Permalink
Browse files

Rock64 not compatible with Pine64 expand fs - fix

  • Loading branch information...
NEMS Linux
NEMS Linux committed Aug 26, 2018
1 parent 4a8621d commit a1b17d12de427a014eabfd2d0a482897bab02863
Showing with 65 additions and 1 deletion.
  1. +14 −1 nems-cleanup.sh
  2. +51 −0 resize_rootfs/rock64
@@ -224,7 +224,20 @@ nameserver 2001:4860:4860::8844
# Also a bit of extra cleanup on the ODROID:
rm -rf /root/scripts
fi
if (( $platform >= 40)) && (( $platform <= 49 )); then
if (( $platform = 43 )); then
# ROCK64
addition="/root/nems/nems-admin/resize_rootfs/rock64\n"
if grep -q "exit" /etc/rc.local; then
# This file contains an exit command, so make sure our new command comes before it
/bin/sed -i -- 's,exit,'"$addition"'exit,g' /etc/rc.local
else
# No exit command within the file, so just add it
echo "PLACEHERE" >> /etc/rc.local
/bin/sed -i -- 's,PLACEHERE,'"$addition"'exit 0,g' /etc/rc.local
fi
fi
fi
if (( $platform = 44 )); then
# PINE64
addition="/root/nems/nems-admin/resize_rootfs/pine64\n"
if grep -q "exit" /etc/rc.local; then
@@ -0,0 +1,51 @@
#!/bin/sh
#FROM: https://github.com/longsleep/build-pine64-image/blob/master/simpleimage/platform-scripts/resize_rootfs.sh
# The version included in the XU4 Stretch distro /root/scripts/resize is much sexier. Eventually integrate.
#The MIT License (MIT)
#Copyright (c) 2016 Simon Eisenmann <simon@longsleep.org>
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
set -e
if [ "$(id -u)" -ne "0" ]; then
echo "This script requires root."
exit 1
fi
set -x
DEVICE="/dev/mmcblk0"
PART="7"
resize() {
start=$(fdisk -l ${DEVICE}|grep ${DEVICE}p${PART}|awk '{print $2}')
echo $start
set +e
fdisk ${DEVICE} <<EOF
p
d
2
n
p
2
$start
w
EOF
set -e
partx -u ${DEVICE}
resize2fs ${DEVICE}p${PART}
}
resize
echo "Done!"
sed -i "s,/root/nems/nems-admin/resize_rootfs/rock64,,g" /etc/rc.local

0 comments on commit a1b17d1

Please sign in to comment.