X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=chroot-script;h=7d2c8c3c398e2e8f6be461a596d4b0f68a1125b6;hp=294b749f2d244f944b59c1323bfd74ea40f0f27e;hb=1ba2adf1af0237c2465dab2b2f9a20ed5ee72889;hpb=aadfa9e6736484c002413f02de93057b9a814449 diff --git a/chroot-script b/chroot-script index 294b749..7d2c8c3 100755 --- a/chroot-script +++ b/chroot-script @@ -92,7 +92,6 @@ grmlrepos() { # user might have provided their own apt sources.list if ! grep -q grml /etc/apt/sources.list.d/grml.list 2>/dev/null ; then cat >> /etc/apt/sources.list.d/grml.list << EOF - # grml: stable repository: deb http://deb.grml.org/ grml-stable main deb-src http://deb.grml.org/ grml-stable main @@ -100,7 +99,6 @@ grmlrepos() { # grml: testing/development repository: deb http://deb.grml.org/ grml-testing main deb-src http://deb.grml.org/ grml-testing main - EOF fi @@ -114,7 +112,7 @@ EOF # why it's necessary, sometimes we get an error even though it works [mika] fi - # make sure we install packages from grml's pool only if not available + # make sure we install packages from Grml's pool only if not available # from Debian! if ! grep -q grml /etc/apt/preferences 2>/dev/null ; then cat >> /etc/apt/preferences << EOF @@ -241,6 +239,11 @@ reconfigure() { # set password of user root {{{ passwords() { + if [ -n "$NOPASSWORD" ] ; then + echo "Skip setting root password as requested." + return 0 + fi + echo "Activating shadow passwords." shadowconfig on @@ -249,7 +252,6 @@ passwords() CHPASSWD_OPTION='-m' fi - if [ -n "$ROOTPASSWORD" ] ; then echo root:"$ROOTPASSWORD" | chpasswd $CHPASSWD_OPTION export ROOTPASSWORD='' @@ -419,6 +421,11 @@ grub_install() { return 0 fi + if ! dpkg --list grub-pc 2>/dev/null | grep -q '^ii' ; then + echo "Notice: grub option set but no grub-pc package, installing it therefore." + DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL grub-pc + fi + if ! [ -x "$(which grub-install)" ] ; then echo "Error: grub-install not available. (Error while installing grub package?)" >&2 return 1