From 1421e85651a656cdc89d206467894e748eb8f8b9 Mon Sep 17 00:00:00 2001
From: isoft <wenjuan.qiu@i-soft.com.cn>
Date: Wed, 2 Nov 2022 06:20:04 +0000
Subject: [PATCH] sw64 tmpl label modify

---
 .../99-generic/config_files/sw64/boot/grub/grub.cfg    |  4 ++--
 share/templates.d/99-generic/sw64.tmpl                 | 10 ++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/share/templates.d/99-generic/sw64.tmpl b/share/templates.d/99-generic/sw64.tmpl
index cea9225..3830f2e 100644
--- a/share/templates.d/99-generic/sw64.tmpl
+++ b/share/templates.d/99-generic/sw64.tmpl
@@ -8,10 +8,10 @@ ISOLINUXDIR="isolinux"
 LORAXDIR="usr/share/lorax/"
 
 ## Don't allow spaces or escape characters in the iso label
-def valid_label(ch):
-    return ch.isalnum() or ch == '_'
+#def valid_label(ch):
+#    return ch.isalnum() or ch == '_'
 
-isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel)
+#isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel)
 
 import os
 from os.path import basename
@@ -54,6 +54,8 @@ install ${configdir}/boot/grub/splash.xpm.gz  ${BOOTDIR}/grub/
 install ${configdir}/boot/grub/fonts/unicode.pf2       ${BOOTDIR}/grub/fonts/
 install ${configdir}/boot/grub/locale/zh_CN.mo         ${BOOTDIR}/grub/locale/
 
+ln -s ${BOOTDIR}/boot .
+
 %for kernel in kernels:
     %if kernel.flavor:
         ## i386 PAE
@@ -68,7 +70,7 @@ install ${configdir}/boot/grub/locale/zh_CN.mo         ${BOOTDIR}/grub/locale/
 
 replace @VERSION@ '${product.version}' ${BOOTDIR}/grub/grub.cfg 
 replace @PRODUCT@ '${product.name}'  ${BOOTDIR}/grub/grub.cfg 
-replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${BOOTDIR}/grub/grub.cfg
+replace @LABEL@ '${isolabel|udev}' ${BOOTDIR}/grub/grub.cfg
 
 install ${configdir}/efibootimg  ${BOOTDIR}/../
 
-- 
2.33.0

