X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=packer%2Fdebian64_provision.sh;h=480df1c2c5d4ce8d6e6976b5720985feb70009d2;hb=19dc059a0f67699116d83305ce8f0320ef0fe613;hp=c7eed1fc859669f4c0dff505fa1249b5cb988fde;hpb=8609e64e6fef8931643d4094342cc2baf37f352d;p=grml-debootstrap.git diff --git a/packer/debian64_provision.sh b/packer/debian64_provision.sh index c7eed1f..480df1c 100644 --- a/packer/debian64_provision.sh +++ b/packer/debian64_provision.sh @@ -32,13 +32,6 @@ trap 'bailout ${LINENO} $?' ERR ## helper functions virtualbox_setup() { - case "$DEBIAN_VERSION" in - lenny) - echo "* Debian lenny doesn't support Virtualbox Guest Additions, skipping." - return 0 - ;; - esac - if ! mountpoint "${TARGET}" &>/dev/null ; then echo "* Mounting target system" mount "${INSTALL_TARGET}" "${TARGET}" @@ -67,7 +60,13 @@ virtualbox_setup() { mountpoint "${TARGET}/media/cdrom" >/dev/null && umount "${TARGET}/media/cdrom" mount -t iso9660 $isofile "${TARGET}/media/cdrom/" UTS_RELEASE=$KERNELVERSION LD_PRELOAD=/tmp/fake-uname.so grml-chroot "$TARGET" /media/cdrom/VBoxLinuxAdditions.run --nox11 || true - tail -10 "${TARGET}/var/log/VBoxGuestAdditions.log" + if grep -q "make: .*vboxguest.*Error 2" "${TARGET}/var/log/vboxadd-install.log" ; then + echo "Error: looks like a fatal error happened during installation of VirtualBox Guest Additions." >&2 + exit 1 + fi + [ -r "${TARGET}/var/log/VBoxGuestAdditions.log" ] && tail -10 "${TARGET}/var/log/VBoxGuestAdditions.log" + [ -r "${TARGET}/var/log/vboxadd-install.log" ] && tail -10 "${TARGET}/var/log/vboxadd-install.log" + [ -r "${TARGET}/var/log/vboxadd-setup.log" ] && tail -10 "${TARGET}/var/log/vboxadd-setup.log" umount "${TARGET}/media/cdrom/" # work around bug in VirtualBox 4.3.18 which leaves process behind, @@ -109,12 +108,8 @@ vagrant_setup() { chroot ${TARGET} chown vagrant:vagrant /home/vagrant/.ssh /home/vagrant/.ssh/authorized_keys echo "* Setting up sudo configuration for user vagrant" - if ! [ -d "${TARGET}/etc/sudoers.d" ] ; then # lenny: - echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> "${TARGET}/etc/sudoers" - else # wheezy and newer: - echo "vagrant ALL=(ALL) NOPASSWD: ALL" > "${TARGET}/etc/sudoers.d/vagrant" - chmod 0440 "${TARGET}/etc/sudoers.d/vagrant" - fi + echo "vagrant ALL=(ALL) NOPASSWD: ALL" > "${TARGET}/etc/sudoers.d/vagrant" + chmod 0440 "${TARGET}/etc/sudoers.d/vagrant" host="$(cat ${TARGET}/etc/hostname)" if ! grep -q "${host}$" "${TARGET}"/etc/hosts ; then @@ -182,7 +177,7 @@ EOF elif [ "$GRML_DEBOOTSTRAP_VERSION" = "git" ] ; then echo "** GRML_DEBOOTSTRAP_VERSION is set to '$GRML_DEBOOTSTRAP_VERSION'" echo "** Using grml-debootstrap from Git repository" - git clone git://git.grml.org/grml-debootstrap.git + git clone https://github.com/grml/grml-debootstrap.git cd grml-debootstrap GRML_DEBOOTSTRAP="CONFFILES=$(pwd) $(pwd)/grml-debootstrap" elif [ "$GRML_DEBOOTSTRAP_VERSION" = "local" ] ; then @@ -197,30 +192,9 @@ EOF fi } -verify_debootstrap_version() { - local required_version=1.0.65 - local present_version=$(dpkg-query --show --showformat='${Version}' debootstrap) - - if dpkg --compare-versions $present_version lt $required_version ; then - echo "** debootstrap version $present_version is older than minimum required version $required_version - upgrading." - apt-get update - apt-get -y install debootstrap - fi -} - grml_debootstrap_execution() { echo "* Installing Debian" - # release specific stuff - case "$DEBIAN_VERSION" in - lenny) - GRML_DEB_OPTIONS="--mirror http://archive.debian.org/debian/ --filesystem ext3" - ;; - stretch) - verify_debootstrap_version - ;; - esac - echo "** Executing: $GRML_DEBOOTSTRAP --hostname $DEBIAN_VERSION --release $DEBIAN_VERSION --target ${INSTALL_TARGET} --grub ${GRUB_TARGET} --password grml --force $GRML_DEB_OPTIONS" | tee -a /tmp/grml-debootstrap.log $GRML_DEBOOTSTRAP --hostname "${DEBIAN_VERSION}" --release "${DEBIAN_VERSION}" --target "${INSTALL_TARGET}" --grub "${GRUB_TARGET}" --password grml --force $GRML_DEB_OPTIONS 2>&1 | tee -a /tmp/grml-debootstrap.log } @@ -228,7 +202,7 @@ grml_debootstrap_execution() { apply_nic_workaround() { # release specific stuff case "$DEBIAN_VERSION" in - stretch|buster|bullseye|unstable|sid) + stretch|buster|bullseye|bookworm|unstable|sid) ;; *) echo "* Debian $DEBIAN_VERSION doesn't require NIC workaround"