From 23d6139c4730960d2851920e94d6de21a200d8dc Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 4 Apr 2016 13:34:23 +0200 Subject: [PATCH 1/8] add NTP options to example file --- config_build.sh.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config_build.sh.example b/config_build.sh.example index 1582842..3e0ac66 100755 --- a/config_build.sh.example +++ b/config_build.sh.example @@ -16,3 +16,5 @@ export DHCP_EXTRACT='/usr/local/bin/extract_archiso' export ISO_MIRROR='http://internal-mirror.local/$repo/os/$arch' export ISO_NFSSERVER='10.30.7.40' export ISO_ROOTHASH='*' +export ISO_NTP='true' +export ISO_NTPSERVER='0.pool.ntp.org europe.pool.ntp.org north-america.pool.ntp.org' From 19ad8fdc7865ebc97337f0feb55fd4c2cec98096 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 4 Apr 2016 13:35:16 +0200 Subject: [PATCH 2/8] disable shellcheck (false positive check) --- airootfs/root/customize_airootfs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh index 5f87ce3..fe0c7c6 100755 --- a/airootfs/root/customize_airootfs.sh +++ b/airootfs/root/customize_airootfs.sh @@ -9,6 +9,7 @@ config='/root/config_build.sh' if [ -n "$config" ] && [ -e "$config" ]; then # source and remove config, could contain sensitive information and we don't want to ship it in the ISO + # shellcheck disable=SC1090 . "${config}" rm "${config}" else From d1e4e4f50a803bb76ee76fd36304c0dcfd25aab4 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 4 Apr 2016 13:55:22 +0200 Subject: [PATCH 3/8] add option to enable NTP --- airootfs/root/customize_airootfs.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh index fe0c7c6..d555b62 100755 --- a/airootfs/root/customize_airootfs.sh +++ b/airootfs/root/customize_airootfs.sh @@ -73,3 +73,15 @@ rm /tmp/shadow.tmp # use the resolv.conf from systemd-resolved.service umount /etc/resolv.conf ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf + +# check if we want NTP +if [ "$ISO_NTP" = "true" ]; then + if [ -n "$ISO_NTPSERVER" ]; then + sed -i "s/#NTP=/NTP=$ISO_NTPSERVER/" /etc/systemd/timesyncd.conf + fi + # this may break because we are in a chroot + timedatectl set-ntp on + + # set hardwareclock to UTC + timedatectl set-local-rtc 0 +fi From 6b2cb833fecf02d0b49d8e3a0ca167eaf04796cc Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 4 Apr 2016 14:04:31 +0200 Subject: [PATCH 4/8] disable SC2163 (false positive) --- airootfs/root/.automated_script.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/airootfs/root/.automated_script.sh b/airootfs/root/.automated_script.sh index 1154490..ebaec3d 100755 --- a/airootfs/root/.automated_script.sh +++ b/airootfs/root/.automated_script.sh @@ -31,6 +31,7 @@ automated_script () if [[ $(tty) == "/dev/tty1" ]]; then cmdline="$(cat /proc/cmdline)" + # shellcheck disable=SC2163 for i in $cmdline; do case "$i" in HASH=*) export "$i";; esac; done if [ -n "$HASH" ]; then grep -v "^root" /etc/shadow > /tmp/shadow.tmp From fa91801f7c243b155a20be600ee6881e031b8cd6 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 6 Apr 2016 17:47:10 +0200 Subject: [PATCH 5/8] add missing whitespace --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d288de3..3582494 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ You check out this project on your local computer, modify the config to your nee * Copy `config_build.sh.example` to `config_build.sh` * Copy `config_live.sh.example` to `config_live.sh` * add Arch entry to your pxelinux config, see `ext/pxelinux_config` -* Update the variables to your needs (see[configuration](#configuration)) +* Update the variables to your needs (see [configuration](#configuration)) * install the archiso tools with: `pacman -Syu archiso` * run `rebuild_and_copy.sh` From 216ad29d60af652676c92fcaad3a6fb784451c37 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 21 Apr 2016 11:46:01 +0200 Subject: [PATCH 6/8] remove useless umount action this is nothing that you could umount --- airootfs/root/customize_airootfs.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh index d555b62..58e1818 100755 --- a/airootfs/root/customize_airootfs.sh +++ b/airootfs/root/customize_airootfs.sh @@ -71,7 +71,6 @@ cat /tmp/shadow.tmp >> /etc/shadow rm /tmp/shadow.tmp # use the resolv.conf from systemd-resolved.service -umount /etc/resolv.conf ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf # check if we want NTP From ca0e847e54138dcd66904d900ede84e35a04a44a Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 21 Apr 2016 12:40:18 +0200 Subject: [PATCH 7/8] use subdir instead of fiddeling in the default conf --- airootfs/root/customize_airootfs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh index 58e1818..009e6e2 100755 --- a/airootfs/root/customize_airootfs.sh +++ b/airootfs/root/customize_airootfs.sh @@ -76,7 +76,8 @@ ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf # check if we want NTP if [ "$ISO_NTP" = "true" ]; then if [ -n "$ISO_NTPSERVER" ]; then - sed -i "s/#NTP=/NTP=$ISO_NTPSERVER/" /etc/systemd/timesyncd.conf + mkdir /etc/systemd/timesyncd.conf.d/ + echo -e "[Time]\nNTP=\nNTP=$ISO_NTPSERVER" > /etc/systemd/timesyncd.conf.d/ntp.conf fi # this may break because we are in a chroot timedatectl set-ntp on From 9810b48ebe4895565602a75c9ae9391bc6967c96 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 21 Apr 2016 14:57:58 +0200 Subject: [PATCH 8/8] enable systemd-timesyncd --- airootfs/root/customize_airootfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh index 009e6e2..dbde6cd 100755 --- a/airootfs/root/customize_airootfs.sh +++ b/airootfs/root/customize_airootfs.sh @@ -40,7 +40,7 @@ sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' /etc/systemd/logind.conf sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' /etc/systemd/logind.conf sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' /etc/systemd/logind.conf -systemctl enable pacman-init.service choose-mirror.service systemd-networkd.service systemd-resolved.service sshd.service +systemctl enable pacman-init.service choose-mirror.service systemd-networkd.service systemd-resolved.service systemd-timesyncd.service sshd.service systemctl set-default multi-user.target # they are broken and nobody needs them