2

I'm preparing an image for download based on Raspbian. I can resize the partition manually using raspi-config. However, I'd prefer this to be automatic during first boot (maybe with a timeout for cancelling if such is possible).

Apparently BerryBoot is able to do this automatically- would appreciate a hint how this is done.

andig
  • 1,077
  • 2
  • 11
  • 12
  • Some googling has found https://github.com/billw2/rpi-clone/blob/master/rpi-clone which contains shell code to do part of the work using parted. – andig Feb 26 '15 at 16:34

1 Answers1

0
  1. make yourself a script that deletes or disables itself after first run (init for background or .profile for foreground)
grep -v custom_script.sh ~/.profile > ~/.profile.new && mv ~/.profile.new ~/.profile
  1. extract the bits you want from raspi-config (line 36 to to 116)
> file $(which raspi-config)
/usr/bin/raspi-config: POSIX shell script, ASCII text executable
user1133275
  • 2,216
  • 15
  • 31