Here you go:<br>--- partinfo    2007-08-20 15:47:18.000000000 -0400<br>+++ partinfo.new        2007-08-20 15:47:44.000000000 -0400<br>@@ -10,7 +10,7 @@<br> S2=$4 # This is the size of disk 2, etc.<br><br> # This would be a partition scheme for two or more drives
<br>-if [ $numd -ge 2 ]; then cat << EOF >> /tmp/partinfo<br>+if [ $numd -ge 2 ]; then cat << EOF > /tmp/partinfo<br> part /boot --fstype ext3 --size=100 --ondisk=$d1 --asprimary<br> part /boot2 --fstype ext3 --size=100 --ondisk=$d2 --asprimary
<br> part swap --size=512 --ondisk=$d1 --asprimary<br>@@ -25,7 +25,7 @@<br><br> else<br><br>-cat << EOF >> /tmp/partinfo<br>+cat << EOF > /tmp/partinfo<br> part /boot --fstype ext3 --size=100 --ondisk=$d1 --asprimary
<br> part swap --size=1024 --ondisk=$d1 --asprimary<br> part pv.01 --fstype "physical volume (LVM)" --size=1 --grow --ondisk=$d1<br><br>--BO<br><br><div><span class="gmail_quote">On 8/17/07, <b class="gmail_sendername">
Harry Hoffman</b> <<a href="mailto:hhoffman@ip-solutions.net">hhoffman@ip-solutions.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All,<br><br>Ran into what I believe is a bug. It looks to be in the %pre section.<br><br>Background:<br><br>Running CentOS release 5 with cobbler 0.5.2. I have a kickstart file for<br>installing RHEL 4.5 (see below).<br>
<br>I have a %pre section in the kickstart file that defines partitions:<br><br><br># Magically figure out how to partition this thing<br>%include /tmp/partinfo<br><br>%pre<br># Determine how many drives we have<br>set $(list-harddrives)
<br>let numd=$#/2<br>d1=$1 # This is the device of disk 1<br>d2=$3 # This is the device of disk 2, etc.<br>S1=$2 # This is the size of disk 1<br>S2=$4 # This is the size of disk 2, etc.<br><br># This would be a partition scheme for two or more drives
<br>if [ $numd -ge 2 ]; then cat << EOF >> /tmp/partinfo<br>part /boot --fstype ext3 --size=100 --ondisk=$d1 --asprimary<br>part /boot2 --fstype ext3 --size=100 --ondisk=$d2 --asprimary<br>part swap --size=512 --ondisk=$d1 --asprimary
<br>part swap --size=512 --ondisk=$d2 --asprimary<br>part raid.01 --size=1 --grow --ondisk=$d1<br>part raid.02 --size=1 --grow --ondisk=$d2<br>raid pv.01 --fstype "physical volume (LVM)" --level=RAID1 --device=md0
<br>raid.01 raid.02<br>volgroup internal_hd pv.01<br>logvol / --fstype ext3 --name=slash --vgname=internal_hd --size=1 --grow<br>EOF<br><br>else<br><br>cat << EOF >> /tmp/partinfo<br>part /boot --fstype ext3 --size=100 --ondisk=$d1 --asprimary
<br>part swap --size=1024 --ondisk=$d1 --asprimary<br>part pv.01 --fstype "physical volume (LVM)" --size=1 --grow --ondisk=$d1<br>volgroup internal_hd pv.01<br>logvol / --fstype ext3 --name=slash --vgname=internal_hd --size=1 --grow
<br>#part / --fstype ext3 --size=1 --grow --ondisk=$d1<br>EOF<br><br>fi<br><br><br>This pre script shows the following errors on vt3:<br>* Running kickstart %pre script(s)<br>let: arith: syntax error: "numd=2/2"
<br><br>let: arith: syntax error: "numd=2/2"<br><br>[: 2: unexpected operator<br><br>* All kickstart %pre script(s) have been run<br>* Exception parsing ks.cfg: Defined PV partition pv.01 multiple times<br><br><br>
In this particular case I have only one (logical HW RAID) drive and the<br>/tmp/partinfo is created with the lines contained in the else clause<br>from above.<br><br>The error about partition pv.01 causes kickstart to fail and die :-(
<br><br>Please see the full kickstart file below.<br><br>I should note that if I place the part info from the else clause outside<br>of the %pre section (i.e. just create a static partition declaration in<br>the kickstart file) then everything works as expected.
<br><br>Any ideas? I'm stumped.<br><br>Cheers,<br>Harry<br><br><br># Kickstart file to automate the installation of Oracle 10 on RHEL4<br># Harry Hoffman <<a href="mailto:hhoffman@fqdn.com">hhoffman@fqdn.com</a>>
<br># Oracle 10g Kickstart file for CentOS 4.x<br>#platform=x86, AMD64, or Intel EM64T<br># System authorization information<br>auth  --useshadow  --enablemd5<br># System bootloader configuration<br>bootloader --location=mbr --md5pass=blah
<br># Partition clearing information<br>clearpart --all --initlabel<br># Use text mode install<br>text<br># Firewall configuration<br>firewall --enabled --port=22:tcp<br># Run the Setup Agent on first boot<br>firstboot --disable
<br># System keyboard<br>keyboard us<br># System language<br>lang en_US.UTF-8<br>langsupport --default=en_US.UTF-8 en_US.UTF-8<br># Use network installation<br>url --url=<a href="http://192.168.1.3/cblr/links/RHEL-4.5-i386">
http://192.168.1.3/cblr/links/RHEL-4.5-i386</a><br># Network information<br>network --bootproto=static --ip=<a href="http://192.168.1.10">192.168.1.10</a> --netmask=<a href="http://255.255.240.0">255.255.240.0</a><br>--gateway=
<a href="http://192.168.1.249">192.168.1.249</a> --nameserver=<a href="http://192.168.1.3">192.168.1.3</a><br>--hostname=<a href="http://db1.prod.fqdn.com">db1.prod.fqdn.com</a> --device=eth0 --onboot=on<br># Reboot after installation
<br>reboot<br><br>#Root password<br>rootpw --iscrypted blah<br># SELinux configuration<br>selinux --enforcing<br># Do not configure the X Window System<br>skipx<br># System timezone<br>timezone  America/New_York<br># Install OS instead of upgrade
<br>install<br># Clear the Master Boot Record<br>zerombr<br><br><br><br><br># Magically figure out how to partition this thing<br>%include /tmp/partinfo<br><br>%pre<br># Determine how many drives we have<br>set $(list-harddrives)
<br>let numd=$#/2<br>d1=$1 # This is the device of disk 1<br>d2=$3 # This is the device of disk 2, etc.<br>S1=$2 # This is the size of disk 1<br>S2=$4 # This is the size of disk 2, etc.<br><br># This would be a partition scheme for two or more drives
<br>if [ $numd -ge 2 ]; then cat << EOF >> /tmp/partinfo<br>part /boot --fstype ext3 --size=100 --ondisk=$d1 --asprimary<br>part /boot2 --fstype ext3 --size=100 --ondisk=$d2 --asprimary<br>part swap --size=512 --ondisk=$d1 --asprimary
<br>part swap --size=512 --ondisk=$d2 --asprimary<br>part raid.01 --size=1 --grow --ondisk=$d1<br>part raid.02 --size=1 --grow --ondisk=$d2<br>raid pv.01 --fstype "physical volume (LVM)" --level=RAID1 --device=md0
<br>raid.01 raid.02<br>volgroup internal_hd pv.01<br>logvol / --fstype ext3 --name=slash --vgname=internal_hd --size=1 --grow<br>EOF<br><br>else<br><br>cat << EOF >> /tmp/partinfo<br>part /boot --fstype ext3 --size=100 --ondisk=$d1 --asprimary
<br>part swap --size=1024 --ondisk=$d1 --asprimary<br>part pv.01 --fstype "physical volume (LVM)" --size=1 --grow --ondisk=$d1<br>volgroup internal_hd pv.01<br>logvol / --fstype ext3 --name=slash --vgname=internal_hd --size=1 --grow
<br>#part / --fstype ext3 --size=1 --grow --ondisk=$d1<br>EOF<br><br>fi<br><br><br>%packages<br>automake<br>bison<br>cpp<br>flex<br>gcc<br>gcc-c++<br>glibc-devel<br>glibc-headers<br>glibc-kernheaders<br>libungif<br>Xaw3d<br>
xorg-x11-xauth<br>libcap<br>ntp<br>sudo<br>vlock<br>screen<br>sysstat<br>-sendmail<br>postfix<br>vim-enhanced<br># Oracle 10 stuff<br>compat-db<br>openmotif<br>setarch<br>libaio<br>libaio-devel<br>compat-gcc-32<br>compat-gcc-32-c++
<br>compat-libstdc++-33<br><br>%post<br>chvt 3<br><br><br>#Turn off/on services<br>chkconfig --level 2345 isdn off<br>chkconfig --level 2345 portmap off<br>chkconfig --level 2345 nfslock off<br>chkconfig --level 345 ntpd on
<br>chkconfig --level 345 cups off<br><br>#Setup root mail forwarding<br>echo -e "<a href="mailto:root:\troot@fqdn.com">root:\troot@fqdn.com</a>" >> /etc/aliases<br>postalias /etc/aliases<br><br><br># Setup Oracle
<br>groupadd -r oinstall;<br>groupadd -r dba;<br>useradd -r -c "Oracle DB User" -g oinstall -G dba -m -p 'blah' oracle<br><br>echo "# " >> /etc/sysctl.conf<br>echo "# Required for Oracle 10g " >> /etc/sysctl.conf
<br>echo "# " >> /etc/sysctl.conf<br>echo "kernel.shmall = 2097152" >> /etc/sysctl.conf<br>echo "kernel.shmmax = 2147483648" >> /etc/sysctl.conf<br>echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
<br>echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf<br>echo "fs.file-max = 65536" >> /etc/sysctl.conf<br>echo "net.ipv4.ip_local_port_range = 1024 65000" >> /etc/sysctl.conf
<br>echo "net.core.rmem_default=262144" >> /etc/sysctl.conf<br>echo "net.core.rmem_max=262144" >> /etc/sysctl.conf<br>echo "net.core.wmem_default=262144" >> /etc/sysctl.conf
<br>echo "net.core.wmem_max=262144" >> /etc/sysctl.conf<br>/sbin/sysctl -p<br><br><br>echo "oracle              soft    nproc   2047" >> /etc/security/limits.conf<br>echo "oracle              hard    nproc   16384" >>
<br>/etc/security/limits.conf<br>echo "oracle              soft    nofile  1024" >> /etc/security/limits.conf<br>echo "oracle              hard    nofile  65536" >><br>/etc/security/limits.conf
<br><br># setting /etc/profile<br>echo "if [ \$USER = \"oracle\" ]; then" >> /etc/profile<br>echo "        if [ \$SHELL = \"/bin/ksh\" ]; then" >> /etc/profile<br>echo "              ulimit -p 16384" >> /etc/profile
<br>echo "              ulimit -n 65536" >> /etc/profile<br>echo "        else" >> /etc/profile<br>echo "              ulimit -u 16384 -n 65536" >> /etc/profile<br>echo "        fi" >> /etc/profile
<br>echo "fi"  >> /etc/profile<br><br># Change pam to respect the new limits<br>echo "session    required     /lib/security/pam_limits.so" >><br>/etc/pam.d/login<br><br># Make oracle directories
<br>mkdir -p /opt/oracle/product/10.2.0.1/db_1<br>chown -R oracle:oinstall /opt/oracle/<br>chmod -R 775 /opt/oracle/<br><br># Set ORACLE_HOME in oracle's .bashrc<br>echo "ORACLE_HOME=/opt/oracle/product/10.2.0.1/db_1" >> /home/oracle/.bashrc
<br>echo "PATH=\$PATH:\$ORACLE_HOME/bin" >> /home/oracle/.bashrc<br>echo "export \$PATH" >> /home/oracle/.bashrc<br><br>touch /etc/oratab<br>chown oracle:oinstall /etc/oratab<br><br><br>wget -O /home/oracle/10201_database_linux32.zip
<br><a href="http://192.168.1.3/cblr/localmirror/10201_database_linux32.zip">http://192.168.1.3/cblr/localmirror/10201_database_linux32.zip</a><br>wget -O /home/oracle/10gR2.rsp <a href="http://192.168.1.3/cblr/localmirror/10gR2.rsp">
http://192.168.1.3/cblr/localmirror/10gR2.rsp</a><br><br>chown oracle:oinstall /home/oracle/10201_database_linux32.zip<br><br>cd /home/oracle && su oracle -c "unzip 10201_database_linux32.zip"<br><br>wget -O /etc/rc3.d/S99oracle_install
<br><a href="http://192.168.1.3/cblr/localmirror/S99oracle_install">http://192.168.1.3/cblr/localmirror/S99oracle_install</a><br>chmod 755 /etc/rc3.d/S99oracle_install<br><br><br># Update the system<br># Update the system
<br>/usr/sbin/rhnreg_ks --profilename "<a href="http://db1.prod.fqdn.com">db1.prod.fqdn.com</a>" --username<br>"rhuser" --password "blah" --email "<a href="mailto:root@fqdn.com">root@fqdn.com
</a>"<br>up2date -fu up2date<br>up2date -fu<br><br><br>wget <a href="http://192.168.1.3/cblr/watcher.py?system_done=RHEL-4-Oracle">http://192.168.1.3/cblr/watcher.py?system_done=RHEL-4-Oracle</a> -b<br><br>_______________________________________________
<br>Kickstart-list mailing list<br><a href="mailto:Kickstart-list@redhat.com">Kickstart-list@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/kickstart-list">https://www.redhat.com/mailman/listinfo/kickstart-list
</a><br></blockquote></div><br>