mirror of
https://github.com/suikan4github/kaiten-yaki.git
synced 2025-12-20 02:21:17 -03:00
Applied shellcheck
This commit is contained in:
parent
b9e490e5f3
commit
dc1e8ff720
5 changed files with 63 additions and 61 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash -u
|
||||
|
||||
function main() {
|
||||
# shellcheck disable=SC1091
|
||||
# Load configuration parameter
|
||||
source config.sh
|
||||
|
||||
|
|
@ -9,6 +9,7 @@ function main() {
|
|||
source lib/pre_install_common.sh
|
||||
source lib/para_install_msg_common.sh
|
||||
|
||||
function main() {
|
||||
|
||||
# This is the mount point of the install target.
|
||||
export TARGETMOUNTPOINT="/target"
|
||||
|
|
@ -22,8 +23,8 @@ function main() {
|
|||
This system seems to be not Ubuntu, while this script is dediated to the Ubuntu.
|
||||
Are you sure you want to run this script? [Y/N]
|
||||
HEREDOC
|
||||
read YESNO
|
||||
if [ ${YESNO} != "Y" -a ${YESNO} != "y" ] ; then
|
||||
read -r YESNO
|
||||
if [ "${YESNO}" != "Y" ] && [ "${YESNO}" != "y" ] ; then
|
||||
cat <<- HEREDOC
|
||||
|
||||
...Installation process terminated..
|
||||
|
|
@ -72,7 +73,7 @@ function main() {
|
|||
HEREDOC
|
||||
|
||||
# waitfor a console input
|
||||
read dummy_var
|
||||
read -r
|
||||
|
||||
# Start Ubiquity installer
|
||||
ubiquity &
|
||||
|
|
@ -106,7 +107,7 @@ function post_install() {
|
|||
## Mount the target file system
|
||||
# ${TARGETMOUNTPOINT} is created by the GUI/TUI installer
|
||||
echo "...Mounting /dev/mapper/${VGNAME}-${LVROOTNAME} on ${TARGETMOUNTPOINT}."
|
||||
mount /dev/mapper/${VGNAME}-${LVROOTNAME} ${TARGETMOUNTPOINT}
|
||||
mount /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" ${TARGETMOUNTPOINT}
|
||||
|
||||
# And mount other directories
|
||||
echo "...Mounting all other dirs."
|
||||
|
|
@ -135,7 +136,7 @@ function post_install() {
|
|||
|
||||
# Add the LUKS volume information to /etc/crypttab to decrypt by kernel.
|
||||
echo "...Adding LUKS volume info to /etc/crypttab."
|
||||
echo "${CRYPTPARTNAME} UUID=$(blkid -s UUID -o value ${DEV}${CRYPTPARTITION}) /etc/luks/boot_os.keyfile luks,discard" >> /etc/crypttab
|
||||
echo "${CRYPTPARTNAME} UUID=$(blkid -s UUID -o value "${DEV}${CRYPTPARTITION}") /etc/luks/boot_os.keyfile luks,discard" >> /etc/crypttab
|
||||
|
||||
# Putting key file into the ramfs initial image
|
||||
echo "...Registering key file to the ramfs"
|
||||
|
|
@ -178,14 +179,14 @@ function grub_check_and_modify() {
|
|||
# Check if installer still exist
|
||||
if ! ps $INSTALLER_PID > /dev/null ; then # If not exists
|
||||
echo "***** ERROR : The GUI/TUI installer terminated unexpectedly. *****"
|
||||
if [ ${OVERWRITEINSTALL} -eq 0 ] ; then # If not over install, volume is new. So delete it
|
||||
if [ "${OVERWRITEINSTALL}" -eq 0 ] ; then # If not over install, volume is new. So delete it
|
||||
echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"."
|
||||
lvremove -f /dev/mapper/${VGNAME}-${LVROOTNAME}
|
||||
lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}"
|
||||
fi
|
||||
echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"."
|
||||
vgchange -a n ${VGNAME}
|
||||
vgchange -a n "${VGNAME}"
|
||||
echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"."
|
||||
cryptsetup close ${CRYPTPARTNAME}
|
||||
cryptsetup close "${CRYPTPARTNAME}"
|
||||
cat <<-HEREDOC
|
||||
|
||||
...The new logical volume has been deleted. You can retry Kaiten-yaki again.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue