aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Edgecumbe <git@esotericnonsense.com>2019-11-11 04:39:08 +0000
committerDaniel Edgecumbe <git@esotericnonsense.com>2019-11-11 04:39:08 +0000
commit4741495c6c3ae40cb68489875484c02101195978 (patch)
treee9838a1295bd57aebf86891671220d6e3d934b1c
parent71f54246051ae6f9f319f8760c7681c331492923 (diff)
Various fixes; add install_repo
-rwxr-xr-xbuild/main.sh27
-rw-r--r--install/config.sh2
2 files changed, 13 insertions, 16 deletions
diff --git a/build/main.sh b/build/main.sh
index 8a2a8a2..77ec7ce 100755
--- a/build/main.sh
+++ b/build/main.sh
@@ -11,14 +11,13 @@
set -euxo pipefail
script_path=$(dirname "$(readlink -f "${0}")")
+# shellcheck source=config.sh
+source "${script_path}/config.sh"
-iso_name=autoarch
-iso_label=autoarch_$(git rev-parse HEAD --git-dir="${script_path}" | head -c 8)
+iso_label=${iso_name}_$(git rev-parse HEAD --git-dir="${script_path}" | head -c 8)
iso_version=$(git rev-parse HEAD --git-dir="${script_path}" | head -c 8)
install_dir=arch
arch=$(uname -m)
-work_dir=/tmp/archiso-work
-out_dir=/tmp/archiso-out
umask 0022
@@ -67,8 +66,6 @@ EOF
}
make_networking() {
- local iface
- iface="ens1"
cat << EOF > "${work_dir}/airootfs/etc/systemd/network/20-wired.network"
[Match]
Name=${iface}
@@ -84,7 +81,7 @@ EOF
make_pacman_mirrorlist() {
local mirrorlist
mirrorlist="${work_dir}/airootfs/etc/pacman.d/mirrorlist"
- cat "${mirrorlist}" | grep "Server" | sed 's/^#Server/Server/g' | sort -R \
+ grep "Server" "${mirrorlist}" | sed 's/^#Server/Server/g' | sort -R \
> "${mirrorlist}.new"
mv "${mirrorlist}.new" "${mirrorlist}"
}
@@ -99,13 +96,13 @@ make_clone_installer_at_run_time() {
cat << EOF > "${work_dir}/airootfs/root/autorun.sh"
#!/usr/bin/env bash
set -uxo pipefail
-git clone "http://github.com/esotericnonsense/autoarch.git" "\${HOME}/autoarch"
+git clone "${install_repo}" "\${HOME}/autoarch"
bash "\${HOME}/autoarch/install/main.sh"
EOF
}
-make_clone_installer_at_build_time() {
- git clone "https://github.com/esotericnonsense/autoarch.git" "${work_dir}/airootfs/root/autoarch"
+make_local_installer_at_build_time() {
+ cp -a "${script_path}/.." "${work_dir}/airootfs/root/autoarch"
cat << EOF > "${work_dir}/airootfs/root/autorun.sh"
#!/usr/bin/env bash
set -uxo pipefail
@@ -128,11 +125,11 @@ if [[ \$(tty) == "/dev/tty1" ]]; then
fi
EOF
-
- # Option 1
- make_clone_installer_at_run_time
- # Option 2
- #make_clone_installer_at_build_time
+ if [[ -v install_repo ]]; then
+ make_clone_installer_at_run_time
+ else
+ make_local_installer_at_build_time
+ fi
chmod +x "${work_dir}/airootfs/root/autorun.sh"
}
diff --git a/install/config.sh b/install/config.sh
index 027f155..e583ece 100644
--- a/install/config.sh
+++ b/install/config.sh
@@ -6,7 +6,7 @@
# Configuration variables for the autoarch install script.
set -euxo pipefail
-# The ethernet interface used for networking.
+# The ethernet interface used for networking on the installed system.
export iface="ens1"
# The timezone of the installed system.