> What I would like to is make a single kickstart file that could be used for both Cobbler/net based and DVD based installations. I added > some logic to the %pre section to adjust but it doesn’t seem to be working. Logic is listed below. The logic works when I test it
> outside of kickstart but the kickstart doesn’t seem to be interpreting the $basepath variable. When I interrupt a kickstart using a ctl-f2
> and look at /tmp/ks.cfg it just shows the base kickstart file and not an interpreted one. Any help would be appreciated. If any ideas on
> how to accomplish the same thing are out the please let me know.
>
> %pre
> #!/bin/bash
> if [ `/bin/grep cdrom /proc/cmdline | wc -l` -gt 0 ]
> then
> touch /tmp/yes_cdrom
> basepath=/mnt/stage2/ks/
> else
> touch /tmp/no_cdrom
> basepath=http://10.0.0.100/
> fi
> %include "${basepath}includes/disk_choose"
Don't think you can use %include in a %pre section. As this section is being parsed by /bin/bash. But you can accomplish the
same effect by using bash-based syntax.
[[ -f /tmp/yes_cdrom ]] && cat ${basepath}includes/disk_choose > /tmp/disk_choose || (cd /tmp; wget ${basepath}includes/disk_choose)
then in your main ks.cfg section:
%include /tmp/disk_choose
Spike
_______________________________________________ Kickstart-list mailing list Kickstart-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/kickstart-list