要获得带有 squashfs 文件系统的工作系统:
sudo apt-get install live-boot live-boot-initramfs-tools extlinux
sudo update-initramfs -u
Run Code Online (Sandbox Code Playgroud)
从引导或运行的 ubuntu 文件系统创建一个 squashfs 文件,其中包含您想要的任何可用包。 https://help.ubuntu.com/community/LiveCDCustomizationFromScratch提供了很好的说明,用于创建要在其上构建的 debootstrapped 系统。使用 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
Run Code Online (Sandbox Code Playgroud)
使用以下内容创建 ${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
Run Code Online (Sandbox Code Playgroud)
现在您应该能够从目标驱动器启动到您的压缩系统。
归档时间: |
|
查看次数: |
44342 次 |
最近记录: |