From f4ed753fbb54090872dff152aaf194b83bf9b588 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 30 Dec 2018 20:46:28 +0100 Subject: [PATCH] Add child menu for bootloaders --- archfi | 132 +++++++++++++++++++++++++++++--------------- lng/English | 156 ++++++++++++++++++++++++++-------------------------- lng/French | 14 +++-- 3 files changed, 175 insertions(+), 127 deletions(-) diff --git a/archfi b/archfi index 415c2bc..ca1dd2d 100644 --- a/archfi +++ b/archfi @@ -772,9 +772,7 @@ archmenu(){ options+=("${txtedit//%1/crypttab}" "($txtoptional)") options+=("${txtedit//%1/mkinitcpio.conf}" "($txtoptional)") options+=("${txtedit//%1/mirrorlist}" "($txtoptional)") - options+=("${txtinstall//%1/grub}" "pacstrap grub (efibootmgr), grub-mkconfig") - options+=("${txtedit//%1/grub}" "($txtoptional)") - options+=("${txtinstall//%1/bootloader}" "grub-install") + options+=("$txtbootloader" "") options+=("${txtenable//%1/dhcpcd}" "systemctl enable dhcpd") options+=("archdi" "$txtarchdidesc") sel=$(whiptail --backtitle "$apptitle" --title "$txtarchinstallmenu" --menu "" --cancel-button "$txtback" --default-item "$nextitem" 0 0 0 \ @@ -814,7 +812,7 @@ archmenu(){ if [ "$luksroot" = "1" ]; then nextitem="${txtgenerate//%1/mkinitcpio.conf}" else - nextitem="${txtinstall//%1/grub}" + nextitem="$txtbootloader" fi fi ;; @@ -823,12 +821,12 @@ archmenu(){ if [ "$luksroot" = "1" ]; then nextitem="${txtgenerate//%1/mkinitcpio.conf}" else - nextitem="${txtinstall//%1/grub}" + nextitem="$txtbootloader" fi ;; "${txtgenerate//%1/mkinitcpio.conf}") archgenmkinitcpio - nextitem="${txtinstall//%1/grub}" + nextitem="$txtbootloader" ;; "${txtedit//%1/fstab}") $EDITOR /mnt/etc/fstab @@ -846,22 +844,9 @@ archmenu(){ $EDITOR /mnt/etc/pacman.d/mirrorlist nextitem="${txtedit//%1/mirrorlist}" ;; - "${txtinstall//%1/grub}") - archinstallgrub - nextitem="${txtinstall//%1/bootloader}" - ;; - "${txtedit//%1/grub}") - $EDITOR /mnt/etc/default/grub - if (whiptail --backtitle "$apptitle" --title "${txtedit//%1/grub}" --yesno "$txtrungrubmakeconfig" 0 0) then - clear - archchroot installgrub - pressanykey - fi - nextitem="${txtinstall//%1/bootloader}" - ;; - "${txtinstall//%1/bootloader}") - archinstallbootloader - nextitem="${txtenable//%1/dhcpcd}" + "$txtbootloader") + archbootloadermenu + nextitem="${txtenable//%1/dhcpcd}" ;; "${txtenable//%1/dhcpcd}") archenabledhcpcd @@ -1065,7 +1050,61 @@ archgenmkinitcpiochroot(){ exit } -archinstallgrub(){ + +archbootloadermenu(){ + options=() + options+=("grub" "") + sel=$(whiptail --backtitle "$apptitle" --title "$txtbootloadermenu" --menu "" --cancel-button "$txtback" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + if [ "$?" = "0" ]; then + case $sel in + "grub") + archbootloadergrubmenu + ;; + esac + fi +} + + +archbootloadergrubmenu(){ + if [ "$1" = "" ]; then + nextblitem="." + else + nextblitem=$1 + fi + options=() + options+=("${txtinstall//%1/grub}" "pacstrap grub (efibootmgr), grub-mkconfig") + options+=("${txtedit//%1/grub}" "($txtoptional)") + options+=("${txtinstall//%1/bootloader}" "grub-install") + sel=$(whiptail --backtitle "$apptitle" --title "$txtbootloadergrubmenu" --menu "" --cancel-button "$txtback" --default-item "$nextblitem" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + if [ "$?" = "0" ]; then + case $sel in + "${txtinstall//%1/grub}") + archgrubinstall + nextblitem="${txtinstall//%1/bootloader}" + ;; + "${txtedit//%1/grub}") + $EDITOR /mnt/etc/default/grub + if (whiptail --backtitle "$apptitle" --title "${txtedit//%1/grub}" --yesno "$txtrungrubmakeconfig" 0 0) then + clear + archchroot grubinstall + pressanykey + fi + nextblitem="${txtinstall//%1/bootloader}" + ;; + "${txtinstall//%1/bootloader}") + archgrubinstallbootloader + nextblitem="${txtinstall//%1/bootloader}" + ;; + esac + archbootloadergrubmenu "$nextblitem" + fi +} + +archgrubinstall(){ clear echo "pacstrap /mnt grub" pacstrap /mnt grub @@ -1099,10 +1138,10 @@ archinstallgrub(){ fi clear - archchroot installgrub + archchroot grubinstall pressanykey } -archinstallgrubchroot(){ +archgrubinstallchroot(){ echo "mkdir /boot/grub" echo "grub-mkconfig -o /boot/grub/grub.cfg" mkdir /boot/grub @@ -1110,7 +1149,7 @@ archinstallgrubchroot(){ exit } -archinstallbootloader(){ +archgrubinstallbootloader(){ items=$(lsblk -d -p -n -l -o NAME -e 7,11) options=() for item in $items; do @@ -1141,34 +1180,34 @@ archinstallbootloader(){ if [ "$?" = "0" ]; then clear case $sel in - "BIOS") archchroot installbootloader $device;; - "EFI") archchroot installbootloaderefi $device;; - "BIOS+EFI") archchroot installbootloaderefiusb $device;; + "BIOS") archchroot grubbootloaderinstall $device;; + "EFI") archchroot grubbootloaderefiinstall $device;; + "BIOS+EFI") archchroot grubbootloaderefiusbinstall $device;; esac pressanykey fi else clear - archchroot installbootloader $device + archchroot grubbootloaderinstall $device pressanykey fi fi } -archinstallbootloaderchroot(){ +archgrubinstallbootloaderchroot(){ if [ ! "$1" = "none" ]; then echo "grub-install --target=i386-pc --recheck $1" grub-install --target=i386-pc --recheck $1 fi exit } -archinstallbootloaderefichroot(){ +archgrubinstallbootloaderefichroot(){ if [ ! "$1" = "none" ]; then echo "grub-install --target=x86_64-efi --efi-directory=/boot --recheck $1" grub-install --target=x86_64-efi --efi-directory=/boot --recheck $1 fi exit } -archinstallbootloaderefiusbchroot(){ +archgrubinstallbootloaderefiusbchroot(){ if [ ! "$1" = "none" ]; then echo "grub-install --target=i386-pc --recheck $1" grub-install --target=i386-pc --recheck $1 @@ -1178,6 +1217,9 @@ archinstallbootloaderefiusbchroot(){ exit } + + + archenabledhcpcd(){ if (whiptail --backtitle "$apptitle" --title "${txtenable//%1/dhcpcd}" --yesno "${txtenable//%1/dhcpcd} ?" 0 0) then clear @@ -1322,7 +1364,6 @@ loadstrings(){ txtinstallmenu="Install Menu" txtarchinstallmenu="Arch Install Menu" - txtrungrubmakeconfig="Run grub-mkconfig ?" txteditmirrorlist="Edit mirrorlist" txtinstallarchlinux="Install Arch Linux" @@ -1336,6 +1377,15 @@ loadstrings(){ txtuseutcclock="Use UTC hardware clock ?" + txtbootloader="Bootloader" + txtbootloadermenu="Choose your bootloader" + + txtefibootmgr="efibootmgr is required for EFI computers." + + txtbootloadergrubmenu="Grub Install Menu" + txtrungrubmakeconfig="Run grub-mkconfig ?" + txtgrubluksdetected="Encrypted root partion !\n\nAdd cryptdevice= to GRUB_CMDLINE_LINUX in /etc/default/grub ?" + txtoptional="Optional" txtrecommandeasyinst="Recommanded for easy install" txtset="Set %1" @@ -1344,14 +1394,8 @@ loadstrings(){ txtinstall="Install %1" txtenable="Enable %1" - txtgrubluksdetected="Encrypted root partion !\n\nAdd cryptdevice= to GRUB_CMDLINE_LINUX in /etc/default/grub ?" - - txtpressanykey="Press any key to continue." - txtinstallosprober="os-prober is a good solution if you want to use mutli-boot.\nInstall os-prober ?" - txtefibootmgr="efibootmgr is required for EFI computers." - txtarchdidesc="Full desktop install script" txtinstallarchdi="Arch Linux Desktop Install (archdi) is a second script who can help you to install a full workstation.\n\nYou can just launch the script or install it. Choose in the next menu.\n\nArch Linux Desktop Install as two dependencies : wget and libnewt.\n\npacstrap wget libnewt ?" txtarchdiinstallandlaunch="Install and run archdi" @@ -1391,10 +1435,10 @@ if [ "$chroot" = "1" ]; then 'settimelocal') archsettimelocalchroot;; 'genmkinitcpio') archgenmkinitcpiochroot;; 'enabledhcpcd') archenabledhcpcdchroot;; - 'installgrub') archinstallgrubchroot;; - 'installbootloader') archinstallbootloaderchroot $args;; - 'installbootloaderefi') archinstallbootloaderefichroot $args;; - 'installbootloaderefiusb') archinstallbootloaderefiusbchroot $args;; + 'grubinstall') archgrubinstallchroot;; + 'grubbootloaderinstall') archgrubinstallbootloaderchroot $args;; + 'grubbootloaderefiinstall') archgrubinstallbootloaderefichroot $args;; + 'grubbootloaderefiusbinstall') archgrubinstallbootloaderefiusbchroot $args;; 'archdiinstallandlaunch') archdiinstallandlaunchchroot;; 'archdiinstall') archdiinstallchroot;; 'archdilaunch') archdilaunchchroot;; diff --git a/lng/English b/lng/English index 0549da6..d53aefd 100644 --- a/lng/English +++ b/lng/English @@ -6,89 +6,91 @@ # notes : misc text... -locale=en_US.UTF-8 -#font= + + locale=en_US.UTF-8 + #font= + + txtexit="Exit" + txtback="Back" + txtignore="Ignore" + + txtselectserver="Select source server :" + + txtmainmenu="Main Menu" + txtlanguage="Language" + txtsetkeymap="Set Keyboard Layout" + txteditor="Editor" + txtdiskpartmenu="Disk Partitions" + txtselectpartsmenu="Select Partitions and Install" + txthelp="Help" + txtchangelog="Changelog" + txtreboot="Reboot" + txtautoparts="Auto Partitions" + txteditparts="Edit Partitions" -txtexit="Exit" -txtback="Back" -txtignore="Ignore" + txtautopartsconfirm="Selected device : %1\n\nAll data will be erased ! \n\nContinue ?" -txtselectserver="Select source server :" + txtautopartclear="Clear all partition data" + txtautopartcreate="Create %1 partition" + txthybridpartcreate="Set hybrid MBR" + txtautopartsettype="Set %1 partition type" -txtmainmenu="Main Menu" -txtlanguage="Language" -txtsetkeymap="Set Keyboard Layout" -txteditor="Editor" -txtdiskpartmenu="Disk Partitions" -txtselectpartsmenu="Select Partitions and Install" -txthelp="Help" -txtchangelog="Changelog" -txtreboot="Reboot" + txtselectdevice="Select %1 device :" + txtselecteddevices="Selected devices :" -txtautoparts="Auto Partitions" -txteditparts="Edit Partitions" + txtformatmountmenu="Format and Mount" + txtformatdevices="Format Devices" + txtformatdevice="Format Device" + txtmount="Mount" + txtunmount="Unmount" + txtmountdesc="Install or Config" -txtautopartsconfirm="Selected device : %1\n\nAll data will be erased ! \n\nContinue ?" + txtformatdeviceconfirm="Warning, all data on selected devices will be erased ! \nFormat devices ?" -txtautopartclear="Clear all partition data" -txtautopartcreate="Create %1 partition" -txthybridpartcreate="Set hybrid MBR" -txtautopartsettype="Set %1 partition type" + txtselectpartformat="Select partition format for %1 :" + txtformatingpart="Formatting partition %1 as" + txtcreateluksdevice="Create luks device :" + txtopenluksdevice="Open luks device :" + txtluksdevicecreated="luks device created !" -txtselectdevice="Select %1 device :" -txtselecteddevices="Selected devices :" + txtinstallmenu="Install Menu" + + txtarchinstallmenu="Arch Install Menu" + txtrungrubmakeconfig="Run grub-mkconfig ?" + + txteditmirrorlist="Edit mirrorlist" + txtinstallarchlinux="Install Arch Linux" + txtconfigarchlinux="Config Arch Linux" -txtformatmountmenu="Format and Mount" -txtformatdevices="Format Devices" -txtformatdevice="Format Device" -txtmount="Mount" -txtunmount="Unmount" -txtmountdesc="Install or Config" - -txtformatdeviceconfirm="Warning, all data on selected devices will be erased ! \nFormat devices ?" - -txtselectpartformat="Select partition format for %1 :" -txtformatingpart="Formatting partition %1 as" -txtcreateluksdevice="Create luks device :" -txtopenluksdevice="Open luks device :" -txtluksdevicecreated="luks device created !" - -txtinstallmenu="Install Menu" - -txtarchinstallmenu="Arch Install Menu" -txtrungrubmakeconfig="Run grub-mkconfig ?" - -txteditmirrorlist="Edit mirrorlist" -txtinstallarchlinux="Install Arch Linux" -txtconfigarchlinux="Config Arch Linux" - -txtsethostname="Set Computer Name" -txtsetfont="Set Font" -txtsetlocale="Set Locale" -txtsettime="Set Time" -txtsetrootpassword="Set root password" - -txtuseutcclock="Use UTC hardware clock ?" - -txtoptional="Optional" -txtrecommandeasyinst="Recommanded for easy install" -txtset="Set %1" -txtgenerate="Generate %1" -txtedit="Edit %1" -txtinstall="Install %1" -txtenable="Enable %1" - -txtgrubluksdetected="Encrypted root partion !\n\nAdd cryptdevice= to GRUB_CMDLINE_LINUX in /etc/default/grub ?" - - -txtpressanykey="Press any key to continue." - -txtinstallosprober="os-prober is a good solution if you want to use mutli-boot.\nInstall os-prober ?" -txtefibootmgr="efibootmgr is required for efi computer." - -txtarchdidesc="Full desktop install script" -txtinstallarchdi="Arch Linux Desktop Install (archdi) is a second script who can help you to install a full workstation.\n\nYou can just launch the script or install it. Choose in the next menu.\n\nArch Linux Desktop Install has two dependencies : wget and libnewt.\n\npacstrap wget libnewt ?" -txtarchdiinstallandlaunch="Install and run archdi" -txtarchdiinstall="Install archdi" -txtarchdilaunch="Launch archdi" + txtsethostname="Set Computer Name" + txtsetfont="Set Font" + txtsetlocale="Set Locale" + txtsettime="Set Time" + txtsetrootpassword="Set root password" + + txtuseutcclock="Use UTC hardware clock ?" + + txtbootloader="Bootloader" + txtbootloadermenu="Choose your bootloader" + + txtefibootmgr="efibootmgr is required for EFI computers." + + txtbootloadergrubmenu="Grub Install Menu" + txtgrubluksdetected="Encrypted root partion !\n\nAdd cryptdevice= to GRUB_CMDLINE_LINUX in /etc/default/grub ?" + + txtoptional="Optional" + txtrecommandeasyinst="Recommanded for easy install" + txtset="Set %1" + txtgenerate="Generate %1" + txtedit="Edit %1" + txtinstall="Install %1" + txtenable="Enable %1" + + txtpressanykey="Press any key to continue." + + txtarchdidesc="Full desktop install script" + txtinstallarchdi="Arch Linux Desktop Install (archdi) is a second script who can help you to install a full workstation.\n\nYou can just launch the script or install it. Choose in the next menu.\n\nArch Linux Desktop Install as two dependencies : wget and libnewt.\n\npacstrap wget libnewt ?" + txtarchdiinstallandlaunch="Install and run archdi" + txtarchdiinstall="Install archdi" + txtarchdilaunch="Launch archdi" diff --git a/lng/French b/lng/French index 3c20ffb..2af4855 100644 --- a/lng/French +++ b/lng/French @@ -71,6 +71,14 @@ txtsetrootpassword="Définir le mot de passe root" txtuseutcclock="Utiliser une horloge matériel UTC ?" +txtbootloader="Bootloader" +txtbootloadermenu="Choisissez votre bootloader" + +txtefibootmgr="efibootmgr est requis pour un système EFI." + +txtbootloadergrubmenu="Menu Installation Grub" +txtgrubluksdetected="Partition root cryptée !\n\nAjouter cryptdevice= to GRUB_CMDLINE_LINUX dans /etc/default/grub ?" + txtoptional="Optionnel" txtrecommandeasyinst="Recommandé pour installation rapide" txtset="Définir %1" @@ -79,14 +87,8 @@ txtedit="Editer %1" txtinstall="Installer %1" txtenable="Activer %1" -txtgrubluksdetected="Partition root cryptée !\n\nAjouter cryptdevice= to GRUB_CMDLINE_LINUX dans /etc/default/grub ?" - - txtpressanykey="Appuyez sur une touche pour continuer." -txtinstallosprober="Pour démarrer sur plusieurs systèmes.\nInstaller os-prober ?" -txtefibootmgr="efibootmgr est requis pour un système EFI." - txtarchdidesc="Installation d'un poste de travail" txtinstallarchdi="Arch Linux Desktop Install (archdi) est un second script peut vous aidez à installer un poste de travail complet.\n\nVous pouvez exécuter ou installer le script en choisissant dans le menu suivant.\n\nArch Linux Desktop Install possède 2 dépendences : wget et libnewt.\n\npacstrap wget libnewt ?" txtarchdiinstallandlaunch="Installer et exécuter archdi"