Archive for January 28th, 2007

kickstart: %include

Posted in kickstart on January 28th, 2007 by Johan Huysmans – 2 Comments

Last week I started playing with kickstart. You can read more about it in the howto section of my blog.

Today I was testing the %include command but every file and every path I tried gave me a file not found error.
It appears that just the specific kickstart config file is copied to /tmp and the other content of my usb-disk is nowhere to find. This explains why my included files can’t be found.

The solution is to make your included files available during the %pre-section. This is possible because anaconda will parse the ks.cfg file 2 times. The first time it won’t complain about included files that can’t be found and only the %pre section is executed. The second time it will complain if an include file is missing.

This is how I made my includes work:
* mount the usb-drive during the %pre section

%pre
mkdir -p /tmp/usb-disk-mount/
mount /dev/sda1 /tmp/usb-disk-mount/

* include the files

%include /tmp/usb-disk-mount/partition/base
%include /tmp/usb-disk-mount/network/dummy