UNCLASSIFIED - NO CUI

Skip to content

LEVIATHAN-13: Add script to build a TFTP netboot archive for a given operating system

General MR

Summary

This MR creates a tool to create a netboot archive for a given operating system defined in a JSON file. The only two definitions currently offered are RHEL 10.0 and 9.6 for aarch64. The process supports EFI and BIOS boot methods, assuming the source ISO image has the requisite files for both. This should work the same with other recent redhat versions. Other OS versions can be supported by adding additional build_${osname}_BIOS and build_${osname}_EFI functions.

ISO images are not stored as part of this MR. It is up to the user to source their own ISO images. The JSON files provide the name of an ISO image but don't provide a URI, it's up to the implementation to know where to source their ISO images from.

Relevant logs/screenshots

Building a RHEL 9.6 aarch64 BIOS netboot archive:

$ bash ./build.sh os_descriptors/rhel-9.6-aarch-bios.iso dist/          
/dev/disk5                                              /Users/andrewkesterson/source/repo1.dso.mil/big-bang/customers/airgap/netboot_builder/n
etbootmountervZwM/RHEL-9-6-0-BaseO
./tftpboot               
./tftpboot/cat.c32       
./tftpboot/chain.c32   
./tftpboot/cmd.c32  
./tftpboot/cmenu.c32    
./tftpboot/config.c32   
./tftpboot/cptime.c32    
./tftpboot/cpu.c32       
./tftpboot/cpuid.c32
./tftpboot/cpuidtest.c32
./tftpboot/debug.c32    
./tftpboot/dhcp.c32    
./tftpboot/dir.c32       
./tftpboot/disk.c32              
./tftpboot/dmi.c32         
./tftpboot/dmitest.c32                                                 
./tftpboot/elf.c32                                                     
./tftpboot/ethersel.c32
./tftpboot/gfxboot.c32                                                 
./tftpboot/gpxecmd.c32
./tftpboot/hdt.c32                                                                                                           12:00:01 [80/1932]
./tftpboot/hexdump.c32
./tftpboot/host.c32
./tftpboot/ifcpu.c32
./tftpboot/ifcpu64.c32
./tftpboot/ifmemdsk.c32
./tftpboot/ifplop.c32
./tftpboot/kbdmap.c32
./tftpboot/kontron_wdt.c32
./tftpboot/ldlinux.c32
./tftpboot/lfs.c32
./tftpboot/libcom32.c32
./tftpboot/libgpl.c32
./tftpboot/liblua.c32
./tftpboot/libmenu.c32
./tftpboot/libutil.c32
./tftpboot/linux.c32
./tftpboot/lpxelinux.0
./tftpboot/ls.c32
./tftpboot/lua.c32
./tftpboot/mboot.c32
./tftpboot/memdisk
./tftpboot/meminfo.c32
./tftpboot/menu.c32
./tftpboot/pci.c32
./tftpboot/pcitest.c32
./tftpboot/pmload.c32
./tftpboot/poweroff.c32
./tftpboot/prdhcp.c32
./tftpboot/pwd.c32
./tftpboot/pxechn.c32
./tftpboot/pxelinux.0
./tftpboot/reboot.c32
./tftpboot/rosh.c32
./tftpboot/sanboot.c32
./tftpboot/sdi.c32
./tftpboot/sysdump.c32
./tftpboot/syslinux.c32
./tftpboot/vesa.c32
./tftpboot/vesainfo.c32
./tftpboot/vesamenu.c32
./tftpboot/vpdtest.c32
./tftpboot/whichsys.c32
./tftpboot/zzjson.c32
2196 blocks
a .
a ./syslinux-tftpboot-6.04-0.20.el9.noarch.rpm
a ./images
a ./pxelinux
a ./redhat
a ./tftpboot
a ./tftpboot/ifcpu.c32
a ./tftpboot/mboot.c32
a ./tftpboot/disk.c32
a ./tftpboot/libcom32.c32
a ./tftpboot/dhcp.c32
a ./tftpboot/ldlinux.c32
a ./tftpboot/rosh.c32
a ./tftpboot/prdhcp.c32
a ./tftpboot/libmenu.c32
a ./tftpboot/gfxboot.c32
a ./tftpboot/meminfo.c32
a ./tftpboot/whichsys.c32
a ./tftpboot/ifmemdsk.c32
a ./tftpboot/libgpl.c32
a ./tftpboot/pwd.c32
a ./tftpboot/sanboot.c32
a ./tftpboot/vpdtest.c32
a ./tftpboot/vesainfo.c32
a ./tftpboot/syslinux.c32
a ./tftpboot/cat.c32
a ./tftpboot/menu.c32
a ./tftpboot/dmitest.c32
a ./tftpboot/elf.c32
a ./tftpboot/cmd.c32
a ./tftpboot/vesa.c32
a ./tftpboot/lpxelinux.0
a ./tftpboot/ifplop.c32
a ./tftpboot/gpxecmd.c32
a ./tftpboot/hdt.c32
a ./tftpboot/libutil.c32
a ./tftpboot/cpuidtest.c32
a ./tftpboot/kontron_wdt.c32
a ./tftpboot/pci.c32
a ./tftpboot/pxelinux.0
a ./tftpboot/dir.c32
a ./tftpboot/chain.c32
a ./tftpboot/kbdmap.c32
a ./tftpboot/liblua.c32
a ./tftpboot/ethersel.c32
a ./tftpboot/pmload.c32
a ./tftpboot/sdi.c32
a ./tftpboot/linux.c32
a ./tftpboot/lfs.c32
a ./tftpboot/config.c32
a ./tftpboot/ifcpu64.c32
a ./tftpboot/debug.c32
a ./tftpboot/lua.c32
a ./tftpboot/cpu.c32
a ./tftpboot/vesamenu.c32
a ./tftpboot/pxechn.c32
a ./tftpboot/sysdump.c32
a ./tftpboot/cmenu.c32
a ./tftpboot/poweroff.c32
a ./tftpboot/cpuid.c32
a ./tftpboot/memdisk
a ./tftpboot/dmi.c32
a ./tftpboot/pcitest.c32
a ./tftpboot/reboot.c32
a ./tftpboot/zzjson.c32
a ./tftpboot/hexdump.c32
a ./tftpboot/ls.c32
a ./tftpboot/host.c32
a ./tftpboot/cptime.c32
a ./pxelinux/pxelinux.0
a ./pxelinux/pxelinux.cfg
a ./pxelinux/pxelinux.cfg/default
a ./images/RHEL-9.6-aarch64
a ./images/RHEL-9.6-aarch64/initrd.img
a ./images/RHEL-9.6-aarch64/vmlinuz 
"disk5" ejected.

$ tar -zvtf dist/redhat-9.6-aarch64-1.tgz                                                                                                      
drwx------  0 andrewkesterson staff       0 Jul  2 12:00 ./                                                                                    
-r--r--r--  0 andrewkesterson staff  487368 Jul  2 12:00 ./syslinux-tftpboot-6.04-0.20.el9.noarch.rpm
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:00 ./images/                                                                             
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:00 ./pxelinux/                                                                           
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:00 ./redhat/                                                                             
drwxr-xr-x  0 andrewkesterson staff       0 Aug  3  2022 ./tftpboot/                                                                           
-rw-r--r--  0 andrewkesterson staff    4192 Aug  3  2022 ./tftpboot/ifcpu.c32
-rw-r--r--  0 andrewkesterson staff   11012 Aug  3  2022 ./tftpboot/mboot.c32
-rw-r--r--  0 andrewkesterson staff    2028 Aug  3  2022 ./tftpboot/disk.c32  
-rw-r--r--  0 andrewkesterson staff  179456 Aug  3  2022 ./tftpboot/libcom32.c32
-rw-r--r--  0 andrewkesterson staff    4112 Aug  3  2022 ./tftpboot/dhcp.c32 
-rw-r--r--  0 andrewkesterson staff  115844 Aug  3  2022 ./tftpboot/ldlinux.c32
-rw-r--r--  0 andrewkesterson staff   14016 Aug  3  2022 ./tftpboot/rosh.c32
-rw-r--r--  0 andrewkesterson staff    3144 Aug  3  2022 ./tftpboot/prdhcp.c32  
-rw-r--r--  0 andrewkesterson staff   24040 Aug  3  2022 ./tftpboot/libmenu.c32
-rw-r--r--  0 andrewkesterson staff   10520 Aug  3  2022 ./tftpboot/gfxboot.c32
-rw-r--r--  0 andrewkesterson staff    2488 Aug  3  2022 ./tftpboot/meminfo.c32
-rw-r--r--  0 andrewkesterson staff    2556 Aug  3  2022 ./tftpboot/whichsys.c32
-rw-r--r--  0 andrewkesterson staff    4324 Aug  3  2022 ./tftpboot/ifmemdsk.c32
-rw-r--r--  0 andrewkesterson staff   67956 Aug  3  2022 ./tftpboot/libgpl.c32
-rw-r--r--  0 andrewkesterson staff    1504 Aug  3  2022 ./tftpboot/pwd.c32
-rw-r--r--  0 andrewkesterson staff    1640 Aug  3  2022 ./tftpboot/sanboot.c32
-rw-r--r--  0 andrewkesterson staff    1872 Aug  3  2022 ./tftpboot/vpdtest.c32
-rw-r--r--  0 andrewkesterson staff    2204 Aug  3  2022 ./tftpboot/vesainfo.c32
-rw-r--r--  0 andrewkesterson staff    8900 Aug  3  2022 ./tftpboot/syslinux.c32
-rw-r--r--  0 andrewkesterson staff    1620 Aug  3  2022 ./tftpboot/cat.c32
-rw-r--r--  0 andrewkesterson staff   26148 Aug  3  2022 ./tftpboot/menu.c32
-rw-r--r--  0 andrewkesterson staff   12344 Aug  3  2022 ./tftpboot/dmitest.c32
-rw-r--r--  0 andrewkesterson staff    3312 Aug  3  2022 ./tftpboot/elf.c32   
-rw-r--r--  0 andrewkesterson staff    1260 Aug  3  2022 ./tftpboot/cmd.c32      
-rw-r--r--  0 andrewkesterson staff    2964 Aug  3  2022 ./tftpboot/vesa.c32            
-rw-r--r--  0 andrewkesterson staff   74645 Aug  3  2022 ./tftpboot/lpxelinux.0    
-rw-r--r--  0 andrewkesterson staff    1980 Aug  3  2022 ./tftpboot/ifplop.c32                 
-rw-r--r--  0 andrewkesterson staff    1608 Aug  3  2022 ./tftpboot/gpxecmd.c32             
-rw-r--r--  0 andrewkesterson staff  166384 Aug  3  2022 ./tftpboot/hdt.c32
-rw-r--r--  0 andrewkesterson staff   23508 Aug  3  2022 ./tftpboot/libutil.c32
-rw-r--r--  0 andrewkesterson staff    2776 Aug  3  2022 ./tftpboot/cpuidtest.c32
-rw-r--r--  0 andrewkesterson staff    4868 Aug  3  2022 ./tftpboot/kontron_wdt.c32
-rw-r--r--  0 andrewkesterson staff    3400 Aug  3  2022 ./tftpboot/pci.c32
-rw-r--r--  0 andrewkesterson staff   42686 Aug  3  2022 ./tftpboot/pxelinux.0
-rw-r--r--  0 andrewkesterson staff    2984 Aug  3  2022 ./tftpboot/dir.c32
-rw-r--r--  0 andrewkesterson staff   25112 Aug  3  2022 ./tftpboot/chain.c32
-rw-r--r--  0 andrewkesterson staff    1676 Aug  3  2022 ./tftpboot/kbdmap.c32
-rw-r--r--  0 andrewkesterson staff  102440 Aug  3  2022 ./tftpboot/liblua.c32
-rw-r--r--  0 andrewkesterson staff    2752 Aug  3  2022 ./tftpboot/ethersel.c32
-rw-r--r--  0 andrewkesterson staff    3028 Aug  3  2022 ./tftpboot/pmload.c32
-rw-r--r--  0 andrewkesterson staff    3064 Aug  3  2022 ./tftpboot/sdi.c32
-rw-r--r--  0 andrewkesterson staff    4744 Aug  3  2022 ./tftpboot/linux.c32
-rw-r--r--  0 andrewkesterson staff    5104 Aug  3  2022 ./tftpboot/lfs.c32
-rw-r--r--  0 andrewkesterson staff    1496 Aug  3  2022 ./tftpboot/config.c32
-rw-r--r--  0 andrewkesterson staff    1812 Aug  3  2022 ./tftpboot/ifcpu64.c32
-rw-r--r--  0 andrewkesterson staff    1600 Aug  3  2022 ./tftpboot/debug.c32
-rw-r--r--  0 andrewkesterson staff    6940 Aug  3  2022 ./tftpboot/lua.c32
-rw-r--r--  0 andrewkesterson staff    4528 Aug  3  2022 ./tftpboot/cpu.c32
-rw-r--r--  0 andrewkesterson staff   26696 Aug  3  2022 ./tftpboot/vesamenu.c32
-rw-r--r--  0 andrewkesterson staff   12468 Aug  3  2022 ./tftpboot/pxechn.c32
-rw-r--r--  0 andrewkesterson staff   14720 Aug  3  2022 ./tftpboot/sysdump.c32
-rw-r--r--  0 andrewkesterson staff    3688 Aug  3  2022 ./tftpboot/cmenu.c32
-rw-r--r--  0 andrewkesterson staff    1672 Aug  3  2022 ./tftpboot/poweroff.c32
-rw-r--r--  0 andrewkesterson staff    1780 Aug  3  2022 ./tftpboot/cpuid.c32
-rw-r--r--  0 andrewkesterson staff   25884 Aug  3  2022 ./tftpboot/memdisk
-rw-r--r--  0 andrewkesterson staff    8748 Aug  3  2022 ./tftpboot/dmi.c32
-rw-r--r--  0 andrewkesterson staff    3516 Aug  3  2022 ./tftpboot/pcitest.c32
-rw-r--r--  0 andrewkesterson staff    1384 Aug  3  2022 ./tftpboot/reboot.c32
-rw-r--r--  0 andrewkesterson staff    3592 Aug  3  2022 ./tftpboot/zzjson.c32
-rw-r--r--  0 andrewkesterson staff    3700 Aug  3  2022 ./tftpboot/hexdump.c32
-rw-r--r--  0 andrewkesterson staff    2992 Aug  3  2022 ./tftpboot/ls.c32
-rw-r--r--  0 andrewkesterson staff    1844 Aug  3  2022 ./tftpboot/host.c32
-rw-r--r--  0 andrewkesterson staff    4276 Aug  3  2022 ./tftpboot/cptime.c32
-rw-r--r--  0 andrewkesterson staff   42686 Jul  2 12:00 ./pxelinux/pxelinux.0
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:00 ./pxelinux/pxelinux.cfg/
-rw-r--r--  0 andrewkesterson staff     714 Jul  2 12:00 ./pxelinux/pxelinux.cfg/default
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:00 ./images/RHEL-9.6-aarch64/
-rw-r--r--  0 andrewkesterson staff 139674968 Jul  2 12:00 ./images/RHEL-9.6-aarch64/initrd.img
-rwxr-xr-x  0 andrewkesterson staff  13052024 Jul  2 12:00 ./images/RHEL-9.6-aarch64/vmlinuz

Building a RHEL 10.0 aarch64 EFI netboot archive:

$ bash ./build.sh os_descriptors/rhel-10.0-aarch64-efi.json dist/
/dev/disk5                                              /Users/andrewkesterson/source/repo1.dso.mil/big-bang/customers/airgap/netboot_builder/netbootmounterefiP/RHEL-10-0-BaseOS
a .
a ./images
a ./redhat
a ./redhat/EFI
a ./redhat/EFI/boot
a ./redhat/EFI/boot/mmaa64.efi
a ./redhat/EFI/boot/grubaa64.efi
a ./redhat/EFI/boot/BOOTAA64.EFI
a ./redhat/EFI/boot/fonts
a ./redhat/EFI/boot/grub.cfg
a ./redhat/EFI/boot/fonts/unicode.pf2
a ./images/RHEL-10.0-aarch64
a ./images/RHEL-10.0-aarch64/initrd.img
a ./images/RHEL-10.0-aarch64/vmlinuz
"disk5" ejected.

$ tar -zvtf dist/redhat-10.0-aarch64-1.tgz 
drwx------  0 andrewkesterson staff       0 Jul  2 12:02 ./
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:02 ./images/
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:02 ./redhat/
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:02 ./redhat/EFI/
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:02 ./redhat/EFI/boot/
-rwxr-xr-x  0 andrewkesterson staff  893760 Jul  2 12:02 ./redhat/EFI/boot/mmaa64.efi
-rwxr-xr-x  0 andrewkesterson staff 4105848 Jul  2 12:02 ./redhat/EFI/boot/grubaa64.efi
-rwxr-xr-x  0 andrewkesterson staff  978528 Jul  2 12:02 ./redhat/EFI/boot/BOOTAA64.EFI
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:02 ./redhat/EFI/boot/fonts/
-rwxr-xr-x  0 andrewkesterson staff    1025 Jul  2 12:02 ./redhat/EFI/boot/grub.cfg
-rwxr-xr-x  0 andrewkesterson staff 2394108 Jul  2 12:02 ./redhat/EFI/boot/fonts/unicode.pf2
drwxr-xr-x  0 andrewkesterson staff       0 Jul  2 12:02 ./images/RHEL-10.0-aarch64/
-rw-r--r--  0 andrewkesterson staff 134111088 Jul  2 12:02 ./images/RHEL-10.0-aarch64/initrd.img
-rwxr-xr-x  0 andrewkesterson staff  14116984 Jul  2 12:02 ./images/RHEL-10.0-aarch64/vmlinuz

Linked Issue

https://repo1.dso.mil/big-bang/customers/airgap/-/issues/160

Upgrade Notices

N/A

Merge request reports

Loading