[gnome-build-meta/valentindavid/eos-installer: 2/12] Add first boot script to resize root filesystem
- From: Valentin David <valentindavid src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-build-meta/valentindavid/eos-installer: 2/12] Add first boot script to resize root filesystem
- Date: Wed, 26 Feb 2020 21:14:36 +0000 (UTC)
commit 68841de9dd3b36edbcf0ef0fafce1b701d384d2e
Author: Valentin David <valentin david codethink co uk>
Date: Wed Feb 26 11:25:34 2020 +0100
Add first boot script to resize root filesystem
If the partition has been reallocated during initramfs boot, then this
resizes the root filesystem to use the whole partition.
elements/vm/deps.bst | 1 +
elements/vm/resize-root.bst | 23 +++++++++++++++++++++++
files/vm/resize-root/resize-root.preset | 1 +
files/vm/resize-root/resize-root.service | 11 +++++++++++
4 files changed, 36 insertions(+)
---
diff --git a/elements/vm/deps.bst b/elements/vm/deps.bst
index b38b4235..acda2190 100644
--- a/elements/vm/deps.bst
+++ b/elements/vm/deps.bst
@@ -14,6 +14,7 @@ runtime-depends:
- vm/plymouth-gnome-theme.bst
- vm/kbd.bst
- vm/dev-repo-script.bst
+- vm/resize-root.bst
- freedesktop-sdk.bst:vm/config/pulseaudio.bst
- freedesktop-sdk.bst:vm/config/sudo.bst
diff --git a/elements/vm/resize-root.bst b/elements/vm/resize-root.bst
new file mode 100644
index 00000000..d777ac98
--- /dev/null
+++ b/elements/vm/resize-root.bst
@@ -0,0 +1,23 @@
+kind: manual
+
+sources:
+- kind: local
+ path: files/vm/resize-root/resize-root.service
+- kind: local
+ path: files/vm/resize-root/resize-root.preset
+
+depends:
+- freedesktop-sdk.bst:components/systemd.bst
+
+build-depends:
+- freedesktop-sdk.bst:components/pkg-config.bst
+
+config:
+ install-commands:
+ - |
+ unitdir="$(pkg-config --variable=systemdsystemunitdir systemd)"
+ install -Dm644 -t "%{install-root}${unitdir}" resize-root.service
+
+ - |
+ presetdir="$(pkg-config --variable=systemdsystempresetdir systemd)"
+ install -Dm644 -t "%{install-root}${presetdir}" resize-root.preset
diff --git a/files/vm/resize-root/resize-root.preset b/files/vm/resize-root/resize-root.preset
new file mode 100644
index 00000000..f0a1b5cf
--- /dev/null
+++ b/files/vm/resize-root/resize-root.preset
@@ -0,0 +1 @@
+enable resize-root.service
diff --git a/files/vm/resize-root/resize-root.service b/files/vm/resize-root/resize-root.service
new file mode 100644
index 00000000..c456f3ac
--- /dev/null
+++ b/files/vm/resize-root/resize-root.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Resize root filesystem
+ConditionFirstBoot=yes
+After=sysinit.target local-fs.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/resize2fs /dev/gpt-auto-root
+
+[Install]
+WantedBy=multi-user.target
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]