Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/gf-platformid
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/supermin-init-prelude.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down