Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Autoexpand of root file system after image copy - need something better



On Tue, Dec 26, 2017 at 08:59:51AM +0100, Harold Gutch wrote:
> What about making the default /etc/rc.conf on {rpi,armv7}.img test for
> a /boot/rc.conf and source it if it exists (I am not sure if this even
> works, /boot might not be mounted yet at this point), then the user
> can disable automatic resizing by adding resize_{disklabel,root}=NO to
> /boot/rc.conf.

I don't think that this will work, resize_* is run so early in the
boot process that not even mount_critical has run yet.

Instead, I realized that this could be done if we have rc.local run a
script from boot - we then could set resize_{disklabel,root}=NO in the
default /etc/rc.conf and provide a default /boot/rc.netbsd that:

- appends resize_{disklabel,root}=YES to rc.conf
- renames /boot/rc.netbsd (i.e., itself)
- reboots

The default behavior will then be more or less the same as what
happens right now (except that we reboot one more time and the initial
process thus takes a bit longer).

If you don't want the automatic growing to happen and/or if you want
to do the initial setup (add user, set password, set root password,
set network config) but do not have a console available, then rename
or edit /boot/rc.netbsd.

The double boot is a bit hackish, but the upside is that we have one
single place (rc.local) from where stuff from /boot is run.


  Harold


Home | Main Index | Thread Index | Old Index