使用不同内核版本的 Ubuntu iso 定制,启动画面混乱

使用不同内核版本的 Ubuntu iso 定制,启动画面混乱

按照此线 我正在尝试基于 ubuntu Bionic Beaver 构建定制的 ubuntu iso:

129292a182136a35e1f89c586dbac2e2  ubuntu-18.04-desktop-amd64.iso

我遵循了本教程:https://help.ubuntu.com/community/LiveCDCustomization 我 chroot 到解压的 squashfs 并安装了一些我想要的 debian 数据包,从 下载了一个新内核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

当使用 virtualbox 启动时,我可以看到 ubuntu 的加载屏幕,然后可以看到 ubuntu 加载的日志,但是屏幕是乱码的。首先: 加载乱码

过了一会儿,屏幕变成了这样: 屏幕乱码

我尝试过解决方案,变为iso/boot/grub/grub.cfg

if loadfont /boot/grub/font.pf2 ; then
    set gfxmode=1280*1024
    insmod efi_gop
    insmod efi_uga
    insmod gfxterm
    terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

set timeout=5
menuentry "Try Ubuntu without installing" {
    set gfxpayload=keep
    linux   /casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash nomodeset video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap ---
    initrd  /casper/initrd.lz
}
menuentry "Install Ubuntu" {
    set gfxpayload=keep
    linux   /casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash nomodeset video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap ---
    initrd  /casper/initrd.lz
}
menuentry "OEM install (for manufacturers)" {
    set gfxpayload=keep
    linux   /casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash nomodeset video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap oem-config/enable=true ---
    initrd  /casper/initrd.lz
}
menuentry "Check disc for defects" {
    set gfxpayload=keep
    linux   /casper/vmlinuz  boot=casper integrity-check quiet splash nomodeset video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap ---
    initrd  /casper/initrd.lz
}

屏幕仍然是乱码,但是方式不同:

屏幕乱码 2

答案1

我设法让它与这个配置工作iso/boot/grub/grub.cfg

if loadfont /boot/grub/font.pf2 ; then
        set gfxmode=1280*1024
        insmod efi_gop
        insmod efi_uga
        insmod gfxterm
        terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

set timeout=5
menuentry "Try Ubuntu without installing" {
        set gfxpayload=keep
        linux   /casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper  nomodeset video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap ---
        initrd  /casper/initrd.lz
}
menuentry "Install Ubuntu" {
        set gfxpayload=keep
        linux   /casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity  nomodeset video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap ---
        initrd  /casper/initrd.lz
}
menuentry "OEM install (for manufacturers)" {
        set gfxpayload=keep
        linux   /casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity  nomodeset video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap oem-config/enable=true ---
        initrd  /casper/initrd.lz
}
menuentry "Check disc for defects" {
        set gfxpayload=keep
        linux   /casper/vmlinuz  boot=casper integrity-check  nomodeset video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap ---
        initrd  /casper/initrd.lz
}

相关内容