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

Bug#778627: live-build: syslinux mbr.bin file not found (again)



Package: live-build
Version: 4.0.5-1
Severity: normal

Hello,

it seems mbr.bin has moved to a subdirectory which causes hdd build
failure in Jessie.

Attaching a patch.

I applied some reformatting to better conform to the coding style so
hope it still works.

Thanks

Michal

-- Package-specific info:

-- System Information:
Debian Release: 8.0
  APT prefers testing
  APT policy: (910, 'testing'), (900, 'stable'), (410, 'unstable'), (400, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.18.0-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages live-build depends on:
ii  debootstrap  1.0.66

Versions of packages live-build recommends:
ii  cpio                            2.11+dfsg-4
ii  live-boot-doc                   4.0.1-1
ii  live-config-doc                 4.0.2-1
pn  live-manual-html | live-manual  <none>

live-build suggests no packages.

-- no debconf information
commit 5720a9d88db781251145c41ce3ce39b8b6763ee7
Author: Michal Suchanek <hramrach@gmail.com>
Date:   Tue Feb 17 13:01:40 2015 +0100

    Fixing binary hdd build.
    
    Signed-off-by: Michal Suchanek <hramrach@gmail.com>

diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd
index 90cd3e9..f290bf2 100755
--- a/scripts/build/binary_hdd
+++ b/scripts/build/binary_hdd
@@ -182,6 +182,18 @@ case "${LB_BINARY_FILESYSTEM}" in
 		;;
 esac
 
+Find_mbrbin() {
+	for _MBR in chroot/usr/lib/${_BOOTLOADER}/mbr/mbr.bin chroot/usr/lib/${_BOOTLOADER}/mbr.bin ; do
+		if [ -f "${_MBR}" ]
+		then
+			echo "${_MBR}"
+			return 0
+		fi
+	done
+	Echo_error "Cannot find mbr.bin." >&2
+	exit 1
+}
+
 case "${LB_BUILD_WITH_CHROOT}" in
 	true)
 		Chroot chroot "parted -s ${FREELO} mklabel ${PARTITION_TABLE_TYPE}" || true
@@ -191,7 +203,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
 
 		if [ "${LB_BOOTLOADER}" = "syslinux" ]
 		then
-			dd if=chroot/usr/lib/${_BOOTLOADER}/mbr.bin of=${FREELO} bs=440 count=1
+			dd if=$(Find_mbrbin) of=${FREELO} bs=440 count=1
 		fi
 		;;
 
@@ -203,7 +215,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
 
 		if [ "${LB_BOOTLOADER}" = "syslinux" ]
 		then
-			dd if=/usr/lib/${_BOOTLOADER}/mbr.bin of=${FREELO} bs=440 count=1
+			dd if=$(Find_mbrbin) of=${FREELO} bs=440 count=1
 		fi
 		;;
 esac

Reply to: