Modifying Anaconda behaviour without rebuilding the whole install media
source link: https://arrfab.net/posts/2011/Jun/11/modifying-anaconda-behaviour-without-rebuilding-the-whole-install-media/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
One thing that I had to have a look at (during CentOS 6 QA), is the way anaconda (the Red Hat/Fedora/CentOS installer) pre-defines some 'tasks' . People used to those kind of install know what I'm talking about : the "Mininal", "Desktop", "Basic Server" and other choices you have during setup. From that first selection, you can decide (or not) to customize the software selection which then leads you to a screen containing categories / groups / packages defined in the comps.xml file present under /repodata on the tree/install media.
If you don't 'see' which screen i'm talking about, a small screenshot of the upcoming CentOS 6 will explain better than words :
Those pre-defined tasks aren't defined in the comps.xml file but rather at build time within anaconda. Fine but how can you 'modify' anaconda behaviour and test it without having to patch anaconda SRPM, rebuild it and launch a new build to generate the tree and install medias ? Easy , thanks to a simple file on the tree !
People wanting to modify anaconda behaviour at install time without having to regenerate the whole tree can just create a small file (updates.img) , put it in the /images directory in the tree. Anaconda (when installing over the network, http/ftp/nfs) always try to see if an updates.img file exists, and if so, use it. Fine, so I could easily try to "patch" it without having to modify the whole tree.
Creating that updates.img (it's just a ext2 filesystem on top) is really easy :
dd if=/dev/zero of=/tmp/updates.img bs=1k count=1440 losetup \`losetup -f\` /tmp/updates.img losetup -a|grep updates.img mkfs.ext2 /dev/loop3 \# was loop3 in my case mkdir /mnt/loop ; mount -o loop /tmp/updates.img /mnt/loop/ ; ll /mnt/loop drwx------. 2 root root 12288 Jun 11 15:43 lost+found
From now, it's just a matter of putting the new files that you want to test and that will "overwrite" at run-time the defaults anaconda ones.
(in our current example, it was the installclasses/rhel.py that needed to be modified, so I just had to create a installclasses dir and drop my version of rhel.py in there on the loop device)
When you're done, umount the updates.img, copy it to /path/to/your/install/tree/images , restart a http install (verify that permissions and selinux contexts are of course correct !) and enjoy !
Easier and faster. Thanks to the Anaconda team which decided to permit modifying the anaconda behaviour at run-time with a simple file :-)
Recommend
-
122
ivim - An easy & highly customizable vim configuration _ _ (_) __(_)___ ___ / / | / / / __ `__ \ / /| |/ / / / / / / / /_/ |___/_/_/ /_/ /_/ Version: 3.0
-
7
Introduction Designed for data science and machine learning workflows, Anaconda is an open-source package manager, environment manager, and distribution of the Python and R programming languages. This tutorial will guide yo...
-
3
Copy link Member m-ou-se commented
-
5
-
3
Apple has figured out how to repair Face ID without replacing the whole damn iPhone#InnovationThere’s no denying that Apple is a resourceful corporation. The company continues to expand the fields it covers — attracting...
-
5
Testing my System Code in /usr/ Without Modifying /usr/
-
13
Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore. This article is...
-
4
Install & Setup Anaconda Python, Jupyter Notebook and Spyder on Windows 10Skip to content...
-
15
Add binaries to Kubernetes Pod without modifying the container image Advertisements Given an scenario where you need t...
-
5
How to Install Matplotlib on Anaconda? ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK