diff --git a/src/cmdlib.sh b/src/cmdlib.sh index e998527f1e..c4cf99254a 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -350,14 +350,13 @@ workdir=${workdir} # chmod will set ownership to root, not builder export USER=$(id -u) -# ensure the user of files created do not have root ownership -trap 'chown -h -R ${USER}:${USER} ${workdir}' EXIT - $(cat "${DIR}"/supermin-init-prelude.sh) rc=0 sh ${TMPDIR}/cmd.sh || rc=\$? echo \$rc > ${workdir}/tmp/rc -/sbin/fstrim -v ${workdir}/cache +if [ -b /dev/sdb1 ]; then + /sbin/fstrim -v ${workdir}/cache +fi /sbin/reboot -f EOF chmod a+x "${vmpreparedir}"/init diff --git a/src/gf-platformid b/src/gf-platformid index ad5170ae3d..a3a007cb1c 100755 --- a/src/gf-platformid +++ b/src/gf-platformid @@ -41,7 +41,7 @@ coreos_gf_run_mount "${tmp_dest}" # * grub config # * BLS config (for subsequent config regeneration) # First, the grub config. -if [ "$arch" -ne "x86_64" ] || [ "$platformid" == "metal" ]; then +if [ "$arch" != "x86_64" ] || [ "$platformid" == "metal" ]; then if [ "$(coreos_gf exists '/boot/efi')" == 'true' ]; then grubcfg_path=$(coreos_gf glob-expand /boot/efi/EFI/*/grub.cfg) else diff --git a/src/supermin-init-prelude.sh b/src/supermin-init-prelude.sh index d0143390e8..e98b8dddab 100644 --- a/src/supermin-init-prelude.sh +++ b/src/supermin-init-prelude.sh @@ -30,7 +30,9 @@ if [ -L "${workdir}"/src/config ]; then mount -t 9p -o rw,trans=virtio,version=9p2000.L source "${workdir}"/src/config fi mkdir -p "${workdir}"/cache /host/container-work -mount /dev/sdb1 "${workdir}"/cache +if [ -b /dev/sdb1 ]; then + mount /dev/sdb1 "${workdir}"/cache +fi if [ -f "${workdir}/tmp/supermin/supermin.env" ]; then source "${workdir}/tmp/supermin/supermin.env";