Fix issue with EDIT_FILES[8]
This commit is contained in:
parent
a51d28f611
commit
63b8592c28
@ -15,7 +15,7 @@
|
||||
# immutable variables {
|
||||
|
||||
readonly DIST="Archlabs" # Linux distributor
|
||||
readonly VER="1.6.29" # Installer version
|
||||
readonly VER="1.6.31" # Installer version
|
||||
readonly LIVE="liveuser" # Live session user
|
||||
readonly TRN="/usr/share/archlabs-installer" # Translation path
|
||||
readonly MNT="/mnt/install" # Install mountpoint
|
||||
@ -39,7 +39,7 @@ readonly ZONES="America - Australia - Asia - Atlantic - Africa - Europe - Indian
|
||||
|
||||
# create associative array for subzones, value is: 'subzone country_code'
|
||||
declare -Ag SUBZONES
|
||||
for zone in $(sed 's/ -//g' <<< "$ZONES"); do
|
||||
for zone in America Australia Asia Atlantic Africa Europe Indian Pacific Arctic Antarctica; do
|
||||
SUBZONES[$zone]="$(awk "/$zone\// {gsub(/$zone\//, \"\"); print \$3 \" \"\$1}" /usr/share/zoneinfo/zone.tab)"
|
||||
done
|
||||
readonly SUBZONES # make it read only
|
||||
@ -64,22 +64,23 @@ lv Latvian md Moldavian mao Maori by Belarusian me Montenegrin mk Macedonian kh
|
||||
az Azerbaijani"
|
||||
|
||||
declare -Agr BOOT_MNTS=(
|
||||
[BIOS-grub]="/boot"
|
||||
[UEFI-grub]="/boot/efi"
|
||||
[BIOS-syslinux]="/boot"
|
||||
[UEFI-systemd-boot]="/boot"
|
||||
[UEFI-grub]="/boot/efi" [UEFI-systemd-boot]="/boot"
|
||||
[BIOS-grub]="/boot" [BIOS-syslinux]="/boot"
|
||||
)
|
||||
|
||||
# static list of bootloaders & boot partition mountpoints stored as the system type (BIOS or UEFI)
|
||||
declare -Agr BOOTLOADERS=(
|
||||
[UEFI]="grub ${BOOT_MNTS[UEFI-grub]} systemd-boot ${BOOT_MNTS[UEFI-systemd-boot]}"
|
||||
[BIOS]="grub ${BOOT_MNTS[BIOS-grub]} syslinux ${BOOT_MNTS[BIOS-syslinux]}"
|
||||
)
|
||||
|
||||
# static mkfs commands for each filesystem offered
|
||||
declare -Agr FS_CMDS=(
|
||||
[ext2]="mkfs.ext2 -q" [ext3]="mkfs.ext3 -q" [ext4]="mkfs.ext4 -q"
|
||||
[f2fs]="mkfs.f2fs" [jfs]="mkfs.jfs -q" [xfs]="mkfs.xfs -f"
|
||||
[f2fs]="mkfs.f2fs" [jfs]="mkfs.jfs -q" [xfs]="mkfs.xfs -f" [nilfs2]="mkfs.nilfs2 -q"
|
||||
[ntfs]="mkfs.ntfs -q" [reiserfs]="mkfs.reiserfs -q" [vfat]="mkfs.vfat -F32"
|
||||
[nilfs2]="mkfs.nilfs2 -q"
|
||||
)
|
||||
|
||||
# static filesystem mount options
|
||||
declare -Agr FS_OPTS=(
|
||||
[vfat]="" [ntfs]="" [ext2]="" [ext3]=""
|
||||
@ -88,10 +89,7 @@ declare -Agr FS_OPTS=(
|
||||
[reiserfs]="acl - off nolog - off notail - off replayonly - off user_xattr - off"
|
||||
[xfs]="discard - off filestreams - off ikeep - off largeio - off noalign - off nobarrier - off norecovery - off noquota - off wsync - off"
|
||||
[nilfs2]="discard - off nobarrier - off errors=continue - off errors=panic - off order=relaxed - off order=strict - off norecovery - off"
|
||||
[f2fs]="data_flush - off disable_roll_forward - off disable_ext_identify - off
|
||||
discard - off fastboot - off flush_merge - off inline_xattr - off inline_data - off
|
||||
inline_dentry - off no_heap - off noacl - off nobarrier - off noextent_cache - off
|
||||
noinline_data - off norecovery - off"
|
||||
[f2fs]="data_flush - off disable_roll_forward - off disable_ext_identify - off discard - off fastboot - off flush_merge - off inline_xattr - off inline_data - off inline_dentry - off no_heap - off noacl - off nobarrier - off noextent_cache - off noinline_data - off norecovery - off"
|
||||
)
|
||||
# }
|
||||
|
||||
@ -159,7 +157,7 @@ initialize_variables() {
|
||||
)
|
||||
|
||||
# files able to be reviewed when finishing install
|
||||
# item index [8] can change depending on which bootloader is selected
|
||||
# item index [9] can change depending on which bootloader is selected
|
||||
declare -Ag EDIT_FILES=(
|
||||
[2]="/etc/X11/xorg.conf.d/00-keyboard.conf /etc/vconsole.conf /etc/default/keyboard"
|
||||
[3]="/etc/locale.conf /etc/default/locale"
|
||||
@ -993,7 +991,7 @@ select_filesystem() {
|
||||
"jfs" "${FS_CMDS[jfs]}" "nilfs2" "${FS_CMDS[nilfs2]}" \
|
||||
"reiserfs" "${FS_CMDS[reiserfs]}" "xfs" "${FS_CMDS[xfs]}")"
|
||||
[[ $choice == "$_Skip" ]] && return 0
|
||||
[[ $? != 0 || $choice == "" ]] && return 1
|
||||
[[ $choice == "" ]] && return 1
|
||||
|
||||
if yesno "$_FSTitle" "\nFormat $part as $choice?\n"; then
|
||||
infobox "$_FSTitle" "\nFormatting: $part\n\nCommand: ${FS_CMDS[$choice]}\n"
|
||||
@ -1026,13 +1024,13 @@ select_boot_setup() {
|
||||
"syslinux-install_update -i" "[/]")"
|
||||
[[ $? != 0 || $cmd == "" ]] && return 1
|
||||
BOOT_CMDS[syslinux]="$cmd"
|
||||
EDIT_FILES[8]="/boot/syslinux/syslinux.cfg" ;;
|
||||
EDIT_FILES[9]="/boot/syslinux/syslinux.cfg"
|
||||
fi
|
||||
else
|
||||
if [[ $BOOTLOADER == 'systemd-boot' ]]; then
|
||||
EDIT_FILES[8]="/boot/loader/entries/archlabs.conf"
|
||||
EDIT_FILES[9]="/boot/loader/entries/archlabs.conf"
|
||||
else
|
||||
EDIT_FILES[8]="/etc/default/grub"
|
||||
EDIT_FILES[9]="/etc/default/grub"
|
||||
if yesno "$_PrepMount" "$_SetBootDefault"; then
|
||||
GRUB_UEFI_FALLBACK=true
|
||||
fi
|
||||
@ -1722,7 +1720,6 @@ install_main() {
|
||||
|
||||
# user can choose to bail at this point
|
||||
unpack_base_system || { initialize_variables; return 1; }
|
||||
UNPACKED_BASE=true
|
||||
fi
|
||||
|
||||
genfstab -U $MNT > $MNT/etc/fstab 2>$ERR
|
||||
@ -1811,6 +1808,7 @@ EOF
|
||||
|
||||
grep -qi "hypervisor" <<< "$(dmesg)" && rm -rf $MNT/etc/X11/xorg.conf.d
|
||||
|
||||
UNPACKED_BASE=true
|
||||
return 0
|
||||
}
|
||||
|
||||
@ -2129,7 +2127,7 @@ setup_bootloader() {
|
||||
# add grub-mkconfig last
|
||||
BOOT_CMDS[grub]="${BOOT_CMDS[grub]} && grub-mkconfig -o /boot/grub/grub.cfg"
|
||||
else
|
||||
# for other bootloaders remove grub and configs
|
||||
# for other bootloaders remove grub and it's configs
|
||||
rm -rf $MNT/etc/default/grub
|
||||
find $MNT/boot/ -name 'grub*' -exec rm -rf '{}' \; >/dev/null 2>&1
|
||||
BOOT_CMDS[$BOOTLOADER]="pacman -Rs grub --noconfirm && ${BOOT_CMDS[$BOOTLOADER]}"
|
||||
@ -2198,9 +2196,12 @@ main_menu() {
|
||||
"1" "$_PrepTitle" "2" "$_InstTitle" "3" "$_ConfTitle" "4" "$_EditTitle" "5" "$_Done")
|
||||
|
||||
if [[ -n $MENU_HIGHLIGHT ]]; then
|
||||
# if trying to unpack the system make sure the partitions are mounted
|
||||
if (( MENU_HIGHLIGHT == 2 )) && ! check_parts_are_mounted; then
|
||||
return 1
|
||||
elif (( MENU_HIGHLIGHT == 3 || MENU_HIGHLIGHT == 4 )); then
|
||||
# when trying to use config_menu() or edit config files make sure
|
||||
# the system is unpacked and the partitions are mounted
|
||||
if ! (check_parts_are_mounted && check_base_unpacked); then
|
||||
return 1
|
||||
fi
|
@ -17,7 +17,7 @@ _Final="\nThe install is almost finished.\n"
|
||||
|
||||
# Welcome
|
||||
_WelTitle="Welcome to"
|
||||
_WelBody="This will unpack and setup $DIST on your system\n\nMenu Navigation:\nSelect by pressing the option number or using the arrow keys. Switch between buttons using [Tab] or the arrow keys. Long lists can be navigated using [Page Up] and [Page Down], or by pressing the first letter of the desired option.\n\nUse [Space] to select/deselect options and [Enter] to confirm.\n[Ctrl]+ to increase font size, [Ctrl]- to decrease it, and [Ctrl]= to reset it.\n"
|
||||
_WelBody="This will unpack and setup $DIST on your system\n\nMenu Navigation:\nSelect items by pressing the option number or using the arrow keys.\nSwitch between buttons using [Tab] or the arrow keys.\nLong lists can be navigated using [Page Up] and [Page Down], or by pressing the first letter of the desired option.\nUse [Space] to select/deselect options and [Enter] to confirm.\n"
|
||||
|
||||
# Requirements
|
||||
_NotRoot="\nThe installer must be run as root or using sudo.\n"
|
Reference in New Issue
Block a user