summaryrefslogtreecommitdiffstats
path: root/src/cmd/mkinitramfs.sh
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-01-17 10:34:56 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-01-17 10:34:56 (EST)
commita8e57bde8d2d9ba23a8c5fc7ddc6438c0142d33f (patch)
treef6a8a785ae52de10da5ea37e83339d3f96657659 /src/cmd/mkinitramfs.sh
parent69b9e4d24a0efa73405bbe42f7e06b567bb1f60e (diff)
cmd/*: Check return value of profile_detect()
Also clean up on error now.
Diffstat (limited to 'src/cmd/mkinitramfs.sh')
-rw-r--r--src/cmd/mkinitramfs.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/mkinitramfs.sh b/src/cmd/mkinitramfs.sh
index d319f3d..e888548 100644
--- a/src/cmd/mkinitramfs.sh
+++ b/src/cmd/mkinitramfs.sh
@@ -57,7 +57,10 @@ cmd_mkinitramfs_main()
root="$(block_mount "${dev}")"
fi
- profile_detect "${root}"
+ if ! profile_detect "${root}"; then
+ [ "x${dev}" != 'x' ] && block_umount "${root}"
+ return 2
+ fi
arch="$(cat "${root}/etc/proteanos_arch")"
plat="$(cat "${root}/etc/proteanos_plat")"