summaryrefslogtreecommitdiffstats
path: root/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/installer-pc.sh25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/cmd/installer-pc.sh b/src/cmd/installer-pc.sh
index ce155f3..595e9c9 100644
--- a/src/cmd/installer-pc.sh
+++ b/src/cmd/installer-pc.sh
@@ -67,7 +67,9 @@ cmd_installer_pc_main()
fi
suite="$(profile_normalize_suite "${suite}")"
- cmd_installer_pc_make_partition_and_fs "${dev}"
+ if ! cmd_installer_pc_make_partition_and_fs "${dev}"; then
+ return 2
+ fi
if ! root="$(block_mount "${dev}1")"; then
return 2
fi
@@ -104,13 +106,26 @@ cmd_installer_pc_make_partition_and_fs()
{
local dev="${1}"
- dd if=/dev/zero of="${dev}" bs=512 count=1
+ if ! dd if=/dev/zero of="${dev}" bs=512 count=1; then
+ return 1
+ fi
+
if ${HAVE_SFDISK}; then
- printf ',,83,*\n' | ${SFDISK} "${dev}"
+ if ! printf ',,83,*\n' | ${SFDISK} "${dev}"; then
+ return 1
+ fi
elif ${HAVE_FDISK}; then
- printf 'n\np\n1\n\n\nt\n83\na\n1\nw\n' | ${FDISK} "${dev}"
+ if ! printf 'n\np\n1\n\n\nt\n83\na\n1\nw\n' | ${FDISK} "${dev}"
+ then
+ return 1
+ fi
+ fi
+
+ if ! ${MKE2FS} -t ext4 "${dev}1"; then
+ return 1
fi
- ${MKE2FS} -t ext4 "${dev}1"
+
+ return 0
}
cmd_installer_pc_register()