我正在尝试从头开始构建 ubuntu live cd,但无法自动配置网络接口卡。live cd 正在启动到桌面,但 NetworkManager 卡在未配置状态。配置 /etc/network/interfaces 未发生改变,因此应该由 NetworkManager 配置,但事实并非如此。加载桌面环境时,NetworkManager 被禁用且未配置任何连接。
我的配置有什么问题?
为了重现-我如何构建我的 Live CD:
你需要:
apt install build-essential debootstrap squashfs-tools genisoimage syslinux-common syslinux-utils
现在从原始 iso 复制基础系统:
mount -o loop kubuntu-16.10-desktop-amd64.iso /mnt/tmp/
mkdir -p /usr/local/src/custom-ubuntu/iso && cd /usr/local/src/custom-ubuntu/iso
cp -r /mnt/tmp/.disk/ .
cp -r /mnt/tmp/boot/ .
cp -r /mnt/tmp/isolinux/ .
cp -r /mnt/tmp/EFI/ .
mkdir casper
创建迷你 Ubuntu
debootstrap --arch amd64 yakkety /usr/local/src/custom-ubuntu/squashfs
挂载设备并 chroot 到 squashfs
cd /usr/local/src/custom-ubuntu/
mount --bind /dev squashfs/dev
mount -t devpts devpts squashfs/dev/pts
mount -t proc proc squashfs/proc
mount -t sysfs sysfs squashfs/sys
cp /etc/resolv.conf squashfs/etc/
cp /etc/apt/sources.list squashfs/etc/
chroot squashfs
为你的 Live CD 安装你最喜欢的程序。对我来说这是
apt install bash-completion ssh vim gpm htop iotop cifs-utils ntp mc rar unrar unace arj p7zip-full apt-file lsb-release dmidecode hdparm realpath acpid aptitude unzip ncdu di localepurge console-data gnu-fdisk intel-microcode amd64-microcode sysstat bc unattended-upgrades btrfs-progs btrfs-tools hfsplus hfsprogs hfsutils exfat-fuse exfat-utils ntfs-3g gparted gpart gddrescue linux-image-generic linux-signed-generic linux-signed-image-generic linux-firmware linux-base linux-tools-generic linux-wlan-ng linux-headers-generic grub-efi casper lupin-casper ubiquity-casper firefox okular libreoffice libreoffice-kde gtk2-engines-oxygen gtk3-engines-breeze k4dirstat meld partitionmanager gsmartcontrol
apt clean
安装您最喜欢的桌面环境。
离开 chroot 并复制新内核
cp squashfs/boot/initrd.img-4.8.0-27-generic iso/casper/initrd.lz
cp squashfs/boot/vmlinuz-4.8.0-27-generic iso/casper/vmlinuz.efi
卸载并清理:
umount squashfs/dev/pts
umount squashfs/dev
umount squashfs/proc
umount squashfs/sys
rm squashfs/etc/resolv.conf
现在您已完成,是时候构建 squash 文件系统并创建 iso 文件了:
mksquashfs squashfs iso/casper/filesystem.squashfs -noappend
genisoimage -cache-inodes -r -J -joliet-long -input-charset utf-8 -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -o live.iso iso
isohybrid -u live.iso