2

I have a kickstart based DVD that I want to use to setup a few identicat servers. The DVD is an exact copy of a RHEL iso image, with the addition of a directory named "custom". Under that directory, I have some scripts and some jpgs that I want to copy to each server.

In the kickstart file, in the %post --nochroot section, I copy all those files to their final location as:

 cp -f /custom/script1.sh /mnt/sysimage/usr/local/bin/
 cp -f /custom/script2.sh /mnt/sysimage/usr/local/bin/
 cp -f /custom/script3.sh /mnt/sysimage/usr/local/bin/

 cp -f /custom/image1.jpg /mnt/sysimage/usr/local/<myapp>
 cp -f /custom/image2.jpg /mnt/sysimage/usr/local/<myapp>
 cp -f /custom/image3.jpg /mnt/sysimage/usr/local/<myapp>

However, the ks.log file says that the /custom directory does exists!

So, how do I copy files from installation DVD to the new system?

Peter
  • 822
  • 2
  • 10
  • 23
  • 2
    The DVD is almost certainly mounted somewhere other than root (maybe /mnt/cdrom or something). I'm not familiar with Kickstart so I couldn't say where, but someone around probably knows... – Chris S Jul 11 '13 at 13:55
  • I can't check right now, but you could switch over to a shell running on a virtual console during Kickstart and look. (CTRL+ALT+F1 - CTRL+ALT+F5) – Aaron Copley Jul 11 '13 at 15:56
  • I don't believe that this is not documented somewhere! – Peter Jul 11 '13 at 18:16

1 Answers1

2

OK, I found it. Red Hat/Centos, mount the installation media in the /mnt/source directory. So in order to copy my files, I changed the commands to:

%post --nochroot s
cp -f /mnt/source/custom/script1.sh /mnt/sysimage/usr/local/bin/
Peter
  • 822
  • 2
  • 10
  • 23
  • What version of RHEL were you using? I'm trying something similar with RHEL 6.3 and I don't see a `/mnt/source` when I use `--nochroot`. – Burhan Ali Aug 07 '13 at 10:15
  • My version is 6.3 too. – Peter Aug 20 '13 at 08:27
  • Thanks. I subsequently discovered that `/mnt/source` is there if you are using a DVD. I was using a USB key at the time and it doesn't exist for that. – Burhan Ali Aug 20 '13 at 09:26
  • And, where is it? – Peter Aug 20 '13 at 09:29
  • It doesn't exist at all as far as I could see. There is a `/mnt/isodir` directory which contains the ISO and I had to resort to manually mounting this ISO to gain access to the contents of the DVD. I don't know if that's the "right" approach but it's what I ended up doing. – Burhan Ali Aug 20 '13 at 09:31
  • @BurhanAli USB content is available at /run/install/repo/, i am using CentOS 7.6 – ImranRazaKhan Apr 15 '19 at 08:42