Giter VIP home page Giter VIP logo

liveroot's Introduction

liveroot

Initcpio hooks for overlayfs ontop of root

Tired of the slow I/O when running Linux on a USB OS? Liveroot greatly speeds up USB based Linux by writing to ram instead of to the USB. Flushing the ram to the USB stick can be controlled by the user by calling /usr/bin/overlay_flush.

Liveroot has 3 modes of operation that can be triggered by adding to the kernel cmdline:

Option Use
oroot=raw use a tmpfs overlay
oroot=compressed use a lzo compressed zram overlay
oroot=live load root into a lzo compressed ram overlay

You will want to move these files to the appropriate directory:

In Repo On Root
initcpio/hooks/oroot /usr/lib/initcpio/hooks/oroot
initcpio/install/oroot /usr/lib/initcpio/install/oroot

Add oroot to the hooks array of /etc/mkinitcpio.conf (after udev and possibly encrypt) and run # mkinitcpio -p linux to run oroot at boot.

*In addition, liveroot now has a compiler that can create a more customized liveroot script. If you pass "btrfs" to the compiler it'll produce a version of liveroot that uses btrfs snapshotting abilities for overlay_flush. Note, to use the btrfs mode, you will need to have a a btrfs root and a subvolume at /snapshots for snapshots. To use the compiler : chmod u+x compiler ./compiler or ./compiler btrfsP This will generate two files: oroot, oroot_install

You will want to move these files to the appropriate directory :

In Repo On Root
oroot /usr/lib/initcpio/hooks/oroot
oroot_install /usr/lib/initcpio/install/oroot

LiveRootSafety

Unmounts /boot when running in ram, and overwrites /etc/motd with a message about the device on which the root filesystem is mounted. This is important if /boot is a distinct mount point e.g. an efi partition. It takes no action if /boot is not a distinct mount point.

This is a safety measure to make sure running pacman -Syu when booted into ram doesn't leave the system partially updated (or broken).

Compile the code in liverootsafety e.g.

go build -ldflags="-s -w" -v

Drop the binary into /usr/local/bin and deploy the systemd targets.

liveroot's People

Contributors

bluerider avatar ianbashford avatar mmellison avatar arcmags avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.