Upstart initsystem support.

This commit is contained in:
Marco Amadori 2011-02-10 23:31:21 +01:00 committed by Daniel Baumann
parent 2159e3fba7
commit fda3fe6310
2 changed files with 25 additions and 17 deletions

View File

@ -148,7 +148,20 @@ Set_defaults ()
esac
# Setting initsystem
LB_INITSYSTEM="${LB_INITSYSTEM:-sysvinit}"
case "${LB_MODE}" in
ubuntu)
if [ "${LB_INITRAMFS}" = "live-boot" ]
then
LB_INITSYSTEM="${LB_INITSYSTEM:-upstart}"
else
LB_INITSYSTEM="${LB_INITSYSTEM:-sysvinit}"
fi
;;
*)
LB_INITSYSTEM="${LB_INITSYSTEM:-sysvinit}"
;;
esac
# Setting fdisk
if [ -z "${LB_FDISK}" ] || [ ! -x "${LB_FDISK}" ]

View File

@ -83,24 +83,19 @@ EOF
echo "live-config live-config-${LB_INITSYSTEM}" >> chroot/root/chroot_packages
fi
# Do initsystem specific hacks (FIXME)
case "${LB_INITSYSTEM}" in
sysvinit)
# Do initsystem specific hacks
if [ "${LB_INITSYSTEM}" != "sysvinit" ]
then
# lets see if we still need the squeeze's "pre init system policy discussion" hack:
;;
IS_SYSVINIT_ESSENTIAL="$(Chroot chroot dpkg-query --show --showformat='${Essential}\n' sysvinit)"
RC=$?
runit)
;;
systemd)
;;
upstart)
;;
esac
if [ "${IS_SYSVINIT_ESSENTIAL}" != "no" ] && [ "${RC}" == "0" ]; then
# sysvinit is both installed and essential, ugly hack to remove it
Chroot chroot dpkg --force-remove-essential --remove sysvinit || true
fi
fi
# Creating stage file
Create_stagefile .stage/chroot_linux-image