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..."
|
||||
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
|
||||
|
||||
echo_tty -n "Moving new image in place... "
|
||||
mv /run/void-usb/container/new_squashfs.img /run/void-usb/container/squashfs.img
|
||||
echo_tty "done"
|
||||
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... "
|
||||
mv /run/void-usb/container/new_squashfs.img /run/void-usb/container/squashfs.img
|
||||
echo_tty "done"
|
||||
fi
|
||||
else
|
||||
echo_tty "Discarding system changes."
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue