All Projects → chesty → Overlayroot

chesty / Overlayroot

Licence: gpl-2.0
mounts an overlay file system over root

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Overlayroot

Cattlepi
effortlessly boot, configure, update and monitor your raspberry pi ☁️
Stars: ✭ 250 (+140.38%)
Mutual labels:  raspberry-pi, boot
Debootstick
Generate a bootable live image from any Debian/Ubuntu filesystem tree.
Stars: ✭ 48 (-53.85%)
Mutual labels:  raspberry-pi, boot
Chromium os Raspberry pi
Build your Chromium OS for Raspberry Pi 3B/3B+/4B and Pi400
Stars: ✭ 1,156 (+1011.54%)
Mutual labels:  raspberry-pi, overlay
Wifimeshraspberrypi
Workshop to create a sensor application over a WiFi Mesh network
Stars: ✭ 99 (-4.81%)
Mutual labels:  raspberry-pi
Iotpos
IotPOS, an open source Point of Sale software.
Stars: ✭ 99 (-4.81%)
Mutual labels:  raspberry-pi
Vosk Api
Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Stars: ✭ 1,357 (+1204.81%)
Mutual labels:  raspberry-pi
Spokestack Python
Spokestack is a library that allows a user to easily incorporate a voice interface into any Python application.
Stars: ✭ 103 (-0.96%)
Mutual labels:  raspberry-pi
Nintimdo Rp
Raspberry Pi Gaming Console
Stars: ✭ 98 (-5.77%)
Mutual labels:  raspberry-pi
Create
Software for the HifiBerry/BeoCreate Re-Create project for upcycling vintage loudspeakers
Stars: ✭ 103 (-0.96%)
Mutual labels:  raspberry-pi
Cirnos
Bringing the workflow of Arduino to the Raspberry Pi
Stars: ✭ 101 (-2.88%)
Mutual labels:  raspberry-pi
Scroll Phat
Library and examples for Scroll pHAT. 11x5 LEDs of goodness!
Stars: ✭ 100 (-3.85%)
Mutual labels:  raspberry-pi
Swift Arm64
Swift for Arm64/aarch64 Servers and SBC's - Rock64, RaspberryPi3 and many more
Stars: ✭ 100 (-3.85%)
Mutual labels:  raspberry-pi
Piclodio3
Raspberry Pi Clock Radio
Stars: ✭ 101 (-2.88%)
Mutual labels:  raspberry-pi
Jagcs
Just another ground control station
Stars: ✭ 99 (-4.81%)
Mutual labels:  raspberry-pi
Movel
Móvel - Dashboard for Raspberry pi car computer
Stars: ✭ 103 (-0.96%)
Mutual labels:  raspberry-pi
Prolink Tools
User friendly tools for accessing and using PRO DJ LINK information.
Stars: ✭ 97 (-6.73%)
Mutual labels:  overlay
Iotstack
docker stack for getting started on IOT on the Raspberry PI
Stars: ✭ 1,383 (+1229.81%)
Mutual labels:  raspberry-pi
Automation Hat
Python library and examples for the Pimoroni Automation HAT, pHAT and HAT Mini
Stars: ✭ 100 (-3.85%)
Mutual labels:  raspberry-pi
Fas
C Pixels-based graphical audio synthesizer implemented as a WebSocket server
Stars: ✭ 100 (-3.85%)
Mutual labels:  raspberry-pi
React Native Loading Spinner Overlay
💈 React Native loading spinner overlay
Stars: ✭ 1,369 (+1216.35%)
Mutual labels:  overlay

overlayroot

mounts an overlay filesystem over the root filesystem

I use this for my Raspberry Pi, but it should work on any Debian or derivative.

The root file system on the sd-card is mounted read-only on /overlay/lower, and / is a read-write copy on write overlay.

There are two sets of instructions below: Raspbian and Ubuntu for ARM.

Raspbian

It uses initramfs. Stock Raspbian doesn't use one so step one would be to get initramfs working. Something like:

sudo mkinitramfs -o /boot/init.gz

Add to /boot/config.txt

initramfs init.gz

Test the initramfs works by rebooting. It should boot as normal.

Add the following line to /etc/initramfs-tools/modules

overlay

Copy the following files

  • hooks-overlay to /etc/initramfs-tools/hooks/
  • init-bottom-overlay to /etc/initramfs-tools/scripts/init-bottom/

install busybox

sudo apt-get install busybox

then rerun

sudo mkinitramfs -o /boot/init.gz

Now skip down to all distributions to finish the installation.

Ubuntu for ARM

Add the following line to /etc/initramfs-tools/modules

overlay

Copy the following files

  • hooks-overlay to /etc/initramfs-tools/hooks/
  • init-bottom-overlay to /etc/initramfs-tools/scripts/init-bottom/

install busybox-static

sudo apt-get install busybox-static

then run

sudo update-initramfs -k $(uname -r) -u

Now continue to all distributions to finish the installation.

all distributions

add to .bashrc

if [ ! -z "${IMCHROOTED}" ]; then
        PS1="chroot(${IMCHROOTED})\w:# "
fi

After rebooting, the root filesystem should be an overlay. If it's on tmpfs any changes made will be lost after a reboot. If you want to upgrade packages, for example, run rootwork, the prompt should change to

chroot(/overlay/lower)/:#

You're now making changes to the sdcard, and changes will be permanent.

I use rootwork to work on the real root filesystem. I put it in ~/bin and add ~/bin to my path.

The /run directory is problematic to umount, so atm rootwork --rbind mounts it on the sd-card root file system, /overlay/lower, and it isn't umounted like /boot /proc /sys and /dev are.

After you've finished working on the sd-card run exit. rootwork tries to clean up by umounting all the mounts it mounted and remount /overlay/lower read-only, but often it can't due to an open file or something else causing the filesystem to be busy. It's probably a good idea to reboot now for 2 reasons:

  • leaving /overlay/lower read-write could cause file corruption on power loss.
  • to test it still boots ok after the changes you've just made.

Whenever the kernel is updated, for Raspbian you need to rerun

sudo mkinitramfs -o /boot/init.gz

and for Ubuntu for ARM

sudo update-initramfs -k $(uname -r) -u

TODO: see if there's a hook to automatically run sudo mkinitramfs -o /boot/init.gz on kernel install

There are comments in some of the files you might want to read and that's about it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].