You are not logged in.

#1 2011-08-15 19:33:17

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 136
Website

AIF Customization Questions

Like many Arch users I have a set of home-brew bash scripts that I use to customize my system post install. After my most recent clean up & refactoring of these scripts I had the sinking feeling that I was simply reimplementing a subset of AIF and decided to take another look at using AIF as my custom install solution.

AIF looks great. The first couple times I peeked at it I didn't get it, but those were early days when I was fresh to Arch and still getting to grips with how things worked. I feel like I have more of a handle on things now and I'd like to put together a "gentle introduction" page about AIF at some point, based on my own "learning AIF" notes that I've been compiling. I have some outstanding questions that I'd like to get some feedback on, listed below.


AIF INFORMATION SOURCES

I have used a variety of sources to draw on during my research into AIF. I would appreciate any pointers to other sources that I might be missing.

Dieter's github AIF repo and custom profile/procedure

Arch releng mailing list

Arch BBS

Arch Wiki

Dieter's Talk at FOSDEM 2011

releng changelog with aif details

AIF Issue Tracking

OUTSTANDING QUESTIONS:

I have a couple questions that I'd appreciate feedback on. Apologies if I've missed anything obvious.


QUESTION 1: Custom Config File Installation

I was reading through the arch-releng mbox archive and am certain I came across a couple mails by Dieter addressing this in 2009, but for the life of me I haven't been able to locate them again. Dieter, I'd welcome your comments here if you have time.

There is a class of config files that are installed by existing core packages but which require customization in order to properly function on a given system. A good example of this is /etc/acpi/handler.sh .

To date I have been handling installation of these files in one of several ways:

  • heredoc used to write out a file

  • keep file in a special overlay subdirectory in relation to my post-install scripts and copy over from there

With AIF, it is less clear to me what the best approach is (again, I swear I read an arch-releng mail from Dieter about this from 2009). Options I can envision include:

  • Custom aif lib to copy a file from a subdirectory, wgetting or a vcs repo. I'm ok with writing this/repourposing my existing code and making it AIF friendly, but not sure this is the best solution. I'm also not sure where the best location for these custom config files would be in relation to the the custom profile (to which they seem most related). I'd like to keep them "close" to the profile itself (i.e. not scatter my profile and config files into disparate repos or directory structures).

  • Custom aif function to take heredocs from the AIF profile (since these files are specific to a system) and write them out. This would bloat the the AIF profile a bit, but isn't the worst solution.  I've used this approach before in my custom scripts, it just requires some scripts to easily update the heredocs in the profile from current system configuration.

  • Custom package to install just the config (seems needlessly complex, particularly when the package is just to copy over a file, likely on top of a config already installed by another package)

  • Unknown AIF native solution. Something I'm missing?

So what's the best approach to installing these must-customize files during AIF? Any of the above or something I've missed?

QUESTION 2: daemons, modules, config file values

This is touched on in a mail from Dieter on Mar 31 2009 (http://mailman.archlinux.org/pipermail/ … 00469.html) but I'm not sure that there is a current best practice solution. If I'm missing a function in AIF, major apologies and someone please point me in the right direction.

This question is similar to the above question of config files. When an existing config file shouldn't be overwritten completely, what's the current best-practice method of modifying it? Classic example is /etc/rc.conf adding and removing
daemons, modules, etc.

Personally, I have a custom lib function I use to add/remove daemons, modules, and individual config file settings (taking into consideration the @daemon variations), and I'm happy to use this as a custom lib in my AIF installs (or clean it up and propose a patch), but I wanted to make sure I'm not duplicating effort here.

I appreciate anyone that can take a moment to provide information on these issues.


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#2 2011-08-15 19:50:46

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,000
Website

Re: AIF Customization Questions

* I also did an AIF talk at Archcon, see http://archlinux.ca/archcon2010/videos/day1/
but I was really tired that day and my performance was subpar.  Anyway it might offer some value.
* the unofficial dir in the aif source repo is outdated. the examples there probably don't work anymore.
* for changing config files, override worker_configure_system(), you might want to reuse preconfigure_target() and postconfigure_target() . you'll have to grep in the code to see what these functions do, but the point is that you can override this worker to do whatever you want. the following example uses a simple sed to change a variable in /etc/rc.conf, but like you say, you can use it to check out files from version control and install them, or whatever. https://github.com/Dieterbe/aif/blob/ma … all-on-sda
* there is no API for adding/modifying/.. daemons (yet?) so currently you'll need to write your own aif lib function for it (which will probably do sedding and such on the files).  I've also been looking at http://augeas.net/ which looks quite neat, maybe if we can get it to support some of our files, and if it is a small dependency, we can start using it.


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#3 2011-08-15 20:23:12

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 136
Website

Re: AIF Customization Questions

Dieter, thanks so much for the (amazingly rapid) reply. I'll focus on reviewing the functions you've mentioned. Augeas looks interesting. I'll probably start by repurposing my existing code and will post once that's done.

A couple final questions:

  • Are there any (yours or others) custom AIF profiles/procedures you consider to be good examples (since the unofficial subdir is outdated)? Are your own profiles posted somewhere else on github?

  • Are you copying your own custom libs/procedures into /usr/lib/aif/user/* before using them? Or do you reference them otherwise?

Again, this is a huge help in understanding how to make use of AIF.


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#4 2011-08-15 20:42:33

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,000
Website

Re: AIF Customization Questions

altercation wrote:

Dieter, thanks so much for the (amazingly rapid) reply. I'll focus on reviewing the functions you've mentioned. Augeas looks interesting. I'll probably start by repurposing my existing code and will post once that's done.

A couple final questions:

  • Are there any (yours or others) custom AIF profiles/procedures you consider to be good examples (since the unofficial subdir is outdated)? Are your own profiles posted somewhere else on github?

  • Are you copying your own custom libs/procedures into /usr/lib/aif/user/* before using them? Or do you reference them otherwise?

Again, this is a huge help in understanding how to make use of AIF.

Ironically, all my available "arch dev time" is going into AIF itself.  I once had the goal of completely automatic my home deployments with nice aif configs (in fact, this was the whole reason I started AIF in the first place) but I didn't work on that for a long time.
About the "own custom things", I forgot how that works, but the README says

* user modules  -> /usr/lib/aif/user/<module name> (put your own modules here)

Btw on my blog you can also find somemore information
Check http://dieter.plaetinck.be/tag/arch

And to find more about the origins and first thoughts around the project: (contains outdated things)
http://dieter.plaetinck.be/rethinking_t … l_approach
http://mailman.archlinux.org/pipermail/ … 02541.html
https://bbs.archlinux.org/viewtopic.php?id=58110

Last edited by Dieter@be (2011-08-15 20:42:45)


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

Board footer

Powered by FluxBB