This commit is contained in:
teldra 2022-02-07 05:35:12 +01:00
parent 9db275831f
commit b769253c53
5 changed files with 100 additions and 23 deletions

View File

@ -1,5 +1,6 @@
packages() { packages() {
addpkg "sddm" "kde5" "konsole" addpkg "sddm" "kde5" "konsole"
need_xserver=1
} }
config() { config() {

122
main.sh
View File

@ -2,6 +2,7 @@
main="/tmp/vinstall" main="/tmp/vinstall"
target="${main}/target" target="${main}/target"
tmp_target="${main}/tmp_target"
pass="oem" pass="oem"
if [ $DEBUG ]; then if [ $DEBUG ]; then
@ -161,36 +162,87 @@ base() {
. ./etc/base . ./etc/base
packages packages
reset packages reset packages
cp ./etc/base $tmp_target
} }
gfx() { gfx() {
multiplechoice "amd" "nvidia" "intel" for i in $(find ./etc/gfx/ -type f); do
GFX=$output gfx+=("$(basename $i)")
. ./etc/gfx/$GFX done
packages if [ "${#gfx[@]}" -gt "1" ]; then
reset packages multiplechoice "${gfx[@]}"
GFX=$output
elif [ "${#gfx[@]}" -eq "1" ]; then
GFX=${gfx[0]}
fi
if ! [ "${#gfx[@]}" -eq "0" ]; then
. ./etc/gfx/$GFX
packages
reset packages
cp ./etc/gfx/$GFX $tmp_target
fi
} }
soundsystem() { soundsystem() {
multiplechoice "pulseaudio" "pipewire" for i in $(find ./etc/soundsystem/ -type f); do
SOUNDSYSTEM=$output soundsystem+=("$(basename $i)")
. ./etc/soundsystem/$SOUNDSYSTEM done
packages if [ "${#soundsystem[@]}" -gt "1" ]; then
reset packages multiplechoice "${soundsystem[@]}"
SOUNDSYSTEM=$output
elif [ "${#soundsystem[@]}" -eq "1" ]; then
SOUNDSYSTEM=${soundsystem[0]}
fi
if ! [ "${#soundsystem[@]}" -eq "0" ]; then
. ./etc/soundsystem/$SOUNDSYSTEM
packages
reset packages
cp ./etc/soundsystem/$SOUNDSYSTEM $tmp_target
fi
} }
de() { xserver() {
multiplechoice "plasma" "gnome" "minimal" for i in $(find ./etc/xserver/ -type f); do
DE=$output xserver+=("$(basename $i)")
if ! [ "$DE" == "minimal" ]; then done
gfx if [ "${#xserver[@]}" -gt "1" ]; then
soundsystem multiplechoice "${xserver[@]}"
. ./etc/de/$DE XSERVER=$output
elif [ "${#xserver[@]}" -eq "1" ]; then
XSERVER=${xserver[0]}
fi
if ! [ "${#xserver[@]}" -eq "0" ]; then
. ./etc/xserver/$XSERVER
packages packages
reset packages reset packages
. ./etc/x11 cp ./etc/xserver/$XSERVER $tmp_target
fi
}
profile() {
for i in $(find ./etc/profile/ -type f); do
profile+=("$(basename $i)")
done
if [ "${#profile[@]}" -gt "1" ]; then
multiplechoice "${profile[@]}"
PROFILE=$output
elif [ "${#profile[@]}" -eq "1" ]; then
PROFILE=${profile[0]}
fi
if ! [ "${#profile[@]}" -eq "0" ]; then
. ./etc/profile/$PROFILE
packages packages
reset packages reset packages
cp ./etc/profile/$PROFILE $tmp_target
if [ "$need_xserver" == "1" ]; then
xserver
fi
if [ "$need_gfx" == "1" ]; then
gfx
fi
if [ "$need_sound" == "1" ]; then
soundsystem
fi
fi fi
} }
@ -210,16 +262,40 @@ lang() {
} }
bootloader() { bootloader() {
for i in $(find recipes/bootloader -type f); do for i in $(find ./etc/bootloader/ -type f); do
bl+=("$(basename $i)") bootloader+=("$(basename $i)")
done done
if [ "${#bl[@]}" -gt "1" ]; then if [ "${#bootloader[@]}" -gt "1" ]; then
multiplechoice "${bl[@]}" multiplechoice "${bootloader[@]}"
BOOTLOADER=$output
elif [ "${#bootloader[@]}" -eq "1" ]; then
BOOTLOADER=${bootloader[0]}
fi fi
if ! [ "${#bootloader[@]}" -eq "0" ]; then
. ./etc/bootloader/$BOOTLOADER
packages
reset packages
cp ./etc/bootloader/$BOOTLOADER $tmp_target
fi
} }
network() { network() {
multiplechoice "NetworkManager" "dhcpcd" "iwd" for i in $(find ./etc/network/ -type f); do
network+=("$(basename $i)")
done
if [ "${#network[@]}" -gt "1" ]; then
multiplechoice "${network[@]}"
NETWORK=$output
elif [ "${#network[@]}" -eq "1" ]; then
NETWORK=${network[0]}
fi
if ! [ "${#network[@]}" -eq "0" ]; then
. ./etc/network/$NETWORK
packages
reset packages
cp ./etc/network/$NETWORK $tmp_target
fi
} }
do_install() { do_install() {