From a18c6bb409ddaf247633e061b1fa7c32f51de329 Mon Sep 17 00:00:00 2001 From: Jybz Date: Thu, 5 Dec 2019 08:03:01 +0100 Subject: sync7 --- tools/resize_root.sh | 32 ++++++++++++++++++++++++++++++++ tools/resize_root.sh~ | 32 -------------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) create mode 100755 tools/resize_root.sh delete mode 100755 tools/resize_root.sh~ (limited to 'tools') 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 diff --git a/tools/resize_root.sh~ b/tools/resize_root.sh~ deleted file mode 100755 index 99aee12..0000000 --- a/tools/resize_root.sh~ +++ /dev/null @@ -1,32 +0,0 @@ -#!/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 -- cgit v1.2.1