aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJybz <j.biernacki@free.fr>2019-12-05 07:51:14 +0100
committerJybz <j.biernacki@free.fr>2019-12-05 07:51:14 +0100
commit6bd962556291bb122fab1024795c74b27fc1c470 (patch)
treeac1c0448797bb60af080b42aaa348d5d8463e81a /tools
parent2a82e889e8fc50d72be705ded4a50292c02b38b0 (diff)
downloadmageia4arm-6bd962556291bb122fab1024795c74b27fc1c470.tar
mageia4arm-6bd962556291bb122fab1024795c74b27fc1c470.tar.gz
mageia4arm-6bd962556291bb122fab1024795c74b27fc1c470.tar.bz2
mageia4arm-6bd962556291bb122fab1024795c74b27fc1c470.tar.xz
mageia4arm-6bd962556291bb122fab1024795c74b27fc1c470.zip
sync
Diffstat (limited to 'tools')
-rwxr-xr-xtools/resize_root.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/resize_root.sh b/tools/resize_root.sh
new file mode 100755
index 0000000..99aee12
--- /dev/null
+++ b/tools/resize_root.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+DEVICE="/dev/mmcblk0"
+ROOT_PARTITION="${DEVICE}p1"
+ROOT_PARTITION="1"
+
+echo "Warning : this an early version to resize the root partition. Check the source code to ensure what you are doing."
+if [ ${1} = "force" ]; then
+ #Check dependency
+ hash growpart
+ if [ ${?} -ne 0 ]; then
+ echo "install cloud-utils-growpart first. Hint : urpmi cloud-utils-growpart"
+ exit 1
+ fi
+
+ #Check the partition :
+ e2fsck -f ${ROOT_PARTITION}
+
+ #Change the size : BUG: app doesn't support "octet".
+ LC_ALL=C growpart ${DEVICE} ${ROOT_PARTITION}
+
+ #Resize the partition with the new size :
+ resize2fs ${ROOT_PARTITION}
+
+ #Sync (just to be sure)
+ sync
+else
+ echo "If you read the source code, you should not have read that message... Exiting with out touching the partition."
+fi
+
+#Quit
+exit 0