Re: how to copy file at post?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chan, Dominic wrote:
I think I am going about this all wrong.  It looks like the CD doesn't get eject by anaconda until the %post section is complete finish.  However, it may dismount the CD before %post begin.  Here is a copy of my %post section.  I try to mount the CD from both chroot and non-chroot environment with not success (but the floppy mount fine!)  What am I miss?

%post
/usr/sbin/useradd test
chfn -f 'Test User' test
/usr/sbin/usermod -p '$1$þAìÑ0Üòq$nUstYoiwgaCXoQxre7cI1.' test
cd /mnt
mkdir cdrom2
mount /dev/cdrom /mnt/cdrom2
cp /mnt/cdrom2/ks.cfg /mnt/sysimage/root/
umount /dev/cdrom2

You should just use /root in the %post section, not /mnt/sysimage/root.



%post --nochroot
cd /mnt
mkdir floppy
mkdir cdrom
mount /dev/fd0 /mnt/floppy
mount /dev/cdrom /mnt/source
cp /mnt/floppy/splash.lss /mnt/sysimage/root/
cp /mnt/source/EULA /mnt/sysimage/root/

Here is the one of the console output
* Running kickstart %post scripts(s)
Changing finger information for test.
Finger information changed
Mount: special device /dev/cdrom does not exist
Cp: cannot stat '/mnt/cdrom2/ks.cfg': no such file or directory
Umount: /dev/cdrom2: not found
* WARNING - Error code 256 encountered running a kickstart %pre%post script
mount: Mounting /dev/cdrom on /mnt/source failed: No such file or directory
cp: cannot stat '/mnt'source/EULA': So such file or directory
* WARNING - Error code 256 encountered running a kickstart %pre%post script
* All kickstart %post scripts(s) have been run
* moving (1) to step methodcomplete
* ejecting CD
* moving (1) to step complete

From the console, take a look at /dev (`ls -l /dev`) in the non-chroot environment (both during and after %post). This may give you a clue. Most likely, the /dev/cdrom link doesn't exist. Instead use /dev/hdc, /dev/scd0, etc., depending on your CD-ROM type and location.

Forrest
--






[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux