From 6637308b5371c0fa1f3c6e3d3fed14589088c306 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 14 Mar 2023 16:07:05 -0700 Subject: [PATCH] Add missing 80-rhel template directory --- 80-rhel/aarch64.tmpl | 87 +++++ 80-rhel/appliance/libvirt.tmpl | 35 ++ 80-rhel/arm.tmpl | 58 +++ 80-rhel/config_files/aarch64/boot.msg | 5 + 80-rhel/config_files/aarch64/grub.conf | 13 + 80-rhel/config_files/aarch64/grub2-efi.cfg | 46 +++ .../common/90-anaconda-no-auto-default.conf | 2 + .../91-anaconda-autoconnect-slaves.conf | 2 + .../common/92-anaconda-loglevel-debug.conf | 2 + 80-rhel/config_files/common/bash_history | 11 + 80-rhel/config_files/common/i18n | 1 + 80-rhel/config_files/common/libuser.conf | 10 + .../org.gtk.Settings.Debug.gschema.override | 2 + 80-rhel/config_files/common/pam.sshd | 9 + 80-rhel/config_files/common/profile | 3 + 80-rhel/config_files/common/resolv.conf | 0 80-rhel/config_files/common/rsyslog.conf | 96 +++++ 80-rhel/config_files/common/selinux.config | 2 + 80-rhel/config_files/common/spice-vdagentd | 1 + .../config_files/common/sshd_config.anaconda | 9 + 80-rhel/config_files/common/sysctl.conf | 1 + 80-rhel/config_files/common/vconsole.conf | 2 + 80-rhel/config_files/s390/cdboot.prm | 1 + 80-rhel/config_files/s390/generic.ins | 5 + 80-rhel/config_files/s390/generic.prm | 1 + 80-rhel/config_files/s390/genericdvd.prm | 1 + 80-rhel/config_files/s390/redhat.exec | 9 + 80-rhel/config_files/sparc/boot.msg | 9 + 80-rhel/config_files/sparc/silo.conf | 18 + 80-rhel/config_files/x86/boot.msg | 5 + 80-rhel/config_files/x86/grub.conf | 13 + 80-rhel/config_files/x86/grub2-efi.cfg | 40 ++ 80-rhel/config_files/x86/isolinux.cfg | 120 ++++++ 80-rhel/efi.tmpl | 61 +++ 80-rhel/live/aarch64.tmpl | 86 ++++ 80-rhel/live/arm.tmpl | 52 +++ .../live/config_files/aarch64/grub2-efi.cfg | 42 ++ 80-rhel/live/config_files/s390/cdboot.prm | 1 + 80-rhel/live/config_files/s390/generic.ins | 5 + 80-rhel/live/config_files/s390/generic.prm | 1 + 80-rhel/live/config_files/s390/genericdvd.prm | 1 + 80-rhel/live/config_files/s390/redhat.exec | 9 + 80-rhel/live/config_files/x86/boot.msg | 5 + 80-rhel/live/config_files/x86/grub.conf | 13 + 80-rhel/live/config_files/x86/grub2-efi.cfg | 36 ++ 80-rhel/live/config_files/x86/isolinux.cfg | 110 ++++++ 80-rhel/live/efi.tmpl | 62 +++ 80-rhel/live/live-install.tmpl | 31 ++ 80-rhel/live/ppc.tmpl | 127 ++++++ 80-rhel/live/ppc64le.tmpl | 98 +++++ 80-rhel/live/s390.tmpl | 91 +++++ 80-rhel/live/x86.tmpl | 129 ++++++ 80-rhel/ppc.tmpl | 116 ++++++ 80-rhel/ppc64le.tmpl | 107 +++++ 80-rhel/pxe-live/pxe-config.tmpl | 3 + 80-rhel/runtime-cleanup.tmpl | 368 ++++++++++++++++++ 80-rhel/runtime-install.tmpl | 173 ++++++++ 80-rhel/runtime-postinstall.tmpl | 124 ++++++ 80-rhel/s390.tmpl | 79 ++++ 80-rhel/x86.tmpl | 137 +++++++ Makefile | 30 ++ README | 16 + SERIAL | 1 + 63 files changed, 2733 insertions(+) create mode 100644 80-rhel/aarch64.tmpl create mode 100644 80-rhel/appliance/libvirt.tmpl create mode 100644 80-rhel/arm.tmpl create mode 100644 80-rhel/config_files/aarch64/boot.msg create mode 100644 80-rhel/config_files/aarch64/grub.conf create mode 100644 80-rhel/config_files/aarch64/grub2-efi.cfg create mode 100644 80-rhel/config_files/common/90-anaconda-no-auto-default.conf create mode 100644 80-rhel/config_files/common/91-anaconda-autoconnect-slaves.conf create mode 100644 80-rhel/config_files/common/92-anaconda-loglevel-debug.conf create mode 100644 80-rhel/config_files/common/bash_history create mode 100644 80-rhel/config_files/common/i18n create mode 100644 80-rhel/config_files/common/libuser.conf create mode 100644 80-rhel/config_files/common/org.gtk.Settings.Debug.gschema.override create mode 100644 80-rhel/config_files/common/pam.sshd create mode 100644 80-rhel/config_files/common/profile create mode 100644 80-rhel/config_files/common/resolv.conf create mode 100644 80-rhel/config_files/common/rsyslog.conf create mode 100644 80-rhel/config_files/common/selinux.config create mode 100644 80-rhel/config_files/common/spice-vdagentd create mode 100644 80-rhel/config_files/common/sshd_config.anaconda create mode 100644 80-rhel/config_files/common/sysctl.conf create mode 100644 80-rhel/config_files/common/vconsole.conf create mode 100644 80-rhel/config_files/s390/cdboot.prm create mode 100644 80-rhel/config_files/s390/generic.ins create mode 100644 80-rhel/config_files/s390/generic.prm create mode 100644 80-rhel/config_files/s390/genericdvd.prm create mode 100644 80-rhel/config_files/s390/redhat.exec create mode 100644 80-rhel/config_files/sparc/boot.msg create mode 100644 80-rhel/config_files/sparc/silo.conf create mode 100644 80-rhel/config_files/x86/boot.msg create mode 100644 80-rhel/config_files/x86/grub.conf create mode 100644 80-rhel/config_files/x86/grub2-efi.cfg create mode 100644 80-rhel/config_files/x86/isolinux.cfg create mode 100644 80-rhel/efi.tmpl create mode 100644 80-rhel/live/aarch64.tmpl create mode 100644 80-rhel/live/arm.tmpl create mode 100644 80-rhel/live/config_files/aarch64/grub2-efi.cfg create mode 100644 80-rhel/live/config_files/s390/cdboot.prm create mode 100644 80-rhel/live/config_files/s390/generic.ins create mode 100644 80-rhel/live/config_files/s390/generic.prm create mode 100644 80-rhel/live/config_files/s390/genericdvd.prm create mode 100644 80-rhel/live/config_files/s390/redhat.exec create mode 100644 80-rhel/live/config_files/x86/boot.msg create mode 100644 80-rhel/live/config_files/x86/grub.conf create mode 100644 80-rhel/live/config_files/x86/grub2-efi.cfg create mode 100644 80-rhel/live/config_files/x86/isolinux.cfg create mode 100644 80-rhel/live/efi.tmpl create mode 100644 80-rhel/live/live-install.tmpl create mode 100644 80-rhel/live/ppc.tmpl create mode 100644 80-rhel/live/ppc64le.tmpl create mode 100644 80-rhel/live/s390.tmpl create mode 100644 80-rhel/live/x86.tmpl create mode 100644 80-rhel/ppc.tmpl create mode 100644 80-rhel/ppc64le.tmpl create mode 100644 80-rhel/pxe-live/pxe-config.tmpl create mode 100644 80-rhel/runtime-cleanup.tmpl create mode 100644 80-rhel/runtime-install.tmpl create mode 100644 80-rhel/runtime-postinstall.tmpl create mode 100644 80-rhel/s390.tmpl create mode 100644 80-rhel/x86.tmpl create mode 100644 Makefile create mode 100644 README create mode 100644 SERIAL diff --git a/80-rhel/aarch64.tmpl b/80-rhel/aarch64.tmpl new file mode 100644 index 0000000..bef284e --- /dev/null +++ b/80-rhel/aarch64.tmpl @@ -0,0 +1,87 @@ +<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel"/> +<% +configdir="tmp/config_files/aarch64" +PXEBOOTDIR="images/pxeboot" +KERNELDIR=PXEBOOTDIR +STAGE2IMG="images/install.img" +LORAXDIR="usr/share/lorax/" + +from os.path import basename +%> + +## Test ${runtime_img} to see if udf is needed +<% + import os + from pylorax.sysutils import joinpaths + if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" + else: + udfargs = "" +%> + +mkdir images +install ${runtime_img} ${STAGE2IMG} +treeinfo stage2 mainimage ${STAGE2IMG} + +## install kernels +mkdir ${KERNELDIR} +%for kernel in kernels: + ## normal aarch64 + installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img +%endfor + +#FIXME: this will need adjusted when we have a real bootloader. +## WHeeeeeeee, EFI. +## We could remove the basearch restriction someday.. +<% efiargs=""; efigraft="" %> +%if exists("boot/efi/EFI/*/gcdaa64.efi"): + <% + efiarch32 = None + efiarch64 = 'AA64' + efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) + images = ["images/efiboot.img"] + %> + %for img in images: + <% + efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img) + efigraft += " {0}={1}/{0}".format(img,outroot) + %> + treeinfo images-${basearch} ${img|basename} ${img} + %endfor + <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/> +%endif + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +# Inherit iso-graft/ if it exists from external templates +<% + import os + if os.path.exists(workdir + "/iso-graft"): + filegraft += " " + workdir + "/iso-graft" +%> + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +%if exists("boot/efi/EFI/*/gcdaa64.efi"): +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso \ + ${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \ + -graft-points \ + ${KERNELDIR}=${outroot}/${KERNELDIR} \ + ${STAGE2IMG}=${outroot}/${STAGE2IMG} \ + ${efigraft} ${filegraft} +treeinfo images-${basearch} boot.iso images/boot.iso +%endif diff --git a/80-rhel/appliance/libvirt.tmpl b/80-rhel/appliance/libvirt.tmpl new file mode 100644 index 0000000..a739e63 --- /dev/null +++ b/80-rhel/appliance/libvirt.tmpl @@ -0,0 +1,35 @@ + + + ${name} + + + + ${arch} + + + + +%for disk, letter in zip(disks, xrange(97, 123)): + +%endfor + + + ${vcpus} + ${memory} +%for net in networks: + +%endfor + + + + +%for disk in disks: + + %if disk.checksum: + ${disk.checksum} + %endif + +%endfor + + + diff --git a/80-rhel/arm.tmpl b/80-rhel/arm.tmpl new file mode 100644 index 0000000..d96e26b --- /dev/null +++ b/80-rhel/arm.tmpl @@ -0,0 +1,58 @@ +<%page args="kernels, runtime_img, runtime_base, basearch, outroot, arch"/> +<% +configdir="tmp/config_files/uboot" +PXEBOOTDIR="images/pxeboot" +DTBDIR="images/pxeboot/dtb" +BOOTDIR="boot" +KERNELDIR=PXEBOOTDIR +STAGE2IMG="images/install.img" +LORAXDIR="usr/share/lorax/" + +# keep a comma-delimited list of platforms installed to add to .treeinfo +platforms = "" +delimiter = '' + +from os.path import basename +%> + +mkdir images +install ${runtime_img} ${STAGE2IMG} +treeinfo stage2 mainimage ${STAGE2IMG} + +mkdir ${DTBDIR} +install boot/dtb-*/*dtb ${DTBDIR}/ + +## install kernels +mkdir ${KERNELDIR} +%for kernel in kernels: + %if kernel.flavor: + installkernel images-${kernel.flavor}-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor} + installinitrd images-${kernel.flavor}-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img +<% + platforms = platforms + delimiter + kernel.flavor + delimiter = ',' +%> + %else: + installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + %endif +%endfor + +# add platform to treeinfo for Beaker support +treeinfo ${basearch} platforms ${platforms} + +# Create optional product.img and updates.img +<% images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + %endif +%endfor + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} +%endfor + +## FIXME: ARM may need some extra boot config diff --git a/80-rhel/config_files/aarch64/boot.msg b/80-rhel/config_files/aarch64/boot.msg new file mode 100644 index 0000000..ff54899 --- /dev/null +++ b/80-rhel/config_files/aarch64/boot.msg @@ -0,0 +1,5 @@ + +splash.lss + + - Press the 0107 key to begin the installation process. + diff --git a/80-rhel/config_files/aarch64/grub.conf b/80-rhel/config_files/aarch64/grub.conf new file mode 100644 index 0000000..49fa32b --- /dev/null +++ b/80-rhel/config_files/aarch64/grub.conf @@ -0,0 +1,13 @@ +#debug --graphics +default=0 +splashimage=@SPLASHPATH@ +timeout 5 +hiddenmenu +title Install @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ quiet + initrd @INITRDPATH@ +title Test this media & install @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ rd.live.check quiet + initrd @INITRDPATH@ diff --git a/80-rhel/config_files/aarch64/grub2-efi.cfg b/80-rhel/config_files/aarch64/grub2-efi.cfg new file mode 100644 index 0000000..1ce5d33 --- /dev/null +++ b/80-rhel/config_files/aarch64/grub2-efi.cfg @@ -0,0 +1,46 @@ +set default="1" + +function load_video { + if [ x$feature_all_video_module = xy ]; then + insmod all_video + else + insmod efi_gop + insmod efi_uga + insmod ieee1275_fb + insmod vbe + insmod vga + insmod video_bochs + insmod video_cirrus + fi +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=60 +### END /etc/grub.d/00_header ### + +search --no-floppy --set=root -l '@ISOLABEL@' + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ ro + initrd @INITRDPATH@ +} +menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ rd.live.check + initrd @INITRDPATH@ +} +submenu 'Troubleshooting -->' { + menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ nomodeset + initrd @INITRDPATH@ + } + menuentry 'Rescue a @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ inst.rescue + initrd @INITRDPATH@ + } +} diff --git a/80-rhel/config_files/common/90-anaconda-no-auto-default.conf b/80-rhel/config_files/common/90-anaconda-no-auto-default.conf new file mode 100644 index 0000000..06b53d8 --- /dev/null +++ b/80-rhel/config_files/common/90-anaconda-no-auto-default.conf @@ -0,0 +1,2 @@ +[main] +no-auto-default=* diff --git a/80-rhel/config_files/common/91-anaconda-autoconnect-slaves.conf b/80-rhel/config_files/common/91-anaconda-autoconnect-slaves.conf new file mode 100644 index 0000000..f9c81e6 --- /dev/null +++ b/80-rhel/config_files/common/91-anaconda-autoconnect-slaves.conf @@ -0,0 +1,2 @@ +[connection] +connection.autoconnect-slaves=1 diff --git a/80-rhel/config_files/common/92-anaconda-loglevel-debug.conf b/80-rhel/config_files/common/92-anaconda-loglevel-debug.conf new file mode 100644 index 0000000..6a6535d --- /dev/null +++ b/80-rhel/config_files/common/92-anaconda-loglevel-debug.conf @@ -0,0 +1,2 @@ +[logging] +level=DEBUG diff --git a/80-rhel/config_files/common/bash_history b/80-rhel/config_files/common/bash_history new file mode 100644 index 0000000..a766df2 --- /dev/null +++ b/80-rhel/config_files/common/bash_history @@ -0,0 +1,11 @@ +kill -USR1 `cat /var/run/anaconda.pid` +kill -USR2 `cat /var/run/anaconda.pid` +kill -HUP `cat /var/run/anaconda.pid` +udevadm info --export-db | less +tail -f /tmp/storage.log +echo b > /proc/sysrq-trigger +dmsetup table +multipath -d +HOME=/root chroot /mnt/sysimage bash -l -i +less /tmp/anaconda.log +grep -v _yum_lock /tmp/packaging.log diff --git a/80-rhel/config_files/common/i18n b/80-rhel/config_files/common/i18n new file mode 100644 index 0000000..b254232 --- /dev/null +++ b/80-rhel/config_files/common/i18n @@ -0,0 +1 @@ +SYSFONT="eurlatgr" diff --git a/80-rhel/config_files/common/libuser.conf b/80-rhel/config_files/common/libuser.conf new file mode 100644 index 0000000..a7a0ef0 --- /dev/null +++ b/80-rhel/config_files/common/libuser.conf @@ -0,0 +1,10 @@ +[defaults] +skeleton = /mnt/sysimage/etc/skel +mailspooldir = /mnt/sysimage/var/mail +crypt_style = md5 +modules = files shadow +create_modules = files shadow +[files] +directory = /mnt/sysimage/etc +[shadow] +directory = /mnt/sysimage/etc diff --git a/80-rhel/config_files/common/org.gtk.Settings.Debug.gschema.override b/80-rhel/config_files/common/org.gtk.Settings.Debug.gschema.override new file mode 100644 index 0000000..fcedd1b --- /dev/null +++ b/80-rhel/config_files/common/org.gtk.Settings.Debug.gschema.override @@ -0,0 +1,2 @@ +[org.gtk.Settings.Debug] + enable-inspector-keybinding=true diff --git a/80-rhel/config_files/common/pam.sshd b/80-rhel/config_files/common/pam.sshd new file mode 100644 index 0000000..88c019f --- /dev/null +++ b/80-rhel/config_files/common/pam.sshd @@ -0,0 +1,9 @@ +#%PAM-1.0 +auth required pam_env.so +auth sufficient pam_unix.so likeauth nullok +auth required pam_deny.so +account required pam_unix.so +password sufficient pam_unix.so nullok use_authtok md5 shadow +password required pam_deny.so +session required pam_limits.so +session required pam_unix.so diff --git a/80-rhel/config_files/common/profile b/80-rhel/config_files/common/profile new file mode 100644 index 0000000..00a475e --- /dev/null +++ b/80-rhel/config_files/common/profile @@ -0,0 +1,3 @@ +PS1="[anaconda \u@\h \W]\\$ " +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/mnt/sysimage/sbin:/mnt/sysimage/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin +export PATH PS1 diff --git a/80-rhel/config_files/common/resolv.conf b/80-rhel/config_files/common/resolv.conf new file mode 100644 index 0000000..e69de29 diff --git a/80-rhel/config_files/common/rsyslog.conf b/80-rhel/config_files/common/rsyslog.conf new file mode 100644 index 0000000..f21f660 --- /dev/null +++ b/80-rhel/config_files/common/rsyslog.conf @@ -0,0 +1,96 @@ +# rsyslog configuration file + +# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html +# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html + +#### MODULES #### + +# The imjournal module below is now used as a message source instead of imuxsock. +$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) +$SystemLogRateLimitInterval 0 # disables message dropping, we need all of them +$ModLoad imjournal # provides access to the systemd journal +#$ModLoad imklog # reads kernel messages (the same are read from journald) +#$ModLoad immark # provides --MARK-- message capability +# Disable rate limiting to the journal, we need all the messages for debugging +$imjournalRatelimitInterval 0 +$imjournalRatelimitBurst 0 + +# Provides UDP syslog reception +#$ModLoad imudp +#$UDPServerRun 514 + +# Provides TCP syslog reception +#$ModLoad imtcp +#$InputTCPServerRun 514 + +$ModLoad imfile +$InputFileName /tmp/X.log +$InputFileTag xserver: +$InputFileStateFile xserver-statefile +$InputFileFacility local1 +$InputRunFileMonitor +$InputFileName /tmp/anaconda-tb-all.log +$InputFileTag anaconda-tb: +$InputFileStateFile anaconda-tb-statefile +$InputFileFacility local1 +$InputRunFileMonitor + + +#### GLOBAL DIRECTIVES #### + +# Where to place auxiliary files +#$WorkDirectory /var/lib/rsyslog + +# Use default timestamp format +$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# File syncing capability is disabled by default. This feature is usually not required, +# not useful and an extreme performance hit +#$ActionFileEnableSync on + +# Include all config files in /etc/rsyslog.d/ +$IncludeConfig /etc/rsyslog.d/*.conf + +# Turn off message reception via local log socket; +# local messages are retrieved through imjournal now. +$OmitLocalLogging on + +# File to store the position in the journal +$IMJournalStateFile imjournal.state + +#### TEMPLATES #### + +$template anaconda_tty4, "%syslogseverity-text:::uppercase% %programname%:%msg%\n" +$template anaconda_syslog, "%timestamp:8:$:date-rfc3164%,%timestamp:1:3:date-subseconds% %syslogseverity-text:::uppercase% %programname%:%msg%\n" +$template virtio_ForwardFormat, "<%PRI%>%TIMESTAMP:::date-rfc3339% localhost %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%\n" + +#### RULES #### + +# log everything except anaconda-specific records from local1 (those are stored +# directly into files via python logging) + +# discard messages from dracut regenerating initrd +:programname,isequal,"dracut" ~ + +*.*;\ +authpriv.none;\ +local1.none /tmp/syslog;anaconda_syslog + & /dev/tty4;anaconda_tty4 + + +# ### begin forwarding rule ### +# The statement between the begin ... end define a SINGLE forwarding +# rule. They belong together, do NOT split them. If you create multiple +# forwarding rules, duplicate the whole block! +# Remote Logging (we use TCP for reliable delivery) +# +# An on-disk queue is created for this action. If the remote host is +# down, messages are spooled to disk and sent when it is up again. +#$ActionQueueFileName fwdRule1 # unique name prefix for spool files +$ActionQueueMaxDiskSpace 1m # space limit (use as much as possible) +$ActionQueueSaveOnShutdown off # do not save messages to disk on shutdown +#$ActionQueueType LinkedList # run asynchronously +#$ActionResumeRetryCount -1 # infinite retries if host is down +# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional +#*.* @@remote-host:514 +# ### end of the forwarding rule ### diff --git a/80-rhel/config_files/common/selinux.config b/80-rhel/config_files/common/selinux.config new file mode 100644 index 0000000..eac67ab --- /dev/null +++ b/80-rhel/config_files/common/selinux.config @@ -0,0 +1,2 @@ +SELINUX=permissive +SELINUXTYPE=targeted diff --git a/80-rhel/config_files/common/spice-vdagentd b/80-rhel/config_files/common/spice-vdagentd new file mode 100644 index 0000000..e70aa69 --- /dev/null +++ b/80-rhel/config_files/common/spice-vdagentd @@ -0,0 +1 @@ +SPICE_VDAGENTD_EXTRA_ARGS=-X diff --git a/80-rhel/config_files/common/sshd_config.anaconda b/80-rhel/config_files/common/sshd_config.anaconda new file mode 100644 index 0000000..8cc3b22 --- /dev/null +++ b/80-rhel/config_files/common/sshd_config.anaconda @@ -0,0 +1,9 @@ +PermitRootLogin yes +X11Forwarding yes +X11DisplayOffset 10 +PrintMotd yes +SyslogFacility AUTHPRIV +PasswordAuthentication yes +PermitEmptyPasswords yes +PermitUserEnvironment yes +Subsystem sftp internal-sftp diff --git a/80-rhel/config_files/common/sysctl.conf b/80-rhel/config_files/common/sysctl.conf new file mode 100644 index 0000000..a95dfc6 --- /dev/null +++ b/80-rhel/config_files/common/sysctl.conf @@ -0,0 +1 @@ +kernel.printk=1 diff --git a/80-rhel/config_files/common/vconsole.conf b/80-rhel/config_files/common/vconsole.conf new file mode 100644 index 0000000..2bd7892 --- /dev/null +++ b/80-rhel/config_files/common/vconsole.conf @@ -0,0 +1,2 @@ +KEYMAP=us +FONT=eurlatgr diff --git a/80-rhel/config_files/s390/cdboot.prm b/80-rhel/config_files/s390/cdboot.prm new file mode 100644 index 0000000..80c034b --- /dev/null +++ b/80-rhel/config_files/s390/cdboot.prm @@ -0,0 +1 @@ +ro @ROOT@ diff --git a/80-rhel/config_files/s390/generic.ins b/80-rhel/config_files/s390/generic.ins new file mode 100644 index 0000000..756d2ff --- /dev/null +++ b/80-rhel/config_files/s390/generic.ins @@ -0,0 +1,5 @@ +* minimal lpar ins file +images/kernel.img 0x00000000 +images/initrd.img @INITRD_LOAD_ADDRESS@ +images/genericdvd.prm 0x00010480 +images/initrd.addrsize 0x00010408 diff --git a/80-rhel/config_files/s390/generic.prm b/80-rhel/config_files/s390/generic.prm new file mode 100644 index 0000000..e1dc397 --- /dev/null +++ b/80-rhel/config_files/s390/generic.prm @@ -0,0 +1 @@ +ro ramdisk_size=40000 cio_ignore=all,!condev diff --git a/80-rhel/config_files/s390/genericdvd.prm b/80-rhel/config_files/s390/genericdvd.prm new file mode 100644 index 0000000..b5d2731 --- /dev/null +++ b/80-rhel/config_files/s390/genericdvd.prm @@ -0,0 +1 @@ +ro ramdisk_size=40000 cio_ignore=all,!condev rd.cmdline=ask diff --git a/80-rhel/config_files/s390/redhat.exec b/80-rhel/config_files/s390/redhat.exec new file mode 100644 index 0000000..f1e5931 --- /dev/null +++ b/80-rhel/config_files/s390/redhat.exec @@ -0,0 +1,9 @@ +/* */ +'CL RDR' +'PURGE RDR ALL' +'SPOOL PUNCH * RDR' +'PUNCH KERNEL IMG A (NOH' +'PUNCH GENERIC PRM A (NOH' +'PUNCH INITRD IMG A (NOH' +'CH RDR ALL KEEP NOHOLD' +'I 00C' diff --git a/80-rhel/config_files/sparc/boot.msg b/80-rhel/config_files/sparc/boot.msg new file mode 100644 index 0000000..915ccf3 --- /dev/null +++ b/80-rhel/config_files/sparc/boot.msg @@ -0,0 +1,9 @@ + + Welcome to @PRODUCT@ @VERSION@! + + - To install in graphical mode, press the  key. + + - To install in text mode, type: linux inst.text . + + - To enter rescue mode type: linux inst.rescue . + diff --git a/80-rhel/config_files/sparc/silo.conf b/80-rhel/config_files/sparc/silo.conf new file mode 100644 index 0000000..82902f4 --- /dev/null +++ b/80-rhel/config_files/sparc/silo.conf @@ -0,0 +1,18 @@ +partition=1 +default=linux +read-write +timeout=100 +message=/boot/boot.msg +image[sun4u]=/boot/vmlinuz + label=linux + alias=install + append="@ROOT@" + initrd=/boot/initrd.img +image[sun4u]=/boot/vmlinuz + label=text + append="@ROOT@ inst.text" + initrd=/boot/initrd.img +image[sun4u]=/boot/vmlinuz + label=ks + append="@ROOT@ inst.ks" + initrd=/boot/initrd.img diff --git a/80-rhel/config_files/x86/boot.msg b/80-rhel/config_files/x86/boot.msg new file mode 100644 index 0000000..ff54899 --- /dev/null +++ b/80-rhel/config_files/x86/boot.msg @@ -0,0 +1,5 @@ + +splash.lss + + - Press the 0107 key to begin the installation process. + diff --git a/80-rhel/config_files/x86/grub.conf b/80-rhel/config_files/x86/grub.conf new file mode 100644 index 0000000..4cf8ced --- /dev/null +++ b/80-rhel/config_files/x86/grub.conf @@ -0,0 +1,13 @@ +#debug --graphics +default=1 +splashimage=@SPLASHPATH@ +timeout 60 +hiddenmenu +title Install @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ quiet + initrd @INITRDPATH@ +title Test this media & install @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ rd.live.check quiet + initrd @INITRDPATH@ diff --git a/80-rhel/config_files/x86/grub2-efi.cfg b/80-rhel/config_files/x86/grub2-efi.cfg new file mode 100644 index 0000000..8c9adad --- /dev/null +++ b/80-rhel/config_files/x86/grub2-efi.cfg @@ -0,0 +1,40 @@ +set default="1" + +function load_video { + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus + insmod all_video +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=60 +### END /etc/grub.d/00_header ### + +search --no-floppy --set=root -l '@ISOLABEL@' + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ quiet + initrdefi @INITRDPATH@ +} +menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ rd.live.check quiet + initrdefi @INITRDPATH@ +} +submenu 'Troubleshooting -->' { + menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ nomodeset quiet + initrdefi @INITRDPATH@ + } + menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ inst.rescue quiet + initrdefi @INITRDPATH@ + } +} diff --git a/80-rhel/config_files/x86/isolinux.cfg b/80-rhel/config_files/x86/isolinux.cfg new file mode 100644 index 0000000..1b3fae2 --- /dev/null +++ b/80-rhel/config_files/x86/isolinux.cfg @@ -0,0 +1,120 @@ +default vesamenu.c32 +timeout 600 + +display boot.msg + +# Clear the screen when exiting the menu, instead of leaving the menu displayed. +# For vesamenu, this means the graphical background is still displayed without +# the menu itself for as long as the screen remains in graphics mode. +menu clear +menu background splash.png +menu title @PRODUCT@ @VERSION@ +menu vshift 8 +menu rows 18 +menu margin 8 +#menu hidden +menu helpmsgrow 15 +menu tabmsgrow 13 + +# Border Area +menu color border * #00000000 #00000000 none + +# Selected item +menu color sel 0 #ffffffff #00000000 none + +# Title bar +menu color title 0 #ff7ba3d0 #00000000 none + +# Press [Tab] message +menu color tabmsg 0 #ff3a6496 #00000000 none + +# Unselected menu item +menu color unsel 0 #84b8ffff #00000000 none + +# Selected hotkey +menu color hotsel 0 #84b8ffff #00000000 none + +# Unselected hotkey +menu color hotkey 0 #ffffffff #00000000 none + +# Help text +menu color help 0 #ffffffff #00000000 none + +# A scrollbar of some type? Not sure. +menu color scrollbar 0 #ffffffff #ff355594 none + +# Timeout msg +menu color timeout 0 #ffffffff #00000000 none +menu color timeout_msg 0 #ffffffff #00000000 none + +# Command prompt text +menu color cmdmark 0 #84b8ffff #00000000 none +menu color cmdline 0 #ffffffff #00000000 none + +# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message. + +menu tabmsg Press Tab for full configuration options on menu items. + +menu separator # insert an empty line +menu separator # insert an empty line + +label linux + menu label ^Install @PRODUCT@ @VERSION@ + kernel vmlinuz + append initrd=initrd.img @ROOT@ quiet + +label check + menu label Test this ^media & install @PRODUCT@ @VERSION@ + menu default + kernel vmlinuz + append initrd=initrd.img @ROOT@ rd.live.check quiet + +menu separator # insert an empty line + +# utilities submenu +menu begin ^Troubleshooting + menu title Troubleshooting + +label vesa + menu indent count 5 + menu label Install @PRODUCT@ @VERSION@ in ^basic graphics mode + text help + Try this option out if you're having trouble installing + @PRODUCT@ @VERSION@. + endtext + kernel vmlinuz + append initrd=initrd.img @ROOT@ nomodeset quiet + +label rescue + menu indent count 5 + menu label ^Rescue a @PRODUCT@ system + text help + If the system will not boot, this lets you access files + and edit config files to try to get it booting again. + endtext + kernel vmlinuz + append initrd=initrd.img @ROOT@ inst.rescue quiet + +label memtest + menu label Run a ^memory test + text help + If your system is having issues, a problem with your + system's memory may be the cause. Use this utility to + see if the memory is working correctly. + endtext + kernel memtest + +menu separator # insert an empty line + +label local + menu label Boot from ^local drive + localboot 0xffff + +menu separator # insert an empty line +menu separator # insert an empty line + +label returntomain + menu label Return to ^main menu + menu exit + +menu end diff --git a/80-rhel/efi.tmpl b/80-rhel/efi.tmpl new file mode 100644 index 0000000..d73d2d7 --- /dev/null +++ b/80-rhel/efi.tmpl @@ -0,0 +1,61 @@ +<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel"/> +<% +EFIBOOTDIR="EFI/BOOT" +APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns" +APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol" +%> + +mkdir ${EFIBOOTDIR} +mkdir ${EFIBOOTDIR}/fonts/ +%if efiarch64: +install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI +install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/ +install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi +%endif +%if efiarch32: +install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI +install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/ +install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi +%endif +install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/ + +## actually make the EFI images +${make_efiboot("images/efiboot.img")} +%if domacboot: + ${make_efiboot("images/macboot.img", imgtype="apple")} +%endif + +## This is kinda gross, but then... so's EFI. +<%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')"> + <% + kdir = EFIBOOTDIR if include_kernel else KERNELDIR + eficonf = "%s/grub.cfg" % (EFIBOOTDIR, ) + args = "--label=ANACONDA --debug" + if disk: args += " --disk" + if imgtype == "apple": args += ' --apple --icon=%s --diskname=%s --product="%s %s"' % (APPLE_EFI_ICON, APPLE_EFI_DISKNAME, product.name, product.version) + %> + %if include_kernel: + copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR} + copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR} + %endif + install ${configdir}/grub2-efi.cfg ${eficonf} + replace @PRODUCT@ '${product.name}' ${eficonf} + replace @VERSION@ ${product.version} ${eficonf} + replace @KERNELNAME@ vmlinuz ${eficonf} + replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf} + replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf} + replace @ISOLABEL@ '${isolabel}' ${eficonf} + %if disk: + replace @ROOT@ inst.stage2=hd:LABEL=ANACONDA ${eficonf} + %else: + replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf} + %endif + %if efiarch32 == 'IA32': + copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf + %endif + runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img} + %if include_kernel: + remove ${EFIBOOTDIR}/vmlinuz + remove ${EFIBOOTDIR}/initrd.img + %endif + diff --git a/80-rhel/live/aarch64.tmpl b/80-rhel/live/aarch64.tmpl new file mode 100644 index 0000000..9ddd2d2 --- /dev/null +++ b/80-rhel/live/aarch64.tmpl @@ -0,0 +1,86 @@ +<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel, extra_boot_args"/> +<% +configdir="tmp/config_files/aarch64" +PXEBOOTDIR="images/pxeboot" +KERNELDIR=PXEBOOTDIR +LIVEDIR="LiveOS" +LORAXDIR="usr/share/lorax/" + +## Don't allow spaces or escape characters in the iso label +def valid_label(ch): + return ch.isalnum() or ch == '_' + +isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel) + +from os.path import basename +%> + +## Test ${runtime_img} to see if udf is needed +<% + import os + from pylorax.sysutils import joinpaths + if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" + else: + udfargs = "" +%> + +mkdir ${LIVEDIR} +install ${runtime_img} ${LIVEDIR}/squashfs.img +treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + +## install kernels +mkdir ${KERNELDIR} +%for kernel in kernels: + ## normal aarch64 + installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img +%endfor + +#FIXME: this will need adjusted when we have a real bootloader. +## WHeeeeeeee, EFI. +## We could remove the basearch restriction someday.. +<% efiargs=""; efigraft="" %> +%if exists("boot/efi/EFI/*/gcdaa64.efi"): + <% + efiarch32 = None + efiarch64 = 'AA64' + efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) + images = ["images/efiboot.img"] + %> + %for img in images: + <% + efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img) + efigraft += " {0}={1}/{0}".format(img,outroot) + %> + treeinfo images-${basearch} ${img|basename} ${img} + %endfor + <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel, extra_boot_args=extra_boot_args"/> +%endif + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +%if exists("boot/efi/EFI/*/gcdaa64.efi"): +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso \ + ${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \ + -graft-points \ + ${KERNELDIR}=${outroot}/${KERNELDIR} \ + ${LIVEDIR}=${outroot}/${LIVEDIR} \ + ${efigraft} ${filegraft} +treeinfo images-${basearch} boot.iso images/boot.iso +%endif diff --git a/80-rhel/live/arm.tmpl b/80-rhel/live/arm.tmpl new file mode 100644 index 0000000..30f1222 --- /dev/null +++ b/80-rhel/live/arm.tmpl @@ -0,0 +1,52 @@ +<%page args="kernels, runtime_img, runtime_base, basearch, outroot, arch"/> +<% +configdir="tmp/config_files/uboot" +PXEBOOTDIR="images/pxeboot" +BOOTDIR="boot" +KERNELDIR=PXEBOOTDIR +LIVEDIR="LiveOS" +LORAXDIR="usr/share/lorax/" + +from os.path import basename +%> + +mkdir ${LIVEDIR} +install ${runtime_img} ${LIVEDIR}/squashfs.img +treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + +## install kernels +mkdir ${KERNELDIR} +%for kernel in kernels: + %if kernel.flavor: + installkernel images-${kernel.flavor}-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor} + installinitrd images-${kernel.flavor}-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img + + treeinfo images-${kernel.flavor}-${basearch} uimage ${KERNELDIR}/uImage-${kernel.flavor} + treeinfo images-${kernel.flavor}-${basearch} uinitrd ${KERNELDIR}/uInitrd-${kernel.flavor} + + %else: + installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + + treeinfo images-${basearch} uimage ${KERNELDIR}/uImage + treeinfo images-${basearch} uinitrd ${KERNELDIR}/uInitrd + + %endif +%endfor + +# Create optional product.img and updates.img +<% images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + %endif +%endfor + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} +%endfor + +## FIXME: ARM may need some extra boot config + diff --git a/80-rhel/live/config_files/aarch64/grub2-efi.cfg b/80-rhel/live/config_files/aarch64/grub2-efi.cfg new file mode 100644 index 0000000..d079924 --- /dev/null +++ b/80-rhel/live/config_files/aarch64/grub2-efi.cfg @@ -0,0 +1,42 @@ +set default="1" + +function load_video { + if [ x$feature_all_video_module = xy ]; then + insmod all_video + else + insmod efi_gop + insmod efi_uga + insmod ieee1275_fb + insmod vbe + insmod vga + insmod video_bochs + insmod video_cirrus + fi +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=60 +### END /etc/grub.d/00_header ### + +search --no-floppy --set=root -l '@ISOLABEL@' + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Start @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet + initrd @INITRDPATH@ +} +menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet + initrd @INITRDPATH@ +} +submenu 'Troubleshooting -->' { + menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image nomodeset quiet + initrd @INITRDPATH@ + } +} diff --git a/80-rhel/live/config_files/s390/cdboot.prm b/80-rhel/live/config_files/s390/cdboot.prm new file mode 100644 index 0000000..5f572d2 --- /dev/null +++ b/80-rhel/live/config_files/s390/cdboot.prm @@ -0,0 +1 @@ +ro @ROOT@ rd.live.image @EXTRA@ diff --git a/80-rhel/live/config_files/s390/generic.ins b/80-rhel/live/config_files/s390/generic.ins new file mode 100644 index 0000000..756d2ff --- /dev/null +++ b/80-rhel/live/config_files/s390/generic.ins @@ -0,0 +1,5 @@ +* minimal lpar ins file +images/kernel.img 0x00000000 +images/initrd.img @INITRD_LOAD_ADDRESS@ +images/genericdvd.prm 0x00010480 +images/initrd.addrsize 0x00010408 diff --git a/80-rhel/live/config_files/s390/generic.prm b/80-rhel/live/config_files/s390/generic.prm new file mode 100644 index 0000000..4f9ba38 --- /dev/null +++ b/80-rhel/live/config_files/s390/generic.prm @@ -0,0 +1 @@ +ro ramdisk_size=40000 cio_ignore=all,!condev @EXTRA@ diff --git a/80-rhel/live/config_files/s390/genericdvd.prm b/80-rhel/live/config_files/s390/genericdvd.prm new file mode 100644 index 0000000..b5d2731 --- /dev/null +++ b/80-rhel/live/config_files/s390/genericdvd.prm @@ -0,0 +1 @@ +ro ramdisk_size=40000 cio_ignore=all,!condev rd.cmdline=ask diff --git a/80-rhel/live/config_files/s390/redhat.exec b/80-rhel/live/config_files/s390/redhat.exec new file mode 100644 index 0000000..f1e5931 --- /dev/null +++ b/80-rhel/live/config_files/s390/redhat.exec @@ -0,0 +1,9 @@ +/* */ +'CL RDR' +'PURGE RDR ALL' +'SPOOL PUNCH * RDR' +'PUNCH KERNEL IMG A (NOH' +'PUNCH GENERIC PRM A (NOH' +'PUNCH INITRD IMG A (NOH' +'CH RDR ALL KEEP NOHOLD' +'I 00C' diff --git a/80-rhel/live/config_files/x86/boot.msg b/80-rhel/live/config_files/x86/boot.msg new file mode 100644 index 0000000..ff54899 --- /dev/null +++ b/80-rhel/live/config_files/x86/boot.msg @@ -0,0 +1,5 @@ + +splash.lss + + - Press the 0107 key to begin the installation process. + diff --git a/80-rhel/live/config_files/x86/grub.conf b/80-rhel/live/config_files/x86/grub.conf new file mode 100644 index 0000000..6c4a51f --- /dev/null +++ b/80-rhel/live/config_files/x86/grub.conf @@ -0,0 +1,13 @@ +#debug --graphics +default=1 +splashimage=@SPLASHPATH@ +timeout 60 +hiddenmenu +title Start @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet + initrd @INITRDPATH@ +title Test this media & start @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet + initrd @INITRDPATH@ diff --git a/80-rhel/live/config_files/x86/grub2-efi.cfg b/80-rhel/live/config_files/x86/grub2-efi.cfg new file mode 100644 index 0000000..2e24b15 --- /dev/null +++ b/80-rhel/live/config_files/x86/grub2-efi.cfg @@ -0,0 +1,36 @@ +set default="1" + +function load_video { + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus + insmod all_video +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=60 +### END /etc/grub.d/00_header ### + +search --no-floppy --set=root -l '@ISOLABEL@' + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet + initrdefi @INITRDPATH@ +} +menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet + initrdefi @INITRDPATH@ +} +submenu 'Troubleshooting -->' { + menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image nomodeset quiet + initrdefi @INITRDPATH@ + } +} diff --git a/80-rhel/live/config_files/x86/isolinux.cfg b/80-rhel/live/config_files/x86/isolinux.cfg new file mode 100644 index 0000000..bc36bb9 --- /dev/null +++ b/80-rhel/live/config_files/x86/isolinux.cfg @@ -0,0 +1,110 @@ +default vesamenu.c32 +timeout 600 + +display boot.msg + +# Clear the screen when exiting the menu, instead of leaving the menu displayed. +# For vesamenu, this means the graphical background is still displayed without +# the menu itself for as long as the screen remains in graphics mode. +menu clear +menu background splash.png +menu title @PRODUCT@ @VERSION@ +menu vshift 8 +menu rows 18 +menu margin 8 +#menu hidden +menu helpmsgrow 15 +menu tabmsgrow 13 + +# Border Area +menu color border * #00000000 #00000000 none + +# Selected item +menu color sel 0 #ffffffff #00000000 none + +# Title bar +menu color title 0 #ff7ba3d0 #00000000 none + +# Press [Tab] message +menu color tabmsg 0 #ff3a6496 #00000000 none + +# Unselected menu item +menu color unsel 0 #84b8ffff #00000000 none + +# Selected hotkey +menu color hotsel 0 #84b8ffff #00000000 none + +# Unselected hotkey +menu color hotkey 0 #ffffffff #00000000 none + +# Help text +menu color help 0 #ffffffff #00000000 none + +# A scrollbar of some type? Not sure. +menu color scrollbar 0 #ffffffff #ff355594 none + +# Timeout msg +menu color timeout 0 #ffffffff #00000000 none +menu color timeout_msg 0 #ffffffff #00000000 none + +# Command prompt text +menu color cmdmark 0 #84b8ffff #00000000 none +menu color cmdline 0 #ffffffff #00000000 none + +# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message. + +menu tabmsg Press Tab for full configuration options on menu items. + +menu separator # insert an empty line +menu separator # insert an empty line + +label linux + menu label ^Start @PRODUCT@ @VERSION@ + kernel vmlinuz + append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image quiet + +label check + menu label Test this ^media & start @PRODUCT@ @VERSION@ + menu default + kernel vmlinuz + append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet + +menu separator # insert an empty line + +# utilities submenu +menu begin ^Troubleshooting + menu title Troubleshooting + +label vesa + menu indent count 5 + menu label Start @PRODUCT@ @VERSION@ in ^basic graphics mode + text help + Try this option out if you're having trouble starting + @PRODUCT@ @VERSION@. + endtext + kernel vmlinuz + append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image nomodeset quiet + +label memtest + menu label Run a ^memory test + text help + If your system is having issues, a problem with your + system's memory may be the cause. Use this utility to + see if the memory is working correctly. + endtext + kernel memtest + +menu separator # insert an empty line + +label local + menu label Boot from ^local drive + localboot 0xffff + +menu separator # insert an empty line +menu separator # insert an empty line + +label returntomain + menu label Return to ^main menu + menu exit + +menu end diff --git a/80-rhel/live/efi.tmpl b/80-rhel/live/efi.tmpl new file mode 100644 index 0000000..572e07d --- /dev/null +++ b/80-rhel/live/efi.tmpl @@ -0,0 +1,62 @@ +<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel, extra_boot_args"/> +<% +EFIBOOTDIR="EFI/BOOT" +APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns" +APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol" +%> + +mkdir ${EFIBOOTDIR} +mkdir ${EFIBOOTDIR}/fonts/ +%if efiarch64: +install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI +install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/ +install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi +%endif +%if efiarch32: +install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI +install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/ +install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi +%endif +install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/ + +## actually make the EFI images +${make_efiboot("images/efiboot.img")} +%if domacboot: + ${make_efiboot("images/macboot.img", imgtype="apple")} +%endif + +## This is kinda gross, but then... so's EFI. +<%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')"> + <% + kdir = EFIBOOTDIR if include_kernel else KERNELDIR + eficonf = "%s/grub.cfg" % (EFIBOOTDIR, ) + args = "--label=ANACONDA" + if disk: args += " --disk" + if imgtype == "apple": args += ' --apple --icon=%s --diskname=%s --product="%s %s"' % (APPLE_EFI_ICON, APPLE_EFI_DISKNAME, product.name, product.version) + %> + %if include_kernel: + copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR} + copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR} + %endif + install ${configdir}/grub2-efi.cfg ${eficonf} + replace @PRODUCT@ '${product.name}' ${eficonf} + replace @VERSION@ ${product.version} ${eficonf} + replace @KERNELNAME@ vmlinuz ${eficonf} + replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf} + replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf} + replace @ISOLABEL@ '${isolabel}' ${eficonf} + replace @EXTRA@ '${extra_boot_args}' ${eficonf} + %if disk: + replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf} + %else: + replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${eficonf} + %endif + %if efiarch32 == 'IA32': + copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf + %endif + runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img} + %if include_kernel: + remove ${EFIBOOTDIR}/vmlinuz + remove ${EFIBOOTDIR}/initrd.img + %endif + diff --git a/80-rhel/live/live-install.tmpl b/80-rhel/live/live-install.tmpl new file mode 100644 index 0000000..d1acbdb --- /dev/null +++ b/80-rhel/live/live-install.tmpl @@ -0,0 +1,31 @@ +## livemedia-creator: Install packages needed for iso creation using per-arch templates +<%page args="basearch"/> + +## arch-specific bootloader packages +%if basearch == "aarch64": + installpkg efibootmgr + installpkg grub2-efi-aa64-cdboot shim-aa64 +%endif +%if basearch in ("arm", "armhfp"): + installpkg efibootmgr + installpkg grub2-efi-arm-cdboot + installpkg uboot-tools +%endif +%if basearch == "x86_64": + installpkg grub2-tools-efi + installpkg efibootmgr + installpkg shim-x64 grub2-efi-x64-cdboot + installpkg shim-ia32 grub2-efi-ia32-cdboot +%endif +%if basearch in ("i386", "x86_64"): + installpkg biosdevname memtest86+ syslinux + installpkg grub2-tools grub2-tools-minimal grub2-tools-extra +%endif +%if basearch in ("ppc64le"): + installpkg powerpc-utils + installpkg grub2-tools grub2-tools-minimal grub2-tools-extra + installpkg grub2-${basearch} +%endif +%if basearch == "s390x": + installpkg s390utils-base +%endif diff --git a/80-rhel/live/ppc.tmpl b/80-rhel/live/ppc.tmpl new file mode 100644 index 0000000..9b883f7 --- /dev/null +++ b/80-rhel/live/ppc.tmpl @@ -0,0 +1,127 @@ +<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel, extra_boot_args"/> +<% +configdir="tmp/config_files/ppc" +BOOTDIR="ppc" +GRUBDIR="boot/grub" +LIVEDIR="LiveOS" +MACDIR=BOOTDIR+"/mac" +NETBOOTDIR="images/netboot" +LORAXDIR="usr/share/lorax/" + +WRAPPER="usr/sbin/wrapper" +WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper" + +prepboot = "" + +## NOTE: yaboot freaks out and stops parsing its config if it sees a '\', +## so we can't use the udev escape sequences in the root arg. +## Instead we'll just replace any non-ASCII characters in the isolabel +## with '_', which means we won't need any udev escapes. +isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel) + +from os.path import basename +%> + +## Test ${runtime_img} to see if udf is needed +<% + import os + from pylorax.sysutils import joinpaths + if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" + else: + udfargs = "" +%> + +mkdir ${LIVEDIR} +install ${runtime_img} ${LIVEDIR}/squashfs.img +treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + +## install bootloaders. +## NOTE: there's two different bootloader setups here: +## ppc/chrp: for normal PPC systems. needs 'addnote' run on yaboot. +## uses /etc/yaboot.conf, as is the default. +## ppc/mac: for PowerMacs. no 'addnote' (it breaks some Macs!) +## ofboot.b picks one of /ppc/ppc{32,64}/yaboot.conf for yaboot, +## thus automatically booting the correct kernel for the machine. +mkdir ${BOOTDIR} +## boot stuff for normal (CHRP/PREP) PPC systems +install ${configdir}/bootinfo.txt ${BOOTDIR} + +mkdir ${GRUBDIR}/powerpc-ieee1275 +runcmd grub2-mkimage -O powerpc-ieee1275 -d /usr/lib/grub/powerpc-ieee1275 -p '()/boot/grub' \ +-o ${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http +install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275 +install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275 + + +install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg +replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg +replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg +replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg +replace @EXTRA@ '${extra_boot_args}' ${GRUBDIR}/grub.cfg + +install ${configdir}/mapping ${BOOTDIR} + +## NOTE: PPC is kind of funky. There's three possible "arch" setups here: +## ppc, ppc64, ppc64le and 'hybrid' (ppc userspace, both ppc & ppc64 kernels). + +## Install kernel and bootloader config (in separate places for each arch) +%for kernel in kernels: + <% + bits = 64 if kernel.arch in ("ppc64", "ppc64le") else 32 + ## separate dirs/images for each arch + KERNELDIR=BOOTDIR+"/ppc%s" % bits + NETIMG=NETBOOTDIR+"/ppc%s.img" % bits + %> + ## install kernel + mkdir ${KERNELDIR} ${NETBOOTDIR} + installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + + ## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img + runcmd ${inroot}/${WRAPPER} -p of \ + -D ${inroot}/${WRAPPER_DATA} \ + -i ${outroot}/${KERNELDIR}/initrd.img \ + ${outroot}/${KERNELDIR}/vmlinuz \ + -o ${outroot}/${NETIMG} + treeinfo images-${kernel.arch} zimage ${NETIMG} + ## PReP is 32-bit only + %if bits == 32: + ## Yes, this is supposed to be a relative path + <% prepboot="-prep-boot " + NETIMG %> + %endif +%endfor + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \ + ${prepboot} -part -hfs -T -r -l -J \ + -A "${product.name} ${product.version}" -sysid PPC -V '${isolabel}' \ + -volset "${product.version}" -volset-size 1 -volset-seqno 1 \ + -hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \ + -map ${inroot}/${configdir}/mapping \ + -no-desktop -allow-multidot ${udfargs} \ + -graft-points \ + ${BOOTDIR}=${outroot}/${BOOTDIR} \ + ${GRUBDIR}=${outroot}/${GRUBDIR} \ + ${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \ + ${LIVEDIR}=${outroot}/${LIVEDIR} ${filegraft} + +%for kernel in kernels: + treeinfo images-${kernel.arch} boot.iso images/boot.iso +%endfor diff --git a/80-rhel/live/ppc64le.tmpl b/80-rhel/live/ppc64le.tmpl new file mode 100644 index 0000000..95ffe15 --- /dev/null +++ b/80-rhel/live/ppc64le.tmpl @@ -0,0 +1,98 @@ +<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel"/> +<% +configdir="tmp/config_files/ppc" +BOOTDIR="ppc" +GRUBDIR="boot/grub" +LIVEDIR="LiveOS" +LORAXDIR="usr/share/lorax/" + +## NOTE: yaboot freaks out and stops parsing its config if it sees a '\', +## so we can't use the udev escape sequences in the root arg. +## Instead we'll just replace any non-ASCII characters in the isolabel +## with '_', which means we won't need any udev escapes. +isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel) + +from os.path import basename +%> + +## Test ${runtime_img} to see if udf is needed +<% + import os + from pylorax.sysutils import joinpaths + if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" + else: + udfargs = "" +%> + +mkdir ${LIVEDIR} +install ${runtime_img} ${LIVEDIR}/squashfs.img +treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + +## install the bootloaders +## ppc/chrp: for normal PPC systems. +## uses /ppc/bootinfo.txt in the iso root +## uses /boot/grub/grub.cfg in the iso root +mkdir ${BOOTDIR} +## boot stuff for normal (CHRP/PREP) PPC systems +install ${configdir}/bootinfo.txt ${BOOTDIR} + +mkdir ${GRUBDIR}/powerpc-ieee1275 +## "()" means the current device to grub2 +runcmd grub2-mkimage --format=powerpc-ieee1275 --directory=/usr/lib/grub/powerpc-ieee1275 --prefix="()/"${GRUBDIR} \ +--output=${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http +install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275 +install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275 + +install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg +replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg +replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg +replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg + +## Install kernel and bootloader config (in separate places for each arch) +%for kernel in kernels: + <% + bits = 64 + ## separate dirs/images for each arch + KERNELDIR=BOOTDIR+"/ppc%s" % bits + %> + ## install kernel + mkdir ${KERNELDIR} + installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + + treeinfo images-${kernel.arch} zimage +%endfor + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +## make boot.iso +runcmd mkisofs -v -U -J -R -T \ + -o ${outroot}/images/boot.iso \ + -part -hfs -r -l -sysid PPC \ + -A "${product.name} ${product.version}" -V '${isolabel}' \ + -volset "${product.version}" -volset-size 1 -volset-seqno 1 \ + -hfs-volid ${product.version} \ + -chrp-boot -map ${inroot}/${configdir}/mapping \ + -no-desktop -allow-multidot ${udfargs} -graft-points \ + ${BOOTDIR}=${outroot}/${BOOTDIR} \ + ${GRUBDIR}=${outroot}/${GRUBDIR} \ + ${LIVEDIR}=${outroot}/${LIVEDIR} ${filegraft} + +%for kernel in kernels: + treeinfo images-${kernel.arch} boot.iso images/boot.iso +%endfor diff --git a/80-rhel/live/s390.tmpl b/80-rhel/live/s390.tmpl new file mode 100644 index 0000000..2e30bd2 --- /dev/null +++ b/80-rhel/live/s390.tmpl @@ -0,0 +1,91 @@ +<%page args="kernels, runtime_img, runtime_base, basearch, outroot, isolabel, extra_boot_args"/> +<% +configdir="tmp/config_files/s390" +BOOTDIR="images" +KERNELDIR=BOOTDIR +INITRD_ADDRESS="0x02000000" +LIVEDIR="LiveOS" +LORAXDIR="usr/share/lorax/" +MKS390IMAGE="/usr/bin/mk-s390image" +# The assumption seems to be that there is only one s390 kernel, ever +kernel = kernels[0] + +## Don't allow spaces or escape characters in the iso label +def valid_label(ch): + return ch.isalnum() or ch == '_' + +isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel) + +from os.path import basename +import os +from pylorax.sysutils import joinpaths + +# Test the runtime_img, if it is > 4GiB we need to set -iso-level to 3 +if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" +else: + udfargs = "" +%> + +mkdir ${LIVEDIR} +install ${runtime_img} ${LIVEDIR}/squashfs.img +treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + +mkdir ${BOOTDIR} +## install bootloader (such as it is) and bootloader config +install ${configdir}/redhat.exec ${BOOTDIR} +install ${configdir}/generic.prm ${BOOTDIR} +install ${configdir}/cdboot.prm ${BOOTDIR} +install ${configdir}/generic.ins . + +## configure bootloader +replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins +replace @EXTRA@ '${extra_boot_args}' ${BOOTDIR}/generic.prm +replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/cdboot.prm +replace @EXTRA@ '${extra_boot_args}' ${BOOTDIR}/cdboot.prm + +## install kernel +installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img +installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + +## s390 needs some extra boot config +createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize + +## s390 also has some special treeinfo data +treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize +treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm +treeinfo images-${basearch} generic.ins generic.ins +treeinfo images-${basearch} redhat.exec ${BOOTDIR}/redhat.exec +treeinfo images-${basearch} cdboot.prm ${BOOTDIR}/cdboot.prm + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +## Make a combined kernel+initrd image for the iso +runcmd ${MKS390IMAGE} ${outroot}/${KERNELDIR}/kernel.img \ + ${outroot}/${BOOTDIR}/cdboot.img \ + -r ${outroot}/${KERNELDIR}/initrd.img \ + -p ${outroot}/${BOOTDIR}/cdboot.prm + +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso \ + -b ${BOOTDIR}/cdboot.img -c ${BOOTDIR}/boot.cat \ + -boot-load-size 4 -no-emul-boot \ + -R -J -V '${isolabel}' ${udfargs} -graft-points \ + ${BOOTDIR}=${outroot}/${BOOTDIR} \ + ${LIVEDIR}=${outroot}/${LIVEDIR} \ + ${filegraft} +treeinfo images-${basearch} boot.iso images/boot.iso diff --git a/80-rhel/live/x86.tmpl b/80-rhel/live/x86.tmpl new file mode 100644 index 0000000..4d46043 --- /dev/null +++ b/80-rhel/live/x86.tmpl @@ -0,0 +1,129 @@ +<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel, extra_boot_args"/> +<% +configdir="tmp/config_files/x86" +SYSLINUXDIR="usr/share/syslinux" +PXEBOOTDIR="images/pxeboot" +BOOTDIR="isolinux" +KERNELDIR=PXEBOOTDIR +LIVEDIR="LiveOS" +LORAXDIR="usr/share/lorax/" + +## Don't allow spaces or escape characters in the iso label +def valid_label(ch): + return ch.isalnum() or ch == '_' + +isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel) + +from os.path import basename +%> + +## Test ${runtime_img} to see if udf is needed +<% + import os + from pylorax.sysutils import joinpaths + if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" + else: + udfargs = "" +%> + +mkdir ${LIVEDIR} +install ${runtime_img} ${LIVEDIR}/squashfs.img +treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + +## install bootloader and config files +mkdir ${BOOTDIR} +install ${SYSLINUXDIR}/isolinux.bin ${BOOTDIR} +install ${SYSLINUXDIR}/vesamenu.c32 ${BOOTDIR} +install ${SYSLINUXDIR}/ldlinux.c32 ${BOOTDIR} +install ${SYSLINUXDIR}/libcom32.c32 ${BOOTDIR} +install ${SYSLINUXDIR}/libutil.c32 ${BOOTDIR} +install ${configdir}/isolinux.cfg ${BOOTDIR} +install ${configdir}/boot.msg ${BOOTDIR} +install ${configdir}/grub.conf ${BOOTDIR} +install usr/share/anaconda/boot/syslinux-splash.png ${BOOTDIR}/splash.png +install boot/memtest* ${BOOTDIR}/memtest + +## configure bootloader +replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg +replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg +replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg +replace @EXTRA@ '${extra_boot_args}' ${BOOTDIR}/isolinux.cfg + +## install kernels +mkdir ${KERNELDIR} +%for kernel in kernels: + %if kernel.flavor: + installkernel images-xen ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor} + installinitrd images-xen ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img + %else: + installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + %endif +%endfor + +hardlink ${KERNELDIR}/vmlinuz ${BOOTDIR} +hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} +%if basearch == 'x86_64': + treeinfo images-xen kernel ${KERNELDIR}/vmlinuz + treeinfo images-xen initrd ${KERNELDIR}/initrd.img +%endif + +## WHeeeeeeee, EFI. +<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %> +%if exists("boot/efi/EFI/*/gcdia32.efi"): + <% efiarch32 = 'IA32' %> +%endif +%if exists("boot/efi/EFI/*/gcdx64.efi"): + <% efiarch64 = 'X64' %> +%endif +%if (efiarch32 or efiarch64) and basearch != 'i386': + <% + efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) + images = ["images/efiboot.img"] + if domacboot: + images.append("images/macboot.img") + %> + %for img in images: + <% + efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img) + efigraft += " {0}={1}/{0}".format(img,outroot) + %> + treeinfo images-${basearch} ${img|basename} ${img} + %endfor + <% efihybrid = "--uefi --mac" if domacboot else "--uefi" %> + <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel, extra_boot_args=extra_boot_args"/> +%endif + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"]; compressargs=""; %> +%if basearch == 'i386': + # Limit the amount of memory xz uses on i386 + <% compressargs="--xz -9 --memlimit-compress=3700MiB" %> +%endif +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${compressargs} ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso \ + -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ + -boot-load-size 4 -boot-info-table -no-emul-boot \ + ${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \ + -graft-points \ + ${BOOTDIR}=${outroot}/${BOOTDIR} \ + ${KERNELDIR}=${outroot}/${KERNELDIR} \ + ${LIVEDIR}=${outroot}/${LIVEDIR} \ + ${efigraft} ${filegraft} +runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso +treeinfo images-${basearch} boot.iso images/boot.iso diff --git a/80-rhel/ppc.tmpl b/80-rhel/ppc.tmpl new file mode 100644 index 0000000..2faf364 --- /dev/null +++ b/80-rhel/ppc.tmpl @@ -0,0 +1,116 @@ +<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel"/> +<% +configdir="tmp/config_files/ppc" +BOOTDIR="ppc" +GRUBDIR="boot/grub" +STAGE2IMG="images/install.img" +MACDIR=GRUBDIR+"/powerpc-ieee1275" +LORAXDIR="usr/share/lorax/" + +## NOTE: yaboot freaks out and stops parsing its config if it sees a '\', +## so we can't use the udev escape sequences in the root arg. +## Instead we'll just replace any non-ASCII characters in the isolabel +## with '_', which means we won't need any udev escapes. +isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel) + +## Anaconda finds the CDROM device automatically +rootarg = "" + +from os.path import basename +%> + +## Test ${runtime_img} to see if udf is needed +<% + import os + from pylorax.sysutils import joinpaths + if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" + else: + udfargs = "" +%> + +mkdir images +install ${runtime_img} ${STAGE2IMG} +treeinfo stage2 mainimage ${STAGE2IMG} + +## install bootloaders. +## NOTE: there's two different bootloader setups here: +## ppc/chrp: for normal PPC systems. needs 'addnote' run on yaboot. +## uses /etc/yaboot.conf, as is the default. +## ppc/mac: for PowerMacs. no 'addnote' (it breaks some Macs!) +## ofboot.b picks one of /ppc/ppc{32,64}/yaboot.conf for yaboot, +## thus automatically booting the correct kernel for the machine. +mkdir ${BOOTDIR} +## boot stuff for normal (CHRP/PREP) PPC systems +install ${configdir}/bootinfo.txt ${BOOTDIR} + +mkdir ${GRUBDIR}/powerpc-ieee1275 +## "()" means the current device to grub2 +runcmd grub2-mkimage --format=powerpc-ieee1275 --directory=/usr/lib/grub/powerpc-ieee1275 --prefix="()/"${GRUBDIR} \ +--output=${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http +install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275 +install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275 + +install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg +replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg +replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg +replace @ROOT@ "${rootarg}" ${GRUBDIR}/grub.cfg + +install ${configdir}/mapping ${BOOTDIR} + +## NOTE: PPC is kind of funky. There's three possible "arch" setups here: +## ppc, ppc64, ppc64le, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels). + +## Install kernel and bootloader config (in separate places for each arch) +%for kernel in kernels: + <% + bits = 64 + ## separate dirs/images for each arch + KERNELDIR=BOOTDIR+"/ppc%s" % bits + %> + ## install kernel + mkdir ${KERNELDIR} + installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + + treeinfo images-${kernel.arch} zimage +%endfor + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +# Inherit iso-graft/ if it exists from external templates +<% + import os + if os.path.exists(workdir + "/iso-graft"): + filegraft += " " + workdir + "/iso-graft" +%> + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \ + -part -hfs -T -r -l -J \ + -A "${product.name} ${product.version}" -sysid PPC -V '${isolabel}' \ + -volset "${product.version}" -volset-size 1 -volset-seqno 1 \ + -hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \ + -map ${inroot}/${configdir}/mapping \ + -no-desktop -allow-multidot ${udfargs} -graft-points \ + ${BOOTDIR}=${outroot}/${BOOTDIR} \ + ${GRUBDIR}=${outroot}/${GRUBDIR} \ + ${STAGE2IMG}=${outroot}/${STAGE2IMG} ${filegraft} + +%for kernel in kernels: + treeinfo images-${kernel.arch} boot.iso images/boot.iso +%endfor diff --git a/80-rhel/ppc64le.tmpl b/80-rhel/ppc64le.tmpl new file mode 100644 index 0000000..0c2c0d1 --- /dev/null +++ b/80-rhel/ppc64le.tmpl @@ -0,0 +1,107 @@ +<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel"/> +<% +configdir="tmp/config_files/ppc" +BOOTDIR="ppc" +GRUBDIR="boot/grub" +STAGE2IMG="images/install.img" +LORAXDIR="usr/share/lorax/" + +## Don't allow spaces or escape characters in the iso label +def valid_label(ch): + return ch.isalnum() or ch == '_' + +isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel) + +from os.path import basename +%> + +## Test ${runtime_img} to see if udf is needed +<% + import os + from pylorax.sysutils import joinpaths + if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" + else: + udfargs = "" +%> + +mkdir images +install ${runtime_img} ${STAGE2IMG} +treeinfo stage2 mainimage ${STAGE2IMG} + +## install the bootloaders +## ppc/chrp: for normal PPC systems. +## uses /ppc/bootinfo.txt in the iso root +## uses /boot/grub/grub.cfg in the iso root +mkdir ${BOOTDIR} +## boot stuff for normal (CHRP/PREP) PPC systems +install ${configdir}/bootinfo.txt ${BOOTDIR} + +mkdir ${GRUBDIR}/powerpc-ieee1275 +## "()" means the current device to grub2 +runcmd grub2-mkimage --format=powerpc-ieee1275 --directory=/usr/lib/grub/powerpc-ieee1275 --prefix="()/"${GRUBDIR} \ +--output=${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http +install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275 +install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275 + +install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg +replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg +replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg +replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg + +install ${configdir}/mapping ${BOOTDIR} + +## Install kernel and bootloader config (in separate places for each arch) +%for kernel in kernels: + <% + bits = 64 + ## separate dirs/images for each arch + KERNELDIR=BOOTDIR+"/ppc%s" % bits + %> + ## install kernel + mkdir ${KERNELDIR} + installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + + treeinfo images-${kernel.arch} zimage +%endfor + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +# Inherit iso-graft/ if it exists from external templates +<% + import os + if os.path.exists(workdir + "/iso-graft"): + filegraft += " " + workdir + "/iso-graft" +%> + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +## make boot.iso +runcmd mkisofs -v -U -J -R -T \ + -o ${outroot}/images/boot.iso \ + -part -hfs -r -l -sysid PPC \ + -A "${product.name} ${product.version}" -V '${isolabel}' \ + -volset "${product.version}" -volset-size 1 -volset-seqno 1 \ + -hfs-volid ${product.version} \ + -chrp-boot -map ${inroot}/${configdir}/mapping \ + -no-desktop -allow-multidot ${udfargs} -graft-points \ + ${BOOTDIR}=${outroot}/${BOOTDIR} \ + ${GRUBDIR}=${outroot}/${GRUBDIR} \ + ${STAGE2IMG}=${outroot}/${STAGE2IMG} ${filegraft} + +%for kernel in kernels: + treeinfo images-${kernel.arch} boot.iso images/boot.iso +%endfor diff --git a/80-rhel/pxe-live/pxe-config.tmpl b/80-rhel/pxe-live/pxe-config.tmpl new file mode 100644 index 0000000..6b841bb --- /dev/null +++ b/80-rhel/pxe-live/pxe-config.tmpl @@ -0,0 +1,3 @@ +# PXE configuration template generated by livemedia-creator +kernel ${kernel} +append initrd=${initrd} root=live:/${liveimg} ${addargs} diff --git a/80-rhel/runtime-cleanup.tmpl b/80-rhel/runtime-cleanup.tmpl new file mode 100644 index 0000000..48edfc1 --- /dev/null +++ b/80-rhel/runtime-cleanup.tmpl @@ -0,0 +1,368 @@ +## lorax template file: cleanup for the ramdisk (runtime image) +<%page args="libdir, branding, root"/> + +## remove the sources +remove usr/share/i18n + +## not required packages installed as dependencies +## perl is needed on s390x +## perl needed for powerpc-utils on PPC +## perl is needed by /usr/bin/rxe_cfg from libibverbs + +## no sound support, thanks +removepkg flac gstreamer-tools libsndfile pulseaudio* sound-theme-freedesktop +## we don't create new initramfs/bootloader conf inside anaconda +## (that happens inside the target system after we install dracut/grubby) +removepkg dracut-network grubby anaconda-dracut +## In order to execute the /usr move on upgrades we need convertfs from dracut +## We also need dracut-shutdown.service and dracut-initramfs-restore to reboot +removefrom dracut --allbut /usr/lib/dracut/modules.d/30convertfs/convertfs.sh \ + /usr/lib/dracut/modules.d/99base/dracut-lib.sh \ + /usr/lib/systemd/* /usr/lib/dracut/modules.d/98dracut-systemd/*.service \ + /usr/lib/dracut/dracut-initramfs-restore +## we don't run SELinux (not in enforcing, anyway) +removepkg checkpolicy selinux-policy libselinux-utils + +## selinux checks for the /etc/selinux/config file's existance +## The removepkg above removes it, create an empty one. See rhbz#1243168 +append etc/selinux/config "" + +## anaconda has its own repo files +removefrom fedora-release --allbut /etc/os-release /usr/lib/os-release \ + /usr/lib/os.release.d/* +removepkg fedora-release-rawhide + +## keep enough of shadow-utils to create accounts +removefrom shadow-utils --allbut /usr/bin/chage /usr/sbin/chpasswd \ + /usr/sbin/groupadd /usr/sbin/useradd \ + /etc/default/useradd + +## remove other account management tools +removepkg usermode usermode-gtk passwd +## no services to turn on/off (keep the /etc/init.d link though) +removefrom chkconfig --allbut /etc/init.d +## Miscellanous unnecessary gpg program +removepkg pinentry +## no storage device monitoring +removepkg device-mapper-event dmraid-events sgpio +## no notifications in anaconda +removepkg notification-daemon +## logrotate isn't useful in anaconda +removepkg logrotate +remove /etc/logrotate.d +## anaconda needs this to do media check +removefrom isomd5sum --allbut /usr/bin/checkisomd5 + +## systemd-nspawn isn't very useful and doesn't link anyway without iptables, +## and there's no need for a bunch of zsh files without zsh +removefrom systemd /usr/bin/systemd-nspawn /usr/share/zsh + +## various other things we remove to save space +removepkg avahi-autoipd coreutils-libs dash db4-utils diffutils file +removepkg genisoimage info iptables +removepkg jasper-libs libXxf86misc +removepkg libasyncns libhbaapi libhbalinux +removepkg libmcpp libtiff linux-atm-libs +removepkg lvm2-libs m4 mailx makebootfat mcpp +removepkg mingetty mobile-broadband-provider-info pkgconfig ppp pth +removepkg rmt rpcbind squashfs-tools system-config-firewall-base +removepkg tigervnc-license ttmkfdir xml-common xorg-x11-font-utils +removepkg xorg-x11-server-common yum-utils firewalld + +## other removals +remove /home /media /opt /srv /tmp/* +remove /usr/etc /usr/games /usr/local /usr/tmp +remove /usr/share/doc /usr/share/info /usr/share/man /usr/share/gnome +remove /usr/share/mime/application /usr/share/mime/audio /usr/share/mime/image +remove /usr/share/mime/inode /usr/share/mime/message /usr/share/mime/model +remove /usr/share/mime/multipart /usr/share/mime/packages /usr/share/mime/text +remove /usr/share/mime/video /usr/share/mime/x-content /usr/share/mime/x-epoc +remove /var/db /var/games /var/tmp /var/yp /var/nis /var/opt /var/local +remove /var/mail /var/spool /var/preserve /var/report +remove /var/lib/rpm/* /var/lib/yum /var/lib/dnf +## clean up the files created by various '> /dev/null's +remove /dev/* + +## icons cache +remove /usr/share/icons/*/icon-theme.cache + +## clean up kernel modules +removekmod sound drivers/media drivers/hwmon \ + net/atm net/bluetooth net/sched net/sctp \ + net/rds net/l2tp net/decnet net/netfilter net/ipv4 net/ipv6 \ + drivers/watchdog drivers/rtc drivers/input/joystick \ + drivers/bluetooth drivers/edac drivers/staging \ + drivers/usb/serial drivers/usb/host drivers/usb/misc \ + fs/ocfs2 fs/ceph fs/nfsd fs/ubifs fs/nilfs2 \ + arch/x86/kvm +## Need to keep virtio_console.ko and ipmi stuff in drivers/char +## Also keep virtio-rng so that the installer can get sufficient randomness for +## LUKS setup. +removekmod drivers/char --allbut virtio_console hw_random \ + virtio-rng ipmi hmcdrv +removekmod drivers/hid --allbut hid-logitech-dj hid-logitech-hidpp hid-multitouch +removekmod drivers/video --allbut hyperv_fb syscopyarea sysfillrect sysimgblt fb_sys_fops +remove lib/modules/*/{build,source,*.map} +## NOTE: depmod gets re-run after cleanup finishes + +## remove unused themes, theme engines, icons, etc. +removefrom gtk2 /usr/${libdir}/gtk-2.0/*/{engines,printbackends}/* +removefrom gtk2 /usr/share/themes/* +## clearlooks is the theme we use for gtk2 +removefrom gtk2-engines --allbut /usr/${libdir}/*/libclearlooks.so \ + /usr/share/themes/Clearlooks/* +removefrom gtk3 /usr/${libdir}/gtk-3.0/*/printbackends/* +removefrom gtk3 /usr/share/themes/* +removefrom metacity --allbut /usr/bin/* /usr/${libdir}/* /etc/* + +## filesystem tools +removefrom e2fsprogs /usr/share/locale/* +removefrom xfsprogs /usr/share/locale/* /usr/share/doc/* /usr/share/man/* +removefrom xfsdump --allbut /usr/sbin/* + +## other package specific removals +removefrom GConf2 /etc/rpm/* /etc/xdg/* /usr/bin/* +removefrom GConf2 /usr/${libdir}/GConf/2/libgconfbackend-{evoldap,oldxml}* +removefrom GConf2 /usr/${libdir}/gio/modules/* +removefrom GConf2 /usr/libexec/gconf-defaults-mechanism /usr/share/GConf/* +removefrom GConf2 /usr/share/locale/* /usr/share/sgml/* +removefrom NetworkManager /usr/share/NetworkManager/* +removefrom NetworkManager /usr/share/locale/*/NetworkManager.mo +removefrom nm-connection-editor /usr/${libdir}/* +removefrom nm-connection-editor /usr/share/applications/* +removefrom anaconda /etc/* /usr/share/applications/* /usr/share/icons/* +removefrom atk /usr/share/locale/* +removefrom audit /etc/* /sbin/audispd /sbin/auditctl /sbin/aureport +removefrom audit /sbin/ausearch /sbin/autrace /usr/bin/* +removefrom audit-libs /etc/* /${libdir}/libauparse* +removefrom authconfig /usr/sbin/* /usr/share/* +removefrom bash /etc/* /usr/bin/bashbug* /usr/share/* +removefrom bind-utils /usr/bin/dig /usr/bin/host /usr/bin/nsupdate +removefrom bitmap-fangsongti-fonts /usr/share/fonts/* +removefrom ca-certificates /etc/pki/java/* +removefrom ca-certificates /etc/pki/tls/certs/ca-bundle.trust.crt /etc/ssl/* +removefrom cairo /usr/${libdir}/libcairo-script* /usr/bin/cairo-sphinx +removefrom coreutils /etc/* /usr/bin/link /usr/bin/nice /usr/bin/stty /usr/bin/su /usr/bin/unlink +removefrom coreutils /usr/sbin/runuser /usr/bin/[ /usr/bin/base64 /usr/bin/chcon +removefrom coreutils /usr/bin/cksum /usr/bin/comm /usr/bin/csplit +removefrom coreutils /usr/bin/dir /usr/bin/dircolors +removefrom coreutils /usr/bin/expand /usr/bin/factor +removefrom coreutils /usr/bin/fold /usr/bin/groups /usr/bin/hostid +removefrom coreutils /usr/bin/install /usr/bin/join /usr/bin/logname +removefrom coreutils /usr/bin/mkfifo /usr/bin/nl /usr/bin/nohup /usr/bin/nproc +removefrom coreutils /usr/bin/pathchk +removefrom coreutils /usr/bin/pinky /usr/bin/pr /usr/bin/printenv +removefrom coreutils /usr/bin/printf /usr/bin/ptx /usr/bin/runcon +removefrom coreutils /usr/bin/sha224sum /usr/bin/sha384sum +removefrom coreutils /usr/bin/sha512sum /usr/bin/shuf /usr/bin/stat +removefrom coreutils /usr/bin/stdbuf /usr/bin/sum /usr/bin/test +removefrom coreutils /usr/bin/timeout /usr/bin/truncate /usr/bin/tsort +removefrom coreutils /usr/bin/unexpand /usr/bin/users /usr/bin/vdir +removefrom coreutils /usr/bin/who /usr/bin/whoami /usr/bin/yes /usr/share/* +removefrom cpio /usr/share/* +removefrom cracklib /usr/sbin/* +removefrom cracklib-dicts /usr/${libdir}/* /usr/sbin/* +removefrom cryptsetup-luks /usr/share/* +removefrom cyrus-sasl-lib /usr/sbin/* +removefrom db4 /usr/* +removefrom dbus-glib /usr/bin/* +removefrom dbus-x11 /etc/X11/* +removefrom dejavu-sans-fonts --allbut *.conf */DejaVuSans{,-Bold}.ttf +removefrom dejavu-sans-mono-fonts --allbut *.conf */DejaVuSansMono.ttf +removefrom dhclient /usr/lib/* /usr/share/* +removefrom dnsmasq /etc/rc.d/* /usr/sbin/* +removefrom dump /etc/* +removefrom elfutils-libelf /usr/share/locale/* +removefrom expat /usr/bin/* +removefrom fcoe-utils /etc/rc.d/* /usr/libexec/fcoe/dcbcheck.sh +removefrom fcoe-utils /usr/libexec/fcoe/fcc.sh /usr/libexec/fcoe/fcoe-setup.sh +removefrom fcoe-utils /usr/libexec/fcoe/fcoedump.sh /usr/sbin/fcnsq +removefrom fcoe-utils /usr/sbin/fcoeadm /usr/sbin/fcping /usr/sbin/fcrls +removefrom file-libs /usr/share/* +removefrom findutils /usr/bin/oldfind /usr/share/* +removefrom fontconfig /usr/bin/* +removefrom gawk /usr/bin/{igawk,pgawk} /usr/libexec/* /usr/share/* +removefrom gdb /usr/share/* /usr/include/* /etc/gdbinit* +removefrom gdisk /usr/share/* +removefrom gdk-pixbuf2 /usr/share/locale* +removefrom gfs2-utils /usr/sbin/* +removefrom glib2 /etc/* /usr/bin/* /usr/share/locale/* +removefrom glibc /etc/gai.conf /etc/localtime /etc/rpc +removefrom glibc /lib/*/nosegneg/* /${libdir}/libBrokenLocale* +removefrom glibc /${libdir}/libSegFault* /${libdir}/libanl* +removefrom glibc /${libdir}/libcidn* /${libdir}/libnss_compat* +removefrom glibc /${libdir}/libnss_hesiod* /${libdir}/libnss_nis* +# python-pyudev uses ctypes.util.find_library, which uses /sbin/ldconfig +removefrom glibc /${libdir}/rtkaio* /sbin/sln +removefrom glibc /usr/libexec/* /usr/sbin/* +removefrom glibc-common /etc/* /usr/bin/catchsegv /usr/bin/gencat +removefrom glibc-common /usr/bin/getent +removefrom glibc-common /usr/bin/locale /usr/bin/rpcgen /usr/bin/sprof +# NB: we keep /usr/bin/localedef so anaconda can inspect payload locale info +removefrom glibc-common /usr/bin/tzselect +removefrom glibc-common /usr/libexec/* /usr/sbin/* +removefrom gmp /usr/${libdir}/libgmpxx.* /usr/${libdir}/libmp.* +removefrom gnome-bluetooth-libs /usr/${libdir}/libgnome-bluetooth* +removefrom gnome-bluetooth-libs /usr/share/* +removefrom gnutls /usr/share/locale/* +removefrom google-noto-sans-cjk-ttc-fonts /usr/share/fonts/google-noto-cjk/NotoSansCJK-{Black,Bold,*Light,Medium,Thin}.ttc +removefrom grep /etc/* /usr/share/locale/* +removefrom gstreamer /usr/bin/* /usr/${libdir}/gstreamer-0.10/* +removefrom gstreamer /usr/${libdir}/libgst* /usr/libexec/* /usr/share/locale/* +removefrom gtk2 /usr/bin/update-gtk-immodules +removefrom gtk3 /usr/${libdir}/gtk-3.0/* +removefrom gzip /usr/bin/{gzexe,zcmp,zdiff,zegrep,zfgrep,zforce,zgrep,zless,zmore,znew} +removefrom hwdata /etc/* /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids +removefrom hwdata /usr/share/hwdata/upgradelist +removefrom initscripts /etc/ppp/* /usr/sbin/* /usr/share/locale/* +removefrom iproute --allbut /usr/sbin/{ip,routef,routel,rtpr} +removefrom iscsi-initiator-utils /etc/rc.d/* +removefrom kbd --allbut */bin/{dumpkeys,kbd_mode,loadkeys,setfont,unicode_*,chvt} +removefrom less /etc/* +removefrom libX11-common /usr/share/X11/XErrorDB +removefrom libbonobo /etc/* /usr/bin/* /usr/sbin/* /usr/share/locale/* +removefrom libbonobo /usr/${libdir}/bonobo/monikers/* +removefrom libbonobo /usr/${libdir}/orbit-2.0/Bonobo_module.so +removefrom libcanberra /usr/${libdir}/libcanberra-* +removefrom libcanberra-gtk2 /usr/${libdir}/gtk-2.0/* +removefrom libcanberra-gtk3 /usr/bin/* +removefrom libcap /usr/sbin/* +removefrom libconfig /usr/${libdir}/libconfig++* +removefrom libcroco /usr/bin/* +removefrom libgnome-keyring /usr/share/locale/* +removefrom libgnomecanvas /usr/share/locale/* +removefrom libgpg-error /usr/bin/* /usr/share/locale/* +removefrom libgssglue /etc/* +removefrom libidn /usr/bin/* /usr/share/locale/* +removefrom libmlx4 /etc/rdma/* /usr/${libdir}/* +removefrom libnotify /usr/bin/* +removefrom librsvg2 /usr/bin/* +removefrom libselinux /usr/sbin/* +removefrom libsemanage /etc/selinux/* +removefrom libstdc++ /usr/share/* +removefrom libuser /usr/bin/* /usr/sbin/* /usr/share/locale/* +removefrom libvorbis /usr/${libdir}/libvorbisenc.* +removefrom libxml2 /usr/bin/* +removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.a +removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.la +removefrom lldpad /etc/* +removefrom lua /usr/bin/* +removefrom madan-fonts /usr/share/fonts/madan/* +removefrom mdadm /etc/* /usr/lib/systemd/system/mdmonitor* +removefrom module-init-tools /etc/* /usr/sbin/insmod.static /usr/sbin/weak-modules +removefrom mt-st /etc/* /usr/sbin/* +removefrom mtools /etc/* +removefrom ncurses /usr/bin/captoinfo /usr/bin/infocmp /usr/bin/infotocap +removefrom ncurses /usr/bin/reset /usr/bin/tabs /usr/bin/tic /usr/bin/toe +removefrom ncurses /usr/bin/tput /usr/bin/tset +removefrom ncurses-libs /usr/${libdir}/libform* +## libmenu.so is needed by lp_diag binary from ppc64-diag which is a PowerPc specific package +%if basearch not in ("ppc", "ppc64", "ppc64le"): + removefrom ncurses-libs /usr/${libdir}/libmenu* +%endif +removefrom ncurses-libs /usr/${libdir}/libpanel.* /usr/${libdir}/libtic* +removefrom net-tools */bin/netstat */sbin/ether-wake */sbin/ipmaddr +removefrom net-tools */sbin/iptunnel */sbin/mii-diag */sbin/mii-tool +removefrom net-tools */sbin/nameif */sbin/plipconfig */sbin/slattach +removefrom net-tools /usr/share/locale/* +removefrom newt /usr/share/locale/* +removefrom nfs-utils /etc/nfsmount.conf +removefrom nfs-utils /etc/rc.d/init.d/* /lib/systemd/system/* +removefrom nfs-utils /etc/sysconfig/nfs /sbin/rpc.statd /usr/sbin/exportfs +removefrom nfs-utils /usr/sbin/gss_clnt_send_err /usr/sbin/gss_destroy_creds +removefrom nfs-utils /usr/sbin/mountstats /usr/sbin/nfsiostat +removefrom nfs-utils /usr/sbin/nfsstat /usr/sbin/rpc.gssd /usr/sbin/rpc.idmapd +removefrom nfs-utils /usr/sbin/rpc.mountd /usr/sbin/rpc.nfsd +removefrom nfs-utils /usr/sbin/rpc.svcgssd /usr/sbin/rpcdebug +removefrom nfs-utils /usr/sbin/showmount /usr/sbin/sm-notify +removefrom nfs-utils /usr/sbin/start-statd /var/lib/nfs/etab +removefrom nfs-utils /var/lib/nfs/rmtab /var/lib/nfs/state /var/lib/nfs/xtab +removefrom nss-softokn /usr/${libdir}/nss/* +removefrom openldap /etc/openldap/* /usr/${libdir}/libldap_r-* +removefrom openssh /usr/libexec/* +removefrom openssh-clients /etc/ssh/* /usr/bin/ssh-* +removefrom openssh-clients /usr/libexec/* +removefrom openssh-server /etc/ssh/* /usr/libexec/openssh/sftp-server +removefrom openssl /etc/pki/* /usr/bin/* /usr/${libdir}/openssl/* +removefrom pam /usr/sbin/* /usr/share/locale/* +removefrom policycoreutils /etc/* /usr/bin/* /usr/share/locale/* +removefrom polkit /usr/bin/* +removefrom polkit-desktop-policy /var/lib/* +removefrom popt /usr/share/locale/* +removefrom procps /usr/bin/free /usr/bin/pgrep /usr/bin/pkill +removefrom procps /usr/bin/pmap /usr/bin/pwdx /usr/bin/skill /usr/bin/slabtop +removefrom procps /usr/bin/snice /usr/bin/tload /usr/bin/uptime +removefrom procps /usr/bin/vmstat /usr/bin/w /usr/bin/watch +removefrom psmisc /usr/share/locale/* +removefrom pygtk2 /usr/bin/* /usr/${libdir}/pygtk/* +removefrom pykickstart /usr/bin/* /usr/share/locale/* +removefrom readline /usr/${libdir}/libhistory* +removefrom libreport /usr/bin/* /usr/share/locale/* +removefrom rpm /usr/share/locale/* +removefrom rsync /etc/* +removefrom sed /usr/share/locale/* +removefrom smartmontools /etc/* /usr/sbin/smartd +removefrom smartmontools /usr/sbin/update-smart-drivedb +removefrom smartmontools /usr/share/smartmontools/* +removefrom sqlite /usr/bin/* +removefrom system-config-date /etc/* /usr/bin/* /usr/share/icons/* +removefrom system-config-keyboard /etc/* /usr/bin/* /usr/share/icons/* +removefrom sysvinit-tools /usr/bin/* +removefrom tar /usr/share/locale/* +removefrom usbutils /usr/bin/* +removefrom util-linux --allbut \ + /usr/bin/{dmesg,eject,getopt,kill,login,lsblk,more,mount,umount,mountpoint,findmnt} \ + /etc/mtab /etc/pam.d/login /etc/pam.d/remote \ + /usr/sbin/{agetty,blkid,blockdev,clock,fdisk,fsck,fstrim,hwclock,losetup} \ + /usr/sbin/{mkswap,swaplabel,nologin,sfdisk,swapoff,swapon,wipefs,partx,fsfreeze} \ + /usr/bin/{logger,hexdump,flock,lscpu,chmem,lsmem} +removefrom volume_key-libs /usr/share/locale/* +removefrom wget /etc/* /usr/share/locale/* +removefrom xorg-x11-drv-intel /usr/${libdir}/libI* +removefrom xorg-x11-drv-openchrome /usr/${libdir}/libchrome* +removefrom xorg-x11-drv-synaptics /usr/bin/* +removefrom xorg-x11-drv-wacom /usr/bin/* +removefrom xorg-x11-fonts-misc --allbut /usr/share/X11/fonts/misc/{6x13,encodings,fonts,*cursor}* +removefrom xorg-x11-server-utils --allbut /usr/bin/xrandr /usr/share/X11/rgb.txt /usr/bin/xrdb +removefrom yum /etc/* /usr/share/locale/* /usr/share/yum-cli/* + +%if branding.release: + removefrom ${branding.logos} /usr/share/plymouth/* + removefrom ${branding.logos} /etc/* + removefrom ${branding.logos} /usr/share/icons/{Bluecurve,oxygen}/* + removefrom ${branding.logos} /usr/share/{firstboot,gnome-screensaver,kde4,pixmaps}/* +%endif + +## cleanup_python_files() +runcmd find ${root} -name "*.pyo" -type f -delete +runcmd find ${root} -name "*.pyc" -type f -exec ln -sf /dev/null {} \; + +## cleanup /boot/ leaving vmlinuz, and .*hmac files +runcmd chroot ${root} find /boot \! -name "vmlinuz*" \ + -and \! -name ".vmlinuz*" \ + -and \! -name boot -delete + +## remove any broken links in /etc or /usr +## (broken systemd service links lead to confusing noise at boot) +## NOTE: not checking /var because we want to keep /var/run +## NOTE: Excluding /etc/mtab which links to /proc/self/mounts for systemd +runcmd chroot ${root} find -L /etc /usr -xdev -type l -and \! -name "mtab" \ + -printf "removing broken symbolic link %p -> %l\n" -delete + +## Clean up some of the mess pulled in by webkitgtk via yelp +## libwebkit2gtk links to a handful of libraries in gstreamer and +## gstreamer-plugins-base. Remove the rest of them. +removefrom gstreamer1 --allbut /usr/${libdir}/libgstbase-1.0.* \ + /usr/${libdir}/libgstreamer-1.0.* +removefrom gstreamer1-plugins-base --allbut \ + /usr/${libdir}/libgst{allocators,app,audio,badallocators,fft,gl,pbutils,tag,video}-1.0.* + +## We have enough geoip libraries, thanks +removepkg geoclue2 + +## And remove the packages that those extra libraries pulled in +removepkg cdparanoia-libs opus libtheora libvisual flac-libs gsm avahi-glib avahi-libs \ + ModemManager-glib + +## metacity requires libvorbis and libvorbisfile, but enc/dec are no longer needed +removefrom libvorbis --allbut /usr/${libdir}/libvorbisfile.* /usr/${libdir}/libvorbis.* diff --git a/80-rhel/runtime-install.tmpl b/80-rhel/runtime-install.tmpl new file mode 100644 index 0000000..ad9e524 --- /dev/null +++ b/80-rhel/runtime-install.tmpl @@ -0,0 +1,173 @@ +## lorax template file: populate the ramdisk (runtime image) +<%page args="basearch, product"/> + +## anaconda package +installpkg anaconda anaconda-widgets kexec-tools-anaconda-addon anaconda-install-env-deps +installpkg oscap-anaconda-addon +installpkg redhat-release-eula + +## Other available payloads +installpkg dnf +installpkg rpm-ostree ostree +## speed up compression on multicore systems +installpkg pigz + +## kernel and firmware +## NOTE: Without explicitly including kernel-modules-extra dnf will choose kernel-debuginfo-* +## to satify a gfs2-utils kmod requirement +installpkg kernel kernel-modules kernel-modules-extra +installpkg grubby +%if basearch != "s390x": + ## skip the firmware for sound, video, and scanners, none of which will + ## do much good for the installer. Also skip uhd-firmware which is not + ## even a kernel firmware package. + installpkg --optional *-firmware --except alsa* --except midisport-firmware \ + --except crystalhd-firmware --except ivtv-firmware \ + --except cx18-firmware --except iscan-firmware \ + --except uhd-firmware --except lulzbot-marlin-firmware +%endif + +## install all of the glibc langpacks since otherwise we get no locales +installpkg glibc-all-langpacks + +## arch-specific packages (bootloaders etc.) +%if basearch == "aarch64": + installpkg efibootmgr grub2-efi-aa64-cdboot grubby shim-aa64 +%endif +%if basearch == "x86_64": + installpkg grub2-tools-efi + installpkg efibootmgr + installpkg shim-x64 grub2-efi-x64-cdboot + installpkg shim-ia32 grub2-efi-ia32-cdboot +%endif +%if basearch in ("i386", "x86_64"): + installpkg biosdevname memtest86+ syslinux + installpkg grub2-tools grub2-tools-minimal grub2-tools-extra +%endif +%if basearch in ("ppc", "ppc64", "ppc64le"): + installpkg powerpc-utils lsvpd ppc64-diag + installpkg grub2-tools grub2-tools-minimal grub2-tools-extra + # We only have ppc64le in RHEL8 26-Jul-2018 + installpkg grub2-ppc64le +%endif +%if basearch == "s390x": + installpkg lsscsi s390utils-base s390utils-cmsfs-fuse + installpkg s390utils-hmcdrvfs +%endif + +## yay, plymouth +installpkg plymouth + +## extra dracut modules +installpkg anaconda-dracut dracut-network dracut-config-generic + +## import-state.service for switchroot +installpkg initscripts + +## rescue needs this +installpkg cryptsetup + +## rpcbind or portmap needed by dracut nfs module +installpkg rpcbind + +## required for dracut +installpkg kbd kbd-misc +## required for anaconda-dracut (img-lib etc.) +installpkg tar xz curl bzip2 + +## basic system stuff +installpkg systemd +installpkg rsyslog + +## xorg/GUI packages +installpkg xorg-x11-drivers xorg-x11-server-Xorg +installpkg xorg-x11-server-utils xorg-x11-xauth +installpkg dbus-x11 metacity gsettings-desktop-schemas +installpkg nm-connection-editor +installpkg librsvg2 + +## filesystem tools +installpkg xfsprogs gfs2-utils +installpkg system-storage-manager +installpkg device-mapper-persistent-data +installpkg xfsdump + +## extra storage packages +# hostname is needed for iscsi to work, see RHBZ#1599183 +installpkg udisks2 udisks2-iscsi hostname + +## extra libblockdev plugins +installpkg libblockdev-lvm-dbus + +## needed for LUKS escrow +installpkg volume_key +installpkg nss-tools + +## SELinux support +installpkg selinux-policy-targeted audit + +## network tools/servers +installpkg ethtool openssh-server nfs-utils openssh-clients +installpkg tigervnc-server-minimal +installpkg tigervnc-server-module +installpkg net-tools +installpkg nmap-ncat +installpkg prefixdevname +installpkg ipcalc + +## hardware utilities/libraries +installpkg pciutils usbutils ipmitool +installpkg mt-st smartmontools +installpkg hdparm +%if basearch not in ("arm", "armhfp"): + installpkg libmlx4 rdma-core +%endif +installpkg rng-tools +%if basearch in ("i386", "x86_64", "aarch64"): +installpkg dmidecode +%endif +installpkg nvme-cli + +## fonts & themes +installpkg bitmap-fangsongti-fonts +installpkg dejavu-sans-fonts dejavu-sans-mono-fonts +installpkg kacst-farsi-fonts +installpkg kacst-qurn-fonts +installpkg lklug-fonts +installpkg lohit-assamese-fonts +installpkg lohit-bengali-fonts +installpkg lohit-devanagari-fonts +installpkg lohit-gujarati-fonts +installpkg lohit-gurmukhi-fonts +installpkg lohit-kannada-fonts +installpkg lohit-odia-fonts +installpkg lohit-tamil-fonts +installpkg lohit-telugu-fonts +installpkg madan-fonts +installpkg smc-meera-fonts +installpkg thai-scalable-waree-fonts +installpkg sil-abyssinica-fonts +installpkg xorg-x11-fonts-misc +installpkg aajohan-comfortaa-fonts +installpkg abattis-cantarell-fonts +installpkg sil-scheherazade-fonts +installpkg jomolhari-fonts +installpkg khmeros-base-fonts +installpkg sil-padauk-fonts +installpkg google-noto-sans-cjk-ttc-fonts + +## debugging/bug reporting tools +installpkg gdb-gdbserver +installpkg libreport-plugin-bugzilla libreport-plugin-reportuploader +installpkg libreport-rhel-anaconda-bugzilla +installpkg python3-pyatspi + +## extra tools not required by anaconda +installpkg vim-minimal strace lsof dump xz less +installpkg rsync bind-utils ftp mtr wget +installpkg spice-vdagent +installpkg gdisk hexedit sg3_utils +installpkg perl-interpreter + +## actually install all the requested packages +run_pkg_transaction diff --git a/80-rhel/runtime-postinstall.tmpl b/80-rhel/runtime-postinstall.tmpl new file mode 100644 index 0000000..b147dd8 --- /dev/null +++ b/80-rhel/runtime-postinstall.tmpl @@ -0,0 +1,124 @@ +## runtime-postinstall.tmpl +## post-install setup required to make the system work. + +<%page args="root, basearch, libdir, configdir"/> +<% +stubs = ("list-harddrives", "raidstart", "raidstop") +configdir = configdir + "/common" +%> + +## move_stubs() +move usr/share/anaconda/restart-anaconda usr/bin +%for stub in stubs: + -move usr/share/anaconda/${stub}-stub usr/bin/${stub} +%endfor + +## move_repos() +move etc/yum.repos.d etc/anaconda.repos.d + +## Setup mdadm config to turn off homehost +remove etc/mdadm.conf +append etc/mdadm.conf "HOMEHOST \n" + +## Configure systemd to start anaconda +remove etc/systemd/system/default.target +symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target + +## Make sure tmpfs is enabled +mkdir etc/systemd/system/local-fs.target.wants/ +symlink /lib/systemd/system/tmp.mount etc/systemd/system/local-fs.target.wants/tmp.mount + +## Start rngd +mkdir etc/systemd/system/basic.target.wants/ +symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service + +## Disable unwanted systemd services +systemctl disable systemd-readahead-collect.service \ + systemd-readahead-replay.service \ + lvm2-monitor.service \ + dnf-makecache.timer +## These services can't be disabled normally (they're linked into place in +## /usr/lib/systemd rather than /etc/systemd), so we have to mask them. +systemctl mask fedora-configure.service fedora-loadmodules.service \ + fedora-autorelabel.service fedora-autorelabel-mark.service \ + fedora-wait-storage.service media.mount \ + systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer \ + ldconfig.service + +## remove because it cannot be disabled +remove usr/lib/systemd/system-generators/lvm2-activation-generator + +## Remove the more terrible parts of systemd-tmpfiles. +## etc.conf is written with the assumption that /etc/ is empty, which is +## ridiculous, and it also creates a broken /etc/resolv.conf, which breaks +## networking. +remove usr/lib/tmpfiles.d/etc.conf + +## Make logind activate anaconda-shell@.service on switch to empty VT +symlink anaconda-shell@.service lib/systemd/system/autovt@.service +replace "#ReserveVT=6" "ReserveVT=2" etc/systemd/logind.conf + +## Don't write the journal to the overlay, just keep it in RAM +remove var/log/journal + +## install some basic configuration files +append etc/fstab "" +install ${configdir}/i18n etc/sysconfig +install ${configdir}/rsyslog.conf etc +install ${configdir}/bash_history root/.bash_history +install ${configdir}/profile root/.profile +install ${configdir}/libuser.conf etc +install ${configdir}/sysctl.conf etc/sysctl.d/anaconda.conf +install ${configdir}/spice-vdagentd etc/sysconfig +mkdir etc/NetworkManager/conf.d +install ${configdir}/91-anaconda-autoconnect-slaves.conf etc/NetworkManager/conf.d +install ${configdir}/vconsole.conf etc +install ${configdir}/92-anaconda-loglevel-debug.conf etc/NetworkManager/conf.d +install ${configdir}/90-anaconda-no-auto-default.conf etc/NetworkManager/conf.d + +## set up sshd +install ${configdir}/sshd_config.anaconda etc/ssh +install ${configdir}/pam.sshd etc/pam.d/sshd +install ${configdir}/pam.sshd etc/pam.d/login +install ${configdir}/pam.sshd etc/pam.d/remote + +## set up "install" user account +append etc/passwd "install:x:0:0:root:/root:/usr/libexec/anaconda/run-anaconda" +append etc/shadow "install::14438:0:99999:7:::" +## remove root password +replace "root:\*:" "root::" etc/shadow + +## gsettings settings +install ${configdir}/org.gtk.Settings.Debug.gschema.override usr/share/glib-2.0/schemas +runcmd chroot ${root} glib-compile-schemas /usr/share/glib-2.0/schemas + +move usr/libexec/anaconda/auditd sbin + +## for compatibility with Ancient Anaconda Traditions +symlink lib/modules /modules +symlink lib/firmware /firmware +symlink ../run/install mnt/install + +## create_depmod_conf() +append etc/depmod.d/dd.conf "search updates built-in" + +## create multipath.conf so multipath gets auto-started +append etc/multipath.conf "defaults {\n\tfind_multipaths smart\n\tuser_friendly_names yes\n}\n" + +## make lvm auto-activate +remove etc/lvm/archive/* +remove etc/lvm/archive +remove etc/lvm/backup/* +remove etc/lvm/backup +remove etc/lvm/cache/* +remove etc/lvm/cache +remove etc/lvm/lvm.conf +append etc/lvm/lvm.conf "global {\n\tuse_lvmetad = 1\n}\n" + +## Record the package versions used to create the image +## rpm initializes nss, which requires /dev/urandom to be present, hence the mknod +runcmd chroot ${root} /usr/bin/mknod -m 666 /dev/random c 1 8 +runcmd chroot ${root} /usr/bin/mknod -m 666 /dev/urandom c 1 9 +runcmd chroot ${root} /usr/bin/rpm -qa --pipe "tee /root/lorax-packages.log" + +## TODO: we could run prelink here if we wanted? diff --git a/80-rhel/s390.tmpl b/80-rhel/s390.tmpl new file mode 100644 index 0000000..6772bc1 --- /dev/null +++ b/80-rhel/s390.tmpl @@ -0,0 +1,79 @@ +<%page args="kernels, runtime_img, runtime_base, basearch, outroot"/> +<% +configdir="tmp/config_files/s390" +BOOTDIR="images" +KERNELDIR=BOOTDIR +INITRD_ADDRESS="0x02000000" +LORAXDIR="usr/share/lorax/" +MKS390IMAGE="/usr/bin/mk-s390image" +# The assumption seems to be that there is only one s390 kernel, ever +kernel = kernels[0] + +from os.path import basename +%> + +mkdir images +install ${runtime_img} images +treeinfo stage2 mainimage images/${runtime_base} + +## install bootloader (such as it is) and bootloader config +install ${configdir}/redhat.exec ${BOOTDIR} +install ${configdir}/generic.prm ${BOOTDIR} +install ${configdir}/genericdvd.prm ${BOOTDIR} +install ${configdir}/cdboot.prm ${BOOTDIR} +install ${configdir}/generic.ins . + +## configure bootloader +replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins +replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${BOOTDIR}/cdboot.prm + +## install kernel +installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img +installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + +## s390 needs some extra boot config +createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize + +## s390 also has some special treeinfo data +treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize +treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm +treeinfo images-${basearch} genericdvd.prm ${BOOTDIR}/genericdvd.prm +treeinfo images-${basearch} generic.ins generic.ins + +# Create optional product.img and updates.img in /images/ +<% filegraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + %endif +%endfor + +# Inherit iso-graft/ if it exists from external templates +<% + import os + if os.path.exists(workdir + "/iso-graft"): + filegraft += " " + workdir + "/iso-graft" +%> + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +## Make a combined kernel+initrd image for the iso +runcmd ${MKS390IMAGE} ${outroot}/${KERNELDIR}/kernel.img \ + ${outroot}/${BOOTDIR}/cdboot.img \ + -r ${outroot}/${KERNELDIR}/initrd.img \ + -p ${outroot}/${BOOTDIR}/cdboot.prm + +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso \ + -b ${BOOTDIR}/cdboot.img -c ${BOOTDIR}/boot.cat \ + -boot-load-size 4 -no-emul-boot \ + -R -J -V '${isolabel}' -T -graft-points \ + generic.ins=${outroot}/generic.ins \ + ${BOOTDIR}=${outroot}/${BOOTDIR} \ + ${filegraft} +treeinfo images-${basearch} boot.iso images/boot.iso diff --git a/80-rhel/x86.tmpl b/80-rhel/x86.tmpl new file mode 100644 index 0000000..1b0a940 --- /dev/null +++ b/80-rhel/x86.tmpl @@ -0,0 +1,137 @@ +<%page args="kernels, runtime_img, runtime_base, basearch, inroot, outroot, product, isolabel"/> +<% +configdir="tmp/config_files/x86" +SYSLINUXDIR="usr/share/syslinux" +PXEBOOTDIR="images/pxeboot" +STAGE2IMG="images/install.img" +BOOTDIR="isolinux" +KERNELDIR=PXEBOOTDIR +LORAXDIR="usr/share/lorax/" + +## Don't allow spaces or escape characters in the iso label +def valid_label(ch): + return ch.isalnum() or ch == '_' + +isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel) + +from os.path import basename +%> + +## Test ${runtime_img} to see if udf is needed +<% + import os + from pylorax.sysutils import joinpaths + if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" + else: + udfargs = "" +%> + +mkdir images +install ${runtime_img} ${STAGE2IMG} +treeinfo stage2 mainimage images/${runtime_base} + +## install bootloader and config files +mkdir ${BOOTDIR} +install ${SYSLINUXDIR}/isolinux.bin ${BOOTDIR} +install ${SYSLINUXDIR}/vesamenu.c32 ${BOOTDIR} +install ${SYSLINUXDIR}/ldlinux.c32 ${BOOTDIR} +install ${SYSLINUXDIR}/libcom32.c32 ${BOOTDIR} +install ${SYSLINUXDIR}/libutil.c32 ${BOOTDIR} +install ${configdir}/isolinux.cfg ${BOOTDIR} +install ${configdir}/boot.msg ${BOOTDIR} +install ${configdir}/grub.conf ${BOOTDIR} +install usr/share/anaconda/boot/syslinux-splash.png ${BOOTDIR}/splash.png +install boot/memtest* ${BOOTDIR}/memtest + +## configure bootloader +replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg +replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg +replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg + +## install kernels +mkdir ${KERNELDIR} +%for kernel in kernels: + %if kernel.flavor: + ## i386 PAE + installkernel images-xen ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor} + installinitrd images-xen ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img + %else: + ## normal i386, x86_64 + installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + %endif +%endfor + +hardlink ${KERNELDIR}/vmlinuz ${BOOTDIR} +hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} +%if basearch == 'x86_64': + treeinfo images-xen kernel ${KERNELDIR}/vmlinuz + treeinfo images-xen initrd ${KERNELDIR}/initrd.img +%endif + +## WHeeeeeeee, EFI. +<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %> +%if exists("boot/efi/EFI/*/gcdia32.efi"): + <% efiarch32 = 'IA32' %> +%endif +%if exists("boot/efi/EFI/*/gcdx64.efi"): + <% efiarch64 = 'X64' %> +%endif +%if (efiarch32 or efiarch64) and basearch != 'i386': + <% + efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) + images = ["images/efiboot.img"] + if domacboot: + images.append("images/macboot.img") + %> + %for img in images: + <% + efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img) + efigraft += " {0}={1}/{0}".format(img,outroot) + %> + treeinfo images-${basearch} ${img|basename} ${img} + %endfor + <% efihybrid = "--uefi --mac" if domacboot else "--uefi" %> + <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/> +%endif + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"]; compressargs=""; %> +%if basearch == 'i386': + # Limit the amount of memory xz uses on i386 + <% compressargs="--xz -9 --memlimit-compress=3700MiB" %> +%endif +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${compressargs} ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +# Inherit iso-graft/ if it exists from external templates +<% + import os + if os.path.exists(workdir + "/iso-graft"): + filegraft += " " + workdir + "/iso-graft" +%> + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso \ + -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ + -boot-load-size 4 -boot-info-table -no-emul-boot \ + ${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \ + -graft-points \ + ${STAGE2IMG}=${outroot}/${STAGE2IMG} \ + ${BOOTDIR}=${outroot}/${BOOTDIR} \ + ${KERNELDIR}=${outroot}/${KERNELDIR} \ + ${efigraft} ${filegraft} +runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso +treeinfo images-${basearch} boot.iso images/boot.iso diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0cb52ef --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +NAME=lorax-templates-rhel +# RHEL version these templates are designed for +RHELVER=8.7 +# Serial number for this release +SERIAL=$(shell [ -f SERIAL ] && cat SERIAL || echo 0) + +SPEC=${NAME}.spec +TARBALL=${NAME}-${RHELVER}-${SERIAL}.tar.gz + +tar: ${TARBALL} + +${TARBALL}: 80-rhel + git archive --prefix='${NAME}-${RHELVER}/' HEAD $ $@ + +bump: bump-serial + +bump-serial: + echo $$((${SERIAL}+1)) > SERIAL + git add SERIAL + +update-spec: + sed -r -i \ + -e 's/^(Release:\s+)[^%]+(%.*)$$/\1${SERIAL}\2/' \ + -e 's/^(Version:\s+).*$$/\1${RHELVER}/' \ + -e 's/^(Source0:\s+).*$$/\1${TARBALL}/' \ + ${SPEC} + +release: tar update-spec + +.PHONY: tar ${TARBALL} bump-serial update-spec release diff --git a/README b/README new file mode 100644 index 0000000..4d1276f --- /dev/null +++ b/README @@ -0,0 +1,16 @@ +Hi there! If you're trying to fix something here, do the following: + +1. Make whatever edits you need to in 80-rhel/ +2. `git commit` the changes +3. `make bump` to bump SERIAL +4. `make tar` to make a new tarball +5. `make update-spec` to update specfile +6. Add changelog entry to .spec +7. `rhpkg-sha512 new-sources` the new tarball +8. `git add lorax-templates-rhel.spec SERIAL` +9. `git commit` + +Steps 8 and 9 can be combined as: + `rhpkg-sha512 clog && rhpkg-sha512 ci -F clog` + +You're now ready to do a new build. Isn't spec wonderful? diff --git a/SERIAL b/SERIAL new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/SERIAL @@ -0,0 +1 @@ +1