aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatMoul <matmoul@gmail.com>2020-04-08 04:17:25 +0200
committerMatMoul <matmoul@gmail.com>2020-04-08 04:17:25 +0200
commitdf6c2bde7c8bb7dd5406aaa3a5b99022a3b57b01 (patch)
treed1872b9d16fd44c199db90dd9cfa7ec78747a379
parenta17a636e1cbb21d72447034295413c418d93ea24 (diff)
downloadhyperfi-df6c2bde7c8bb7dd5406aaa3a5b99022a3b57b01.tar.lz
hyperfi-df6c2bde7c8bb7dd5406aaa3a5b99022a3b57b01.tar.xz
hyperfi-df6c2bde7c8bb7dd5406aaa3a5b99022a3b57b01.zip
Add custom package list support
-rw-r--r--archfi28
-rw-r--r--samples/custompackagelist13
2 files changed, 41 insertions, 0 deletions
diff --git a/archfi b/archfi
index e6c0df0..410b8f5 100644
--- a/archfi
+++ b/archfi
@@ -14,6 +14,7 @@
apptitle="Arch Linux Fast Install (archfi) - Version: 2020.04.05.23.08.12 (GPLv3)"
baseurl=https://raw.githubusercontent.com/MatMoul/archfi/master
+cpl=0
skipfont="0"
fspkgs=""
@@ -859,6 +860,24 @@ installbase(){
pkgs="$pkgs $(echo $itm | sed 's/"//g')"
done
+ if [[ ${cpl} == 1 ]]; then
+ sed -i '/^\s*$/d' /tmp/archfi-custom-package-list
+ sed -i '/^#/ d' /tmp/archfi-custom-package-list
+ options=()
+ while read pkg; do
+ options+=("${pkg}" "" on)
+ done < /tmp/archfi-custom-package-list
+ sel=$(whiptail --backtitle "${apptitle}" --title "Custom Package List" --checklist "" 0 0 0 \
+ "${options[@]}" \
+ 3>&1 1>&2 2>&3)
+ if [ ! "$?" = "0" ]; then
+ return 1
+ fi
+ for itm in $sel; do
+ pkgs="$pkgs $(echo $itm | sed 's/"//g')"
+ done
+ fi
+
clear
echo "pacstrap /mnt ${pkgs}"
pacstrap /mnt ${pkgs}
@@ -1927,11 +1946,20 @@ while (( "$#" )); do
--help)
echo "archfi"
echo "------"
+ echo "-cpl | --custom-package-list url Set custom package list url"
echo "-sf | --skip-font Skip setfont from language files"
echo "-efiX -efi0 : disable EFI, -efi1 efi inst, -efi2 efi hybrid inst"
echo "-t | --test ghusername ghbranch Test archfi script and language"
exit 0
;;
+ -cpl | --custom-package-list)
+ curl -L ${2} > /tmp/archfi-custom-package-list
+ if [[ "$?" != "0" ]]; then
+ echo "Error downloading custom package list"
+ exit 0
+ fi
+ cpl=1
+ ;;
-sf | --skip-font) skipfont=1;;
-t | --test)
wget -O archfi https://raw.githubusercontent.com/${2}/archfi/${3}/archfi
diff --git a/samples/custompackagelist b/samples/custompackagelist
new file mode 100644
index 0000000..0dd466c
--- /dev/null
+++ b/samples/custompackagelist
@@ -0,0 +1,13 @@
+# This file is a sample of a custom package list that is available at the pacstrap step.
+# Each line is a package but empty line and commented line is supported.
+
+# How to use :
+# Store your own file on a web server
+# Launch archfi with :
+# archfi -cpl url_of_the_file
+
+# Some packages :
+neofetch
+nmon
+lsusb
+# base-devel