From: Michael Prokop Date: Fri, 25 May 2018 11:02:05 +0000 (+0200) Subject: Merge remote-tracking branch 'remotes/origin/pr/97' X-Git-Tag: v0.82~3 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=c63778958572b529958e6d2844352bc6c4739ea5;hp=7f3e2b0f970864652ee51d595512eaf022dac80d Merge remote-tracking branch 'remotes/origin/pr/97' --- diff --git a/debian/changelog b/debian/changelog index 2fe09c1..fa9d667 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,39 @@ +grml-debootstrap (0.81) unstable; urgency=medium + + * [0617fa8] Add e2fsprogs to Depends. Thanks to Helmut Grohne + for the bugreport (Closes: #887224) + * [9bdd7a1] Bump Standards-Version to 4.1.3 + + -- Michael Prokop Mon, 15 Jan 2018 10:58:37 +0100 + +grml-debootstrap (0.80) unstable; urgency=medium + + * [351237a] Fix a bunch of typos + * [7803bf3] packer: add support for building Debian/buster + * [ecff5b9] packer: use current Grml release 2017.05 for building + * [3314417] packer: use latest VirtualBox Guest Additions ISO + * [05ed1a4] Identify UUID of target system even if it's SWRAID or a + mountpoint. Thanks to hex2a for reporting and testing + * [d8de50b] Bump Standards-Version to 4.1.2 + + -- Michael Prokop Fri, 08 Dec 2017 12:54:17 +0100 + +grml-debootstrap (0.79) unstable; urgency=medium + + [ Bigo ] + * [d0cd2dd] Update /dev and /dev/pts mount from --bind to proper fs type + + [ Darshaka Pathirana ] + * [263c465] Add documentation for --defaultinterfaces command line + option + + [ Michael Prokop ] + * [1fba2a2] Depend on fdisk | util-linux (<< 2.29.2-3~) Thanks to + Andreas Henriksson (Closes: #872219) + * [f56ca7d] Bump Standards-Version to 4.0.1 + + -- Michael Prokop Thu, 17 Aug 2017 14:42:01 +0200 + grml-debootstrap (0.78) unstable; urgency=medium The "hello vienna, hello stretch" release diff --git a/debian/control b/debian/control index f19385c..6bd83b5 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Build-Depends-Indep: asciidoc, docbook-xsl, shunit2, xsltproc -Standards-Version: 3.9.8 +Standards-Version: 4.1.3 Homepage: https://grml.org/grml-debootstrap/ Vcs-git: git://git.grml.org/grml-debootstrap.git Vcs-Browser: https://git.grml.org/?p=grml-debootstrap.git @@ -20,6 +20,8 @@ Package: grml-debootstrap Architecture: all Depends: debian-archive-keyring, debootstrap (>= 0.3.3.3) | cdebootstrap (>= 0.3.16), + e2fsprogs, + fdisk | util-linux (<< 2.29.2-3~), gawk, kmod, ${misc:Depends}, diff --git a/docker/README.md b/docker/README.md index a2ca38f..b3c273a 100644 --- a/docker/README.md +++ b/docker/README.md @@ -44,7 +44,7 @@ Use grml-debootstrap inside the container, e.g.: # grml-debootstrap --target /srv/debian --password grml --hostname docker [--force] ```` -*TIP:* to speed up the build prepend `eatmydata` in the the grml-debootstrap command line +*TIP:* to speed up the build prepend `eatmydata` in the grml-debootstrap command line *TIP:* if you want to have access to the generated Debian systems after exiting the container make sure to share your working directory as `/srv` via adding `-v $PWD:/srv/` to your `docker run` command line diff --git a/grml-debootstrap b/grml-debootstrap index 18b1ef4..135b660 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -463,7 +463,7 @@ if [ -n "$CONFIGFILE" ] ; then fi # }}} -# backwards compability checks {{{ +# backwards compatibility checks {{{ if [ -n "$GROOT" ] ; then eerror "Error: you seem to have \$GROOT configured." eerror "This variable is no longer supported, please visit the" @@ -774,7 +774,7 @@ format_efi_partition() { if fsck.vfat -bn "$EFI" >/dev/null; then einfo "EFI partition $EFI seems to have a FAT filesystem, not modifying." ; eend 0 else - einfo "EFI partition $EFI doesn't seem to be formated, creating filesystem." + einfo "EFI partition $EFI doesn't seem to be formatted, creating filesystem." mkfs.fat -F32 -n "EFI System Partition" "$EFI" RC=$? if [ $RC -eq 0 ] ; then @@ -1113,14 +1113,52 @@ mkfs() { # race conditions :-/ sleep 2 - eval "$(blkid -o udev "$TARGET" 2>/dev/null)" - [ -n "$ID_FS_UUID" ] && TARGET_UUID="$ID_FS_UUID" || TARGET_UUID="" - eend $RC fi } # }}} +identify_target_uuid() { + local device="$1" + + if ! [ -b "$device" ] ; then + return 1 + fi + + eval "$(blkid -o udev "$1" 2>/dev/null)" + + if [ -n "$ID_FS_UUID" ] ; then + echo "$ID_FS_UUID" + else + return 1 + fi +} + +mountpoint_to_blockdevice() { + TARGET_UUID='' + + TARGET_UUID=$(identify_target_uuid "$TARGET" 2>/dev/null || true) + if [ -n "$TARGET_UUID" ] ; then + einfo "Identified UUID $TARGET_UUID for $TARGET" + return 0 + fi + + # $TARGET might be a mountpoint and not a blockdevice, search for according entry + for file in /sys/block/*/*/dev ; do + if grep -q "^$(mountpoint -d "${TARGET}")$" "$file" ; then + local dev + dev="${file%/dev}" + dev="/dev/${dev##*/}" + TARGET_UUID=$(identify_target_uuid "$dev" 2>/dev/null || true) + + if [ -n "$TARGET_UUID" ] ; then + einfo "Identified UUID $TARGET_UUID for $TARGET (via $file)" + return 0 + fi + fi + done +} + # modify filesystem settings {{{ tunefs() { if [ -n "$TUNE2FS" ] && echo "$MKFS" | grep -q "mkfs.ext" ; then @@ -1241,8 +1279,8 @@ finalize_vm() { mount -t proc none "${MNTPOINT}"/proc mount -t sysfs none "${MNTPOINT}"/sys - mount --bind /dev "${MNTPOINT}"/dev - mount --bind /dev/pts "${MNTPOINT}"/dev/pts + mount -t devtmpfs udev "${MNTPOINT}"/dev + mount -t devpts devpts "${MNTPOINT}"/dev/pts # Has chroot-script installed GRUB to MBR using grub-install (successfully), already? # chroot-script skips installation for unset ${GRUB} @@ -1575,8 +1613,8 @@ chrootscript() { eend 1 else einfo "Executing chroot-script now" - mount --bind /dev "$MNTPOINT"/dev - mount --bind /dev/pts "$MNTPOINT"/dev/pts + mount -t devtmpfs udev "${MNTPOINT}"/dev + mount -t devpts devpts "${MNTPOINT}"/dev/pts if [ "$DEBUG" = "true" ] ; then chroot "$MNTPOINT" /bin/bash -x /bin/chroot-script ; RC=$? else @@ -1660,7 +1698,8 @@ remove_configs() { # }}} # now execute all the functions {{{ -for i in format_efi_partition prepare_vm mkfs tunefs mount_target debootstrap_system \ +for i in format_efi_partition prepare_vm mkfs tunefs \ + mount_target mountpoint_to_blockdevice debootstrap_system \ preparechroot execute_pre_scripts chrootscript execute_post_scripts \ remove_configs umount_chroot finalize_vm fscktool ; do if stage "${i}" ; then diff --git a/grml-debootstrap.8.txt b/grml-debootstrap.8.txt index 17011ac..46af45e 100644 --- a/grml-debootstrap.8.txt +++ b/grml-debootstrap.8.txt @@ -83,6 +83,11 @@ Options and environment variables Execute in very verbose way. Useful for debugging possible problems with grml-debootstrap or identify what's actually executed. +*--defaultinterfaces*:: + + Install a default /etc/network/interfaces file (enabling DHCP for eth0) + instead of taking over config from host system. + *--efi* _device_:: Partition where EFI boot manager should be installed to. If the diff --git a/packer/Makefile b/packer/Makefile index c152feb..0d8e104 100644 --- a/packer/Makefile +++ b/packer/Makefile @@ -12,6 +12,10 @@ clean: fake-uname.so: gcc -shared -fPIC -ldl fake-uname.c -o fake-uname.so +# Debian 10 +buster: fake-uname.so clean install + packer build -var debian_version=$@ -var grml_debootstrap_version=$(GRML_DEBOOTSTRAP_VERSION) -var grml_debootstrap_local_path=$(GRML_DEBOOTSTRAP_LOCAL_PATH) debian64.json + # Debian 9 stretch: fake-uname.so clean install packer build -var debian_version=$@ -var grml_debootstrap_version=$(GRML_DEBOOTSTRAP_VERSION) -var grml_debootstrap_local_path=$(GRML_DEBOOTSTRAP_LOCAL_PATH) debian64.json @@ -32,4 +36,4 @@ squeeze: fake-uname.so clean install lenny: fake-uname.so clean install packer build -var debian_version=$@ -var grml_debootstrap_version=$(GRML_DEBOOTSTRAP_VERSION) -var grml_debootstrap_local_path=$(GRML_DEBOOTSTRAP_LOCAL_PATH) debian64.json -.PHONY: compile stretch jessie wheezy squeeze lenny +.PHONY: compile buster stretch jessie wheezy squeeze lenny diff --git a/packer/debian64.bats b/packer/debian64.bats index 189c668..b0f9be6 100644 --- a/packer/debian64.bats +++ b/packer/debian64.bats @@ -17,7 +17,7 @@ teardown() { @test "debian_version exists and is valid version" { run cat "${mountpath}/etc/debian_version" [ "$status" -eq 0 ] - [[ "$output" == [0-9].[0-9]* ]] || [[ "$output" == 'stretch/sid' ]] + [[ "$output" == [0-9].[0-9]* ]] || [[ "$output" == 'buster/sid' ]] } @test "kernel exists" { diff --git a/packer/debian64.json b/packer/debian64.json index f140230..bac55c1 100644 --- a/packer/debian64.json +++ b/packer/debian64.json @@ -1,9 +1,9 @@ { "variables": { "grml_type": "grml64-full", - "grml_version": "2014.11", - "grml_iso_checksum": "120bfa48b096691797a73fa2f464c7c71fac1587", - "debian_version": "jessie", + "grml_version": "2017.05", + "grml_iso_checksum": "9a6d788879699e2e1dce8edd4556e07f63d19c14", + "debian_version": "stretch", "grml_debootstrap_version": "latest", "grml_debootstrap_local_path": "doesnotexist" }, @@ -26,7 +26,12 @@ "boot_command": [ " ssh=grml " ], - "shutdown_command": "shutdown -h now" + "shutdown_command": "shutdown -h now", + "guest_additions_url": "https://www.virtualbox.org/download/testcase/VBoxGuestAdditions_5.2.1-118918.iso", + "guest_additions_sha256": "5023b5b6314593c092d2680fbbfe37870977b1d7fa790af9bdd4a75944ca0603", + "vboxmanage": [ + ["modifyvm", "{{.Name}}", "--memory", "1024"] + ] } ], "provisioners": [ diff --git a/packer/debian64_provision.sh b/packer/debian64_provision.sh index c7eed1f..2a416de 100644 --- a/packer/debian64_provision.sh +++ b/packer/debian64_provision.sh @@ -67,7 +67,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, diff --git a/tests/test_cmdlineopts.sh b/tests/test_cmdlineopts.sh index 312fe76..c1df0d6 100755 --- a/tests/test_cmdlineopts.sh +++ b/tests/test_cmdlineopts.sh @@ -17,7 +17,7 @@ test_cmdlineopts() { if [[ $CMD == *:: ]] ; then DELIM="=" fi - # CMD expects addional parameter + # CMD expects additional parameter if [[ $CMD == *: ]] ; then PARAM=$RANDOM fi