[PATCH 06/22] grub: change @linux_suffix@

Anton Midyukov antohami at altlinux.org
Fri Jan 3 12:58:15 MSK 2020


---
 features.in/grub/cfg.in/00defaults.cfg            | 11 -----------
 features.in/grub/cfg.in/20install2.cfg            |  4 ++--
 features.in/grub/cfg.in/25install-vnc-connect.cfg |  4 ++--
 features.in/grub/cfg.in/25install-vnc-listen.cfg  |  4 ++--
 features.in/grub/cfg.in/30live.cfg                |  4 ++--
 features.in/grub/cfg.in/32live_rw.cfg             |  4 ++--
 features.in/grub/cfg.in/80rescue.cfg              |  4 ++--
 features.in/grub/cfg.in/82rescue_rw.cfg           |  4 ++--
 features.in/grub/cfg.in/83rescue_fm.cfg           |  4 ++--
 features.in/grub/cfg.in/85mediacheck.cfg          |  4 ++--
 features.in/grub/cfg.in/90memtest_efi.cfg         |  2 +-
 features.in/grub/stage1/scripts.d/01-grub         | 12 ++++++++++++
 12 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/features.in/grub/cfg.in/00defaults.cfg b/features.in/grub/cfg.in/00defaults.cfg
index 4d469d4817..88b56d9873 100644
--- a/features.in/grub/cfg.in/00defaults.cfg
+++ b/features.in/grub/cfg.in/00defaults.cfg
@@ -4,14 +4,3 @@ insmod minicmd
 insmod normal
 insmod test
 set timeout=@timeout@
-
-if [ $grub_cpu = x86_64 -o $grub_cpu = i386 ]; then
-    if [ $grub_platform = efi ]; then
-        linux_suffix=efi
-    elif [ $grub_platform = pc ]; then
-        linux_suffix=16
-    else
-        linux_suffix=
-else
-    linux_suffix=
-fi
diff --git a/features.in/grub/cfg.in/20install2.cfg b/features.in/grub/cfg.in/20install2.cfg
index 373cd892fc..9cf86bbed0 100644
--- a/features.in/grub/cfg.in/20install2.cfg
+++ b/features.in/grub/cfg.in/20install2.cfg
@@ -1,6 +1,6 @@
 
 default='linux'
 menuentry 'Install @relname@' --hotkey 'i' --id 'linux' {
-  linux$linux_suffix @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ vga=@bootvga@ @bootargs@
-  initrd$linux_suffix @boot_path@/full.cz
+  linux ÎÁ linux_suffix@ @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ vga=@bootvga@ @bootargs@
+  initrd ÎÁ linux_suffix@ @boot_path@/full.cz
 }
diff --git a/features.in/grub/cfg.in/25install-vnc-connect.cfg b/features.in/grub/cfg.in/25install-vnc-connect.cfg
index 77cbee0e5c..8277bd4b03 100644
--- a/features.in/grub/cfg.in/25install-vnc-connect.cfg
+++ b/features.in/grub/cfg.in/25install-vnc-connect.cfg
@@ -1,5 +1,5 @@
 
 menuentry 'Install ALT @relname@ (headless with DHCP+VNC client) (edit to set server IP address)' --id 'vncconnect' {
-  linux$linux_suffix @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncconnect=IP
-  initrd$linux_suffix @boot_path@/full.cz
+  linux ÎÁ linux_suffix@ @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncconnect=IP
+  initrd ÎÁ linux_suffix@ @boot_path@/full.cz
 }
diff --git a/features.in/grub/cfg.in/25install-vnc-listen.cfg b/features.in/grub/cfg.in/25install-vnc-listen.cfg
index 39606a400a..a056a64fca 100644
--- a/features.in/grub/cfg.in/25install-vnc-listen.cfg
+++ b/features.in/grub/cfg.in/25install-vnc-listen.cfg
@@ -1,6 +1,6 @@
 
 menuentry 'Install ALT @relname@ (headless with DHCP+VNC) (password VNCPWD)' --id 'vncpasswd' {
-  linux$linux_suffix @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD
-  initrd$linux_suffix @boot_path@/full.cz
+  linux ÎÁ linux_suffix@ @boot_path@/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD
+  initrd ÎÁ linux_suffix@ @boot_path@/full.cz
 }
 
diff --git a/features.in/grub/cfg.in/30live.cfg b/features.in/grub/cfg.in/30live.cfg
index b03b5ade9e..5e4b85ada6 100644
--- a/features.in/grub/cfg.in/30live.cfg
+++ b/features.in/grub/cfg.in/30live.cfg
@@ -1,6 +1,6 @@
 menuentry 'LiveCD (no hard disk needed)' --id 'live' {
-  linux$linux_suffix @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts lowmem vga=@bootvga@ @bootargs@
-  initrd$linux_suffix @boot_path@/full.cz
+  linux ÎÁ linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts lowmem vga=@bootvga@ @bootargs@
+  initrd ÎÁ linux_suffix@ @boot_path@/full.cz
 }
 
 
diff --git a/features.in/grub/cfg.in/32live_rw.cfg b/features.in/grub/cfg.in/32live_rw.cfg
index 5aec351804..4bac28aa65 100644
--- a/features.in/grub/cfg.in/32live_rw.cfg
+++ b/features.in/grub/cfg.in/32live_rw.cfg
@@ -1,4 +1,4 @@
 menuentry 'LiveCD with sessions support' --id 'session' {
-  linux$linux_suffix @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts live_rw vga=@bootvga@ @bootargs@
-  initrd$linux_suffix @boot_path@/full.cz
+  linux ÎÁ linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts live_rw vga=@bootvga@ @bootargs@
+  initrd ÎÁ linux_suffix@ @boot_path@/full.cz
 }
diff --git a/features.in/grub/cfg.in/80rescue.cfg b/features.in/grub/cfg.in/80rescue.cfg
index 230f8c6cb3..a9d2575cfb 100644
--- a/features.in/grub/cfg.in/80rescue.cfg
+++ b/features.in/grub/cfg.in/80rescue.cfg
@@ -1,4 +1,4 @@
 menuentry 'Rescue LiveCD' --id 'rescue' {
-  linux$linux_suffix @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@
-  initrd$linux_suffix @boot_path@/full.cz
+  linux ÎÁ linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@
+  initrd ÎÁ linux_suffix@ @boot_path@/full.cz
 }
diff --git a/features.in/grub/cfg.in/82rescue_rw.cfg b/features.in/grub/cfg.in/82rescue_rw.cfg
index 6266962645..753c642bc3 100644
--- a/features.in/grub/cfg.in/82rescue_rw.cfg
+++ b/features.in/grub/cfg.in/82rescue_rw.cfg
@@ -1,4 +1,4 @@
 menuentry 'Rescue with sessions support' --id 'rescue_session' {
-  linux$linux_suffix @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom,label:ALT* ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@ live_rw
-  initrd$linux_suffix @boot_path@/full.cz
+  linux ÎÁ linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom,label:ALT* ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@ live_rw
+  initrd ÎÁ linux_suffix@ @boot_path@/full.cz
 }
diff --git a/features.in/grub/cfg.in/83rescue_fm.cfg b/features.in/grub/cfg.in/83rescue_fm.cfg
index e2214b6cc5..2374452dee 100644
--- a/features.in/grub/cfg.in/83rescue_fm.cfg
+++ b/features.in/grub/cfg.in/83rescue_fm.cfg
@@ -1,4 +1,4 @@
 menuentry 'Forensic mode (leave disks alone)' --id 'rescue_forensic' {
-  linux$linux_suffix @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ splash=0 showopts stagename=rescue @rescue_bootargs@ max_loop=16 forensic hash=@rescue_hash@
-  initrd$linux_suffix @boot_path@/full.cz
+  linux ÎÁ linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ splash=0 showopts stagename=rescue @rescue_bootargs@ max_loop=16 forensic hash=@rescue_hash@
+  initrd ÎÁ linux_suffix@ @boot_path@/full.cz
 }
diff --git a/features.in/grub/cfg.in/85mediacheck.cfg b/features.in/grub/cfg.in/85mediacheck.cfg
index 490df685f2..918f074dbe 100644
--- a/features.in/grub/cfg.in/85mediacheck.cfg
+++ b/features.in/grub/cfg.in/85mediacheck.cfg
@@ -1,4 +1,4 @@
 menuentry 'Check this media for defects' --id 'mediachk' {
-  linux$linux_suffix @boot_path@/vmlinuz changedisk live quiet lowmem automatic=method:cdrom mediacheck=1 stagename=mediacheck showopts @bootargs@
-  initrd$linux_suffix @boot_path@/full.cz
+  linux ÎÁ linux_suffix@ @boot_path@/vmlinuz changedisk live quiet lowmem automatic=method:cdrom mediacheck=1 stagename=mediacheck showopts @bootargs@
+  initrd ÎÁ linux_suffix@ @boot_path@/full.cz
 }
diff --git a/features.in/grub/cfg.in/90memtest_efi.cfg b/features.in/grub/cfg.in/90memtest_efi.cfg
index d0d27372d9..c52d1a6ffc 100644
--- a/features.in/grub/cfg.in/90memtest_efi.cfg
+++ b/features.in/grub/cfg.in/90memtest_efi.cfg
@@ -1,3 +1,3 @@
 menuentry 'Memory Test' --id 'memtest' {
-  linux$linux_suffix /EFI/tools/memtest86.efi
+  linux ÎÁ linux_suffix@ /EFI/tools/memtest86.efi
 }
diff --git a/features.in/grub/stage1/scripts.d/01-grub b/features.in/grub/stage1/scripts.d/01-grub
index 4ea9a02acd..e7e82a9bfd 100755
--- a/features.in/grub/stage1/scripts.d/01-grub
+++ b/features.in/grub/stage1/scripts.d/01-grub
@@ -61,6 +61,18 @@ if [ -f "$CFG_EFI" ]; then
 	sed -i 's, ÎÁ boot_path@,/EFI/BOOT,g' "$CFG_EFI"
 fi
 
+# change @linux_suffix@
+case "$GLOBAL_ARCH" in
+	i586|x86_64)
+		[ ! -f "$CFG" ] || sed -i 's/@linux_suffix@/16/g' "$CFG"
+		[ ! -f "$CFG_EFI" ] || sed -i 's/@linux_suffix@/efi/g' "$CFG_EFI"
+	;;
+	*)
+		[ ! -f "$CFG" ] || sed -i 's/@linux_suffix@//g' "$CFG"
+		[ ! -f "$CFG_EFI" ] || sed -i 's/@linux_suffix@//g' "$CFG_EFI"
+	;;
+esac
+
 # snippets are not going into the actual image
 if [ "$DEBUG" != 2 ]; then
 	rm -r .in/
-- 
2.24.1


--------------E54E3444F4BC138E1CEC79A9
Content-Type: text/x-patch;
 name="0007-grub-available-for-i586-x86_64-aarch64-ppc64le.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0007-grub-available-for-i586-x86_64-aarch64-ppc64le.patch"



More information about the devel-distro mailing list