1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__mageia4arm/tools/resize_root.sh
Neal Gompa b4da22f2cf Initial conversion to use DNF
This change makes it so that the ARM image creation script uses DNF
instead of urpmi. This affords several advantages:

1. Mageia images can be created from non-Mageia systems
2. Mageia images can be created from within Mock
3. ARM images can be created from x86_64 hosts
4. Image building can rely on pre-installed repo configurations

This also brings us in line with the Docker image creation process,
which also uses DNF.
2020-01-04 18:06:54 -05:00

33 lines
842 B
Bash
Executable File

#!/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 : dnf install 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