GithubHelp home page GithubHelp logo

xargonwan / qbert Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 2.0 34 KB

Qbert generates a root overlay where you can install whatever software you need without messing your filesystem

License: GNU General Public License v3.0

Shell 100.00%

qbert's Introduction

RetroDECK Icon Xargon's GitHub stats

GitHub Contribution Snake

qbert's People

Contributors

xargonwan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qbert's Issues

Reboot and Update Survivability

To make the Script run on every boot we have a few Options:

As this is an Filesystem Overlay we want it up as soon as possible on boot to avoid issues.
The best would be fstab. This would require the the Script to use sudo.
/etc is not part of the read-only file system and thus survives Updates. My pacman.conf with added chaotic-aur is proof of that.

Second, root-less option would be .bashrc or .bash_profile.
Just keep in mind that load order of things is important here as we need to run qbert as soon as possible. Things that hook into rendering like vkBaslat could lead to a Gamescope crash if the required layer cannot be loaded when DeckUI starts.

Another Option would be a systemd Service. This is more universal as with this approach we can set Service Dependencies and load orders.

It doesn't really overlay `/`

The script doesn't really work / overlay the actual root:

(deck@ysd ~)$ tmp/Qbert/qbert.sh -S pv
[sudo] password for deck: 
@#?%&#*!
(Overlay is mounted!)

....
warning: warning given when extracting /usr/bin/pv (Can't create '/usr/bin/pv')
...
touch: setting times of '/usr': Read-only file system
error: command failed to execute correctly
(deck@ysd ~)$ touch /usr/aaa
touch: cannot touch '/usr/aaa': Read-only file system

The script mounts the overlayed root fs into ~/.qbert/merged but doesn't really overlay/change the fs root (/). So you can access and change everything under ~/.qbert/merged, but / is still read-only.

(A+)(root@ysd ~)# mount | grep overlay
overlay on /etc type overlay (rw,relatime,lowerdir=/sysroot/etc,upperdir=/sysroot/var/lib/overlays/etc/upper,workdir=/sysroot/var/lib/overlays/etc/work)
overlay on /home/deck/.qbert/merged type overlay (rw,relatime,lowerdir=/,upperdir=/home/deck/.qbert/upperdir,workdir=/home/deck/.qbert/work)

(A+)(root@ysd ~)# ls /usr
bin  lib  lib32  lib64  libexec  local  sbin  share  src
(A+)(root@ysd ~)# ls /home/deck/.qbert/merged/usr/
bin  lib  lib32  lib64  libexec  local  sbin  share  src
(A+)(root@ysd ~)# touch /usr/aaaa
touch: cannot touch '/usr/aaaa': Read-only file system
(1)(A+)(root@ysd ~)# touch /home/deck/.qbert/merged/usr/aaaa
(A+)(root@ysd ~)# ls /home/deck/.qbert/merged/usr
aaaa  bin  lib  lib32  lib64  libexec  local  sbin  share  src
(A+)(root@ysd ~)# ls /usr
bin  lib  lib32  lib64  libexec  local  sbin  share  src

You would need to mount the overlay over / itself... however there are some complications with that, becaues you need to mount it before the other mounts, especially /proc , /sys etc..

The easiest way to do that is from an initrd, before the normal init system starts mounting everything else, but with simple init systems it should be possible to change it also there directly. (I have done this only on custom ebedded systems or a system with a custom initrd, but haven't looked into what support for this "normal" distros have. Systemd has a systemd.volatile=overlay option, but that puts the overlay data on a temporary in-memory filesystem, which will get lost on reboot).


Alternatively for your use case (allowing pacman installs) you could just create an overlay for just /usr, the same way steamos already has one configured for /etc, just check out /usr/lib/systemd/system/etc.mount, but basically (not tested ;):

  • create /etc/systemd/system/usr.mount with

      [Unit]
      Description=usr overlay
      
      [Mount]
      Where=/usr
      What=overlay
      Type=overlay
      Options=lowerdir=/usr,upperdir=/var/lib/overlays/usr/upper,workdir=/var/lib/overlays/usr/work
      
      [Install]
      WantedBy=local-fs.target
    
  • run (it should be actually possible to do the mkdir automatically as a dependent systemd service or something ;)

      mkdir -p /var/lib/overlays/usr/{upper,work}
      systemctl enable usr.mount
    
  • reboot. Alternatively you could just start systemctl start usr.mount to start it using right away, but already running apps would keep open files from the original usr which might cause some confusion (for a similar reason, it will be hard to disable it again without a restart)

--umount/unmount doesn't do anything

Fairly simple, running this command doesn't unmount anything. Everything is still clearly showing as mounted, and --delete-overlay doesn't work since the files are in use.

If Qbert is uninstalled, pacman still shows packages as installed

I was attempting to build libstrangle on the Steam Deck using this to save having to unlock the filesystem, and ran into numerous issues that prevented it from working. When trying to build something from the AUR it was showing fakeroot as not installed, even though I'd just installed it and everything else for the AUR with Qbert.

Eventually I gave up, rebooted to unmount since that wasn't working, ran --delete-overlay and uninstalled Qbert. However, the packages that I installed through Qbert are still showing as installed in the pacman package list.

I've got no idea what to do now, as while they're showing as installed, they're clearly not. I can't reinstall them since the root fs is locked, if I install them through Qbert then they don't work, and generally it feels like I've just made a huge mess which is what I was trying to avoid in the first place :(

Any ideas?

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.