mirror of
https://github.com/suikan4github/kaiten-yaki.git
synced 2025-12-20 02:21:17 -03:00
change -eq 1 to -ne 0
To accept non-zero value
This commit is contained in:
parent
dc1e8ff720
commit
b7738a9fd8
4 changed files with 10 additions and 10 deletions
|
|
@ -44,7 +44,7 @@ export ISEFI=0 # No, BIOS
|
|||
fi # is EFI firmaare?
|
||||
|
||||
# Set partition number based on the firmware type
|
||||
if [ ${ISEFI} -eq 1 ] ; then
|
||||
if [ ${ISEFI} -ne 0 ] ; then
|
||||
# EFI firmware
|
||||
export EFIPARTITION=1
|
||||
export CRYPTPARTITION=2
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
function confirmation_common(){
|
||||
|
||||
# Consistency check for the OVERWRITEINSTALL and ERASEALL
|
||||
if [ "${ERASEALL}" -eq 1 ] && [ "${OVERWRITEINSTALL}" -eq 1 ] ; then
|
||||
if [ "${ERASEALL}" -ne 0 ] && [ "${OVERWRITEINSTALL}" -ne 0 ] ; then
|
||||
cat <<- HEREDOC
|
||||
***** ERROR : Confliction between ERASEALL and OVERWRITEINSTALL *****
|
||||
...ERASEALL = ${ERASEALL}
|
||||
|
|
@ -71,7 +71,7 @@ function confirmation_common(){
|
|||
fi # if YES
|
||||
|
||||
# For sure ask to be sure to erase.
|
||||
if [ "${ERASEALL}" -eq 1 ] ; then
|
||||
if [ "${ERASEALL}" -ne 0 ] ; then
|
||||
echo "Are you sure you want to erase entire ${DEV}? [Y/N]"
|
||||
read -r YESNO
|
||||
if [ "${YESNO}" != "Y" ] && [ "${YESNO}" != "y" ] ; then
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function para_install_msg_common() {
|
|||
HEREDOC
|
||||
|
||||
# In the EFI system, add this mapping
|
||||
if [ "${ISEFI}" -eq 1 ] ; then
|
||||
if [ "${ISEFI}" -ne 0 ] ; then
|
||||
echo "/boot/efi : ${DEV}${EFIPARTITION}"
|
||||
fi
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ function para_install_msg_common() {
|
|||
echo "/ : /dev/mapper/${VGNAME}-${LVROOTNAME}"
|
||||
|
||||
# In case of erased storage, add this mapping
|
||||
if [ "${ERASEALL}" -eq 1 ] ; then
|
||||
if [ "${ERASEALL}" -ne 0 ] ; then
|
||||
echo "swap : /dev/mapper/${VGNAME}-${LVSWAPNAME}"
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ function pre_install_common() {
|
|||
|
||||
|
||||
# ----- Erase entire disk, create partitions, format them and encrypt the LUKS partition -----
|
||||
if [ "${ERASEALL}" -eq 1 ] ; then
|
||||
if [ "${ERASEALL}" -ne 0 ] ; then
|
||||
|
||||
# Assign specified space and rest of disk to the EFI and LUKS partition, respectively.
|
||||
if [ "${ISEFI}" -eq 1 ] ; then
|
||||
if [ "${ISEFI}" -ne 0 ] ; then # EFI
|
||||
# Zap existing partition table and create new GPT
|
||||
echo "...Initializing \"${DEV}\" with GPT."
|
||||
sgdisk --zap-all "${DEV}"
|
||||
|
|
@ -24,7 +24,7 @@ function pre_install_common() {
|
|||
sgdisk --new="${CRYPTPARTITION}":0:0 --change-name="${CRYPTPARTITION}":"Linux LUKS" --typecode="${CRYPTPARTITION}":8309 "${DEV}"
|
||||
# Then print them
|
||||
sgdisk --print "${DEV}"
|
||||
else
|
||||
else # BIOS
|
||||
# Zap existing partition table
|
||||
echo "...Erasing partition table of \"${DEV}\"."
|
||||
dd if=/dev/zero of="${DEV}" bs=512 count=1
|
||||
|
|
@ -80,7 +80,7 @@ function pre_install_common() {
|
|||
|
||||
# Create a ROOT Logical Volume on VG.
|
||||
if [ -e /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" ] ; then # exist
|
||||
if [ "${OVERWRITEINSTALL}" -eq 1 ] ; then # exist and overwrite install
|
||||
if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then # exist and overwrite install
|
||||
echo "...Logical volume \"${VGNAME}-${LVROOTNAME}\" already exists. OK."
|
||||
else # exist and not overwriteinstall
|
||||
cat <<- HEREDOC
|
||||
|
|
@ -98,7 +98,7 @@ function pre_install_common() {
|
|||
return 1 # with error status
|
||||
fi
|
||||
else # not exsit
|
||||
if [ "${OVERWRITEINSTALL}" -eq 1 ] ; then
|
||||
if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then
|
||||
cat <<- HEREDOC
|
||||
***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}" doesn't exist while overwrite install. *****
|
||||
...Check consistency of your config.txt.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue