[gnome-build-meta/valentindavid/rock64: 4/9] vm: Make resize root work on non EFI compliant systems
- From: Valentin David <valentindavid src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-build-meta/valentindavid/rock64: 4/9] vm: Make resize root work on non EFI compliant systems
- Date: Thu, 7 May 2020 21:59:28 +0000 (UTC)
commit 26b971a61ffe5806a14e0b0dddabe00b2e6cb606
Author: Valentin David <valentin david codethink co uk>
Date: Thu May 7 12:50:31 2020 +0200
vm: Make resize root work on non EFI compliant systems
elements/vm/resize-root.bst | 4 ++++
files/vm/resize-root/resize-root.service | 2 +-
files/vm/resize-root/resize-root.sh | 10 ++++++++++
3 files changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/elements/vm/resize-root.bst b/elements/vm/resize-root.bst
index d777ac98..b6c59511 100644
--- a/elements/vm/resize-root.bst
+++ b/elements/vm/resize-root.bst
@@ -5,6 +5,8 @@ sources:
path: files/vm/resize-root/resize-root.service
- kind: local
path: files/vm/resize-root/resize-root.preset
+- kind: local
+ path: files/vm/resize-root/resize-root.sh
depends:
- freedesktop-sdk.bst:components/systemd.bst
@@ -14,6 +16,8 @@ build-depends:
config:
install-commands:
+ - install -Dm755 resize-root.sh "%{install-root}%{bindir}/resize-root"
+
- |
unitdir="$(pkg-config --variable=systemdsystemunitdir systemd)"
install -Dm644 -t "%{install-root}${unitdir}" resize-root.service
diff --git a/files/vm/resize-root/resize-root.service b/files/vm/resize-root/resize-root.service
index c456f3ac..b4bfdc86 100644
--- a/files/vm/resize-root/resize-root.service
+++ b/files/vm/resize-root/resize-root.service
@@ -5,7 +5,7 @@ After=sysinit.target local-fs.target
[Service]
Type=oneshot
-ExecStart=/usr/bin/resize2fs /dev/gpt-auto-root
+ExecStart=/usr/bin/resize-root
[Install]
WantedBy=multi-user.target
diff --git a/files/vm/resize-root/resize-root.sh b/files/vm/resize-root/resize-root.sh
new file mode 100644
index 00000000..ad902d13
--- /dev/null
+++ b/files/vm/resize-root/resize-root.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+root="$(awk '{ if ($2 == "/") print $1 }' /proc/mounts)"
+
+if [ -z "${root}" ]; then
+ echo "Root device not found" 1>&2
+ exit 1
+fi
+
+exec /usr/bin/resize2fs "${root}"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]