Re: Multi Bootloaders support patch (not working)

2015-08-26 Thread adrian15

I attach the new patch that seems to work ok with the default value.
I have not tried two bootloaders at the same time yet.
I will do these tests when I implement loopback.cfg binary based on this 
commit.


I copy and paste from the git commit because I'm concerned on how to 
deal with IFS variable (not saving and reusing the old value (well, 
that's not exactly what I'm actually doing) was the reason why things 
did not work as expected).


Finally I have not commited this to a custom tmp-something branch based 
debian-next yet. I will wait till I have something more robust unless 
you think it's better for me to commit it instead of sending patches here.


---

Note: OLDIFS use makes IFS to be reset to  instead to it being unset.
Either we need to detect if old IFS was unset to unset it
or we need a proper way of setting it as a local variable.
Even more IFS it's not currently used in
Check_package (which it's called from: binary_hdd).
we should have a clean way of resetting/unsetting IFS when calling 
Check_package.


The other approach it's to explicitly define IFS with its default 
value in the
places inside live-build code where we implicitly suppose that it's 
going to have

its default value.




El 21/08/15 a las 20:08, adrian15 escribió:
This is a patch for adding Multi bootloaders support to Debian Live. 
(Based on current git master).


This is the first step I need to be able to add loopback.cfg support 
to Debian Live.


It's currently not working. Any help on debugging it it's needed.

Thank you !

adrian15


--
Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona 
a Super Grub Disk. http://www.supergrubdisk.org/donate/

commit 036355074e84e4088d307d7c4cd7474ac0010b04
Author: Adrian Gibanel Lopez adrian.giba...@btactic.com
Date:   Fri Aug 21 23:54:46 2015 +0200

Multi bootloader support

Note: OLDIFS use makes IFS to be reset to  instead to it being unset.
Either we need to detect if old IFS was unset to unset it
or we need a proper way of setting it as a local variable.
Even more IFS it's not currently used in
Check_package (which it's called from: binary_hdd).
we should have a clean way of resetting/unsetting IFS when calling Check_package.

The other approach it's to explicitly define IFS with its default value in the
places inside live-build code where we implicitly suppose that it's going to have
its default value.

diff --git a/functions/defaults.sh b/functions/defaults.sh
index eba52ae..a0cb968 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -536,11 +536,11 @@ Set_defaults ()
 	esac
 
 	# Setting bootloader
-	if [ -z ${LB_BOOTLOADER} ]
+	if [ -z ${LB_BOOTLOADERS} ]
 	then
 		case ${LB_ARCHITECTURES} in
 			amd64|i386)
-LB_BOOTLOADER=syslinux
+LB_BOOTLOADERS=syslinux
 ;;
 		esac
 	fi
@@ -853,7 +853,10 @@ Check_defaults ()
 		fi
 	fi
 
-	if [ ${LB_BOOTLOADER} = syslinux ]
+
+	LB_PRIMARY_BOOTLOADER=$(echo ${LB_BOOTLOADERS} | awk -F, '{ print $1 }')
+
+	if [ ${LB_PRIMARY_BOOTLOADER} = syslinux ]
 	then
 		# syslinux + fat or ntfs, or extlinux + ext[234] or btrfs
 		case ${LB_BINARY_FILESYSTEM} in
@@ -867,7 +870,7 @@ Check_defaults ()
 
 	case ${LIVE_IMAGE_TYPE} in
 		hdd*)
-			case ${LB_BOOTLOADER} in
+			case ${LB_PRIMARY_BOOTLOADER} in
 grub)
 	Echo_error You have selected a combination of bootloader and image type that is currently not supported by live-build. Please use either another bootloader or a different image type.
 	exit 1
diff --git a/scripts/build/binary_grub-legacy b/scripts/build/binary_grub-legacy
index 8a2093b..59daab0 100755
--- a/scripts/build/binary_grub-legacy
+++ b/scripts/build/binary_grub-legacy
@@ -24,9 +24,19 @@ Arguments ${@}
 Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
 Set_defaults
 
-if [ ${LB_BOOTLOADER} != grub-legacy ]
-then
-	exit 0
+FOUND_MYSELF=
+IFS=, ; for BOOTLOADER in ${LB_BOOTLOADERS} ; do
+
+   case ${BOOTLOADER} in
+   grub-legacy )
+   FOUND_MYSELF=True
+   break ;;
+   esac
+
+done
+
+if [ -z ${FOUND_MYSELF} ] ; then
+exit 0
 fi
 
 Echo_message Begin installing grub-legacy...
diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc
index de2683c..d8085fb 100755
--- a/scripts/build/binary_grub-pc
+++ b/scripts/build/binary_grub-pc
@@ -24,9 +24,21 @@ Arguments ${@}
 Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
 Set_defaults
 
-if [ ${LB_BOOTLOADER} != grub-pc ]
-then
-	exit 0
+FOUND_MYSELF=
+OLDIFS=$IFS
+IFS=, ; for BOOTLOADER in ${LB_BOOTLOADERS} ; do
+
+   case ${BOOTLOADER} in
+   grub-pc )
+   FOUND_MYSELF=True
+   break ;;
+   esac
+
+done
+IFS=$OLDIFS
+
+if [ -z ${FOUND_MYSELF} ] ; then
+exit 0
 fi
 
 Echo_message Begin installing 

Multi Bootloaders support patch (not working)

2015-08-21 Thread adrian15
This is a patch for adding Multi bootloaders support to Debian Live. 
(Based on current git master).


This is the first step I need to be able to add loopback.cfg support to 
Debian Live.


It's currently not working. Any help on debugging it it's needed.

Thank you !

adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona 
a Super Grub Disk. http://www.supergrubdisk.org/donate/

commit c0263ca760f1af55a4b74c386baba14ea84eea7c
Author: Daniel Baumann m...@daniel-baumann.ch
Date:   Fri Aug 14 14:05:39 2015 +0200

Wrap and sort debian control file.

diff --git a/debian/control b/debian/control
index 05d6c59..f2996af 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,10 @@ Source: live-build
 Section: misc
 Priority: optional
 Maintainer: Live Systems Maintainers debian-live@lists.debian.org
-Uploaders: Daniel Baumann m...@daniel-baumann.ch
-Build-Depends: debhelper (= 9)
+Uploaders:
+ Daniel Baumann m...@daniel-baumann.ch,
+Build-Depends:
+ debhelper (= 9),
 Standards-Version: 3.9.6
 Homepage: http://live-systems.org/devel/live-build/
 Vcs-Browser: http://live-systems.org/gitweb/?p=live-build.git
@@ -12,18 +14,18 @@ Vcs-Git: git://live-systems.org/git/live-build.git
 Package: live-build
 Architecture: all
 Depends:
- ${misc:Depends},
  debootstrap,
+ ${misc:Depends},
 Recommends:
  apt-utils,
  cpio,
- wget,
  live-boot-doc,
  live-config-doc,
  live-manual-html | live-manual,
+ wget,
 Suggests:
- gpgv,
  debian-keyring,
+ gpgv,
 Description: Live System Build Components
  The Live Systems project maintains the components to build Debian based Live
  systems and the official Debian Live images themselves.