public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Yaakov Selkowitz <yselkowi@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/lorax-templates-rhel] eln: Add templates for 64k flavor aarch64 kernel
Date: Sun, 28 Jun 2026 23:33:14 GMT	[thread overview]
Message-ID: <178268959449.1.18174020817537302133.rpms-lorax-templates-rhel-5afd1abe2213@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/lorax-templates-rhel
            Branch : eln
            Commit : 5afd1abe22136bb92e28bbf5497f18fc851d0c97
            Author : Yaakov Selkowitz <yselkowi@redhat.com>
            Date   : 2026-06-26T12:54:51-04:00
            Stats  : +2239/-0 in 53 file(s)
            URL    : https://src.fedoraproject.org/rpms/lorax-templates-rhel/c/5afd1abe22136bb92e28bbf5497f18fc851d0c97?branch=eln

            Log:
            Add templates for 64k flavor aarch64 kernel

These are identical to the current state of 80-rhel except for the
kernel-64k handling in runtime-install.

---
diff --git a/70-64k/aarch64.tmpl b/70-64k/aarch64.tmpl
new file mode 100644
index 0000000..9a022f7
--- /dev/null
+++ b/70-64k/aarch64.tmpl
@@ -0,0 +1,92 @@
+<%page args="kernels, runtime_img, runtime_base, basearch, inroot, outroot, product, isolabel"/>
+<%
+configdir="tmp/config_files/aarch64"
+PXEBOOTDIR="images/pxeboot"
+KERNELDIR=PXEBOOTDIR
+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)
+
+import os
+from os.path import basename
+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:
+    isoargs = "-iso-level 3"
+else:
+    isoargs = ""
+%>
+
+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-common/*"):
+    install ${f} ${f|basename}
+    <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
+%endfor
+
+%if exists("boot/efi/EFI/*/gcdaa64.efi"):
+## make boot.iso
+runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
+       ${efiargs} -R -J -V '${isolabel}' \
+       -graft-points \
+       .discinfo=${outroot}/.discinfo \
+       ${KERNELDIR}=${outroot}/${KERNELDIR} \
+       ${STAGE2IMG}=${outroot}/${STAGE2IMG} \
+       ${efigraft} ${filegraft}
+treeinfo images-${basearch} boot.iso images/boot.iso
+%endif

diff --git a/70-64k/appliance/libvirt.tmpl b/70-64k/appliance/libvirt.tmpl
new file mode 100644
index 0000000..b6ffc61
--- /dev/null
+++ b/70-64k/appliance/libvirt.tmpl
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<image>
+  <name>${name}</name>
+  <domain>
+    <boot type='hvm'>
+      <guest>
+        <arch>${arch}</arch>
+      </guest>
+      <os>
+        <loader dev='hd'/>
+      </os>
+%for disk, letter in zip(disks, range(97, 123)):
+      <drive disk='${disk.name}' target='hd${chr(letter)}'/>
+%endfor
+    </boot>
+    <devices>
+      <vcpu>${vcpus}</vcpu>
+      <memory>${memory}</memory>
+%for net in networks:
+      <interface/>
+%endfor
+      <graphics/>
+    </devices>
+  </domain>
+  <storage>
+%for disk in disks:
+  <disk file='${disk.name}' use='system' format='${disk.format}'>
+  %if disk.checksum:
+    <checksum type='${disk.checksum_type}'>${disk.checksum}</checksum>
+  %endif
+  </disk>
+%endfor
+  </storage>
+</image>
+

diff --git a/70-64k/config_files/aarch64/boot.msg b/70-64k/config_files/aarch64/boot.msg
new file mode 100644
index 0000000..ff54899
--- /dev/null
+++ b/70-64k/config_files/aarch64/boot.msg
@@ -0,0 +1,5 @@
+\f 
+\x18splash.lss
+
+ -  Press the \x0f01<ENTER>\x0f07 key to begin the installation process.
+

diff --git a/70-64k/config_files/aarch64/grub2-efi.cfg b/70-64k/config_files/aarch64/grub2-efi.cfg
new file mode 100644
index 0000000..d9756d8
--- /dev/null
+++ b/70-64k/config_files/aarch64/grub2-efi.cfg
@@ -0,0 +1,50 @@
+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@
+}
+menuentry 'Install @PRODUCT@ @VERSION@ in FIPS mode' --class red --class gnu-linux --class gnu --class os {
+	linux @KERNELPATH@ @ROOT@ ro fips=1
+	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/70-64k/config_files/common/91-anaconda-autoconnect-slaves.conf b/70-64k/config_files/common/91-anaconda-autoconnect-slaves.conf
new file mode 100644
index 0000000..f9c81e6
--- /dev/null
+++ b/70-64k/config_files/common/91-anaconda-autoconnect-slaves.conf
@@ -0,0 +1,2 @@
+[connection]
+connection.autoconnect-slaves=1

diff --git a/70-64k/config_files/common/92-anaconda-loglevel-debug.conf b/70-64k/config_files/common/92-anaconda-loglevel-debug.conf
new file mode 100644
index 0000000..6a6535d
--- /dev/null
+++ b/70-64k/config_files/common/92-anaconda-loglevel-debug.conf
@@ -0,0 +1,2 @@
+[logging]
+level=DEBUG

diff --git a/70-64k/config_files/common/bash_history b/70-64k/config_files/common/bash_history
new file mode 100644
index 0000000..0f0d4d7
--- /dev/null
+++ b/70-64k/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/sysroot bash -l -i
+less /tmp/anaconda.log
+grep -v _yum_lock /tmp/packaging.log

diff --git a/70-64k/config_files/common/i18n b/70-64k/config_files/common/i18n
new file mode 100644
index 0000000..b254232
--- /dev/null
+++ b/70-64k/config_files/common/i18n
@@ -0,0 +1 @@
+SYSFONT="eurlatgr"

diff --git a/70-64k/config_files/common/inst.rngd.service b/70-64k/config_files/common/inst.rngd.service
new file mode 100644
index 0000000..aa2e3c5
--- /dev/null
+++ b/70-64k/config_files/common/inst.rngd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Hardware RNG Entropy Gatherer Daemon
+ConditionVirtualization=!container
+ConditionKernelCommandLine=|inst.rngd
+ConditionKernelCommandLine=!inst.rngd=0
+
+# The "-f" option is required for the systemd service rngd to work with Type=simple
+[Service]
+Type=simple
+EnvironmentFile=/etc/sysconfig/rngd
+ExecStart=/usr/bin/rngd -f $RNGD_ARGS

diff --git a/70-64k/config_files/common/org.gtk.Settings.Debug.gschema.override b/70-64k/config_files/common/org.gtk.Settings.Debug.gschema.override
new file mode 100644
index 0000000..fcedd1b
--- /dev/null
+++ b/70-64k/config_files/common/org.gtk.Settings.Debug.gschema.override
@@ -0,0 +1,2 @@
+[org.gtk.Settings.Debug]
+	enable-inspector-keybinding=true

diff --git a/70-64k/config_files/common/pam.sshd b/70-64k/config_files/common/pam.sshd
new file mode 100644
index 0000000..88c019f
--- /dev/null
+++ b/70-64k/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/70-64k/config_files/common/profile b/70-64k/config_files/common/profile
new file mode 100644
index 0000000..89cbe86
--- /dev/null
+++ b/70-64k/config_files/common/profile
@@ -0,0 +1,3 @@
+PS1="[anaconda \u@\h \W]\\$ "
+PATH=/usr/bin:/mnt/sysroot/usr/bin
+export PATH PS1

diff --git a/70-64k/config_files/common/resolv.conf b/70-64k/config_files/common/resolv.conf
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/70-64k/config_files/common/resolv.conf

diff --git a/70-64k/config_files/common/rsyslog.conf b/70-64k/config_files/common/rsyslog.conf
new file mode 100644
index 0000000..6e47f41
--- /dev/null
+++ b/70-64k/config_files/common/rsyslog.conf
@@ -0,0 +1,77 @@
+# minimal rsyslog configuration file for the installer boot.iso
+
+# provides support for local system logging (e.g. via logger command)
+# disables message dropping, we need all of them
+# Turn off message reception via local log socket;
+# local messages are retrieved through imjournal now.
+module(load="imuxsock"
+    SysSock.RateLimit.Interval="0"
+    SysSock.Use="off")
+
+# provides access to the systemd journal
+# Disable rate limiting to the journal, we need all the messages for debugging
+module(load="imjournal"
+    Ratelimit.Interval="0"
+    Ratelimit.Burst="0"
+    StateFile="imjournal.state")
+
+module(load="imfile" mode="inotify")
+input(type="imfile"
+    File="/tmp/X.log"
+    Tag="xserver:"
+    Facility="local1")
+
+input(type="imfile"
+    File="/tmp/anaconda-tb-all.log"
+    Tag="anaconda-tb:"
+    Facility="local1")
+
+module(load="builtin:omfile"
+    Template="RSYSLOG_TraditionalFileFormat"
+)
+
+
+#### GLOBAL DIRECTIVES ####
+
+# Where to place auxiliary files
+global(workDirectory="/var/lib/rsyslog")
+
+# Include all config files in /etc/rsyslog.d/
+include(file="/etc/rsyslog.d/*.conf")
+
+#### 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" stop
+
+*.*;\
+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/70-64k/config_files/common/selinux.config b/70-64k/config_files/common/selinux.config
new file mode 100644
index 0000000..eac67ab
--- /dev/null
+++ b/70-64k/config_files/common/selinux.config
@@ -0,0 +1,2 @@
+SELINUX=permissive
+SELINUXTYPE=targeted

diff --git a/70-64k/config_files/common/spice-vdagentd b/70-64k/config_files/common/spice-vdagentd
new file mode 100644
index 0000000..e70aa69
--- /dev/null
+++ b/70-64k/config_files/common/spice-vdagentd
@@ -0,0 +1 @@
+SPICE_VDAGENTD_EXTRA_ARGS=-X

diff --git a/70-64k/config_files/common/sshd_config.anaconda b/70-64k/config_files/common/sshd_config.anaconda
new file mode 100644
index 0000000..241ba8f
--- /dev/null
+++ b/70-64k/config_files/common/sshd_config.anaconda
@@ -0,0 +1,7 @@
+PermitRootLogin yes
+PrintMotd yes
+SyslogFacility AUTHPRIV
+PasswordAuthentication yes
+PermitEmptyPasswords yes
+PermitUserEnvironment yes
+Subsystem sftp internal-sftp

diff --git a/70-64k/config_files/common/sysctl.conf b/70-64k/config_files/common/sysctl.conf
new file mode 100644
index 0000000..a95dfc6
--- /dev/null
+++ b/70-64k/config_files/common/sysctl.conf
@@ -0,0 +1 @@
+kernel.printk=1

diff --git a/70-64k/config_files/common/systemd-allowroot.conf b/70-64k/config_files/common/systemd-allowroot.conf
new file mode 100644
index 0000000..5352b62
--- /dev/null
+++ b/70-64k/config_files/common/systemd-allowroot.conf
@@ -0,0 +1,3 @@
+[Unit]
+ConditionUser=
+

diff --git a/70-64k/config_files/common/vconsole.conf b/70-64k/config_files/common/vconsole.conf
new file mode 100644
index 0000000..2bd7892
--- /dev/null
+++ b/70-64k/config_files/common/vconsole.conf
@@ -0,0 +1,2 @@
+KEYMAP=us
+FONT=eurlatgr

diff --git a/70-64k/config_files/s390/cdboot.prm b/70-64k/config_files/s390/cdboot.prm
new file mode 100644
index 0000000..80c034b
--- /dev/null
+++ b/70-64k/config_files/s390/cdboot.prm
@@ -0,0 +1 @@
+ro @ROOT@

diff --git a/70-64k/config_files/s390/generic.ins b/70-64k/config_files/s390/generic.ins
new file mode 100644
index 0000000..756d2ff
--- /dev/null
+++ b/70-64k/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/70-64k/config_files/s390/generic.prm b/70-64k/config_files/s390/generic.prm
new file mode 100644
index 0000000..e1dc397
--- /dev/null
+++ b/70-64k/config_files/s390/generic.prm
@@ -0,0 +1 @@
+ro ramdisk_size=40000 cio_ignore=all,!condev

diff --git a/70-64k/config_files/s390/genericdvd.prm b/70-64k/config_files/s390/genericdvd.prm
new file mode 100644
index 0000000..b5d2731
--- /dev/null
+++ b/70-64k/config_files/s390/genericdvd.prm
@@ -0,0 +1 @@
+ro ramdisk_size=40000 cio_ignore=all,!condev rd.cmdline=ask

diff --git a/70-64k/config_files/s390/redhat.exec b/70-64k/config_files/s390/redhat.exec
new file mode 100644
index 0000000..f1e5931
--- /dev/null
+++ b/70-64k/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/70-64k/config_files/sparc/boot.msg b/70-64k/config_files/sparc/boot.msg
new file mode 100644
index 0000000..ed74246
--- /dev/null
+++ b/70-64k/config_files/sparc/boot.msg
@@ -0,0 +1,9 @@
+^[[H^[[J
+                   Welcome to @PRODUCT@ @VERSION@!
+
+ -  To install in graphical mode, press the ^[[7m<ENTER>^[[m key.
+
+ -  To install in text mode, type: ^[[7mlinux text <ENTER>^[[m.
+
+ -  To enter rescue mode type: ^[[7mlinux inst.rescue <ENTER>^[[m.
+

diff --git a/70-64k/config_files/sparc/silo.conf b/70-64k/config_files/sparc/silo.conf
new file mode 100644
index 0000000..159ebb7
--- /dev/null
+++ b/70-64k/config_files/sparc/silo.conf
@@ -0,0 +1,18 @@
+partition=1
+default=linux
+read-write
+timeout=600
+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@ text"
+        initrd=/boot/initrd.img
+image[sun4u]=/boot/vmlinuz
+        label=ks
+        append="@ROOT@ ks"
+        initrd=/boot/initrd.img

diff --git a/70-64k/config_files/x86/boot.msg b/70-64k/config_files/x86/boot.msg
new file mode 100644
index 0000000..ff54899
--- /dev/null
+++ b/70-64k/config_files/x86/boot.msg
@@ -0,0 +1,5 @@
+\f 
+\x18splash.lss
+
+ -  Press the \x0f01<ENTER>\x0f07 key to begin the installation process.
+

diff --git a/70-64k/config_files/x86/grub2-bios.cfg b/70-64k/config_files/x86/grub2-bios.cfg
new file mode 100644
index 0000000..a5c6461
--- /dev/null
+++ b/70-64k/config_files/x86/grub2-bios.cfg
@@ -0,0 +1,47 @@
+set default="1"
+
+function load_video {
+  insmod all_video
+}
+
+load_video
+set gfxpayload=keep
+insmod gzio
+insmod part_gpt
+insmod ext2
+insmod chain
+
+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 {
+	linux @KERNELPATH@ @ROOT@ quiet
+	initrd @INITRDPATH@
+}
+menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
+	linux @KERNELPATH@ @ROOT@ rd.live.check quiet
+	initrd @INITRDPATH@
+}
+menuentry 'Install @PRODUCT@ @VERSION@ in FIPS mode' --class fedora --class gnu-linux --class gnu --class os {
+	linux @KERNELPATH@ @ROOT@ quiet fips=1
+	initrd @INITRDPATH@
+}
+submenu 'Troubleshooting -->' {
+	menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
+		linux @KERNELPATH@ @ROOT@ nomodeset quiet
+		initrd @INITRDPATH@
+	}
+	menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
+		linux @KERNELPATH@ @ROOT@ inst.rescue quiet
+		initrd @INITRDPATH@
+	}
+	menuentry 'Boot first drive' --class fedora --class gnu-linux --class gnu --class os {
+		chainloader (hd0)+1
+	}
+	menuentry 'Boot second drive' --class fedora --class gnu-linux --class gnu --class os {
+		chainloader (hd1)+1
+	}
+}

diff --git a/70-64k/config_files/x86/grub2-efi.cfg b/70-64k/config_files/x86/grub2-efi.cfg
new file mode 100644
index 0000000..ba28867
--- /dev/null
+++ b/70-64k/config_files/x86/grub2-efi.cfg
@@ -0,0 +1,44 @@
+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 {
+	linux @KERNELPATH@ @ROOT@ quiet
+	initrd @INITRDPATH@
+}
+menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
+	linux @KERNELPATH@ @ROOT@ rd.live.check quiet
+	initrd @INITRDPATH@
+}
+menuentry 'Install @PRODUCT@ @VERSION@ in FIPS mode' --class fedora --class gnu-linux --class gnu --class os {
+	linuxefi @KERNELPATH@ @ROOT@ quiet fips=1
+	initrdefi @INITRDPATH@
+}
+submenu 'Troubleshooting -->' {
+	menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
+		linux @KERNELPATH@ @ROOT@ nomodeset quiet
+		initrd @INITRDPATH@
+	}
+	menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
+		linux @KERNELPATH@ @ROOT@ inst.rescue quiet
+		initrd @INITRDPATH@
+	}
+}

diff --git a/70-64k/config_files/x86/isolinux.cfg b/70-64k/config_files/x86/isolinux.cfg
new file mode 100644
index 0000000..b5bbcc2
--- /dev/null
+++ b/70-64k/config_files/x86/isolinux.cfg
@@ -0,0 +1,116 @@
+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
+
+label fips
+  menu label ^Install @PRODUCT@ @VERSION@ in FIPS mode
+  kernel vmlinuz
+  append initrd=initrd.img @ROOT@ quiet fips=1
+
+menu separator # insert an empty line
+
+# utilities submenu
+menu begin ^Troubleshooting
+  menu title Troubleshooting @PRODUCT@ @VERSION@
+
+label basic
+  menu indent count 5
+  menu label Install using ^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
+
+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/70-64k/efi.tmpl b/70-64k/efi.tmpl
new file mode 100644
index 0000000..d50c575
--- /dev/null
+++ b/70-64k/efi.tmpl
@@ -0,0 +1,57 @@
+<%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 usr/share/grub/unicode.pf2 ${EFIBOOTDIR}/fonts/
+
+## actually make the EFI images
+${make_efiboot("images/efiboot.img")}
+
+## 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 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
+</%def>

diff --git a/70-64k/live/aarch64.tmpl b/70-64k/live/aarch64.tmpl
new file mode 100644
index 0000000..d1a3f87
--- /dev/null
+++ b/70-64k/live/aarch64.tmpl
@@ -0,0 +1,84 @@
+<%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)
+
+import os
+from os.path import basename
+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:
+    isoargs = "-iso-level 3"
+else:
+    isoargs = ""
+%>
+
+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-common/*"):
+    install ${f} ${f|basename}
+    <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
+%endfor
+
+%if exists("boot/efi/EFI/*/gcdaa64.efi"):
+## make boot.iso
+runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
+       ${efiargs} -R -J -V '${isolabel}' \
+       -graft-points \
+       ${KERNELDIR}=${outroot}/${KERNELDIR} \
+       ${LIVEDIR}=${outroot}/${LIVEDIR} \
+       ${efigraft} ${filegraft}
+treeinfo images-${basearch} boot.iso images/boot.iso
+%endif

diff --git a/70-64k/live/config_files/aarch64/grub2-efi.cfg b/70-64k/live/config_files/aarch64/grub2-efi.cfg
new file mode 100644
index 0000000..c874547
--- /dev/null
+++ b/70-64k/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 rhgb
+	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 rhgb
+		initrd @INITRDPATH@
+	}
+}

diff --git a/70-64k/live/config_files/s390/cdboot.prm b/70-64k/live/config_files/s390/cdboot.prm
new file mode 100644
index 0000000..5f572d2
--- /dev/null
+++ b/70-64k/live/config_files/s390/cdboot.prm
@@ -0,0 +1 @@
+ro @ROOT@ rd.live.image @EXTRA@

diff --git a/70-64k/live/config_files/s390/generic.ins b/70-64k/live/config_files/s390/generic.ins
new file mode 100644
index 0000000..756d2ff
--- /dev/null
+++ b/70-64k/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/70-64k/live/config_files/s390/generic.prm b/70-64k/live/config_files/s390/generic.prm
new file mode 100644
index 0000000..4f9ba38
--- /dev/null
+++ b/70-64k/live/config_files/s390/generic.prm
@@ -0,0 +1 @@
+ro ramdisk_size=40000 cio_ignore=all,!condev @EXTRA@

diff --git a/70-64k/live/config_files/s390/genericdvd.prm b/70-64k/live/config_files/s390/genericdvd.prm
new file mode 100644
index 0000000..b5d2731
--- /dev/null
+++ b/70-64k/live/config_files/s390/genericdvd.prm
@@ -0,0 +1 @@
+ro ramdisk_size=40000 cio_ignore=all,!condev rd.cmdline=ask

diff --git a/70-64k/live/config_files/s390/redhat.exec b/70-64k/live/config_files/s390/redhat.exec
new file mode 100644
index 0000000..f1e5931
--- /dev/null
+++ b/70-64k/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/70-64k/live/config_files/x86/grub2-bios.cfg b/70-64k/live/config_files/x86/grub2-bios.cfg
new file mode 100644
index 0000000..73d0a56
--- /dev/null
+++ b/70-64k/live/config_files/x86/grub2-bios.cfg
@@ -0,0 +1,39 @@
+set default="1"
+
+function load_video {
+  insmod all_video
+}
+
+load_video
+set gfxpayload=keep
+insmod gzio
+insmod part_gpt
+insmod ext2
+insmod chain
+
+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 {
+	linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet rhgb
+	initrd @INITRDPATH@
+}
+menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
+	linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
+	initrd @INITRDPATH@
+}
+submenu 'Troubleshooting -->' {
+	menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
+		linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image nomodeset vga=791 quiet rhgb
+		initrd @INITRDPATH@
+	}
+	menuentry 'Boot first drive' --class fedora --class gnu-linux --class gnu --class os {
+		chainloader (hd0)+1
+	}
+	menuentry 'Boot second drive' --class fedora --class gnu-linux --class gnu --class os {
+		chainloader (hd1)+1
+	}
+}

diff --git a/70-64k/live/config_files/x86/grub2-efi.cfg b/70-64k/live/config_files/x86/grub2-efi.cfg
new file mode 100644
index 0000000..62812b0
--- /dev/null
+++ b/70-64k/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 {
+	linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet rhgb
+	initrd @INITRDPATH@
+}
+menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
+	linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
+	initrd @INITRDPATH@
+}
+submenu 'Troubleshooting -->' {
+	menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
+		linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image nomodeset quiet rhgb
+		initrd @INITRDPATH@
+	}
+}

diff --git a/70-64k/live/efi.tmpl b/70-64k/live/efi.tmpl
new file mode 100644
index 0000000..f1fd1b5
--- /dev/null
+++ b/70-64k/live/efi.tmpl
@@ -0,0 +1,58 @@
+<%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 usr/share/grub/unicode.pf2 ${EFIBOOTDIR}/fonts/
+
+## actually make the EFI images
+${make_efiboot("images/efiboot.img")}
+
+## 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 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
+</%def>

diff --git a/70-64k/live/live-install.tmpl b/70-64k/live/live-install.tmpl
new file mode 100644
index 0000000..5107ecd
--- /dev/null
+++ b/70-64k/live/live-install.tmpl
@@ -0,0 +1,24 @@
+## 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 == "x86_64":
+    installpkg grub2-tools-efi
+    installpkg efibootmgr
+    installpkg shim-x64 grub2-efi-x64-cdboot
+    installpkg biosdevname
+    installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
+    installpkg grub2-pc-modules
+%endif
+%if basearch == "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/70-64k/live/ppc64le.tmpl b/70-64k/live/ppc64le.tmpl
new file mode 100644
index 0000000..ec3a446
--- /dev/null
+++ b/70-64k/live/ppc64le.tmpl
@@ -0,0 +1,94 @@
+<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel, extra_boot_args"/>
+<%
+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)
+
+import os
+from os.path import basename
+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:
+    isoargs = "-iso-level 3"
+else:
+    isoargs = ""
+%>
+
+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
+install /usr/lib/grub/powerpc-ieee1275/core.elf ${GRUBDIR}/powerpc-ieee1275
+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 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-common/*"):
+    install ${f} ${f|basename}
+    <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
+%endfor
+
+## make boot.iso
+runcmd xorrisofs -v -U -J -R ${isoargs} \
+        -o ${outroot}/images/boot.iso \
+        -r -l -sysid PPC \
+        -A "${product.name} ${product.version}" -V '${isolabel}' \
+        -volset "${product.version}" -volset-size 1 -volset-seqno 1 \
+        -chrp-boot \
+        -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/70-64k/live/s390.tmpl b/70-64k/live/s390.tmpl
new file mode 100644
index 0000000..3d2e54b
--- /dev/null
+++ b/70-64k/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:
+    isoargs = "-iso-level 3"
+else:
+    isoargs = ""
+%>
+
+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-common/*"):
+    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 xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
+       -b ${BOOTDIR}/cdboot.img -c ${BOOTDIR}/boot.cat \
+       -boot-load-size 4 -no-emul-boot \
+       -R -J -V '${isolabel}' -graft-points \
+       ${BOOTDIR}=${outroot}/${BOOTDIR} \
+       ${LIVEDIR}=${outroot}/${LIVEDIR} \
+       ${filegraft}
+treeinfo images-${basearch} boot.iso images/boot.iso

diff --git a/70-64k/live/x86.tmpl b/70-64k/live/x86.tmpl
new file mode 100644
index 0000000..d2e033a
--- /dev/null
+++ b/70-64k/live/x86.tmpl
@@ -0,0 +1,122 @@
+<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel, extra_boot_args"/>
+<%
+configdir="tmp/config_files/x86"
+PXEBOOTDIR="images/pxeboot"
+KERNELDIR=PXEBOOTDIR
+GRUB2DIR="boot/grub2"
+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)
+
+import os
+from os.path import basename
+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:
+    isoargs = "-iso-level 3"
+else:
+    isoargs = ""
+%>
+
+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-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
+
+%if basearch == 'x86_64':
+    treeinfo images-xen kernel ${KERNELDIR}/vmlinuz
+    treeinfo images-xen initrd ${KERNELDIR}/initrd.img
+%endif
+
+## configure grub2 config file
+mkdir ${GRUB2DIR}
+install ${configdir}/grub2-bios.cfg ${GRUB2DIR}/grub.cfg
+replace @VERSION@ '${product.version}' ${GRUB2DIR}/grub.cfg
+replace @PRODUCT@ '${product.name}'  ${GRUB2DIR}/grub.cfg
+replace @KERNELPATH@ /${KERNELDIR}/vmlinuz ${GRUB2DIR}/grub.cfg
+replace @INITRDPATH@ /${KERNELDIR}/initrd.img ${GRUB2DIR}/grub.cfg
+replace @ISOLABEL@ '${isolabel}' ${GRUB2DIR}/grub.cfg
+replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${GRUB2DIR}/grub.cfg
+replace @EXTRA@ '${extra_boot_args}' ${GRUB2DIR}/grub.cfg
+
+
+## WHeeeeeeee, EFI.
+<% efiargs=""; efigraft=""; 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):
+    <%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=""; %>
+%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-common/*"):
+    install ${f} ${f|basename}
+    <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
+%endfor
+
+# Add the livecd-iso-to-disk script if installed
+<% f = "usr/bin/livecd-iso-to-disk" %>
+%if exists(f):
+    install ${f} ${LIVEDIR}/${f|basename}
+%endif
+
+## Make images/eltoritio.img
+runcmd grub2-mkimage -O i386-pc-eltorito -d ${inroot}/usr/lib/grub/i386-pc \
+       -o ${outroot}/images/eltorito.img \
+       -p /${GRUB2DIR} \
+       iso9660 biosdisk
+treeinfo images-${basearch} eltorito.img images/eltorito.img
+
+## make boot.iso
+runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
+       -R -J -V '${isolabel}' \
+       --grub2-mbr ${inroot}/usr/lib/grub/i386-pc/boot_hybrid.img \
+       -partition_offset 16 \
+       -appended_part_as_gpt \
+       -append_partition 2 C12A7328-F81F-11D2-BA4B-00A0C93EC93B ${outroot}/images/efiboot.img \
+       -iso_mbr_part_type EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 \
+       -c boot.cat --boot-catalog-hide \
+       -b images/eltorito.img \
+       -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \
+       -eltorito-alt-boot \
+       -e '--interval:appended_partition_2:all::' -no-emul-boot \
+       -graft-points \
+       ${KERNELDIR}=${outroot}/${KERNELDIR} \
+       ${LIVEDIR}=${outroot}/${LIVEDIR} \
+       ${filegraft} \
+       ${GRUB2DIR}=${outroot}/${GRUB2DIR} \
+       ${GRUB2DIR}/i386-pc=${inroot}/usr/lib/grub/i386-pc \
+       images/eltorito.img=${outroot}/images/eltorito.img \
+       EFI/BOOT=${outroot}/EFI/BOOT
+treeinfo images-${basearch} boot.iso images/boot.iso

diff --git a/70-64k/ppc64le.tmpl b/70-64k/ppc64le.tmpl
new file mode 100644
index 0000000..6a31b64
--- /dev/null
+++ b/70-64k/ppc64le.tmpl
@@ -0,0 +1,101 @@
+<%page args="kernels, runtime_img, runtime_base, basearch, 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)
+
+import os
+from os.path import basename
+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:
+    isoargs = "-iso-level 3"
+else:
+    isoargs = ""
+%>
+
+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
+install /usr/lib/grub/powerpc-ieee1275/core.elf ${GRUBDIR}/powerpc-ieee1275
+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 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-common/*"):
+    install ${f} ${f|basename}
+    <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
+%endfor
+
+## make boot.iso
+runcmd xorrisofs -v -U -J -R ${isoargs} \
+        -o ${outroot}/images/boot.iso \
+        -r -l -sysid PPC \
+        -A "${product.name} ${product.version}" -V '${isolabel}' \
+        -volset "${product.version}" -volset-size 1 -volset-seqno 1 \
+        -chrp-boot \
+        -graft-points \
+        .discinfo=${outroot}/.discinfo \
+        ${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/70-64k/pxe-live/pxe-config.tmpl b/70-64k/pxe-live/pxe-config.tmpl
new file mode 100644
index 0000000..6b841bb
--- /dev/null
+++ b/70-64k/pxe-live/pxe-config.tmpl
@@ -0,0 +1,3 @@
+# PXE configuration template generated by livemedia-creator
+kernel <PXE_DIR>${kernel}
+append initrd=<PXE_DIR>${initrd} root=live:<URL>/${liveimg} ${addargs}

diff --git a/70-64k/runtime-cleanup.tmpl b/70-64k/runtime-cleanup.tmpl
new file mode 100644
index 0000000..cae55d4
--- /dev/null
+++ b/70-64k/runtime-cleanup.tmpl
@@ -0,0 +1,374 @@
+## lorax template file: cleanup for the ramdisk (runtime image)
+<%page args="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
+## perl is needed by /usr/bin/rxe_cfg from libibverbs
+
+## 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
+
+## keep enough of shadow-utils to create accounts
+removefrom shadow-utils --allbut /usr/bin/chage /usr/*bin/chpasswd \
+                        /usr/*bin/groupadd /usr/*bin/useradd
+
+## no services to turn on/off (keep the /etc/init.d link though)
+removefrom initscripts /usr/bin/* /usr/share/locale/* /usr/share/doc/* /usr/share/man/*
+
+## no storage device monitoring
+removepkg device-mapper-event
+## logrotate isn't useful in anaconda
+remove /etc/logrotate.d
+## anaconda needs this to do media check
+removefrom isomd5sum --allbut /usr/bin/checkisomd5
+
+## there's no need for a bunch of zsh files without zsh,
+## systemd-analyze is quite large and not essential
+removefrom systemd /usr/bin/systemd-analyze /usr/share/zsh/site-functions/*
+
+## we only need syslinux to make the installer image bootable, we don't
+## run anything from it that uses mtools, and that's the only thing
+## that pulls in glibc-gconv-extra
+removepkg mtools glibc-gconv-extra
+
+## various other things we remove to save space
+removepkg diffutils file
+removepkg lvm2-libs
+removepkg mobile-broadband-provider-info
+removepkg rmt rpcbind squashfs-tools
+removepkg xml-common
+removepkg mkfontscale
+# do not remove this, required for ppc64le and s390x !!!
+removepkg ncurses
+
+## 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
+## 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 drivers/iio \
+           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. As of 2020-09 this is not built as a module, but keep it in here
+## in case that changes again
+removekmod drivers/char --allbut virtio_console hw_random \
+                                  virtio-rng ipmi hmcdrv nvram
+removekmod drivers/hid --allbut hid-logitech-dj hid-logitech-hidpp hid-multitouch
+
+## As of 2020-09 most of this are built-in too, but again, keep them listed
+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 gtk3 /usr/lib64/gtk-3.0/*/printbackends/*
+removefrom gtk3 /usr/share/themes/*
+
+## filesystem tools
+removefrom e2fsprogs /usr/share/locale/*
+removefrom xfsprogs /usr/share/locale/* /usr/share/doc/* /usr/share/man/*
+removefrom xfsdump --allbut /usr/*bin/*
+
+## other package specific removals
+removefrom gsettings-desktop-schemas /usr/share/locale/*
+removefrom NetworkManager-libnm /usr/share/locale/*/NetworkManager.mo
+removefrom nm-connection-editor /usr/share/applications/*
+removefrom at-spi2-core /usr/share/locale/*
+removefrom bash /etc/* /usr/bin/bashbug* /usr/share/*
+removefrom bind-utils /usr/bin/host /usr/bin/nsupdate
+removefrom ca-certificates /etc/pki/java/*
+removefrom ca-certificates /etc/pki/tls/certs/ca-bundle.trust.crt
+removefrom coreutils /usr/bin/link /usr/bin/nice /usr/bin/stty /usr/bin/unlink
+removefrom coreutils /usr/bin/[ /usr/bin/base64
+removefrom coreutils /usr/bin/cksum /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
+removefrom coreutils /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
+removefrom coreutils-common /etc/* /usr/share/*
+removefrom cpio /usr/share/*
+removefrom cracklib /usr/*bin/*
+removefrom cracklib-dicts /usr/lib64/* /usr/*bin/*
+removefrom cryptsetup /usr/share/*
+removefrom cryptsetup-libs /usr/share/locale/*
+removefrom cyrus-sasl-lib /usr/*bin/*
+removefrom dbus-x11 /etc/X11/*
+removefrom dnf5 /usr/share/locale/*
+removefrom dnf5-plugins /usr/share/locale/*
+removefrom dump /etc/*
+removefrom elfutils-libelf /usr/share/locale/*
+removefrom expat /usr/bin/*
+removefrom fcoe-utils /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/*bin/fcnsq
+removefrom fcoe-utils /usr/*bin/fcoeadm /usr/*bin/fcping /usr/*bin/fcrls
+removefrom file-libs /usr/share/*
+removefrom findutils /usr/share/*
+removefrom fontconfig /usr/bin/*
+removefrom gawk /usr/libexec/* /usr/share/*
+removefrom gdb /usr/share/* /usr/include/*
+removefrom gdb-headless /etc/gdbinit*
+removefrom gdk-pixbuf2 /usr/share/locale*
+removefrom glib2 /usr/bin/* /usr/share/locale/*
+removefrom glibc /etc/gai.conf /etc/rpc
+removefrom glibc */lib64/libBrokenLocale*
+removefrom glibc */lib64/libanl*
+removefrom glibc */lib64/libnss_compat*
+# python-pyudev uses ctypes.util.find_library, which uses /sbin/ldconfig
+removefrom glibc /usr/libexec/* /usr/*bin/iconvconfig
+removefrom glibc-common /usr/bin/gencat
+removefrom glibc-common /usr/bin/getent
+removefrom glibc-common /usr/bin/locale /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/*bin/zic
+removefrom gnutls /usr/share/locale/*
+removefrom google-noto-sans-cjk-fonts /usr/share/fonts/google-noto-sans-cjk-fonts/NotoSansCJK-{Black,Bold,*Light,Medium,Thin}.ttc
+removefrom google-noto-sans-vf-fonts /usr/share/fonts/google-noto-vf/NotoSans-Italic*
+removefrom google-noto-serif-vf-fonts /usr/share/fonts/google-noto-vf/NotoSerif*
+removefrom grep /etc/* /usr/share/locale/*
+removefrom gtk3 /usr/lib64/gtk-3.0/*
+removefrom gtk4 /usr/lib64/gtk-4.0/*
+removefrom guile22 /usr/lib64/guile/2.2/ccache*
+removefrom gzip /usr/bin/{gzexe,zcmp,zdiff,zegrep,zfgrep,zforce,zgrep,zless,zmore,znew}
+removefrom hwdata /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids
+removefrom iproute --allbut /usr/*bin/{ip,routef,routel,rtpr}
+removefrom kbd --allbut */bin/{dumpkeys,kbd_mode,loadkeys,setfont,unicode_*,chvt}
+removefrom less /etc/*
+removefrom libX11-common /usr/share/X11/XErrorDB
+removefrom libcanberra /usr/lib64/libcanberra-*
+removefrom libcanberra-gtk3 /usr/bin/*
+removefrom libcap /usr/*bin/*
+removefrom libconfig /usr/lib64/libconfig++*
+removefrom libdnf5 /usr/share/locale/*
+removefrom libdnf5-cli /usr/share/locale/*
+removefrom liberation-sans-fonts /usr/share/fonts/liberation-sans-fonts/LiberationSans-{Bold*,Italic}.ttf
+removefrom liberation-serif-fonts /usr/share/fonts/liberation-serif-fonts/*
+removefrom liberation-mono-fonts /usr/share/fonts/liberation-mono-fonts/LiberationMono-{Bold*,Italic}.ttf
+removefrom libgpg-error /usr/bin/* /usr/share/locale/*
+removefrom libibverbs /usr/lib64/libmlx4*
+removefrom libidn2 /usr/share/locale/*
+removefrom libnotify /usr/bin/*
+removefrom libsemanage /etc/selinux/*
+removefrom libstdc++ /usr/share/*
+removefrom libxml2 /usr/bin/*
+removefrom brcmfmac-firmware /usr/lib/firmware/brcm/BCM-*
+removefrom linux-firmware /usr/lib/firmware/ttusb-budget/dspbootcode.bin*
+removefrom linux-firmware /usr/lib/firmware/emi26/*
+removefrom linux-firmware /usr/lib/firmware/emi62/*
+removefrom linux-firmware /usr/lib/firmware/cpia2/*
+removefrom linux-firmware /usr/lib/firmware/dabusb/*
+removefrom linux-firmware /usr/lib/firmware/vicam/*
+removefrom linux-firmware /usr/lib/firmware/dsp56k/*
+removefrom linux-firmware /usr/lib/firmware/sun/*
+removefrom linux-firmware /usr/lib/firmware/usbdux*
+removefrom linux-firmware /usr/lib/firmware/f2255usb.bin*
+removefrom linux-firmware /usr/lib/firmware/TDA7706*
+removefrom linux-firmware /usr/lib/firmware/tlg2300_firmware.bin*
+removefrom linux-firmware /usr/lib/firmware/s5p-mfc*
+removefrom linux-firmware /usr/lib/firmware/go7007/*
+removefrom linux-firmware /usr/lib/firmware/intel/IntcSST2.bin*
+removefrom qcom-firmware /usr/lib/firmware/qcom/apq8096/*
+removefrom qcom-firmware /usr/lib/firmware/qcom/sdm845/*
+removefrom qcom-firmware /usr/lib/firmware/qcom/sm8250/*
+removefrom qcom-firmware /usr/lib/firmware/qcom/venus*/*
+removefrom qcom-firmware /usr/lib/firmware/qcom/vpu*/*
+removefrom linux-firmware /usr/lib/firmware/meson/vdec/*
+removefrom linux-firmware /usr/lib/firmware/phanfw.bin*
+## these are for SoCs used in Chromebooks, our kernel does not build the drivers
+removefrom linux-firmware /usr/lib/firmware/mediatek/mt81*/*
+removefrom linux-firmware /usr/lib/firmware/mediatek/sof/*
+removefrom linux-firmware /usr/lib/firmware/mediatek/sof-tplg/*
+## these are old versions that current qed driver will never load
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values-8.10.9.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values-8.10.9.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values-8.14.6.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values-8.18.9.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values-8.20.0.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values-8.30.12.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values-8.33.12.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values-8.37.7.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values-8.40.33.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.10.10.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.10.5.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.15.3.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.20.0.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.33.1.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.33.11.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.37.2.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.37.7.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.4.2.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.42.2.0.bin*
+removefrom linux-firmware /usr/lib/firmware/qed/qed_init_values_zipped-8.7.3.0.bin*
+%if basearch != "aarch64":
+    removefrom linux-firmware /usr/lib/firmware/dpaa2/*
+%endif
+removefrom lldpad /etc/*
+removefrom mdadm /etc/* /usr/lib/systemd/system/mdmonitor*
+removefrom mesa-dri-drivers /usr/lib64/dri/*_video.so
+removefrom mt-st /usr/*bin/stinit
+removefrom mtools /etc/*
+removefrom ncurses-libs /usr/lib64/libform*
+## libmenu.so is needed by lp_diag binary from ppc64-diag which is a PowerPC specific package
+%if basearch != "ppc64le":
+    removefrom ncurses-libs /usr/lib64/libmenu*
+%endif
+removefrom ncurses-libs /usr/lib64/libpanel.* /usr/lib64/libtic*
+removefrom net-tools */bin/netstat */*bin/ether-wake */*bin/ipmaddr
+removefrom net-tools */*bin/iptunnel */*bin/mii-diag */*bin/mii-tool
+removefrom net-tools */*bin/nameif */*bin/plipconfig */*bin/slattach
+removefrom net-tools /usr/share/locale/*
+removefrom nfs-common-utils /etc/nfsmount.conf
+removefrom nfs-common-utils /usr/lib/systemd/system/*
+removefrom nfs-common-utils /usr/*bin/nfsstat /usr/*bin/rpc.gssd
+removefrom nfs-common-utils /usr/*bin/rpcdebug /usr/*bin/showmount
+removefrom nfs-python-utils /usr/*bin/mountstats /usr/*bin/nfsiostat
+removefrom nfs-utils /usr/*bin/exportfs /usr/*bin/rpc.idmapd
+removefrom nfs-utils /usr/*bin/rpc.mountd /usr/*bin/rpc.nfsd
+removefrom nfs-utils /var/lib/nfs/etab /var/lib/nfs/rmtab
+removefrom nfsv3-client-utils /*bin/rpc.statd /usr/*bin/sm-notify
+removefrom nfsv3-client-utils /usr/*bin/start-statd /var/lib/nfs/statd/state
+removefrom nss-softokn /usr/lib64/nss/*
+removefrom openldap /etc/openldap/*
+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 pam /usr/share/locale/*
+## keep /usr/bin (load_policy, setfiles) for anaconda and dracut shutdown (RHEL-144456)
+removefrom policycoreutils /etc/* /usr/share/locale/*
+removefrom popt /usr/share/locale/*
+removefrom procps-ng /usr/bin/free /usr/bin/pgrep /usr/bin/pkill
+removefrom procps-ng /usr/bin/pmap /usr/bin/pwdx /usr/bin/skill /usr/bin/slabtop
+removefrom procps-ng /usr/bin/snice /usr/bin/tload /usr/bin/uptime
+removefrom procps-ng /usr/bin/vmstat /usr/bin/w /usr/bin/watch
+removefrom psmisc /usr/share/locale/*
+removefrom python3-kickstart /usr/lib/python*/site-packages/pykickstart/locale/*
+removefrom readline /usr/lib64/libhistory*
+removefrom rdma-core /etc/rdma/mlx4.conf
+removefrom rpm /usr/share/locale/*
+removefrom rsync /etc/*
+removefrom sed /usr/share/locale/*
+removefrom sil-padauk-fonts /usr/share/fonts/sil-padauk-fonts/Padauk-Bold.ttf
+removefrom smartmontools /etc/* /usr/*bin/smartd
+removefrom smartmontools /usr/*bin/update-smart-drivedb
+removefrom smartmontools /usr/share/smartmontools/*
+removefrom tar /usr/share/locale/*
+removefrom usbutils /usr/bin/*
+removefrom util-linux --allbut \
+    /usr/bin/{chmem,eject,getopt,hexdump,login,lscpu,lsmem,lsblk,setpriv} \
+    /etc/pam.d/login /etc/pam.d/remote \
+    /usr/*bin/{clock,fdisk,fsfreeze,fstrim,hwclock,nologin,sfdisk,swaplabel,wipefs,zramctl}
+removefrom util-linux-core --allbut \
+    /usr/bin/{dmesg,findmnt,flock,kill,logger,more,mount,mountpoint,umount,unshare} \
+    /etc/mtab \
+    /usr/*bin/{agetty,blkid,blockdev,fsck,losetup,mkswap,partx,swapoff,swapon}
+removefrom volume_key-libs /usr/share/locale/*
+removefrom wget1 /usr/share/locale/*
+removefrom wpa_supplicant /usr/*bin/eapol_test
+removefrom yelp /usr/share/yelp/mathjax*
+
+%if branding.release:
+    removefrom ${branding.logos} /usr/share/plymouth/*
+    removefrom ${branding.logos} /etc/*
+    removefrom ${branding.logos} /usr/share/icons/{Bluecurve,oxygen}/*
+
+    # Keep /usr/share/pixmaps/fedora-logo-sprite.svg if it exists
+    # See https://github.com/weldr/lorax/issues/1340
+    removefrom ${branding.logos} /usr/share/kde4/*
+    removefrom ${branding.logos} /usr/share/pixmaps/bootloader/*
+    removefrom ${branding.logos} /usr/share/pixmaps/*.png
+%endif
+
+## 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
+
+## Remove compiled python files, they are recreated as needed anyway
+runcmd find ${root} -name "*.pyo" -type f -delete
+runcmd find ${root} -name "*.pyc" -type f -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/lib64/libgstbase-1.0.* \
+                               /usr/lib64/libgstreamer-1.0.*
+removefrom gstreamer1-plugins-base --allbut \
+        /usr/lib64/libgst{allocators,app,audio,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 avahi-glib ModemManager-glib
+
+## Remove build-id links, they are used with debuginfo
+remove /usr/lib/.build-id
+
+## make the image more reproducible
+
+## make machine-id empty but present to avoid systemd populating /etc with
+## preset settings
+remove /etc/machine-id
+append /etc/machine-id ""
+## journalctl message catalog, non-deterministic
+remove /var/lib/systemd/catalog/database
+## non-reproducible caches
+remove /var/cache/ldconfig/aux-cache
+remove /etc/pki/ca-trust/extracted/java/cacerts
+
+# Remove the rpm database
+# NOTE: must run after all removepkg, removefrom, and removekmod commands
+remove /usr/lib/sysimage/rpm/* /var/lib/rpm/* /var/lib/yum /var/lib/dnf
+
+## sort groups
+runcmd chroot ${root} /bin/sh -c "LC_ALL=C sort /etc/group > /etc/group- && mv /etc/group- /etc/group"
+runcmd chroot ${root} /bin/sh -c "LC_ALL=C sort /etc/gshadow > /etc/gshadow- && mv /etc/gshadow- /etc/gshadow"

diff --git a/70-64k/runtime-install.tmpl b/70-64k/runtime-install.tmpl
new file mode 100644
index 0000000..f42d67d
--- /dev/null
+++ b/70-64k/runtime-install.tmpl
@@ -0,0 +1,172 @@
+## lorax template file: populate the ramdisk (runtime image)
+<%page args="basearch, product"/>
+<%
+# Version 1:2.06-3 of grub2 moves the font directory and is needed to keep the efi template from failing.
+# Version 1:2.06-67 of grub2 includes all needed modules in the signed core.elf for ppc64le
+GRUB2VER="1:2.06-67"
+%>
+
+## anaconda package
+installpkg anaconda anaconda-install-img-deps
+# Not available in ELN, must be uncommented for RHEL
+#installpkg redhat-release-eula
+
+## FIXME Pull in device-mapper-multipath
+## This *should* be pulled in by libblockdev-plugins-all and libblockdev-mpath but it is not
+installpkg device-mapper-multipath
+
+## Other available payloads
+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
+%if basearch != "aarch64":
+installpkg kernel kernel-modules kernel-modules-extra
+%else:
+## This template is used for lorax-templates-rhel-64k which installs the aarch64's 64k
+## kernel instead of the 4k kernel. This requires lorax >= 40.5.16 to support
+## the 64k kernel flavor.
+installpkg kernel-64k kernel-64k-modules kernel-64k-modules-extra
+%endif
+
+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. liquidio and netronome firmwares are
+    ## for enterprise switch devices, netinst deployment does not work on
+    ## these so there is no point shipping them - see
+    ## https://bugzilla.redhat.com/show_bug.cgi?id=2011615
+    ## bfa-firmware contains only obsolete files - see
+    ## https://bugzilla.redhat.com/show_bug.cgi?id=2152202
+    ## qcom-firmware we pull in again lower down but *only* on aarch64, it is
+    ## no use on other arches - https://bugzilla.redhat.com/show_bug.cgi?id=2178852
+    ## similarly amd-ucode-firmware is *only* useful on x86_64 so we pull
+    ## it in there later
+    ## python virt firmware packages obviously aren't 'real' firmware
+    ## crust-firmware is arm uboot stuff; we don't need a copy at this
+    ## level, it is built into the uboot firmware - see
+    ## https://bugzilla.redhat.com/show_bug.cgi?id=2352679#c13
+    installpkg --optional *-firmware --except alsa* --except midisport-firmware \
+                           --except crystalhd-firmware --except ivtv-firmware \
+                           --except cx18-firmware --except iscan-firmware \
+                           --except dvb-firmware --except cirrus-audio-firmware \
+                           --except intel-audio-firmware  --except intel-vsc-firmware \
+                           --except uhd-firmware --except lulzbot-marlin-firmware \
+                           --except gnome-firmware --except sigrok-firmware \
+                           --except liquidio-firmware --except netronome-firmware \
+                           --except mrvlprestera-firmware --except mlxsw_spectrum-firmware \
+                           --except hackrf-firmware --except python-virt-firmware \
+                           --except python3-virt-firmware --except crust-firmware \
+                           --except qcom-firmware --except qcom-accel-firmware \
+                           --except amd-ucode-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
+    installpkg grub2-efi-aa64-cdboot>=${GRUB2VER}
+    installpkg grub2-tools>=${GRUB2VER}
+    installpkg shim-aa64
+    installpkg qcom-firmware
+%endif
+%if basearch == "x86_64":
+    installpkg grub2-tools-efi>=${GRUB2VER}
+    installpkg efibootmgr
+    installpkg shim-x64
+    installpkg grub2-efi-x64-cdboot>=${GRUB2VER}
+    installpkg biosdevname
+    installpkg grub2-tools>=${GRUB2VER} grub2-tools-minimal>=${GRUB2VER}
+    installpkg grub2-tools-extra>=${GRUB2VER}
+    installpkg grub2-pc-modules>=${GRUB2VER}
+    installpkg amd-ucode-firmware
+%endif
+%if basearch == "ppc64le":
+    installpkg powerpc-utils lsvpd ppc64-diag
+    installpkg grub2-tools>=${GRUB2VER} grub2-tools-minimal>=${GRUB2VER}
+    installpkg grub2-tools-extra>=${GRUB2VER} grub2-${basearch}>=${GRUB2VER}
+%endif
+%if basearch == "s390x":
+    installpkg lsscsi s390utils-base s390utils-cmsfs-fuse 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 rsyslog
+
+## extra storage tools for rescue mode
+installpkg device-mapper-persistent-data
+installpkg xfsdump
+
+## needed for LUKS escrow
+installpkg volume_key
+installpkg nss-tools
+
+## SELinux support
+installpkg selinux-policy libselinux-utils selinux-policy-targeted audit
+
+## network tools/servers
+installpkg ethtool openssh-server nfs-utils openssh-clients
+installpkg net-tools
+installpkg ipcalc
+installpkg nmap-ncat
+installpkg prefixdevname
+
+## hardware utilities/libraries
+installpkg pciutils usbutils ipmitool
+installpkg mt-st smartmontools
+installpkg hdparm
+installpkg rdma-core
+installpkg rng-tools
+%if basearch in ("x86_64", "aarch64"):
+installpkg dmidecode
+%endif
+installpkg nvme-cli
+
+## fonts & themes
+installpkg default-fonts-core-sans
+installpkg default-fonts-other-sans
+## We can't go with this because google-noto-sans-cjk-vf-fonts is too big.
+# installpkg default-fonts-cjk-sans
+installpkg google-noto-sans-cjk-fonts
+
+## debugging/bug reporting tools
+installpkg gdb-gdbserver
+installpkg python3-pyatspi
+
+## extra tools not required by anaconda
+installpkg nano
+installpkg vim-minimal strace lsof xz less
+installpkg wget1-wget rsync bind-utils mtr
+installpkg spice-vdagent
+installpkg hexedit sg3_utils
+installpkg perl-interpreter
+installpkg restore
+
+## actually install all the requested packages
+run_pkg_transaction

diff --git a/70-64k/runtime-postinstall.tmpl b/70-64k/runtime-postinstall.tmpl
new file mode 100644
index 0000000..142b05a
--- /dev/null
+++ b/70-64k/runtime-postinstall.tmpl
@@ -0,0 +1,140 @@
+## runtime-postinstall.tmpl
+## post-install setup required to make the system work.
+
+<%page args="root, basearch, configdir"/>
+<%
+configdir = configdir + "/common"
+import os, time
+SOURCE_DATE_EPOCH = os.environ.get('SOURCE_DATE_EPOCH', str(int(time.time())))
+%>
+
+## move_stubs()
+move usr/share/anaconda/list-harddrives-stub usr/bin/list-harddrives
+
+## 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 <ignore>\n"
+
+## Configure systemd to start anaconda
+remove etc/systemd/system/default.target
+symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target
+
+## Allow pipewire.service and pipewire.socket to run as root
+## https://bugzilla.redhat.com/show_bug.cgi?id=2355207
+mkdir etc/systemd/user/pipewire.service.d/
+install ${configdir}/systemd-allowroot.conf etc/systemd/user/pipewire.service.d/allowroot.conf
+mkdir etc/systemd/user/pipewire.socket.d/
+install ${configdir}/systemd-allowroot.conf etc/systemd/user/pipewire.socket.d/allowroot.conf
+
+## 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
+
+## Disable unwanted systemd services
+systemctl disable systemd-readahead-collect.service \
+                  systemd-readahead-replay.service \
+                  lvm2-monitor.service \
+                  dnf-makecache.timer \
+                  sshd.socket
+## 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 usr/lib/systemd/system/rngd.service
+
+## remove because it cannot be disabled
+remove usr/lib/systemd/system-generators/lvm2-activation-generator
+remove usr/lib/systemd/system-generators/systemd-gpt-auto-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
+mkdir usr/lib/systemd/logind.conf.d
+append usr/lib/systemd/logind.conf.d/anaconda-shell.conf "[Login]\nReserveVT=2"
+
+## 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}/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}/selinux.config etc/selinux/config
+install ${configdir}/vconsole.conf etc
+install ${configdir}/92-anaconda-loglevel-debug.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 inst.rngd support
+install ${configdir}/inst.rngd.service etc/systemd/system/inst.rngd.service
+mkdir etc/systemd/system/basic.target.wants/
+symlink /etc/systemd/system/inst.rngd.service etc/systemd/system/basic.target.wants/inst.rngd.service
+
+## 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:::"
+## set up "install-user" who is needed to start webui without root permission in boot iso.
+append etc/passwd "install-user:x:1001:1001::/tmp/install-user:/usr/bin/bash"
+append etc/shadow "install-user::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
+
+
+## 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"
+# dmeventd and event libraries are not installed
+append etc/lvm/lvm.conf "activation {\n\tmonitoring = 0\n}\n"
+
+## Remove machine specific nvme-cli files
+remove etc/nvme/hostid
+remove etc/nvme/hostnqn
+
+## TODO: we could run prelink here if we wanted?
+
+## fix fonconfig cache containing timestamps
+runcmd chroot ${root} /usr/bin/find /usr/share/fonts -newermt "@${SOURCE_DATE_EPOCH}" -exec \
+    touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" {} +
+runcmd chroot ${root} /usr/bin/fc-cache -f

diff --git a/70-64k/s390.tmpl b/70-64k/s390.tmpl
new file mode 100644
index 0000000..a2e9dd4
--- /dev/null
+++ b/70-64k/s390.tmpl
@@ -0,0 +1,95 @@
+<%page args="kernels, runtime_img, runtime_base, basearch, inroot, outroot, product, isolabel"/>
+<%
+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]
+
+## 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)
+
+import os
+from os.path import basename
+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:
+    isoargs = "-iso-level 3"
+else:
+    isoargs = ""
+%>
+
+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
+treeinfo images-${basearch} redhat.exec ${BOOTDIR}/redhat.exec
+
+# 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-common/*"):
+    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 xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
+       -b ${BOOTDIR}/cdboot.img -c ${BOOTDIR}/boot.cat \
+       -boot-load-size 4 -no-emul-boot \
+       -R -J -V '${isolabel}' -graft-points \
+       .discinfo=${outroot}/.discinfo \
+       generic.ins=${outroot}/generic.ins \
+       ${BOOTDIR}=${outroot}/${BOOTDIR} \
+       ${filegraft}
+treeinfo images-${basearch} boot.iso images/boot.iso

diff --git a/70-64k/x86.tmpl b/70-64k/x86.tmpl
new file mode 100644
index 0000000..039e4ca
--- /dev/null
+++ b/70-64k/x86.tmpl
@@ -0,0 +1,118 @@
+<%page args="kernels, runtime_img, runtime_base, basearch, inroot, outroot, product, isolabel"/>
+<%
+configdir="tmp/config_files/x86"
+PXEBOOTDIR="images/pxeboot"
+STAGE2IMG="images/install.img"
+GRUB2DIR="boot/grub2"
+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)
+
+import os
+from os.path import basename
+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:
+    isoargs = "-iso-level 3"
+else:
+    isoargs = ""
+%>
+
+mkdir images
+install ${runtime_img} ${STAGE2IMG}
+treeinfo stage2 mainimage images/${runtime_base}
+
+## install kernels
+mkdir ${KERNELDIR}
+%for kernel in kernels:
+    installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
+    installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
+%endfor
+
+%if basearch == 'x86_64':
+    treeinfo images-xen kernel ${KERNELDIR}/vmlinuz
+    treeinfo images-xen initrd ${KERNELDIR}/initrd.img
+%endif
+
+## configure grub2 config file
+mkdir ${GRUB2DIR}
+install ${configdir}/grub2-bios.cfg ${GRUB2DIR}/grub.cfg
+replace @VERSION@ '${product.version}' ${GRUB2DIR}/grub.cfg
+replace @PRODUCT@ '${product.name}'  ${GRUB2DIR}/grub.cfg
+replace @KERNELPATH@ /${KERNELDIR}/vmlinuz ${GRUB2DIR}/grub.cfg
+replace @INITRDPATH@ /${KERNELDIR}/initrd.img ${GRUB2DIR}/grub.cfg
+replace @ISOLABEL@ '${isolabel}' ${GRUB2DIR}/grub.cfg
+replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${GRUB2DIR}/grub.cfg
+
+
+## WHeeeeeeee, EFI.
+<% 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):
+    <%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=""; %>
+%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-common/*"):
+    install ${f} ${f|basename}
+    <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
+%endfor
+
+## Make images/eltoritio.img
+runcmd grub2-mkimage -O i386-pc-eltorito -d ${inroot}/usr/lib/grub/i386-pc \
+       -o ${outroot}/images/eltorito.img \
+       -p /${GRUB2DIR} \
+       iso9660 biosdisk
+treeinfo images-${basearch} eltorito.img images/eltorito.img
+
+## make boot.iso
+runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
+       -R -J -V '${isolabel}' \
+       --grub2-mbr ${inroot}/usr/lib/grub/i386-pc/boot_hybrid.img \
+       -partition_offset 16 \
+       -appended_part_as_gpt \
+       -append_partition 2 C12A7328-F81F-11D2-BA4B-00A0C93EC93B ${outroot}/images/efiboot.img \
+       -iso_mbr_part_type EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 \
+       -c boot.cat --boot-catalog-hide \
+       -b images/eltorito.img \
+       -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \
+       -eltorito-alt-boot \
+       -e '--interval:appended_partition_2:all::' -no-emul-boot \
+       -graft-points \
+       .discinfo=${outroot}/.discinfo \
+       ${STAGE2IMG}=${outroot}/${STAGE2IMG} \
+       ${KERNELDIR}=${outroot}/${KERNELDIR} \
+       ${filegraft} \
+       ${GRUB2DIR}=${outroot}/${GRUB2DIR} \
+       ${GRUB2DIR}/i386-pc=${inroot}/usr/lib/grub/i386-pc \
+       images/eltorito.img=${outroot}/images/eltorito.img \
+       EFI/BOOT=${outroot}/EFI/BOOT
+treeinfo images-${basearch} boot.iso images/boot.iso

                 reply	other threads:[~2026-06-28 23:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178268959449.1.18174020817537302133.rpms-lorax-templates-rhel-5afd1abe2213@fedoraproject.org \
    --to=yselkowi@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox