attempt new non-recursive structure

merge-requests/273/head
Bernhard Landauer 7 years ago
parent 365e83a8ff
commit 3d40b140cb

@ -27,7 +27,4 @@ select_language
mk_connection mk_connection
check_requirements check_requirements
greeting greeting
main_menu
while true; do
main_menu_online
done

@ -90,7 +90,7 @@ set_hw_clock() {
if [[ $(cat ${ANSWER}) != "" ]]; then if [[ $(cat ${ANSWER}) != "" ]]; then
arch_chroot "hwclock --systohc --$(cat ${ANSWER})" 2>$ERR arch_chroot "hwclock --systohc --$(cat ${ANSWER})" 2>$ERR
check_for_error "$FUNCNAME" "$?" check_for_error "$FUNCNAME" "$?" config_base_menu
fi fi
} }
@ -112,11 +112,9 @@ generate_fstab() {
[[ -f ${MOUNTPOINT}/swapfile ]] && sed -i "s/\\${MOUNTPOINT}//" ${MOUNTPOINT}/etc/fstab [[ -f ${MOUNTPOINT}/swapfile ]] && sed -i "s/\\${MOUNTPOINT}//" ${MOUNTPOINT}/etc/fstab
fi fi
fi fi
config_base_menu
} }
boot_encrypted_setting() boot_encrypted_setting() {
{
# Check if there is separate encrypted /boot partition # Check if there is separate encrypted /boot partition
if $(lsblk | grep '/mnt/boot' | grep -q 'crypt' ); then if $(lsblk | grep '/mnt/boot' | grep -q 'crypt' ); then
echo "GRUB_ENABLE_CRYPTODISK=y" >> /mnt/etc/default/grub echo "GRUB_ENABLE_CRYPTODISK=y" >> /mnt/etc/default/grub
@ -134,7 +132,7 @@ set_hostname() {
echo "$(cat ${ANSWER})" > ${MOUNTPOINT}/etc/hostname 2>$ERR echo "$(cat ${ANSWER})" > ${MOUNTPOINT}/etc/hostname 2>$ERR
echo -e "#<ip-address>\t<hostname.domain.org>\t<hostname>\n127.0.0.1\tlocalhost.localdomain\tlocalhost\t$(cat \ echo -e "#<ip-address>\t<hostname.domain.org>\t<hostname>\n127.0.0.1\tlocalhost.localdomain\tlocalhost\t$(cat \
${ANSWER})\n::1\tlocalhost.localdomain\tlocalhost\t$(cat ${ANSWER})" > ${MOUNTPOINT}/etc/hosts 2>$ERR ${ANSWER})\n::1\tlocalhost.localdomain\tlocalhost\t$(cat ${ANSWER})" > ${MOUNTPOINT}/etc/hosts 2>$ERR
check_for_error "$FUNCNAME" 0 config_base_menu check_for_error "$FUNCNAME" 0
} }
# Adapted and simplified from the Manjaro 0.8 and Antergos 2.0 installers # Adapted and simplified from the Manjaro 0.8 and Antergos 2.0 installers
@ -217,7 +215,6 @@ create_new_user() {
run_mkinitcpio() { run_mkinitcpio() {
clear clear
KERNEL="" KERNEL=""
# If LVM and/or LUKS used, add the relevant hook(s) # If LVM and/or LUKS used, add the relevant hook(s)
@ -226,7 +223,7 @@ run_mkinitcpio() {
([[ $LVM -eq 0 ]] && [[ $LUKS -eq 1 ]]) && { sed -i 's/block filesystems/block encrypt filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR || check_for_error "LUKS hooks" $?; } ([[ $LVM -eq 0 ]] && [[ $LUKS -eq 1 ]]) && { sed -i 's/block filesystems/block encrypt filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR || check_for_error "LUKS hooks" $?; }
arch_chroot "mkinitcpio -P" 2>$ERR arch_chroot "mkinitcpio -P" 2>$ERR
check_for_error "$FUNCNAME" "$?" check_for_error "$FUNCNAME" "$?" config_base_menu
} }
install_base() { install_base() {
@ -617,11 +614,9 @@ install_network_menu() {
;; ;;
"4") install_cups "4") install_cups
;; ;;
*) main_menu_online *) main_menu
;; ;;
esac esac
install_network_menu
} }
install_intel() { install_intel() {
@ -707,9 +702,7 @@ setup_graphics_card() {
sed -i 's/MODULES=""/MODULES="nouveau"/' ${MOUNTPOINT}/etc/mkinitcpio.conf sed -i 's/MODULES=""/MODULES="nouveau"/' ${MOUNTPOINT}/etc/mkinitcpio.conf
fi fi
check_for_error "$FUNCNAME $(cat /tmp/.driver)" "$?" check_for_error "$FUNCNAME $(cat /tmp/.driver)" "$?" install_graphics_menu
install_graphics_menu
} }
security_menu() { security_menu() {
@ -777,9 +770,7 @@ security_menu() {
|| DIALOG " $_SeeConfErrTitle " --msgbox "$_SeeConfErrBody1" 0 0 ;; || DIALOG " $_SeeConfErrTitle " --msgbox "$_SeeConfErrBody1" 0 0 ;;
esac esac
;; ;;
*) main_menu_online *) main_menu
;; ;;
esac esac
security_menu
} }

@ -67,7 +67,7 @@ install_de_wm() {
if [[ $(cat ${PACKAGES}) != "" ]]; then if [[ $(cat ${PACKAGES}) != "" ]]; then
clear clear
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "basestrap ${MOUNTPOINT} $(cat ${PACKAGES})" "$?" check_for_error "basestrap ${MOUNTPOINT} $(cat ${PACKAGES})" "$?" install_vanilla_de_wm
fi fi
fi fi
} }
@ -177,14 +177,11 @@ install_manjaro_de_wm() {
check_for_error "packages to install: $(grep -v -f /mnt/.base /tmp/.edition | sort | uniq | tr '\n' ' ')" check_for_error "packages to install: $(grep -v -f /mnt/.base /tmp/.edition | sort | uniq | tr '\n' ' ')"
clear clear
# remove already installed base pkgs and # remove already installed base pkgs and
# basestrap the parsed package list to the new root # basestrap the parsed package list to the new root
basestrap -i ${MOUNTPOINT} $(grep -v -f /mnt/.base /tmp/.edition | sort | uniq) 2>$ERR basestrap -i ${MOUNTPOINT} $(grep -v -f /mnt/.base /tmp/.edition | sort | uniq) 2>$ERR
check_for_error "install pkgs: $(cat /tmp/.desktop)" "$?" check_for_error "install pkgs: $(cat /tmp/.desktop)" "$?" install_desktop_menu
# copy the profile overlay to the new root # copy the profile overlay to the new root
echo "Copying overlay files to the new root" echo "Copying overlay files to the new root"
@ -193,7 +190,7 @@ install_manjaro_de_wm() {
# Copy settings to root account # Copy settings to root account
cp -ar $MOUNTPOINT/etc/skel/. $MOUNTPOINT/root/ 2>$ERR cp -ar $MOUNTPOINT/etc/skel/. $MOUNTPOINT/root/ 2>$ERR
check_for_error "copy root config" "$?" check_for_error "copy root config" "$?" install_desktop_menu
# copy settings to already created users # copy settings to already created users
if [[ -e "$(echo /mnt/home/*)" ]]; then if [[ -e "$(echo /mnt/home/*)" ]]; then
@ -288,7 +285,7 @@ install_manjaro_de_wm() {
if [[ $(cat ${PACKAGES}) != "" ]]; then if [[ $(cat ${PACKAGES}) != "" ]]; then
clear clear
basestrap -i ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR basestrap -i ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "basestrap -i ${MOUNTPOINT} $(cat ${PACKAGES})" "$?" check_for_error "basestrap -i ${MOUNTPOINT} $(cat ${PACKAGES})" "$?" install_desktop_menu
fi fi
fi fi
} }
@ -308,8 +305,6 @@ install_manjaro_de_wm_pkg() {
pacman -Sy --noconfirm $p 2>$ERR pacman -Sy --noconfirm $p 2>$ERR
check_for_error "update profiles pkgs" $? install_graphics_menu check_for_error "update profiles pkgs" $? install_graphics_menu
done done
install_manjaro_de_wm
} }
install_manjaro_de_wm_git() { install_manjaro_de_wm_git() {
@ -330,8 +325,6 @@ install_manjaro_de_wm_git() {
git clone --depth 1 https://github.com/manjaro/iso-profiles.git $PROFILES 2>$ERR git clone --depth 1 https://github.com/manjaro/iso-profiles.git $PROFILES 2>$ERR
check_for_error "clone profiles repo" $? install_graphics_menu check_for_error "clone profiles repo" $? install_graphics_menu
fi fi
install_manjaro_de_wm
} }
# Display Manager # Display Manager
@ -441,8 +434,7 @@ install_nm() {
arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR
fi fi
fi fi
check_for_error "$FUNCNAME" "$?" install_network_menu
check_for_error "$FUNCNAME" "$?"
NM_ENABLED=1 NM_ENABLED=1
} }
@ -478,6 +470,7 @@ install_nm() {
# Where networkmanager selected, add network-manager-applet # Where networkmanager selected, add network-manager-applet
sed -i 's/NetworkManager/networkmanager network-manager-applet/g' ${PACKAGES} sed -i 's/NetworkManager/networkmanager network-manager-applet/g' ${PACKAGES}
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME" "$?" install_network_menu
# Where networkmanager selected, now remove network-manager-applet # Where networkmanager selected, now remove network-manager-applet
sed -i 's/networkmanager network-manager-applet/NetworkManager/g' ${PACKAGES} sed -i 's/networkmanager network-manager-applet/NetworkManager/g' ${PACKAGES}
@ -491,100 +484,102 @@ install_nm() {
} }
install_multimedia_menu() { install_multimedia_menu() {
local PARENT="$FUNCNAME" declare -i loopmenu=1
while ((loopmenu)); do
install_alsa_pulse() { local PARENT="$FUNCNAME"
# Prep Variables
echo "" > ${PACKAGES} submenu 5
ALSA="" DIALOG "$_InstMultMenuBody" --default-item ${HIGHLIGHT_SUB} --menu " $_InstMultMenuTitle " 0 0 5 \
PULSE_EXTRA="" "1" "$_InstMulSnd" \
alsa=$(pacman -Ss alsa | awk '{print $1}' | grep "/alsa-" | sed "s/extra\///g" | sort -u) "2" "$_InstMulCodec" \
pulse_extra=$(pacman -Ss pulseaudio- | awk '{print $1}' | sed "s/extra\///g" | grep "pulseaudio-" | sort -u) "3" "$_InstMulAcc" \
"4" "$_InstMulCust" \
for i in ${alsa}; do "5" "$_Back" 2>${ANSWER}
ALSA="${ALSA} ${i} - off"
done HIGHLIGHT_SUB=$(cat ${ANSWER})
case $(cat ${ANSWER}) in
"1") install_alsa_pulse
;;
"2") install_codecs
;;
"3") install_acc_menu
;;
"4") install_cust_pkgs
;;
*) loopmenu=0
;;
esac
done
install_multimedia_menu
}
ALSA=$(echo $ALSA | sed "s/alsa-utils - off/alsa-utils - on/g" | sed "s/alsa-plugins - off/alsa-plugins - on/g") install_alsa_pulse() {
# Prep Variables
echo "" > ${PACKAGES}
ALSA=""
PULSE_EXTRA=""
alsa=$(pacman -Ss alsa | awk '{print $1}' | grep "/alsa-" | sed "s/extra\///g" | sort -u)
pulse_extra=$(pacman -Ss pulseaudio- | awk '{print $1}' | sed "s/extra\///g" | grep "pulseaudio-" | sort -u)
for i in ${pulse_extra}; do for i in ${alsa}; do
PULSE_EXTRA="${PULSE_EXTRA} ${i} - off" ALSA="${ALSA} ${i} - off"
done done
DIALOG " $_InstMulSnd " --checklist "$_InstMulSndBody\n\n$_UseSpaceBar" 0 0 6 \ ALSA=$(echo $ALSA | sed "s/alsa-utils - off/alsa-utils - on/g" | sed "s/alsa-plugins - off/alsa-plugins - on/g")
$ALSA "pulseaudio" "-" off $PULSE_EXTRA \
"paprefs" "pulseaudio GUI" off \
"pavucontrol" "pulseaudio GUI" off \
"ponymix" "pulseaudio CLI" off \
"volumeicon" "ALSA GUI" off \
"volwheel" "ASLA GUI" off 2>${PACKAGES}
clear for i in ${pulse_extra}; do
# If at least one package, install. PULSE_EXTRA="${PULSE_EXTRA} ${i} - off"
if [[ $(cat ${PACKAGES}) != "" ]]; then done
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME" "$?"
fi
}
install_codecs() { DIALOG " $_InstMulSnd " --checklist "$_InstMulSndBody\n\n$_UseSpaceBar" 0 0 6 \
# Prep Variables $ALSA "pulseaudio" "-" off $PULSE_EXTRA \
echo "" > ${PACKAGES} "paprefs" "pulseaudio GUI" off \
GSTREAMER="" "pavucontrol" "pulseaudio GUI" off \
gstreamer=$(pacman -Ss gstreamer | awk '{print $1}' | grep "/gstreamer" | sed "s/extra\///g" | sed "s/community\///g" | sort -u) "ponymix" "pulseaudio CLI" off \
echo $gstreamer "volumeicon" "ALSA GUI" off \
for i in ${gstreamer}; do "volwheel" "ASLA GUI" off 2>${PACKAGES}
GSTREAMER="${GSTREAMER} ${i} - off"
done
DIALOG " $_InstMulCodec " --checklist "$_InstMulCodBody\n\n$_UseSpaceBar" 0 0 14 \ clear
$GSTREAMER "xine-lib" "-" off 2>${PACKAGES} # If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME" "$?" install_multimedia_menu
fi
}
clear install_codecs() {
# If at least one package, install. # Prep Variables
if [[ $(cat ${PACKAGES}) != "" ]]; then echo "" > ${PACKAGES}
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR GSTREAMER=""
check_for_error "$FUNCNAME" "$?" gstreamer=$(pacman -Ss gstreamer | awk '{print $1}' | grep "/gstreamer" | sed "s/extra\///g" | sed "s/community\///g" | sort -u)
fi echo $gstreamer
} for i in ${gstreamer}; do
GSTREAMER="${GSTREAMER} ${i} - off"
done
install_cust_pkgs() { DIALOG " $_InstMulCodec " --checklist "$_InstMulCodBody\n\n$_UseSpaceBar" 0 0 14 \
echo "" > ${PACKAGES} $GSTREAMER "xine-lib" "-" off 2>${PACKAGES}
DIALOG " $_InstMulCust " --inputbox "$_InstMulCustBody" 0 0 "" 2>${PACKAGES} || install_multimedia_menu
clear clear
# If at least one package, install. # If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then if [[ $(cat ${PACKAGES}) != "" ]]; then
if [[ $(cat ${PACKAGES}) == "hen poem" ]]; then basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
DIALOG " \"My Sweet Buckies\" by Atiya & Carl " --msgbox "\nMy Sweet Buckies,\nYou are the sweetest Buckies that ever did \"buck\",\nLily, Rosie, Trumpet, and Flute,\nMy love for you all is absolute!\n\nThey buck: \"We love our treats, we are the Booyakka sisters,\"\n\"Sometimes we squabble and give each other comb-twisters,\"\n\"And in our garden we love to sunbathe, forage, hop and jump,\"\n\"We love our freedom far, far away from that factory farm dump,\"\n\n\"For so long we were trapped in cramped prisons full of disease,\"\n\"No sunlight, no fresh air, no one who cared for even our basic needs,\"\n\"We suffered in fear, pain, and misery for such a long time,\"\n\"But now we are so happy, we wanted to tell you in this rhyme!\"\n\n" 0 0 check_for_error "$FUNCNAME" "$?" install_multimedia_menu
else fi
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR }
check_for_error "$FUNCNAME $(cat ${PACKAGES})" "$?"
fi
fi
}
submenu 5 install_cust_pkgs() {
DIALOG "$_InstMultMenuBody" --default-item ${HIGHLIGHT_SUB} --menu " $_InstMultMenuTitle " 0 0 5 \ echo "" > ${PACKAGES}
"1" "$_InstMulSnd" \ DIALOG " $_InstMulCust " --inputbox "$_InstMulCustBody" 0 0 "" 2>${PACKAGES} || install_multimedia_menu
"2" "$_InstMulCodec" \
"3" "$_InstMulAcc" \
"4" "$_InstMulCust" \
"5" "$_Back" 2>${ANSWER}
HIGHLIGHT_SUB=$(cat ${ANSWER})
case $(cat ${ANSWER}) in
"1") install_alsa_pulse
;;
"2") install_codecs
;;
"3") install_acc_menu
;;
"4") install_cust_pkgs
;;
*) main_menu_online
;;
esac
install_multimedia_menu clear
} # If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
if [[ $(cat ${PACKAGES}) == "hen poem" ]]; then
DIALOG " \"My Sweet Buckies\" by Atiya & Carl " --msgbox "\nMy Sweet Buckies,\nYou are the sweetest Buckies that ever did \"buck\",\nLily, Rosie, Trumpet, and Flute,\nMy love for you all is absolute!\n\nThey buck: \"We love our treats, we are the Booyakka sisters,\"\n\"Sometimes we squabble and give each other comb-twisters,\"\n\"And in our garden we love to sunbathe, forage, hop and jump,\"\n\"We love our freedom far, far away from that factory farm dump,\"\n\n\"For so long we were trapped in cramped prisons full of disease,\"\n\"No sunlight, no fresh air, no one who cared for even our basic needs,\"\n\"We suffered in fear, pain, and misery for such a long time,\"\n\"But now we are so happy, we wanted to tell you in this rhyme!\"\n\n" 0 0
else
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
check_for_error "$FUNCNAME $(cat ${PACKAGES})" "$?" install_multimedia_menu
fi
fi
}

@ -4,10 +4,10 @@ umount_partitions() {
MOUNTED=$(mount | grep "${MOUNTPOINT}" | awk '{print $3}' | sort -r) MOUNTED=$(mount | grep "${MOUNTPOINT}" | awk '{print $3}' | sort -r)
swapoff -a swapoff -a
# for i in ${MOUNTED[@]}; do for i in ${MOUNTED[@]}; do
# local err=$(umount $i >/dev/null 2>$ERR) local err=$(umount $i >/dev/null 2>$ERR)
# (( err !=0 )) && check_for_error "$FUNCNAME $i" $err (( err !=0 )) && check_for_error "$FUNCNAME $i" $err
# done done
} }
# This function does not assume that the formatted device is the Root installation device as # This function does not assume that the formatted device is the Root installation device as
@ -45,8 +45,6 @@ create_partitions() {
[[ $(cat ${ANSWER}) == "$_PartOptAuto" ]] && auto_partition [[ $(cat ${ANSWER}) == "$_PartOptAuto" ]] && auto_partition
fi fi
fi fi
prep_menu
} }
# Securely destroy all data on a given device. # Securely destroy all data on a given device.
@ -58,7 +56,7 @@ secure_wipe() {
# Install wipe where not already installed. Much faster than dd # Install wipe where not already installed. Much faster than dd
if [[ ! -e /usr/bin/wipe ]]; then if [[ ! -e /usr/bin/wipe ]]; then
pacman -Sy --noconfirm wipe 2>$ERR pacman -Sy --noconfirm wipe 2>$ERR
check_for_error "install wipe" $? check_for_error "install wipe" $? create_partitions
fi fi
clear clear
@ -66,7 +64,7 @@ secure_wipe() {
# Alternate dd command - requires pv to be installed # Alternate dd command - requires pv to be installed
#dd if=/dev/zero | pv | dd of=${DEVICE} iflag=nocache oflag=direct bs=4096 2>$ERR #dd if=/dev/zero | pv | dd of=${DEVICE} iflag=nocache oflag=direct bs=4096 2>$ERR
check_for_error "wipe -Ifre ${DEVICE}" $? check_for_error "wipe -Ifre ${DEVICE}" $? create_partitions
else else
create_partitions create_partitions
fi fi
@ -83,7 +81,7 @@ auto_partition() {
for del_part in $(tac /tmp/.del_parts); do for del_part in $(tac /tmp/.del_parts); do
parted -s ${DEVICE} rm ${del_part} 2>$ERR parted -s ${DEVICE} rm ${del_part} 2>$ERR
check_for_error "parted -s ${DEVICE} rm ${del_part}" $? check_for_error "parted -s ${DEVICE} rm ${del_part}" $? create_partitions
done done
# Identify the partition table # Identify the partition table
@ -92,11 +90,11 @@ auto_partition() {
# Create partition table if one does not already exist # Create partition table if one does not already exist
if [[ $SYSTEM == "BIOS" ]] && [[ $part_table != "msdos" ]] ; then if [[ $SYSTEM == "BIOS" ]] && [[ $part_table != "msdos" ]] ; then
parted -s ${DEVICE} mklabel msdos 2>$ERR parted -s ${DEVICE} mklabel msdos 2>$ERR
check_for_error "${DEVICE} mklabel msdos" $? check_for_error "${DEVICE} mklabel msdos" $? create_partitions
fi fi
if [[ $SYSTEM == "UEFI" ]] && [[ $part_table != "gpt" ]] ; then if [[ $SYSTEM == "UEFI" ]] && [[ $part_table != "gpt" ]] ; then
parted -s ${DEVICE} mklabel gpt 2>$ERR parted -s ${DEVICE} mklabel gpt 2>$ERR
check_for_error "${DEVICE} mklabel gpt" $? check_for_error "${DEVICE} mklabel gpt" $? create_partitions
fi fi
# Create partitions (same basic partitioning scheme for BIOS and UEFI) # Create partitions (same basic partitioning scheme for BIOS and UEFI)
@ -109,7 +107,7 @@ auto_partition() {
parted -s ${DEVICE} set 1 boot on 2>$ERR parted -s ${DEVICE} set 1 boot on 2>$ERR
check_for_error "set boot flag for ${DEVICE}" $? check_for_error "set boot flag for ${DEVICE}" $?
parted -s ${DEVICE} mkpart primary ext3 513MiB 100% 2>$ERR parted -s ${DEVICE} mkpart primary ext3 513MiB 100% 2>$ERR
check_for_error "parted -s ${DEVICE} mkpart primary ext3 513MiB 100%" $? check_for_error "parted -s ${DEVICE} mkpart primary ext3 513MiB 100%" $? create_partitions
# Show created partitions # Show created partitions
lsblk ${DEVICE} -o NAME,TYPE,FSTYPE,SIZE > /tmp/.devlist lsblk ${DEVICE} -o NAME,TYPE,FSTYPE,SIZE > /tmp/.devlist
@ -288,7 +286,7 @@ select_filesystem() {
DIALOG " $_FSTitle " --yesno "\n$_FSMount $FILESYSTEM\n\n! $_FSWarn1 $PARTITION $_FSWarn2 !\n\n" 0 0 DIALOG " $_FSTitle " --yesno "\n$_FSMount $FILESYSTEM\n\n! $_FSWarn1 $PARTITION $_FSWarn2 !\n\n" 0 0
if (( $? != 1 )); then if (( $? != 1 )); then
${FILESYSTEM} ${PARTITION} >/dev/null 2>$ERR ${FILESYSTEM} ${PARTITION} >/dev/null 2>$ERR
check_for_error "mount $PARTITION as $FILESYSTEM." $? check_for_error "mount $PARTITION as $FILESYSTEM." $? select_filesystem
else else
select_filesystem select_filesystem
fi fi
@ -858,11 +856,11 @@ mount_partitions() {
if [[ $(fsck -N $PARTITION | grep fat) ]]; then if [[ $(fsck -N $PARTITION | grep fat) ]]; then
DIALOG " $_PrepMntPart " --yesno "$_FormUefiBody $PARTITION $_FormUefiBody2" 0 0 && { DIALOG " $_PrepMntPart " --yesno "$_FormUefiBody $PARTITION $_FormUefiBody2" 0 0 && {
mkfs.vfat -F32 ${PARTITION} >/dev/null 2>$ERR mkfs.vfat -F32 ${PARTITION} >/dev/null 2>$ERR
check_for_error "mkfs.vfat -F32 ${PARTITION}" "$?" check_for_error "mkfs.vfat -F32 ${PARTITION}" "$?" prep_menu
} }
else else
mkfs.vfat -F32 ${PARTITION} >/dev/null 2>$ERR mkfs.vfat -F32 ${PARTITION} >/dev/null 2>$ERR
check_for_error "mkfs.vfat -F32 ${PARTITION}" "$?" check_for_error "mkfs.vfat -F32 ${PARTITION}" "$?" prep_menu
fi fi
# Inform users of the mountpoint options and consequences # Inform users of the mountpoint options and consequences

@ -1,262 +1,271 @@
main_menu_online() { main_menu() {
if [[ $HIGHLIGHT != 9 ]]; then declare -i loopmenu=1
HIGHLIGHT=$(( HIGHLIGHT + 1 )) while ((loopmenu)); do
fi if [[ $HIGHLIGHT != 9 ]]; then
HIGHLIGHT=$(( HIGHLIGHT + 1 ))
fi
DIALOG " $_MMTitle " --default-item ${HIGHLIGHT} \ DIALOG " $_MMTitle " --default-item ${HIGHLIGHT} \
--menu "$_MMBody" 0 0 9 \ --menu "$_MMBody" 0 0 9 \
"1" "$_PrepMenuTitle|>" \ "1" "$_PrepMenuTitle|>" \
"2" "$_InstBsMenuTitle|>" \ "2" "$_InstBsMenuTitle|>" \
"3" "$_InstGrMenuTitle|>" \ "3" "$_ConfBseMenuTitle|>" \
"4" "$_ConfBseMenuTitle|>" \ "4" "$_InstGrMenuTitle|>" \
"5" "$_InstNMMenuTitle|>" \ "5" "$_InstNMMenuTitle|>" \
"6" "$_InstMultMenuTitle|>" \ "6" "$_InstMultMenuTitle|>" \
"7" "$_SecMenuTitle|>" \ "7" "$_SecMenuTitle|>" \
"8" "$_SeeConfOptTitle|>" \ "8" "$_SeeConfOptTitle|>" \
"9" "$_Done" 2>${ANSWER} "9" "$_Done" 2>${ANSWER}
HIGHLIGHT=$(cat ${ANSWER}) HIGHLIGHT=$(cat ${ANSWER})
# Depending on the answer, first check whether partition(s) are mounted and whether base has been installed # Depending on the answer, first check whether partition(s) are mounted and whether base has been installed
if [[ $(cat ${ANSWER}) -eq 2 ]]; then if [[ $(cat ${ANSWER}) -eq 2 ]]; then
check_mount check_mount
fi fi
if [[ $(cat ${ANSWER}) -ge 3 ]] && [[ $(cat ${ANSWER}) -le 8 ]]; then if [[ $(cat ${ANSWER}) -ge 3 ]] && [[ $(cat ${ANSWER}) -le 8 ]]; then
check_mount check_mount
check_base check_base
fi fi
case $(cat ${ANSWER}) in case $(cat ${ANSWER}) in
"1") prep_menu "1") prep_menu
;; ;;
"2") install_base_menu "2") install_base_menu
;; ;;
"3") install_graphics_menu "3") config_base_menu
;; ;;
"4") config_base_menu "4") install_graphics_menu
;; ;;
"5") install_network_menu "5") install_network_menu
;; ;;
"6") install_multimedia_menu "6") install_multimedia_menu
;; ;;
"7") security_menu "7") security_menu
;; ;;
"8") edit_configs "8") edit_configs
;; ;;
*) final_check *) final_check
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$_CloseInstBody $(cat ${CHECKLIST})" 0 0 dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$_CloseInstBody $(cat ${CHECKLIST})" 0 0
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
echo "exit installer." >> ${LOGFILE} echo "exit installer." >> ${LOGFILE}
if [[ -e /mnt/usr ]]; then if [[ -e /mnt/usr ]]; then
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n$_LogInfo\n" 0 0 dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n$_LogInfo\n" 0 0
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
[[ -e /mnt/.m-a.log ]] && cat ${LOGFILE} >> /mnt/.m-a.log [[ -e /mnt/.m-a.log ]] && cat ${LOGFILE} >> /mnt/.m-a.log
cp ${LOGFILE} /mnt/.m-a.log cp ${LOGFILE} /mnt/.m-a.log
fi fi
fi
umount_partitions
clear
loopmenu=0
fi fi
umount_partitions ;;
clear esac
exit 0
fi
;;
esac
main_menu_online done
} }
# Preparation # Preparation
prep_menu() { prep_menu() {
local PARENT="$FUNCNAME" declare -i loopmenu=1
while ((loopmenu)); do
submenu 7 local PARENT="$FUNCNAME"
DIALOG "$_PrepMenuTitle " --default-item ${HIGHLIGHT_SUB} \
--menu "$_PrepMenuBody" 0 0 7 \ submenu 7
"1" "$_VCKeymapTitle" \ DIALOG "$_PrepMenuTitle " --default-item ${HIGHLIGHT_SUB} \
"2" "$_DevShowOpt" \ --menu "$_PrepMenuBody" 0 0 7 \
"3" "$_PrepPartDisk" \ "1" "$_VCKeymapTitle" \
"4" "$_PrepLUKS" \ "2" "$_DevShowOpt" \
"5" "$_PrepLVM $_PrepLVM2" \ "3" "$_PrepPartDisk" \
"6" "$_PrepMntPart" \ "4" "$_PrepLUKS" \
"7" "$_Back" 2>${ANSWER} "5" "$_PrepLVM $_PrepLVM2" \
"6" "$_PrepMntPart" \
HIGHLIGHT_SUB=$(cat ${ANSWER}) "7" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") set_keymap HIGHLIGHT_SUB=$(cat ${ANSWER})
;; case $(cat ${ANSWER}) in
"2") show_devices "1") set_keymap
;; ;;
"3") umount_partitions "2") show_devices
select_device ;;
create_partitions "3") umount_partitions
;; select_device
"4") luks_menu create_partitions
;; ;;
"5") lvm_menu "4") luks_menu
;; ;;
"6") mount_partitions "5") lvm_menu
;; ;;
*) main_menu_online "6") mount_partitions
;; ;;
esac *) loopmenu=0
;;
prep_menu esac
done
main_menu
} }
# Base Installation # Base Installation
install_base_menu() { install_base_menu() {
local PARENT="$FUNCNAME" declare -i loopmenu=1
while ((loopmenu)); do
submenu 5 local PARENT="$FUNCNAME"
DIALOG " $_InstBsMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_InstBseMenuBody" 0 0 5 \
"1" "$_PrepMirror" \ submenu 5
"2" "$_PrepPacKey" \ DIALOG " $_InstBsMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_InstBseMenuBody" 0 0 5 \
"3" "$_InstBse" \ "1" "$_PrepMirror" \
"4" "$_InstBootldr" \ "2" "$_PrepPacKey" \
"5" "$_Back" 2>${ANSWER} "3" "$_InstBse" \
"4" "$_InstBootldr" \
HIGHLIGHT_SUB=$(cat ${ANSWER}) "5" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") configure_mirrorlist HIGHLIGHT_SUB=$(cat ${ANSWER})
;; case $(cat ${ANSWER}) in
"2") clear "1") configure_mirrorlist
pacman-key --init ;;
pacman-key --populate archlinux manjaro "2") clear
pacman-key --refresh-keys pacman-key --init
check_for_error "refresh pacman-keys" pacman-key --populate archlinux manjaro
;; pacman-key --refresh-keys
"3") install_base check_for_error "refresh pacman-keys"
;; ;;
"4") install_bootloader "3") install_base
;; ;;
*) main_menu_online "4") install_bootloader
;; ;;
esac *) loopmenu=0
;;
install_base_menu esac
} done
main_menu
install_graphics_menu() {
local PARENT="$FUNCNAME"
submenu 4
DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
--menu "$_InstGrMenuBody" 0 0 4 \
"1" "$_InstGrMenuDD" \
"2" "$_InstGrMenuGE|>" \
"3" "$_PrepKBLayout" \
"4" "$_Back" 2>${ANSWER}
HIGHLIGHT_SUB=$(cat ${ANSWER})
case $(cat ${ANSWER}) in
"1") setup_graphics_card
;;
"2") install_desktop_menu
;;
"3") set_xkbmap
;;
*) main_menu_online
;;
esac
install_graphics_menu
} }
# Base Configuration # Base Configuration
config_base_menu() { config_base_menu() {
local PARENT="$FUNCNAME" declare -i loopmenu=1
while ((loopmenu)); do
submenu 8 local PARENT="$FUNCNAME"
DIALOG "$_ConfBseBody" --default-item ${HIGHLIGHT_SUB} --menu " $_ConfBseMenuTitle " \
0 0 8 \ submenu 8
"1" "$_ConfBseFstab" \ DIALOG "$_ConfBseBody" --default-item ${HIGHLIGHT_SUB} --menu " $_ConfBseMenuTitle " \
"2" "$_ConfBseHost" \ 0 0 8 \
"3" "$_ConfBseSysLoc" \ "1" "$_ConfBseFstab" \
"4" "$_ConfBseTimeHC" \ "2" "$_ConfBseHost" \
"5" "$_ConfUsrRoot" \ "3" "$_ConfBseSysLoc" \
"6" "$_ConfUsrNew" \ "4" "$_ConfBseTimeHC" \
"7" "$_MMRunMkinit" \ "5" "$_ConfUsrRoot" \
"8" "$_Back" 2>${ANSWER} "6" "$_ConfUsrNew" \
"7" "$_MMRunMkinit" \
HIGHLIGHT_SUB=$(cat ${ANSWER}) "8" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") generate_fstab HIGHLIGHT_SUB=$(cat ${ANSWER})
;; case $(cat ${ANSWER}) in
"2") set_hostname "1") generate_fstab
;; ;;
"3") set_locale "2") set_hostname
;; ;;
"4") set_timezone "3") set_locale
set_hw_clock ;;
;; "4") set_timezone
"5") set_root_password set_hw_clock
;; ;;
"6") create_new_user "5") set_root_password
;; ;;
"7") run_mkinitcpio "6") create_new_user
;; ;;
*) main_menu_online "7") run_mkinitcpio
;; ;;
esac *) loopmenu=0
;;
config_base_menu esac
done
main_menu
}
install_graphics_menu() {
declare -i loopmenu=1
while ((loopmenu)); do
local PARENT="$FUNCNAME"
submenu 4
DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
--menu "$_InstGrMenuBody" 0 0 4 \
"1" "$_InstGrMenuDD" \
"2" "$_InstGrMenuGE|>" \
"3" "$_PrepKBLayout" \
"4" "$_Back" 2>${ANSWER}
HIGHLIGHT_SUB=$(cat ${ANSWER})
case $(cat ${ANSWER}) in
"1") setup_graphics_card
;;
"2") install_desktop_menu
;;
"3") set_xkbmap
;;
*) loopmenu=0
;;
esac
done
main_menu
} }
install_vanilla_de_wm() { install_vanilla_de_wm() {
local PARENT="$FUNCNAME" declare -i loopmenu=1
while ((loopmenu)); do
submenu 4 local PARENT="$FUNCNAME"
DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
--menu "$_InstGrMenuBody" 0 0 4 \ submenu 4
"1" "$_InstGrMenuDS" \ DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
"2" "$_InstGrDE" \ --menu "$_InstGrMenuBody" 0 0 4 \
"3" "$_InstGrMenuDM" \ "1" "$_InstGrMenuDS" \
"4" "$_Back" 2>${ANSWER} "2" "$_InstGrDE" \
"3" "$_InstGrMenuDM" \
HIGHLIGHT_SUB=$(cat ${ANSWER}) "4" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") install_xorg_input HIGHLIGHT_SUB=$(cat ${ANSWER})
;; case $(cat ${ANSWER}) in
"2") install_de_wm "1") install_xorg_input
;; ;;
"3") install_dm "2") install_de_wm
;; ;;
*) SUB_MENU="install_graphics_menu" "3") install_dm
HIGHLIGHT_SUB=2 ;;
install_graphics_menu *) loopmenu=0
;; ;;
esac esac
done
install_vanilla_de_wm install_graphics_menu
} }
install_desktop_menu() { install_desktop_menu() {
local PARENT="$FUNCNAME" declare -i loopmenu=1
while ((loopmenu)); do
submenu 4 local PARENT="$FUNCNAME"
DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
--menu "$_InstDEMenuTitle" 0 0 4 \ submenu 4
"1" "$_InstDEStable" \ DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
"2" "$_InstDEGit" \ --menu "$_InstDEMenuTitle" 0 0 4 \
"3" "$_InstDE|>" \ "1" "$_InstDEStable" \
"4" "$_Back" 2>${ANSWER} "2" "$_InstDEGit" \
"3" "$_InstDE|>" \
HIGHLIGHT_SUB=$(cat ${ANSWER}) "4" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") install_manjaro_de_wm_pkg HIGHLIGHT_SUB=$(cat ${ANSWER})
;; case $(cat ${ANSWER}) in
"2") install_manjaro_de_wm_git "1") install_manjaro_de_wm_pkg
;; ;;
"3") install_vanilla_de_wm "2") install_manjaro_de_wm_git
;; ;;
*) SUB_MENU="install_graphics_menu" "3") install_vanilla_de_wm
HIGHLIGHT_SUB=2 ;;
install_graphics_menu *) loopmenu=0
;; ;;
esac esac
done
install_desktop_menu install_graphics_menu
} }
# Install Accessibility Applications # Install Accessibility Applications
@ -286,86 +295,87 @@ install_acc_menu() {
basestrap ${MOUNTPOINT} ${PACKAGES} 2>$ERR basestrap ${MOUNTPOINT} ${PACKAGES} 2>$ERR
check_for_error "$FUNCNAME" $? install_multimedia_menu check_for_error "$FUNCNAME" $? install_multimedia_menu
fi fi
install_multimedia_menu install_multimedia_menu
} }
edit_configs() { edit_configs() {
local PARENT="$FUNCNAME" declare -i loopmenu=1
while ((loopmenu)); do
# Clear the file variables local PARENT="$FUNCNAME"
FILE=""
user_list="" # Clear the file variables
FILE=""
submenu 13 user_list=""
DIALOG " $_SeeConfOptTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_SeeConfOptBody" 0 0 13 \
"1" "/etc/vconsole.conf" \ submenu 13
"2" "/etc/locale.conf" \ DIALOG " $_SeeConfOptTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_SeeConfOptBody" 0 0 13 \
"3" "/etc/hostname" \ "1" "/etc/vconsole.conf" \
"4" "/etc/hosts" \ "2" "/etc/locale.conf" \
"5" "/etc/sudoers" \ "3" "/etc/hostname" \
"6" "/etc/mkinitcpio.conf" \ "4" "/etc/hosts" \
"7" "/etc/fstab" \ "5" "/etc/sudoers" \
"8" "/etc/crypttab" \ "6" "/etc/mkinitcpio.conf" \
"9" "grub/syslinux/systemd-boot" \ "7" "/etc/fstab" \
"10" "lxdm/lightdm/sddm" \ "8" "/etc/crypttab" \
"11" "/etc/pacman.conf" \ "9" "grub/syslinux/systemd-boot" \
"12" "~/.xinitrc" \ "10" "lxdm/lightdm/sddm" \
"13" "$_Back" 2>${ANSWER} "11" "/etc/pacman.conf" \
"12" "~/.xinitrc" \
HIGHLIGHT_SUB=$(cat ${ANSWER}) "13" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") [[ -e ${MOUNTPOINT}/etc/vconsole.conf ]] && FILE="${MOUNTPOINT}/etc/vconsole.conf" HIGHLIGHT_SUB=$(cat ${ANSWER})
;; case $(cat ${ANSWER}) in
"2") [[ -e ${MOUNTPOINT}/etc/locale.conf ]] && FILE="${MOUNTPOINT}/etc/locale.conf" "1") [[ -e ${MOUNTPOINT}/etc/vconsole.conf ]] && FILE="${MOUNTPOINT}/etc/vconsole.conf"
;; ;;
"3") [[ -e ${MOUNTPOINT}/etc/hostname ]] && FILE="${MOUNTPOINT}/etc/hostname" "2") [[ -e ${MOUNTPOINT}/etc/locale.conf ]] && FILE="${MOUNTPOINT}/etc/locale.conf"
;; ;;
"4") [[ -e ${MOUNTPOINT}/etc/hosts ]] && FILE="${MOUNTPOINT}/etc/hosts" "3") [[ -e ${MOUNTPOINT}/etc/hostname ]] && FILE="${MOUNTPOINT}/etc/hostname"
;; ;;
"5") [[ -e ${MOUNTPOINT}/etc/sudoers ]] && FILE="${MOUNTPOINT}/etc/sudoers" "4") [[ -e ${MOUNTPOINT}/etc/hosts ]] && FILE="${MOUNTPOINT}/etc/hosts"
;; ;;
"6") [[ -e ${MOUNTPOINT}/etc/mkinitcpio.conf ]] && FILE="${MOUNTPOINT}/etc/mkinitcpio.conf" "5") [[ -e ${MOUNTPOINT}/etc/sudoers ]] && FILE="${MOUNTPOINT}/etc/sudoers"
;; ;;
"7") [[ -e ${MOUNTPOINT}/etc/fstab ]] && FILE="${MOUNTPOINT}/etc/fstab" "6") [[ -e ${MOUNTPOINT}/etc/mkinitcpio.conf ]] && FILE="${MOUNTPOINT}/etc/mkinitcpio.conf"
;; ;;
"8") [[ -e ${MOUNTPOINT}/etc/crypttab ]] && FILE="${MOUNTPOINT}/etc/crypttab" "7") [[ -e ${MOUNTPOINT}/etc/fstab ]] && FILE="${MOUNTPOINT}/etc/fstab"
;; ;;
"9") [[ -e ${MOUNTPOINT}/etc/default/grub ]] && FILE="${MOUNTPOINT}/etc/default/grub" "8") [[ -e ${MOUNTPOINT}/etc/crypttab ]] && FILE="${MOUNTPOINT}/etc/crypttab"
[[ -e ${MOUNTPOINT}/boot/syslinux/syslinux.cfg ]] && FILE="$FILE ${MOUNTPOINT}/boot/syslinux/syslinux.cfg" ;;
if [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/loader/loader.conf ]]; then "9") [[ -e ${MOUNTPOINT}/etc/default/grub ]] && FILE="${MOUNTPOINT}/etc/default/grub"
files=$(ls ${MOUNTPOINT}${UEFI_MOUNT}/loader/entries/*.conf) [[ -e ${MOUNTPOINT}/boot/syslinux/syslinux.cfg ]] && FILE="$FILE ${MOUNTPOINT}/boot/syslinux/syslinux.cfg"
for i in ${files}; do if [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/loader/loader.conf ]]; then
FILE="$FILE ${i}" files=$(ls ${MOUNTPOINT}${UEFI_MOUNT}/loader/entries/*.conf)
for i in ${files}; do
FILE="$FILE ${i}"
done
fi
;;
"10") [[ -e ${MOUNTPOINT}/etc/lxdm/lxdm.conf ]] && FILE="${MOUNTPOINT}/etc/lxdm/lxdm.conf"
[[ -e ${MOUNTPOINT}/etc/lightdm/lightdm.conf ]] && FILE="${MOUNTPOINT}/etc/lightdm/lightdm.conf"
[[ -e ${MOUNTPOINT}/etc/sddm.conf ]] && FILE="${MOUNTPOINT}/etc/sddm.conf"
;;
"11") [[ -e ${MOUNTPOINT}/etc/pacman.conf ]] && FILE="${MOUNTPOINT}/etc/pacman.conf"
;;
"12") user_list=$(ls ${MOUNTPOINT}/home/ | sed "s/lost+found//")
for i in ${user_list}; do
[[ -e ${MOUNTPOINT}/home/$i/.xinitrc ]] && FILE="$FILE ${MOUNTPOINT}/home/$i/.xinitrc"
done done
;;
*) loopmenu=0
;;
esac
if [[ $FILE != "" ]]; then
nano $FILE
if [[ $FILE="${MOUNTPOINT}/etc/mkinitcpio.conf" ]]; then
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "${_MMRunMkinit}?" 0 0 && {
run_mkinitcpio 2>$ERR
check_for_error "run_mkinitcpio" "$?" edit_configs
}
fi fi
;; else
"10") [[ -e ${MOUNTPOINT}/etc/lxdm/lxdm.conf ]] && FILE="${MOUNTPOINT}/etc/lxdm/lxdm.conf" DIALOG " $_ErrTitle " --msgbox "$_SeeConfErrBody" 0 0
[[ -e ${MOUNTPOINT}/etc/lightdm/lightdm.conf ]] && FILE="${MOUNTPOINT}/etc/lightdm/lightdm.conf"
[[ -e ${MOUNTPOINT}/etc/sddm.conf ]] && FILE="${MOUNTPOINT}/etc/sddm.conf"
;;
"11") [[ -e ${MOUNTPOINT}/etc/pacman.conf ]] && FILE="${MOUNTPOINT}/etc/pacman.conf"
;;
"12") user_list=$(ls ${MOUNTPOINT}/home/ | sed "s/lost+found//")
for i in ${user_list}; do
[[ -e ${MOUNTPOINT}/home/$i/.xinitrc ]] && FILE="$FILE ${MOUNTPOINT}/home/$i/.xinitrc"
done
;;
*) main_menu_online
;;
esac
if [[ $FILE != "" ]]; then
nano $FILE
if [[ $FILE="${MOUNTPOINT}/etc/mkinitcpio.conf" ]]; then
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "${_MMRunMkinit}?" 0 0 && {
run_mkinitcpio 2>$ERR
check_for_error "run_mkinitcpio" "$?" edit_configs
}
fi fi
else done
DIALOG " $_ErrTitle " --msgbox "$_SeeConfErrBody" 0 0 main_menu
fi
edit_configs
} }

@ -106,7 +106,8 @@ submenu() {
if [[ $SUB_MENU != "$PARENT" ]]; then if [[ $SUB_MENU != "$PARENT" ]]; then
SUB_MENU="$PARENT" SUB_MENU="$PARENT"
HIGHLIGHT_SUB=1 HIGHLIGHT_SUB=1
elif [[ $HIGHLIGHT_SUB != "$1" ]]; then fi
if [[ $HIGHLIGHT_SUB != "$1" ]]; then
HIGHLIGHT_SUB=$(( HIGHLIGHT_SUB + 1 )) HIGHLIGHT_SUB=$(( HIGHLIGHT_SUB + 1 ))
fi fi
} }
@ -157,7 +158,7 @@ id_system() {
check_for_error() { check_for_error() {
local _msg="$1" local _msg="$1"
local _err="${2:-0}" local _err="${2:-0}"
local _function_menu="${3:-main_menu_online}" local _function_menu="${3:-main_menu}"
((${_err}!=0)) && _msg="[${_msg}][${_err}]" ((${_err}!=0)) && _msg="[${_msg}][${_err}]"
[[ -f "${ERR}" ]] && { [[ -f "${ERR}" ]] && {
_msg="${_msg} $(head -n1 ${ERR})" _msg="${_msg} $(head -n1 ${ERR})"
@ -169,8 +170,9 @@ check_for_error() {
_fpath=" --${_fpath// /()<-}" _fpath=" --${_fpath// /()<-}"
echo -e "$(date +%D\ %T) ERROR ${_msg} ${_fpath}" >> "${LOGFILE}" echo -e "$(date +%D\ %T) ERROR ${_msg} ${_fpath}" >> "${LOGFILE}"
if [[ "${_function_menu}" != "SKIP" ]]; then if [[ "${_function_menu}" != "SKIP" ]]; then
DIALOG " $_ErrTitle " --msgbox "\n${_msg}\n" 0 0 DIALOG " $_ErrTitle " --msgbox "\n${_msg}\n" 0 0
($_function_menu) loopmenu=0 # ??
($_function_menu)
fi fi
else else
echo -e "$(date +%D\ %T) ${_msg}" >> "${LOGFILE}" echo -e "$(date +%D\ %T) ${_msg}" >> "${LOGFILE}"
@ -291,7 +293,8 @@ check_requirements() {
sleep 2 sleep 2
clear clear
echo "" > $ERR echo "" > $ERR
pacman -Syy pacman -Syy 2>$ERR
check_for_error "refresh database" $? 'SKIP'
} }
# Greet the user when first starting the installer # Greet the user when first starting the installer
@ -299,6 +302,35 @@ greeting() {
DIALOG " $_WelTitle $VERSION " --msgbox "$_WelBody" 0 0 DIALOG " $_WelTitle $VERSION " --msgbox "$_WelBody" 0 0
} }
# Originally adapted from AIS. Added option to allow users to edit the mirrorlist.
configure_mirrorlist() {
declare -i loopmenu=1
while ((loopmenu)); do
DIALOG " $_MirrorlistTitle " \
--menu "$_MirrorlistBody" 0 0 4 \
"1" "$_MirrorRankTitle" \
"2" "$_MirrorConfig" \
"3" "$_MirrorPacman" \
"4" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") rank_mirrors
;;
"2") nano /etc/pacman-mirrors.conf
check_for_error "edit pacman-mirrors.conf"
;;
"3") nano /etc/pacman.conf
DIALOG " $_MirrorPacman " --yesno "$_MIrrorPacQ" 0 0 && COPY_PACCONF=1 || COPY_PACCONF=0
check_for_error "edit pacman.conf $COPY_PACCONF"
pacman -Syy
;;
*) loopmenu=0
;;
esac
done
install_base_menu
}
rank_mirrors() { rank_mirrors() {
#Choose the branch for mirrorlist #Choose the branch for mirrorlist
BRANCH="/tmp/.branch" BRANCH="/tmp/.branch"
@ -313,33 +345,6 @@ rank_mirrors() {
} }
} }
# Originally adapted from AIS. Added option to allow users to edit the mirrorlist.
configure_mirrorlist() {
DIALOG " $_MirrorlistTitle " \
--menu "$_MirrorlistBody" 0 0 4 \
"1" "$_MirrorRankTitle" \
"2" "$_MirrorConfig" \
"3" "$_MirrorPacman" \
"4" "$_Back" 2>${ANSWER}
case $(cat ${ANSWER}) in
"1") rank_mirrors
;;
"2") nano /etc/pacman-mirrors.conf
check_for_error "edit pacman-mirrors.conf"
;;
"3") nano /etc/pacman.conf
DIALOG " $_MirrorPacman " --yesno "$_MIrrorPacQ" 0 0 && COPY_PACCONF=1 || COPY_PACCONF=0
check_for_error "edit pacman.conf $COPY_PACCONF"
pacman -Syy
;;
*) install_base_menu
;;
esac
configure_mirrorlist
}
# Simple code to show devices / partitions. # Simple code to show devices / partitions.
show_devices() { show_devices() {
lsblk -o NAME,MODEL,TYPE,FSTYPE,SIZE,MOUNTPOINT | grep "disk\|part\|lvm\|crypt\|NAME\|MODEL\|TYPE\|FSTYPE\|SIZE\|MOUNTPOINT" > /tmp/.devlist lsblk -o NAME,MODEL,TYPE,FSTYPE,SIZE,MOUNTPOINT | grep "disk\|part\|lvm\|crypt\|NAME\|MODEL\|TYPE\|FSTYPE\|SIZE\|MOUNTPOINT" > /tmp/.devlist
@ -355,7 +360,6 @@ arch_chroot() {
check_mount() { check_mount() {
if [[ $(lsblk -o MOUNTPOINT | grep ${MOUNTPOINT}) == "" ]]; then if [[ $(lsblk -o MOUNTPOINT | grep ${MOUNTPOINT}) == "" ]]; then
DIALOG " $_ErrTitle " --msgbox "$_ErrNoMount" 0 0 DIALOG " $_ErrTitle " --msgbox "$_ErrNoMount" 0 0
main_menu_online
fi fi
} }
@ -363,7 +367,6 @@ check_mount() {
check_base() { check_base() {
if [[ ! -e /mnt/.base_installed ]]; then if [[ ! -e /mnt/.base_installed ]]; then
DIALOG " $_ErrTitle " --msgbox "$_ErrNoBase" 0 0 DIALOG " $_ErrTitle " --msgbox "$_ErrNoBase" 0 0
install_base_menu
fi fi
} }

Loading…
Cancel
Save