From ea4ed5e757ca43316b60501ed17ffe947cab7c82 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Fri, 4 Jan 2019 00:17:03 +0100 Subject: [PATCH] systemd-boot: add entries menu and pacman hook --- config/boot/initcpio/menu | 6 +++--- config/boot/systemd/entries | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config/boot/initcpio/menu b/config/boot/initcpio/menu index cc47f6f..6bb27c6 100644 --- a/config/boot/initcpio/menu +++ b/config/boot/initcpio/menu @@ -2,10 +2,10 @@ . ./lib options=() -options+=("config" "/etc/mkinitcpio.conf") +options+=("Config" "/etc/mkinitcpio.conf") options+=("mkinicpio" "") -defaultitem="" +defaultitem="Config" 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) @@ -15,7 +15,7 @@ fi sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 case $sel in - 'config') editfile /etc/mkinitcpio.conf;; + 'Config') editfile /etc/mkinitcpio.conf;; 'mkinicpio') options=() configs=$(ls /etc/mkinitcpio.d) diff --git a/config/boot/systemd/entries b/config/boot/systemd/entries index 68b0a59..e5fe62e 100644 --- a/config/boot/systemd/entries +++ b/config/boot/systemd/entries @@ -65,32 +65,38 @@ case $sel in "${entrylist[@]}" \ 3>&1 1>&2 2>&3) if [ "$?" = "0" ]; then + endmsg="Nothing to do !" clear for itm in $sel; do itm=${itm//\"/} if [ -f /boot/amd-ucode.img ]; then if [ ! "$(cat /boot/loader/entries/$itm.conf | grep amd-ucode.img)" ]; then + endmsg="" echo "Add amd-ucode to $itm" sed -i "/vmlinuz/a initrd /amd-ucode.img" /boot/loader/entries/$itm.conf fi else if [ "$(cat /boot/loader/entries/$itm.conf | grep amd-ucode.img)" ]; then + endmsg="" echo "Remove amd-ucode from $itm" sed -i "/amd-ucode.img/d" /boot/loader/entries/$itm.conf fi fi if [ -f /boot/intel-ucode.img ]; then if [ ! "$(cat /boot/loader/entries/$itm.conf | grep intel-ucode.img)" ]; then + endmsg="" echo "Add intel-ucode to $itm" sed -i "/vmlinuz/a initrd /intel-ucode.img" /boot/loader/entries/$itm.conf fi else if [ "$(cat /boot/loader/entries/$itm.conf | grep intel-ucode.img)" ]; then + endmsg="" echo "Remove intel-ucode from $itm" sed -i "/intel-ucode.img/d" /boot/loader/entries/$itm.conf fi fi done + echo "$endmsg" pressanykey fi ;;