mirror of
https://github.com/suikan4github/kaiten-yaki.git
synced 2025-12-20 18:41:17 -03:00
Add and adjust erro rhanding.
Add error handling afer dd. Error message of pre-install is now conditional.
This commit is contained in:
parent
6810e4414a
commit
95d8c6f62c
2 changed files with 3 additions and 2 deletions
|
|
@ -158,6 +158,7 @@ function pre_install() {
|
||||||
# Zap existing partition table
|
# Zap existing partition table
|
||||||
echo "...Erasing partition table of \"${DEV}\"."
|
echo "...Erasing partition table of \"${DEV}\"."
|
||||||
dd if=/dev/zero of="${DEV}" bs=512 count=1
|
dd if=/dev/zero of="${DEV}" bs=512 count=1
|
||||||
|
if is_error ; then return 1 ; fi; # If error, terminate
|
||||||
# Create MBR and allocate max storage for Linux partition
|
# Create MBR and allocate max storage for Linux partition
|
||||||
echo "...Creating a Linux partition on ${DEV} with MBR."
|
echo "...Creating a Linux partition on ${DEV} with MBR."
|
||||||
sfdisk "${DEV}" <<- HEREDOC
|
sfdisk "${DEV}" <<- HEREDOC
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ function main() {
|
||||||
# Common part of the pre-install stage
|
# Common part of the pre-install stage
|
||||||
if ! pre_install ; then
|
if ! pre_install ; then
|
||||||
# If error, restore the modification.
|
# If error, restore the modification.
|
||||||
echo "...restoring modified /etc/default/grub."
|
echo "...restoring /etc/default/grub, if needed"
|
||||||
sed -i -e "s#loglevel=4 ${GRUB_ADDITIONAL_PARAMETERS}#loglevel=4#" /etc/default/grub
|
sed -i -e "s#${GRUB_ADDITIONAL_PARAMETERS}##" /etc/default/grub
|
||||||
return 1 # with error status
|
return 1 # with error status
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue