1
1
mirror of https://github.com/OpenVoiceOS/OpenVoiceOS synced 2025-01-08 07:28:11 +01:00
OpenVoiceOS/buildroot-external/rootfs-overlay/etc/init.d/init_resize.sh
Peter Steenbergen 55846e484a MycroftOS: Implementation of a very first initial bootable version
- Add Buildroot patches to downgrade / upgrade package dependencies
  in line with the Mycroft A.I. software stack requirements.
- Add buildroot additional package dependencies in line with the
  Mycroft A.I. software stack requirements.
- Update rpi3 defconfig file.
- Implement initial root_fs overlay filestructure.
- Addition of some quick and dirty helper scripts.
- Update of README to reflect these changes.
2018-10-30 15:55:12 +01:00

32 lines
645 B
Bash

#!/bin/bash
set -e
mount -t proc proc /proc
mount -t sysfs sys /sys
mount -t tmpfs tmp /run
mount /boot
mount / -o remount,rw
sed -i 's| init=/etc/init.d/init_resize.sh||' /boot/cmdline.txt
sync
DEVICE="/dev/mmcblk0"
PARTNR="p2"
CURRENTSIZEB=`fdisk -l $DEVICE$PARTNR | grep "Disk $DEVICE$PARTNR" | cut -d' ' -f5`
CURRENTSIZE=`expr $CURRENTSIZEB / 1024 / 1024`
MAXSIZEMB=`printf %s\\n 'unit MB print list' | parted | grep "Disk ${DEVICE}" | cut -d' ' -f3 | tr -d MB`
echo "[ok] applying resize operation.."
parted ${DEVICE} resizepart ${PARTNR} ${MAXSIZEMB}
echo "[done]"
partprobe $DEVICE
umount /boot
mount / -o remount,ro
sync
reboot