From cmura at virginia.edu Tue Jan 6 15:48:39 2009 From: cmura at virginia.edu (Cameron Mura) Date: Tue, 06 Jan 2009 10:48:39 -0500 Subject: auto-configure NTP in Kickstart? Message-ID: <49637D57.2040209@virginia.edu> Hi all, Does anyone know how to setup NTP info via kickstart ? More specifically, I'd like to do the following on Fedora 10 systems via the kickstart mechanism: 1) Specify NTP servers (e.g., ntp1.virginia.edu, ntp2.virginia.edu, ...) 2) Enable / activate NTP -- I.e., What one would get by running 'system-config-time' and clicking the "Enable Network Time Protocol" box. I know this stuff can set manually, post-installation, via the system-config-time route, and that it also can be setup immediately after a kickstart-based install by setting "firstboot --enable" to run the Setup Agent upon first reboot (...and then manually entering the info at that screen.) But seems as though this could be done at the kickstart level ?? I couldn't find anything on ntp-in-kickstart in the Anaconda Kickstart reference at http://fedoraproject.org/wiki/Anaconda/Kickstart or by searching around the web. I naively did the following in a ks file to modify ntp.conf, but that doesn't actually 'enable' ntp on the system: > cat >> /etc/ntp.conf < server ntp1.virginia.edu dynamic > server ntp2.virginia.edu dynamic > server ntp3.virginia.edu dynamic > EOF_ntpconfig Any tips (or pointers to possible advice) would be most sincerely appreciated... Cameron -------------- next part -------------- An HTML attachment was scrubbed... URL: From hhoffman at ip-solutions.net Tue Jan 6 16:01:40 2009 From: hhoffman at ip-solutions.net (Harry Hoffman) Date: Tue, 06 Jan 2009 11:01:40 -0500 Subject: auto-configure NTP in Kickstart? In-Reply-To: <49637D57.2040209@virginia.edu> References: <49637D57.2040209@virginia.edu> Message-ID: <1231257700.15503.6.camel@n1-14-96.dhcp.drexel.edu> 1) perl -p -i -e 's/0.fedora.pool.ntp.org/NTP_SERVER_0/' /etc/ntp.conf perl -p -i -e 's/1.fedora.pool.ntp.org/NTP_SERVER_1/' /etc/ntp.conf perl -p -i -e 's/2.fedora.pool.ntp.org/NTP_SERVER_2/' /etc/ntp.conf (the above is if your already chrooted in kickstart) 2) chkconfig ntp on On Tue, 2009-01-06 at 10:48 -0500, Cameron Mura wrote: > Hi all, > > Does anyone know how to setup NTP info via kickstart ? More > specifically, I'd like to do the following on Fedora 10 systems via > the kickstart mechanism: > > 1) Specify NTP servers (e.g., ntp1.virginia.edu, > ntp2.virginia.edu, ...) > > 2) Enable / activate NTP -- I.e., What one would get by running > 'system-config-time' and clicking the "Enable Network Time Protocol" > box. > > I know this stuff can set manually, post-installation, via the > system-config-time route, and that it also can be setup immediately > after a kickstart-based install by setting "firstboot --enable" to run > the Setup Agent upon first reboot (...and then manually entering the > info at that screen.) But seems as though this could be done at the > kickstart level ?? > > I couldn't find anything on ntp-in-kickstart in the Anaconda Kickstart > reference at http://fedoraproject.org/wiki/Anaconda/Kickstart or by > searching around the web. I naively did the following in a ks file to > modify ntp.conf, but that doesn't actually 'enable' ntp on the system: > > cat >> /etc/ntp.conf < > server ntp1.virginia.edu dynamic > > server ntp2.virginia.edu dynamic > > server ntp3.virginia.edu dynamic > > EOF_ntpconfig > Any tips (or pointers to possible advice) would be most sincerely > appreciated... > > Cameron > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list From bschneiders at woti.com Tue Jan 6 16:02:16 2009 From: bschneiders at woti.com (Bryan Schneiders) Date: Tue, 06 Jan 2009 11:02:16 -0500 Subject: auto-configure NTP in Kickstart? In-Reply-To: <49637D57.2040209@virginia.edu> References: <49637D57.2040209@virginia.edu> Message-ID: <49638088.4080005@woti.com> Our machines get NTP server information from DHCP, so I just comment out the default servers in the post section with sed: sed -i.orig -e "s/\(server [0-9].fedora.pool.ntp.org dynamic\)/#\1/" /etc/ntp.conf I believe you can enable ntp with the "services" command in the top of the kickstart file. services --enabled=ntpd Bryan Schneiders Cameron Mura wrote: > Hi all, > > Does anyone know how to setup NTP info via kickstart ? More > specifically, I'd like to do the following on Fedora 10 systems via the > kickstart mechanism: > > 1) Specify NTP servers (e.g., ntp1.virginia.edu, ntp2.virginia.edu, ...) > > 2) Enable / activate NTP -- I.e., What one would get by running > 'system-config-time' and clicking the "Enable Network Time Protocol" box. > > I know this stuff can set manually, post-installation, via the > system-config-time route, and that it also can be setup immediately > after a kickstart-based install by setting "firstboot --enable" to run > the Setup Agent upon first reboot (...and then manually entering the > info at that screen.) But seems as though this could be done at the > kickstart level ?? > > I couldn't find anything on ntp-in-kickstart in the Anaconda Kickstart > reference at http://fedoraproject.org/wiki/Anaconda/Kickstart or by > searching around the web. I naively did the following in a ks file to > modify ntp.conf, but that doesn't actually 'enable' ntp on the system: >> cat >> /etc/ntp.conf <> server ntp1.virginia.edu dynamic >> server ntp2.virginia.edu dynamic >> server ntp3.virginia.edu dynamic >> EOF_ntpconfig > Any tips (or pointers to possible advice) would be most sincerely > appreciated... > > Cameron > > > ------------------------------------------------------------------------ > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list From jarle at bjorgeengen.net Tue Jan 6 16:06:26 2009 From: jarle at bjorgeengen.net (=?ISO-8859-1?Q?Jarle_Bj=F8rgeengen?=) Date: Tue, 6 Jan 2009 17:06:26 +0100 Subject: auto-configure NTP in Kickstart? In-Reply-To: <49637D57.2040209@virginia.edu> References: <49637D57.2040209@virginia.edu> Message-ID: On Jan 6, 2009, at 4:48 , Cameron Mura wrote: > Hi all, > > Does anyone know how to setup NTP info via kickstart ? More > specifically, I'd like to do the following on Fedora 10 systems via > the kickstart mechanism: > > 1) Specify NTP servers (e.g., ntp1.virginia.edu, > ntp2.virginia.edu, ...) > Just use cat << EOF > /etc/ntp.conf whatever you want to be in ntp.conf EOF in your %post section > 2) Enable / activate NTP -- I.e., What one would get by running > 'system-config-time' and clicking the "Enable Network Time Protocol" > box. > chkconfig ntp on in the %post I also recommend man chkconfig > I know this stuff can set manually, post-installation, via the > system-config-time route, and that it also can be setup immediately > after a kickstart-based install by setting "firstboot --enable" to > run the Setup Agent upon first reboot (...and then manually entering > the info at that screen.) But seems as though this could be done > at the kickstart level ?? > > I couldn't find anything on ntp-in-kickstart in the Anaconda > Kickstart reference at http://fedoraproject.org/wiki/Anaconda/Kickstart > or by searching around the web. I naively did the following in a > ks file to modify ntp.conf, but that doesn't actually 'enable' ntp > on the system: >> cat >> /etc/ntp.conf <> server ntp1.virginia.edu dynamic >> server ntp2.virginia.edu dynamic >> server ntp3.virginia.edu dynamic >> EOF_ntpconfig Ah, so you have already the answer to Q1 ;-) > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Best regards .~. Jarle Bj?rgeengen /V\ Mob: +47 9155 7978 // \\ http://www.uio.no/sok?person=jb /( )\ while(<>){if(s/^(.*\?)$/42 !/){print "$1 $_"}} ^`~'^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From chris1.noreply at googlemail.com Thu Jan 8 09:59:51 2009 From: chris1.noreply at googlemail.com (Chris) Date: Thu, 8 Jan 2009 09:59:51 +0000 Subject: How are DVDs identified by anaconda? Message-ID: I've built a Fedora 9 based installation DVD using revisor and it's working fine but I needed to add some files to the root directory on the DVD. I've been able to do this using a program called IsoMaster which opens the ISO, allows me to add files, then rebuilds the ISO. This works fine except that it's a manually GUI-only operation and I need to script it. So now in my script I mount the ISO as a loop device, add the files, then recreate the ISO using genisoimage. This seems to work OK at first, when I boot from the DVD I get the boot menu and can choose the install option but when anaconda starts up it tells me to insert the correct DVD. So my question is, how is the DVD identified? I thought it was by the ISO label but I've been careful to make sure that this is preserved to be the same as that generated by revisor - although I will go and double-check this. I'm sure this must be possible because it works when I do it manually using IsoMaster, but I'm clearly going wrong somewhere. Any suggestions welcome! Thanks, Chris. From bschneiders at woti.com Thu Jan 8 14:27:45 2009 From: bschneiders at woti.com (Bryan Schneiders) Date: Thu, 08 Jan 2009 09:27:45 -0500 Subject: How are DVDs identified by anaconda? In-Reply-To: References: Message-ID: <49660D61.1040505@woti.com> Does your new ISO include the .discinfo and .treeinfo files from the root of the original DVD? Bryan Schneiders Chris wrote: > I've built a Fedora 9 based installation DVD using revisor and it's > working fine but I needed to add some files to the root directory on > the DVD. I've been able to do this using a program called IsoMaster > which opens the ISO, allows me to add files, then rebuilds the ISO. > This works fine except that it's a manually GUI-only operation and I > need to script it. > > So now in my script I mount the ISO as a loop device, add the files, > then recreate the ISO using genisoimage. This seems to work OK at > first, when I boot from the DVD I get the boot menu and can choose the > install option but when anaconda starts up it tells me to insert the > correct DVD. > > So my question is, how is the DVD identified? I thought it was by the > ISO label but I've been careful to make sure that this is preserved to > be the same as that generated by revisor - although I will go and > double-check this. > > I'm sure this must be possible because it works when I do it manually > using IsoMaster, but I'm clearly going wrong somewhere. > > Any suggestions welcome! > > Thanks, Chris. > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list From chris1.noreply at googlemail.com Thu Jan 8 14:37:34 2009 From: chris1.noreply at googlemail.com (Chris) Date: Thu, 8 Jan 2009 14:37:34 +0000 Subject: How are DVDs identified by anaconda? In-Reply-To: <49660D61.1040505@woti.com> References: <49660D61.1040505@woti.com> Message-ID: 2009/1/8 Bryan Schneiders : > Does your new ISO include the .discinfo and .treeinfo files from the root of > the original DVD? No it doesn't! Well spotted. After I mount the original ISO as a loop device, I have to copy it to another location before I can copy my files into the tree since you can't copy files in there in-place. My copy command was missing out the hidden files. Thank you very much. Chris. From cmura at virginia.edu Thu Jan 8 16:01:33 2009 From: cmura at virginia.edu (Cameron Mura) Date: Thu, 08 Jan 2009 11:01:33 -0500 Subject: Kickstart-list Digest, Vol 59, Issue 1 In-Reply-To: <20090106170022.5896E619C09@hormel.redhat.com> References: <20090106170022.5896E619C09@hormel.redhat.com> Message-ID: <4966235D.9040603@virginia.edu> Hi Harry, Bryan, & Jarle, Thanks a lot for the useful tips and suggestions -- I've got my kickstart / ntp problem fixed now; it was simply my own misunderstanding in thinking that the 'd' in the 'ntpd' init process meant purely server behavior (rather than ntp client too) and therefore not considering activating this service. All the best, Cameron === kickstart-list-request at redhat.com wrote (on 01/06/2009 12:00 PM): === > Today's Topics: > > 1. auto-configure NTP in Kickstart? (Cameron Mura) > 2. Re: auto-configure NTP in Kickstart? (Harry Hoffman) > 3. Re: auto-configure NTP in Kickstart? (Bryan Schneiders) > 4. Re: auto-configure NTP in Kickstart? (Jarle Bj?rgeengen) > > > ------------------------------------------------------------------------ > > Subject: > auto-configure NTP in Kickstart? > From: > Cameron Mura > Date: > Tue, 06 Jan 2009 10:48:39 -0500 > To: > kickstart-list at redhat.com, Fedora Mailing List > , uvalug at virginia.edu > > To: > kickstart-list at redhat.com, Fedora Mailing List > , uvalug at virginia.edu > CC: > > > Hi all, > > Does anyone know how to setup NTP info via kickstart ? More > specifically, I'd like to do the following on Fedora 10 systems via > the kickstart mechanism: > > 1) Specify NTP servers (e.g., ntp1.virginia.edu, ntp2.virginia.edu, ...) > > 2) Enable / activate NTP -- I.e., What one would get by running > 'system-config-time' and clicking the "Enable Network Time Protocol" box. > > I know this stuff can set manually, post-installation, via the > system-config-time route, and that it also can be setup immediately > after a kickstart-based install by setting "firstboot --enable" to run > the Setup Agent upon first reboot (...and then manually entering the > info at that screen.) But seems as though this could be done at the > kickstart level ?? > > I couldn't find anything on ntp-in-kickstart in the Anaconda Kickstart > reference at http://fedoraproject.org/wiki/Anaconda/Kickstart or by > searching around the web. I naively did the following in a ks file to > modify ntp.conf, but that doesn't actually 'enable' ntp on the system: >> cat >> /etc/ntp.conf <> server ntp1.virginia.edu dynamic >> server ntp2.virginia.edu dynamic >> server ntp3.virginia.edu dynamic >> EOF_ntpconfig > Any tips (or pointers to possible advice) would be most sincerely > appreciated... > > Cameron > > ------------------------------------------------------------------------ > > Subject: > Re: auto-configure NTP in Kickstart? > From: > Harry Hoffman > Date: > Tue, 06 Jan 2009 11:01:40 -0500 > To: > cmura at virginia.edu, Discussion list about Kickstart > > > To: > cmura at virginia.edu, Discussion list about Kickstart > > CC: > > > 1) perl -p -i -e 's/0.fedora.pool.ntp.org/NTP_SERVER_0/' /etc/ntp.conf > perl -p -i -e 's/1.fedora.pool.ntp.org/NTP_SERVER_1/' /etc/ntp.conf > perl -p -i -e 's/2.fedora.pool.ntp.org/NTP_SERVER_2/' /etc/ntp.conf > (the above is if your already chrooted in kickstart) > > 2) chkconfig ntp on > > > > On Tue, 2009-01-06 at 10:48 -0500, Cameron Mura wrote: > >> Hi all, >> >> Does anyone know how to setup NTP info via kickstart ? More >> specifically, I'd like to do the following on Fedora 10 systems via >> the kickstart mechanism: >> >> 1) Specify NTP servers (e.g., ntp1.virginia.edu, >> ntp2.virginia.edu, ...) >> >> 2) Enable / activate NTP -- I.e., What one would get by running >> 'system-config-time' and clicking the "Enable Network Time Protocol" >> box. >> >> I know this stuff can set manually, post-installation, via the >> system-config-time route, and that it also can be setup immediately >> after a kickstart-based install by setting "firstboot --enable" to run >> the Setup Agent upon first reboot (...and then manually entering the >> info at that screen.) But seems as though this could be done at the >> kickstart level ?? >> >> I couldn't find anything on ntp-in-kickstart in the Anaconda Kickstart >> reference at http://fedoraproject.org/wiki/Anaconda/Kickstart or by >> searching around the web. I naively did the following in a ks file to >> modify ntp.conf, but that doesn't actually 'enable' ntp on the system: >> >>> cat >> /etc/ntp.conf <>> server ntp1.virginia.edu dynamic >>> server ntp2.virginia.edu dynamic >>> server ntp3.virginia.edu dynamic >>> EOF_ntpconfig >>> >> Any tips (or pointers to possible advice) would be most sincerely >> appreciated... >> >> Cameron >> _______________________________________________ >> Kickstart-list mailing list >> Kickstart-list at redhat.com >> https://www.redhat.com/mailman/listinfo/kickstart-list >> > > > > > ------------------------------------------------------------------------ > > Subject: > Re: auto-configure NTP in Kickstart? > From: > Bryan Schneiders > Date: > Tue, 06 Jan 2009 11:02:16 -0500 > To: > cmura at virginia.edu, Discussion list about Kickstart > > > To: > cmura at virginia.edu, Discussion list about Kickstart > > CC: > > > Our machines get NTP server information from DHCP, so I just comment > out the default servers in the post section with sed: > > sed -i.orig -e "s/\(server [0-9].fedora.pool.ntp.org dynamic\)/#\1/" > /etc/ntp.conf > > I believe you can enable ntp with the "services" command in the top of > the kickstart file. > > services --enabled=ntpd > > Bryan Schneiders > > Cameron Mura wrote: >> Hi all, >> >> Does anyone know how to setup NTP info via kickstart ? More >> specifically, I'd like to do the following on Fedora 10 systems via >> the kickstart mechanism: >> >> 1) Specify NTP servers (e.g., ntp1.virginia.edu, ntp2.virginia.edu, ...) >> >> 2) Enable / activate NTP -- I.e., What one would get by running >> 'system-config-time' and clicking the "Enable Network Time Protocol" >> box. >> >> I know this stuff can set manually, post-installation, via the >> system-config-time route, and that it also can be setup immediately >> after a kickstart-based install by setting "firstboot --enable" to >> run the Setup Agent upon first reboot (...and then manually entering >> the info at that screen.) But seems as though this could be done at >> the kickstart level ?? >> >> I couldn't find anything on ntp-in-kickstart in the Anaconda >> Kickstart reference at >> http://fedoraproject.org/wiki/Anaconda/Kickstart or by searching >> around the web. I naively did the following in a ks file to modify >> ntp.conf, but that doesn't actually 'enable' ntp on the system: >>> cat >> /etc/ntp.conf <>> server ntp1.virginia.edu dynamic >>> server ntp2.virginia.edu dynamic >>> server ntp3.virginia.edu dynamic >>> EOF_ntpconfig >> Any tips (or pointers to possible advice) would be most sincerely >> appreciated... >> >> Cameron >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Kickstart-list mailing list >> Kickstart-list at redhat.com >> https://www.redhat.com/mailman/listinfo/kickstart-list > > > > ------------------------------------------------------------------------ > > Subject: > Re: auto-configure NTP in Kickstart? > From: > Jarle Bj?rgeengen > Date: > Tue, 6 Jan 2009 17:06:26 +0100 > To: > cmura at virginia.edu, Discussion list about Kickstart > > > To: > cmura at virginia.edu, Discussion list about Kickstart > > CC: > Fedora Mailing List , uvalug at virginia.edu > > > > On Jan 6, 2009, at 4:48 , Cameron Mura wrote: > >> Hi all, >> >> Does anyone know how to setup NTP info via kickstart ? More >> specifically, I'd like to do the following on Fedora 10 systems via >> the kickstart mechanism: >> >> 1) Specify NTP servers (e.g., ntp1.virginia.edu, ntp2.virginia.edu, ...) >> > > Just use > > cat << EOF > /etc/ntp.conf > whatever > you > want > to be in > ntp.conf > EOF > > in your %post section > >> 2) Enable / activate NTP -- I.e., What one would get by running >> 'system-config-time' and clicking the "Enable Network Time Protocol" >> box. >> > > chkconfig ntp on > > in the %post > > I also recommend man chkconfig > >> I know this stuff can set manually, post-installation, via the >> system-config-time route, and that it also can be setup immediately >> after a kickstart-based install by setting "firstboot --enable" to >> run the Setup Agent upon first reboot (...and then manually entering >> the info at that screen.) But seems as though this could be done at >> the kickstart level ?? >> >> I couldn't find anything on ntp-in-kickstart in the Anaconda >> Kickstart reference at >> http://fedoraproject.org/wiki/Anaconda/Kickstart or by searching >> around the web. I naively did the following in a ks file to modify >> ntp.conf, but that doesn't actually 'enable' ntp on the system: >>> cat >> /etc/ntp.conf <>> server ntp1.virginia.edu dynamic >>> server ntp2.virginia.edu dynamic >>> server ntp3.virginia.edu dynamic >>> EOF_ntpconfig > > Ah, so you have already the answer to Q1 ;-) > >> > > ------------------------------------------------------------------------ > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From kanarip at kanarip.com Sun Jan 11 16:52:05 2009 From: kanarip at kanarip.com (Jeroen van Meeuwen) Date: Sun, 11 Jan 2009 11:52:05 -0500 Subject: How are DVDs identified by anaconda? In-Reply-To: References: Message-ID: <496A23B5.8080904@kanarip.com> Chris wrote: > I've built a Fedora 9 based installation DVD using revisor and it's > working fine but I needed to add some files to the root directory on > the DVD. I've been able to do this using a program called IsoMaster > which opens the ISO, allows me to add files, then rebuilds the ISO. > This works fine except that it's a manually GUI-only operation and I > need to script it. > Not sure why the files need to be in the root of the DVD, but Revisor allows you to specify copy_dir which is then copied (recursively) into a files/ subdirectory on the DVD. -Jeroen From chris1.noreply at googlemail.com Mon Jan 12 09:31:15 2009 From: chris1.noreply at googlemail.com (Chris) Date: Mon, 12 Jan 2009 09:31:15 +0000 Subject: How are DVDs identified by anaconda? In-Reply-To: <496A23B5.8080904@kanarip.com> References: <496A23B5.8080904@kanarip.com> Message-ID: 2009/1/11 Jeroen van Meeuwen : > Not sure why the files need to be in the root of the DVD, but Revisor allows > you to specify copy_dir which is then copied (recursively) into a files/ > subdirectory on the DVD. One of the files I needed to add was a dreaded autorun.inf (don't ask!) so I really needed to access the root directory. Turned out I was just missing the hidden files in the ISO tree. It's all working now. Many thanks, Chris. From larry.brigman at gmail.com Tue Jan 13 23:11:18 2009 From: larry.brigman at gmail.com (Larry Brigman) Date: Tue, 13 Jan 2009 15:11:18 -0800 Subject: kickstart fails to process %pre event Message-ID: I have a kickstart file for doing RHEL5 installs. It works just fine but now as we have moved to having more than one disk in the systems; this automated install breaks as it cannot determine which disk to install the system on. I could write multiple kickstart files to handle 1,6,12,18,24,36 and 48 disk installs but I shouldn't need to. I have added a %pre script, instead, to the file to handle this case but it doesn't seem to even be run. We are doing the installs from pxeboot. I look at the /tmp/ks.cfg file and it has the %pre script embedded but the file that it creates when executed doesn't. The logging page (ctrl+alt+F3) does not show that the script was processed. Additional info 2.6.18-53 RHEL5 kernel anaconda-11.1.2.87-1 How do I troubleshoot this problem? Below is my kickstart file ----------------------------- #platform=x86, AMD64, or Intel EM64T # System authorization information auth --useshadow --enablemd5 # Clear the Master Boot Record zerombr #dynamic drive install # cmdline causes no-interaction installs cmdline # Use text install text # use graphical install # graphical # disable asking for key on install key --skip # Firewall configuration firewall --disabled # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang en_US # Installation logging level logging --level=info # Install OS instead of upgrade install # Use network installation # area51 # CD Image loop mounted or copied (must match booted image) url --url=http://10.109.0.46/repo/RHEL5/VOD repo --name=packages --baseurl=http://10.109.0.46/packages repo --name=EL5-latest --baseurl=http://10.109.0.46/repo/RHEL5/x86_64/ # Network information # SELinux configuration selinux --disabled # System timezone timezone --isUtc America/Los_Angeles # X Window System configuration information #xconfig --defaultdesktop=GNOME --depth=8 --resolution=800x600 --startxonboot #reboot %packages --nobase kernel bash passwd mkinitrd grub coreutils httpd openssh-server openssh-clients ftp kexec-tools rootfiles sudo sysklogd smartmontools yum ntp mdadm traceroute strace man bind-utils tcpdump logrotate audit # extra tools sysstat gdb vim-minimal which #remove un-used packages -libhugetlbfs.i386 -libtermcap.i386 -system-config-securitylevel-tui -policycoreutils -librpm.i386 -zlib.i386 -sqlite.i386 -beecrypt.i386 -elfutils-libelf.i386 -sysreport -rp-pppoe -NetworkManager -aspell* -words -bluez* -ypbind -yptools -nc %pre --interpreter /bin/sh #!/bin/sh # assumes all disks for install are on the scsi bus echo "pre kickstart script is running" >/tmp/pre-kickstart.out #path for file outfile=/tmp/part-include get_disk_paths() { for d in `echo /sys/bus/scsi/devices/*`; do [ -d $d/block* ] && echo $d/block* done } convert_path_to_dev_name() { echo $1 | sed -e 's/^.*block\://' } get_queue_type() { file=$(dirname $1)/queue_type if [ -f $file ]; then cat $file else echo "no queue type" fi } get_disk_size() { file=$1/size if [ -f $file ]; then cat $file else echo 0 fi } is_removable() { cat $1/removable } all_disks=$(get_disk_paths) all_dev_names=$(for d in $all_disks; do convert_path_to_dev_name $d; done) #echo $all_disks #echo $all_dev_names install_disk="" install_dev="" for dev in $all_disks; do #here is our test for USB flash device #No queuing and is_removable if [ $(get_queue_type $dev) == "none" ] && [ $(is_removable $dev) -eq 1 ] ;then install_disk=$dev install_dev=$(convert_path_to_dev_name $dev) fi done #no USB flash device use all of first disk if [ -z "$install_disk" ]; then $install_disk=$(echo $all_disk | cut -d' ' -f1) $install_dev=$(convert_path_to_dev_name $install_disk) fi install_dev_size=$(get_disk_size $install_disk) #echo $install_disk #echo $install_dev #echo $install_dev_size size_kblks=$[ $install_dev_size / 2 ] size_Mblks=$[ size_kblks / 1000 ] boot_size=100 swap_size=500 root_size=$[ $size_Mblks - $boot_size - $swap_size ] cat <$outfile #partitioning info starts here clearpart --drives=$(echo $all_dev_names | tr ' ' ,) --all --initlabel ignoredisk --drives=$(echo ${all_dev_names/$install_dev/} | tr ' ' , ) part / --fstype=ext3 --ondisk=$install_dev --size=$root_size --asprimary part /boot --fstype=ext2 --ondisk=$install_dev --size=$boot_size --asprimary part swap --fstype=swap --ondisk=$install_dev --size=$swap_size --asprimary #autopart # System bootloader configuration bootloader --append="rhgb quiet crashkernel=128M at 16M console=tty1 console=ttyS0,38400n8" --location=mbr --driveorder=$install_dev EOF %post #update dns and nameservers cat >/etc/resolv.conf</etc/yum.repos.d/packages.repo</etc/yum.repos.d/rhel5_local.repo<>/etc/inittab <>/etc/fstab<> /etc/hosts # update network file for gateway echo "GATEWAY=$GATEWAY" >>/etc/sysconfig/network echo update ifcfg-eth0 for static ( cd /etc/sysconfig/network-scripts sed -i -e "s/dhcp/static/" ifcfg-eth0 cat >>ifcfg-eth0 <> /etc/rc.d/rc.sysinit # update other ethernet interfaces HOSTNUM=$[ $(echo $HOSTNAME | perl -ln -e '/([1-9]+)$/; print "$1";') % 255] for e in 2 3 4 5 6 7 8 9 do file=/etc/sysconfig/network-scripts/ifcfg-eth${e} if [ -e $file ] ; then netnum=$[ ${e} + 100 ] sed -i -e "s/ONBOOT=no/ONBOOT=yes\n\ IPADDR=172.25.${HOSTNUM}.${netnum} \n\ NETMASK=255.255.0.0 \n\ BOOTPROTO=static \ /" $file if [ ${e} -eq 2 ]; then cat >/etc/ethers.eth${e}< References: Message-ID: The best way I've found for troubleshooting pre or post scripting errors is to simply put a sleep statement in the pre or post, then manually walk through the script and see where it fails. %pre Sleep 9999999999999 Chip -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Larry Brigman Sent: Tuesday, January 13, 2009 3:11 PM To: kickstart-list at redhat.com Subject: kickstart fails to process %pre event I have a kickstart file for doing RHEL5 installs. It works just fine but now as we have moved to having more than one disk in the systems; this automated install breaks as it cannot determine which disk to install the system on. I could write multiple kickstart files to handle 1,6,12,18,24,36 and 48 disk installs but I shouldn't need to. I have added a %pre script, instead, to the file to handle this case but it doesn't seem to even be run. We are doing the installs from pxeboot. I look at the /tmp/ks.cfg file and it has the %pre script embedded but the file that it creates when executed doesn't. The logging page (ctrl+alt+F3) does not show that the script was processed. Additional info 2.6.18-53 RHEL5 kernel anaconda-11.1.2.87-1 How do I troubleshoot this problem? Below is my kickstart file ----------------------------- #platform=x86, AMD64, or Intel EM64T # System authorization information auth --useshadow --enablemd5 # Clear the Master Boot Record zerombr #dynamic drive install # cmdline causes no-interaction installs cmdline # Use text install text # use graphical install # graphical # disable asking for key on install key --skip # Firewall configuration firewall --disabled # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang en_US # Installation logging level logging --level=info # Install OS instead of upgrade install # Use network installation # area51 # CD Image loop mounted or copied (must match booted image) url --url=http://10.109.0.46/repo/RHEL5/VOD repo --name=packages --baseurl=http://10.109.0.46/packages repo --name=EL5-latest --baseurl=http://10.109.0.46/repo/RHEL5/x86_64/ # Network information # SELinux configuration selinux --disabled # System timezone timezone --isUtc America/Los_Angeles # X Window System configuration information #xconfig --defaultdesktop=GNOME --depth=8 --resolution=800x600 --startxonboot #reboot %packages --nobase kernel bash passwd mkinitrd grub coreutils httpd openssh-server openssh-clients ftp kexec-tools rootfiles sudo sysklogd smartmontools yum ntp mdadm traceroute strace man bind-utils tcpdump logrotate audit # extra tools sysstat gdb vim-minimal which #remove un-used packages -libhugetlbfs.i386 -libtermcap.i386 -system-config-securitylevel-tui -policycoreutils -librpm.i386 -zlib.i386 -sqlite.i386 -beecrypt.i386 -elfutils-libelf.i386 -sysreport -rp-pppoe -NetworkManager -aspell* -words -bluez* -ypbind -yptools -nc %pre --interpreter /bin/sh #!/bin/sh # assumes all disks for install are on the scsi bus echo "pre kickstart script is running" >/tmp/pre-kickstart.out #path for file outfile=/tmp/part-include get_disk_paths() { for d in `echo /sys/bus/scsi/devices/*`; do [ -d $d/block* ] && echo $d/block* done } convert_path_to_dev_name() { echo $1 | sed -e 's/^.*block\://' } get_queue_type() { file=$(dirname $1)/queue_type if [ -f $file ]; then cat $file else echo "no queue type" fi } get_disk_size() { file=$1/size if [ -f $file ]; then cat $file else echo 0 fi } is_removable() { cat $1/removable } all_disks=$(get_disk_paths) all_dev_names=$(for d in $all_disks; do convert_path_to_dev_name $d; done) #echo $all_disks #echo $all_dev_names install_disk="" install_dev="" for dev in $all_disks; do #here is our test for USB flash device #No queuing and is_removable if [ $(get_queue_type $dev) == "none" ] && [ $(is_removable $dev) -eq 1 ] ;then install_disk=$dev install_dev=$(convert_path_to_dev_name $dev) fi done #no USB flash device use all of first disk if [ -z "$install_disk" ]; then $install_disk=$(echo $all_disk | cut -d' ' -f1) $install_dev=$(convert_path_to_dev_name $install_disk) fi install_dev_size=$(get_disk_size $install_disk) #echo $install_disk #echo $install_dev #echo $install_dev_size size_kblks=$[ $install_dev_size / 2 ] size_Mblks=$[ size_kblks / 1000 ] boot_size=100 swap_size=500 root_size=$[ $size_Mblks - $boot_size - $swap_size ] cat <$outfile #partitioning info starts here clearpart --drives=$(echo $all_dev_names | tr ' ' ,) --all --initlabel ignoredisk --drives=$(echo ${all_dev_names/$install_dev/} | tr ' ' , ) part / --fstype=ext3 --ondisk=$install_dev --size=$root_size --asprimary part /boot --fstype=ext2 --ondisk=$install_dev --size=$boot_size --asprimary part swap --fstype=swap --ondisk=$install_dev --size=$swap_size --asprimary #autopart # System bootloader configuration bootloader --append="rhgb quiet crashkernel=128M at 16M console=tty1 console=ttyS0,38400n8" --location=mbr --driveorder=$install_dev EOF %post #update dns and nameservers cat >/etc/resolv.conf</etc/yum.repos.d/packages.repo</etc/yum.repos.d/rhel5_local.repo<>/etc/inittab <>/etc/fstab<> /etc/hosts # update network file for gateway echo "GATEWAY=$GATEWAY" >>/etc/sysconfig/network echo update ifcfg-eth0 for static ( cd /etc/sysconfig/network-scripts sed -i -e "s/dhcp/static/" ifcfg-eth0 cat >>ifcfg-eth0 <> /etc/rc.d/rc.sysinit # update other ethernet interfaces HOSTNUM=$[ $(echo $HOSTNAME | perl -ln -e '/([1-9]+)$/; print "$1";') % 255] for e in 2 3 4 5 6 7 8 9 do file=/etc/sysconfig/network-scripts/ifcfg-eth${e} if [ -e $file ] ; then netnum=$[ ${e} + 100 ] sed -i -e "s/ONBOOT=no/ONBOOT=yes\n\ IPADDR=172.25.${HOSTNUM}.${netnum} \n\ NETMASK=255.255.0.0 \n\ BOOTPROTO=static \ /" $file if [ ${e} -eq 2 ]; then cat >/etc/ethers.eth${e}< References: Message-ID: Damn outlook thinking for me... That's supposed to be a lower case S - sleep 999999999999 -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Shabazian, Chip Sent: Tuesday, January 13, 2009 3:28 PM To: Discussion list about Kickstart Subject: RE: kickstart fails to process %pre event The best way I've found for troubleshooting pre or post scripting errors is to simply put a sleep statement in the pre or post, then manually walk through the script and see where it fails. %pre Sleep 9999999999999 Chip -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Larry Brigman Sent: Tuesday, January 13, 2009 3:11 PM To: kickstart-list at redhat.com Subject: kickstart fails to process %pre event I have a kickstart file for doing RHEL5 installs. It works just fine but now as we have moved to having more than one disk in the systems; this automated install breaks as it cannot determine which disk to install the system on. I could write multiple kickstart files to handle 1,6,12,18,24,36 and 48 disk installs but I shouldn't need to. I have added a %pre script, instead, to the file to handle this case but it doesn't seem to even be run. We are doing the installs from pxeboot. I look at the /tmp/ks.cfg file and it has the %pre script embedded but the file that it creates when executed doesn't. The logging page (ctrl+alt+F3) does not show that the script was processed. Additional info 2.6.18-53 RHEL5 kernel anaconda-11.1.2.87-1 How do I troubleshoot this problem? Below is my kickstart file ----------------------------- #platform=x86, AMD64, or Intel EM64T # System authorization information auth --useshadow --enablemd5 # Clear the Master Boot Record zerombr #dynamic drive install # cmdline causes no-interaction installs cmdline # Use text install text # use graphical install # graphical # disable asking for key on install key --skip # Firewall configuration firewall --disabled # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang en_US # Installation logging level logging --level=info # Install OS instead of upgrade install # Use network installation # area51 # CD Image loop mounted or copied (must match booted image) url --url=http://10.109.0.46/repo/RHEL5/VOD repo --name=packages --baseurl=http://10.109.0.46/packages repo --name=EL5-latest --baseurl=http://10.109.0.46/repo/RHEL5/x86_64/ # Network information # SELinux configuration selinux --disabled # System timezone timezone --isUtc America/Los_Angeles # X Window System configuration information #xconfig --defaultdesktop=GNOME --depth=8 --resolution=800x600 --startxonboot #reboot %packages --nobase kernel bash passwd mkinitrd grub coreutils httpd openssh-server openssh-clients ftp kexec-tools rootfiles sudo sysklogd smartmontools yum ntp mdadm traceroute strace man bind-utils tcpdump logrotate audit # extra tools sysstat gdb vim-minimal which #remove un-used packages -libhugetlbfs.i386 -libtermcap.i386 -system-config-securitylevel-tui -policycoreutils -librpm.i386 -zlib.i386 -sqlite.i386 -beecrypt.i386 -elfutils-libelf.i386 -sysreport -rp-pppoe -NetworkManager -aspell* -words -bluez* -ypbind -yptools -nc %pre --interpreter /bin/sh #!/bin/sh # assumes all disks for install are on the scsi bus echo "pre kickstart script is running" >/tmp/pre-kickstart.out #path for file outfile=/tmp/part-include get_disk_paths() { for d in `echo /sys/bus/scsi/devices/*`; do [ -d $d/block* ] && echo $d/block* done } convert_path_to_dev_name() { echo $1 | sed -e 's/^.*block\://' } get_queue_type() { file=$(dirname $1)/queue_type if [ -f $file ]; then cat $file else echo "no queue type" fi } get_disk_size() { file=$1/size if [ -f $file ]; then cat $file else echo 0 fi } is_removable() { cat $1/removable } all_disks=$(get_disk_paths) all_dev_names=$(for d in $all_disks; do convert_path_to_dev_name $d; done) #echo $all_disks #echo $all_dev_names install_disk="" install_dev="" for dev in $all_disks; do #here is our test for USB flash device #No queuing and is_removable if [ $(get_queue_type $dev) == "none" ] && [ $(is_removable $dev) -eq 1 ] ;then install_disk=$dev install_dev=$(convert_path_to_dev_name $dev) fi done #no USB flash device use all of first disk if [ -z "$install_disk" ]; then $install_disk=$(echo $all_disk | cut -d' ' -f1) $install_dev=$(convert_path_to_dev_name $install_disk) fi install_dev_size=$(get_disk_size $install_disk) #echo $install_disk #echo $install_dev #echo $install_dev_size size_kblks=$[ $install_dev_size / 2 ] size_Mblks=$[ size_kblks / 1000 ] boot_size=100 swap_size=500 root_size=$[ $size_Mblks - $boot_size - $swap_size ] cat <$outfile #partitioning info starts here clearpart --drives=$(echo $all_dev_names | tr ' ' ,) --all --initlabel ignoredisk --drives=$(echo ${all_dev_names/$install_dev/} | tr ' ' , ) part / --fstype=ext3 --ondisk=$install_dev --size=$root_size --asprimary part /boot --fstype=ext2 --ondisk=$install_dev --size=$boot_size --asprimary part swap --fstype=swap --ondisk=$install_dev --size=$swap_size --asprimary #autopart # System bootloader configuration bootloader --append="rhgb quiet crashkernel=128M at 16M console=tty1 console=ttyS0,38400n8" --location=mbr --driveorder=$install_dev EOF %post #update dns and nameservers cat >/etc/resolv.conf</etc/yum.repos.d/packages.repo</etc/yum.repos.d/rhel5_local.repo<>/etc/inittab <>/etc/fstab<> /etc/hosts # update network file for gateway echo "GATEWAY=$GATEWAY" >>/etc/sysconfig/network echo update ifcfg-eth0 for static ( cd /etc/sysconfig/network-scripts sed -i -e "s/dhcp/static/" ifcfg-eth0 cat >>ifcfg-eth0 <> /etc/rc.d/rc.sysinit # update other ethernet interfaces HOSTNUM=$[ $(echo $HOSTNAME | perl -ln -e '/([1-9]+)$/; print "$1";') % 255] for e in 2 3 4 5 6 7 8 9 do file=/etc/sysconfig/network-scripts/ifcfg-eth${e} if [ -e $file ] ; then netnum=$[ ${e} + 100 ] sed -i -e "s/ONBOOT=no/ONBOOT=yes\n\ IPADDR=172.25.${HOSTNUM}.${netnum} \n\ NETMASK=255.255.0.0 \n\ BOOTPROTO=static \ /" $file if [ ${e} -eq 2 ]; then cat >/etc/ethers.eth${e}< References: Message-ID: I'm not getting the "All kickstart %%pre script(s) have been run" message in the logs. It is like it is not finding the "%pre" directive in the file. I even have a simple piece that should never error if it gets run. echo "pre kickstart script is running" >/tmp/pre-kickstart.out On Tue, Jan 13, 2009 at 3:30 PM, Shabazian, Chip wrote: > Damn outlook thinking for me... That's supposed to be a lower case S - > sleep 999999999999 > > -----Original Message----- > From: kickstart-list-bounces at redhat.com > [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Shabazian, Chip > Sent: Tuesday, January 13, 2009 3:28 PM > To: Discussion list about Kickstart > Subject: RE: kickstart fails to process %pre event > > The best way I've found for troubleshooting pre or post scripting errors > is to simply put a sleep statement in the pre or post, then manually > walk through the script and see where it fails. > > %pre > Sleep 9999999999999 > > Chip > > -----Original Message----- > From: kickstart-list-bounces at redhat.com > [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Larry Brigman > Sent: Tuesday, January 13, 2009 3:11 PM > To: kickstart-list at redhat.com > Subject: kickstart fails to process %pre event > > I have a kickstart file for doing RHEL5 installs. It works just fine > but now as > we have moved to having more than one disk in the systems; this > automated install > breaks as it cannot determine which disk to install the system on. I > could write multiple > kickstart files to handle 1,6,12,18,24,36 and 48 disk installs but I > shouldn't need to. > > I have added a %pre script, instead, to the file to handle this case > but it doesn't seem to even be > run. We are doing the installs from pxeboot. I look at the > /tmp/ks.cfg file and it has the > %pre script embedded but the file that it creates when executed > doesn't. The logging page > (ctrl+alt+F3) does not show that the script was processed. > > Additional info > 2.6.18-53 RHEL5 kernel > anaconda-11.1.2.87-1 > > > How do I troubleshoot this problem? > > Below is my kickstart file > ----------------------------- > #platform=x86, AMD64, or Intel EM64T > # System authorization information > auth --useshadow --enablemd5 > # Clear the Master Boot Record > zerombr > #dynamic drive install > # cmdline causes no-interaction installs > cmdline > # Use text install > text > # use graphical install > # graphical > # disable asking for key on install > key --skip > # Firewall configuration > firewall --disabled > # Run the Setup Agent on first boot > firstboot --disable > # System keyboard > keyboard us > # System language > lang en_US > # Installation logging level > logging --level=info > # Install OS instead of upgrade > install > # Use network installation > # area51 > # CD Image loop mounted or copied (must match booted image) > url --url=http://10.109.0.46/repo/RHEL5/VOD > repo --name=packages --baseurl=http://10.109.0.46/packages > repo --name=EL5-latest --baseurl=http://10.109.0.46/repo/RHEL5/x86_64/ > # Network information > > # SELinux configuration > selinux --disabled > # System timezone > timezone --isUtc America/Los_Angeles > # X Window System configuration information > #xconfig --defaultdesktop=GNOME --depth=8 --resolution=800x600 > --startxonboot > #reboot > %packages --nobase > kernel > bash > passwd > mkinitrd > grub > coreutils > httpd > openssh-server > openssh-clients > ftp > kexec-tools > rootfiles > sudo > sysklogd > smartmontools > yum > ntp > mdadm > traceroute > strace > man > bind-utils > tcpdump > logrotate > audit > > > # extra tools > sysstat > gdb > vim-minimal > which > > #remove un-used packages > -libhugetlbfs.i386 > -libtermcap.i386 > -system-config-securitylevel-tui > -policycoreutils > -librpm.i386 > -zlib.i386 > -sqlite.i386 > -beecrypt.i386 > -elfutils-libelf.i386 > -sysreport > -rp-pppoe > -NetworkManager > -aspell* > -words > -bluez* > -ypbind > -yptools > -nc > > > %pre --interpreter /bin/sh > #!/bin/sh > # assumes all disks for install are on the scsi bus > echo "pre kickstart script is running" >/tmp/pre-kickstart.out > #path for file > outfile=/tmp/part-include > > get_disk_paths() { > for d in `echo /sys/bus/scsi/devices/*`; > do > [ -d $d/block* ] && echo $d/block* > done > } > > convert_path_to_dev_name() { > echo $1 | sed -e 's/^.*block\://' > } > > get_queue_type() { > file=$(dirname $1)/queue_type > if [ -f $file ]; then > cat $file > else > echo "no queue type" > fi > } > > get_disk_size() { > file=$1/size > if [ -f $file ]; then > cat $file > else > echo 0 > fi > } > > is_removable() { > cat $1/removable > } > > > all_disks=$(get_disk_paths) > all_dev_names=$(for d in $all_disks; do convert_path_to_dev_name $d; > done) > > #echo $all_disks > #echo $all_dev_names > > install_disk="" > install_dev="" > for dev in $all_disks; > do > #here is our test for USB flash device > #No queuing and is_removable > if [ $(get_queue_type $dev) == "none" ] && [ $(is_removable > $dev) -eq 1 ] ;then > install_disk=$dev > install_dev=$(convert_path_to_dev_name $dev) > fi > done > > #no USB flash device use all of first disk > if [ -z "$install_disk" ]; then > $install_disk=$(echo $all_disk | cut -d' ' -f1) > $install_dev=$(convert_path_to_dev_name $install_disk) > fi > install_dev_size=$(get_disk_size $install_disk) > > #echo $install_disk > #echo $install_dev > #echo $install_dev_size > size_kblks=$[ $install_dev_size / 2 ] > size_Mblks=$[ size_kblks / 1000 ] > boot_size=100 > swap_size=500 > root_size=$[ $size_Mblks - $boot_size - $swap_size ] > > cat <$outfile > #partitioning info starts here > clearpart --drives=$(echo $all_dev_names | tr ' ' ,) --all --initlabel > ignoredisk --drives=$(echo ${all_dev_names/$install_dev/} | tr ' ' , ) > > part / --fstype=ext3 --ondisk=$install_dev --size=$root_size > --asprimary > part /boot --fstype=ext2 --ondisk=$install_dev --size=$boot_size > --asprimary > part swap --fstype=swap --ondisk=$install_dev --size=$swap_size > --asprimary > #autopart > # System bootloader configuration > bootloader --append="rhgb quiet crashkernel=128M at 16M console=tty1 > console=ttyS0,38400n8" --location=mbr --driveorder=$install_dev > > EOF > > %post > #update dns and nameservers > cat >/etc/resolv.conf< search mydns.com > nameserver 5.5.3.240 > nameserver 5.5.64.127 > EOF > > cat >/etc/yum.repos.d/packages.repo< [packages] > name=local packages > baseurl=http://area51/packages > enabled=1 > gpgcheck=0 > EOF > > cat >/etc/yum.repos.d/rhel5_local.repo< [rhel5] > name=Red Hat Enterprise Linux 5 local - \$basearch > baseurl=http://area51/repo/RHEL5/\$basearch > enabled=1 > gpgcheck=0 > EOF > chkconfig httpd on > # modify grub for serial console > sed -i -e 's/^timeout=5/serial --unit=0 --speed=38400 --word=8 > --parity=no --stop=1 \ > terminal --timeout=5 serial console \ > timeout=5/' /boot/grub/grub.conf > > # modify inittab to add serial console login > cat >>/etc/inittab < > #serial console login enabled > co:2345:respawn:/sbin/agetty ttyS0 38400 vt100-nav > EOF > > # add tmpfs mounts > cat >>/etc/fstab< tmpfs /tmp tmpfs size=20M 0 0 > tmpfs /var/tmp tmpfs size=2M 0 0 > tmpfs /var/run tmpfs size=2M 0 0 > EOF > # update for noatime > sed -i -e '1,2s/defaults/defaults,noatime,nodiratime/' /etc/fstab > > # get host info > GATEWAY=$(route -n | grep ^0.0.0.0 | awk '{print $2}') > #HOSTNAME=$(hostname) > HOSTIP=$(ifconfig eth0 | grep "inet addr" | cut -d: -f2|awk '{print > $1}') > NETMASK=$(ifconfig eth0 | grep Mask | cut -d: -f4) > HOSTNAME=$(host $HOSTIP 5.5.64.127 | grep pointer | cut -d' ' -f 5 | > cut -d. -f1 ) > #FQDN=$(host $HOSTNAME 5.5.64.127 | grep address | cut -d' ' -f1) > if [ -z "$HOSTIP" ] ; then > echo "Did not find a IP address for host $HOSTNAME from > Server:$DNS!" > echo "This will need to be set manually" > fi > #echo write hosts file > #echo "$HOSTIP $FQDN $HOSTNAME" >> /etc/hosts > # update network file for gateway > echo "GATEWAY=$GATEWAY" >>/etc/sysconfig/network > echo update ifcfg-eth0 for static > ( cd /etc/sysconfig/network-scripts > sed -i -e "s/dhcp/static/" ifcfg-eth0 > cat >>ifcfg-eth0 < IPADDR=$HOSTIP > NETMASK=$NETMASK > EOF > ) > # make netreport to quiet network startup > echo "mkdir -p /var/run/netreport" >> /etc/rc.d/rc.sysinit > > # update other ethernet interfaces > HOSTNUM=$[ $(echo $HOSTNAME | perl -ln -e '/([1-9]+)$/; print "$1";') % > 255] > for e in 2 3 4 5 6 7 8 9 > do > file=/etc/sysconfig/network-scripts/ifcfg-eth${e} > if [ -e $file ] ; then > netnum=$[ ${e} + 100 ] > sed -i -e "s/ONBOOT=no/ONBOOT=yes\n\ > IPADDR=172.25.${HOSTNUM}.${netnum} \n\ > NETMASK=255.255.0.0 \n\ > BOOTPROTO=static \ > /" $file > if [ ${e} -eq 2 ]; then > cat >/etc/ethers.eth${e}< #nsg ethers > 00:00:00:00:00:05 172.25.100.3 > 00:00:00:00:00:05 172.25.100.2 > EOF_ETHERS > else > ( cd /etc > ln -s ethers.eth2 ethers.eth${e} > ) > fi > fi > done > sync > > %include /tmp/part-include > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > From dwsmith at micron.com Wed Jan 14 00:25:14 2009 From: dwsmith at micron.com (Daryl W Smith - TestEng) Date: Tue, 13 Jan 2009 17:25:14 -0700 Subject: Kickstart-list Digest, Vol 59, Issue 5 In-Reply-To: <20090113233048.C8E55618F8A@hormel.redhat.com> References: <20090113233048.C8E55618F8A@hormel.redhat.com> Message-ID: <1231892714.14001.88.camel@telinux1.micron.com> I've found that with the bash shell from busybox used during the kickstart doesn't have all the functionality one is used to. And it varies between rhel3,4,5. So I elected to do any scripted partitioning in a python script. Following are the %pre install script and autopartition script pulled from the server via NFS to accomplish our install. (NFS server IP address is 192.168.0.2). Part of the python code from the autopartition script was borrowed from /usr/lib/anaconda/list-harddrives-stub. I rely heavily on the %include capability and have made stuff very modular. I utilize a perl script that creates our ks.cfg files. Hope this gives you some more ideas. Daryl Smith Software Engineer Micron Technology ########## Applicable code chunks from our ks.cfg file ###### zerombr yes # Partitioning Information, determined below in %pre %include /tmp/clearpart # partition done via script, below in %pre %include /tmp/partition-layout ### Commands To Be Run Pre-Installation %pre --interpreter /bin/sh ( export TMP_MOUNT=/tmp-pre export NFSHOST=192.168.0.2 NFSMOUNT=/vol/pteng/osload NFSPATH="/linux/ks/centos5u2" mkdir -p ${TMP_MOUNT} mount -t nfs -o nolock ${NFSHOST}:${NFSMOUNT} ${TMP_MOUNT} DISKA=`list-harddrives | head -1 | cut -d" " -f1` partitions="`grep ${DISKA}1 /proc/partitions`" if [ "${partitions}" ]; then echo "clearpart --all" > /tmp/clearpart else echo "clearpart --initlabel" > /tmp/clearpart fi if [ -f "${TMP_MOUNT}/${NFSPATH}/packages/install-packages" ]; then cp "${TMP_MOUNT}/${NFSPATH}/packages/install-packages" /tmp/install-packages else echo "${TMP_MOUNT}/${NFSPATH}/packages/install-packages not found." fi if [ -f "${TMP_MOUNT}/${NFSPATH}/packages/remove_packages" ]; then cp "${TMP_MOUNT}/${NFSPATH}/packages/remove_packages" /tmp/remove-packages else echo "${TMP_MOUNT}/${NFSPATH}/packages/remove_packages not found" fi # Get MAC address for potential customized installs (unused at this time) MAC_ADDR=`ifconfig eth0 | grep HWaddr | sed -e 's/^.*HWaddr \([A-Fa-f0-9:]*\).*$/\1/; s/:/-/g'` if [ -f "${TMP_MOUNT}/${NFSPATH}/${MAC_ADDR}" ]; then cp "${TMP_MOUNT}/${NFSPATH}/${MAC_ADDR}" /tmp/network fi # make sure at the very least an empty partition-layout exists touch /tmp/partition-layout # check for specialized parition layout files based on MAC # address or hostname. Else call autopartition script. PART_SRC=${TMP_MOUNT}/${NFSPATH}/partition if [ -f "${PART_SRC}/${MAC_ADDR}" ]; then echo "partition data: file=${MAC_ADDR}" cp "${PART_SRC}/${MAC_ADDR}" /tmp/partition-layout elif [ -f "${PART_SRC}/linuxhost999" ]; then echo "partition data: file=linuxhost999" cp "${PART_SRC}/linuxhost999" /tmp/partition-layout elif [ -f "${PART_SRC}/autopartition" ]; then echo "partition script: file=autopartition" cp "${PART_SRC}/autopartition" /tmp/autopartition fi if [ -f /tmp/autopartition ]; then /tmp/autopartition desktop fi umount ${TMP_MOUNT} ) 2>&1 | tee /tmp/preinstall.log #### End pre-install #!/usr/bin/python # # autopartition script # Scan system for harddrives and output partitioning file for # kickstart script # Used for rhel3,rhel4,rhel5, and centos5 # import os, string import sys # for testing if (os.path.exists('isys')): sys.path.append('isys') # this is available during a kickstart sys.path.append('/usr/lib/anaconda') import isys import parted # this is in kilobytes def memInstalled(): f = open("/proc/meminfo", "r") lines = f.readlines() f.close() for l in lines: if l.startswith("MemTotal:"): fields = string.split(l) mem = fields[1] break return int(mem) # try to keep 2.4 kernel swapper happy! def swapSuggestion(quiet=0): mem = memInstalled()/1024 mem = ((mem/16)+1)*16 if mem < 2000: swap = 2000 else: swap = 2000 + mem return (swap) # 18Gig minimum disksize in megabytes # type = [ 'partition', minimum in megs, maximum in megs ] # /usr gets the excess left over. no maximum # put /, /usr, and extra swap(s) on extended # each swap partition will be 2Gig # Based on information from http://tldp.org/HOWTO/Partition # Swap should be placed on outer tracks for best performance. # if the drive is a newer style ZBR drive # partition 1 will be /boot # partition 2 will be /var # partition 3 will be extended and contain the rest ( /, /usr, additional swap(s) ) # partition 4 will be 2GB swap server = [[ '/boot', 100, 100 ], [ '/var', 2000, 6000 ], [ '/', 5000, 12000 ], [ '/usr', 8000, 0 ], [ 'swap', 2000, 8000 ]] desktop = [[ '/boot', 100, 100 ], [ '/var', 2000, 4000 ], [ '/', 5000, 10000 ], [ '/usr', 8000, 0 ], [ 'swap', 2000, 8000 ]] tester = [[ '/boot', 100, 100 ], [ '/var', 2000, 4000 ], [ '/', 5000, 10000 ], [ '/usr', 8000, 0 ], [ 'swap', 2000, 8000 ]] MinDisksize = tester[0][1] + tester[1][1] + tester[2][1] + tester[3][1]+ tester[4][1] drives = isys.hardDriveDict() driveList = drives.keys() driveList.sort() drive = driveList[0] #if isys.mediaPresent(drive): # continue # try to open and get size skip = 0 deviceFile = "/tmp/%s" % (drive,) isys.makeDevInode(drive, deviceFile) try: dev = parted.PedDevice.get(deviceFile) except: skip = 1 os.remove(deviceFile) sizeMB = (float(dev.heads * dev.cylinders * dev.sectors) / (1024 * 1024) * dev.sector_size) # assign minimums to start BootSize = tester[0][1] VarMin = tester[1][1] RootMin = tester[2][1] UsrMin = tester[3][1] SwapMin = tester[4][1] swapsugg = swapSuggestion() SwapPartitions = int(round(swapsugg / 2000.0)) MegsPerCyl = int(sizeMB / dev.cylinders) RemainingDisk = int(sizeMB) - MinDisksize # First use excess disk for swap partitions # only build make a maximum of three SwapOne = SwapMin SwapTwo = 0 SwapThree = 0 SwapPartitions = SwapPartitions - 1 if SwapPartitions > 0: if RemainingDisk > 2000: SwapTwo = 2000 else: SwapTwo = RemainingDisk RemainingDisk = RemainingDisk - SwapTwo SwapPartitions = SwapPartitions - 1 if SwapPartitions > 0: if RemainingDisk > 2000: SwapThree = 2000 else: SwapThree = RemainingDisk RemainingDisk = RemainingDisk - SwapThree SwapPartitions = SwapPartitions - 1 # Next use excess disk for /var partition VarMax = tester[1][2] VarMore = VarMax - VarMin if RemainingDisk > VarMore: VarSize = VarMax RemainingDisk = RemainingDisk - VarMore else: VarSize = VarMin + RemainingDisk RemainingDisk = 0 RootMax = tester[2][2] RootSize = RootMin UsrSize = UsrMin RootMore = RootMax - RootMin # If evenly split the remaining excess between / and /usr # until RootMax has is met. Then give everything else to /usr if RemainingDisk < (2 * RootMore): # redefine RootMore to half of remaining space RootMore = RemainingDisk / 2 RootSize = RootSize + RootMore RemainingDisk = RemainingDisk - RootMore # give other remaining half to usr UsrMore = RemainingDisk UsrSize = UsrSize + UsrMore RemainingDisk = 0 else: RootSize = RootMax RemainingDisk = RemainingDisk - RootMore # give other remaining disk to usr but UsrSize = UsrSize + RemainingDisk RemainingDisk = 0 # Subtract off 5 meg so actual disk size is not exceeded. # The /usr partition has the --grow option, so it will use # all available anyway. UsrSize = UsrSize - 5 ############################### # Caculate Cylinder Boundaries ############################### MBPerCyl = int(sizeMB / dev.cylinders) BootStartCyl = 1 BootCylSize = int(BootSize / MBPerCyl ) BootEndCyl = BootCylSize VarStartCyl = BootEndCyl + 1 VarCylSize = int(VarSize / MBPerCyl ) + 1 VarEndCyl = VarStartCyl + VarCylSize RootStartCyl = VarEndCyl + 1 RootCylSize = int(RootSize / MBPerCyl ) + 1 RootEndCyl = RootStartCyl + RootCylSize f = open("/tmp/partition-layout", "w") print >> f, "partition /boot --asprimary --size=%s --ondisk=%s --fstype=ext3" %(BootSize,drive) print >> f, "partition /var --asprimary --size=%s --ondisk=%s --fstype=ext3" %(VarSize,drive) print >> f, "partition / --asprimary --size=%s --ondisk=%s --fstype=ext3" %(RootSize,drive) print >> f, "partition /usr --size=%s --grow --ondisk=%s --fstype=ext3" %(UsrSize,drive) print >> f, "partition swap --size=%s --ondisk=%s --fstype=ext3" %(SwapOne,drive) if SwapTwo != 0: print >> f, "partition swap --size=%s --ondisk=%s --fstype=ext3" %(SwapTwo,drive) if SwapThree != 0: print >> f, "partition swap --size=%s --ondisk=%s --fstype=ext3" %(SwapThree,drive) f.close() # debug #print drive, sizeMB On Tue, 2009-01-13 at 16:30, kickstart-list-request at redhat.com wrote: > Send Kickstart-list mailing list submissions to > kickstart-list at redhat.com > > To subscribe or unsubscribe via the World Wide Web, visit > https://www.redhat.com/mailman/listinfo/kickstart-list > or, via email, send a message with subject or body 'help' to > kickstart-list-request at redhat.com > > You can reach the person managing the list at > kickstart-list-owner at redhat.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Kickstart-list digest..." > > ______________________________________________________________________ > Today's Topics: > > 1. kickstart fails to process %pre event (Larry Brigman) > 2. RE: kickstart fails to process %pre event (Shabazian, Chip) > 3. RE: kickstart fails to process %pre event (Shabazian, Chip) > > ______________________________________________________________________ > From: Larry Brigman > To: kickstart-list at redhat.com > Subject: kickstart fails to process %pre event > Date: Tue, 13 Jan 2009 15:11:18 -0800 > > I have a kickstart file for doing RHEL5 installs. It works just fine but now as > we have moved to having more than one disk in the systems; this > automated install > breaks as it cannot determine which disk to install the system on. I > could write multiple > kickstart files to handle 1,6,12,18,24,36 and 48 disk installs but I > shouldn't need to. > > I have added a %pre script, instead, to the file to handle this case > but it doesn't seem to even be > run. We are doing the installs from pxeboot. I look at the > /tmp/ks.cfg file and it has the > %pre script embedded but the file that it creates when executed > doesn't. The logging page > (ctrl+alt+F3) does not show that the script was processed. > > Additional info > 2.6.18-53 RHEL5 kernel > anaconda-11.1.2.87-1 > > > How do I troubleshoot this problem? > > Below is my kickstart file > ----------------------------- > #platform=x86, AMD64, or Intel EM64T > # System authorization information > auth --useshadow --enablemd5 > # Clear the Master Boot Record > zerombr > #dynamic drive install > # cmdline causes no-interaction installs > cmdline > # Use text install > text > # use graphical install > # graphical > # disable asking for key on install > key --skip > # Firewall configuration > firewall --disabled > # Run the Setup Agent on first boot > firstboot --disable > # System keyboard > keyboard us > # System language > lang en_US > # Installation logging level > logging --level=info > # Install OS instead of upgrade > install > # Use network installation > # area51 > # CD Image loop mounted or copied (must match booted image) > url --url=http://10.109.0.46/repo/RHEL5/VOD > repo --name=packages --baseurl=http://10.109.0.46/packages > repo --name=EL5-latest --baseurl=http://10.109.0.46/repo/RHEL5/x86_64/ > # Network information > > # SELinux configuration > selinux --disabled > # System timezone > timezone --isUtc America/Los_Angeles > # X Window System configuration information > #xconfig --defaultdesktop=GNOME --depth=8 --resolution=800x600 --startxonboot > #reboot > %packages --nobase > kernel > bash > passwd > mkinitrd > grub > coreutils > httpd > openssh-server > openssh-clients > ftp > kexec-tools > rootfiles > sudo > sysklogd > smartmontools > yum > ntp > mdadm > traceroute > strace > man > bind-utils > tcpdump > logrotate > audit > > > # extra tools > sysstat > gdb > vim-minimal > which > > #remove un-used packages > -libhugetlbfs.i386 > -libtermcap.i386 > -system-config-securitylevel-tui > -policycoreutils > -librpm.i386 > -zlib.i386 > -sqlite.i386 > -beecrypt.i386 > -elfutils-libelf.i386 > -sysreport > -rp-pppoe > -NetworkManager > -aspell* > -words > -bluez* > -ypbind > -yptools > -nc > > > %pre --interpreter /bin/sh > #!/bin/sh > # assumes all disks for install are on the scsi bus > echo "pre kickstart script is running" >/tmp/pre-kickstart.out > #path for file > outfile=/tmp/part-include > > get_disk_paths() { > for d in `echo /sys/bus/scsi/devices/*`; > do > [ -d $d/block* ] && echo $d/block* > done > } > > convert_path_to_dev_name() { > echo $1 | sed -e 's/^.*block\://' > } > > get_queue_type() { > file=$(dirname $1)/queue_type > if [ -f $file ]; then > cat $file > else > echo "no queue type" > fi > } > > get_disk_size() { > file=$1/size > if [ -f $file ]; then > cat $file > else > echo 0 > fi > } > > is_removable() { > cat $1/removable > } > > > all_disks=$(get_disk_paths) > all_dev_names=$(for d in $all_disks; do convert_path_to_dev_name $d; done) > > #echo $all_disks > #echo $all_dev_names > > install_disk="" > install_dev="" > for dev in $all_disks; > do > #here is our test for USB flash device > #No queuing and is_removable > if [ $(get_queue_type $dev) == "none" ] && [ $(is_removable $dev) -eq 1 ] ;then > install_disk=$dev > install_dev=$(convert_path_to_dev_name $dev) > fi > done > > #no USB flash device use all of first disk > if [ -z "$install_disk" ]; then > $install_disk=$(echo $all_disk | cut -d' ' -f1) > $install_dev=$(convert_path_to_dev_name $install_disk) > fi > install_dev_size=$(get_disk_size $install_disk) > > #echo $install_disk > #echo $install_dev > #echo $install_dev_size > size_kblks=$[ $install_dev_size / 2 ] > size_Mblks=$[ size_kblks / 1000 ] > boot_size=100 > swap_size=500 > root_size=$[ $size_Mblks - $boot_size - $swap_size ] > > cat <$outfile > #partitioning info starts here > clearpart --drives=$(echo $all_dev_names | tr ' ' ,) --all --initlabel > ignoredisk --drives=$(echo ${all_dev_names/$install_dev/} | tr ' ' , ) > > part / --fstype=ext3 --ondisk=$install_dev --size=$root_size --asprimary > part /boot --fstype=ext2 --ondisk=$install_dev --size=$boot_size --asprimary > part swap --fstype=swap --ondisk=$install_dev --size=$swap_size --asprimary > #autopart > # System bootloader configuration > bootloader --append="rhgb quiet crashkernel=128M at 16M console=tty1 > console=ttyS0,38400n8" --location=mbr --driveorder=$install_dev > > EOF > > %post > #update dns and nameservers > cat >/etc/resolv.conf< search mydns.com > nameserver 5.5.3.240 > nameserver 5.5.64.127 > EOF > > cat >/etc/yum.repos.d/packages.repo< [packages] > name=local packages > baseurl=http://area51/packages > enabled=1 > gpgcheck=0 > EOF > > cat >/etc/yum.repos.d/rhel5_local.repo< [rhel5] > name=Red Hat Enterprise Linux 5 local - \$basearch > baseurl=http://area51/repo/RHEL5/\$basearch > enabled=1 > gpgcheck=0 > EOF > chkconfig httpd on > # modify grub for serial console > sed -i -e 's/^timeout=5/serial --unit=0 --speed=38400 --word=8 > --parity=no --stop=1 \ > terminal --timeout=5 serial console \ > timeout=5/' /boot/grub/grub.conf > > # modify inittab to add serial console login > cat >>/etc/inittab < > #serial console login enabled > co:2345:respawn:/sbin/agetty ttyS0 38400 vt100-nav > EOF > > # add tmpfs mounts > cat >>/etc/fstab< tmpfs /tmp tmpfs size=20M 0 0 > tmpfs /var/tmp tmpfs size=2M 0 0 > tmpfs /var/run tmpfs size=2M 0 0 > EOF > # update for noatime > sed -i -e '1,2s/defaults/defaults,noatime,nodiratime/' /etc/fstab > > # get host info > GATEWAY=$(route -n | grep ^0.0.0.0 | awk '{print $2}') > #HOSTNAME=$(hostname) > HOSTIP=$(ifconfig eth0 | grep "inet addr" | cut -d: -f2|awk '{print $1}') > NETMASK=$(ifconfig eth0 | grep Mask | cut -d: -f4) > HOSTNAME=$(host $HOSTIP 5.5.64.127 | grep pointer | cut -d' ' -f 5 | > cut -d. -f1 ) > #FQDN=$(host $HOSTNAME 5.5.64.127 | grep address | cut -d' ' -f1) > if [ -z "$HOSTIP" ] ; then > echo "Did not find a IP address for host $HOSTNAME from Server:$DNS!" > echo "This will need to be set manually" > fi > #echo write hosts file > #echo "$HOSTIP $FQDN $HOSTNAME" >> /etc/hosts > # update network file for gateway > echo "GATEWAY=$GATEWAY" >>/etc/sysconfig/network > echo update ifcfg-eth0 for static > ( cd /etc/sysconfig/network-scripts > sed -i -e "s/dhcp/static/" ifcfg-eth0 > cat >>ifcfg-eth0 < IPADDR=$HOSTIP > NETMASK=$NETMASK > EOF > ) > # make netreport to quiet network startup > echo "mkdir -p /var/run/netreport" >> /etc/rc.d/rc.sysinit > > # update other ethernet interfaces > HOSTNUM=$[ $(echo $HOSTNAME | perl -ln -e '/([1-9]+)$/; print "$1";') % 255] > for e in 2 3 4 5 6 7 8 9 > do > file=/etc/sysconfig/network-scripts/ifcfg-eth${e} > if [ -e $file ] ; then > netnum=$[ ${e} + 100 ] > sed -i -e "s/ONBOOT=no/ONBOOT=yes\n\ > IPADDR=172.25.${HOSTNUM}.${netnum} \n\ > NETMASK=255.255.0.0 \n\ > BOOTPROTO=static \ > /" $file > if [ ${e} -eq 2 ]; then > cat >/etc/ethers.eth${e}< #nsg ethers > 00:00:00:00:00:05 172.25.100.3 > 00:00:00:00:00:05 172.25.100.2 > EOF_ETHERS > else > ( cd /etc > ln -s ethers.eth2 ethers.eth${e} > ) > fi > fi > done > sync > > %include /tmp/part-include > > > > ______________________________________________________________________ > From: "Shabazian, Chip" > To: Discussion list about Kickstart > Subject: RE: kickstart fails to process %pre event > Date: Tue, 13 Jan 2009 15:28:24 -0800 > > The best way I've found for troubleshooting pre or post scripting errors > is to simply put a sleep statement in the pre or post, then manually > walk through the script and see where it fails. > > %pre > Sleep 9999999999999 > > Chip > > -----Original Message----- > From: kickstart-list-bounces at redhat.com > [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Larry Brigman > Sent: Tuesday, January 13, 2009 3:11 PM > To: kickstart-list at redhat.com > Subject: kickstart fails to process %pre event > > I have a kickstart file for doing RHEL5 installs. It works just fine > but now as > we have moved to having more than one disk in the systems; this > automated install > breaks as it cannot determine which disk to install the system on. I > could write multiple > kickstart files to handle 1,6,12,18,24,36 and 48 disk installs but I > shouldn't need to. > > I have added a %pre script, instead, to the file to handle this case > but it doesn't seem to even be > run. We are doing the installs from pxeboot. I look at the > /tmp/ks.cfg file and it has the > %pre script embedded but the file that it creates when executed > doesn't. The logging page > (ctrl+alt+F3) does not show that the script was processed. > > Additional info > 2.6.18-53 RHEL5 kernel > anaconda-11.1.2.87-1 > > > How do I troubleshoot this problem? > > Below is my kickstart file > ----------------------------- > #platform=x86, AMD64, or Intel EM64T > # System authorization information > auth --useshadow --enablemd5 > # Clear the Master Boot Record > zerombr > #dynamic drive install > # cmdline causes no-interaction installs > cmdline > # Use text install > text > # use graphical install > # graphical > # disable asking for key on install > key --skip > # Firewall configuration > firewall --disabled > # Run the Setup Agent on first boot > firstboot --disable > # System keyboard > keyboard us > # System language > lang en_US > # Installation logging level > logging --level=info > # Install OS instead of upgrade > install > # Use network installation > # area51 > # CD Image loop mounted or copied (must match booted image) > url --url=http://10.109.0.46/repo/RHEL5/VOD > repo --name=packages --baseurl=http://10.109.0.46/packages > repo --name=EL5-latest --baseurl=http://10.109.0.46/repo/RHEL5/x86_64/ > # Network information > > # SELinux configuration > selinux --disabled > # System timezone > timezone --isUtc America/Los_Angeles > # X Window System configuration information > #xconfig --defaultdesktop=GNOME --depth=8 --resolution=800x600 > --startxonboot > #reboot > %packages --nobase > kernel > bash > passwd > mkinitrd > grub > coreutils > httpd > openssh-server > openssh-clients > ftp > kexec-tools > rootfiles > sudo > sysklogd > smartmontools > yum > ntp > mdadm > traceroute > strace > man > bind-utils > tcpdump > logrotate > audit > > > # extra tools > sysstat > gdb > vim-minimal > which > > #remove un-used packages > -libhugetlbfs.i386 > -libtermcap.i386 > -system-config-securitylevel-tui > -policycoreutils > -librpm.i386 > -zlib.i386 > -sqlite.i386 > -beecrypt.i386 > -elfutils-libelf.i386 > -sysreport > -rp-pppoe > -NetworkManager > -aspell* > -words > -bluez* > -ypbind > -yptools > -nc > > > %pre --interpreter /bin/sh > #!/bin/sh > # assumes all disks for install are on the scsi bus > echo "pre kickstart script is running" >/tmp/pre-kickstart.out > #path for file > outfile=/tmp/part-include > > get_disk_paths() { > for d in `echo /sys/bus/scsi/devices/*`; > do > [ -d $d/block* ] && echo $d/block* > done > } > > convert_path_to_dev_name() { > echo $1 | sed -e 's/^.*block\://' > } > > get_queue_type() { > file=$(dirname $1)/queue_type > if [ -f $file ]; then > cat $file > else > echo "no queue type" > fi > } > > get_disk_size() { > file=$1/size > if [ -f $file ]; then > cat $file > else > echo 0 > fi > } > > is_removable() { > cat $1/removable > } > > > all_disks=$(get_disk_paths) > all_dev_names=$(for d in $all_disks; do convert_path_to_dev_name $d; > done) > > #echo $all_disks > #echo $all_dev_names > > install_disk="" > install_dev="" > for dev in $all_disks; > do > #here is our test for USB flash device > #No queuing and is_removable > if [ $(get_queue_type $dev) == "none" ] && [ $(is_removable > $dev) -eq 1 ] ;then > install_disk=$dev > install_dev=$(convert_path_to_dev_name $dev) > fi > done > > #no USB flash device use all of first disk > if [ -z "$install_disk" ]; then > $install_disk=$(echo $all_disk | cut -d' ' -f1) > $install_dev=$(convert_path_to_dev_name $install_disk) > fi > install_dev_size=$(get_disk_size $install_disk) > > #echo $install_disk > #echo $install_dev > #echo $install_dev_size > size_kblks=$[ $install_dev_size / 2 ] > size_Mblks=$[ size_kblks / 1000 ] > boot_size=100 > swap_size=500 > root_size=$[ $size_Mblks - $boot_size - $swap_size ] > > cat <$outfile > #partitioning info starts here > clearpart --drives=$(echo $all_dev_names | tr ' ' ,) --all --initlabel > ignoredisk --drives=$(echo ${all_dev_names/$install_dev/} | tr ' ' , ) > > part / --fstype=ext3 --ondisk=$install_dev --size=$root_size > --asprimary > part /boot --fstype=ext2 --ondisk=$install_dev --size=$boot_size > --asprimary > part swap --fstype=swap --ondisk=$install_dev --size=$swap_size > --asprimary > #autopart > # System bootloader configuration > bootloader --append="rhgb quiet crashkernel=128M at 16M console=tty1 > console=ttyS0,38400n8" --location=mbr --driveorder=$install_dev > > EOF > > %post > #update dns and nameservers > cat >/etc/resolv.conf< search mydns.com > nameserver 5.5.3.240 > nameserver 5.5.64.127 > EOF > > cat >/etc/yum.repos.d/packages.repo< [packages] > name=local packages > baseurl=http://area51/packages > enabled=1 > gpgcheck=0 > EOF > > cat >/etc/yum.repos.d/rhel5_local.repo< [rhel5] > name=Red Hat Enterprise Linux 5 local - \$basearch > baseurl=http://area51/repo/RHEL5/\$basearch > enabled=1 > gpgcheck=0 > EOF > chkconfig httpd on > # modify grub for serial console > sed -i -e 's/^timeout=5/serial --unit=0 --speed=38400 --word=8 > --parity=no --stop=1 \ > terminal --timeout=5 serial console \ > timeout=5/' /boot/grub/grub.conf > > # modify inittab to add serial console login > cat >>/etc/inittab < > #serial console login enabled > co:2345:respawn:/sbin/agetty ttyS0 38400 vt100-nav > EOF > > # add tmpfs mounts > cat >>/etc/fstab< tmpfs /tmp tmpfs size=20M 0 0 > tmpfs /var/tmp tmpfs size=2M 0 0 > tmpfs /var/run tmpfs size=2M 0 0 > EOF > # update for noatime > sed -i -e '1,2s/defaults/defaults,noatime,nodiratime/' /etc/fstab > > # get host info > GATEWAY=$(route -n | grep ^0.0.0.0 | awk '{print $2}') > #HOSTNAME=$(hostname) > HOSTIP=$(ifconfig eth0 | grep "inet addr" | cut -d: -f2|awk '{print > $1}') > NETMASK=$(ifconfig eth0 | grep Mask | cut -d: -f4) > HOSTNAME=$(host $HOSTIP 5.5.64.127 | grep pointer | cut -d' ' -f 5 | > cut -d. -f1 ) > #FQDN=$(host $HOSTNAME 5.5.64.127 | grep address | cut -d' ' -f1) > if [ -z "$HOSTIP" ] ; then > echo "Did not find a IP address for host $HOSTNAME from > Server:$DNS!" > echo "This will need to be set manually" > fi > #echo write hosts file > #echo "$HOSTIP $FQDN $HOSTNAME" >> /etc/hosts > # update network file for gateway > echo "GATEWAY=$GATEWAY" >>/etc/sysconfig/network > echo update ifcfg-eth0 for static > ( cd /etc/sysconfig/network-scripts > sed -i -e "s/dhcp/static/" ifcfg-eth0 > cat >>ifcfg-eth0 < IPADDR=$HOSTIP > NETMASK=$NETMASK > EOF > ) > # make netreport to quiet network startup > echo "mkdir -p /var/run/netreport" >> /etc/rc.d/rc.sysinit > > # update other ethernet interfaces > HOSTNUM=$[ $(echo $HOSTNAME | perl -ln -e '/([1-9]+)$/; print "$1";') % > 255] > for e in 2 3 4 5 6 7 8 9 > do > file=/etc/sysconfig/network-scripts/ifcfg-eth${e} > if [ -e $file ] ; then > netnum=$[ ${e} + 100 ] > sed -i -e "s/ONBOOT=no/ONBOOT=yes\n\ > IPADDR=172.25.${HOSTNUM}.${netnum} \n\ > NETMASK=255.255.0.0 \n\ > BOOTPROTO=static \ > /" $file > if [ ${e} -eq 2 ]; then > cat >/etc/ethers.eth${e}< #nsg ethers > 00:00:00:00:00:05 172.25.100.3 > 00:00:00:00:00:05 172.25.100.2 > EOF_ETHERS > else > ( cd /etc > ln -s ethers.eth2 ethers.eth${e} > ) > fi > fi > done > sync > > %include /tmp/part-include > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > > > > ______________________________________________________________________ > From: "Shabazian, Chip" > To: Discussion list about Kickstart > Subject: RE: kickstart fails to process %pre event > Date: Tue, 13 Jan 2009 15:30:21 -0800 > > Damn outlook thinking for me... That's supposed to be a lower case S - > sleep 999999999999 > > -----Original Message----- > From: kickstart-list-bounces at redhat.com > [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Shabazian, Chip > Sent: Tuesday, January 13, 2009 3:28 PM > To: Discussion list about Kickstart > Subject: RE: kickstart fails to process %pre event > > The best way I've found for troubleshooting pre or post scripting errors > is to simply put a sleep statement in the pre or post, then manually > walk through the script and see where it fails. > > %pre > Sleep 9999999999999 > > Chip > > -----Original Message----- > From: kickstart-list-bounces at redhat.com > [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Larry Brigman > Sent: Tuesday, January 13, 2009 3:11 PM > To: kickstart-list at redhat.com > Subject: kickstart fails to process %pre event > > I have a kickstart file for doing RHEL5 installs. It works just fine > but now as > we have moved to having more than one disk in the systems; this > automated install > breaks as it cannot determine which disk to install the system on. I > could write multiple > kickstart files to handle 1,6,12,18,24,36 and 48 disk installs but I > shouldn't need to. > > I have added a %pre script, instead, to the file to handle this case > but it doesn't seem to even be > run. We are doing the installs from pxeboot. I look at the > /tmp/ks.cfg file and it has the > %pre script embedded but the file that it creates when executed > doesn't. The logging page > (ctrl+alt+F3) does not show that the script was processed. > > Additional info > 2.6.18-53 RHEL5 kernel > anaconda-11.1.2.87-1 > > > How do I troubleshoot this problem? > > Below is my kickstart file > ----------------------------- > #platform=x86, AMD64, or Intel EM64T > # System authorization information > auth --useshadow --enablemd5 > # Clear the Master Boot Record > zerombr > #dynamic drive install > # cmdline causes no-interaction installs > cmdline > # Use text install > text > # use graphical install > # graphical > # disable asking for key on install > key --skip > # Firewall configuration > firewall --disabled > # Run the Setup Agent on first boot > firstboot --disable > # System keyboard > keyboard us > # System language > lang en_US > # Installation logging level > logging --level=info > # Install OS instead of upgrade > install > # Use network installation > # area51 > # CD Image loop mounted or copied (must match booted image) > url --url=http://10.109.0.46/repo/RHEL5/VOD > repo --name=packages --baseurl=http://10.109.0.46/packages > repo --name=EL5-latest --baseurl=http://10.109.0.46/repo/RHEL5/x86_64/ > # Network information > > # SELinux configuration > selinux --disabled > # System timezone > timezone --isUtc America/Los_Angeles > # X Window System configuration information > #xconfig --defaultdesktop=GNOME --depth=8 --resolution=800x600 > --startxonboot > #reboot > %packages --nobase > kernel > bash > passwd > mkinitrd > grub > coreutils > httpd > openssh-server > openssh-clients > ftp > kexec-tools > rootfiles > sudo > sysklogd > smartmontools > yum > ntp > mdadm > traceroute > strace > man > bind-utils > tcpdump > logrotate > audit > > > # extra tools > sysstat > gdb > vim-minimal > which > > #remove un-used packages > -libhugetlbfs.i386 > -libtermcap.i386 > -system-config-securitylevel-tui > -policycoreutils > -librpm.i386 > -zlib.i386 > -sqlite.i386 > -beecrypt.i386 > -elfutils-libelf.i386 > -sysreport > -rp-pppoe > -NetworkManager > -aspell* > -words > -bluez* > -ypbind > -yptools > -nc > > > %pre --interpreter /bin/sh > #!/bin/sh > # assumes all disks for install are on the scsi bus > echo "pre kickstart script is running" >/tmp/pre-kickstart.out > #path for file > outfile=/tmp/part-include > > get_disk_paths() { > for d in `echo /sys/bus/scsi/devices/*`; > do > [ -d $d/block* ] && echo $d/block* > done > } > > convert_path_to_dev_name() { > echo $1 | sed -e 's/^.*block\://' > } > > get_queue_type() { > file=$(dirname $1)/queue_type > if [ -f $file ]; then > cat $file > else > echo "no queue type" > fi > } > > get_disk_size() { > file=$1/size > if [ -f $file ]; then > cat $file > else > echo 0 > fi > } > > is_removable() { > cat $1/removable > } > > > all_disks=$(get_disk_paths) > all_dev_names=$(for d in $all_disks; do convert_path_to_dev_name $d; > done) > > #echo $all_disks > #echo $all_dev_names > > install_disk="" > install_dev="" > for dev in $all_disks; > do > #here is our test for USB flash device > #No queuing and is_removable > if [ $(get_queue_type $dev) == "none" ] && [ $(is_removable > $dev) -eq 1 ] ;then > install_disk=$dev > install_dev=$(convert_path_to_dev_name $dev) > fi > done > > #no USB flash device use all of first disk > if [ -z "$install_disk" ]; then > $install_disk=$(echo $all_disk | cut -d' ' -f1) > $install_dev=$(convert_path_to_dev_name $install_disk) > fi > install_dev_size=$(get_disk_size $install_disk) > > #echo $install_disk > #echo $install_dev > #echo $install_dev_size > size_kblks=$[ $install_dev_size / 2 ] > size_Mblks=$[ size_kblks / 1000 ] > boot_size=100 > swap_size=500 > root_size=$[ $size_Mblks - $boot_size - $swap_size ] > > cat <$outfile > #partitioning info starts here > clearpart --drives=$(echo $all_dev_names | tr ' ' ,) --all --initlabel > ignoredisk --drives=$(echo ${all_dev_names/$install_dev/} | tr ' ' , ) > > part / --fstype=ext3 --ondisk=$install_dev --size=$root_size > --asprimary > part /boot --fstype=ext2 --ondisk=$install_dev --size=$boot_size > --asprimary > part swap --fstype=swap --ondisk=$install_dev --size=$swap_size > --asprimary > #autopart > # System bootloader configuration > bootloader --append="rhgb quiet crashkernel=128M at 16M console=tty1 > console=ttyS0,38400n8" --location=mbr --driveorder=$install_dev > > EOF > > %post > #update dns and nameservers > cat >/etc/resolv.conf< search mydns.com > nameserver 5.5.3.240 > nameserver 5.5.64.127 > EOF > > cat >/etc/yum.repos.d/packages.repo< [packages] > name=local packages > baseurl=http://area51/packages > enabled=1 > gpgcheck=0 > EOF > > cat >/etc/yum.repos.d/rhel5_local.repo< [rhel5] > name=Red Hat Enterprise Linux 5 local - \$basearch > baseurl=http://area51/repo/RHEL5/\$basearch > enabled=1 > gpgcheck=0 > EOF > chkconfig httpd on > # modify grub for serial console > sed -i -e 's/^timeout=5/serial --unit=0 --speed=38400 --word=8 > --parity=no --stop=1 \ > terminal --timeout=5 serial console \ > timeout=5/' /boot/grub/grub.conf > > # modify inittab to add serial console login > cat >>/etc/inittab < > #serial console login enabled > co:2345:respawn:/sbin/agetty ttyS0 38400 vt100-nav > EOF > > # add tmpfs mounts > cat >>/etc/fstab< tmpfs /tmp tmpfs size=20M 0 0 > tmpfs /var/tmp tmpfs size=2M 0 0 > tmpfs /var/run tmpfs size=2M 0 0 > EOF > # update for noatime > sed -i -e '1,2s/defaults/defaults,noatime,nodiratime/' /etc/fstab > > # get host info > GATEWAY=$(route -n | grep ^0.0.0.0 | awk '{print $2}') > #HOSTNAME=$(hostname) > HOSTIP=$(ifconfig eth0 | grep "inet addr" | cut -d: -f2|awk '{print > $1}') > NETMASK=$(ifconfig eth0 | grep Mask | cut -d: -f4) > HOSTNAME=$(host $HOSTIP 5.5.64.127 | grep pointer | cut -d' ' -f 5 | > cut -d. -f1 ) > #FQDN=$(host $HOSTNAME 5.5.64.127 | grep address | cut -d' ' -f1) > if [ -z "$HOSTIP" ] ; then > echo "Did not find a IP address for host $HOSTNAME from > Server:$DNS!" > echo "This will need to be set manually" > fi > #echo write hosts file > #echo "$HOSTIP $FQDN $HOSTNAME" >> /etc/hosts > # update network file for gateway > echo "GATEWAY=$GATEWAY" >>/etc/sysconfig/network > echo update ifcfg-eth0 for static > ( cd /etc/sysconfig/network-scripts > sed -i -e "s/dhcp/static/" ifcfg-eth0 > cat >>ifcfg-eth0 < IPADDR=$HOSTIP > NETMASK=$NETMASK > EOF > ) > # make netreport to quiet network startup > echo "mkdir -p /var/run/netreport" >> /etc/rc.d/rc.sysinit > > # update other ethernet interfaces > HOSTNUM=$[ $(echo $HOSTNAME | perl -ln -e '/([1-9]+)$/; print "$1";') % > 255] > for e in 2 3 4 5 6 7 8 9 > do > file=/etc/sysconfig/network-scripts/ifcfg-eth${e} > if [ -e $file ] ; then > netnum=$[ ${e} + 100 ] > sed -i -e "s/ONBOOT=no/ONBOOT=yes\n\ > IPADDR=172.25.${HOSTNUM}.${netnum} \n\ > NETMASK=255.255.0.0 \n\ > BOOTPROTO=static \ > /" $file > if [ ${e} -eq 2 ]; then > cat >/etc/ethers.eth${e}< #nsg ethers > 00:00:00:00:00:05 172.25.100.3 > 00:00:00:00:00:05 172.25.100.2 > EOF_ETHERS > else > ( cd /etc > ln -s ethers.eth2 ethers.eth${e} > ) > fi > fi > done > sync > > %include /tmp/part-include > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > > > > ______________________________________________________________________ > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list From kanarip at kanarip.com Wed Jan 14 10:34:24 2009 From: kanarip at kanarip.com (Jeroen van Meeuwen) Date: Wed, 14 Jan 2009 11:34:24 +0100 Subject: How are DVDs identified by anaconda? In-Reply-To: References: <496A23B5.8080904@kanarip.com> Message-ID: <496DBFB0.4010907@kanarip.com> Chris wrote: > 2009/1/11 Jeroen van Meeuwen : >> Not sure why the files need to be in the root of the DVD, but Revisor allows >> you to specify copy_dir which is then copied (recursively) into a files/ >> subdirectory on the DVD. > > One of the files I needed to add was a dreaded autorun.inf (don't > ask!) so I really needed to access the root directory. Turned out I > was just missing the hidden files in the ISO tree. It's all working > now. > In an attempt to speed up your workflow, you could patch Revisor to not append "files/" and have everything go to the root directory[1]. To make the change more permanently, you could even create your own module putting the files in "/" rather then "files/"[2,3]. Kind regards, Jeroen van Meeuwen -kanarip [1] Line 404 in /usr/lib/python2.5/site-packages/revisor/pungi.py: - dst_dir = "%s/files/%s" + dst_dir = "%s/%s" [2] Example module: http://git.fedorahosted.org/git/?p=revisor;a=blob;f=revisor/modisolinux/__init__.py http://git.fedorahosted.org/git/?p=revisor;a=blob;f=revisor/modreuseinstaller/__init__.py [3] Documentation on writing modules/plugins: https://fedorahosted.org/revisor/wiki/WritingPlugins From joliver at john-oliver.net Wed Jan 14 17:40:46 2009 From: joliver at john-oliver.net (John Oliver) Date: Wed, 14 Jan 2009 09:40:46 -0800 Subject: RHEL5 - copy files from DVD during %post Message-ID: <20090114174046.GA12381@ns.sdsitehosting.net> So, I've read that anaconda got broke in RHEL5, and it ejects the DVD too early. I found a post about creating a new stage2.img with a couple of lines in dispatch.py swapped which is supposed to fix this. I did that, and wound up with a DVD that is ejecting right after the SCSI drivers load! I really need to be able to copy files from the DVD during %post What is the correct incantation to make this happen? Thanks... -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From Chip.Shabazian at bankofamerica.com Wed Jan 14 17:46:58 2009 From: Chip.Shabazian at bankofamerica.com (Shabazian, Chip) Date: Wed, 14 Jan 2009 09:46:58 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090114174046.GA12381@ns.sdsitehosting.net> References: <20090114174046.GA12381@ns.sdsitehosting.net> Message-ID: How big are the files? If they are small enough, you can use an old workaround I had to use a long time ago where you create a ram drive, copy the files there in the %pre, then you can mount and access that ram drive in the %post. -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of John Oliver Sent: Wednesday, January 14, 2009 9:41 AM To: kickstart-list at redhat.com Subject: RHEL5 - copy files from DVD during %post So, I've read that anaconda got broke in RHEL5, and it ejects the DVD too early. I found a post about creating a new stage2.img with a couple of lines in dispatch.py swapped which is supposed to fix this. I did that, and wound up with a DVD that is ejecting right after the SCSI drivers load! I really need to be able to copy files from the DVD during %post What is the correct incantation to make this happen? Thanks... -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list From joliver at john-oliver.net Wed Jan 14 18:08:53 2009 From: joliver at john-oliver.net (John Oliver) Date: Wed, 14 Jan 2009 10:08:53 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: References: <20090114174046.GA12381@ns.sdsitehosting.net> Message-ID: <20090114180853.GB12824@ns.sdsitehosting.net> On Wed, Jan 14, 2009 at 09:46:58AM -0800, Shabazian, Chip wrote: > How big are the files? If they are small enough, you can use an old > workaround I had to use a long time ago where you create a ram drive, > copy the files there in the %pre, then you can mount and access that ram > drive in the %post. Far too big for that :-) Someone has offered to send me a patched image, but... this has been known about for 18 months now. In Bugzilla, a fix is promised in 5.2, but that never happened, and nobody at Red Hat has updated since. https://bugzilla.redhat.com/show_bug.cgi?id=239002 Very frustrating. -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From bschneiders at woti.com Wed Jan 14 18:49:13 2009 From: bschneiders at woti.com (Bryan Schneiders) Date: Wed, 14 Jan 2009 13:49:13 -0500 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090114180853.GB12824@ns.sdsitehosting.net> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> Message-ID: <496E33A9.9000003@woti.com> I worked around this in the past by modifying usr/lib/anaconda/kickstart.py in the stage2.img and adding dispatch.skipStep("methodcomplete") to the list in the setSteps function. I think I tried the other patch you mentioned only to run into the cdrom device or mount point being deleted before %post. I have the skipStep method written down in my notes so I believe that's what I settled on. Bryan Schneiders John Oliver wrote: > On Wed, Jan 14, 2009 at 09:46:58AM -0800, Shabazian, Chip wrote: >> How big are the files? If they are small enough, you can use an old >> workaround I had to use a long time ago where you create a ram drive, >> copy the files there in the %pre, then you can mount and access that ram >> drive in the %post. > > Far too big for that :-) > > Someone has offered to send me a patched image, but... this has been > known about for 18 months now. In Bugzilla, a fix is promised in 5.2, but > that never happened, and nobody at Red Hat has updated since. > > https://bugzilla.redhat.com/show_bug.cgi?id=239002 > > Very frustrating. > From joliver at john-oliver.net Wed Jan 14 19:04:50 2009 From: joliver at john-oliver.net (John Oliver) Date: Wed, 14 Jan 2009 11:04:50 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <496E33A9.9000003@woti.com> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <496E33A9.9000003@woti.com> Message-ID: <20090114190450.GA13810@ns.sdsitehosting.net> On Wed, Jan 14, 2009 at 01:49:13PM -0500, Bryan Schneiders wrote: > I worked around this in the past by modifying usr/lib/anaconda/kickstart.py > in the stage2.img and adding dispatch.skipStep("methodcomplete") to the > list in the setSteps function. > > I think I tried the other patch you mentioned only to run into the cdrom > device or mount point being deleted before %post. I have the skipStep > method written down in my notes so I believe that's what I settled on. Thanks! I'll give that a try! -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From chris1.noreply at googlemail.com Wed Jan 14 19:33:32 2009 From: chris1.noreply at googlemail.com (Chris) Date: Wed, 14 Jan 2009 19:33:32 +0000 Subject: How are DVDs identified by anaconda? In-Reply-To: <496DBFB0.4010907@kanarip.com> References: <496A23B5.8080904@kanarip.com> <496DBFB0.4010907@kanarip.com> Message-ID: 2009/1/14 Jeroen van Meeuwen : > In an attempt to speed up your workflow, you could patch Revisor to not > append "files/" and have everything go to the root directory[1]. > > To make the change more permanently, you could even create your own module > putting the files in "/" rather then "files/"[2,3]. > > Kind regards, > > Jeroen van Meeuwen > -kanarip > > [1] Line 404 in /usr/lib/python2.5/site-packages/revisor/pungi.py: > - dst_dir = "%s/files/%s" > + dst_dir = "%s/%s" > > [2] Example module: > http://git.fedorahosted.org/git/?p=revisor;a=blob;f=revisor/modisolinux/__init__.py > http://git.fedorahosted.org/git/?p=revisor;a=blob;f=revisor/modreuseinstaller/__init__.py > > [3] Documentation on writing modules/plugins: > > https://fedorahosted.org/revisor/wiki/WritingPlugins That's extremely useful thank you. Chris. From joliver at john-oliver.net Wed Jan 14 23:23:08 2009 From: joliver at john-oliver.net (John Oliver) Date: Wed, 14 Jan 2009 15:23:08 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <496E33A9.9000003@woti.com> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <496E33A9.9000003@woti.com> Message-ID: <20090114232308.GB19523@ns.sdsitehosting.net> On Wed, Jan 14, 2009 at 01:49:13PM -0500, Bryan Schneiders wrote: > I worked around this in the past by modifying usr/lib/anaconda/kickstart.py > in the stage2.img and adding dispatch.skipStep("methodcomplete") to the > list in the setSteps function. > > I think I tried the other patch you mentioned only to run into the cdrom > device or mount point being deleted before %post. I have the skipStep > method written down in my notes so I believe that's what I settled on. I tried this, both with and without the other "fix". In all cases, the DVD is ejecting immediately after controller drivers are loaded. It can't even start to install. I know it's the stage2.img, because if I replace a hacked one with the original, the install will proceed. Has anyone made this work? I could really use the exact steps that will result in a DVD that will stay mounted for %post, or a link to that stage2.img that I can download. I'd prefer to know the correct edits that I can do myself and wind up with a working image that I can reproduce in the future. -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From bschneiders at woti.com Wed Jan 14 23:42:39 2009 From: bschneiders at woti.com (Bryan Schneiders) Date: Wed, 14 Jan 2009 18:42:39 -0500 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090114232308.GB19523@ns.sdsitehosting.net> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <496E33A9.9000003@woti.com> <20090114232308.GB19523@ns.sdsitehosting.net> Message-ID: <496E786F.9000507@woti.com> Where did you put dispatch.skipStep("methodcomplete")? Mine was just after dispatch.skipStep("network"), or more importantly: not inside any of the "if" blocks in that function. You could also try commenting out the anaconda.method.ejectCD() line in the doMethodComplete function at the bottom of usr/lib/ananconda/installmethod.py. Bryan Schneiders bschneiders at woti.com 301-562-1900 ext 305 John Oliver wrote: > On Wed, Jan 14, 2009 at 01:49:13PM -0500, Bryan Schneiders wrote: >> I worked around this in the past by modifying usr/lib/anaconda/kickstart.py >> in the stage2.img and adding dispatch.skipStep("methodcomplete") to the >> list in the setSteps function. >> >> I think I tried the other patch you mentioned only to run into the cdrom >> device or mount point being deleted before %post. I have the skipStep >> method written down in my notes so I believe that's what I settled on. > > I tried this, both with and without the other "fix". In all cases, the > DVD is ejecting immediately after controller drivers are loaded. It > can't even start to install. I know it's the stage2.img, because if I > replace a hacked one with the original, the install will proceed. > > Has anyone made this work? I could really use the exact steps that will > result in a DVD that will stay mounted for %post, or a link to that > stage2.img that I can download. I'd prefer to know the correct edits > that I can do myself and wind up with a working image that I can > reproduce in the future. > From joliver at john-oliver.net Thu Jan 15 22:56:59 2009 From: joliver at john-oliver.net (John Oliver) Date: Thu, 15 Jan 2009 14:56:59 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <496E786F.9000507@woti.com> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <496E33A9.9000003@woti.com> <20090114232308.GB19523@ns.sdsitehosting.net> <496E786F.9000507@woti.com> Message-ID: <20090115225659.GA8673@ns.sdsitehosting.net> On Wed, Jan 14, 2009 at 06:42:39PM -0500, Bryan Schneiders wrote: > Where did you put dispatch.skipStep("methodcomplete")? > > Mine was just after dispatch.skipStep("network"), or more importantly: not > inside any of the "if" blocks in that function. That was the *only* change you made to the stock stage2.img? > You could also try commenting out the anaconda.method.ejectCD() line in the > doMethodComplete function at the bottom of > usr/lib/ananconda/installmethod.py. I'll try that, but I don't understand why there isn't one "This is how you do it". If someone has made this work, that's what I'm hoping can be posted, so not only I, but the next poor sap who runs into this problem and finds this thread can get a working solution. -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From klaus.arndt at verigy.com Fri Jan 16 08:51:13 2009 From: klaus.arndt at verigy.com (Arndt, Klaus) Date: Fri, 16 Jan 2009 02:51:13 -0600 Subject: How to "upgrade" a RHEL3/RHEL5 Dual boot system ! Message-ID: <5E07F2A85589E74798B02EC48B8B01E6221160@usplmvpbe002.ent.rt.verigy.net> Hello, I have here several RHEL3 / RHEL5 dual boot systems, And would like now to "upgrade" the RHEL5 System via anaconda "upgrade" paht. The issue I got is that anaconda use the first [root] partition in the system for the upgrade, But on the first [root] partition in the system is RHEL3 installed, which should not be overwritten. /dev/sda1 /boot /dev/sda2 swap /dev/sda3 / (RHEL3U7) /dev/sda4 [Exended] /dev/sda5 /1 (RHEL5U0) I found in the Mailing list a possible Patch : https://www.redhat.com/archives/kickstart-list/2008-December/msg00019.html but I would prefer to select the right Root partition in the %pre section of upgrade.cf of rather then to select the right one if anaconda found more then one [root] partition on the system. I check the RHEL5U3 /usr/lib/anaconda/upgrade.py File from the Beta ISO but this has also the same methode, and select the first [root] partition for the "upgrade" :-( Have anyone a Idea to realize this on RHEL5U1 or later ? Regards Klaus ________________________________ Klaus Arndt telnet 57116 telephone +49 7031 4357 116 facsimile +49 7031 4357 ??? Klaus.Arndt at Verigy.com Verigy Germany GmbH, Herrenberger Strasse 130, 71034 B?blingen Sitz der Gesellschaft: B?blingen - Amtsgericht Stuttgart HRB 246167 WEEE-Reg.-Nr. DE 16968742 Gesch?ftsf?hrer: Hans-J?rgen Wagner (Vors.), Dietmar H?ller -------------- next part -------------- An HTML attachment was scrubbed... URL: From saagar.palace at gmail.com Mon Jan 19 01:46:23 2009 From: saagar.palace at gmail.com (saagar shrivastava) Date: Mon, 19 Jan 2009 07:16:23 +0530 Subject: How to "upgrade" a RHEL3/RHEL5 Dual boot system ! In-Reply-To: <5E07F2A85589E74798B02EC48B8B01E6221160@usplmvpbe002.ent.rt.verigy.net> References: <5E07F2A85589E74798B02EC48B8B01E6221160@usplmvpbe002.ent.rt.verigy.net> Message-ID: <106076a20901181746h3642a143m8046d9392a5140b9@mail.gmail.com> Klaus, This is to inform you that, "Upgrade" RHEL to RHEL5 upgrades the packages only it dosen't overwrite the configuration and additional data on it. -Saagar On Fri, Jan 16, 2009 at 2:21 PM, Arndt, Klaus wrote: > Hello, > > > > I have here several RHEL3 / RHEL5 dual boot systems, > > And would like now to "upgrade" the RHEL5 System via anaconda "upgrade" > paht. > > The issue I got is that anaconda use the first [root] partition in the > system for the upgrade, > > But on the first [root] partition in the system is RHEL3 installed, which > should not be overwritten. > > > > /dev/sda1 /boot > > /dev/sda2 swap > > /dev/sda3 / (RHEL3U7) > > /dev/sda4 [Exended] > > /dev/sda5 /1 (RHEL5U0) > > > > I found in the Mailing list a possible Patch : > > > > https://www.redhat.com/archives/kickstart-list/2008-December/msg00019.html > > > > but I would prefer to select the right Root partition in the %pre section > of upgrade.cf > > of rather then to select the right one if anaconda found more then one > [root] partition > > on the system. > > > > I check the RHEL5U3 /usr/lib/anaconda/upgrade.py > > File from the Beta ISO but this has also the same methode, > > and select the first [root] partition for the "upgrade" L > > > > Have anyone a Idea to realize this on RHEL5U1 or later ? > > > > Regards > > Klaus > > > ------------------------------ > > Klaus Arndt > > telnet 57116 > telephone +49 7031 4357 116 > facsimile +49 7031 4357 ??? > > > > *Klaus.Arndt at Verigy.com* > > > > Verigy Germany GmbH, Herrenberger Strasse 130, 71034 B?blingen > > Sitz der Gesellschaft: B?blingen - Amtsgericht Stuttgart HRB 246167 > > WEEE-Reg.-Nr. DE 16968742 > > Gesch?ftsf?hrer: Hans-J?rgen Wagner (Vors.), Dietmar H?ller > > > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cameron.Kennedy at bovislendlease.com Tue Jan 20 14:13:33 2009 From: Cameron.Kennedy at bovislendlease.com (Kennedy, Cameron) Date: Tue, 20 Jan 2009 09:13:33 -0500 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090114174046.GA12381@ns.sdsitehosting.net> References: <20090114174046.GA12381@ns.sdsitehosting.net> Message-ID: <59B63035E89DEB4C99AB5ECC9C115BB70352F25A@USATL01ME253.amer.lendlease.com> I may have completely missed the mark with your question, because I don't have any issues with the following in my kickstart script: %post mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom rsync -rv /mnt/cdrom/LL_Extras /root HOSTNAMETMP=SERVERNAME cp /mnt/cdrom/ks..tar.gz /root/LL_Extras/. umount /mnt/cdrom Basically I use this to copy various saved files, SUN JAVA installs and so on from my custome DVD I make. By custom, all I do is add ks files, server saved files and an LL_EXTRAS folders which has a bunch of installation programs that I need. Right now, that totals about 500MB in size. I don't modify any stage2.img file or make any changes to the standard RHEL DVD files. I use this in RHEL4.x through 5.2 without issues. Regards, -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of John Oliver Sent: Wednesday, January 14, 2009 12:41 PM To: kickstart-list at redhat.com Subject: RHEL5 - copy files from DVD during %post So, I've read that anaconda got broke in RHEL5, and it ejects the DVD too early. I found a post about creating a new stage2.img with a couple of lines in dispatch.py swapped which is supposed to fix this. I did that, and wound up with a DVD that is ejecting right after the SCSI drivers load! I really need to be able to copy files from the DVD during %post What is the correct incantation to make this happen? Thanks... -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list ----------------------------------------- This email (including any attachments) is confidential. If you are not the intended recipient you must not copy, use, disclose, distribute or rely on the information contained in it. If you have received this email in error, please notify the sender immediately by reply email and delete the email from your system. Confidentiality and legal privilege attached to this communication are not waived or lost by reason of mistaken delivery to you. Lend Lease does not guarantee that this email or the attachment(s) are unaffected by computer virus, corruption or other defects. Lend Lease may monitor incoming and outgoing emails for compliance with its Email Policy. Please note that our servers may not be located in your country. From muksyed at stanford.edu Tue Jan 20 22:35:25 2009 From: muksyed at stanford.edu (Mukarram Syed) Date: Tue, 20 Jan 2009 14:35:25 -0800 Subject: Uncompressing Linux booting the kernel...hangs. Message-ID: <003001c97b4f$63509cb0$29f1d610$@edu> Hi, I am sure people would have seen this. I am trying to Kickstart a Dell PE1850. I have connected a monitor/keyboard to it. When I Kickstart it I could load the image (vmlinux and initrd). Then it says: Uncompressing Linux.Ok Booting the kernel Then it hangs there. Now after a couple of minutes when I type ALT+F3, ALT+F4 etc. going through the virtual terminals, I see the installation process and then the Kickstart completes. But I don't see it on the first window. I have disabled Console Redirection on the BIOS. Is there something to do with the terminal.tty stuff. I have a similar issue going on with VMware installation with Kickstart as well. I can't type ALT+F3, ALT+F4 etc. going through the virtual terminals on the VMware install. And also the installs don't complete. Appreciate the help. Regards # mukarram -------------- next part -------------- An HTML attachment was scrubbed... URL: From kpowell at redhat.com Wed Jan 21 16:47:34 2009 From: kpowell at redhat.com (Kyle Powell) Date: Wed, 21 Jan 2009 11:47:34 -0500 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090114180853.GB12824@ns.sdsitehosting.net> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> Message-ID: <497751A6.5040404@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Oliver wrote: > Someone has offered to send me a patched image, but... this has been > known about for 18 months now. In Bugzilla, a fix is promised in 5.2, but > that never happened, and nobody at Red Hat has updated since. > > https://bugzilla.redhat.com/show_bug.cgi?id=239002 > > Very frustrating. > Hi John, Yes, it did happen. Here's the link to the relevant RHEL 5.2 errata: http://rhn.redhat.com/errata/RHBA-2008-0397.html "* do not eject the CD before the %post scripts are run." Can we back up a step? I'd like to help you get fixed up, but your original post doesn't describe the problem you're having. What happens when you try to install RHEL 5.2? - -- Kyle Powell | Red Hat | Senior Consultant, RHCE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFJd1Gm7pTtanQdBU4RAouKAJ45Qd/xfGOEwQ8kUMGr8VoKLxgYoACfcNNw NV7CwI32ujeIqyrCpWQT+ZQ= =SZDV -----END PGP SIGNATURE----- From kpowell at redhat.com Wed Jan 21 16:59:11 2009 From: kpowell at redhat.com (Kyle Powell) Date: Wed, 21 Jan 2009 11:59:11 -0500 Subject: Uncompressing Linux booting the kernel...hangs. In-Reply-To: <003001c97b4f$63509cb0$29f1d610$@edu> References: <003001c97b4f$63509cb0$29f1d610$@edu> Message-ID: <4977545F.2020808@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mukarram Syed wrote: > Hi, > I am sure people would have seen this? > I am trying to Kickstart a Dell PE1850. I have connected a > monitor/keyboard to it. When I Kickstart it I could load the image > (vmlinux and initrd). Then it says: > > Uncompressing Linux?Ok > Booting the kernel > > Then it hangs there. > > Now after a couple of minutes when I type ALT+F3, ALT+F4 etc. going > through the virtual terminals, I see the installation process and then > the Kickstart completes. If the kickstart is completing, then "hangs" is not the right word to use. I think you're issue is caused by a serial console, but not the one you disabled in the BIOS. The output of the kernel and init is going to the serial console instead of the monitor you've got plugged in. Check your kernel boot parameters for something like "console=tty0,ttyS0" and remove it (tty0 is the default). - -- Kyle Powell | Red Hat | Senior Consultant, RHCE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFJd1Rf7pTtanQdBU4RAjCnAJ92+W7T8RB6isvpjxoN3JyMcaoDnwCeOTzD NfxLNq3clNAIn+F2KYwOkWc= =TqoU -----END PGP SIGNATURE----- From muksyed at stanford.edu Wed Jan 21 17:39:37 2009 From: muksyed at stanford.edu (Mukarram Syed) Date: Wed, 21 Jan 2009 09:39:37 -0800 Subject: Uncompressing Linux booting the kernel...hangs. In-Reply-To: <4977545F.2020808@redhat.com> References: <003001c97b4f$63509cb0$29f1d610$@edu> <4977545F.2020808@redhat.com> Message-ID: <00b001c97bef$3b280b10$b1782130$@edu> Thanks Kyle. I'll try that. I have ttyS0 as the console argument like so: label 5 kernel ENTLINUX32_U6/vmlinuz append nofb ks=http://171.67.144.10/ENTLINUX32_U6/Enterprise/ks_el32_u6_asia-base-x-app. cfg initrd=ENTLINUX32_U 6/initrd.img ramdisk_size=10000 lang= devfs=nomount ramdisk_size=9216 ksdevice=eth0 console=ttyS0,9600 ipappend 1 -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Kyle Powell Sent: Wednesday, January 21, 2009 8:59 AM To: Discussion list about Kickstart Subject: Re: Uncompressing Linux booting the kernel...hangs. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mukarram Syed wrote: > Hi, > I am sure people would have seen this? > I am trying to Kickstart a Dell PE1850. I have connected a > monitor/keyboard to it. When I Kickstart it I could load the image > (vmlinux and initrd). Then it says: > > Uncompressing Linux?Ok > Booting the kernel > > Then it hangs there. > > Now after a couple of minutes when I type ALT+F3, ALT+F4 etc. going > through the virtual terminals, I see the installation process and then > the Kickstart completes. If the kickstart is completing, then "hangs" is not the right word to use. I think you're issue is caused by a serial console, but not the one you disabled in the BIOS. The output of the kernel and init is going to the serial console instead of the monitor you've got plugged in. Check your kernel boot parameters for something like "console=tty0,ttyS0" and remove it (tty0 is the default). - -- Kyle Powell | Red Hat | Senior Consultant, RHCE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFJd1Rf7pTtanQdBU4RAjCnAJ92+W7T8RB6isvpjxoN3JyMcaoDnwCeOTzD NfxLNq3clNAIn+F2KYwOkWc= =TqoU -----END PGP SIGNATURE----- _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list From muksyed at stanford.edu Wed Jan 21 22:30:03 2009 From: muksyed at stanford.edu (Mukarram Syed) Date: Wed, 21 Jan 2009 14:30:03 -0800 Subject: Uncompressing Linux booting the kernel...hangs. References: <003001c97b4f$63509cb0$29f1d610$@edu> <4977545F.2020808@redhat.com> Message-ID: <001301c97c17$cd997c90$68cc75b0$@edu> Kyle. You hit the nail on the head on this issue. I really appreciate your help. I got this fixed on the Kickstart install. I'll try the VMware Kickstart install and send an update. Thanks much # mukarram -----Original Message----- From: Mukarram Syed [mailto:muksyed at stanford.edu] Sent: Wednesday, January 21, 2009 9:40 AM To: 'Discussion list about Kickstart' Subject: RE: Uncompressing Linux booting the kernel...hangs. Thanks Kyle. I'll try that. I have ttyS0 as the console argument like so: label 5 kernel ENTLINUX32_U6/vmlinuz append nofb ks=http://171.67.144.10/ENTLINUX32_U6/Enterprise/ks_el32_u6_asia-base-x-app. cfg initrd=ENTLINUX32_U 6/initrd.img ramdisk_size=10000 lang= devfs=nomount ramdisk_size=9216 ksdevice=eth0 console=ttyS0,9600 ipappend 1 -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Kyle Powell Sent: Wednesday, January 21, 2009 8:59 AM To: Discussion list about Kickstart Subject: Re: Uncompressing Linux booting the kernel...hangs. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mukarram Syed wrote: > Hi, > I am sure people would have seen this? > I am trying to Kickstart a Dell PE1850. I have connected a > monitor/keyboard to it. When I Kickstart it I could load the image > (vmlinux and initrd). Then it says: > > Uncompressing Linux?Ok > Booting the kernel > > Then it hangs there. > > Now after a couple of minutes when I type ALT+F3, ALT+F4 etc. going > through the virtual terminals, I see the installation process and then > the Kickstart completes. If the kickstart is completing, then "hangs" is not the right word to use. I think you're issue is caused by a serial console, but not the one you disabled in the BIOS. The output of the kernel and init is going to the serial console instead of the monitor you've got plugged in. Check your kernel boot parameters for something like "console=tty0,ttyS0" and remove it (tty0 is the default). - -- Kyle Powell | Red Hat | Senior Consultant, RHCE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFJd1Rf7pTtanQdBU4RAjCnAJ92+W7T8RB6isvpjxoN3JyMcaoDnwCeOTzD NfxLNq3clNAIn+F2KYwOkWc= =TqoU -----END PGP SIGNATURE----- _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list From debian at herakles.homelinux.org Thu Jan 22 15:42:40 2009 From: debian at herakles.homelinux.org (John Summerfield) Date: Fri, 23 Jan 2009 00:42:40 +0900 Subject: How to "upgrade" a RHEL3/RHEL5 Dual boot system ! In-Reply-To: <5E07F2A85589E74798B02EC48B8B01E6221160@usplmvpbe002.ent.rt.verigy.net> References: <5E07F2A85589E74798B02EC48B8B01E6221160@usplmvpbe002.ent.rt.verigy.net> Message-ID: <497893F0.50200@herakles.homelinux.org> Arndt, Klaus wrote: > Hello, > > > > I have here several RHEL3 / RHEL5 dual boot systems, > > And would like now to "upgrade" the RHEL5 System via anaconda "upgrade" paht. Why? > > The issue I got is that anaconda use the first [root] partition in the system for the upgrade, > > But on the first [root] partition in the system is RHEL3 installed, which should not be overwritten. You seem to have identified a real problem, but what's wrong with this not really difficult method are you ready keep reading yum upgrade -- Cheers John -- spambait 1aaaaaaa at coco.merseine.nu Z1aaaaaaa at coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-) From gwaugh at frontstreetnetworks.com Thu Jan 22 16:38:22 2009 From: gwaugh at frontstreetnetworks.com (Gerald Waugh) Date: Thu, 22 Jan 2009 10:38:22 -0600 Subject: cdrom issue Message-ID: <000501c97caf$da859b80$6401a8c0@systemax> On CentOS4 we mounted the install cdrom in %post And copied some files over to the hard drive. This does not work with CentOS5.2 %post --nochroot # Mount CDROM /usr/bin/mkdir /mnt/source # /usr/bin/mount /tmp/cdrom /mnt/source /usr/bin/mount /dev/cdrom /mnt/source # Move PKGS Over to /tmp/PKGS /usr/bin/mkdir /mnt/sysimage/tmp/PKGS /usr/bin/cp -Rp /mnt/source/PKGS/* /mnt/sysimage/tmp/PKGS >/dev/null 2>&1 # Unmount CDROM /usr/bin/umount /mnt/source %post # Run post install script /tmp/finish_install.sh - Gerald From debian at herakles.homelinux.org Thu Jan 22 17:26:36 2009 From: debian at herakles.homelinux.org (John Summerfield) Date: Fri, 23 Jan 2009 02:26:36 +0900 Subject: cdrom issue In-Reply-To: <000501c97caf$da859b80$6401a8c0@systemax> References: <000501c97caf$da859b80$6401a8c0@systemax> Message-ID: <4978AC4C.5040301@herakles.homelinux.org> Gerald Waugh wrote: > On CentOS4 we mounted the install cdrom in %post > And copied some files over to the hard drive. > This does not work with CentOS5.2 > > %post --nochroot > # Mount CDROM > /usr/bin/mkdir /mnt/source > # /usr/bin/mount /tmp/cdrom /mnt/source > /usr/bin/mount /dev/cdrom /mnt/source Here, add /bin/sh > > # Move PKGS Over to /tmp/PKGS > /usr/bin/mkdir /mnt/sysimage/tmp/PKGS > /usr/bin/cp -Rp /mnt/source/PKGS/* /mnt/sysimage/tmp/PKGS >/dev/null > 2>&1 > > # Unmount CDROM > /usr/bin/umount /mnt/source > > %post > # Run post install script > /tmp/finish_install.sh Here, add /bin/bash --login These will allow you to poke around and see what's what. > > > > - > Gerald > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > -- Cheers John -- spambait 1aaaaaaa at coco.merseine.nu Z1aaaaaaa at coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-) From gwaugh at frontstreetnetworks.com Thu Jan 22 17:34:59 2009 From: gwaugh at frontstreetnetworks.com (Gerald Waugh) Date: Thu, 22 Jan 2009 11:34:59 -0600 Subject: cdrom issue In-Reply-To: <4978AC4C.5040301@herakles.homelinux.org> Message-ID: <000001c97cb7$c3329020$6401a8c0@systemax> John Summerfield wrote Thursday, January 22, 2009 11:27 AM > > Gerald Waugh wrote: > > On CentOS4 we mounted the install cdrom in %post > > And copied some files over to the hard drive. > > This does not work with CentOS5.2 > > > > %post --nochroot > > # Mount CDROM > > /usr/bin/mkdir /mnt/source > > # /usr/bin/mount /tmp/cdrom /mnt/source > > /usr/bin/mount /dev/cdrom /mnt/source > Here, add > /bin/sh > > > > # Move PKGS Over to /tmp/PKGS > > /usr/bin/mkdir /mnt/sysimage/tmp/PKGS > > /usr/bin/cp -Rp /mnt/source/PKGS/* /mnt/sysimage/tmp/PKGS >/dev/null > > 2>&1 > > > > # Unmount CDROM > > /usr/bin/umount /mnt/source > > > > %post > > # Run post install script > > /tmp/finish_install.sh > Here, add > /bin/bash --login > > > These will allow you to poke around and see what's what. > Thanks, will give it a try! Gerald From muksyed at stanford.edu Thu Jan 22 18:21:32 2009 From: muksyed at stanford.edu (Mukarram Syed) Date: Thu, 22 Jan 2009 10:21:32 -0800 Subject: Uncompressing Linux booting the kernel...hangs. References: <003001c97b4f$63509cb0$29f1d610$@edu> <4977545F.2020808@redhat.com> Message-ID: <005a01c97cbe$40a7d0a0$c1f771e0$@edu> VMware Kickstart worked as well. Thanks much for all your help. # mukarram -----Original Message----- From: Mukarram Syed [mailto:muksyed at stanford.edu] Sent: Wednesday, January 21, 2009 2:30 PM To: 'Discussion list about Kickstart' Subject: RE: Uncompressing Linux booting the kernel...hangs. Kyle. You hit the nail on the head on this issue. I really appreciate your help. I got this fixed on the Kickstart install. I'll try the VMware Kickstart install and send an update. Thanks much # mukarram -----Original Message----- From: Mukarram Syed [mailto:muksyed at stanford.edu] Sent: Wednesday, January 21, 2009 9:40 AM To: 'Discussion list about Kickstart' Subject: RE: Uncompressing Linux booting the kernel...hangs. Thanks Kyle. I'll try that. I have ttyS0 as the console argument like so: label 5 kernel ENTLINUX32_U6/vmlinuz append nofb ks=http://171.67.144.10/ENTLINUX32_U6/Enterprise/ks_el32_u6_asia-base-x-app. cfg initrd=ENTLINUX32_U 6/initrd.img ramdisk_size=10000 lang= devfs=nomount ramdisk_size=9216 ksdevice=eth0 console=ttyS0,9600 ipappend 1 -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Kyle Powell Sent: Wednesday, January 21, 2009 8:59 AM To: Discussion list about Kickstart Subject: Re: Uncompressing Linux booting the kernel...hangs. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mukarram Syed wrote: > Hi, > I am sure people would have seen this? > I am trying to Kickstart a Dell PE1850. I have connected a > monitor/keyboard to it. When I Kickstart it I could load the image > (vmlinux and initrd). Then it says: > > Uncompressing Linux?Ok > Booting the kernel > > Then it hangs there. > > Now after a couple of minutes when I type ALT+F3, ALT+F4 etc. going > through the virtual terminals, I see the installation process and then > the Kickstart completes. If the kickstart is completing, then "hangs" is not the right word to use. I think you're issue is caused by a serial console, but not the one you disabled in the BIOS. The output of the kernel and init is going to the serial console instead of the monitor you've got plugged in. Check your kernel boot parameters for something like "console=tty0,ttyS0" and remove it (tty0 is the default). - -- Kyle Powell | Red Hat | Senior Consultant, RHCE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFJd1Rf7pTtanQdBU4RAjCnAJ92+W7T8RB6isvpjxoN3JyMcaoDnwCeOTzD NfxLNq3clNAIn+F2KYwOkWc= =TqoU -----END PGP SIGNATURE----- _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list From gwaugh at frontstreetnetworks.com Thu Jan 22 18:29:15 2009 From: gwaugh at frontstreetnetworks.com (Gerald Waugh) Date: Thu, 22 Jan 2009 12:29:15 -0600 Subject: cdrom issue In-Reply-To: <4978AC4C.5040301@herakles.homelinux.org> Message-ID: <000201c97cbf$580bb5d0$6401a8c0@systemax> John Summerfield wrote; > > Gerald Waugh wrote: > > On CentOS4 we mounted the install cdrom in %post > > And copied some files over to the hard drive. > > This does not work with CentOS5.2 > > > > %post --nochroot > > # Mount CDROM > > /usr/bin/mkdir /mnt/source > > # /usr/bin/mount /tmp/cdrom /mnt/source > > /usr/bin/mount /dev/cdrom /mnt/source > Here, add > /bin/sh > > > > # Move PKGS Over to /tmp/PKGS > > /usr/bin/mkdir /mnt/sysimage/tmp/PKGS > > /usr/bin/cp -Rp /mnt/source/PKGS/* /mnt/sysimage/tmp/PKGS >/dev/null > > 2>&1 > > > > # Unmount CDROM > > /usr/bin/umount /mnt/source > > > > %post > > # Run post install script > > /tmp/finish_install.sh > Here, add > /bin/bash --login > > These will allow you to poke around and see what's what. > Oops! stalled at "Running post-install scripts" Gerald From keith at karsites.net Thu Jan 22 18:35:21 2009 From: keith at karsites.net (Keith Roberts) Date: Thu, 22 Jan 2009 18:35:21 +0000 (GMT) Subject: cdrom issue In-Reply-To: <000501c97caf$da859b80$6401a8c0@systemax> References: <000501c97caf$da859b80$6401a8c0@systemax> Message-ID: On Thu, 22 Jan 2009, Gerald Waugh wrote: > To: kickstart-list at redhat.com > From: Gerald Waugh > Subject: cdrom issue > > On CentOS4 we mounted the install cdrom in %post > And copied some files over to the hard drive. > This does not work with CentOS5.2 > > %post --nochroot > # Mount CDROM > /usr/bin/mkdir /mnt/source > # /usr/bin/mount /tmp/cdrom /mnt/source > /usr/bin/mount /dev/cdrom /mnt/source > > # Move PKGS Over to /tmp/PKGS > /usr/bin/mkdir /mnt/sysimage/tmp/PKGS > /usr/bin/cp -Rp /mnt/source/PKGS/* /mnt/sysimage/tmp/PKGS >/dev/null > 2>&1 > > # Unmount CDROM > /usr/bin/umount /mnt/source > > %post > # Run post install script > /tmp/finish_install.sh > > > > - > Gerald Hi Gerald. I'm a new user to kickstart so please bear with me. I managed to mount a seperate working Fedora root partition without using the --nochroot option. I had to make the device node as well. Here is the relevant part of my kickstart file: Maybe this approach would help with your problem? #--------------------------------------------------- # Packages and groups to install. %packages --nobase @british-support # Needed for mknod. coreutils %end #--------------------------------------------------- # Post installation script. %post --interpreter /bin/bash --log=/root/F10-basic-2.ks-log --erroronfail # Create the /mnt/F8-root directory. mkdir /mnt/F8-root #--------------------------------------------------- # Create the device node for /dev/sda1 drive. mknod /dev/sda1 b 8 1 #--------------------------------------------------- # Mount the F8 root partition. mount -v -t ext3 /dev/sda1 /mnt/F8-root # Delete the existing resolv.conf file. rm -fv /etc/resolv.conf # Copy the working resolv.conf file. cp -v /mnt/F8-root/etc/resolv.conf /etc/resolv.conf # Setup the network. chkconfig --level 2345 network on # Stop the network. /etc/init.d/network stop # Start the network. /etc/init.d/network start # Ping remote host 10 times to test internet connection. ping -c 10 www.grc.com %end HTH Kind Regards, Keith Roberts ----------------------------------------------------------------- Websites: http://www.php-debuggers.net http://www.karsites.net http://www.raised-from-the-dead.org.uk All email addresses are challenge-response protected with TMDA [http://tmda.net] ----------------------------------------------------------------- From debian at herakles.homelinux.org Fri Jan 23 00:46:22 2009 From: debian at herakles.homelinux.org (John Summerfield) Date: Fri, 23 Jan 2009 09:46:22 +0900 Subject: cdrom issue In-Reply-To: <000201c97cbf$580bb5d0$6401a8c0@systemax> References: <000201c97cbf$580bb5d0$6401a8c0@systemax> Message-ID: <4979135E.2010007@herakles.homelinux.org> Gerald Waugh wrote: > John Summerfield wrote; >> Gerald Waugh wrote: >>> On CentOS4 we mounted the install cdrom in %post >>> And copied some files over to the hard drive. >>> This does not work with CentOS5.2 >>> >>> %post --nochroot >>> # Mount CDROM >>> /usr/bin/mkdir /mnt/source >>> # /usr/bin/mount /tmp/cdrom /mnt/source >>> /usr/bin/mount /dev/cdrom /mnt/source >> Here, add >> /bin/sh >>> # Move PKGS Over to /tmp/PKGS >>> /usr/bin/mkdir /mnt/sysimage/tmp/PKGS >>> /usr/bin/cp -Rp /mnt/source/PKGS/* /mnt/sysimage/tmp/PKGS >/dev/null >>> 2>&1 >>> >>> # Unmount CDROM >>> /usr/bin/umount /mnt/source >>> >>> %post >>> # Run post install script >>> /tmp/finish_install.sh >> Here, add >> /bin/bash --login >> >> These will allow you to poke around and see what's what. >> > Oops! stalled at "Running post-install scripts" That's the shell awaiting for your input. I don't recall which console it appears on, but you can force the issue with a preliminary chvt. > > Gerald > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > -- Cheers John -- spambait 1aaaaaaa at coco.merseine.nu Z1aaaaaaa at coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-) From debian at herakles.homelinux.org Fri Jan 23 00:54:02 2009 From: debian at herakles.homelinux.org (John Summerfield) Date: Fri, 23 Jan 2009 09:54:02 +0900 Subject: cdrom issue In-Reply-To: References: <000501c97caf$da859b80$6401a8c0@systemax> Message-ID: <4979152A.4000906@herakles.homelinux.org> Keith Roberts wrote: > On Thu, 22 Jan 2009, Gerald Waugh wrote: > >> To: kickstart-list at redhat.com >> From: Gerald Waugh >> Subject: cdrom issue >> >> On CentOS4 we mounted the install cdrom in %post >> And copied some files over to the hard drive. >> This does not work with CentOS5.2 >> >> %post --nochroot >> # Mount CDROM >> /usr/bin/mkdir /mnt/source >> # /usr/bin/mount /tmp/cdrom /mnt/source >> /usr/bin/mount /dev/cdrom /mnt/source >> >> # Move PKGS Over to /tmp/PKGS >> /usr/bin/mkdir /mnt/sysimage/tmp/PKGS >> /usr/bin/cp -Rp /mnt/source/PKGS/* /mnt/sysimage/tmp/PKGS >/dev/null >> 2>&1 >> >> # Unmount CDROM >> /usr/bin/umount /mnt/source >> >> %post >> # Run post install script >> /tmp/finish_install.sh >> >> >> >> - >> Gerald > > > Hi Gerald. I'm a new user to kickstart so please bear with me. > > I managed to mount a seperate working Fedora root partition without > using the --nochroot option. I had to make the device node as well. Here > is the relevant part of my kickstart file: > > Maybe this approach would help with your problem? > > #--------------------------------------------------- > > # Packages and groups to install. > %packages --nobase > @british-support > > # Needed for mknod. > coreutils > %end > > #--------------------------------------------------- > > # Post installation script. > %post --interpreter /bin/bash --log=/root/F10-basic-2.ks-log --erroronfail > > # Create the /mnt/F8-root directory. > mkdir /mnt/F8-root > > #--------------------------------------------------- > # Create the device node for /dev/sda1 drive. > mknod /dev/sda1 b 8 1 > #--------------------------------------------------- Risky. Trust me, you don't want two device nodes for one device. I would fully expect harm to the filesystem. If you get away with it, you're lucky. Whether to use --chroot is a often matter of taste and coding, influenced by available resources including device nodes. I don't know where anaconda creates its device nodes now, they used to be in /tmp and only exist when required. It might be now that anaconda relies on the kernel or dbus or something else creating them somewhere. When in the %post and %pre scripts, device nodes for the target storage exist. Probably they do for the install device too, but it's a long time since I looked, mostly I install off the LAN (using http). -- Cheers John -- spambait 1aaaaaaa at coco.merseine.nu Z1aaaaaaa at coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-) From jlaska at redhat.com Fri Jan 23 17:23:09 2009 From: jlaska at redhat.com (James Laska) Date: Fri, 23 Jan 2009 12:23:09 -0500 Subject: pykickstart -- looking for unit test volunteers Message-ID: <1232731389.3647.308.camel@localhost.localdomain> Greetings folks, Chris Lumens, maintainer of pykickstart [1], is looking to expand the unit tests for the pykickstart package. For those who aren't familiar, pykickstart is used to read and write kickstart files by the anaconda installer, system-config-kickstart, livecd-tools, and snake. Anytime a pykickstart change is made, it can potentially disrupt kickstart processing for all of the supported distros (from RHEL3 to rawhide) or dependent tools. In order to improve confidence in any code changes, we began building unit tests into pykickstart [2]. So far, the tests are proving worthwhile in shaking out several bugs. However, only 2 of 47 kickstart commands have unit test coverage. We could use some help :) I invite folks to come join us in #kickstart where we'll be hosting a unit test development session. WHO: Anyone who ... * is interested in improving their python skills * wants to share their favorite kickstart files * has ideas on how to unit test WHEN: Wednesday, January 28, 2009 from 17:00-21:00 UTC (noon - 5pm EST) WHERE: irc://irc.freenode.net/kickstart WHY: Improving pykickstart makes installing Fedora more reliable ... and why do it alone when writing tests with friends is more fun! Hope to see you there! Thanks, James [1] https://fedoraproject.org/wiki/Pykickstart [2] http://git.fedorahosted.org/git/?p=pykickstart.git;a=commit;h=f4b5cf11aab1bf7acbc4113865a51cc718ba0935 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From joliver at john-oliver.net Fri Jan 23 20:53:09 2009 From: joliver at john-oliver.net (John Oliver) Date: Fri, 23 Jan 2009 12:53:09 -0800 Subject: cdrom issue In-Reply-To: <000501c97caf$da859b80$6401a8c0@systemax> References: <000501c97caf$da859b80$6401a8c0@systemax> Message-ID: <20090123205309.GB16846@ns.sdsitehosting.net> On Thu, Jan 22, 2009 at 10:38:22AM -0600, Gerald Waugh wrote: > On CentOS4 we mounted the install cdrom in %post > And copied some files over to the hard drive. > This does not work with CentOS5.2 > > %post --nochroot > # Mount CDROM > /usr/bin/mkdir /mnt/source > # /usr/bin/mount /tmp/cdrom /mnt/source > /usr/bin/mount /dev/cdrom /mnt/source > > # Move PKGS Over to /tmp/PKGS > /usr/bin/mkdir /mnt/sysimage/tmp/PKGS > /usr/bin/cp -Rp /mnt/source/PKGS/* /mnt/sysimage/tmp/PKGS >/dev/null > 2>&1 > > # Unmount CDROM > /usr/bin/umount /mnt/source > > %post > # Run post install script > /tmp/finish_install.sh There is a problem with the RHEL5 anaconda that tries to eject the CD-ROM before %post I've found a couple of "fixes" that result in a message telling me I have no CD inserted :-( With VMware, I've been able to 'mount /dev/hdc /mnt/cdrom' instead of /dev/cdrom You can also replace the contents of %post with "sleep 99999" The install will "hang" when it gets there. You can Alt-F2 to see messages, and Alt-F3 to get to a sh shell. With that, you can poke around and see what's what. -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From eric at trueblade.com Fri Jan 23 21:43:35 2009 From: eric at trueblade.com (Eric Smith) Date: Fri, 23 Jan 2009 16:43:35 -0500 Subject: %traceback section in config file? Message-ID: <497A3A07.4080105@trueblade.com> According to http://fedoraproject.org/wiki/Anaconda/Kickstart, there's a %traceback section in the config file. That term appears only once on that page, and I couldn't find a reference to it anywhere using google. Does such a section exist, and if so, what does it do? Just curious. Thanks. Eric. From clumens at redhat.com Fri Jan 23 21:51:28 2009 From: clumens at redhat.com (Chris Lumens) Date: Fri, 23 Jan 2009 16:51:28 -0500 Subject: %traceback section in config file? In-Reply-To: <497A3A07.4080105@trueblade.com> References: <497A3A07.4080105@trueblade.com> Message-ID: <20090123215127.GJ1121@localhost.localdomain> > According to http://fedoraproject.org/wiki/Anaconda/Kickstart, there's a > %traceback section in the config file. That term appears only once on > that page, and I couldn't find a reference to it anywhere using google. > > Does such a section exist, and if so, what does it do? > > Just curious. Thanks. Yes, a %traceback is a type of script just like a %pre or %post. It executes in the event anaconda gets a traceback, which is a python error. We use these for automated install testing and reporting. I don't think they are overly useful to end users, but who knows. - Chris From masaiah.p at gmail.com Fri Jan 23 22:13:00 2009 From: masaiah.p at gmail.com (Masaiah) Date: 23 Jan 2009 22:13:00 -0000 Subject: Masaiah invites you to join Zorpia Message-ID: <20090123221300.27849.qmail@zorpia.com> Hi Discussion list about! Your friend Masaiah from , just invited you to his online photo albums and journals at Zorpia.com. So what is Zorpia? It is an online community that allows you to upload unlimited amount of photos, write journals and make friends. We also have a variety of skins in store for you so that you can customize your homepage freely. Join now for free! Please click the following link to join Zorpia: http://in.signup.zorpia.com/signup?invitation_key=20081273560f58f7bdb25e3c409baad3&referral=masaiah This message was delivered with the Masaiah's initiation. If you wish to discontinue receiving invitations from us, please click the following link: http://in.signup.zorpia.com/email/optout/kickstart-list at redhat.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcole at keysoftsys.com Sat Jan 24 01:17:50 2009 From: dcole at keysoftsys.com (Darren Cole) Date: Fri, 23 Jan 2009 17:17:50 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090115225659.GA8673@ns.sdsitehosting.net> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <496E33A9.9000003@woti.com> <20090114232308.GB19523@ns.sdsitehosting.net> <496E786F.9000507@woti.com> <20090115225659.GA8673@ns.sdsitehosting.net> Message-ID: >> Where did you put dispatch.skipStep("methodcomplete")? >> >> Mine was just after dispatch.skipStep("network"), or more >> importantly: not >> inside any of the "if" blocks in that function. > > That was the *only* change you made to the stock stage2.img? Here is patch I used, but it was against released RHEL5, not at 5.2 or anything like that. I unsquashed the stage2.img, patched, the resquashed a newer stage2.img. diff -ru squashfs-root-orig/usr/lib/anaconda/dispatch.py squashfs-root/ usr/lib/anaconda/dispatch.py --- squashfs-root-orig/usr/lib/anaconda/dispatch.py 2006-12-18 10:49:01.000000000 -0800 +++ squashfs-root/usr/lib/anaconda/dispatch.py 2007-07-01 20:33:48.000000000 -0700 @@ -108,8 +108,8 @@ ("writeregkey", writeRegKey, ), ("setfilecon", setFileCons, ), ("copylogs", copyAnacondaLogs, ), - ("methodcomplete", doMethodComplete, ), ("dopostaction", doPostAction, ), + ("methodcomplete", doMethodComplete, ), ("complete", ), ] From eric at trueblade.com Sat Jan 24 14:24:53 2009 From: eric at trueblade.com (Eric Smith) Date: Sat, 24 Jan 2009 09:24:53 -0500 Subject: %traceback section in config file? In-Reply-To: <20090123215127.GJ1121@localhost.localdomain> References: <497A3A07.4080105@trueblade.com> <20090123215127.GJ1121@localhost.localdomain> Message-ID: <497B24B5.90108@trueblade.com> Chris Lumens wrote: >> According to http://fedoraproject.org/wiki/Anaconda/Kickstart, there's a >> %traceback section in the config file. That term appears only once on >> that page, and I couldn't find a reference to it anywhere using google. >> >> Does such a section exist, and if so, what does it do? >> >> Just curious. Thanks. > > Yes, a %traceback is a type of script just like a %pre or %post. It > executes in the event anaconda gets a traceback, which is a python > error. We use these for automated install testing and reporting. I > don't think they are overly useful to end users, but who knows. Thanks, Chris. Do you know if this is documented anywhere? For example, can I get access to the traceback in the script? Are there any options to the %traceback section itself? I might have a use for this. If it's not documented, I'll dig out the source. Thanks! From clumens at redhat.com Mon Jan 26 15:33:59 2009 From: clumens at redhat.com (Chris Lumens) Date: Mon, 26 Jan 2009 10:33:59 -0500 Subject: %traceback section in config file? In-Reply-To: <497B24B5.90108@trueblade.com> References: <497A3A07.4080105@trueblade.com> <20090123215127.GJ1121@localhost.localdomain> <497B24B5.90108@trueblade.com> Message-ID: <20090126153359.GK1121@localhost.localdomain> >> Yes, a %traceback is a type of script just like a %pre or %post. It >> executes in the event anaconda gets a traceback, which is a python >> error. We use these for automated install testing and reporting. I >> don't think they are overly useful to end users, but who knows. > > Thanks, Chris. Do you know if this is documented anywhere? For example, > can I get access to the traceback in the script? Are there any options > to the %traceback section itself? > > I might have a use for this. > > If it's not documented, I'll dig out the source. It's not documented very well, no. You can access the traceback by looking at /tmp/anacdump.txt. It takes the same options as a %post script does. As usual, the source is the best documentation though. - Chris From mdehaan at redhat.com Tue Jan 27 20:14:17 2009 From: mdehaan at redhat.com (Michael DeHaan) Date: Tue, 27 Jan 2009 15:14:17 -0500 Subject: %traceback section in config file? In-Reply-To: <20090126153359.GK1121@localhost.localdomain> References: <497A3A07.4080105@trueblade.com> <20090123215127.GJ1121@localhost.localdomain> <497B24B5.90108@trueblade.com> <20090126153359.GK1121@localhost.localdomain> Message-ID: <497F6B19.8020006@redhat.com> Chris Lumens wrote: >>> Yes, a %traceback is a type of script just like a %pre or %post. It >>> executes in the event anaconda gets a traceback, which is a python >>> error. We use these for automated install testing and reporting. I >>> don't think they are overly useful to end users, but who knows. >>> >> Thanks, Chris. Do you know if this is documented anywhere? For example, >> can I get access to the traceback in the script? Are there any options >> to the %traceback section itself? >> >> I might have a use for this. >> >> If it's not documented, I'll dig out the source. >> > > It's not documented very well, no. You can access the traceback by > looking at /tmp/anacdump.txt. It takes the same options as a %post > script does. > > As usual, the source is the best documentation though. > > - Chris > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > How far back does %traceback go? (EL 2/3/4?) --Michael From katzj at redhat.com Tue Jan 27 21:20:42 2009 From: katzj at redhat.com (Jeremy Katz) Date: Tue, 27 Jan 2009 16:20:42 -0500 Subject: %traceback section in config file? In-Reply-To: <497F6B19.8020006@redhat.com> References: <497A3A07.4080105@trueblade.com> <20090123215127.GJ1121@localhost.localdomain> <497B24B5.90108@trueblade.com> <20090126153359.GK1121@localhost.localdomain> <497F6B19.8020006@redhat.com> Message-ID: <20090127212042.GA28659@redhat.com> On Tuesday, January 27 2009, Michael DeHaan said: > How far back does %traceback go? > > (EL 2/3/4?) It was added in April of 2003, so Red Hat Enterprise Linux 3 should have it I believe Jeremy From kpowell at redhat.com Tue Jan 27 21:53:26 2009 From: kpowell at redhat.com (Kyle Powell) Date: Tue, 27 Jan 2009 16:53:26 -0500 Subject: %traceback section in config file? In-Reply-To: <20090127212042.GA28659@redhat.com> References: <497A3A07.4080105@trueblade.com> <20090123215127.GJ1121@localhost.localdomain> <497B24B5.90108@trueblade.com> <20090126153359.GK1121@localhost.localdomain> <497F6B19.8020006@redhat.com> <20090127212042.GA28659@redhat.com> Message-ID: <497F8256.9080406@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jeremy Katz wrote: > On Tuesday, January 27 2009, Michael DeHaan said: >> How far back does %traceback go? >> >> (EL 2/3/4?) > > It was added in April of 2003, so Red Hat Enterprise Linux 3 should have > it I believe > > Jeremy I don't see it in the last Red Hat Enterprise Linux 3 anaconda (anaconda-9.1-8.RHEL.i386.rpm). RHEL 3 was based on Red Hat Linux 8 which was released September of 2002 so I don't think %traceback was ever added to the RHEL 3 code base. And considering Red Hat Linux 9 was released in March of 2003, I'd say you need Fedora or RHEL 4 to use %traceback. - -- Kyle Powell | Red Hat | Senior Consultant, RHCE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFJf4JV7pTtanQdBU4RAvDkAJ9fWtG+hifubMeYxTJhr21xXS0+QgCcDvAP IpsH9meOEqhpsOWl6n2+Ul8= =n4Id -----END PGP SIGNATURE----- From mdehaan at redhat.com Tue Jan 27 22:10:30 2009 From: mdehaan at redhat.com (Michael DeHaan) Date: Tue, 27 Jan 2009 17:10:30 -0500 Subject: %traceback section in config file? In-Reply-To: <497F8256.9080406@redhat.com> References: <497A3A07.4080105@trueblade.com> <20090123215127.GJ1121@localhost.localdomain> <497B24B5.90108@trueblade.com> <20090126153359.GK1121@localhost.localdomain> <497F6B19.8020006@redhat.com> <20090127212042.GA28659@redhat.com> <497F8256.9080406@redhat.com> Message-ID: <497F8656.6020601@redhat.com> Kyle Powell wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Jeremy Katz wrote: > >> On Tuesday, January 27 2009, Michael DeHaan said: >> >>> How far back does %traceback go? >>> >>> (EL 2/3/4?) >>> >> It was added in April of 2003, so Red Hat Enterprise Linux 3 should have >> it I believe >> >> Jeremy >> > > I don't see it in the last Red Hat Enterprise Linux 3 anaconda > (anaconda-9.1-8.RHEL.i386.rpm). RHEL 3 was based on Red Hat Linux 8 which was > released September of 2002 so I don't think %traceback was ever added to the > RHEL 3 code base. And considering Red Hat Linux 9 was released in March of 2003, > I'd say you need Fedora or RHEL 4 to use %traceback. > - -- > Kyle Powell | Red Hat | Senior Consultant, RHCE > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (GNU/Linux) > Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org > > iD8DBQFJf4JV7pTtanQdBU4RAvDkAJ9fWtG+hifubMeYxTJhr21xXS0+QgCcDvAP > IpsH9meOEqhpsOWl6n2+Ul8= > =n4Id > -----END PGP SIGNATURE----- > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > I'm really not sure I can use it anyway. Reason I was asking -- James Laska and Bill Peck added some nice Anaconda monitoring code from a previous provisioning system to Cobbler, so we do now have a way for folks to do a whole bunch of logging of various Anaconda things remotely if they want. I'm not sure if this ultimately proves useful in extending that or not, but I figured I would ask. (Look at the devel branch in git, not the stuff in Fedora/EPEL) I also want to do a better remote status implementation, so I can say "show me all my systems that are installing in my lab/datacenter and what's up with them". Right now we have that, but it's based on their start time and whether they've finished. Spacewalk has another implementation that provides more granularity, I used to have a mod_python filter handler one (before various API things broke it, and it was unreliable anyway), but maybe I'll rewrite it someday. Anyhow, I think tracebacks would be nice, but then again a failure in post doesn't trigger a traceback, so it's not that common either. Still, good to know. --Michael From jgranado at redhat.com Wed Jan 28 11:10:02 2009 From: jgranado at redhat.com (Joel Granados) Date: Wed, 28 Jan 2009 06:10:02 -0500 (EST) Subject: %traceback section in config file? In-Reply-To: <497F8256.9080406@redhat.com> Message-ID: <1134002416.2420931233141002389.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> ----- "Kyle Powell" wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Jeremy Katz wrote: > > On Tuesday, January 27 2009, Michael DeHaan said: > >> How far back does %traceback go? > >> > >> (EL 2/3/4?) > > > > It was added in April of 2003, so Red Hat Enterprise Linux 3 should > have > > it I believe > > > > Jeremy > > I don't see it in the last Red Hat Enterprise Linux 3 anaconda > (anaconda-9.1-8.RHEL.i386.rpm). RHEL 3 was based on Red Hat Linux 8 I would try to look for it in the kickstart package. pykickstart is the name, I think. > which was > released September of 2002 so I don't think %traceback was ever added > to the > RHEL 3 code base. And considering Red Hat Linux 9 was released in > March of 2003, > I'd say you need Fedora or RHEL 4 to use %traceback. > - -- > Kyle Powell | Red Hat | Senior Consultant, RHCE > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (GNU/Linux) > Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org > > iD8DBQFJf4JV7pTtanQdBU4RAvDkAJ9fWtG+hifubMeYxTJhr21xXS0+QgCcDvAP > IpsH9meOEqhpsOWl6n2+Ul8= > =n4Id > -----END PGP SIGNATURE----- > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list -- Joel Andres Granados Red Hat / Brno Czech Republic From jlaska at redhat.com Wed Jan 28 13:13:43 2009 From: jlaska at redhat.com (James Laska) Date: Wed, 28 Jan 2009 08:13:43 -0500 Subject: %traceback section in config file? In-Reply-To: <497F8656.6020601@redhat.com> References: <497A3A07.4080105@trueblade.com> <20090123215127.GJ1121@localhost.localdomain> <497B24B5.90108@trueblade.com> <20090126153359.GK1121@localhost.localdomain> <497F6B19.8020006@redhat.com> <20090127212042.GA28659@redhat.com> <497F8256.9080406@redhat.com> <497F8656.6020601@redhat.com> Message-ID: <1233148423.9756.29.camel@localhost.localdomain> On Tue, 2009-01-27 at 17:10 -0500, Michael DeHaan wrote: > I also want to do a better remote status implementation, so I can say > "show me all my systems that are installing in my lab/datacenter and > what's up with them". Right now we have that, but it's based on their > start time and whether they've finished. Spacewalk has another > implementation that provides more granularity, I used to have a > mod_python filter handler one (before various API things broke it, > and > it was unreliable anyway), but maybe I'll rewrite it someday. I'm anxious for your input here. I'm not yet sure of the best method to plug anamon (anaconda monitor) into this. > Anyhow, I think tracebacks would be nice, but then again a failure in > post doesn't trigger a traceback, so it's not that common either. Among lots of other files in /tmp, the anaconda monitoring code will send back a /tmp/anacdump.txt if encountered by your installing system. Thanks, James -- ========================================== James Laska -- jlaska at redhat.com Quality Engineering -- Red Hat, Inc. ========================================== -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From mdehaan at redhat.com Wed Jan 28 16:11:02 2009 From: mdehaan at redhat.com (Michael DeHaan) Date: Wed, 28 Jan 2009 11:11:02 -0500 Subject: %traceback section in config file? In-Reply-To: <1233148423.9756.29.camel@localhost.localdomain> References: <497A3A07.4080105@trueblade.com> <20090123215127.GJ1121@localhost.localdomain> <497B24B5.90108@trueblade.com> <20090126153359.GK1121@localhost.localdomain> <497F6B19.8020006@redhat.com> <20090127212042.GA28659@redhat.com> <497F8256.9080406@redhat.com> <497F8656.6020601@redhat.com> <1233148423.9756.29.camel@localhost.localdomain> Message-ID: <49808396.7050307@redhat.com> James Laska wrote: > On Tue, 2009-01-27 at 17:10 -0500, Michael DeHaan wrote: > > >> I also want to do a better remote status implementation, so I can say >> "show me all my systems that are installing in my lab/datacenter and >> what's up with them". Right now we have that, but it's based on their >> start time and whether they've finished. Spacewalk has another >> implementation that provides more granularity, I used to have a >> mod_python filter handler one (before various API things broke it, >> and >> it was unreliable anyway), but maybe I'll rewrite it someday. >> > > I'm anxious for your input here. I'm not yet sure of the best method to > plug anamon (anaconda monitor) into this. > Wasn't planning to use it for that, since log parsing for all the systems could be slow and error prone. I need to find out the proper mod_python way to monitor gets to files under a specific path. The filter handler I was using before seems too intrusive. > >> Anyhow, I think tracebacks would be nice, but then again a failure in >> post doesn't trigger a traceback, so it's not that common either. >> > > Among lots of other files in /tmp, the anaconda monitoring code will > send back a /tmp/anacdump.txt if encountered by your installing system. > Nice! > Thanks, > James > > > ------------------------------------------------------------------------ > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list From jlaska at redhat.com Wed Jan 28 17:44:42 2009 From: jlaska at redhat.com (James Laska) Date: Wed, 28 Jan 2009 12:44:42 -0500 Subject: pykickstart -- looking for unit test volunteers In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233164683.9756.39.camel@localhost.localdomain> Greetings, We'll be getting started shortly, come join the fun in #kickstart ... Thanks, James On Fri, 2009-01-23 at 12:23 -0500, James Laska wrote: > Greetings folks, > > Chris Lumens, maintainer of pykickstart [1], is looking to expand the > unit tests for the pykickstart package. For those who aren't familiar, > pykickstart is used to read and write kickstart files by the anaconda > installer, system-config-kickstart, livecd-tools, and snake. Anytime a > pykickstart change is made, it can potentially disrupt kickstart > processing for all of the supported distros (from RHEL3 to rawhide) or > dependent tools. > > In order to improve confidence in any code changes, we began building > unit tests into pykickstart [2]. So far, the tests are proving > worthwhile in shaking out several bugs. However, only 2 of 47 kickstart > commands have unit test coverage. > > We could use some help :) > > I invite folks to come join us in #kickstart where we'll be hosting a > unit test development session. > > WHO: Anyone who ... > * is interested in improving their python skills > * wants to share their favorite kickstart files > * has ideas on how to unit test > WHEN: Wednesday, January 28, 2009 > from 17:00-21:00 UTC (noon - 5pm EST) > WHERE: irc://irc.freenode.net/kickstart > WHY: Improving pykickstart makes installing Fedora more > reliable ... and why do it alone when writing tests > with friends is more fun! > > Hope to see you there! > > Thanks, > James > > [1] https://fedoraproject.org/wiki/Pykickstart > [2] > http://git.fedorahosted.org/git/?p=pykickstart.git;a=commit;h=f4b5cf11aab1bf7acbc4113865a51cc718ba0935 > > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From jlaska at redhat.com Wed Jan 28 18:39:43 2009 From: jlaska at redhat.com (James Laska) Date: Wed, 28 Jan 2009 13:39:43 -0500 Subject: [PATCH] Added new autostep test In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233167983-12932-1-git-send-email-jlaska@redhat.com> --- tests/commands/autostep.py | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) create mode 100644 tests/commands/autostep.py diff --git a/tests/commands/autostep.py b/tests/commands/autostep.py new file mode 100644 index 0000000..1a117df --- /dev/null +++ b/tests/commands/autostep.py @@ -0,0 +1,37 @@ +# +# James Laska +# +# Copyright 2005, 2006, 2007 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# +import unittest, shlex +import warnings +from tests.baseclass import * + +from pykickstart.errors import * +from pykickstart.commands.autostep import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("autostep", "autostep\n") + self.assert_parse("autostep --autoscreenshot", "autostep --autoscreenshot\n") + + # fail + self.assert_parse_error("autostep --autoscreenshot=FOO") + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From clumens at redhat.com Wed Jan 28 18:45:02 2009 From: clumens at redhat.com (Chris Lumens) Date: Wed, 28 Jan 2009 13:45:02 -0500 Subject: [PATCH] Add a test case for the autopart command. In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233168302-19773-1-git-send-email-clumens@redhat.com> --- tests/commands/autopart.py | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 tests/commands/autopart.py diff --git a/tests/commands/autopart.py b/tests/commands/autopart.py new file mode 100644 index 0000000..2586b0b --- /dev/null +++ b/tests/commands/autopart.py @@ -0,0 +1,53 @@ +# +# Chris Lumens +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# +import unittest, shlex +import warnings +from tests.baseclass import * + +from pykickstart.errors import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("autopart") + + # fail + self.assert_parse_error("autopart --blah", KickstartValueError) + +class F9_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("autopart") + self.assert_parse("autopart --passphrase=whatever", "autopart\n") + self.assert_parse("autopart --encrypted", "autopart --encrypted\n") + self.assert_parse("autopart --encrypted --passphrase=\"whatever\"", + "autopart --encrypted --passphrase=\"whatever\"\n") + self.assert_parse("autopart --encrypted --passphrase=whatever", + "autopart --encrypted --passphrase=\"whatever\"\n") + + # fail + self.assert_parse_error("autopart --blah") + self.assert_parse_error("autopart --passphrase") + self.assert_parse_error("autopart --encrypted --passphrase") + self.assert_parse_error("autopart --encrypted=False") + self.assert_parse_error("autopart --encrypted=True") + +if __name__ == "__main__": + unittest.main() -- 1.6.0.3 From adamwill at shaw.ca Wed Jan 28 20:39:03 2009 From: adamwill at shaw.ca (Adam Williamson) Date: Wed, 28 Jan 2009 12:39:03 -0800 Subject: [PATCH] Create clearpart command In-Reply-To: <1232731389.3647.308.camel@adam.local.net> References: <1232731389.3647.308.camel@adam.local.net> Message-ID: <1233175143-9998-1-git-send-email-adamwill@shaw.ca> From: Adam Williamson --- tests/commands/clearpart.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) create mode 100644 tests/commands/clearpart.py diff --git a/tests/commands/clearpart.py b/tests/commands/clearpart.py new file mode 100644 index 0000000..03a4d16 --- /dev/null +++ b/tests/commands/clearpart.py @@ -0,0 +1,38 @@ +import unittest, shlex +import warnings +from tests.baseclass import * + +from pykickstart.errors import * +from pykickstart.commands.authconfig import * +#from pykickstart.base import * +#from pykickstart.options import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("clearpart") + self.assert_parse("clearpart --all", "clearpart --all \n") + # Passing multiple competing type options should accept only the last one + self.assert_parse("clearpart --linux --none --all", "clearpart --all \n") + # Setting --initlabel or --drives without a type option should 'fail' + self.assert_parse("clearpart --initlabel", "") + self.assert_parse("clearpart --drives sda", "") + + self.assert_parse("clearpart --all --initlabel", "clearpart --all --initlabel \n") + self.assert_parse("clearpart --all --drives sda", "clearpart --all --drives=sda\n") + self.assert_parse("clearpart --all --drives sda,sdb", "clearpart --all --drives=sda,sdb\n") + self.assert_parse("clearpart --all --drives=sda", "clearpart --all --drives=sda\n") + self.assert_parse("clearpart --all --drives=sda,sdb", "clearpart --all --drives=sda,sdb\n") + # Big Everything Test + self.assert_parse("clearpart --drives=sda,sdb --all --linux --initlabel", "clearpart --linux --initlabel --drives=sda,sdb\n") + + # fail + # initlabel should not take a value + self.assert_parse_error("clearpart --initlabel=foo") + # drives must take a value + self.assert_parse_error("clearpart --all --drives") + # nonsensical parameter test + self.assert_parse_error("clearpart --cheese") + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From adamwill at shaw.ca Wed Jan 28 20:59:05 2009 From: adamwill at shaw.ca (Adam Williamson) Date: Wed, 28 Jan 2009 12:59:05 -0800 Subject: [PATCH] switch to spaces not tabs In-Reply-To: <1232731389.3647.308.camel@adam.local.net> References: <1232731389.3647.308.camel@adam.local.net> Message-ID: <1233176345-10196-1-git-send-email-adamwill@shaw.ca> --- tests/commands/clearpart.py | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/commands/clearpart.py b/tests/commands/clearpart.py index 03a4d16..f4e6076 100644 --- a/tests/commands/clearpart.py +++ b/tests/commands/clearpart.py @@ -12,27 +12,27 @@ class FC3_TestCase(CommandTest): # pass self.assert_parse("clearpart") self.assert_parse("clearpart --all", "clearpart --all \n") - # Passing multiple competing type options should accept only the last one + # Passing multiple competing type options should accept only the last one self.assert_parse("clearpart --linux --none --all", "clearpart --all \n") - # Setting --initlabel or --drives without a type option should 'fail' - self.assert_parse("clearpart --initlabel", "") - self.assert_parse("clearpart --drives sda", "") + # Setting --initlabel or --drives without a type option should 'fail' + self.assert_parse("clearpart --initlabel", "") + self.assert_parse("clearpart --drives sda", "") - self.assert_parse("clearpart --all --initlabel", "clearpart --all --initlabel \n") - self.assert_parse("clearpart --all --drives sda", "clearpart --all --drives=sda\n") - self.assert_parse("clearpart --all --drives sda,sdb", "clearpart --all --drives=sda,sdb\n") - self.assert_parse("clearpart --all --drives=sda", "clearpart --all --drives=sda\n") - self.assert_parse("clearpart --all --drives=sda,sdb", "clearpart --all --drives=sda,sdb\n") - # Big Everything Test - self.assert_parse("clearpart --drives=sda,sdb --all --linux --initlabel", "clearpart --linux --initlabel --drives=sda,sdb\n") + self.assert_parse("clearpart --all --initlabel", "clearpart --all --initlabel \n") + self.assert_parse("clearpart --all --drives sda", "clearpart --all --drives=sda\n") + self.assert_parse("clearpart --all --drives sda,sdb", "clearpart --all --drives=sda,sdb\n") + self.assert_parse("clearpart --all --drives=sda", "clearpart --all --drives=sda\n") + self.assert_parse("clearpart --all --drives=sda,sdb", "clearpart --all --drives=sda,sdb\n") + # Big Everything Test + self.assert_parse("clearpart --drives=sda,sdb --all --linux --initlabel", "clearpart --linux --initlabel --drives=sda,sdb\n") # fail - # initlabel should not take a value + # initlabel should not take a value self.assert_parse_error("clearpart --initlabel=foo") - # drives must take a value - self.assert_parse_error("clearpart --all --drives") - # nonsensical parameter test - self.assert_parse_error("clearpart --cheese") + # drives must take a value + self.assert_parse_error("clearpart --all --drives") + # nonsensical parameter test + self.assert_parse_error("clearpart --cheese") if __name__ == "__main__": unittest.main() -- 1.6.0.6 From jlaska at redhat.com Wed Jan 28 21:01:16 2009 From: jlaska at redhat.com (James Laska) Date: Wed, 28 Jan 2009 16:01:16 -0500 Subject: [PATCH] Add a device unit test In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233176476-15018-1-git-send-email-jlaska@redhat.com> --- tests/commands/device.py | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 71 insertions(+), 0 deletions(-) create mode 100644 tests/commands/device.py diff --git a/tests/commands/device.py b/tests/commands/device.py new file mode 100644 index 0000000..6197952 --- /dev/null +++ b/tests/commands/device.py @@ -0,0 +1,71 @@ +# +# James Laska +# +# Copyright 2005, 2006, 2007 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# +import unittest, shlex +import warnings +from tests.baseclass import * + +from pykickstart.errors import * +from pykickstart.commands.device import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("device TYPE MODNAME", "device TYPE MODNAME\n") + self.assert_parse("device TYPE MODNAME --opts=key1", + "device TYPE MODNAME --opts=\"key1\"\n") + self.assert_parse("device TYPE MODNAME --opts=key1=val1", + "device TYPE MODNAME --opts=\"key1=val1\"\n") + self.assert_parse("device TYPE MODNAME --opts=\"key1=val1\"", + "device TYPE MODNAME --opts=\"key1=val1\"\n") + self.assert_parse("device TYPE MODNAME --opts=\"key1=val1 key2=val2\"", + "device TYPE MODNAME --opts=\"key1=val1 key2=val2\"\n") + + # fail + self.assert_parse_error("device", KickstartValueError) + self.assert_parse_error("device MODNAME", KickstartValueError) + self.assert_parse_error("device TYPE MODNAME GARBAGE", KickstartValueError) + self.assert_parse_error("device --opts=foo", KickstartValueError) + self.assert_parse_error("device --opts=\"foo\"", KickstartValueError) + +class F8_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("device MODNAME", "device MODNAME\n") + self.assert_parse("device MODNAME --opts=key1", + "device MODNAME --opts=\"key1\"\n") + self.assert_parse("device MODNAME --opts=key1=val1", + "device MODNAME --opts=\"key1=val1\"\n") + self.assert_parse("device MODNAME --opts=\"key1=val1\"", + "device MODNAME --opts=\"key1=val1\"\n") + self.assert_parse("device MODNAME --opts=\"key1=val1 key2=val2\"", + "device MODNAME --opts=\"key1=val1 key2=val2\"\n") + + # fail - TYPE is no longer accepted + self.assert_parse_error("device TYPE MODNAME", KickstartValueError) + self.assert_parse_error("device TYPE MODNAME --opts=\"foo\"", KickstartValueError) + + # fail + self.assert_parse_error("device", KickstartValueError) + self.assert_parse_error("device MODNAME GARBAGE", KickstartValueError) + self.assert_parse_error("device --opts=foo", KickstartValueError) + self.assert_parse_error("device --opts=\"foo\"", KickstartValueError) + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From jlaska at redhat.com Wed Jan 28 21:15:00 2009 From: jlaska at redhat.com (James Laska) Date: Wed, 28 Jan 2009 16:15:00 -0500 Subject: [PATCH] Create a skipx unit test In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233177300-15414-1-git-send-email-jlaska@redhat.com> --- tests/commands/skipx.py | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) create mode 100644 tests/commands/skipx.py diff --git a/tests/commands/skipx.py b/tests/commands/skipx.py new file mode 100644 index 0000000..92d4b63 --- /dev/null +++ b/tests/commands/skipx.py @@ -0,0 +1,34 @@ +# +# James Laska +# +# Copyright 2005, 2006, 2007 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# +from tests.baseclass import * +from pykickstart.errors import * +from pykickstart.commands.skipx import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("skipx", "skipx\n") + + # fail + self.assert_parse_error("skipx --do-something-awesome", KickstartValueError) + self.assert_parse_error("skipx MAGIC", KickstartValueError) + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From adamwill at shaw.ca Wed Jan 28 21:19:08 2009 From: adamwill at shaw.ca (Adam Williamson) Date: Wed, 28 Jan 2009 13:19:08 -0800 Subject: [PATCH] Create lang command test In-Reply-To: <1232731389.3647.308.camel@adam.local.net> References: <1232731389.3647.308.camel@adam.local.net> Message-ID: <1233177548-10427-1-git-send-email-adamwill@shaw.ca> --- tests/commands/lang.py | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) create mode 100644 tests/commands/lang.py diff --git a/tests/commands/lang.py b/tests/commands/lang.py new file mode 100644 index 0000000..8e68749 --- /dev/null +++ b/tests/commands/lang.py @@ -0,0 +1,21 @@ +import unittest, shlex +import warnings +from tests.baseclass import * + +from pykickstart.errors import * +from pykickstart.commands.authconfig import * +#from pykickstart.base import * +#from pykickstart.options import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("lang en_US", "lang en_US\n") + + # fail + # Fail if less than or more than one argument is specified + self.assert_parse_error("lang", KickstartValueError) + self.assert_parse_error("lang en_US en_CA", KickstartValueError) + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From jlaska at redhat.com Wed Jan 28 21:58:32 2009 From: jlaska at redhat.com (James Laska) Date: Wed, 28 Jan 2009 16:58:32 -0500 Subject: [PATCH] Create a monitor unit test In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233179912-16474-1-git-send-email-jlaska@redhat.com> --- tests/commands/monitor.py | 73 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-) create mode 100644 tests/commands/monitor.py diff --git a/tests/commands/monitor.py b/tests/commands/monitor.py new file mode 100644 index 0000000..2678af9 --- /dev/null +++ b/tests/commands/monitor.py @@ -0,0 +1,73 @@ +# +# James Laska +# +# Copyright 2005, 2006, 2007 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# +from tests.baseclass import * +from pykickstart.base import * +from pykickstart.errors import * +from pykickstart.commands.monitor import * + +class FC3_TestCase(CommandTest): + def fc3_unsupported_tests(self): + # fail - unsupported + self.assert_parse_error("monitor --noprobe", KickstartParseError) + + def fc3_supported_tests(self): + # pass + self.assert_parse("monitor", "") + self.assert_parse("monitor --hsync=HSYNC", "monitor --hsync=HSYNC\n") + self.assert_parse("monitor --vsync=VSYNC", "monitor --vsync=VSYNC\n") + self.assert_parse("monitor --monitor=MONITOR", "monitor --monitor=\"MONITOR\"\n") + self.assert_parse("monitor --hsync=HSYNC --monitor=MONITOR", + "monitor --hsync=HSYNC --monitor=\"MONITOR\"\n") + self.assert_parse("monitor --monitor=MONITOR --vsync=VSYNC", + "monitor --monitor=\"MONITOR\" --vsync=VSYNC\n") + self.assert_parse("monitor --hsync=HSYNC --monitor=MONITOR --vsync=VSYNC", + "monitor --hsync=HSYNC --monitor=\"MONITOR\" --vsync=VSYNC\n") + + # fail + self.assert_parse_error("monitor BOGUS", KickstartValueError) + self.assert_parse_error("monitor --monitor=SOMETHING GREAT", KickstartValueError) + + def runTest(self): + self.fc3_supported_tests() + self.fc3_unsupported_tests() + +class FC6_TestCase(FC3_TestCase): + def noprobe_tests(self): + # pass + self.assert_parse("monitor --noprobe", "monitor --noprobe\n") + # fail + self.assert_parse_error("monitor --noprobe 1", KickstartValueError) + + def runTest(self): + self.fc3_supported_tests() + self.noprobe_tests() + +class F10_TestCase(FC6_TestCase): + def runTest(self): + + # make sure we've been deprecated + parser = self.getParser("monitor") + self.assertEqual(issubclass(parser.__class__, DeprecatedCommand), True) + + # FIXME - how should a DeprecatedCommand parse? + #self.assert_parse("monitor", "") + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From jlaska at redhat.com Thu Jan 29 00:20:50 2009 From: jlaska at redhat.com (James Laska) Date: Wed, 28 Jan 2009 19:20:50 -0500 Subject: [PATCH] Use KSOptionParser so we can catch bad command options In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233188450-18784-1-git-send-email-jlaska@redhat.com> --- pykickstart/commands/keyboard.py | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pykickstart/commands/keyboard.py b/pykickstart/commands/keyboard.py index 4876361..a960f86 100644 --- a/pykickstart/commands/keyboard.py +++ b/pykickstart/commands/keyboard.py @@ -19,6 +19,7 @@ # from pykickstart.base import * from pykickstart.errors import * +from pykickstart.options import * import gettext _ = lambda x: gettext.ldgettext("pykickstart", x) @@ -29,6 +30,7 @@ class FC3_Keyboard(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.keyboard = kwargs.get("keyboard", "") def __str__(self): @@ -39,9 +41,15 @@ class FC3_Keyboard(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) != 1: + (opts, extra) = self.op.parse_args(args=args) + + if len(extra) != 1: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s requires one argument") % "keyboard") - self.keyboard = args[0] + self.keyboard = extra[0] return self -- 1.6.0.6 From stickster at gmail.com Thu Jan 29 15:12:53 2009 From: stickster at gmail.com (Paul W. Frields) Date: Thu, 29 Jan 2009 10:12:53 -0500 Subject: [PATCH] Create reboot unittest Message-ID: <1233241973-9277-1-git-send-email-stickster@gmail.com> --- tests/commands/reboot.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) create mode 100644 tests/commands/reboot.py diff --git a/tests/commands/reboot.py b/tests/commands/reboot.py new file mode 100644 index 0000000..1e20ca9 --- /dev/null +++ b/tests/commands/reboot.py @@ -0,0 +1,46 @@ +# +# Paul W. Frields +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# +import unittest, shlex +import warnings +from tests.baseclass import * + +from pykickstart.errors import * +from pykickstart.commands.reboot import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("reboot", "reboot\n") + + +class FC6_TestCase(FC3_TestCase): + def runTest(self): + FC3_TestCase.runTest(self) + + # pass + self.assert_parse("reboot --eject", "reboot --eject\n") + + # fail, bad option + self.assert_parse_error("reboot --idontexist") + # fail, no argument + self.assert_parse_error("reboot --eject=foo") + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From clumens at redhat.com Thu Jan 29 19:15:52 2009 From: clumens at redhat.com (Chris Lumens) Date: Thu, 29 Jan 2009 14:15:52 -0500 Subject: [PATCH] Use KSOptionParser so we can catch bad command options In-Reply-To: <1233188450-18784-1-git-send-email-jlaska@redhat.com> References: <1232731389.3647.308.camel@localhost.localdomain> <1233188450-18784-1-git-send-email-jlaska@redhat.com> Message-ID: <20090129191552.GA30009@localhost.localdomain> > --- > pykickstart/commands/keyboard.py | 12 ++++++++++-- > 1 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/pykickstart/commands/keyboard.py b/pykickstart/commands/keyboard.py > index 4876361..a960f86 100644 > --- a/pykickstart/commands/keyboard.py > +++ b/pykickstart/commands/keyboard.py > @@ -19,6 +19,7 @@ > # > from pykickstart.base import * > from pykickstart.errors import * > +from pykickstart.options import * > > import gettext > _ = lambda x: gettext.ldgettext("pykickstart", x) > @@ -29,6 +30,7 @@ class FC3_Keyboard(KickstartCommand): > > def __init__(self, writePriority=0, *args, **kwargs): > KickstartCommand.__init__(self, writePriority, *args, **kwargs) > + self.op = self._getParser() > self.keyboard = kwargs.get("keyboard", "") > > def __str__(self): > @@ -39,9 +41,15 @@ class FC3_Keyboard(KickstartCommand): > > return retval > > + def _getParser(self): > + op = KSOptionParser(lineno=self.lineno) > + return op > + > def parse(self, args): > - if len(args) != 1: > + (opts, extra) = self.op.parse_args(args=args) > + > + if len(extra) != 1: > raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s requires one argument") % "keyboard") > > - self.keyboard = args[0] > + self.keyboard = extra[0] > return self This looks okay to me. Are there other places that would benefit from using this idiom? - Chris From jlaska at redhat.com Thu Jan 29 19:45:40 2009 From: jlaska at redhat.com (James Laska) Date: Thu, 29 Jan 2009 14:45:40 -0500 Subject: [PATCH] Use KSOptionParser so we can catch bad command options In-Reply-To: <20090129191552.GA30009@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> <1233188450-18784-1-git-send-email-jlaska@redhat.com> <20090129191552.GA30009@localhost.localdomain> Message-ID: <1233258340.3704.1.camel@localhost.localdomain> On Thu, 2009-01-29 at 14:15 -0500, Chris Lumens wrote: > This looks okay to me. Are there other places that would benefit > from using this idiom? I think it's potentially anything that's not using KSOptionParser. # grep -L KSOptionParser pykickstart/commands/*py authconfig.py deviceprobe.py displaymode.py __init__.py interactive.py iscsiname.py key.py keyboard.py lang.py lilocheck.py mediacheck.py skipx.py updates.py zerombr.py How would you feel about a patch that adds KSOptionParser parse_args processing to each of these? Thanks, James -- ========================================== James Laska -- jlaska at redhat.com Quality Engineering -- Red Hat, Inc. ========================================== -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From clumens at redhat.com Thu Jan 29 19:54:50 2009 From: clumens at redhat.com (Chris Lumens) Date: Thu, 29 Jan 2009 14:54:50 -0500 Subject: [PATCH] Use KSOptionParser so we can catch bad command options In-Reply-To: <1233258340.3704.1.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> <1233188450-18784-1-git-send-email-jlaska@redhat.com> <20090129191552.GA30009@localhost.localdomain> <1233258340.3704.1.camel@localhost.localdomain> Message-ID: <20090129195449.GB30009@localhost.localdomain> > How would you feel about a patch that adds KSOptionParser parse_args > processing to each of these? I think I would take a patch that did that. - Chris From larry.brigman at gmail.com Fri Jan 30 17:17:27 2009 From: larry.brigman at gmail.com (Larry Brigman) Date: Fri, 30 Jan 2009 09:17:27 -0800 Subject: problems with partition include Message-ID: I have a kickstart file that has a %pre script that is creating my partition info that is include separately. Although the syntax looks right, anaconda is telling me that it is needing interactive mode on a cmdline install. The script is need due to the fact that I am trying to install on a USB device but have multiple SAS disks installed and I don't know ahead of time where the USB device will be showing up. Can some one tell me what is wrong with this section or what is missing. Thanks. Included section: ---------------------------------------------------------- clearpart --drives=sda,sdb,sdc,sdd,sde,sdf,sdg --all --initlabel ignoredisk --drives=sda,sdb,sdc,sdd,sde,sdf part /boot --fstype=ext2 --ondisk=sdg --size=100 --asprimary part swap --fstype=swap --ondisk=sdg --size=500 --asprimary part / --fstype=ext3 --ondisk=sdg --size=15046 --asprimary bootloader --append="rhgb quiet crashkernel=128M at 16M console=tty1 console=ttyS0,38400n8" --location=mbr --driveorder=sdg From clumens at redhat.com Fri Jan 30 20:42:11 2009 From: clumens at redhat.com (Chris Lumens) Date: Fri, 30 Jan 2009 15:42:11 -0500 Subject: [PATCH] Create reboot unittest In-Reply-To: <1233241973-9277-1-git-send-email-stickster@gmail.com> References: <1233241973-9277-1-git-send-email-stickster@gmail.com> Message-ID: <20090130204211.GH30009@localhost.localdomain> > diff --git a/tests/commands/reboot.py b/tests/commands/reboot.py > new file mode 100644 > index 0000000..1e20ca9 > --- /dev/null > +++ b/tests/commands/reboot.py > @@ -0,0 +1,46 @@ > +# > +# Paul W. Frields > +# > +# Copyright 2009 Red Hat, Inc. > +# > +# This copyrighted material is made available to anyone wishing to use, modify, > +# copy, or redistribute it subject to the terms and conditions of the GNU > +# General Public License v.2. This program is distributed in the hope that it > +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the > +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > +# See the GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License along with > +# this program; if not, write to the Free Software Foundation, Inc., 51 > +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat > +# trademarks that are incorporated in the source code or documentation are not > +# subject to the GNU General Public License and may only be used or replicated > +# with the express permission of Red Hat, Inc. > +# > +import unittest, shlex > +import warnings > +from tests.baseclass import * > + > +from pykickstart.errors import * > +from pykickstart.commands.reboot import * > + > +class FC3_TestCase(CommandTest): > + def runTest(self): > + # pass > + self.assert_parse("reboot", "reboot\n") > + > + > +class FC6_TestCase(FC3_TestCase): > + def runTest(self): > + FC3_TestCase.runTest(self) > + > + # pass > + self.assert_parse("reboot --eject", "reboot --eject\n") > + > + # fail, bad option > + self.assert_parse_error("reboot --idontexist") > + # fail, no argument > + self.assert_parse_error("reboot --eject=foo") > + > +if __name__ == "__main__": > + unittest.main() fcami at fp.o already sent me a test for this command (we should all make sure to CC the list as well, so two people don't work on the same thing) but I'll give you the same advice I gave him and we'll see who wins. This command also supports being called as "shutdown", "poweroff", and "halt" so we should have tests for that too. - Chris