forked from BodgeMaster/void-usb
Add the ability to choose between different architectures
parent
0facbea16a
commit
51fbc1f2cf
|
@ -210,12 +210,33 @@ xmirror
|
|||
#TODO: also remove CPU architecture
|
||||
TARGET_MIRROR="$(sed 's/repository=//;s|/musl$||' /etc/xbps.d/00-repository-main.conf)"
|
||||
|
||||
#TODO: select installation type
|
||||
TARGET_TYPE="x86_64"
|
||||
|
||||
options=("x86_64" "x86_64 musl" "x86_32")
|
||||
while true; do
|
||||
echo "Select your desired architecture."
|
||||
for i in "${!options[@]}"; do
|
||||
echo "$((i+1))) ${options[$i]}"
|
||||
done
|
||||
|
||||
read -p "Input your choice: " choice
|
||||
|
||||
# Funny loop in bash...
|
||||
if [[ "$choice" =~ ^[0-9]+$ ]] && [ "$choice" -ge 1 ] && [ "$choice" -le "${#options[@]}" ]; then
|
||||
TARGET_TYPE="${options[$((choice-1))]}"
|
||||
break
|
||||
else
|
||||
echo "Selection invalid."
|
||||
fi
|
||||
done
|
||||
|
||||
echo "You selected: $TARGET_TYPE"
|
||||
|
||||
#TODO: also add CPU architecture
|
||||
if grep "musl" <<< "$TARGET_TYPE"; then
|
||||
TARGET_MIRROR="$TARGET_MIRROR/musl"
|
||||
# Probably not the smartest idea, but since there is just one option for musl,
|
||||
# I figured out this should do.
|
||||
TARGET_TYPE="x86_64"
|
||||
fi
|
||||
|
||||
echo -n "Copying repository keys... "
|
||||
|
|
Loading…
Reference in New Issue