[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[RFC] Architecture detection patches in multiarch CDs



Dear all,

After three DebConfs discussing this (but only actually using DebConf 
space/time to actually work on it), and taking the opportunity of the 
immediate post stretch-alpha2 period, I'd like to discuss two 
architecture detection patches for a smarter boot of multiarch CDs.

* 0001-Add-syslinux-machinery-to-use-ifcpu64.c32-on-multi-a.patch

This is a patch against installer.git, to add the needed files in the 
boot directory: All x86* menu entries are moved under x86menu.cfg and 
x86.cfg. x86.cfg is roughly equivalent to menu.cfg and is meant to be a 
direct vesamenu.cfg argument (for when the detection code says only 32 
bits is possible), x86menu.cfg is the wrapper around this when 32 bits 
is a sub-option of the 64bits menu.

x86syslinux.cfg is the new start menu leveraging ifcpu64.c32 and 
launching vesamenu.c32 upon detection.

* 0001-Add-management-of-arch-detection-from-d-i-in-isolinu.patch

This is a patch against debian-cd.git. Inclusion of ifcpu64.c32 (1.7k) 
is only done on the second run (MULTIARCH=1), and the second thing this 
does is to use the x86syslinux.cfg (named that way so that it becomes 
deleted on non-multiarch deployments) and use it as isolinux.cfg.

Comments, ideas?

Cheers,
OdyX
>From 172aa231a60f0886cbafb2b2a943e81b00042212 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Sat, 15 Aug 2015 15:13:04 +0200
Subject: [PATCH] Add syslinux machinery to use ifcpu64.c32 on multi-arch CDs,
 for CPU 64-bits capability detection

---
 build/boot/x86/menu.cfg        |  8 +-------
 build/boot/x86/x86.cfg         | 25 +++++++++++++++++++++++++
 build/boot/x86/x86menu.cfg     |  6 ++++++
 build/boot/x86/x86syslinux.cfg | 15 +++++++++++++++
 debian/changelog               |  7 +++++++
 5 files changed, 54 insertions(+), 7 deletions(-)
 create mode 100644 build/boot/x86/x86.cfg
 create mode 100644 build/boot/x86/x86menu.cfg
 create mode 100644 build/boot/x86/x86syslinux.cfg

diff --git a/build/boot/x86/menu.cfg b/build/boot/x86/menu.cfg
index 4fada91..251d3e8 100644
--- a/build/boot/x86/menu.cfg
+++ b/build/boot/x86/menu.cfg
@@ -4,9 +4,7 @@ menu width 61
 menu title ${BEEP}Debian GNU/Linux installer boot menu
 include ${SYSDIR}stdmenu.cfg
 include ${SYSDIR}gtk.cfg
-include ${SYSDIR}x86gtk.cfg
 include ${SYSDIR}txt.cfg
-include ${SYSDIR}x86txt.cfg
 menu begin advanced
     menu label ^Advanced options
 	menu title Advanced options
@@ -15,10 +13,9 @@ menu begin advanced
 		menu label ^Back..
 		menu exit
 	include ${SYSDIR}adgtk.cfg
-	include ${SYSDIR}x86adgtk.cfg
 	include ${SYSDIR}adtxt.cfg
-	include ${SYSDIR}x86adtxt.cfg
 menu end
+include ${SYSDIR}x86menu.cfg
 label help
 	menu label ^Help
 	text help
@@ -26,6 +23,3 @@ label help
 	endtext
 	config ${SYSDIR}prompt.cfg
 include ${SYSDIR}spkgtk.cfg
-include ${SYSDIR}x86spgtk.cfg
-include ${SYSDIR}spk.cfg
-include ${SYSDIR}x86spk.cfg
diff --git a/build/boot/x86/x86.cfg b/build/boot/x86/x86.cfg
new file mode 100644
index 0000000..ab7a559
--- /dev/null
+++ b/build/boot/x86/x86.cfg
@@ -0,0 +1,25 @@
+menu hshift 7
+menu width 61
+
+menu title ${BEEP}Debian GNU/Linux 32bits installer menu
+include ${SYSDIR}stdmenu.cfg
+
+include ${SYSDIR}x86gtk.cfg
+include ${SYSDIR}x86txt.cfg
+menu begin advanced
+    menu label ^Advanced options
+        menu title Advanced options
+        include ${SYSDIR}stdmenu.cfg
+        label mainmenu
+                menu label ^Back..
+                menu exit
+        include ${SYSDIR}x86adgtk.cfg
+        include ${SYSDIR}x86adtxt.cfg
+menu end
+label help
+        menu label ^Help
+        text help
+   Display help screens; type 'menu' at boot prompt to return to this menu
+        endtext
+        config ${SYSDIR}prompt.cfg
+include ${SYSDIR}x86spkgtk.cfg
diff --git a/build/boot/x86/x86menu.cfg b/build/boot/x86/x86menu.cfg
new file mode 100644
index 0000000..662917c
--- /dev/null
+++ b/build/boot/x86/x86menu.cfg
@@ -0,0 +1,6 @@
+menu begin x86
+    menu label ^32 bit install options
+    menu title 32 bit install options
+    include ${SYSDIR}stdmenu.cfg
+    include ${SYSDIR}x86.cfg
+menu end
diff --git a/build/boot/x86/x86syslinux.cfg b/build/boot/x86/x86syslinux.cfg
new file mode 100644
index 0000000..716c415
--- /dev/null
+++ b/build/boot/x86/x86syslinux.cfg
@@ -0,0 +1,15 @@
+# D-I config version 3.0
+# search path for the c32 support libraries (libcom32, libutil etc.)
+path ${SYSDIR}
+label archdetect
+ kernel ${SYSDIR}ifcpu64.c32
+ append amd64 -- i386
+label amd64
+ kernel ${SYSDIR}vesamenu.c32
+ append menu.cfg
+label i386
+ kernel ${SYSDIR}vesamenu.c32
+ append x86.cfg
+default archdetect
+prompt 0
+timeout 0
diff --git a/debian/changelog b/debian/changelog
index 07795bb..98ab917 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+debian-installer (20150815) UNRELEASED; urgency=medium
+
+  * Add syslinux machinery to use ifcpu64.c32 on multi-arch CDs, for CPU
+    64-bits capability detection
+
+ -- Didier Raboud <odyx@debian.org>  Sat, 15 Aug 2015 15:43:05 +0200
+
 debian-installer (20150813) unstable; urgency=medium
 
   [ Didier Raboud ]
-- 
2.5.0

>From 33accc6d955178374ef6dfcf02fd074ffe6b3795 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Sat, 15 Aug 2015 15:49:50 +0200
Subject: [PATCH] Add management of arch detection from d-i in isolinux

---
 debian/changelog            | 1 +
 tools/boot/stretch/boot-x86 | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 940d65e..4cdcd0b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,7 @@ debian-cd (3.1.18) UNRELEASED; urgency=medium
   [ Didier Raboud ]
   * For stretch, swap amd64 and i386 to let the first be the norm, and the
     latter be the special case, this copes with the similar change in d-i
+  * Add management of arch detection from d-i in isolinux
 
  -- Steve McIntyre <93sam@debian.org>  Mon, 20 Apr 2015 12:36:57 +0100
 
diff --git a/tools/boot/stretch/boot-x86 b/tools/boot/stretch/boot-x86
index fbc8812..73ccc1f 100644
--- a/tools/boot/stretch/boot-x86
+++ b/tools/boot/stretch/boot-x86
@@ -296,6 +296,11 @@ if [ "$BOOT_BIOS" = 1 ] ; then
     cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libcom32.c32 boot$N/isolinux/
     cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libutil.c32 boot$N/isolinux/
 
+    if [ ! -z "$MULTIARCH" ]; then
+        # Mandatory for 64bits capability detection
+        cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/ifcpu64.c32 boot$N/isolinux/
+    fi
+
     # If we don't have grub stuff from d-i, tell xorriso to add a
     # partition offset for the isohybrid code
     if [ ! -d boot$N/isolinux/grub ] || [ $BOOT_EFI = 0 ] ; then
@@ -360,6 +365,9 @@ if [ -z "$MULTIARCH" ]; then
     # that does not have both amd64 and i386 dirs.
     find boot$N/isolinux/ -name "x86*.cfg" -delete
 else
+    # Use the syslinux.cfg with architecture detection
+    mv boot$N/isolinux/x86syslinux.cfg boot$N/isolinux/isolinux.cfg
+
     # Set up isolinux dir for multi-arch
     grep -lr '%install[-x86]*%' boot$N/isolinux/* | \
         xargs -r sed -i -e "s|%install%|$INSTALLDIR_amd64|" \
-- 
2.5.0


Reply to: