summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-03-03 03:15:35 -0500
committerAndrew Cady <d@cryptonomic.net>2021-03-03 03:15:35 -0500
commit5bf743c7f970d228a24b770d1c87dd398e42e4ee (patch)
tree346b93b8efad5a84c6bc27b71cb2a7a43567fb63
parent60f81e1cd5b9c7f4c3249f1f6e6f2d62d70e6e11 (diff)
automatically make the boot medium ejectable
-rw-r--r--src/initrd/btrfs-create.sh2
-rw-r--r--src/initrd/firstboot.service10
2 files changed, 12 insertions, 0 deletions
diff --git a/src/initrd/btrfs-create.sh b/src/initrd/btrfs-create.sh
index cb415ab..cea4c29 100644
--- a/src/initrd/btrfs-create.sh
+++ b/src/initrd/btrfs-create.sh
@@ -211,6 +211,8 @@ initialize_root_filesystem()
211 # the initrd. 211 # the initrd.
212 cp /bin/mdadm-dup.sh /root/sbin/ 212 cp /bin/mdadm-dup.sh /root/sbin/
213 cp /bin/samizdat-eject.sh /root/sbin/ 213 cp /bin/samizdat-eject.sh /root/sbin/
214 cp /bin/firstboot.service /root/etc/systemd/system/
215 ln -s /etc/systemd/system/firstboot.service /root/etc/systemd/system/multi-user.target.wants/
214 216
215 sed -i -e 's/^root:x:/root::/' /root/etc/passwd 217 sed -i -e 's/^root:x:/root::/' /root/etc/passwd
216 cp /patchroot/* /root/root/ 218 cp /patchroot/* /root/root/
diff --git a/src/initrd/firstboot.service b/src/initrd/firstboot.service
new file mode 100644
index 0000000..3b7e602
--- /dev/null
+++ b/src/initrd/firstboot.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=Samizdat - Samizdat Eject - Ejects the install source medium. Initiates copy of the rootfs to destination medium.
3After=network.target
4
5[Service]
6Type=oneshot
7ExecStart=/bin/btrfs device remove 1 2 /
8
9[Install]
10WantedBy=multi-user.target