Permalink
Browse files

Move Rock64 to 2-stage resizer

  • Loading branch information...
NEMS Linux
NEMS Linux committed Aug 27, 2018
1 parent 0a3de37 commit 5d946f162c90f962b0f4734793de3d2537638fda
Showing with 44 additions and 53 deletions.
  1. +1 −1 nems-cleanup.sh
  2. +1 −1 resize_rootfs/odroid-stage1
  3. +0 −51 resize_rootfs/rock64
  4. +35 −0 resize_rootfs/rock64-stage1
  5. +7 −0 resize_rootfs/rock64-stage2
@@ -226,7 +226,7 @@ nameserver 2001:4860:4860::8844
fi
if (( $platform = 43 )); then
# ROCK64
addition="/root/nems/nems-admin/resize_rootfs/rock64\n"
addition="/root/nems/nems-admin/resize_rootfs/rock64-stage1\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
@@ -5,7 +5,7 @@ BOOTDEVICE=`ls -l /dev/disk/by-uuid/ | grep 96C3-9298 | awk '{print $11}' | sed
function do_resize
{
# this takes in consideration /dev/mmcblk1p2 as the rootfs!
rsflog=/root/resize-$DATE-log.txt
rsflog=/var/log/nems/resize-$DATE.log
echo "Saving the log to $rsflog"
sleep 4

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,35 @@
#!/bin/bash
BOOTDEVICE=mmcblk1
PARTITION=7
PLATFORM=rock64 # Must match the filename $PLATFORM-stage#
function do_resize
{
rsflog=/var/log/nems/resize-$DATE.log
echo "Saving the log to $rsflog"
sleep 4
start=`/sbin/fdisk -l /dev/$BOOTDEVICE | grep ${BOOTDEVICE}p${PARTITION} | awk '{print $2}'`
end=$(((`/sbin/fdisk -l /dev/$BOOTDEVICE | head -n1 | grep -i bytes | awk '{print $5}'`/512)-20))
echo $end
/sbin/fdisk /dev/$BOOTDEVICE <<EOF &>> $rsflog
p
d
$PARTITION
n
p
$PARTITION
$start
$end
p
w
EOF
sync && sync
sed -i "s,/root/nems/nems-admin/resize_rootfs/"'${PLATFORM}'"-stage1,/root/nems/nems-admin/resize_rootfs/"'${PLATFORM}'"-stage2,g" "/etc/rc.local"
echo > /etc/udev/rules.d/70-persistent-net.rules
}
do_resize
sync
reboot
@@ -0,0 +1,7 @@
#!/bin/bash
BOOTDEVICE=mmcblk1
PARTITION=7
PLATFORM=rock64 # Must match the filename $PLATFORM-stage#
/sbin/resize2fs /dev/${BOOTDEVICE}p${PARTITION}
sed -i "s,/root/nems/nems-admin/resize_rootfs/"'${PLATFORM}'"-stage2,,g" /etc/rc.local

0 comments on commit 5d946f1

Please sign in to comment.