[ArchLinux]自定义LiveCD镜像

发布于 2018-08-17  40 次阅读


把自己写的程序或者经常用到的程序丢进ISO,自定义LiveCD,方便日后使用。方法如下

环境

系统: Archlinux 2018.08

配置

pacman -Sy
pacman -S squashfs-tools arch-install-scripts cdrtools

下载 Archlinux 镜像

wget  http://mirrors.163.com/archlinux/iso/2018.08.01/archlinux-2018.08.01-x86_64.iso

解压缩 ISO

mkdir /mnt/archiso
mount -t iso9660 -o loop ~/archlinux-2018.08.01-x86_64.iso /mnt/archiso
cp -a /mnt/archiso ~/customiso

修改 LiveCD 系统

cd ~/customiso/arch/x86_64
unsquashfs airootfs.sfs
unsquashfs airootfs.sfs
cp ../boot/x86_64/vmlinuz squashfs-root/boot/vmlinuz-linux
arch-chroot squashfs-root /bin/bash

Chroot 下的操作

  pacman-key --init
  pacman-key --populate archlinux
  exit

加入定制程序

 cp [somefile] ~/customiso/arch/x86_64/squashfs-root/[someplace]

重新打包

rm airootfs.sfs
mksquashfs squashfs-root airootfs.sfs
rm -r squashfs-root
md5sum airootfs.sfs > airootfs.md5
cd ~/customiso/
genisoimage -l -r -J -V "ARCH_201209" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o ../arch-custom.iso ./

注意:ARCH_201209 应该和原光盘LABEL标签相同

References

Arch-Mirror-163

Link