aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-07-30 01:42:36 +0700
committerShulhan <ms@kilabit.info>2023-02-11 14:23:05 +0700
commit6ab17f6eb52e14e0814cd3e23cd4177ba2d1d7c7 (patch)
tree8c23cb16b9c84a2f475777e3e9f72fdc50ec380f
parent72e264e2ccda60ba1fc1c2e0549f6ad094faa566 (diff)
downloadcompute-archlinux-image-builder-6ab17f6eb52e14e0814cd3e23cd4177ba2d1d7c7.tar.xz
all: use predefined files to configure systemd-repart
-rwxr-xr-xbuild-arch-gce22
-rw-r--r--sys/etc/repart.d/root.conf2
-rw-r--r--sys/etc/systemd/system/systemd-repart.service.d/override.conf2
3 files changed, 14 insertions, 12 deletions
diff --git a/build-arch-gce b/build-arch-gce
index 1fdeb84..affacda 100755
--- a/build-arch-gce
+++ b/build-arch-gce
@@ -92,6 +92,16 @@ print_fstab() {
echo '- Running additional setup in chroot.'
+echo '-- Configuring systemd-repart.'
+
+mkdir -p $mount_dir/etc/repart.d
+cp -f ./sys/etc/repart.d/root.conf \
+ $mount_dir/etc/repart.d/
+
+mkdir -p $mount_dir/etc/systemd/system/systemd-repart.service.d
+cp -f ./sys/etc/systemd/system/systemd-repart.service.d/override.conf \
+ $mount_dir/etc/systemd/system/systemd-repart.service.d/
+
echo '-- Configuring NTP.'
mkdir -p $mount_dir/etc/systemd/timesyncd.conf.d/
cp ./sys/etc/systemd/timesyncd.conf.d/00-google.conf $mount_dir/etc/systemd/timesyncd.conf.d/
@@ -139,18 +149,6 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS'
echo '-- Enabling pacman-init service.'
systemctl --quiet enable pacman-init.service
- echo '-- Configuring systemd-repart.'
- mkdir -p /etc/repart.d
- cat <<-'EOF' > /etc/repart.d/root.conf
- [Partition]
- Type=root
- EOF
- mkdir -p /etc/systemd/system/systemd-repart.service.d
- cat <<-'EOF' > /etc/systemd/system/systemd-repart.service.d/override.conf
- [Unit]
- Before=systemd-growfs@-.service
- EOF
-
echo '-- Enabling google-cloud-ops-agent.service'
systemctl --quiet enable google-cloud-ops-agent.service
diff --git a/sys/etc/repart.d/root.conf b/sys/etc/repart.d/root.conf
new file mode 100644
index 0000000..1aadd2d
--- /dev/null
+++ b/sys/etc/repart.d/root.conf
@@ -0,0 +1,2 @@
+[Partition]
+Type=root
diff --git a/sys/etc/systemd/system/systemd-repart.service.d/override.conf b/sys/etc/systemd/system/systemd-repart.service.d/override.conf
new file mode 100644
index 0000000..50ae1f4
--- /dev/null
+++ b/sys/etc/systemd/system/systemd-repart.service.d/override.conf
@@ -0,0 +1,2 @@
+[Unit]
+Before=systemd-growfs@-.service