Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand sd Card #3

Open
LeonardoGentile opened this issue Jan 12, 2017 · 5 comments
Open

Expand sd Card #3

LeonardoGentile opened this issue Jan 12, 2017 · 5 comments

Comments

@LeonardoGentile
Copy link

You could automate this already, some options are available to pass to raspi-config, for example:
raspi-config --expand-rootfs

@Condla
Copy link
Owner

Condla commented Jan 12, 2017

Thanks for opening the issue. I know, that some of these things can be automated, just didn't add them yet. I'll leave this issue open as a reminder ;)

@LeonardoGentile
Copy link
Author

LeonardoGentile commented Jan 12, 2017

I've posted it here because I've just found out by inspecting the script that we can pass some options to raspi-config (very few) but they are undocumented so I tough it might help ;)
Given it accepts few options in the end we still have to manually run raspi-config in a way or another

@idcrook
Copy link

idcrook commented Jan 25, 2017

just started investigating ansible for setting up raspberry Pis. was gonna roll my own, but might as well start here. 👍

BTW, the source code for raspi-config has few built-in "non-interactive options" as you point out ( https://github.com/RPi-Distro/raspi-config/blob/master/raspi-config#L1439-L1474 )
-- and there is only one additional "supported" option --apply-os-config

However, it looks like any routine in raspi-config can be invoked at the command line using nonint? From the source

for i in $*
do
  case $i in
...
  nonint)
    INTERACTIVE=False
    $@
    ;;

and

nonint() {
    $*
}

And some of them are instrumented to be used that way, while others could be made to work. For example, I tested with:

sudo raspi-config nonint do_hostname rpi2

And it worked! So might be worth exploring further...

@chrowe
Copy link

chrowe commented Feb 12, 2017

It looks like https://github.com/mikolak-net/ansible-raspi-config is already doing this.

@idcrook
Copy link

idcrook commented Feb 12, 2017

I added a few of these raspi-config hooks to my raspi ansible as well https://github.com/idcrook/raspberry-pi-rotary-phone/blob/master/roles/raspbian-maintenance/tasks/raspi-config.yml

Note: Recent versions of Raspbian jessie automatically, upon first boot, perform the resize filesystem task, and reboot themselves, so I've found the expand fs to be no longer necessary for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants