Update the support server script for rocky

This commit is contained in:
lumarel 2022-01-30 22:31:48 +01:00 committed by Trevor Cooper
parent 0f7034c00b
commit 101906db67
2 changed files with 13 additions and 13 deletions

View File

@ -434,7 +434,7 @@ sub repos_mirrorlist {
# have not been updated, and the infra repo is rejected as its # have not been updated, and the infra repo is rejected as its
# metadata checksum isn't known to MM # metadata checksum isn't known to MM
my $files = shift; my $files = shift;
$files ||= "/etc/yum.repos.d/fedora*.repo"; $files ||= "/etc/yum.repos.d/Rocky*.repo";
assert_script_run "sed -i -e 's,metalink,mirrorlist,g' ${files}"; assert_script_run "sed -i -e 's,metalink,mirrorlist,g' ${files}";
} }

View File

@ -12,7 +12,7 @@ sub _pxe_setup {
# don't get hung up on slow mirrors when DNFing... # don't get hung up on slow mirrors when DNFing...
repos_mirrorlist; repos_mirrorlist;
# create necessary dirs # create necessary dirs
assert_script_run "mkdir -p /var/lib/tftpboot/fedora"; assert_script_run "mkdir -p /var/lib/tftpboot/rocky";
# basic tftp config # basic tftp config
assert_script_run "printf 'enable-tftp\ntftp-root=/var/lib/tftpboot\ntftp-secure\n' >> /etc/dnsmasq.conf"; assert_script_run "printf 'enable-tftp\ntftp-root=/var/lib/tftpboot\ntftp-secure\n' >> /etc/dnsmasq.conf";
# pxe boot config # pxe boot config
@ -23,7 +23,7 @@ sub _pxe_setup {
# install and configure bootloaders # install and configure bootloaders
my $ourversion = get_var("CURRREL"); my $ourversion = get_var("CURRREL");
my $testversion = get_var("RELEASE"); my $testversion = get_var("RELEASE");
assert_script_run "mkdir -p /var/tmp/fedora"; assert_script_run "mkdir -p /var/tmp/rocky";
my $arch = get_var("ARCH"); my $arch = get_var("ARCH");
if ($arch eq 'x86_64') { if ($arch eq 'x86_64') {
@ -31,15 +31,15 @@ sub _pxe_setup {
assert_script_run "mkdir -p /var/lib/tftpboot/pxelinux.cfg"; assert_script_run "mkdir -p /var/lib/tftpboot/pxelinux.cfg";
# install bootloader packages # install bootloader packages
assert_script_run "dnf -y install syslinux", 120; assert_script_run "dnf -y install syslinux", 120;
assert_script_run "dnf -y --releasever=$ourversion --installroot=/var/tmp/fedora install shim-x64 grub2-efi-x64", 300; assert_script_run "dnf -y --releasever=$ourversion --installroot=/var/tmp/rocky install shim-x64 grub2-efi-x64", 300;
# copy bootloader files to tftp root # copy bootloader files to tftp root
assert_script_run "cp /usr/share/syslinux/{pxelinux.0,vesamenu.c32,ldlinux.c32,libcom32.c32,libutil.c32} /var/lib/tftpboot"; assert_script_run "cp /usr/share/syslinux/{pxelinux.0,vesamenu.c32,ldlinux.c32,libcom32.c32,libutil.c32} /var/lib/tftpboot";
assert_script_run "cp /var/tmp/fedora/boot/efi/EFI/fedora/{shim.efi,grubx64.efi} /var/lib/tftpboot"; assert_script_run "cp /var/tmp/rocky/boot/efi/EFI/rocky/{shim.efi,grubx64.efi} /var/lib/tftpboot";
# bootloader configs # bootloader configs
# BIOS # BIOS
assert_script_run "printf 'default vesamenu.c32\nprompt 1\ntimeout 600\n\nlabel linux\n menu label ^Install Fedora 64-bit\n menu default\n kernel fedora/vmlinuz\n append initrd=fedora/initrd.img inst.ks=file:///ks.cfg ip=dhcp\nlabel local\n menu label Boot from ^local drive\n localboot 0xffff\n' >> /var/lib/tftpboot/pxelinux.cfg/default"; assert_script_run "printf 'default vesamenu.c32\nprompt 1\ntimeout 600\n\nlabel linux\n menu label ^Install Rocky Linux\n menu default\n kernel rocky/vmlinuz\n append initrd=rocky/initrd.img inst.ks=file:///ks.cfg ip=dhcp\nlabel local\n menu label Boot from ^local drive\n localboot 0xffff\n' >> /var/lib/tftpboot/pxelinux.cfg/default";
# UEFI # UEFI
assert_script_run "printf 'function load_video {\n insmod efi_gop\n insmod efi_uga\n insmod ieee1275_fb\n insmod vbe\n insmod vga\n insmod video_bochs\n insmod video_cirrus\n}\n\nload_video\nset gfxpayload=keep\ninsmod gzio\n\nmenuentry \"Install Fedora 64-bit\" --class fedora --class gnu-linux --class gnu --class os {\n linuxefi fedora/vmlinuz ip=dhcp inst.ks=file:///ks.cfg\n initrdefi fedora/initrd.img\n}' >> /var/lib/tftpboot/grub.cfg"; assert_script_run "printf 'function load_video {\n insmod efi_gop\n insmod efi_uga\n insmod ieee1275_fb\n insmod vbe\n insmod vga\n insmod video_bochs\n insmod video_cirrus\n}\n\nload_video\nset gfxpayload=keep\ninsmod gzio\n\nmenuentry \"Install Rocky Linux\" --class rocky --class gnu-linux --class gnu --class os {\n linuxefi rocky/vmlinuz ip=dhcp inst.ks=file:///ks.cfg\n initrdefi rocky/initrd.img\n}' >> /var/lib/tftpboot/grub.cfg";
# DEBUG DEBUG # DEBUG DEBUG
upload_logs "/etc/dnsmasq.conf"; upload_logs "/etc/dnsmasq.conf";
upload_logs "/var/lib/tftpboot/grub.cfg"; upload_logs "/var/lib/tftpboot/grub.cfg";
@ -53,7 +53,7 @@ sub _pxe_setup {
# install a network bootloader to tftp root # install a network bootloader to tftp root
assert_script_run "grub2-mknetdir --net-directory=/var/lib/tftpboot"; assert_script_run "grub2-mknetdir --net-directory=/var/lib/tftpboot";
# bootloader config # bootloader config
assert_script_run "printf 'set default=0\nset timeout=5\n\nmenuentry \"Install Fedora 64-bit\" --class fedora --class gnu-linux --class gnu --class os {\n linux fedora/vmlinuz ip=dhcp inst.ks=file:///ks.cfg\n initrd fedora/initrd.img\n}' >> /var/lib/tftpboot/boot/grub2/grub.cfg"; assert_script_run "printf 'set default=0\nset timeout=5\n\nmenuentry \"Install Rocky Linux\" --class rocky --class gnu-linux --class gnu --class os {\n linux rocky/vmlinuz ip=dhcp inst.ks=file:///ks.cfg\n initrd rocky/initrd.img\n}' >> /var/lib/tftpboot/boot/grub2/grub.cfg";
# DEBUG DEBUG # DEBUG DEBUG
upload_logs "/etc/dnsmasq.conf"; upload_logs "/etc/dnsmasq.conf";
upload_logs "/var/lib/tftpboot/boot/grub2/grub.cfg"; upload_logs "/var/lib/tftpboot/boot/grub2/grub.cfg";
@ -63,9 +63,9 @@ sub _pxe_setup {
# aarch64: use grub2 with 'linux' for UEFI # aarch64: use grub2 with 'linux' for UEFI
# copy bootloader files to tftp root (we just use the system # copy bootloader files to tftp root (we just use the system
# bootloader, no need to install packages) # bootloader, no need to install packages)
assert_script_run "cp /boot/efi/EFI/fedora/{shim.efi,grubaa64.efi} /var/lib/tftpboot"; assert_script_run "cp /boot/efi/EFI/rocky/{shim.efi,grubaa64.efi} /var/lib/tftpboot";
# bootloader config # bootloader config
assert_script_run "printf 'function load_video {\n insmod efi_gop\n insmod efi_uga\n insmod ieee1275_fb\n insmod vbe\n insmod vga\n insmod video_bochs\n insmod video_cirrus\n}\n\nload_video\nset gfxpayload=keep\ninsmod gzio\n\nmenuentry \"Install Fedora 64-bit\" --class fedora --class gnu-linux --class gnu --class os {\n linux fedora/vmlinuz ip=dhcp inst.ks=file:///ks.cfg\n initrd fedora/initrd.img\n}' >> /var/lib/tftpboot/grub.cfg"; assert_script_run "printf 'function load_video {\n insmod efi_gop\n insmod efi_uga\n insmod ieee1275_fb\n insmod vbe\n insmod vga\n insmod video_bochs\n insmod video_cirrus\n}\n\nload_video\nset gfxpayload=keep\ninsmod gzio\n\nmenuentry \"Install Rocky Linux\" --class rocky --class gnu-linux --class gnu --class os {\n linux rocky/vmlinuz ip=dhcp inst.ks=file:///ks.cfg\n initrd rocky/initrd.img\n}' >> /var/lib/tftpboot/grub.cfg";
# DEBUG DEBUG # DEBUG DEBUG
upload_logs "/etc/dnsmasq.conf"; upload_logs "/etc/dnsmasq.conf";
upload_logs "/var/lib/tftpboot/grub.cfg"; upload_logs "/var/lib/tftpboot/grub.cfg";
@ -76,15 +76,15 @@ sub _pxe_setup {
my $kernpath = "images/pxeboot"; my $kernpath = "images/pxeboot";
# for some crazy reason these are in a different place for ppc64 # for some crazy reason these are in a different place for ppc64
$kernpath = "ppc/ppc64" if ($arch eq 'ppc64le'); $kernpath = "ppc/ppc64" if ($arch eq 'ppc64le');
assert_script_run "curl -o /var/lib/tftpboot/fedora/vmlinuz $location/Everything/${arch}/os/${kernpath}/vmlinuz"; assert_script_run "curl -o /var/lib/tftpboot/rocky/vmlinuz $location/BaseOS/${arch}/os/${kernpath}/vmlinuz";
assert_script_run "curl -o /var/lib/tftpboot/fedora/initrd.img $location/Everything/${arch}/os/${kernpath}/initrd.img"; assert_script_run "curl -o /var/lib/tftpboot/rocky/initrd.img $location/BaseOS/${arch}/os/${kernpath}/initrd.img";
# get a kickstart to embed in the initramfs, for testing: # get a kickstart to embed in the initramfs, for testing:
# https://fedoraproject.org/wiki/QA:Testcase_Kickstart_File_Path_Ks_Cfg # https://fedoraproject.org/wiki/QA:Testcase_Kickstart_File_Path_Ks_Cfg
assert_script_run "curl -o ks.cfg https://fedorapeople.org/groups/qa/kickstarts/root-user-crypted-net.ks"; assert_script_run "curl -o ks.cfg https://fedorapeople.org/groups/qa/kickstarts/root-user-crypted-net.ks";
# tweak the repo config in it # tweak the repo config in it
assert_script_run "sed -i -e 's,^url.*,nfs --server 172.16.2.110 --dir /repo --opts nfsvers=4,g' ks.cfg"; assert_script_run "sed -i -e 's,^url.*,nfs --server 172.16.2.110 --dir /repo --opts nfsvers=4,g' ks.cfg";
# embed it # embed it
assert_script_run "echo ks.cfg | cpio -c -o >> /var/lib/tftpboot/fedora/initrd.img"; assert_script_run "echo ks.cfg | cpio -c -o >> /var/lib/tftpboot/rocky/initrd.img";
# chown root # chown root
assert_script_run "chown -R dnsmasq /var/lib/tftpboot"; assert_script_run "chown -R dnsmasq /var/lib/tftpboot";
assert_script_run "restorecon -vr /var/lib/tftpboot"; assert_script_run "restorecon -vr /var/lib/tftpboot";