Find the answer to your Linux question:
Results 1 to 4 of 4
RHEL 5.4 I'm trying to use %include statements in my kickstarts, and am running into some problems. In %pre, I can %include /mnt/source/isolinux/setup-questions and that works just fine. One of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie jnojr's Avatar
    Join Date
    Sep 2007
    Location
    San Diego, CA
    Posts
    118

    Question %include in kickstart


    RHEL 5.4

    I'm trying to use %include statements in my kickstarts, and am running into some problems.

    In %pre, I can %include /mnt/source/isolinux/setup-questions and that works just fine. One of the things it does is echo out several variables to /tmp/vars In %post --nochroot, I copy /tmp/vars to /mnt/sysimage/tmp/vars so I can access /tmp/vars in %post That works just fine.

    The problem is when I try to include files I've copied to /tmp In %pre, I can copy my include files to /tmp/ks-files/, and I've verified that they are, indeed, copied. The files exist, are readable, have the correct content. But if, in %pre, I %include /tmp/ks-files/setup-questions, kickstart simple sails right on past. In %post, again, I can drop to a shell and see that /tmp/ks-files/* are all there, but the first %include bombs out with an error about the file not existing.

    What's the secret to getting this to work?

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    i'm doing something similar in my ks files: i create a file (/tmp/part-include) in %pre, then i have an %include /tmp/part-include line after it - works fine. i also have an %end, after the %pre, before the %include, which was optional when I added it, but maybe it is required now?

    anyway, post the relevant portion of your KS file, and maybe someone can spot a prob.

  3. #3
    Linux Newbie jnojr's Avatar
    Join Date
    Sep 2007
    Location
    San Diego, CA
    Posts
    118
    Quote Originally Posted by atreyu View Post
    i'm doing something similar in my ks files: i create a file (/tmp/part-include) in %pre, then i have an %include /tmp/part-include line after it - works fine.
    I don't see much point in creating a file in %pre... I'd be echoing in dozens or hundreds of lines in each and every kickstart. I might as well keep doing it the way I do now.

    i also have an %end, after the %pre, before the %include, which was optional when I added it, but maybe it is required now?
    I've never heard of %end before, and have never used them, and my kickstarts have worked fine for years, so maybe that's a pre-RHEL thing?

    anyway, post the relevant portion of your KS file, and maybe someone can spot a prob.
    Even if I could (and I can't, as the system in question is not connected to the Internet), I don't see the point... %include does work in some cases as I specified in my original post. And the only difference is the location of the files. It isn't like I'm trying to use %include in some different, weird way like suddenly pretending I have a C:\ drive or something

  4. #4
    Linux Newbie jnojr's Avatar
    Join Date
    Sep 2007
    Location
    San Diego, CA
    Posts
    118
    Anyone have any idea?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •