mirror of
https://github.com/rwinkhart/artix-install-script.git
synced 2026-08-28 04:46:27 -04:00
Pass variables from install.sh to chrootInstall.sh via an array, rather than writing values to disk
This commit is contained in:
+11
-11
@@ -1,17 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Importing Variables
|
||||
formfactor="$(< /tempfiles/formfactor)"
|
||||
threadsminusone="$(< /tempfiles/threadsminusone)"
|
||||
gpu="$(< /tempfiles/gpu)"
|
||||
intel_vaapi_driver="$(< /tempfiles/intel_vaapi_driver)"
|
||||
boot="$(< /tempfiles/boot)"
|
||||
disk="$(< /tempfiles/disk)"
|
||||
username="$(< /tempfiles/username)"
|
||||
userpassword="$(< /tempfiles/userpassword)"
|
||||
rootpassword="$(< /tempfiles/rootpassword)"
|
||||
timezone="$(< /tempfiles/timezone)"
|
||||
swap="$(< /tempfiles/swap)"
|
||||
formfactor=$1[1]
|
||||
threadsminusone=$1[2]
|
||||
gpu=$1[3]
|
||||
intel_vaapi_driver=$1[4]
|
||||
boot=$1[5]
|
||||
disk=$1[6]
|
||||
username=$1[7]
|
||||
userpassword=$1[8]
|
||||
rootpassword=$1[9]
|
||||
timezone=$1[10]
|
||||
swap=$1[11]
|
||||
|
||||
# configuring locale and clock Settings
|
||||
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
|
||||
|
||||
+3
-14
@@ -174,21 +174,10 @@ for int in "${interfaces[@]}"; do
|
||||
echo "net.ipv6.conf.${int:15}.use_tempaddr = 2" >> /mnt/etc/sysctl.d/40-ipv6.conf
|
||||
done
|
||||
|
||||
# exporting variables
|
||||
mkdir /mnt/tempfiles
|
||||
echo "$formfactor" > /mnt/tempfiles/formfactor
|
||||
echo "$threadsminusone" > /mnt/tempfiles/threadsminusone
|
||||
echo "$gpu" > /mnt/tempfiles/gpu
|
||||
echo "$intel_vaapi_driver" > /mnt/tempfiles/intel_vaapi_driver
|
||||
echo "$boot" > /mnt/tempfiles/boot
|
||||
echo "$disk0" > /mnt/tempfiles/disk
|
||||
echo "$username" > /mnt/tempfiles/username
|
||||
echo "$userpassword" > /mnt/tempfiles/userpassword
|
||||
echo "$rootpassword" > /mnt/tempfiles/rootpassword
|
||||
echo "$timezone" > /mnt/tempfiles/timezone
|
||||
echo "$swap" > /mnt/tempfiles/swap
|
||||
# create array of variables to pass to part 2
|
||||
var_export=($formfactor $threadsminusone $gpu $intel_vaapi_driver $boot $disk0 $username $userpassword $rootpassword $timezone $swap)
|
||||
|
||||
# download and initiate part 2
|
||||
curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/chrootInstall.sh -o /mnt/chrootInstall.sh
|
||||
chmod +x /mnt/chrootInstall.sh
|
||||
artix-chroot /mnt /chrootInstall.sh
|
||||
artix-chroot /mnt /chrootInstall.sh $var_export
|
||||
|
||||
Reference in New Issue
Block a user