From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Stefan_Fr=F6berg?= Date: Fri, 25 Jan 2013 00:42:45 +0200 Subject: [Buildroot] Squashfs boot In-Reply-To: <51017295.7020803@mind.be> References: <50FE8914.30909@petroprogram.com> <51017295.7020803@mind.be> Message-ID: <5101B8E5.7050000@petroprogram.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net 24.1.2013 19:42, Arnout Vandecappelle kirjoitti: > On 01/22/13 13:41, Stefan Fr?berg wrote: > [snip] >> My /etc/fstab look like this >> # /etc/fstab: static file system information. >> # >> # >> /modules.sqfs /lib/modules squashfs >> defaults,auto,loop,noatime 0 0 >> /firmware.sqfs /lib/firmware squashfs >> defaults,auto,loop,noatime 0 0 >> /dev/cdrom /mnt/cdrom iso9660 defaults,noatime >> 0 0 >> /mnt/cdrom/usr.sqfs /mnt/ro squashfs >> defaults,auto,loop,noatime 0 0 > > Now this is a real use case for being able to split the rootfs into > several parts. > > However, as Thomas mentioned, it's simpler to just use a complete > squashfs rootfs and put the unionfs on top of that. How? Somewhere > early in your init.d you put something like the following (a script I > swiped from the internet, don't remember where from; I haven't > actually tested it myself): > > #!/bin/sh > > CHROOT_PATH="/tmp/unionfs" > UNION_OPT="-o > allow_other,use_ino,suid,dev,nonempty,chroot=$CHROOT_PATH,max_files=32768" > > #mount -t proc proc /proc > #mount -t tmpfs tmpfs /tmp > > mkdir -p $CHROOT_PATH/root > mkdir -p $CHROOT_PATH/rw > mkdir -p /tmp/union > > # Mount the filesystems > mount --bind / $CHROOT_PATH/root > # $CHROOT_PATH/rw is already on a tmpfs so doesn't need to be mounted > > modprobe fuse > $CHROOT_PATH/root/usr/bin/unionfs $UNION_OPT /rw=RW:/root=RO /tmp/union > > #mount -t proc proc /tmp/union/proc > > cd /tmp/union > mkdir oldroot > pivot_root . oldroot > cd / > > # Move existing mounts, if any > #umount /proc > mount --move /oldroot/proc /proc > mount --move /oldroot/dev /dev > mount --move /oldroot/sys /sys > mount --move /oldroot/tmp /tmp > rmdir /tmp/union > That looks very interesting Arnout. If that works then I will own you a whiskey bottle :-) Stefan