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

Bug#759424: di-netboot-assistant: please update package for jessie / new syslinux



Quoting Jonas Smedegaard (2014-11-23 13:05:36)
> Quoting Cyril Brulebois (2014-11-23 12:49:58)
>> Jonas Smedegaard <dr@jones.dk> (2014-11-21):
>>> Attached is a patch believed to fix all issues related to new 
>>> syslinux:
>>>
>>>  * Lookup pxelinux.0 in /usr/lib/PXELINUX (not only 
>>>    /usr/lib/syslinux).
>>>  * Lookup only BIOS binaries (not accidentally include EFI 
>>>    binaries).
>>>  * Install core modules at tftpd root dir.
>>>  * Keep vesamenu and menu modules in sync with PXELINUX.
>>
>> thank you both for providing patches to di-netboot-assistant; is 
>> there any chance you could submit a branch or patch series against 
>> its git repository 
>> (git://anonscm.debian.org/d-i/netboot-assistant.git)?
>>
>> Of course I could try and split up your patches into atomic commits, 
>> but I guess it'd be better if knowledgeable could document patches. 
>> There's of course the part where Andreas had to patch a bit more what 
>> Jonas provided, so cross-checking each other would be nice.
>
> Sure thing: I will prepare git commits.

I now have a fork of your git locally, and attached patches were 
produced using "git format-patch --minimal origin/master" - not sure if 
that's what you prefer, else please guide me.

My patches do not incorporate Andreas' addition, as I believe it to be 
wrong.  I could be wrong, of course, and am open to further input.


Hope this all helps,

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
From e4b2ab5cd4e09daf72d51ee5b35b3a8b8b5e92d9 Mon Sep 17 00:00:00 2001
From: Jonas Smedegaard <dr@jones.dk>
Date: Sun, 23 Nov 2014 16:01:15 +0100
Subject: [PATCH 5/5] Handle core PXELINUX modules introduced in recent
 PXELINUX, required to be served at tftp root dir.

---
 di-netboot-assistant | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/di-netboot-assistant b/di-netboot-assistant
index d581507..e21112e 100755
--- a/di-netboot-assistant
+++ b/di-netboot-assistant
@@ -276,6 +276,13 @@ copy_syslinux_bin() {
 	done
 	# Smooth transition to vesamenu
 	[ ! -f "$c32_dir/menu.c32" ] && ln -s "vesamenu.c32" $c32_dir/menu.c32
+	# Add core modules at root (see <https://bugs.debian.org/756275#49>)
+	if [ "$TFTP_ROOT/debian-installer/" = "$dst" ]; then
+		for f in ldlinux.c32 libcom32.c32 libutil.c32; do
+			srcf="$(find_file $f "$src")"
+			[ -z "$srcf" ] || cp -np "$srcf" "$TFTP_ROOT/$f"
+		done
+	fi
 	return 0
 }
 
@@ -925,6 +932,9 @@ setup_syslinux() {
 		  vesamenu.c32|menu.c32)
 			cp -pft "$(dirname "$f")" "$TFTP_ROOT/debian-installer/pxelinux.cfg/$(basename "$f")"
 			;;
+		  ldlinux.c32|libcom32.c32|libutil.c32)
+			cp -pft "$(dirname "$f")" "$TFTP_ROOT/$(basename "$f")"
+			;;
 		  *)
 			echo "W: Unusual PXELINUX module \"$f\" may not work." 1>&2
 			continue
-- 
2.1.3

From 8e3ffac22d2888ed0094ed3a172257836250ccbf Mon Sep 17 00:00:00 2001
From: Jonas Smedegaard <dr@jones.dk>
Date: Sun, 23 Nov 2014 15:45:48 +0100
Subject: [PATCH 4/5] Update PXELINUX modules to be in sync with PXELINUX
 itself.

---
 di-netboot-assistant | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/di-netboot-assistant b/di-netboot-assistant
index 7b93e11..d581507 100755
--- a/di-netboot-assistant
+++ b/di-netboot-assistant
@@ -919,6 +919,18 @@ setup_syslinux() {
 	if ! copy_syslinux_bin "$expand_dir" "$TFTP_ROOT/debian-installer/" ; then
 		echo "E: No PXELinux menu installed. Please file a bug." 1>&2
 	fi
+	# ensure only a single PXELINUX version is used for all its modules
+	for f in $(find "$expand_dir" -type f -name '*.c32'); do
+		case $(basename "$f") in
+		  vesamenu.c32|menu.c32)
+			cp -pft "$(dirname "$f")" "$TFTP_ROOT/debian-installer/pxelinux.cfg/$(basename "$f")"
+			;;
+		  *)
+			echo "W: Unusual PXELINUX module \"$f\" may not work." 1>&2
+			continue
+			;;
+		esac
+	done
 
 	for f in $(find "$expand_dir" -type f -a \( -name "default" -o -name "boot.txt" -o -name '*.cfg' \) ); do
 		mv "$f" "$f.ORIG"
-- 
2.1.3

From 0a3af696406e8cb5e6f695d43118696d940ca2b9 Mon Sep 17 00:00:00 2001
From: Jonas Smedegaard <dr@jones.dk>
Date: Sun, 23 Nov 2014 13:11:08 +0100
Subject: [PATCH 1/5] Extend find_file() to support multiple paths (and fix
 order of arguments in comment while at it).

---
 di-netboot-assistant | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/di-netboot-assistant b/di-netboot-assistant
index 88c06f7..f85e381 100755
--- a/di-netboot-assistant
+++ b/di-netboot-assistant
@@ -200,12 +200,13 @@ print_do_not_edit_header() {
 # ------------------------------------------------------------ #
 # find_file()
 #	Return the name of the first file matching criteria.
-# Parameters: dir name
+# Parameters: name dir [dir...]
 # Returns: (STRING) file
 # ------------------------------------------------------------ #
 find_file() {
 	if [ "$1" -a "$2" ]; then
-		find "$2" -type f -name $1 | head -n 1
+		local name=$1; shift
+		find "$@" -type f -name "$name" | head -n 1
 	else
 		echo ""
 	fi
-- 
2.1.3

From 3a7aac0058e7b643f91315c85863b4310c8828e2 Mon Sep 17 00:00:00 2001
From: Jonas Smedegaard <dr@jones.dk>
Date: Sun, 23 Nov 2014 13:19:08 +0100
Subject: [PATCH 2/5] Handle pxelinux binary located below /usr/lib/PXELINUX in
 recent Debian releases of SYSLINUX.

---
 di-netboot-assistant | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/di-netboot-assistant b/di-netboot-assistant
index f85e381..dea44cf 100755
--- a/di-netboot-assistant
+++ b/di-netboot-assistant
@@ -242,7 +242,12 @@ copy_syslinux_bin() {
 
 	[ ! "$src" -o ! "$dst" ] && return 1
 
-	newbin=$(find_file pxelinux.0 "$src" 2>/dev/null)
+	if [ "$SYSLINUX" = "$src" ]; then
+		# recent SYSLINUX ships PXELINUX at separate location
+		newbin=$(find_file pxelinux.0 /usr/lib/PXELINUX "$SYSLINUX" 2>/dev/null)
+	else
+		newbin=$(find_file pxelinux.0 "$src" 2>/dev/null)
+	fi
 	[ ! -f "$dst/pxelinux.0" -a ! -f "$newbin" ] && return 1
 
 	pxe_new_ver="$(pxelinux_version "$newbin")"
@@ -254,7 +259,11 @@ copy_syslinux_bin() {
 	echo "I: Upgrading PXELinux ($pxe_cur_ver to $pxe_new_ver)"
 
 	for f in pxelinux.0 menu.c32 vesamenu.c32; do
-		srcf="$(find_file $f "$src")"
+		if [ pxelinux.0 = "$f" ]; then
+			srcf="$newbin"
+		else
+			srcf="$(find_file $f "$src")"
+		fi
 		[ "${f#*c32}" ] || f="pxelinux.cfg/$f"
 		[ -L "$dst/$f" ] && rm "$dst/$f"
 		if [ -f "$srcf" ]; then
-- 
2.1.3

From d9952d64b8765add7971054c62949995eddc3537 Mon Sep 17 00:00:00 2001
From: Jonas Smedegaard <dr@jones.dk>
Date: Sun, 23 Nov 2014 14:06:35 +0100
Subject: [PATCH 3/5] Avoid accidental use of non-PXELINUX binaries shipped
 with recent Debian releases of SYSLINUX.

---
 di-netboot-assistant | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/di-netboot-assistant b/di-netboot-assistant
index dea44cf..7b93e11 100755
--- a/di-netboot-assistant
+++ b/di-netboot-assistant
@@ -243,6 +243,8 @@ copy_syslinux_bin() {
 	[ ! "$src" -o ! "$dst" ] && return 1
 
 	if [ "$SYSLINUX" = "$src" ]; then
+		# avoid recent SYSLINUX EFI binaries incompatible with PXELINUX
+		[ ! -d "$src/modules/bios" ] || src="$src/modules/bios"
 		# recent SYSLINUX ships PXELINUX at separate location
 		newbin=$(find_file pxelinux.0 /usr/lib/PXELINUX "$SYSLINUX" 2>/dev/null)
 	else
-- 
2.1.3

Attachment: signature.asc
Description: signature


Reply to: