diff --git a/config/boot/grub/menu b/config/boot/grub/menu new file mode 100644 index 0000000..bc677a4 --- /dev/null +++ b/config/boot/grub/menu @@ -0,0 +1,27 @@ +#!/bin/bash +. ./lib + +options=() +options+=("config" "/etc/default/grub") +options+=("grub-mkconfig" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Grub Config Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'config') editfile /etc/default/grub;; + 'grub-mkconfig') + clear + echo "grub-mkconfig -o /boot/grub/grub.cfg" + grub-mkconfig -o /boot/grub/grub.cfg + pressanykey + ;; +esac + +exit 0 diff --git a/config/boot/initcpio/menu b/config/boot/initcpio/menu new file mode 100644 index 0000000..cc47f6f --- /dev/null +++ b/config/boot/initcpio/menu @@ -0,0 +1,45 @@ +#!/bin/bash +. ./lib + +options=() +options+=("config" "/etc/mkinitcpio.conf") +options+=("mkinicpio" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Initcpio Config Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'config') editfile /etc/mkinitcpio.conf;; + 'mkinicpio') + options=() + configs=$(ls /etc/mkinitcpio.d) + for itm in $configs; do + options+=("${itm::-7}" "" on) + done + sel=$(whiptail --backtitle "$apptitle" --title "Choose configs :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + if [ ! "$?" = "0" ]; then + exit 1 + fi + clear + for itm in $sel; do + case $itm in + *) + itm=$(sed "s/\"//g" <<<"$itm") + echo "mkinitcpio -p $itm" + mkinitcpio -p $itm + ;; + esac + done + pressanykey + ;; +esac + +exit 0 diff --git a/config/boot/menu b/config/boot/menu new file mode 100644 index 0000000..c38708d --- /dev/null +++ b/config/boot/menu @@ -0,0 +1,24 @@ +#!/bin/bash +. ./lib + +options=() +options+=("initcpio" "") +if [ -f /boot/grub/grub.cfg ]; then + options+=("grub" "") +fi + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Boot Configuration :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'initcpio') menu config/boot/initcpio/menu;; + 'grub') menu config/boot/grub/menu;; +esac + +exit 0