summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2019-12-15 11:03:01 +0100
committerxengineering <mail2xengineering@protonmail.com>2019-12-15 11:03:01 +0100
commita9d270eddc062c336c40e1ef8e2c732986222673 (patch)
tree1f68137196293ec69e994872538bb09ab12329aa
parent9c3854fc72d16c7a819cd74e93dda56e6805cc21 (diff)
downloadarchinstall-a9d270eddc062c336c40e1ef8e2c732986222673.tar
archinstall-a9d270eddc062c336c40e1ef8e2c732986222673.tar.zst
archinstall-a9d270eddc062c336c40e1ef8e2c732986222673.zip
Removed some hard-coding.
-rw-r--r--util/configure_keyboard.sh5
-rw-r--r--util/configure_network.sh5
-rw-r--r--util/configure_timezone.sh6
-rw-r--r--util/configure_users.sh1
-rw-r--r--util/copy_archinstall_config.sh5
-rw-r--r--util/copy_archinstall_log.sh7
-rw-r--r--util/create_filesystems.sh7
-rw-r--r--util/install_archinstall.sh5
-rw-r--r--util/install_bootloader.sh8
-rw-r--r--util/install_packages.sh5
-rw-r--r--util/mount_filesystems.sh4
-rw-r--r--util/partition_disk.sh5
-rw-r--r--util/unmount_filesystems.sh4
-rw-r--r--util/write_config.py2
-rw-r--r--util/write_fstab.sh1
15 files changed, 56 insertions, 14 deletions
diff --git a/util/configure_keyboard.sh b/util/configure_keyboard.sh
index f492e43..9a1a1a3 100644
--- a/util/configure_keyboard.sh
+++ b/util/configure_keyboard.sh
@@ -18,7 +18,10 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+keymap=$1 # e.g. "de-latin1"
+
+
touch /etc/vconsole.conf
-echo "KEYMAP=de-latin1" > /etc/vconsole.conf
+echo "KEYMAP=$keymap" > /etc/vconsole.conf
echo "Keyboard configuration done - OK"
diff --git a/util/configure_network.sh b/util/configure_network.sh
index 6d07280..fd85e36 100644
--- a/util/configure_network.sh
+++ b/util/configure_network.sh
@@ -18,8 +18,11 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+hostname=$1
+
+
touch /etc/hostname
-echo $1 > /etc/hostname
+echo $hostname > /etc/hostname
touch /etc/hosts
echo "" >> /etc/hosts
diff --git a/util/configure_timezone.sh b/util/configure_timezone.sh
index f567832..fce6d99 100644
--- a/util/configure_timezone.sh
+++ b/util/configure_timezone.sh
@@ -18,6 +18,10 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
+timezone=$1 # e.g. /usr/share/zoneinfo/Europe/Berlin
+
+
+ln -sf $timezone /etc/localtime
hwclock --systohc
+
echo "Configured timezone - OK"
diff --git a/util/configure_users.sh b/util/configure_users.sh
index 3d482c0..b6eba0b 100644
--- a/util/configure_users.sh
+++ b/util/configure_users.sh
@@ -19,4 +19,5 @@
echo "root:root" | chpasswd
+
echo "Configured users - OK"
diff --git a/util/copy_archinstall_config.sh b/util/copy_archinstall_config.sh
index 8a7b04a..a56a222 100644
--- a/util/copy_archinstall_config.sh
+++ b/util/copy_archinstall_config.sh
@@ -18,6 +18,9 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-cp $LOG_FILE_PATH /mnt$LOG_FILE_PATH
+config_file_path=$1 # e.g. "/var/log/archinstall.log"
+
+
+cp $config_file_path /mnt$config_file_path
echo "Copied archinstall configuration - OK"
diff --git a/util/copy_archinstall_log.sh b/util/copy_archinstall_log.sh
index 1c5f3af..5f2a8b8 100644
--- a/util/copy_archinstall_log.sh
+++ b/util/copy_archinstall_log.sh
@@ -18,7 +18,10 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-mkdir /mnt$(dirname "$CONFIG_FILE_PATH")
-cp $CONFIG_FILE_PATH /mnt$CONFIG_FILE_PATH
+log_file_path=$1 # e.g. "/etc/archinstall/config.json"
+
+
+mkdir /mnt$(dirname "$log_file_path")
+cp $log_file_path /mnt$log_file_path
echo "Copied archinstall log - OK"
diff --git a/util/create_filesystems.sh b/util/create_filesystems.sh
index 8a58909..8f2341f 100644
--- a/util/create_filesystems.sh
+++ b/util/create_filesystems.sh
@@ -18,8 +18,13 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+boot_partition_path=$1 # e.g. /dev/sda1
+root_partition_path=$2 # e.g. /dev/sda2
+
+
mkfs.fat -F32 $boot_partition_path
-mkfs.ext4 $root_partition_path
fatlabel $boot_partition_path "BOOT"
+mkfs.ext4 $root_partition_path
e2label $root_partition_path "ROOT"
+
echo "Created filesystems - OK"
diff --git a/util/install_archinstall.sh b/util/install_archinstall.sh
index 2b37073..67aee15 100644
--- a/util/install_archinstall.sh
+++ b/util/install_archinstall.sh
@@ -18,6 +18,9 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-cp -r $REPOSITORY_PATH /mnt$REPOSITORY_PATH
+repository_path=$1 # e.g. "/opt/archinstall"
+
+
+cp -r $repository_path /mnt$repository_path
echo "Installed archinstall - OK"
diff --git a/util/install_bootloader.sh b/util/install_bootloader.sh
index 4bf6ab5..29e211f 100644
--- a/util/install_bootloader.sh
+++ b/util/install_bootloader.sh
@@ -18,9 +18,13 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-mount $1 /mnt
+boot_partition_path=$1
+
+
+mount $boot_partition_path /mnt
grub-install --target=x86_64-efi --efi-directory=/mnt --bootloader-id=GRUB \
--removable
grub-mkconfig -o /boot/grub/grub.cfg
-umount $1
+umount $boot_partition_path
+
echo "Installed bootloader - OK"
diff --git a/util/install_packages.sh b/util/install_packages.sh
index 8515675..b56c145 100644
--- a/util/install_packages.sh
+++ b/util/install_packages.sh
@@ -18,8 +18,11 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+desktop_wanted=$1 # e.g. "yes"
+
+
pacstrap /mnt base linux linux-firmware dhcpcd nano sudo grub efibootmgr
-if [ "$desktop" = "yes" ]; then
+if [ "$desktop_wanted" = "yes" ]; then
pacstrap /mnt xorg lightdm lightdm-gtk-greeter xfce4 mousepad
fi
diff --git a/util/mount_filesystems.sh b/util/mount_filesystems.sh
index f426ca2..4bb66e4 100644
--- a/util/mount_filesystems.sh
+++ b/util/mount_filesystems.sh
@@ -18,5 +18,9 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+root_partition_path=$1 # e.g. /dev/sda2
+
+
mount $root_partition_path /mnt
+
echo "Mounted filesystems - OK"
diff --git a/util/partition_disk.sh b/util/partition_disk.sh
index bffe87f..096b1fd 100644
--- a/util/partition_disk.sh
+++ b/util/partition_disk.sh
@@ -18,6 +18,9 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+disk_path=$1 # e.g. /dev/sda
+
+
wipefs -a $disk_path # make sure that fdisk does not ask for removing
# signatures which breaks the script
fdisk $disk_path << EOF
@@ -33,7 +36,5 @@ n
p
w
EOF
-boot_partition_path="${disk_path}1"
-root_partition_path="${disk_path}2"
echo "Partitioned disk - OK"
diff --git a/util/unmount_filesystems.sh b/util/unmount_filesystems.sh
index 95d7101..770a5e7 100644
--- a/util/unmount_filesystems.sh
+++ b/util/unmount_filesystems.sh
@@ -18,5 +18,9 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+root_partition_path=$1 # e.g. /dev/sda2
+
+
cd /root && umount $root_partition_path
+
echo "Unmounted filesystems - OK"
diff --git a/util/write_config.py b/util/write_config.py
index 9545611..72c1c34 100644
--- a/util/write_config.py
+++ b/util/write_config.py
@@ -23,7 +23,7 @@ import json
import subprocess
-config_file_path = sys.argv[1]
+config_file_path = sys.argv[1] # e.g. "/etc/archinstall/config.json"
config = {}
diff --git a/util/write_fstab.sh b/util/write_fstab.sh
index 7321c54..61b1128 100644
--- a/util/write_fstab.sh
+++ b/util/write_fstab.sh
@@ -19,4 +19,5 @@
genfstab -U /mnt >> /mnt/etc/fstab
+
echo "Wrote /etc/fstab - OK"