[Buildroot] Squashfs boot

Stephen Turner artic.knight31337 at gmail.com
Sun Jan 27 07:13:17 UTC 2013


Thats what i was hoping to not have to do but i appreciate you sharing that
very much. I will try it that way and see if i like it. Everyone has been
very helpful thanks for all your input.

Stephen
On Jan 26, 2013 5:38 PM, "Arnout Vandecappelle" <arnout at mind.be> wrote:

> On 01/25/13 22:55, Stefan Fröberg wrote:
>
>> Hello Stephen
>>
>> I made a quick conversion of my LiveCD initramfs stuff to squashfs image
>> file and then played little bit with it and kernel image
>> with the help of qemu. (took less time than starting all
>> reconfiguring/combiling from buildroot)
>>
>> The good news is that yes, it should be doable to do boot directly from
>> squashfs root image.
>>
>> For example I did this to start it (ramdisk_size is in kilobytes):
>>
>> qemu-system-i386 -kernel bzImage -initrd rootfs.sqfs -append
>> "ramdisk_size=131072"
>>
>> It first tries to unpack rootfs as initramfs and then it notices that
>> it's not initramfs but traditional,
>> older version of initrd file. (please see root.png).
>>
>> After that it should print RAMDISK: squashfs filesystem found and start
>> automatically loading it to ram.
>> (please see root2.png)
>>
>> After that it continues normally and starts the normal init process.
>>
>> And now the bad news:
>>
>> - Takes a lot of memory. This is old style initrd stuff (time when 2.4
>> kernel was still hot and new).
>>
>
>  Yes, using squashfs as initrd is probably not what you want: it will load
> the entire squashfs into memory (albeit compressed), and then copy it (and
> decompress) when you access it.
>
>  The typical way to use squashfs is as a partition of your disk. So if
> you'd boot from a USB stick, you'd make two partitions: an ext2 for grub
> and the kernel, and a second one for the squashfs. To install it, just do
> "cat output/images/rootfs.sqfs > /dev/sdb2" (assuming your USB key is
> /dev/sdb and squashfs is the second partition). When booting, you append
> the following the kernel command line: "root=/dev/sda2 rootwait" (assuming
> there's no hard disk or anything so the USB key will end up as /dev/sda).
>
>
>  - Squashfs is read-only so if you use mdev or udev then expect little
>> troubles (please see root3.png).
>>
>> However maybe buildroot init already takes care of those ????
>>
>
>  Copy fs/cpio/init to output/target/init and all will be well.
>
>
>  Regards,
>  Arnout
>
> [snip]
>
> --
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/**arnoutvandecappelle<http://www.linkedin.com/in/arnoutvandecappelle>
> GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130127/38c93c85/attachment-0001.html>


More information about the buildroot mailing list