要获得带有squashfs文件系统的工作系统:
sudo apt-get install live-boot live-boot-initramfs-tools extlinux
sudo update-initramfs -u
从引导或运行的ubuntu文件系统创建一个squashfs文件,其中包含您想要的任何可用软件包。https://help.ubuntu.com/community/LiveCDCustomizationFromScratch 为创建要构建的去引导系统提供了很好的说明。使用ext2/3/4格式化目标驱动器并启用可引导标志。在目标驱动器上创建文件夹布局并安装extlinux:
mkdir -p ${TARGET}/boot/extlinux ${TARGET}/live
extlinux -i ${TARGET}/boot/extlinux
dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdX #X is the drive letter
cp /boot/vmlinuz-$(uname -r) ${TARGET}/boot/vmlinuz
cp /boot/initrd.img-$(uname -r) ${TARGET}/boot/initrd
cp filesystem.squashfs ${TARGET}/live
创建${TARGET}/boot/extlinux/extlinux.conf,内容如下:
DEFAULT Live
LABEL Live
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd boot=live toram=filesystem.squashfs
TIMEOUT 10
PROMPT 0
现在,您应该能够从目标驱动器引导到解压的系统。