Giter Site home page Giter Site logo

vanilla-os / abroot Goto Github PK

View Code? Open in Web Editor NEW
262.0 9.0 16.0 13.98 MB

ABRoot is utility which provides full immutability and atomicity to a Linux system, by transacting between two root filesystems. Updates are performed using OCI images, to ensure that the system is always in a consistent state.

Home Page: http://abroot-dev.vanillaos.org/

License: GNU General Public License v3.0

Go 100.00%
immutability atomicity linux transactions hacktoberfest vanillaos command-line

abroot's People

Contributors

89luca89 avatar andibing avatar andrew-geo avatar axtloss avatar benstone326 avatar bittin avatar bketelsen avatar dependabot[bot] avatar driedpampas avatar emintufan avatar falexei avatar flipflop97 avatar fw190d13 avatar guylamar2006 avatar kbdharun avatar kefir2105 avatar kuroki100 avatar lakejason0 avatar matbme avatar mirkobrombin avatar notchapple1703 avatar peterrakmanyi avatar pietrodicaprio avatar plasmus777 avatar sebastian-sebastian avatar taukakao avatar thednp avatar weblate avatar xavspm avatar yorimirus 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  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  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  avatar  avatar  avatar  avatar  avatar

abroot's Issues

Can't control the apt command using ABRoot

Screenshot from 2023-11-01 16-28-35

On ABRoot 2.0.0-alpha.1 (in Vanilla OS 2.0 alpha 10/16/2023), I can't control the CLI when I accidentally selected some packages that requires additional condition, which I can't access. As a result, I can't get past through the error.

More intrusively warn that you should not install software via ABRoot

ABRooting to install software should be a strictly discouraged process as root partitions are very small and system reserved.

To prevent this we should advise against the use of transactions unless strictly necessary (kernel, drivers), even at the cost of becoming more invasive in the user experience. My idea is to ask the user to confirm entry into the shell by typing: "I understand the danger of installing software in root." and provide a direct link to learn about the risks of ABRooting.

===============================================================================
PLEASE READ CAREFULLY BEFORE PROCEEDING
===============================================================================
Changes made in the shell will be applied to the future root on next boot on
successful.
Running a command in a transactional shell is meant to be used by advanced users 
for maintenance purposes.

If you ended up here trying to install an application, consider using 
Flatpak/Appimage or Apx (apx install pacakge) instead.

Know the risks of installing software via ABRoot at [link].
Read more about ABRoot at [https://documentation.vanillaos.org/docs/ABRoot/].

If you still want to proceed, type: "I understand the danger of installing software in root." 

Add --dry-run option

This flag allow the transaction to be dropped at final steps. Useful for development purposes/tests.

Installation history

It would be such a delight to have the capabilities to see which packages we have installed through ABRoot. It's like the ostree feature where you can see the packages you have layered.

Add more info to `abroot status` command, plus a `--dump`

The dump command will create an yaml with the following assets:

  • ABRoot log files
  • ABRoot configuration
  • added/removed packages
  • device specifics (what kind?)
  • abimage.abr files content (both A and B)

This yaml can be used to investigate and reproduce an issue with ease.

[kinetic] Unable to update with or use ABRoot: Failed to start transactional shell: exit status 11.

I'm unable to update my system or perform any transactions that require ABRoot. When using either abroot exec or abroot shell, I receive:
Failed to start transactional shell: exit status 11

Attempting to update via VSO ends up throwing the same error.

Even trying an empty transaction like this results in a failure:
sudo abroot shell
exit 0

Full ABRoot transaction output:
https://hastebin.com/moceloxeno.yaml

I originally ran into this with abroot 1.3.0 and vso 1.3.0. I was able to start applying transactions again after several reboots for seemingly no reason and am now on abroot 1.3.3 and vso 1.3.1-3. Now running into the same issue again after applying updates.

update-grub not working

Hey, sorry if this is the wrong place but feel free to point me in the right direction. I've got vanilla-os installed on a microsoft surface pro 7 and I'm working on installing surface-linux for which I assume I need to do in abroot shell since it's a different kernel. I'm able to get through to the point where it tries installing the kernel and tries to upgrade grub to point at it. This is needed for quite a few pieces of hardware (including the touchscreen) to work.

The specific error I'm getting is the following:

/usr/sbin/grub-probe: error: failed to get canonical path of `overlay'.

Here are the full logs: https://pastebin.com/28YYBWWy

I'm able to use the computer in the meantime but would like for stuff like my touchscreen and cooling to work correctly. If there's any troubleshooting you'd like me to do or workarounds to try, please let me know. I also understand if this isn't something you'd like to support.

os-prober disabled by ABRoot

VanillaOS Orchid. I am encountering an issue where the os-prober is "forever" disabled, even if I enable it in /etc/default/grub. I suspect that it's because of ABRoot recipe that keeps it disabled after a transaction like in the picture below. That prevents me from booting other operating systems like Windows. A good idea would be a switch or something to enable or disable it in the ABRoot recipe.

rn_image_picker_lib_temp_be987be8-9588-4675-95cc-c9be09a2d348

Use DEBIAN_FRONTEND=noninteractive

Setting DEBIAN_FRONTEND=noninteractive will prevent a transaction started with exec to freeze when a dpkg-reconfigure appear.

Since ABRoot is meant to be distro-agnostic, this should be added by the packager.

ABRoot v2 - Follow up

  • create /etc/abroot/packages.unstaged file instead of failing if not exist
  • pkg.applyFailed shows as info while it's error
  • pkg apply leave transactions locked on fail

Add progress bar when downloading a new image during upgrade

During a system upgrade ABRoot only shows STEP 1/4: FROM ghcr.io/vanilla-os/desktop:main when downloading the new image, which is a bad indicative of progress. We should add some sort of progress update to show how long until the download finishes.

Resize the disk?

20gb is not enough for me, how can I solve it without breaking anything?

Allow for optional pkg check while adding new ones

Replaces #79

Currently the bundled package manager does not check if a package exist before installing. We have to query an API to ensure that it exist before proceeding.

Since ABRoot is distro-agnostic, we have to make this feature optional.

example:

{
...
    "iPkgMngPre": "",
    "iPkgMngPost": "",
    "iPkgMngAdd": "apt install -y",
    "iPkgMngRm": "apt remove -y",
    "iPkgMngApi": "https://packages.vanillaos.org/api/check/{packageName}",
...
}

HasUpdate always fails with a ghcr registry

This is due to multiple factors:

  • the api call we generate is the wrong one, it should be ghcr.io/v2/vanilla-os/nvidia/manifests/main
  • ghcr requires an Authorization token
  • abroot tries to compare a sha256:xxx digest with xxx, to keep this consistent we should always remove the prefix

Wrong digest in Containerfile build

The syntax used in the Containerfile to build the local changes is wrong:

FROM ghcr.io/vanilla-os/nvidia@:7cc1c8287b7e135d468ba502c99f82480923df0d0b411c509b9b39e81c960241

The correct one is:

FROM ghcr.io/vanilla-os/nvidia:main@sha256:7cc1c8287b7e135d468ba502c99f82480923df0d0b411c509b9b39e81c960241

missing var partition when manually partitioning

Issue Description

Post-install setup on Orchid requires you to boot into previous partition rather than current, otherwise hostname is wrong and you can't sign in to TTY nor GDM.

Steps to Reproduce

  • Install VanillaOS Orchid
  • Do post-setup
  • Boot into "current partition"
  • Try signing into GDM
  • Go to TTY to check hostname and try signin

On what version of Vanilla OS this happens?

Unreleased

Additional Information

This was done using a manual install on nvme0n1 where nvme0n1p1 is a 465GiB NTFS partition.

How do i edit /etc/default/grub?

I need grub to prob for Windows that was not present during the install. Whenever I edit /etc/default/grub, the change gets reverted in the next reboot. Also, update-grub doesn't do anything.

Please do help me with this. My Windows partition is not accessible presently.

[feat] Adapt root scripts to new structure

  • /usr/sbin/init isn't changed anymore, it remains the default one that ships with the image
  • /usr/sbin/.vanilla-mountpoints now contains the script responsible for mounting /var, /etc, /home, etc
  • /etc/systemd/system/var-mount.service holds the SystemD service responsible for running the above script

Broken `pkg apply` command

I am currently testing ABRoot options in Orchid. So, on top of the default installation, I tried adding a couple of packages git, meson, flatpak, go using sudo abroot pkg add command. After adding I applied the changes using sudo abroot pkg apply it failed (Ref. [1]) as I misspelt the golang package name as go. Now, I tried removing it using sudo abroot pkg remove go and did a reboot. Post reboot I tried applying the update again and it failed. After which I tried removing the package again.

image

If you notice in the above image, the remove command is working separately and not checking for duplicate entries, when mishaps like this occur and abroot rollback isn't an option. I think we should allow editing the package list using maybe apkg edit command.

Support fetching update details via API

Since we dropped the usage of the package manager (which is now eventually used during the build process only), we can't list changes from the packages repository. However this would be pointless as much of Vanilla OS is built using modules and not packages.

The idea is to allow ABRoot pulling details for an update using its digest.

Brought back to grub selection menu multiple times

The first startup is successful; I complete the first setup, then proceed to shut down. Once I start the device again it presents to me the grub menu, as I'd expect. I let it proceed... once started up, I wait. (after the ~30 seconds it takes for the setup software to start) I am presented with a request to authenticate to complete the setup, which ends up completing successfully, and notifies me that my system is ready to use; I press the super key but nothing happens, GNOME still seems limited. I reboot, and am then greeted to the grub menu once again... I let it proceed with the default once again; after a few moments, I am greeted with yet another grub menu, exactly the same with nothing changed. This happens a few times. After multiple boots of trying one root partition, then the other (and completing the first setup multiple times) it finally boots properly... little did I know that on the next boot I would be presented with the same issue once again. Any system updates showing in GNOME software that I attempt to apply remain pending in GNOME software on the next successful boot.

  • NOTE: the first startup uses a, it never seems to use a as the default after this.
  • OTHER NOTE: I've given this a try with LUKS encryption, and without; it seems to make no difference.
  • OTHER OTHER NOTE: The output shown before the grub menu goes away is shown for too little time for me to see what is says, but there is no red text. It might be worth nothing that the last three lines of text are a grey color contrary to the rest of the output.
  • LAST OTHER NOTE: this issue might relate to #34

Hidden Folders not Persisted by ABRoot in Vanillaos

Trying to use some software that needs to be installed in root. (security stuff for work)
It needs to have at least one hidden folder in the /opt/<software-name>/ folder. (as in, the folder begins with ..

ABRoot does not see it as an added file when exiting the shell.

Automate "Version"

having Version as a string in main.go and also as a file in the repo root is fragile and error-prone. Automate this somehow - simple github action + goreleaser on tag maybe?

[feat] Better integration of new SystemD-based mountpoints with ABRoot

Task #86 changed how ABRoot mounts the /var partition and its derivatives (/home, root-specific /etc, and so on), but its implementation wasn't very well thought out and integrates very poorly with ABRoot's goal of being distro-agnostic.

This task suggests some changes to the current structure:

  • Rename /usr/sbin/.vanilla-mountpoints to /usr/sbin/.abrootmountpoints
  • Ship a mountpoints file template with ABRoot, which will need to be modified when the system is installed to hold the correct partition names
  • Also ship the SystemD unit with ABRoot, which must be enabled in order to work

Some files are not properly synched in `/etc` when performing an update

Files like /etc/abroot/packages.* are not synced when performing an update or apply operation.

My suspicion is that line 577 in core/system.go (currently newEtc := filepath.Join(systemNew, "/etc") ) needs to be replaced with newEtc := filepath.Join(systemNew, "/.system/etc"), since the new root's /etc is an overlay mount combining /.system/etc and /var/lib/abroot/etc/[root-label].

[kinetic] Unable to use abroot after reboot

I'm getting the following error:

Transactions are locked, another one is already running or a reboot is required.

I rebooted several times and rolled back transactions, but still can't use abroot after making some installations. I used abx during the transaction as well.

I get the following diff:

$ sudo abroot diff
SUCCESS  Gathering changes made by transaction...                                                                                                                                   
Removed:


Added:


Modified:
 • /etc/fstab
 • /etc/cups/subscriptions.conf
 • /etc/cups/subscriptions.conf.O
 • /usr/sbin/grub-mkconfig

Corectrl Settings Resetting After Reboot

Corectrl is a Utility needed to Manage AMD CPUs and GPUs under Linux.

image

It needs to be installed via ABRoot to function properly (I've installed via the Mesa Almost Stable repo) and, while it does work, the settings it applies, at least to CPU Scheduling (Governor), reset to the default schedutil after reboot.

Changing partitions for subvolumenes

Hi, I just watched the brodie robertson video about ABRoot and was thinking "wouldn't be possible to replace the roota and rootb partitions for roota and rootb subvolumenes?" this would have
the advantage of:
1- just needing 1 root partition (as roota and rootb are subvolumenes)
2- reducing the amount of space required by 1/2 (if reflinks are used to sync roota and rootb then only the delta is added)
3- instant sync between the two roots (again if reflinks are used to sync then it should be instant)
the drawbacks:
1- the installer would have to be modified to make use of the new subvol layout
2- ABRoot should be modified to use the subvolumenes instead of partitions
3- insert here problem I have not realized yet
So, is it feasible? it was already in development? or it has way too many problems that I don't see?

abroot kargs throws out of range error

Running 'VanillaOS 22.10 all' with kernel version 5.19.0-38-generic.

Reproduce:

  • Open Bash Shell in Gnome Console
  • running $ abroot kargs

Full log:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/vanilla-os/abroot/cmd.kargsCommand(0xc000195200?, {0xac3f50?, 0x0?, 0x0?})
	github.com/vanilla-os/abroot/cmd/kargs.go:20 +0x43e
github.com/vanilla-os/abroot/vendor/github.com/spf13/cobra.(*Command).execute(0xc000195200, {0xac3f50, 0x0, 0x0})
	github.com/vanilla-os/abroot/vendor/github.com/spf13/cobra/command.go:916 +0x862
github.com/vanilla-os/abroot/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc000194000)
	github.com/vanilla-os/abroot/vendor/github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/vanilla-os/abroot/vendor/github.com/spf13/cobra.(*Command).Execute(...)
	github.com/vanilla-os/abroot/vendor/github.com/spf13/cobra/command.go:968
github.com/vanilla-os/abroot/vendor/github.com/vanilla-os/orchid/cmdr.(*App).Run(0xc000194000?)
	github.com/vanilla-os/abroot/vendor/github.com/vanilla-os/orchid/cmdr/app.go:94 +0x78
main.main()
	github.com/vanilla-os/abroot/main.go:48 +0x953

Failed to start transactional shell: exit status 11

I update the grub and tried update-grub (that didn't work), then tried sudo abroot exec echo but with no success I received exit status 11, full log below:

 WARNING  New transaction started. This may take a while...
          Do not reboot or cancel the transaction until it is finished.
Unlocking apt
Unlocking apt-get
Unlocking dpkg
Leaving 'local diversion of /usr/sbin/grub-mkconfig to /usr/sbin/grub-mkconfig.distrib'
Leaving 'local diversion of /etc/default/grub to /etc/default/grub.distrib'

Locking apt
Locking apt-get
Locking dpkg

Syncing <wer.service-dMUPj6/ [214/214] ███████████████████████████████ 100% | 2s
  ERROR   Failed to start transactional shell: exit status 11

Add Differ support

Include support for the Differ API for checking package version changes between images.

Past/Present instead of Present/Future

Currently, ABRoot has 2 safeguards:

  1. If a transaction failed obviously, discard changes
  2. If the future system broke, users can boot back to the working system. Unless they did a new transaction on the future system.

I believe it's possible to skip the necessary reboot into the future system, while still having the same guarantees. I'd call this concept "past/present" in contrast to the current "present/future". The idea is to apply changes live, to the present partition, on a successful transaction. Then, after an eventual reboot, mark the partition as successfully booted. Successfully booted partition is an eventual replacement for the "past" partition. After a user makes another successful transaction, the successfully booted present partition becomes the "past" one, and changes are applied on the new present partition.

This makes it easier to modify the host system, but still keeps the old bootable system around.

Feat: implement a `ABROOT_FREE_SPACE` env var to delete .system

If the ABROOT_FREE_SPACE env var is set, ABSystem will delete the future .system (not .system.new), this is a potentially harmful option which must be exposed as a flag and should be used only in a test environment to free up space in case the root is too small.

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.