* tinker: initial support * Fix info * Fix uboot defconfig * Split kernel config * Fix name * Add post-image * Init different boot * Add SPL images * Dynamic rauc config * Support SPL for OTA * Fix expand script style * Fix SPL * Bump build u-boot * Cleanup * Add cmd for scritps * Use kernel from armbian * Fix u-boot * Add bluetooth support * Fix bt * Fix env * Change uart debug like rpi * move config
27 lines
836 B
Bash
Executable File
27 lines
836 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
DEVICE_CHILD="$(findfs LABEL="hassos-data")"
|
|
DEVICE_ROOT="/dev/$(lsblk -no pkname ${DEVICE_CHILD})"
|
|
PART_NUM="$(sgdisk -p ${DEVICE_ROOT} | awk '/hassos-data/ { print $1 }')"
|
|
|
|
# Need resize
|
|
if [ $(sgdisk -E ${DEVICE_ROOT}) -le 2048 ]; then
|
|
echo "[INFO] No resize of data partition needed"
|
|
exit
|
|
fi
|
|
|
|
# Resize & Reload partition
|
|
echo "[INFO] Update hassos-data partition ${PART_NUM}"
|
|
sgdisk -e ${DEVICE_ROOT}
|
|
sgdisk -d ${PART_NUM} -n ${PART_NUM}:0:0 -c ${PART_NUM}:"hassos-data" -t ${PART_NUM}:"0FC63DAF-8483-4772-8E79-3D69D8477DE4" -u ${PART_NUM}:"a52a4597-fa3a-4851-aefd-2fbe9f849079" ${DEVICE_ROOT}
|
|
sgdisk -v ${DEVICE_ROOT}
|
|
partx -u ${DEVICE_ROOT}
|
|
|
|
# Resize filesystem
|
|
echo "[INFO] Resize hassos-data filesystem"
|
|
e2fsck -y ${DEVICE_CHILD}
|
|
resize2fs -f ${DEVICE_CHILD}
|
|
|
|
echo "[INFO] Finish hassos-data resizing"
|