使用不同内核版本的Ubuntu iso定制,挂起在initramfs上

我正在尝试基于ubuntu Bionic Beaver构建一个定制的ubuntu iso:

129292a182136a35e1f89c586dbac2e2 ubuntu-18.04-desktop-amd64.iso 

我遵循了这个教程: https://help.ubuntu.com/community/LiveCDCustomizationhttps://help.ubuntu.com/community/LiveCDCustomization我chrooted到提取的squashfs并安装了我想要的一些debian数据包,从http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15.3/下载了一个新内核http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15.3/ ,启动了mkinitramfs -o /initrd.gz 4.15.3-041503-generic命令。

然后我使用以下命令重建iso:

 sudo rm -f iso/casper/vmlinuz iso/casper/initrd.lz sudo cp squashfs/boot/vmlinuz-4.15.3-041503-generic iso/casper/vmlinuz sudo cp squashfs/initrd.gz iso/casper/initrd.lz sudo chmod a+w iso/casper/filesystem.manifest sudo chroot squashfs dpkg-query -W --showformat='${Package} ${Version}\n' > iso/casper/filesystem.manifest sudo chmod go-w iso/casper/filesystem.manifest sudo rm iso/casper/filesystem.squashfs cd squashfs sudo mksquashfs . ../iso/casper/filesystem.squashfs -info cd .. cd iso sudo bash -c "find . -path ./isolinux -prune -o -type f -not -name md5sum.txt -print0 | xargs -0 md5sum | tee md5sum.txt" cd .. sudo mkisofs -r -V "my_custom_iso" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o custom-livecd.iso iso sudo isohybrid custom-livecd.iso 

我试图在新创建的iso上启动virtualbox,它似乎工作,因为我可以看到ubuntu加载的启动画面,但然后它挂起在initramfs shell上: initramfs的

这是消息的代码 :

  # Confirm the final format was valid. if [ "${UNIONFS}" != "unionfs-fuse" ]; then modprobe "${MP_QUIET}" -b "${UNIONFS}" || true if cut -f2 /proc/filesystems | grep -q "^${UNIONFS}\$"; then : else panic "/cow format specified as ${UNIONFS} and no support found" fi fi 
  • 第一IF总是如此。
  • 第二个IF:如果在/ proc / filesystems错误通知中找不到union-fs。
  • 基本上你缺少一个叠加层
  • 似乎是Casper 1.34+中的一个错误

修复 :

  • 编辑/shared/livecd/work/rootfs/etc/initramfs-tools/modules
  • 添加overlay.ko
  • 运行update-initramfs -u -k $(uname -r)