i emerge dracut with DRACUT_MODULES="plymouth dmsquash-live dm lvm" and USE flags="device-mapper "
and inside the chrooted system i run
#dracut -m "base lvm kernel-modules" -a "dmsquash-live" --filesystems "squashfs" -f
This is ganerate the initramfs in /boot
We must have a kernel with lvm support and the LVM kernel extension to permit snapshotting
outside of chrooted enviroment.
we have the directory /diskless/squashfs (contains the rootfs)
we make a folder name LiveOS indside of a folder LiveOS
#mkdir-p /diskless/LiveOS/LiveOS
then go to the directory LiveOS/LiveOS
#cd /diskless/LiveOS/LiveOS
we create an EXT3 image
#dd if=/dev/zero of=ext3fs.img bs=1M count=4096
#mkfs.ext3 ext3fs.img
we create a directory to mount the ext3fs.img
#mkdir -p /diskless/ext3
mount the ext3fs.img to directory
#cd /diskless
mount LiveOS/LiveOS/ext3fs.img ext3/
and then we copy the contents of squashfs-root to ext3 folder
#rsync -avHx squashfs/ --exclude='usr/src/*' ext3
umount the ext3fs.img of ext3/
#umount ext3
go outside of first LiveOS folder
#cd /diskless
make squashfs image
#mksquashfs LiveOS/ squashfs.img
I assume that we have a usb stick formated with fat32 ,and the label of that is " LABEL=live" ,with installed grub or grub2 (personaly i use grub2 with EFI,)
in the /boot folder of usb, we put the initramfs image generated by dracut ,and the kernel for the squashfs-root
the grub kernel command is like that:
/boot/vmlinux-3.3.8-gentoo root=live:LABEL=live ro rd.live.image
Also you can use UUID=aaaa-bbbb instead LABEL="label of usb"
At the usb stick we create the directory /LiveOS and we copy there the squashfs.img
lets assume that the usb is mounted at /mnt/usb
#mkdir /mnt/usb/LiveOS
# cp /diskless/squashfs.img /mnt/usb/LiveOS
if you want to take the advantage of plymouth ,just add in the kernel command the splash or rhgb
/boot/vmlinux-3.3.8-gentoo root=live:LABEL=live ro rd.live.image splash
devsk am waiting your results , i am facing problems with the plymouth (only when is enabled in kernel cmd ) at the shutdown-reboot ,i think that something go wrong with the plymouth-openrc-plugin
(and sorry for my poor english....)
Elpizw o Theos na sas xarizei eutixia...................