Took a closer look at the build scripts and found out a couple of things:

- the ntfs format problem can be solved by adding the "-Q" to mkfs.ntfs.
- syslinux still does not install on a ntfs image after correcting mkfs.ntfs
- extlinux officially supports: fat*, ntfs, ext2/3/4 and btrfs
- syslinux officially only supports fat* and ntfs (with ntfs bugged)

As solution I implemented extlinux and tested it succesfully for fat32, ntfs and ext4. Then I configured the scripts to use extlinux when syslinux is chosen with "lb config". It seems extlinux can function as a complete and improved replacement for syslinux. If there are no specific advantages of using syslinux, it may be an option to completely remove it.

Attached a patch with changes for 'binary_hdd', 'binary_syslinux' and 'binary_loopback_cfg'.

Bob
--- a/scripts/build/binary_hdd
+++ b/scripts/build/binary_hdd
@@ -70,12 +70,9 @@
 LB_PRIMARY_BOOTLOADER=$(echo "${LB_BOOTLOADERS}" | awk -F, '{ print $1 }')
 
 case ${LB_PRIMARY_BOOTLOADER} in
-		syslinux)
+		syslinux|extlinux)
 			case ${LB_BINARY_FILESYSTEM} in
-				fat*|ntfs)
-					_BOOTLOADER=syslinux
-					;;
-				ext[234]|btrfs)
+				ext[234]|btrfs|ntfs|fat*)
 					_BOOTLOADER=extlinux
 					;;
 				*)
@@ -184,9 +181,13 @@
 		Chroot chroot "parted -s ${FREELO} set 1 boot on" || true
 		Chroot chroot "parted -s ${FREELO} set 1 lba off" || true
 
-		if [ "${LB_PRIMARY_BOOTLOADER}" = "syslinux" ]
+		if [ "${_BOOTLOADER}" = "syslinux" ]
 		then
 			dd if=chroot/usr/lib/SYSLINUX/mbr.bin of=${FREELO} bs=440 count=1
+		
+		elif [ "${_BOOTLOADER}" = "extlinux" ]
+		then
+			dd if=chroot/usr/lib/EXTLINUX/mbr.bin of=${FREELO} bs=440 count=1
 		fi
 		;;
 
@@ -204,9 +205,13 @@
 		parted -s "${FREELO}" set 1 boot on || true
 		parted -s "${FREELO}" set 1 lba off || true
 
-		if [ "${LB_PRIMARY_BOOTLOADER}" = "syslinux" ]
+		if [ "${_BOOTLOADER}" = "syslinux" ]
 		then
 			dd if=/usr/lib/SYSLINUX/mbr.bin of=${FREELO} bs=440 count=1
+
+		elif [ "${_BOOTLOADER}" = "extlinux" ]
+		then
+			dd if=/usr/lib/EXTLINUX/mbr.bin of=${FREELO} bs=440 count=1
 		fi
 		;;
 esac
@@ -237,7 +242,7 @@
 
 	ntfs)
 		MKFS="ntfs"
-		MKFS_OPTIONS="-L ${LB_HDD_LABEL}"
+		MKFS_OPTIONS="-Q -L ${LB_HDD_LABEL}"
 		MOUNT_OPTIONS="-t ntfs-3g"
 		;;
 esac
@@ -267,6 +272,9 @@
 mkdir -p chroot/binary.tmp
 mount ${MOUNT_OPTIONS} ${FREELO} chroot/binary.tmp
 cp -T ${CP_OPTIONS} binary/ chroot/binary.tmp
+
+Echo_message "Done..."
+Echo_message "Installing bootloader ${_BOOTLOADER}..."
 
 FIXME()
 {
@@ -304,7 +312,7 @@
 		_SYSLINUX_INSTALLER="syslinux ${FREELO}"
 		;;
 	extlinux)
-		_SYSLINUX_INSTALLER="extlinux --install /binary.tmp/boot/extlinux"
+		_SYSLINUX_INSTALLER="extlinux --install /binary.tmp/extlinux"
 		;;
 	*)
 		_SYSLINUX_INSTALLER=""


--- a/scripts/build/binary_loopback_cfg
+++ b/scripts/build/binary_loopback_cfg
@@ -134,23 +134,10 @@
 
 	hdd*|*)
 		case ${LB_BINARY_FILESYSTEM} in
-			fat*|ntfs)
-				_BOOTLOADER=syslinux
-
-				case "${LB_MODE}" in
-					progress-linux)
-						_TARGET="binary/boot"
-						;;
-
-					*)
-						_TARGET="binary/syslinux"
-						;;
-				esac
-				;;
-
-			ext[234]|btrfs)
+
+			ext[234]|btrfs|fat*|ntfs)
 				_BOOTLOADER=extlinux
-				_TARGET="binary/boot/extlinux"
+				_TARGET="binary/extlinux"
 				;;
 			*)
 				Echo_error "syslinux/extlinux doesn't support ${LB_BINARY_FILESYSTEM}"
@@ -193,7 +180,7 @@
 do
 
        case ${BOOTLOADER} in
-               "syslinux" )
+               "syslinux"|"extlinux" )
                        FOUND_SYSLINUX="True"
                        break ;;
        esac


--- a/scripts/build/binary_syslinux
+++ b/scripts/build/binary_syslinux
@@ -31,7 +31,7 @@
 do
 
        case ${BOOTLOADER} in
-               "syslinux" )
+               "syslinux"|"extlinux" )
                        FOUND_MYSELF="True"
                        break ;;
        esac
@@ -90,23 +90,18 @@
 
 	hdd*|*)
 		case ${LB_BINARY_FILESYSTEM} in
-			fat*|ntfs)
-				_BOOTLOADER=syslinux
-
+			ext[234]|btrfs|fat*|ntfs)
+				_BOOTLOADER=extlinux
+				
 				case "${LB_MODE}" in
 					progress-linux)
 						_TARGET="binary/boot"
 						;;
 
 					*)
-						_TARGET="binary/syslinux"
+						_TARGET="binary/extlinux"
 						;;
 				esac
-				;;
-
-			ext[234]|btrfs)
-				_BOOTLOADER=extlinux
-				_TARGET="binary/boot/extlinux"
 				;;
 			*)
 				Echo_error "syslinux/extlinux doesn't support ${LB_BINARY_FILESYSTEM}"
@@ -327,7 +322,7 @@
 
 case "${LB_MODE}" in
 	progress-linux)
-		for _FILE in "${_TARGET}/isolinux.bin" "${_TARGET}/isolinux.cfg" "${_TARGET}/syslinux.cfg"
+		for _FILE in "${_TARGET}/isolinux.bin" "${_TARGET}/isolinux.cfg" "${_TARGET}/syslinux.cfg" "${_TARGET}/extlinux.cfg"
 		do
 			if [ -e "${_FILE}" ]
 			then

Reply via email to