0

I want to break out my kickstart user definitions into a separate file.

Trying to pull that file in with %include, I get an error that breaks the install:

Unable to open input kickstart file: curl#37 - "Couldn't open file /whatever/path/itry/user_section-ks.cfg"

This doc and this doc both say I can use it like this: %include /path/to/file

RH gives this example:

/usr/share/anaconda/user_section-ks.cfg

I've seen google results here and there, people using /tmp and file:/// I tried 'em both.

I've checked every name, checked permissions and se contexts run ksvalidator and ... I'm stumped! Don't know what I don't know :(

iletras
  • 163
  • 2
  • 6
  • What section of the kickstart file? E.g., `%pre` isn't chrooted whereas `%post` is. – Mark Wagner Dec 20 '16 at 00:38
  • Refreshed my memory on ks-- the commands section isn't chrooted (which is where you'd use the `user` command). – Mark Wagner Dec 20 '16 at 00:42
  • @MarkWagner Right, it's in the main section. I just pulled the user statements out into a separate file and put the `%include` in their place – iletras Dec 20 '16 at 01:45

1 Answers1

0

I'm assuming you've placed a file you want to include on the same DVD or USB media from which you are trying to install RHEL.

The key here is that the installation media is not mounted at / when you boot into it. Rather, / is mounted from the read-only filesystem image /LiveOS/squashfs.img on the installation media.

The DVD/USB media itself gets mounted at /run/install/repo in RHEL 7. So if you placed a file mystuff.ks in the top level directory of the installation media, you will find it at /run/install/repo/mystuff.ks.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • I'm installing from a local ISO file, like: `/srv/distros/centos.iso` All of the kickstart files are at: `/srv/distros/ks` – iletras Dec 20 '16 at 01:42
  • 1
    @iletras OK, but how do you expect the installation to be able to read the kickstart files, then? – Michael Hampton Dec 20 '16 at 01:43
  • @Mark Hampton, it's been dawning on me that it's a false assumption :) So the way to do it is to unpack the ISO and point to a location within it? – iletras Dec 20 '16 at 01:47
  • @iletras There are probably many things you could do, but it depends on how you're deploying these machines, whether they're physical or virtual, where the kickstart files are hosted, and maybe things I haven't thought of. Creating a custom ISO is certainly one possible option. – Michael Hampton Dec 20 '16 at 01:49