Hi All, I am attempting to create a custom USB drive for kickstart install. I found this: 1. get the ISO file of CentOS 7 2. mount -o loop CentOS-7.0*.iso /mnt/ 3. mkdir -p /CentOS-7-ISO-respin/{CentOS-7-unpacked,CentOS-7-iso} 4. rsync -avz /mnt/ /CentOS-7-ISO-respin/RHEL-7-unpacked 5. put your kickstart file into /CentOS-7-ISO-respin/RHEL-7-unpacked 6. add a new line to /CentOS-7-ISO-respin/RHEL-7-unpacked/isolinux/isolinux.cfg (this way you can use the ISO also from a DVD) label linux_ks menu label ^Install CentOS 7 with Kickstart kernel vmlinuz append initrd=initrd.img inst.stage2=hd:sdb2:/ ks=hd:sdb1:/ks.cfg 7. create the ISO with: /usr/bin/genisoimage -untranslated-filenames -volid 'CentOS-7.0-KS-x86_64' -J -joliet-long -rational-rock -translation-table -input-charset utf-8 -x ./lost+found -b isolinux/isolinux.bin -c isolinux/ boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table 8. dd if=/CentOS-7-ISO-respin/CentOS-7-CSB-iso/CentOS-7.0-KS-x86_64-DVD.iso of=/dev/XXX (where XXX is the Device Name of your USB drive without the partition number e.g. /dev/sdb) (Careful, that command destroys all data on the Stick) But I would also like to create a custom directory on the ISO and put some files in there for a custom POST section. I was not able to find an example with a custom POST section on the ISO. Anyone have any examples? Thanks, Jerry
Paul Heinlein
2017-Aug-14 18:18 UTC
[CentOS] Custom kickstart post section on usb thumbdrive
On Mon, 14 Aug 2017, Jerry Geis wrote:> Hi All, > > I am attempting to create a custom USB drive for kickstart install. > [... much snippage ...] > But I would also like to create a custom directory on the ISO and > put some files in there for a custom POST section. > > I was not able to find an example with a custom POST section on the > ISO. Anyone have any examples?The trouble I think you'll encounter is that the %post section of the kickstart operation is chroot-ed into the new system. You won't be able to see the original ISO, as far as I know. The %pre section is *not* run in the chroot environment, but it's run prior to partitioning the system disk, so I don't know how you'd copy files unless you did all your partitioning in %pre, reserving one partition for your %post data. I think what I'd do is create and install a custom rpm with the data files you want available during %post. Of course, that means you'll have to hack the repo on your USB drive, so it's not really a lightweight solution. -- Paul Heinlein <> heinlein at madboa.com <> https://www.madboa.com/