以前,我通过将ISO提取到NFS挂载,并使用iPXE脚本魔术将vmlinuz.efi和initrd.gz从casper复制到tftpboot目录中,来设置Ubuntu LiveCD的PXE引导。
对于16.04、16.10和17.10(有效),此功能完美运行。
在18.04中,我首先发现caslin中不再存在vmlinuz.efi,但是vmlinuz确实存在。所以,我再次尝试更改名称...
现在它仍然无法完成启动。我得到了“紧急模式”。键入“ journalctl -xb”(如紧急模式提示所建议)并浏览会导致以下结果:
Unit sys-fs-fuse-connections has begun starting up.
ubuntu systemd[1]: Failed to set up mount unit: Device or resource busy
ubuntu systemd[1]: Failed to set up mount unit: Device or resource busy
sys-kernel-config.mount: Mount process finished, but there is no mount.
sys-kernel-config.mount: Failed with result 'protocol'.
Failed to mount Kernel Configuration File System.
救命!
新增2018-04-30:
用于提取ISO以进行PXE挂载的脚本代码(TARGET设置为映像名称,例如仿生):
set -e
# Look for bionic.iso as the ISO I am going to extract.
TARGET=invalid.iso
[ -f bionic.iso ] && TARGET=bionic
echo TARGET=$TARGET
# Mount the ISO to the /tmp directory
sudo rm -rf /var/nfs/$TARGET/*
sudo rm -rf /tmp/$TARGET
mkdir /tmp/$TARGET
sudo mount -o loop ~/$TARGET.iso /tmp/$TARGET
# Clear up the NFS directory where things will be copied (and copy them)
sudo rm -rf /var/nfs/$TARGET
sudo mkdir /var/nfs/$TARGET
sudo rsync -avH /tmp/$TARGET/ /var/nfs/$TARGET
# I've not had luck with iPXE changing filesystems to find
# vmlinuz, vmlinuz.efi, or initrd.gz... so I copy those files
# specifically to the tftp directory structure so the boot loader
# can load them.
sudo rm -rf /var/lib/tftpboot/$TARGET
sudo mkdir /var/lib/tftpboot/$TARGET
sudo cp /tmp/$TARGET/casper/vmlinuz* /var/lib/tftpboot/$TARGET/.
sudo cp /tmp/$TARGET/casper/initrd.lz /var/lib/tftpboot/$TARGET/.
# Cleanup: unmount the ISO and remove the temp directory
sudo umount /tmp/$TARGET/
sudo rm -rf /tmp/$TARGET/
echo Done.