summaryrefslogtreecommitdiffstats
path: root/projectroot/etc/rc.once.d/repart
diff options
context:
space:
mode:
Diffstat (limited to 'projectroot/etc/rc.once.d/repart')
-rwxr-xr-xprojectroot/etc/rc.once.d/repart9
1 files changed, 9 insertions, 0 deletions
diff --git a/projectroot/etc/rc.once.d/repart b/projectroot/etc/rc.once.d/repart
new file mode 100755
index 0000000..c84ab31
--- /dev/null
+++ b/projectroot/etc/rc.once.d/repart
@@ -0,0 +1,9 @@
+#!/bin/sh
+if rdev | grep -q '/dev/hd.*[0-9]\|/dev/mmcblk.*[0-9]\|/dev/sd.*[0-9]\|/dev/vd.*[0-9])'; then
+ echo "Repartitioning the root disk..."
+ systemd-repart --dry-run=no --definitions=/etc/repart.rc-once.d/
+else
+ # root is not on a partitionable disk; probably running in qemu or initrd
+ echo "Note: no root device or root not on a disk, not running systemd-repart"
+ exit 0
+fi