From be521bdec6233530cc952be246a66f1957b0dd58 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Wed, 18 May 2016 21:26:56 -0400 Subject: [PATCH] Export FS_TYPE and remove hardcoded ext4 values Export FS_TYPE from img-defaults and use it to remove hard-coded defaults in the debootstrap mounting. Also, cleanup the suse element as it should have access to the exported variable. Change-Id: Ie9b671ca9336060a5ad294be48aa7eff442bf066 Signed-off-by: Paul Belanger --- elements/debootstrap/install.d/15-cleanup-debootstrap | 2 +- elements/opensuse/post-install.d/10-mkinitrd | 4 ---- elements/yum-minimal/install.d/15-base-fstab | 2 +- lib/img-defaults | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/elements/debootstrap/install.d/15-cleanup-debootstrap b/elements/debootstrap/install.d/15-cleanup-debootstrap index 31eac339..a256612b 100755 --- a/elements/debootstrap/install.d/15-cleanup-debootstrap +++ b/elements/debootstrap/install.d/15-cleanup-debootstrap @@ -26,5 +26,5 @@ echo 'blacklist pcspkr' > /etc/modprobe.d/blacklist.conf cat << EOF | tee /etc/fstab > /dev/null proc /proc proc nodev,noexec,nosuid 0 0 -LABEL=${DIB_ROOT_LABEL} / ext4 errors=remount-ro 0 1 +LABEL=${DIB_ROOT_LABEL} / ${FS_TYPE} errors=remount-ro 0 1 EOF diff --git a/elements/opensuse/post-install.d/10-mkinitrd b/elements/opensuse/post-install.d/10-mkinitrd index b764c48e..6162655f 100755 --- a/elements/opensuse/post-install.d/10-mkinitrd +++ b/elements/opensuse/post-install.d/10-mkinitrd @@ -8,10 +8,6 @@ fi set -eu set -o pipefail -# To have access to FS_TYPE -_LIB="/tmp/opensuse-extras" -source $_LIB/img-defaults - # This is to tell mkinitrd to include the right tools for the root filesystem # that will actually be used for the final image. This is likely something # different than what the chroot is currently on (which might currently be a diff --git a/elements/yum-minimal/install.d/15-base-fstab b/elements/yum-minimal/install.d/15-base-fstab index d996dcee..a766a9d8 100755 --- a/elements/yum-minimal/install.d/15-base-fstab +++ b/elements/yum-minimal/install.d/15-base-fstab @@ -23,5 +23,5 @@ set -o pipefail cat << EOF | tee /etc/fstab > /dev/null proc /proc proc nodev,noexec,nosuid 0 0 -LABEL=${DIB_ROOT_LABEL} / ext4 errors=remount-ro 0 1 +LABEL=${DIB_ROOT_LABEL} / ${FS_TYPE} errors=remount-ro 0 1 EOF diff --git a/lib/img-defaults b/lib/img-defaults index 079cec9a..1bdf6431 100644 --- a/lib/img-defaults +++ b/lib/img-defaults @@ -17,7 +17,7 @@ source $_LIB/common-defaults # options for create-baremetal-image.sh -FS_TYPE=${FS_TYPE:-ext4} +export FS_TYPE=${FS_TYPE:-ext4} # Used to set the file extension only at this stage. export IMAGE_TYPE=${IMAGE_TYPE:-qcow2} export IMAGE_NAME=${IMAGE_NAME:-image}