RPi-Distro / raspi-config

Configuration tool for the Raspberry Pi
Other
565 stars 206 forks source link

Add optional second argument to `do_overlayfs` to make separate control easier #208

Open cinderblock opened 1 year ago

cinderblock commented 1 year ago

I've been using raspi-config with the nonint option in some scripts.

I noticed with sudo raspi-config nonint do_overlayfs * it is not possible to control the state of the boot fs independently of the root fs, assuming you have rw permissions already.

I think the problem is here

https://github.com/RPi-Distro/raspi-config/blob/0fc1f9552fc99332d57e3b6df20c64576466913a/raspi-config#L2817

Where RET is set to the first argument to the function ($1).

I think it would be a little better if it were to use a second argument that defaults to the same as the first: ${2:-$1}.

Alternatively a shift after the previous ret assignment could work, but I think that would confuse things more than help.