Permalink
Browse files

Resize Pi on First Boot

  • Loading branch information...
NEMS Linux
NEMS Linux committed Feb 11, 2019
1 parent 08aa2a8 commit 9f34f0f035c0da8c05dbb8ec9b164c80760d56af
Showing with 17 additions and 2 deletions.
  1. +9 −2 nems-cleanup.sh
  2. +8 −0 resize_rootfs/raspi
@@ -213,8 +213,15 @@ nameserver 2001:4860:4860::8844
# Make it so filesystem resizes at first boot
if (( $platform >= 0 )) && (( $platform <= 9 )); then
# Raspberry Pi
# Will use raspi-config during init for now, but should automate this in future
echo "Filesystem will be resized during nems-init."
addition="/root/nems/nems-admin/resize_rootfs/raspi\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
if (( $platform >= 10 )) && (( $platform <= 19 )); then
# ODROID
@@ -0,0 +1,8 @@
#!/bin/bash
# Resize Raspberry Pi on first boot

if (( $platform >= 0 )) && (( $platform <= 9 )); then
/usr/bin/raspi-config --expand-rootfs > /dev/null 2>&1
fi

/bin/sed -i~ '/\/root\/nems\/nems-admin\/resize_rootfs\/raspi/d' /etc/rc.local

0 comments on commit 9f34f0f

Please sign in to comment.