Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d9aa63a3b | ||
|
|
d0c0ba601b | ||
|
|
793e8039d2 | ||
|
|
4856de5e63 | ||
|
|
63eb08ba82 | ||
|
|
43067a912f | ||
|
|
e3ad199ad8 |
29
config.yaml
29
config.yaml
@ -7,7 +7,8 @@ actions:
|
||||
%define almatemplatedir %{_datadir}/lorax/templates.d/70-almalinux
|
||||
|
||||
# AlmaLinux support and rebranding
|
||||
Patch0001: 0001-Correct-grammar-in-Grub-rescue-menu-entries.patch
|
||||
Patch1001: Add-x86_64_v2-support.patch
|
||||
Patch1002: Add-risv64-support.patch
|
||||
|
||||
count: 1
|
||||
- target: "spec"
|
||||
@ -41,7 +42,14 @@ actions:
|
||||
# Prepare AlmaLinux templates
|
||||
mkdir -p 70-almalinux
|
||||
cp -a 80-rhel/* 70-almalinux/
|
||||
%patch -P 0001 -p1
|
||||
|
||||
# Correct grammar: "Rescue a AlmaLinux" -> "Rescue an AlmaLinux"
|
||||
for f in $(find 70-almalinux/ -type f \( -name "*.cfg" -o -name "*.in" \)); do
|
||||
sed -i "s/Rescue a @PRODUCT@/Rescue an @PRODUCT@/g" "$f"
|
||||
done
|
||||
|
||||
%patch -P 1001 -p1
|
||||
%patch -P 1002 -p1
|
||||
sed -i '/libreport-rhel-anaconda-bugzilla/d' 70-almalinux/runtime-install.tmpl
|
||||
sed -i '/redhat-release-eula/d' 70-almalinux/runtime-install.tmpl
|
||||
|
||||
@ -79,15 +87,28 @@ actions:
|
||||
- run_script:
|
||||
- script: "lorax-templates-almalinux-requires.sh"
|
||||
cwd: "rpms"
|
||||
- script: "generate-patch-for-v2.sh"
|
||||
cwd: "rpms"
|
||||
|
||||
- changelog_entry:
|
||||
- name: "Yuriy Kohut"
|
||||
email: "ykohut@almalinux.org"
|
||||
line:
|
||||
- "Correct grammar in Grub rescue menuentries"
|
||||
- name: "Eduard Abdullin"
|
||||
email: "eabdullin@almalinux.org"
|
||||
line:
|
||||
- "Add riscv64 support"
|
||||
- "Add x86_64_v2 support"
|
||||
|
||||
- add_files:
|
||||
# will be generated by generate-patch-for-v2.sh so it should not be added here
|
||||
# these comments are here just as a reminder
|
||||
# - type: "patch"
|
||||
# name: "Add-x86_64_v2-support.patch"
|
||||
# number: 1001
|
||||
# modify_spec: false
|
||||
- type: "patch"
|
||||
name: "0001-Correct-grammar-in-Grub-rescue-menu-entries.patch"
|
||||
number: 0001
|
||||
name: "Add-risv64-support.patch"
|
||||
number: 1002
|
||||
modify_spec: false
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
diff --git a/70-almalinux/config_files/aarch64/grub2-efi.cfg b/70-almalinux/config_files/aarch64/grub2-efi.cfg
|
||||
index 80db480..2b89973 100644
|
||||
--- a/70-almalinux/config_files/aarch64/grub2-efi.cfg
|
||||
+++ b/70-almalinux/config_files/aarch64/grub2-efi.cfg
|
||||
@@ -39,7 +39,7 @@ submenu 'Troubleshooting -->' {
|
||||
linux @KERNELPATH@ @ROOT@ inst.text
|
||||
initrd @INITRDPATH@
|
||||
}
|
||||
- menuentry 'Rescue a @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os {
|
||||
+ menuentry 'Rescue an @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os {
|
||||
linux @KERNELPATH@ @ROOT@ inst.rescue
|
||||
initrd @INITRDPATH@
|
||||
}
|
||||
diff --git a/70-almalinux/config_files/ppc/grub.cfg.in b/70-almalinux/config_files/ppc/grub.cfg.in
|
||||
index aa5f1dc..d4ad33d 100644
|
||||
--- a/70-almalinux/config_files/ppc/grub.cfg.in
|
||||
+++ b/70-almalinux/config_files/ppc/grub.cfg.in
|
||||
@@ -13,7 +13,7 @@ menuentry "Test this media & install @PRODUCT@ @VERSION@ (64-bit kernel)" --cla
|
||||
initrd /ppc/ppc64/initrd.img
|
||||
}
|
||||
|
||||
-menuentry "Rescue a @PRODUCT@ system (64-bit kernel)" --class fedora --class gnu-linux --class gnu --class os {
|
||||
+menuentry "Rescue an @PRODUCT@ system (64-bit kernel)" --class fedora --class gnu-linux --class gnu --class os {
|
||||
linux /ppc/ppc64/vmlinuz @ROOT@ inst.rescue ro
|
||||
initrd /ppc/ppc64/initrd.img
|
||||
}
|
||||
diff --git a/70-almalinux/config_files/x86/grub2-efi.cfg b/70-almalinux/config_files/x86/grub2-efi.cfg
|
||||
index 5fc47de..6c1e557 100644
|
||||
--- a/70-almalinux/config_files/x86/grub2-efi.cfg
|
||||
+++ b/70-almalinux/config_files/x86/grub2-efi.cfg
|
||||
@@ -33,7 +33,7 @@ submenu 'Troubleshooting -->' {
|
||||
linuxefi @KERNELPATH@ @ROOT@ inst.text quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
- menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
|
||||
+ menuentry 'Rescue an @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ inst.rescue quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
diff --git a/70-almalinux/config_files/x86/isolinux.cfg b/70-almalinux/config_files/x86/isolinux.cfg
|
||||
index 01bf0cd..6ed0893 100644
|
||||
--- a/70-almalinux/config_files/x86/isolinux.cfg
|
||||
+++ b/70-almalinux/config_files/x86/isolinux.cfg
|
||||
@@ -87,7 +87,7 @@ label text
|
||||
|
||||
label rescue
|
||||
menu indent count 5
|
||||
- menu label ^Rescue a @PRODUCT@ system
|
||||
+ menu label ^Rescue an @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.
|
||||
498
files/Add-risv64-support.patch
Normal file
498
files/Add-risv64-support.patch
Normal file
@ -0,0 +1,498 @@
|
||||
From 5afcdaa2c518e1ec91cf9f1ce2cbfa72043d096e Mon Sep 17 00:00:00 2001
|
||||
From: eabdullin <eabdullin@almalinux.org>
|
||||
Date: Mon, 1 Sep 2025 14:23:08 +0300
|
||||
Subject: [PATCH] Add riscv64
|
||||
|
||||
---
|
||||
70-almalinux/config_files/riscv64/boot.msg | 3 +
|
||||
70-almalinux/config_files/riscv64/grub2-efi.cfg | 46 ++++++++++
|
||||
70-almalinux/efi.tmpl | 2 +
|
||||
70-almalinux/live/config_files/riscv64.tmpl | 84 +++++++++++++++++
|
||||
.../live/config_files/riscv64/grub2-efi.cfg | 42 +++++++++
|
||||
70-almalinux/live/efi.tmpl | 2 +
|
||||
70-almalinux/live/live-install.tmpl | 4 +
|
||||
70-almalinux/live/riscv64.tmpl | 84 +++++++++++++++++
|
||||
70-almalinux/riscv64.tmpl | 92 +++++++++++++++++++
|
||||
70-almalinux/runtime-cleanup.tmpl | 5 +
|
||||
70-almalinux/runtime-install.tmpl | 8 +-
|
||||
11 files changed, 371 insertions(+), 1 deletion(-)
|
||||
create mode 100644 70-almalinux/config_files/riscv64/boot.msg
|
||||
create mode 100644 70-almalinux/config_files/riscv64/grub2-efi.cfg
|
||||
create mode 100644 70-almalinux/live/config_files/riscv64.tmpl
|
||||
create mode 100644 70-almalinux/live/config_files/riscv64/grub2-efi.cfg
|
||||
create mode 100644 70-almalinux/live/riscv64.tmpl
|
||||
create mode 100644 70-almalinux/riscv64.tmpl
|
||||
|
||||
diff --git a/70-almalinux/config_files/riscv64/boot.msg b/70-almalinux/config_files/riscv64/boot.msg
|
||||
new file mode 100644
|
||||
index 0000000..9b1722b
|
||||
--- /dev/null
|
||||
+++ b/70-almalinux/config_files/riscv64/boot.msg
|
||||
@@ -0,0 +1,3 @@
|
||||
+splash.lss
|
||||
+
|
||||
+ - Press the 01<ENTER>07 key to begin the installation process.
|
||||
diff --git a/70-almalinux/config_files/riscv64/grub2-efi.cfg b/70-almalinux/config_files/riscv64/grub2-efi.cfg
|
||||
new file mode 100644
|
||||
index 0000000..1ce5d33
|
||||
--- /dev/null
|
||||
+++ b/70-almalinux/config_files/riscv64/grub2-efi.cfg
|
||||
@@ -0,0 +1,46 @@
|
||||
+set default="1"
|
||||
+
|
||||
+function load_video {
|
||||
+ if [ x$feature_all_video_module = xy ]; then
|
||||
+ insmod all_video
|
||||
+ else
|
||||
+ insmod efi_gop
|
||||
+ insmod efi_uga
|
||||
+ insmod ieee1275_fb
|
||||
+ insmod vbe
|
||||
+ insmod vga
|
||||
+ insmod video_bochs
|
||||
+ insmod video_cirrus
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+load_video
|
||||
+set gfxpayload=keep
|
||||
+insmod gzio
|
||||
+insmod part_gpt
|
||||
+insmod ext2
|
||||
+
|
||||
+set timeout=60
|
||||
+### END /etc/grub.d/00_header ###
|
||||
+
|
||||
+search --no-floppy --set=root -l '@ISOLABEL@'
|
||||
+
|
||||
+### BEGIN /etc/grub.d/10_linux ###
|
||||
+menuentry 'Install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
|
||||
+ linux @KERNELPATH@ @ROOT@ ro
|
||||
+ initrd @INITRDPATH@
|
||||
+}
|
||||
+menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
|
||||
+ linux @KERNELPATH@ @ROOT@ rd.live.check
|
||||
+ initrd @INITRDPATH@
|
||||
+}
|
||||
+submenu 'Troubleshooting -->' {
|
||||
+ menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os {
|
||||
+ linux @KERNELPATH@ @ROOT@ nomodeset
|
||||
+ initrd @INITRDPATH@
|
||||
+ }
|
||||
+ menuentry 'Rescue a @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os {
|
||||
+ linux @KERNELPATH@ @ROOT@ inst.rescue
|
||||
+ initrd @INITRDPATH@
|
||||
+ }
|
||||
+}
|
||||
diff --git a/70-almalinux/efi.tmpl b/70-almalinux/efi.tmpl
|
||||
index 80600d2..4e0b10b 100644
|
||||
--- a/70-almalinux/efi.tmpl
|
||||
+++ b/70-almalinux/efi.tmpl
|
||||
@@ -8,8 +8,10 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
|
||||
mkdir ${EFIBOOTDIR}
|
||||
mkdir ${EFIBOOTDIR}/fonts/
|
||||
%if efiarch64:
|
||||
+%if basearch != "riscv64":
|
||||
install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
|
||||
install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
|
||||
+%endif
|
||||
install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
|
||||
%endif
|
||||
%if efiarch32:
|
||||
diff --git a/70-almalinux/live/config_files/riscv64.tmpl b/70-almalinux/live/config_files/riscv64.tmpl
|
||||
new file mode 100644
|
||||
index 0000000..6d8784d
|
||||
--- /dev/null
|
||||
+++ b/70-almalinux/live/config_files/riscv64.tmpl
|
||||
@@ -0,0 +1,84 @@
|
||||
+<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel, extra_boot_args"/>
|
||||
+<%
|
||||
+configdir="tmp/config_files/riscv64"
|
||||
+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/*/gcdriscv64.efi"):
|
||||
+ <%
|
||||
+ efiarch32 = None
|
||||
+ efiarch64 = 'riscv64'
|
||||
+ 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/*/gcdriscv64.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-almalinux/live/config_files/riscv64/grub2-efi.cfg b/70-almalinux/live/config_files/riscv64/grub2-efi.cfg
|
||||
new file mode 100644
|
||||
index 0000000..c874547
|
||||
--- /dev/null
|
||||
+++ b/70-almalinux/live/config_files/riscv64/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-almalinux/live/efi.tmpl b/70-almalinux/live/efi.tmpl
|
||||
index 813f91e..9af7abf 100644
|
||||
--- a/70-almalinux/live/efi.tmpl
|
||||
+++ b/70-almalinux/live/efi.tmpl
|
||||
@@ -8,8 +8,10 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
|
||||
mkdir ${EFIBOOTDIR}
|
||||
mkdir ${EFIBOOTDIR}/fonts/
|
||||
%if efiarch64:
|
||||
+%if basearch != "riscv64":
|
||||
install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
|
||||
install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
|
||||
+%endif
|
||||
install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
|
||||
%endif
|
||||
%if efiarch32:
|
||||
diff --git a/70-almalinux/live/live-install.tmpl b/70-almalinux/live/live-install.tmpl
|
||||
index cfa9325..bbecd6f 100644
|
||||
--- a/70-almalinux/live/live-install.tmpl
|
||||
+++ b/70-almalinux/live/live-install.tmpl
|
||||
@@ -23,3 +23,7 @@
|
||||
%if basearch == "s390x":
|
||||
installpkg s390utils-base
|
||||
%endif
|
||||
+%if basearch == "riscv64":
|
||||
+ installpkg efibootmgr
|
||||
+ installpkg grub2-efi-riscv64-cdboot
|
||||
+%endif
|
||||
diff --git a/70-almalinux/live/riscv64.tmpl b/70-almalinux/live/riscv64.tmpl
|
||||
new file mode 100644
|
||||
index 0000000..6d8784d
|
||||
--- /dev/null
|
||||
+++ b/70-almalinux/live/riscv64.tmpl
|
||||
@@ -0,0 +1,84 @@
|
||||
+<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel, extra_boot_args"/>
|
||||
+<%
|
||||
+configdir="tmp/config_files/riscv64"
|
||||
+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/*/gcdriscv64.efi"):
|
||||
+ <%
|
||||
+ efiarch32 = None
|
||||
+ efiarch64 = 'riscv64'
|
||||
+ 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/*/gcdriscv64.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-almalinux/riscv64.tmpl b/70-almalinux/riscv64.tmpl
|
||||
new file mode 100644
|
||||
index 0000000..62dd763
|
||||
--- /dev/null
|
||||
+++ b/70-almalinux/riscv64.tmpl
|
||||
@@ -0,0 +1,92 @@
|
||||
+<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel"/>
|
||||
+<%
|
||||
+configdir="tmp/config_files/riscv64"
|
||||
+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/*/gcdriscv64.efi"):
|
||||
+ <%
|
||||
+ efiarch32 = None
|
||||
+ efiarch64 = 'riscv64'
|
||||
+ 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/*/gcdriscv64.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-almalinux/runtime-cleanup.tmpl b/70-almalinux/runtime-cleanup.tmpl
|
||||
index 5332691..5666d29 100644
|
||||
--- a/70-almalinux/runtime-cleanup.tmpl
|
||||
+++ b/70-almalinux/runtime-cleanup.tmpl
|
||||
@@ -329,8 +329,13 @@ runcmd chroot ${root} find /boot \! -name "vmlinuz*" \
|
||||
## (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
|
||||
+%if basearch == "riscv64":
|
||||
+runcmd chroot ${root} find -L /etc -xdev -type l -and \! -name "mtab" \
|
||||
+ -printf "removing broken symbolic link %p -> %l\n" -delete
|
||||
+%else:
|
||||
runcmd chroot ${root} find -L /etc /usr -xdev -type l -and \! -name "mtab" \
|
||||
-printf "removing broken symbolic link %p -> %l\n" -delete
|
||||
+%endif
|
||||
|
||||
## Remove compiled python files, they are recreated as needed anyway
|
||||
runcmd find ${root} -name "*.pyo" -type f -delete
|
||||
diff --git a/70-almalinux/runtime-install.tmpl b/70-almalinux/runtime-install.tmpl
|
||||
index 2106964..1ad7669 100644
|
||||
--- a/70-almalinux/runtime-install.tmpl
|
||||
+++ b/70-almalinux/runtime-install.tmpl
|
||||
@@ -79,6 +79,12 @@ installpkg glibc-all-langpacks
|
||||
%if basearch == "s390x":
|
||||
installpkg lsscsi s390utils-base s390utils-cmsfs-fuse s390utils-hmcdrvfs
|
||||
%endif
|
||||
+%if basearch == "riscv64":
|
||||
+ installpkg efibootmgr
|
||||
+ installpkg grub2-efi-riscv64-cdboot>=${GRUB2VER}
|
||||
+ installpkg grub2-tools>=${GRUB2VER}
|
||||
+ installpkg uboot-tools
|
||||
+%endif
|
||||
|
||||
## yay, plymouth
|
||||
installpkg plymouth
|
||||
@@ -140,7 +146,7 @@ installpkg mt-st smartmontools
|
||||
installpkg hdparm
|
||||
installpkg rdma-core
|
||||
installpkg rng-tools
|
||||
-%if basearch in ("x86_64", "x86_64_v2", "aarch64"):
|
||||
+%if basearch in ("x86_64", "x86_64_v2", "aarch64", "riscv64"):
|
||||
installpkg dmidecode
|
||||
%endif
|
||||
installpkg nvme-cli
|
||||
24
scripts/generate-patch-for-v2.sh
Normal file
24
scripts/generate-patch-for-v2.sh
Normal file
@ -0,0 +1,24 @@
|
||||
set -e
|
||||
|
||||
TEMPLATE_DIR=70-almalinux
|
||||
|
||||
mkdir -p a b
|
||||
|
||||
cp -r 80-rhel a/${TEMPLATE_DIR}
|
||||
cp -r 80-rhel b/${TEMPLATE_DIR}
|
||||
|
||||
# Добавляем x86_v2 конфиги и шаблоны
|
||||
mkdir -p b/${TEMPLATE_DIR}/live/config_files/x86_v2
|
||||
cp b/${TEMPLATE_DIR}/live/config_files/x86/* b/${TEMPLATE_DIR}/live/config_files/x86_v2/
|
||||
cp b/${TEMPLATE_DIR}/x86.tmpl b/${TEMPLATE_DIR}/x86_v2.tmpl
|
||||
cp b/${TEMPLATE_DIR}/live/x86.tmpl b/${TEMPLATE_DIR}/live/x86_v2.tmpl
|
||||
|
||||
sed -i 's/%if basearch == "x86_64":/%if basearch in ("x86_64", "x86_64_v2"):/g' b/${TEMPLATE_DIR}/live/live-install.tmpl b/${TEMPLATE_DIR}/runtime-install.tmpl
|
||||
sed -i 's/%if basearch in ("x86_64", "aarch64"):/%if basearch in ("x86_64", "x86_64_v2", "aarch64"):/g' b/${TEMPLATE_DIR}/runtime-install.tmpl
|
||||
find b/${TEMPLATE_DIR}/live/config_files/x86_v2/ -type f -exec sed -i 's/%if basearch == \(['"'"'"]\)x86_64\1:/%if basearch == \1x86_64_v2\1:/g' {} \;
|
||||
find b/${TEMPLATE_DIR}/ -type f -name '*x86_v2*' -exec sed -i 's/%if basearch == \(['"'"'"]\)x86_64\1:/%if basearch == \1x86_64_v2\1:/g' {} \;
|
||||
|
||||
|
||||
diff -aruN a/${TEMPLATE_DIR} b/${TEMPLATE_DIR} > Add-x86_64_v2-support.patch || [ $? -eq 1 ]
|
||||
|
||||
rm -rf a b
|
||||
@ -1,7 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Get the "Requires" from the lorax-templates-rhel.spec file (main package)
|
||||
# and replace the 'Requires: <Requires>' string for the lorax-templates-almalinux subpackage
|
||||
|
||||
requires=$(grep 'Requires:' SPECS/lorax-templates-rhel.spec | grep -v '<Requires>')
|
||||
sed -i "s/^Requires:.*<Requires>/$requires/" SPECS/lorax-templates-rhel.spec
|
||||
requires=$(grep 'Requires:' lorax-templates-rhel.spec | grep -v '<Requires>')
|
||||
sed -i "s/^Requires:.*<Requires>/$requires/" lorax-templates-rhel.spec
|
||||
|
||||
Loading…
Reference in New Issue
Block a user