From 2075ce2a4a0db574fe3febc68aecd1545cc37a87 Mon Sep 17 00:00:00 2001 From: Gunnar Wolf Date: Fri, 19 Jul 2019 12:14:51 -0300 Subject: [PATCH] Install and enable set-sysconf --- raspi0w.yaml | 11 ++++++----- raspi2.yaml | 11 ++++++----- raspi3.yaml | 11 ++++++----- set-sysconf.service | 2 +- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/raspi0w.yaml b/raspi0w.yaml index e0759b2..90be261 100644 --- a/raspi0w.yaml +++ b/raspi0w.yaml @@ -96,6 +96,12 @@ steps: install -m 644 -o root -g root eth0 "${ROOT?}/etc/network/interfaces.d/eth0" + install -m 755 -o root -g root set-sysconf "${ROOT?}/usr/local/sbin/set-sysconf" + install -m 644 -o root -g root set-sysconf.service "${ROOT?}/etc/systemd/system" + install -m 644 -o root -g root sysconf.txt "${ROOT?}/boot/firmware/sysconf.txt" + mkdir -p "${ROOT?}/etc/systemd/system/basic.target.requires/" + ln -s /etc/systemd/system/set-sysconf.service "${ROOT?}/etc/systemd/system/basic.target.requires/set-sysconf.service" + install -m 755 -o root -g root rpi-resizerootfs "${ROOT?}/usr/sbin/rpi-resizerootfs" install -m 644 -o root -g root rpi-resizerootfs.service "${ROOT?}/etc/systemd/system" mkdir -p "${ROOT?}/etc/systemd/system/systemd-remount-fs.service.requires/" @@ -107,11 +113,6 @@ steps: rm -f ${ROOT?}/etc/ssh/ssh_host_*_key* cp "${ROOT?}/usr/lib/linux-image-4.19.0.5-rpi/bcm2835-rpi-zero-w.dtb" "${ROOT?}/boot/" - - cat >> "${ROOT?}/etc/motd" <<'EOT' - - Please change the root password by running passwd - EOT root-fs: / # Clean up archive cache (likely not useful) and lists (likely outdated) to diff --git a/raspi2.yaml b/raspi2.yaml index f3a465c..e82d30d 100644 --- a/raspi2.yaml +++ b/raspi2.yaml @@ -94,6 +94,12 @@ steps: install -m 644 -o root -g root eth0 "${ROOT?}/etc/network/interfaces.d/eth0" + install -m 755 -o root -g root set-sysconf "${ROOT?}/usr/local/sbin/set-sysconf" + install -m 644 -o root -g root set-sysconf.service "${ROOT?}/etc/systemd/system" + install -m 644 -o root -g root sysconf.txt "${ROOT?}/boot/firmware/sysconf.txt" + mkdir -p "${ROOT?}/etc/systemd/system/basic.target.requires/" + ln -s /etc/systemd/system/set-sysconf.service "${ROOT?}/etc/systemd/system/basic.target.requires/set-sysconf.service" + install -m 755 -o root -g root rpi-resizerootfs "${ROOT?}/usr/sbin/rpi-resizerootfs" install -m 644 -o root -g root rpi-resizerootfs.service "${ROOT?}/etc/systemd/system" mkdir -p "${ROOT?}/etc/systemd/system/systemd-remount-fs.service.requires/" @@ -105,11 +111,6 @@ steps: rm -f ${ROOT?}/etc/ssh/ssh_host_*_key* wget https://github.com/raspberrypi/firmware/blob/master/boot/bcm2709-rpi-2-b.dtb -O "${ROOT?}/boot/bcm2708-rpi-2-b.dtb" - - cat >> "${ROOT?}/etc/motd" <<'EOT' - - Please change the root password by running passwd - EOT root-fs: / # Clean up archive cache (likely not useful) and lists (likely outdated) to diff --git a/raspi3.yaml b/raspi3.yaml index 503704a..64c8f96 100644 --- a/raspi3.yaml +++ b/raspi3.yaml @@ -96,6 +96,12 @@ steps: install -m 644 -o root -g root eth0 "${ROOT?}/etc/network/interfaces.d/eth0" + install -m 755 -o root -g root set-sysconf "${ROOT?}/usr/local/sbin/set-sysconf" + install -m 644 -o root -g root set-sysconf.service "${ROOT?}/etc/systemd/system" + install -m 644 -o root -g root sysconf.txt "${ROOT?}/boot/firmware/sysconf.txt" + mkdir -p "${ROOT?}/etc/systemd/system/basic.target.requires/" + ln -s /etc/systemd/system/set-sysconf.service "${ROOT?}/etc/systemd/system/basic.target.requires/set-sysconf.service" + install -m 755 -o root -g root rpi-resizerootfs "${ROOT?}/usr/sbin/rpi-resizerootfs" install -m 644 -o root -g root rpi-resizerootfs.service "${ROOT?}/etc/systemd/system" mkdir -p "${ROOT?}/etc/systemd/system/systemd-remount-fs.service.requires/" @@ -105,11 +111,6 @@ steps: mkdir -p "${ROOT?}/etc/systemd/system/multi-user.target.requires/" ln -s /etc/systemd/system/rpi-generate-ssh-host-keys.service "${ROOT?}/etc/systemd/system/multi-user.target.requires/rpi-generate-ssh-host-keys.service" rm -f ${ROOT?}/etc/ssh/ssh_host_*_key* - - cat >> "${ROOT?}/etc/motd" <<'EOT' - - Please change the root password by running passwd - EOT root-fs: / # Clean up archive cache (likely not useful) and lists (likely outdated) to diff --git a/set-sysconf.service b/set-sysconf.service index d053ab4..e8c5df8 100644 --- a/set-sysconf.service +++ b/set-sysconf.service @@ -3,7 +3,7 @@ Description=Set up system configuration [Service] Type=oneshot -ExecStart=/usr/sbin/set-sysconf +ExecStart=/usr/local/sbin/set-sysconf ExecStart=/bin/systemctl --no-reload disable %n [Install]