diff --git a/1023-support-sw_64-lorax-templates-anolis.patch b/1023-support-sw_64-lorax-templates-anolis.patch new file mode 100644 index 0000000000000000000000000000000000000000..6d887f8f0e106e2a9c184e535c237f3c968a9300 --- /dev/null +++ b/1023-support-sw_64-lorax-templates-anolis.patch @@ -0,0 +1,411 @@ +From aa58966aeafb0f2f10f3ae051f69969d9381bef5 Mon Sep 17 00:00:00 2001 +From: zhangbinchen +Date: Thu, 14 Aug 2025 16:51:06 +0800 +Subject: [PATCH] support-sw_64 + +Signed-off-by: zhangbinchen +--- + 80-anolis/config_files/sw_64/boot.msg | 5 ++ + 80-anolis/config_files/sw_64/grub.conf | 13 +++ + 80-anolis/config_files/sw_64/grub2-efi.cfg | 46 ++++++++++ + 80-anolis/efi.tmpl | 6 +- + .../live/config_files/sw_64/grub2-efi.cfg | 42 +++++++++ + 80-anolis/live/live-install.tmpl | 4 + + 80-anolis/live/sw_64.tmpl | 84 ++++++++++++++++++ + 80-anolis/runtime-install.tmpl | 11 ++- + 80-anolis/sw_64.tmpl | 86 +++++++++++++++++++ + 9 files changed, 293 insertions(+), 4 deletions(-) + create mode 100644 80-anolis/config_files/sw_64/boot.msg + create mode 100644 80-anolis/config_files/sw_64/grub.conf + create mode 100644 80-anolis/config_files/sw_64/grub2-efi.cfg + create mode 100644 80-anolis/live/config_files/sw_64/grub2-efi.cfg + create mode 100644 80-anolis/live/sw_64.tmpl + create mode 100644 80-anolis/sw_64.tmpl + +diff --git a/80-anolis/config_files/sw_64/boot.msg b/80-anolis/config_files/sw_64/boot.msg +new file mode 100644 +index 0000000..ff54899 +--- /dev/null ++++ b/80-anolis/config_files/sw_64/boot.msg +@@ -0,0 +1,5 @@ ++ ++splash.lss ++ ++ - Press the 0107 key to begin the installation process. ++ +diff --git a/80-anolis/config_files/sw_64/grub.conf b/80-anolis/config_files/sw_64/grub.conf +new file mode 100644 +index 0000000..b5a167e +--- /dev/null ++++ b/80-anolis/config_files/sw_64/grub.conf +@@ -0,0 +1,13 @@ ++#debug --graphics ++default=0 ++splashimage=@SPLASHPATH@ ++timeout 60 ++hiddenmenu ++title Install @PRODUCT@ @VERSION@ ++ findiso ++ kernel @KERNELPATH@ @ROOT@ quiet inst.xtimeout=1200 ++ initrd @INITRDPATH@ ++title Test this media & install @PRODUCT@ @VERSION@ ++ findiso ++ kernel @KERNELPATH@ @ROOT@ rd.live.check quiet inst.xtimeout=1200 ++ initrd @INITRDPATH@ +diff --git a/80-anolis/config_files/sw_64/grub2-efi.cfg b/80-anolis/config_files/sw_64/grub2-efi.cfg +new file mode 100644 +index 0000000..acede09 +--- /dev/null ++++ b/80-anolis/config_files/sw_64/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 inst.profile=anolis inst.xtimeout=1200 ++ initrd @INITRDPATH@ ++} ++menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os { ++ linux @KERNELPATH@ @ROOT@ rd.live.check inst.profile=anolis inst.xtimeout=1200 ++ 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 inst.profile=anolis inst.xtimeout=1200 ++ initrd @INITRDPATH@ ++ } ++ menuentry 'Rescue a @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os { ++ linux @KERNELPATH@ @ROOT@ inst.rescue inst.profile=anolis inst.xtimeout=1200 ++ initrd @INITRDPATH@ ++ } ++} +diff --git a/80-anolis/efi.tmpl b/80-anolis/efi.tmpl +index d351760..26207e1 100644 +--- a/80-anolis/efi.tmpl ++++ b/80-anolis/efi.tmpl +@@ -7,7 +7,7 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol" + + mkdir ${EFIBOOTDIR} + mkdir ${EFIBOOTDIR}/fonts/ +-%if efiarch64 and efiarch64 != 'LOONGARCH64' and efiarch64 != 'riscv64': ++%if efiarch64 and efiarch64 != 'LOONGARCH64' and efiarch64 != 'riscv64' and efiarch64 != 'sw_64': + 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 +@@ -26,6 +26,10 @@ install boot/efi/EFI/*/grubloongarch64.efi ${EFIBOOTDIR}/grub${efiarch64|lower}. + install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI + install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi + %endif ++%if efiarch64 == 'sw_64': ++install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI ++install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi ++%endif + install boot/grub2/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/ + + ## actually make the EFI images +diff --git a/80-anolis/live/config_files/sw_64/grub2-efi.cfg b/80-anolis/live/config_files/sw_64/grub2-efi.cfg +new file mode 100644 +index 0000000..c874547 +--- /dev/null ++++ b/80-anolis/live/config_files/sw_64/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/80-anolis/live/live-install.tmpl b/80-anolis/live/live-install.tmpl +index 10ee0ff..df3976c 100644 +--- a/80-anolis/live/live-install.tmpl ++++ b/80-anolis/live/live-install.tmpl +@@ -32,3 +32,7 @@ + installpkg efibootmgr + installpkg grub2-efi-riscv64-cdboot + %endif ++%if basearch == "sw_64": ++ installpkg efibootmgr ++ installpkg grub2-efi-sw_64-cdboot ++%endif +diff --git a/80-anolis/live/sw_64.tmpl b/80-anolis/live/sw_64.tmpl +new file mode 100644 +index 0000000..643bbc4 +--- /dev/null ++++ b/80-anolis/live/sw_64.tmpl +@@ -0,0 +1,84 @@ ++<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel, extra_boot_args"/> ++<% ++configdir="tmp/config_files/sw_64" ++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/*/gcdsw64.efi"): ++ <% ++ efiarch32 = None ++ efiarch64 = 'sw_64' ++ 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/*/gcdsw64.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/80-anolis/runtime-install.tmpl b/80-anolis/runtime-install.tmpl +index 477e058..5bec04c 100644 +--- a/80-anolis/runtime-install.tmpl ++++ b/80-anolis/runtime-install.tmpl +@@ -86,7 +86,12 @@ installpkg glibc-all-langpacks + installpkg grub2-tools + installpkg uboot-tools + %endif +- ++%if basearch == "sw64": ++ installpkg efibootmgr ++ installpkg grub2-efi-sw64-cdboot ++ installpkg grub2-efi-sw64 ++ installpkg grub2-tools ++%endif + + ## yay, plymouth + installpkg plymouth +@@ -147,7 +152,7 @@ installpkg nmap-ncat + installpkg pciutils usbutils ipmitool + installpkg mt-st smartmontools + installpkg hdparm +-%if basearch not in ("aarch64", "ppc64le", "s390x", "riscv64"): ++%if basearch not in ("aarch64", "ppc64le", "s390x", "riscv64", "sw_64"): + installpkg pcmciautils + %endif + ## see bug #1483278 +@@ -155,7 +160,7 @@ installpkg pcmciautils + installpkg libmlx4 rdma-core + %endif + installpkg rng-tools +-%if basearch in ("i386", "x86_64", "aarch64", "riscv64"): ++%if basearch in ("i386", "x86_64", "aarch64", "riscv64", "sw_64"): + installpkg dmidecode + %endif + +diff --git a/80-anolis/sw_64.tmpl b/80-anolis/sw_64.tmpl +new file mode 100644 +index 0000000..1d8d632 +--- /dev/null ++++ b/80-anolis/sw_64.tmpl +@@ -0,0 +1,86 @@ ++<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel"/> ++<% ++configdir="tmp/config_files/sw_64" ++PXEBOOTDIR="images/pxeboot" ++KERNELDIR=PXEBOOTDIR ++STAGE2IMG="images/install.img" ++LORAXDIR="usr/share/lorax/" ++ ++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/*/gcdsw64.efi"): ++ <% ++ efiarch32 = None ++ efiarch64 = 'sw_64' ++ 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/*/gcdsw64.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 +-- +2.43.5 + diff --git a/lorax-templates-anolis.spec b/lorax-templates-anolis.spec index 50d5f7cc28a76b0a4c958978ac650f7857074b56..d4145a1851139fc1f412a75ff6574dc6964edd12 100644 --- a/lorax-templates-anolis.spec +++ b/lorax-templates-anolis.spec @@ -1,4 +1,4 @@ -%define anolis_release 25 +%define anolis_release 26 Name: lorax-templates-anolis Version: 37.0 @@ -34,6 +34,7 @@ Patch1019: 1019-add-inst.xtimeout-1200.patch Patch1020: 1020-enable-systemd-resolved-by-default.patch Patch1021: 1021-add-riscv64-support-for-lorax-templates-anolis.patch Patch1022: 1022-Fix-lorax-failed-after-webkitgtk-upgrade-to-2.48.patch +Patch1023: 1023-support-sw_64-lorax-templates-anolis.patch # Where are these supposed to end up? %define templatedir %{_datadir}/lorax/templates.d/80-anolis @@ -58,6 +59,9 @@ cp -a 80-anolis/* $RPM_BUILD_ROOT/%{templatedir} %{templatedir}/* %changelog +* Fri Aug 15 2025 zhangbinchen - 37.0-1.26 +- add patch 1023 for sw64 support + * Thu Jun 19 2025 Yihao Yan - 37.0-1.25 - Fix build images failed after webkitgtk upgrade to 2.48