X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=b1586453daa85bb31650751f6688e300bac30dcb;hp=13d65365d866180ea1f701ac9901f592f9e2e1ce;hb=4b7bcd8bb312afbc7eb0be80f72c1cc99566a56b;hpb=12f4a35be8bcb52492d3745ac21c4a482bedb948 diff --git a/grml-debootstrap b/grml-debootstrap index 13d6536..b158645 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -1055,6 +1055,24 @@ mkfs() { einfo "Enabling force option (-F) for mkfs.ext* tool as requested via --force switch." MKFS_OPTS="$MKFS_OPTS -F" eend 0 + + ;; + esac + fi + + # starting with e2fsprogs 1.43~WIP.2015.05.18-1 mkfs.ext4 enables the metadata_csum feature + # by default, which requires a recent version of tune2fs on the target system then, + # so disable this feature for older Debian releases where it's known to be unsupported + if [ -n "$MKFS" ] && [ "$MKFS" = "mkfs.ext4" ] ; then + case "$RELEASE" in + lenny|squeeze|wheezy|jessie) + # assume a more recent version if we can't identify the version via dpkg-query + local e2fsprogs_version="$(dpkg-query --show --showformat='${Version}' e2fsprogs 2>/dev/null || echo 1.44)" + if [ -n "$e2fsprogs_version" ] && dpkg --compare-versions "$e2fsprogs_version" ge '1.43~WIP.2015.05.18-1' ; then + einfo "Disabling metadata_csum feature for $MKFS as $RELEASE doesn't support it." + MKFS_OPTS="$MKFS_OPTS -O ^metadata_csum" + eend 0 + fi ;; esac fi @@ -1512,8 +1530,9 @@ execute_pre_scripts() { # execute all scripts in /etc/debootstrap/post-scripts/ {{{ execute_post_scripts() { - # make sure we have $MNTPOINT available for our scripts + # make sure we have $MNTPOINT and HOSTNAME available for our scripts export MNTPOINT + export TARGET_HOSTNAME=$HOSTNAME if [ -d "$_opt_scripts" ] || [ "$SCRIPTS" = 'yes' ] ; then # legacy support for /etc/debootstrap/scripts/