Description of problem: ks文件适配X86物理服务器ISO镜像报repodata源异常无法自动安装,会停在anaconda的软件源选择text或GUI(不同型号服务器症状不同)画面, “Installation Source”、“Kernel selection”以及“Software selection”显示未配置的高级,anaconda GUI 界面下显示黄色叹号/ text界面下Installation 8个配置项中上述三个显示叹号 Version-Release number of selected component (if applicable): 镜像版本:AnolisOS8.8-minimal版本 系统版本: [root@localhost network-scripts]# cat /etc/*-release Anolis OS release 8.8 NAME="Anolis OS" VERSION="8.8" ID="anolis" ID_LIKE="rhel fedora centos" VERSION_ID="8.8" PLATFORM_ID="platform:an8" PRETTY_NAME="Anolis OS 8.8" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" 内核版本: Anolis OS release 8.8 [root@localhost network-scripts]# uname -r 5.10.134-13.an8.x86_64 How reproducible: 服务器型号:Inspur X86_64 server Model SA5280M6 将ks文件放入ISO解压开的镜像文件夹中 isolinux/目录下,genisoimage指令重新压缩制作镜像 Steps to Reproduce: 1.编写如下ks文件: text #graphical ## Added by YG 20231030 reboot logging --level=info #cdrom #ignoredisk --only-use=sda #bootloader --location=mbr lang en_US.UTF-8 timezone America/New_York --isUtc keyboard --vckeymap=us --xlayouts='us' ## Added by YG 20231030 skipx #user --name anuser --iscrypted --password=$6$Do1gUtQq9jOvp.ux$zZfN2joEpG0IiApeNkJI/12EbW7P0Q0MHz.LRIBnTpUNTqIpKtn7lSdRqtcC/3FAI2UZdyzBmY5uyjjcCJWAe1 --groups=sudo #rootpw --iscrypted thereisnopasswordanditslocked --lock rootpw "alibaba1688" network --bootproto=dhcp --device=link --activate --onboot=on network --hostname=localhost.localdomain services --enabled="chronyd" firewall --disabled selinux --disabled firstboot --disable #repo --name="BaseOS" --baseurl=file:///run/install/repo/BaseOS --cost=100 #repo --name="BaseOS" --baseurl=cdrom:sr0 --cost=100 bootloader --location=mbr --boot-drive=sda zerombr clearpart --all --initlabel reqpart part /boot/efi --fstype=efi --ondisk=sda --size=512 part /boot --fstype=ext4 --ondisk=sda --size=1024 part swap --fstype=swap --ondisk=sda --size=2048 part / --fstype=ext4 --grow --size=10240 --mkfsoptions="-O ^64bit,^metadata_csum" --ondisk=sda --asprimary repo --name="Minimal" --baseurl=file:///run/install/sources/mount-0000-cdrom/Minimal %packages @^server-product-environment bpftool-5.10.134 kernel-5.10.134 kernel-devel-5.10.134 kernel-headers-5.10.134 kernel-tools-5.10.134 kexec-tools perf-5.10.134 python3-perf-5.10.134 -bpftool-4.18.0 -bpftool-4.19.91 -kernel-4.18.0 -kernel-4.19.91 -kernel-devel-4.18.0 -kernel-devel-4.19.91 -kernel-headers-4.18.0 -kernel-headers-4.19.91 -kernel-tools-4.18.0 -kernel-tools-4.19.91 -perf-4.18.0 -perf-4.19.91 -python3-perf-4.18.0 -python3-perf-4.19.91 #@base #@core #gcc #ssh #wget #curl #telnet #sysstat #ntp #grub2-pc #grub2-efi-x64 #shim #grubby #kernel-5.10.134 %end %addon com_redhat_kdump --enable --reserve-mb='auto' %end %anaconda pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty %end %post mkdir -p /etc/dracut.conf.d echo 'add_drivers+=" nvme "' >>/etc/dracut.conf.d/nvme.conf mkinitrd -f \ --with=nvme --preload=nvme \ /boot/initramfs-$($KERNEL_VERSION).img $(KERNEL_VERSION) sed -i '/^root/ a\anuser ALL=(ALL) ALL' /etc/sudoers sed -i 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config %end 2.将上述ks放置到ISO mount之后的镜像制作目录的 isolinux/目录下,服务器是使用EFI模式启动的, /EFI/BOOT/grub.cfg文件对应做如下修改: menuentry 'Install Anolis OS 8' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/pxeboot/vmlinuz-5.10.134-13.an8.x86_64 inst.stage2=hd:LABEL=anolis-8-x86_64-dvd inst.ks=cdrom:/isolinux/ks.cfg quiet initrdefi /images/pxeboot/initrd-5.10.134-13.an8.x86_64.img } menuentry 'Install Anolis OS 8 in compatible mode' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/pxeboot/vmlinuz-4.18.0-372.32.1.an8_6.x86_64 inst.stage2=hd:LABEL=anolis-8-x86_64-dvd inst.ks=cdrom:/isolinux/ks.cfg quiet initrdefi /images/pxeboot/initrd-4.18.0-372.32.1.an8_6.x86_64.img } menuentry 'Test this media & install Anolis OS 8' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/pxeboot/vmlinuz-5.10.134-13.an8.x86_64 inst.stage2=hd:LABEL=anolis-8-x86_64-dvd inst.ks=cdrom:/isolinux/ks.cfg rd.live.check quiet initrdefi /images/pxeboot/initrd-5.10.134-13.an8.x86_64.img } 3.如下指令将镜像打包: genisoimage -v -cache-inodes -joliet-long -R -J -T -V anolis-8-x86_64-dvd -o AnolisOS-8.8-5.10.134-2023-11-06-1750.iso -input-charset utf-8 -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -allow-limited-size -eltorito-alt-boot -b images/efiboot.img -no-emul-boot /data/home/zld/data/1.iso/AnolisOS/mini/ Actual results: 报 “Installation Source”、“Kernel selection”以及“Software selection”未配置的告警, 安装阻塞 Expected results: 正常安装,屏幕上出现每一个包的installing过程 Additional info: 手工可以正常安装,参考如下链接, https://docs.centos.org/en-US/8-docs/advanced-install/assembly_creating-kickstart-files/ 直接使用手工安装后系统的/root/anaconda-ks.cfg文件作为ks.cfg按照上述方案整合在镜像中使用,仍然报相同错误
分析了一下anaconda源码, file:///run/install/sources/mount-0000-cdrom/Minimal 是手工本地安装时,repo源挂载到的位置 ks安装的话,repo还是自动挂载到file:///run/install/repo/xxx下的 另外,centos8/redhat8有人反馈类似问题: https://unix.stackexchange.com/questions/603848/centos8-pxeboot-error-setting-up-software-source https://bugzilla.redhat.com/show_bug.cgi?id=1914955
使用CentOS8尝试,也复现问题,并且在卡住的界面下alt+cmd+F2切换到安装过程无盘系统的shell,发现 file:///run/install/repo/下 有BaseOS无Minimal
纠正一下上一条,有BaseOS无AppStream,而AppStream确实是我自己做实验手工去掉的。后续尝试加回AppStream的完整镜像,以及centos的minimal镜像
使用10G左右的完整版本镜像,在卡住的界面下alt+cmd+F2切换到安装过程无盘系统的shell,发现存在AppStream和BaseOS, 但是参考如下两个链接: https://unix.stackexchange.com/questions/603848/centos8-pxeboot-error-setting-up-software-source https://almalinux.discourse.group/t/error-setting-up-software-source/523/6 参考第一个链接同时追加所有存在的repo源,并且参考上述第二个链接的建议追加反斜杠和双引号,ks文件里面写: repo --name="BaseOS" --baseurl="file:///run/install/repo/BaseOS/" repo --name="AppStream" --baseurl="file:///run/install/repo/AppStream/" 仍然无效,症状相同。
参考如下链接: https://access.redhat.com/discussions/5362161 将两句repo语句修改为: url --url="file:///run/install/repo/Minimal/" url --url="file:///run/install/repo/BaseOS/" 问题解决