aboutsummaryrefslogtreecommitdiff
diff options
from:
to:
context:
space:
mode:
authorGravatar Andrea Bolognani <abologna@redhat.com> 2025-01-24 14:12:12 +0100
committerGravatar Andrea Bolognani <abologna@redhat.com> 2025-01-24 16:23:26 +0100
commitd33836e5605d348810f0df4aa0729f736c64ba68 (patch)
tree22e4631f81e1d8f0c105ee0598a5e50a1436ebe8
parent9fed79138a6d88563fc9683e0ac63b3c56e56028 (diff)
downloadkiwi-descriptions-d33836e5605d348810f0df4aa0729f736c64ba68.tar.gz
kiwi-descriptions-d33836e5605d348810f0df4aa0729f736c64ba68.zip
config: Resize root partition on first boot
Disk images are usually flashed to media which is much larger than they are, and all that additional space goes unused until the user intervenes. Configure things so that systemd-repart, which runs by default, automatically takes care of resizing the root partition. systemd-growfs, which also runs by default, will subsequently take care of resizing the filesystem to fill the newly-enlarged partition. Note that we don't do this for cloud images, since in that case cloud-init takes care of resizing the root filesystem and the underlying partition together with all the other setup tasks. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
-rwxr-xr-xconfig.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/config.sh b/config.sh
index 74ce9f6..fb10431 100755
--- a/config.sh
+++ b/config.sh
@@ -44,6 +44,18 @@ if [[ "$kiwi_profiles" != *"Container"* ]] && [[ "$kiwi_profiles" != *"FEX"* ]];
fi
#======================================
+# Resize root partition on first boot
+#--------------------------------------
+
+if [[ "$kiwi_profiles" == *"Disk"* ]]; then
+ mkdir -p /etc/repart.d/
+ cat > /etc/repart.d/50-root.conf << EOF
+[Partition]
+Type=root
+EOF
+fi
+
+#======================================
# Delete & lock the root user password
#--------------------------------------
if [[ "$kiwi_profiles" == *"Cloud"* ]] || [[ "$kiwi_profiles" == *"Disk"* ]] || [[ "$kiwi_profiles" == *"Live"* ]]; then