Skip to content

Instantly share code, notes, and snippets.

@tomtwinkle
Last active February 7, 2021 09:33
Show Gist options
  • Save tomtwinkle/d02d9c2c66457a97752032f778113a63 to your computer and use it in GitHub Desktop.
Save tomtwinkle/d02d9c2c66457a97752032f778113a63 to your computer and use it in GitHub Desktop.
Raspberry Pi rootfs ROM control function
# Raspberry Pi rootfs ROM control function
function rsfsrom() {
case $1 in
"status" )
raspi-config nonint get_overlay_now && echo "enable" || echo "disabled"
;;
"enable" )
sudo raspi-config nonint enable_overlayfs &&
echo -e "rootfs ROM is enable. system reboot required.\n> sudo systemctl reboot"
;;
"disable" )
sudo raspi-config nonint disable_overlayfs &&
echo -e "rootfs ROM is disable. system reboot required.\n> sudo systemctl reboot"
;;
* )
cat << EOS
Raspberry Pi rootfs ROM control
usage: rsfsrom [OPTION]
[OPTION]
status :show rootfs rom status. [enable/disable]
enable :rootfs rom enable,
must be user can "sudo raspi-config",
system reboot required.
disable :rootfs rom disable,
must be user can "sudo raspi-config",
system reboot required.
EOS
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment