Can you any of the new maintainers take a look at this request?

I attach an updated patch that adds arch autodetection support to isolinux.

I've tried it in actual hardware booting in BIOS-only mode and it works
as expected.


Thank you very much!


Note that the grub2's support arch autodetection is already present in
binary_loopback_cfg. So I only want isolinux support to be added.

adrian15
-- 
Support free software. Donate to Super Grub Disk. Apoya el software
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
>From 13730f7f8db6eb9bdd82a06b5c38148c56b2278d Mon Sep 17 00:00:00 2001
From: Adrian Gibanel Lopez <adrian.giba...@btactic.com>
Date: Sun, 7 Dec 2014 17:46:07 +0100
Subject: [PATCH] Syslinux build now supports: Arch detection It adds a default
 boot option that automatically chooses either amd64 or x86 kernel depending
 on the detected cpu flags.

---
 scripts/build/binary_syslinux | 39 ++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux
index bb6658826..24ddbb445 100755
--- a/scripts/build/binary_syslinux
+++ b/scripts/build/binary_syslinux
@@ -147,6 +147,12 @@ case "${LB_BUILD_WITH_CHROOT}" in
 		;;
 esac
 
+# Copy necessary syslinux modules
+for module in ifcpu64.c32
+do
+	cp "chroot/usr/lib/syslinux/modules/bios/${module}" "${_TARGET}/"
+done
+
 # Configuring files
 if [ -e "${_TARGET}/live.cfg.in" ]
 then
@@ -169,6 +175,22 @@ then
 			;;
 
 		*)
+			_AMD64_686_NUMBER="0"
+
+			for _FLAVOUR in ${LB_LINUX_FLAVOURS}
+			do
+				if [ "${_FLAVOUR}" = "amd64" -o "${_FLAVOUR}" = "686" ] ; then
+					_AMD64_686_NUMBER="$((${_AMD64_686_NUMBER} + 1))"
+				fi
+			done
+
+			if [ "${_AMD64_686_NUMBER}" -ge 2 ] ; then
+				_AMD64_LABEL=$(cat "${_TARGET}/live.cfg.in" | grep "^label" | grep -v "failsafe" | sed 's/label //g' | sed -e "s|@FLAVOUR@|""amd64""|g")
+				_686_LABEL=$(cat "${_TARGET}/live.cfg.in" | grep "^label" | grep -v "failsafe" | sed 's/label //g' | sed -e "s|@FLAVOUR@|""686""|g")
+				_AUTO_LABEL=$(cat "${_TARGET}/live.cfg.in" | grep "^label" | grep -v "failsafe" | sed 's/label //g' | sed -e "s|@FLAVOUR@|""autodetect""|g")
+				_AUTO_MENU_LABEL=$(cat "${_TARGET}/live.cfg.in" | grep "menu label" | grep -v "failsafe" | sed 's/.*menu label //g' | sed -e "s|@FLAVOUR@|""auto""|g")
+			fi
+
 			_NUMBER="0"
 
 			for _FLAVOUR in ${LB_LINUX_FLAVOURS}
@@ -183,7 +205,22 @@ then
 					echo "" >> "${_TARGET}/live.cfg"
 					grep -v 'menu default' "${_TARGET}/live.cfg.in" >> "${_TARGET}/live.cfg"
 				else
-					cat "${_TARGET}/live.cfg.in" >> "${_TARGET}/live.cfg"
+					if [ "${_AMD64_686_NUMBER}" -ge 2 ] ; then
+						cat << EOF >> "${_TARGET}/live.cfg"
+label ${_AUTO_LABEL}
+	menu label ${_AUTO_MENU_LABEL}
+	com32 ifcpu64.c32
+	append ${_AMD64_LABEL} -- ${_686_LABEL} -- ${_686_LABEL}
+
+EOF
+					fi
+
+
+					if [ "${_AMD64_686_NUMBER}" -ge 2 ] ; then
+						grep -v 'menu default' "${_TARGET}/live.cfg.in" >> "${_TARGET}/live.cfg"
+					else
+						cat "${_TARGET}/live.cfg.in" >> "${_TARGET}/live.cfg"
+					fi
 				fi
 
 				sed -i -e "s|@FLAVOUR@|${_FLAVOUR}|g" \

Reply via email to