[CentOS] %include command in Kickstart

Thu Feb 15 23:28:02 UTC 2007
John Summerfield <debian at herakles.homelinux.org>

Pierre Bourgin wrote:
> Al Sparks a écrit :
>>> Al Sparks  :
>>>> I have a kickstart file that basically runs the following:
>>>>
>>>> install nfs --server=nfserver.blah.local
>>>> --dir=/vol/updts/staging/CentOS_4.3 #include %some_file.cfg
>>>>
>>>> I want to be able to access or "include" a file on the nfs share not
>>>> the local CDROM I've got this on.  How do I do that?
> 
> <snip #include syntax typo>
> 
>> Also, my network configuration includes a local DNS, so I've been able to
>> reach the NFS server by name.
> 
> ? strange: I've already test it (mainly under centos3) and an IP address 
> was required for the NFS server; but I was booting via network (PXE), 
> not from cdrom.
> 
>> But it occurs to me that I need to place
>> that information on the ks.cfg file on the cdrom portion, not the 
>> "some_file.cfg" located on the nfs share.
> 
> your configuration is unusual: you use the cdrom to boot, right ?
> then you use an NFS server for the media location instead of the cdrom, 
> right ?
> So why in this case use the cdrom as storage for your include ks file ? 
> it will be really easier to use an NFS resource to store this additional 
> file.
> 
> Anyway, in this configuration, I guess the cdrom won't be mounted 
> automatically, you have to do it in the main .ks file like this:
> 
> -----------------
> install nfs --server=1.2.3.4 --dir=/vol/updts/staging/CentOS_4.3
> %include /media/cdrom/anotherfile.ks
> 
> # the "pre"/"post" directives must be at the end of the .ks file
> %pre
>   mount /media/cdrom
> ------------------
> 
> I'm not shure this will work: does the install system has an entry in 
> its /etc/fstab for "/media/cdrom" ?
> 
> It it's not the case, you will have to mount the cdrom "by hand", that 
> means its device is subject to change depending on the hardware 
> configuration of your machine: is it "hda", "hdb", "hdc" ... ?
> You should try within the shell of console #2.
> The "pre" section should then look like:
> 
> -----
> %pre
>   mount /dev/hda2 /media/cdrom
> -----
> 
>>> install nfs --server=1.2.3.4 --dir=/vol/updts/staging/CentOS_4.3 
>>> %include /path/to/file
>>>
>>> Once the installation system is running, the mount point for the used
>>> NFS share by directive "install" is /mnt/source .
>>
>> The really great info you gave me is the mount point the nfs command 
>> uses.
> 
> in fact, /mnt/source is the mount point of the source media (NFS, cdrom, 
> whatever).
> Once booted, goto onto console #2 with Ctl-Alt-F2 and use "mount" to see 
> it.

One of the images (in Nahant) is to boot off the CD and install from the 
network.

That should work BUT I've only used it to get the entire ks file off the 
LAN. Booting from a CD is quick and easy (provided you have a CD drive 
as in this instance).

Probably the %include will work fairly easily if the original ks file's 
obtained via NFS; otherwise I suspect you'll need to do the mount in %pre.




-- 

Cheers
John

-- spambait
1aaaaaaa at coco.merseine.nu  Z1aaaaaaa at coco.merseine.nu

Please do not reply off-list