- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: kickstart issues in %post section
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2008 02:48 PM
тАО03-06-2008 02:48 PM
kickstart issues in %post section
I've been successfully doing network kickstarts for some time now, but needed to create an "all-inclusive" CDROM/(virtual CDROM via ISO image) kickstart for automated builds with no PXE/NFS/HTTP services to a physical box or VMware VM.
I generate the ISO file with custom ks.cfg & a directory with additional rpms & scripts....it boots up just fine, does what the kickstart file wants it to, up to the %post section, then stuff breaks down bigtime.
I really want to just set a few variables then cp the main post script from the cdrom to the system & execute it. I have put several echos in the %post to find out what's going on. Apparently there is a very limited shell environment at this stage...why is this different from a network build?? (Here's my post section, simplified way beyond the original so I could troubleshoot it:
%post --nochroot
echo "Here is what we have mounted" > /mnt/sysimage/opt/POST.txt
df -k >> /mnt/sysimage/opt/POST.txt
cp /cdrom/third-party/rhel_post.bash /mnt/sysimage/opt/rhel_post.bash
%post
#!/bin/bash
echo "Entering POST section" >> /opt/POST.txt
echo $SHELL >> /opt/POST.txt
ls -la /opt >> /opt/POST.txt
#export METHOD=NETWORK
export METHOD=CDROM
echo "METHOD=${METHOD}" >> /opt/POST.txt
export VER=RHEL5_32
echo "VERSION=${VER}" >> /opt/POST.txt
#
#/bin/mount -t iso96660 -o ro /dev/cdrom /cdrom
[ -f /opt/rhel_post.bash ] && cd /opt
bash -x /opt/rhel_post.bash ${VER} ${METHOD} >> /opt/POST.txt 2>&1
#####################
The ONLY output I get are a few of the echos to a file called /opt/POST.txt? (yes, with a ? at the end of it - dunno where that comes from)
The rhel_post.bash script of course never gets copied or run...
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2008 03:15 PM
тАО03-06-2008 03:15 PM
Re: kickstart issues in %post section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2008 03:46 PM
тАО03-06-2008 03:46 PM
Re: kickstart issues in %post section
/bin/bash -x ........
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2008 03:51 PM
тАО03-06-2008 03:51 PM
Re: kickstart issues in %post section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2008 06:47 PM
тАО03-06-2008 06:47 PM
Re: kickstart issues in %post section
In a --nochroot environment, I've ascertained what is mounted & available:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev 127812 0 127812 0% /dev
/tmp/loop0 83264 83264 0 100% /mnt/runtime
/dev/System/root 6094400 1288952 4490876 23% /mnt/sysimage
/dev/System/tmp 4062912 139396 3713804 4% /mnt/sysimage/tmp
/dev/System/csm 507748 18768 462766 4% /mnt/sysimage/csm
/tmp/sda1 124427 11727 106276 10% /mnt/sysimage/boot
/dev 127812 0 127812 0% /mnt/sysimage/dev
So, logic would tell me that I could mount my cdrom up like so:
/mnt/sysimage/bin/mount /dev/cdrom /mnt/sysimage/media
But this does not work....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2008 05:52 AM
тАО03-07-2008 05:52 AM
Re: kickstart issues in %post section
%post --nochroot
/mnt/sysimage/bin/mount /dev/cdrom /mnt/sysimage/media
echo "Here is what we have mounted" > /mnt/sysimage/opt/POST.txt
df -k >> /mnt/sysimage/opt/POST.txt
/mnt/sysimage/bin/cp /media/third-party/rhel_post.bash /mnt/sysimage/opt/rhel_post.bash
%post
#!/bin/bash
echo "Entering POST section" >> /opt/POST.txt
echo $SHELL >> /opt/POST.txt
ls -la /opt >> /opt/POST.txt
#export METHOD=NETWORK
export METHOD=CDROM
echo "METHOD=${METHOD}" >> /opt/POST.txt
export VER=RHEL5_32
echo "VERSION=${VER}" >> /opt/POST.txt
#
[ -f /opt/rhel_post.bash ] && cd /opt
bash -x /opt/rhel_post.bash ${VER} ${METHOD} >> /opt/POST.txt 2>&1
#####################
CONTENTS of output file: /opt/POST.txt? :
Here is what we have mounted
Filesystem 1K-blocks Used Available Use% Mounted on
/dev 127812 0 127812 0% /dev
/tmp/loop0 83264 83264 0 100% /mnt/runtime
/dev/System/root 6094400 1288952 4490876 23% /mnt/sysimage
/dev/System/tmp 4062912 139396 3713804 4% /mnt/sysimage/tmp
/dev/System/csm 507748 18768 462766 4% /mnt/sysimage/csm
/tmp/sda1 124427 11727 106276 10% /mnt/sysimage/boot
/dev 127812 0 127812 0% /mnt/sysimage/dev
Entering POST section
/bin/bash
total 24
drwxr-xr-x 2 root root 4096 Mar 6 19:00 .
drwxr-xr-x 23 root root 4096 Mar 6 19:00 ..
-rw-r--r-- 1 root root 625 Mar 6 19:00 POST.txt
METHOD=CDROM
VERSION=RHEL5_32
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2008 11:45 AM
тАО03-07-2008 11:45 AM
Re: kickstart issues in %post section
# ls -ld /dev/cdrom
lrwxrwxrwx 1 root root 3 Sep 10 12:45 /dev/cdrom -> hda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2008 01:30 PM
тАО03-07-2008 01:30 PM