You are not logged in.
Pages: 1
dear arch-experts:
I am trying to create a system where /boot is /dev/sda1 (vfat EFI boot), and my rw root partition (in rw form, at /dev/sda2) is to be replaced by a /boot/root.sqfs (eventually, I want a test for existence first, but I am starting without it). my starting system boots and works nicely. here is what I am doing:
first, I add the string squashfs to the MODULES in /etc/mkinitcpio.conf .
second, I create my root copy
mksquashfs / /boot/root.sqfs -e /boot/ -e /proc/ -e /sys/ -e /dev/ -e /run/
with some xattr errors that I think I can ignore. for good order, I make a backup copy of /root.sqfs in /boot/live/ .
now, I wonder if this is correct. first, I wonder if /proc /sys /dev and /run need to exist as (empty) directories, and not be excluded, which is what I have now. (a disk-mount requires a directory to exist. does a special mount?) second, I need to update the /etc/fstab to reflect that the root partition will be different. what goes in the left-most column here? this is like a "ram" device (and I want to unmount /boot/ after this stage). so, the file-system location of /boot/root.sqfs won't be on my system after the initial boot step anyway.
eventually, the missing directories and changed fstab could be overcome by copying the root partition fully somewhere, changing the fstab and making four empty directories, and then doing a mksquashfs on the copy. this would seem rather cumbersome for replacing one file with another during the mksquashfs.
third, I update my EFI boot manager,
efibootmgr -d /dev/sda -p 1 -c -L "ARCH-RO" -l vmlinuz-linux -u "boot=live toram=root.sqfs ro initrd=/initramrfs-linux.img"
probably not surprisingly to someone who knows what I am missing, I get a failed boot, with some wishes of luck along the way. alas, to me, it seems
Last edited by iaw4 (2014-12-23 05:42:22)
Offline
the following is what I roughly figured out. first, I needed to change the default_mount_handler in /usr/lib/init_functions to
mkdir /boot
mount -t vfat /dev/sda1 /boot
cp /boot/root.sqfs /dev/ram1
umount /boot
and change the mount in the same function below to
if ! mount -t squashfs -o ro /dev/ram1 "$1"; then
and then I included
MODULES="squashfs fat vfat loop"
as modules in /etc/mkinitcpio.conf .
then, run mkinitcpio -p linux and check that the resulting initramfs-linux.img contains the modifications. I do this via an inelegant
zcat /boot/initramfs-linux.img | cpio -id
and then hand-inspection. (A fuse filesystem would do this better, but I don't know how to do this.) the /etc/fstab on the new ro volume needs to be
/dev/loop1 / ro 0 1
and make sure that you created (empty) directories in /dev, /sys, and /run.
it may not be the right way to do this, but it works.
Last edited by iaw4 (2014-12-24 05:54:50)
Offline
then, run mkinitcpio -p linux and check that the resulting initramfs-linux.img contains the modifications. I do this via an inelegant
zcat /boot/initramfs-linux.img | cpio -id
and then hand-inspection.
Check out lsinitcpio. It is included with the mkinitcpio package.
(A fuse filesystem would do this better, but I don't know how to do this.).
With the 3.18 kernel, OverlayFS has been merged into mainline. I'm not sure if that is what you are looking for though...
Offline
lsinitcpio -x seems to do the same thing as my zcat pipe. I wanted to be able to get the equivalent of a catinitcpio---that is, look at the contents of one file within the initrd.
Offline
Pages: 1