Hello,

the following patch will fix this bug and bug #772522 (casper is not
installed in ubuntu mode in live-build 4.0.3-1). It fixes the
--initsystem option and --mode ubuntu.

Example (one may want a live cd with sysvinit without systemd nor
consolekit installed):

Now, to get a jessie live system with sysvinit instead of systemd with
live-build 4.0.3-1:

lb config -d jessie

sed -i 's|live-config-systemd|live-config-sysvinit|'
config/package-lists/live.list.chroot
echo "sysvinit-core" >> config/package-lists/live.list.chroot

sudo lb build

With the following patch applied one can symply select the prefered
supported initsystem (being the default systemd) and just do:

lb config -d jessie --initsystem sysvinit
sudo lb build

And live-build will build a jessie livesystem with sysvinit instead of systemd.

Obviously, in this case, because fluxbox does not depend on neither
systemd nor consolekit, they both don't get installed in the live
system. If a user selects packages that depend on systemd then he/she
should not select sysvinit as the initsystem for the image.

I did not tested it but last time I tried to build a wheezy live image
with live-build 4.0.3-1 it didn't booted. I think this patch will also
fix it, but I did not try.

The patch is against latest live-build debian-next branch but IMHO I
think this patch should be applied to the debian branch (jessie). I
can provide it if needed.

I've CC bug #772522 because I think it is related.

Please keep the --initsystem option in lb4.

Thank you.


On Tue, Dec 9, 2014 at 5:43 PM, Daniel Baumann
<daniel.baum...@progress-technologies.net> wrote:
> found 772651 4.0.3-1
> notfound 772651 4.0.3-1kali2
> thanks
>
> On 12/09/14 16:39, Raphaël Hertzog wrote:
>> Version: 4.0.3-1kali2
>
> please don't report against versions never have been present in debian.
>
>> Unfortunately, this means that the --initsystem option does not allow one to
>> override this choice.
>
> given that this doesn't really work anyway due to the fact how
> debootstrap handles excludes (by ignoring them effectivly, #557322) and
> the state of the late state of the freeze, i'll remove the --initsystem.
>
> this will have to be properly re-added post jessie (jftr, eventhough i'm
> pro-systemd, i'll intend to support initsystem choice in lb as much as
> possible, so no need to worry about not getting that option back for
> stretch).
>
>> Furthermore the check based on the distribution codename
>> is very restrictive and doesn't work for derivatives.
>
> which is why, as said many times, lb5 is going to address that bottom-up.
>
> --
> Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
> Email:          daniel.baum...@progress-technologies.net
> Internet:       http://people.progress-technologies.net/~daniel.baumann/
>
>
> --
> To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
> Archive: https://lists.debian.org/548734bd.9090...@progress-technologies.net
>
From 74b3f4a003488e4514f43d05cdda85aa596faca9 Mon Sep 17 00:00:00 2001
From: "Rui Miguel P. Bernardo" <rui.bernardo...@gmail.com>
Date: Wed, 10 Dec 2014 03:20:29 +0000
Subject: [PATCH] fix choice of --initsystem in debian and ubuntu.

---
 functions/defaults.sh |   10 +++++++++-
 scripts/build/config  |   51 +++++++++++++++++++++++++++++++++----------------
 2 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/functions/defaults.sh b/functions/defaults.sh
index aa9c3dd..20d6921 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -288,7 +288,15 @@ Set_defaults ()
 		*)
 			case "${LB_SYSTEM}" in
 				live)
-					LB_INITSYSTEM="${LB_INITSYSTEM:-sysvinit}"
+					case "${LB_PARENT_DISTRIBUTION}" in
+						wheezy)
+							LB_INITSYSTEM="${LB_INITSYSTEM:-sysvinit}"
+							;;
+
+						*)
+							LB_INITSYSTEM="${LB_INITSYSTEM:-systemd}"
+							;;
+					esac
 					;;
 
 				normal)
diff --git a/scripts/build/config b/scripts/build/config
index e3b1e51..e18812f 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -1353,22 +1353,41 @@ done
 
 if [ ! -e config/package-lists/live.list.chroot ]
 then
-
-cat > config/package-lists/live.list.chroot << EOF
-live-boot
-live-config
-EOF
-
-case "${LB_PARENT_DISTRIBUTION}" in
-	wheezy)
-		echo "live-config-sysvinit" >> config/package-lists/live.list.chroot
-		;;
-
-	*)
-		echo "live-config-systemd" >> config/package-lists/live.list.chroot
-		;;
-esac
-
+	case "${LB_INITRAMFS}" in
+		live-boot)
+			echo "live-boot" > config/package-lists/live.list.chroot
+			echo "live-config" >> config/package-lists/live.list.chroot
+			case "${LB_PARENT_DISTRIBUTION}" in
+				wheezy)
+					echo "live-config-sysvinit" >> config/package-lists/live.list.chroot
+					;;
+				*)
+					case "${LB_INITSYSTEM}" in
+						none)
+							# do nothing						
+							;;
+						systemd)
+							echo "live-config-systemd" >> config/package-lists/live.list.chroot
+							;;
+						sysvinit|runit|upstart)
+							echo "live-config-${LB_INITSYSTEM}" >> config/package-lists/live.list.chroot
+							echo "sysvinit-core" >> config/package-lists/live.list.chroot
+							;;
+						*)
+							echo "${LB_INITSYSTEM} is not a supported initsystem."
+							;;
+					esac
+					;;
+			esac
+			;;
+
+		casper)
+			echo "casper" > config/package-lists/live.list.chroot
+			;;
+
+		*)
+			;;
+	esac
 fi
 
 cat > config/build << EOF
-- 
1.7.10.4

Reply via email to