CyberShadow / aconfmgr

A configuration manager for Arch Linux
1.15k stars 41 forks source link

Target a different installation than the one on / #121

Open Dieterbe opened 2 years ago

Dieterbe commented 2 years ago

While aconfmgr looks awesome, as a new user i want to be rather careful with attempting my first few "apply" commands onto my live system.

Is it possible to restore/apply into a separate directory or chroot? That would make it pretty easy to run apply "safely" and then compare it against the real system, to see how correct apply was, and to find any issues with permissions, files not being restored properly etc, without breaking the main system. This would also allow "safer" experimentation with more aggressive changes to the .sh files.

If this is not supported, I suppose the next best thing would be to restore into a VM, which brings another question: what needs to be in place, at a minimum, in order for aconfmgr to operate? A blockdevice? A filesystem? A full arch linux installation ?

cheers

CyberShadow commented 2 years ago

While aconfmgr looks awesome, as a new user i want to be rather careful with attempting my first few "apply" commands onto my live system.

aconfmgr will prompt for a confirmation before every system modification. With --paranoid, it will ask twice for some operations, or ask for individual items for batch operations.

Is it possible to restore/apply into a separate directory or chroot?

Not at the moment.

That would make it pretty easy to run apply "safely" and then compare it against the real system, to see how correct apply was, and to find any issues with permissions, files not being restored properly etc, without breaking the main system.

Not to dismiss your concern, but I feel fairly confident in aconfmgr's capability to apply the specified configuration as it is specified. There is a very thorough test suite as well as matrix tests which test every possible combination of configuration/system state.

If this is not supported, I suppose the next best thing would be to restore into a VM, which brings another question: what needs to be in place, at a minimum, in order for aconfmgr to operate? A blockdevice? A filesystem? A full arch linux installation ?

A full Arch Linux installation capable of running pacman and bash. There are some other dependencies, which aconfmgr will install if they're missing as part of its execution.

You may find the integration test suite mode of aconfmgr useful, as it tests aconfmgr against a real Arch Linux installation in a Docker container.

Dieterbe commented 2 years ago

this is looking promising. I didn't look at the tests yet in depth but I decided to gave a full save-check-apply cycle a run, and nothing seems to have broken :) i compared against and older backup and nothing particular stood out. nice work.

I still think restoring into a separate directory could be useful, e.g. when building a VM or building a new system on a locally mounted hard drive. Note that pacman has a --root flag which allows to install packages in dirs other than / which should make this easy. (assuming package post/pre-install scripts don't have bugs).

Either way it's not a feature I really need, so if no one else asks for it, then let's forget about it and close this.

CyberShadow commented 2 years ago

I still think restoring into a separate directory could be useful

I agree. Another use case would be using aconfmgr to scrub and repair another system without booting or chrooting into it (because perhaps e.g. it is completely broken, or is suspected of being compromised).