system-image: check that the mksquashfs command actually succeeded before overwriting the old image
parent
a84cb829dd
commit
8b98b2e160
|
|
@ -97,10 +97,14 @@ if $DONT_ASK || yesno; then
|
||||||
|
|
||||||
echo_tty "Building image..."
|
echo_tty "Building image..."
|
||||||
mksquashfs / /run/void-usb/container/new_squashfs.img -b 1M -comp xz -progress -noappend -pf /run/void-usb/system-image-pseudo -ef /run/void-usb/system-image-excludes > $TTY_OR_CONSOLE
|
mksquashfs / /run/void-usb/container/new_squashfs.img -b 1M -comp xz -progress -noappend -pf /run/void-usb/system-image-pseudo -ef /run/void-usb/system-image-excludes > $TTY_OR_CONSOLE
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo_tty "An error ocurred while generating the image. It will be discarded."
|
||||||
|
sleep 5
|
||||||
|
else
|
||||||
echo_tty -n "Moving new image in place... "
|
echo_tty -n "Moving new image in place... "
|
||||||
mv /run/void-usb/container/new_squashfs.img /run/void-usb/container/squashfs.img
|
mv /run/void-usb/container/new_squashfs.img /run/void-usb/container/squashfs.img
|
||||||
echo_tty "done"
|
echo_tty "done"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo_tty "Discarding system changes."
|
echo_tty "Discarding system changes."
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue