From 9a207c003fd2b6d06939d9105e76b3d1b0cb4c22 Mon Sep 17 00:00:00 2001 From: teldra Date: Mon, 7 Feb 2022 17:58:29 +0100 Subject: [PATCH] progress --- etc/functions | 19 +++++++++++++++++++ main.sh | 31 ++++++------------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/etc/functions b/etc/functions index 8fb5c21..1f56259 100644 --- a/etc/functions +++ b/etc/functions @@ -119,3 +119,22 @@ yesno() { return 0 fi } + +readin() { + WHICH="$1" + for i in $(find ./etc/${WHICH}/ -type f); do + choice+=("$(basename $i)") + done + if [ "${#choice[@]}" -gt "1" ]; then + header "$WHICH" + multiplechoice "${choice[@]}" + elif [ "${#choice[@]}" -eq "1" ]; then + output=${choice[0]} + fi + if ! [ "${#choice[@]}" -eq "0" ]; then + . ./etc/${WHICH}/$output + packages + reset packages + cp ./etc/${WHICH}/$output $tmp_target + fi +} \ No newline at end of file diff --git a/main.sh b/main.sh index c42561a..e9c7ebf 100644 --- a/main.sh +++ b/main.sh @@ -194,13 +194,13 @@ profile() { reset packages cp ./etc/profile/$PROFILE $tmp_target if [ "$need_xserver" == "1" ]; then - packages xserver + readin xserver fi if [ "$need_gfx" == "1" ]; then - packages gfx + readin gfx fi if [ "$need_sound" == "1" ]; then - packages soundsystem + readin soundsystem fi fi } @@ -214,25 +214,6 @@ lang() { fi } -packages() { - WHICH="$1" - for i in $(find ./etc/${WHICH}/ -type f); do - choice+=("$(basename $i)") - done - if [ "${#choice[@]}" -gt "1" ]; then - header "$WHICH" - multiplechoice "${choice[@]}" - elif [ "${#choice[@]}" -eq "1" ]; then - output=${choice[0]} - fi - if ! [ "${#choice[@]}" -eq "0" ]; then - . ./etc/${WHICH}/$output - packages - reset packages - cp ./etc/${WHICH}/$output $tmp_target - fi -} - do_install() { header "Installation" mkdir -p ${target}/var/db/xbps/keys @@ -300,14 +281,14 @@ target_phy_id use_efi encryption_style hibernation -packages bootloader +readin bootloader user lang hostname base profile -packages network -packages printing +readin network +readin printing do_partition do_install do_chroot