From gbailey at terremark.com Wed Nov 4 21:44:45 2009 From: gbailey at terremark.com (Glenn Bailey) Date: Wed, 4 Nov 2009 16:44:45 -0500 Subject: Grabbing user input in the %pre section using the python snack library Message-ID: Howdy folks, I've been beating my head trying to get this darn thing to work. I can easily grab user input via straight shell in the following example: %pre chvt 3 exec /dev/tty3 2>/dev/tty3 echo -n "Enter the hostname: " read HOSTNAME echo "You entered: $HOSTNAME" But, what I am trying to do is use the python snack library, and I'm having no luck. I couldn't find a pure python solution, so I tried some tricks and came up with the following: %pre chvt 3 exec /dev/tty3 2>/dev/tty3 /usr/bin/python < References: Message-ID: <4AF230D1.8070908@trueblade.com> See: http://www.trueblade.com/techblog/user-input-during-a-fedora-kickstart Hope that helps. Eric. Glenn Bailey wrote: > Howdy folks, > > I've been beating my head trying to get this darn thing to work. I can easily grab user input via straight shell in the following example: > > %pre > chvt 3 > exec /dev/tty3 2>/dev/tty3 > echo -n "Enter the hostname: " > read HOSTNAME > echo "You entered: $HOSTNAME" > > But, what I am trying to do is use the python snack library, and I'm having no luck. I couldn't find a pure python solution, so I tried some tricks and came up with the following: > > %pre > chvt 3 > exec /dev/tty3 2>/dev/tty3 > /usr/bin/python < > import os, sys > from snack import * > > title = "Linux Build" > buttons = ['Ok', 'Cancel'] > width = 40 > help = "None" > textItems = "Hello!" > text = "Confirm options" > screen = SnackScreen() > ButtonChoiceWindow(screen, title, textItems, ['Start Build', 'Re-input Items'], > width, 0,0,help) > screen.finish() > > EOF > > Which will display the screen, but it still takes input from tty1. Any ideas to WTH is going on? Looking through the archives I found some pure python examples, but they did nada fer me .. I'd take a solution in shell or python as long as it works ;-) > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > From jimi at sngx.net Thu Nov 5 02:05:23 2009 From: jimi at sngx.net (James Cammarata) Date: Wed, 04 Nov 2009 20:05:23 -0600 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: <4AF230D1.8070908@trueblade.com> References: <4AF230D1.8070908@trueblade.com> Message-ID: <2aa3a6b1a01072d0211def0b5b519806@sngx.net> On Wed, 04 Nov 2009 20:56:33 -0500, Eric Smith wrote: > See: > http://www.trueblade.com/techblog/user-input-during-a-fedora-kickstart > > Hope that helps. > Eric. > > Glenn Bailey wrote: >> Howdy folks, >> >> I've been beating my head trying to get this darn thing to work. I can >> easily grab user input via straight shell in the following example: >> >> %pre >> chvt 3 >> exec /dev/tty3 2>/dev/tty3 >> echo -n "Enter the hostname: " >> read HOSTNAME >> echo "You entered: $HOSTNAME" >> >> But, what I am trying to do is use the python snack library, and I'm >> having no luck. I couldn't find a pure python solution, so I tried some >> tricks and came up with the following: >> >> %pre >> chvt 3 >> exec /dev/tty3 2>/dev/tty3 >> /usr/bin/python <> >> import os, sys >> from snack import * >> >> title = "Linux Build" >> buttons = ['Ok', 'Cancel'] >> width = 40 >> help = "None" >> textItems = "Hello!" >> text = "Confirm options" >> screen = SnackScreen() >> ButtonChoiceWindow(screen, title, textItems, ['Start Build', 'Re-input >> Items'], >> width, 0,0,help) >> screen.finish() >> >> EOF >> >> Which will display the screen, but it still takes input from tty1. Any >> ideas to WTH is going on? Looking through the archives I found some pure >> python examples, but they did nada fer me .. I'd take a solution in shell >> or python as long as it works ;-) In my opinion, kickstarts should be completely automated with no user input. I'd recommend looking into a provisioning system like Cobbler, which allows you to setup all the information about the system your building before the kickstart begins. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From eric at trueblade.com Thu Nov 5 02:35:14 2009 From: eric at trueblade.com (Eric Smith) Date: Wed, 04 Nov 2009 21:35:14 -0500 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: <2aa3a6b1a01072d0211def0b5b519806@sngx.net> References: <4AF230D1.8070908@trueblade.com> <2aa3a6b1a01072d0211def0b5b519806@sngx.net> Message-ID: <4AF239E2.4030101@trueblade.com> James Cammarata wrote: > In my opinion, kickstarts should be completely automated with no user > input. I'd recommend looking into a provisioning system like Cobbler, > which allows you to setup all the information about the system your > building before the kickstart begins. They're both useful techniques, depending on your workflow. I wouldn't say always use one or the other. Eric. From mrose at n-able.com Thu Nov 5 13:52:01 2009 From: mrose at n-able.com (Matt Rose) Date: Thu, 5 Nov 2009 08:52:01 -0500 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: References: Message-ID: <4AF2D881.3020209@n-able.com> you can kick off a %pre in python using the --interpreter flag. I just use the vt5 for feedback, so I just issue os.system("chvt 5") and write to /dev/tty5 directly, but I'm sure you could manipulate sys.stdout, and sys.stderr Matt Glenn Bailey wrote: > Howdy folks, > > I've been beating my head trying to get this darn thing to work. I can easily grab user input via straight shell in the following example: > > %pre > chvt 3 > exec /dev/tty3 2>/dev/tty3 > echo -n "Enter the hostname: " > read HOSTNAME > echo "You entered: $HOSTNAME" > > But, what I am trying to do is use the python snack library, and I'm having no luck. I couldn't find a pure python solution, so I tried some tricks and came up with the following: > > %pre > chvt 3 > exec /dev/tty3 2>/dev/tty3 > /usr/bin/python < > import os, sys > from snack import * > > title = "Linux Build" > buttons = ['Ok', 'Cancel'] > width = 40 > help = "None" > textItems = "Hello!" > text = "Confirm options" > screen = SnackScreen() > ButtonChoiceWindow(screen, title, textItems, ['Start Build', 'Re-input Items'], > width, 0,0,help) > screen.finish() > > EOF > > Which will display the screen, but it still takes input from tty1. Any ideas to WTH is going on? Looking through the archives I found some pure python examples, but they did nada fer me .. I'd take a solution in shell or python as long as it works ;-) > > _______________________________________________ > 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 victor_sira at yahoo.com Mon Nov 9 05:39:56 2009 From: victor_sira at yahoo.com (vs) Date: Sun, 8 Nov 2009 21:39:56 -0800 (PST) Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: <2aa3a6b1a01072d0211def0b5b519806@sngx.net> References: <4AF230D1.8070908@trueblade.com> <2aa3a6b1a01072d0211def0b5b519806@sngx.net> Message-ID: <45711.76975.qm@web51310.mail.re2.yahoo.com> ----- Original Message ---- > From: James Cammarata > To: Discussion list about Kickstart > Sent: Wed, November 4, 2009 6:05:23 PM > Subject: Re: Grabbing user input in the %pre section using the python snack library > > > On Wed, 04 Nov 2009 20:56:33 -0500, Eric Smith wrote: > > See: > > http://www.trueblade.com/techblog/user-input-during-a-fedora-kickstart > > > > Hope that helps. > > Eric. > > > > Glenn Bailey wrote: > >> Howdy folks, > >> > >> I've been beating my head trying to get this darn thing to work. I can > >> easily grab user input via straight shell in the following example: > >> > >> %pre > >> chvt 3 > >> exec /dev/tty3 2>/dev/tty3 > >> echo -n "Enter the hostname: " > >> read HOSTNAME > >> echo "You entered: $HOSTNAME" > >> > >> But, what I am trying to do is use the python snack library, and I'm > >> having no luck. I couldn't find a pure python solution, so I tried some > >> tricks and came up with the following: > >> > >> %pre > >> chvt 3 > >> exec /dev/tty3 2>/dev/tty3 > >> /usr/bin/python < > >> > >> import os, sys > >> from snack import * > >> > >> title = "Linux Build" > >> buttons = ['Ok', 'Cancel'] > >> width = 40 > >> help = "None" > >> textItems = "Hello!" > >> text = "Confirm options" > >> screen = SnackScreen() > >> ButtonChoiceWindow(screen, title, textItems, ['Start Build', 'Re-input > >> Items'], > >> width, 0,0,help) > >> screen.finish() > >> > >> EOF > >> > >> Which will display the screen, but it still takes input from tty1. Any > >> ideas to WTH is going on? Looking through the archives I found some pure > >> python examples, but they did nada fer me .. I'd take a solution in > shell > >> or python as long as it works ;-) > > In my opinion, kickstarts should be completely automated with no user > input. I'd recommend looking into a provisioning system like Cobbler, > which allows you to setup all the information about the system your > building before the kickstart begins. I agree with this comment, but for networking information and if you don't use dhcp reservations, how can you feed this information back in to the setup? I imagine you can setup your own text files somewhere that match name,ip etc to mac addresses for example, but is there a better solution? Or does cobbler has a built in way to handle this? --Victor > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list __________________________________________________________________ The new Internet Explorer? 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/ From jimi at sngx.net Mon Nov 9 05:56:09 2009 From: jimi at sngx.net (James Cammarata) Date: Sun, 08 Nov 2009 23:56:09 -0600 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: <45711.76975.qm@web51310.mail.re2.yahoo.com> References: <4AF230D1.8070908@trueblade.com> <2aa3a6b1a01072d0211def0b5b519806@sngx.net> <45711.76975.qm@web51310.mail.re2.yahoo.com> Message-ID: <7c231606f4d15d58c68c2af27a3f80a4@sngx.net> > I agree with this comment, but for networking information and if you don't > use dhcp reservations, how can you feed this information back in to the > setup? I imagine you can setup your own text files somewhere that match > name,ip etc to mac addresses for example, but is there a better solution? > Or does cobbler has a built in way to handle this? > > --Victor Yes, cobbler allows you to provision systems with IP addresses based on interface mac address. During the kickstart, it sets up static dhcp reservations so the system you're building has the same IP during the kickstart and after. I'm a cobbler dev, so I am a bit biased :) -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From ed.sealing at gmail.com Mon Nov 9 16:03:37 2009 From: ed.sealing at gmail.com (Ed) Date: Mon, 9 Nov 2009 11:03:37 -0500 Subject: Package installation order Message-ID: <5f7b4ce70911090803j4bd6ff36ya5490b838d756aa6@mail.gmail.com> I'm building a custom distro with secure SELinux policy and an automated puppet configuration. Both the custom puppet-rpm and SELinux policy-rpm need to be installed last (after all other rpms). Is there any way to specify this easily? Currently I just make ALL packages a requirement in the .spec file, but this isn't a very clean way to do it. I customize the stage2.img as well if there are any modifications in there that could be made. Thanks for your help and genius!! ~Ed -------------- next part -------------- An HTML attachment was scrubbed... URL: From gbailey at terremark.com Mon Nov 9 17:06:36 2009 From: gbailey at terremark.com (Glenn Bailey) Date: Mon, 9 Nov 2009 12:06:36 -0500 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: <4AF230D1.8070908@trueblade.com> References: <4AF230D1.8070908@trueblade.com> Message-ID: > See: > http://www.trueblade.com/techblog/user-input-during-a-fedora-kickstart > worked perfect, thanks! it does get a garbled screen on RHEL4 builds, but RHEL4 for us should only be re-builds, not net new so I think I can get away with a basic console. From gbailey at terremark.com Mon Nov 9 17:08:36 2009 From: gbailey at terremark.com (Glenn Bailey) Date: Mon, 9 Nov 2009 12:08:36 -0500 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: <2aa3a6b1a01072d0211def0b5b519806@sngx.net> References: <4AF230D1.8070908@trueblade.com> <2aa3a6b1a01072d0211def0b5b519806@sngx.net> Message-ID: > In my opinion, kickstarts should be completely automated with no user > input. I'd recommend looking into a provisioning system like Cobbler, > which allows you to setup all the information about the system your > building before the kickstart begins. I do use Cobbler, this is a fallback method for when the server cannot query our config management database or does not have an entry yet .. From eric at trueblade.com Mon Nov 9 17:08:38 2009 From: eric at trueblade.com (Eric Smith) Date: Mon, 09 Nov 2009 12:08:38 -0500 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: References: <4AF230D1.8070908@trueblade.com> Message-ID: <4AF84C96.1070005@trueblade.com> Glenn Bailey wrote: >> See: >> http://www.trueblade.com/techblog/user-input-during-a-fedora-kickstart >> > > worked perfect, thanks! it does get a garbled screen on RHEL4 builds, but RHEL4 for us should only be re-builds, not net new so I think I can get away with a basic console. I'm glad it helped. I forgot to mention the problems on RHEL4 (and I think FC2 as well), but I haven't used either in a while. Eric. From joliver at john-oliver.net Mon Nov 9 18:52:20 2009 From: joliver at john-oliver.net (John Oliver) Date: Mon, 9 Nov 2009 10:52:20 -0800 Subject: Kickstart, partitioning, differing disk space Message-ID: <20091109185220.GA26611@ns.sdsitehosting.net> So far, I've been installing on physical servers that have ~500GB disk space and on virtual machines that have 20GB. I've been using two different kickstarts: # Partioning for physical servers #logvol / --fstype ext3 --name=root --vgname=vg1 --size=500000 #logvol /var --fstype ext3 --name=var --vgname=vg1 --size=20480 #logvol /tmp --fstype ext3 --name=tmp --vgname=vg1 --size=8192 #logvol /usr --fstype ext3 --name=usr --vgname=vg1 --size=10240 #logvol /home --fstype ext3 --name=home --vgname=vg1 --size=20480 #logvol swap --fstype swap --name=swap --vgname=vg1 --size=8192 # Partitioning for 20GB VMs #logvol / --fstype ext3 --name=root --vgname=vg1 --size 3072 #logvol /home --fstype ext3 --name=home --vgname=vg1 --size 2048 #logvol /var --fstype ext3 --name=var --vgname=vg1 --size=9000 #logvol /tmp --fstype ext3 --name=tmp --vgname=vg1 --size=4096 #logvol swap --fstype swap --name=swap --vgname=vg1 --size=2048 I'm trying to think of how I can have just one partitioning stanza that would take any amount of disk space and partition it. I'm working with: # Test partitioning logvol / --fstype=ext3 --name=root--vgname=vg1 --size=3072 --grow --maxsize=500000 logvol /var --fstype=ext3 --name=var --vgname=vg1 --size=2048 --grow --maxsize=20480 logvol /tmp --fstype=ext3 --name=tmp --vgname=vg1 --size=4096 --grow --maxsize=8192 logvol /home --fstype=ext3 --name=home -vgname=vg1 --size=2048 --grow --maxsize=20480 logvol swap --fstype=swap --name=swap --vgname=vg1 --size=2048 --grow --maxsize=8192 I do not know yet if it will take all lines into consideration, or if it will look at the first line, grow / to 20GB, and then say, "I'm done." Is --percent about the only way I could do this? That seems a little messy. Maybe combined with --maxsize? Has anyone else slain this dragon? -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From chip.shabazian at bankofamerica.com Mon Nov 9 19:04:22 2009 From: chip.shabazian at bankofamerica.com (Shabazian, Chip) Date: Mon, 09 Nov 2009 11:04:22 -0800 Subject: Kickstart, partitioning, differing disk space In-Reply-To: <20091109185220.GA26611@ns.sdsitehosting.net> References: <20091109185220.GA26611@ns.sdsitehosting.net> Message-ID: We have three different partitioning schemes. The kickstart figures out how big the disk is, then uses one of three different schemes based on the size. However, if it's a VM, we automatically select the smallest partitioning scheme -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of John Oliver Sent: Monday, November 09, 2009 10:52 AM To: kickstart-list at redhat.com Subject: Kickstart, partitioning, differing disk space So far, I've been installing on physical servers that have ~500GB disk space and on virtual machines that have 20GB. I've been using two different kickstarts: # Partioning for physical servers #logvol / --fstype ext3 --name=root --vgname=vg1 --size=500000 #logvol /var --fstype ext3 --name=var --vgname=vg1 --size=20480 #logvol /tmp --fstype ext3 --name=tmp --vgname=vg1 --size=8192 #logvol /usr --fstype ext3 --name=usr --vgname=vg1 --size=10240 #logvol /home --fstype ext3 --name=home --vgname=vg1 --size=20480 #logvol swap --fstype swap --name=swap --vgname=vg1 --size=8192 # Partitioning for 20GB VMs #logvol / --fstype ext3 --name=root --vgname=vg1 --size 3072 #logvol /home --fstype ext3 --name=home --vgname=vg1 --size 2048 #logvol /var --fstype ext3 --name=var --vgname=vg1 --size=9000 #logvol /tmp --fstype ext3 --name=tmp --vgname=vg1 --size=4096 #logvol swap --fstype swap --name=swap --vgname=vg1 --size=2048 I'm trying to think of how I can have just one partitioning stanza that would take any amount of disk space and partition it. I'm working with: # Test partitioning logvol / --fstype=ext3 --name=root--vgname=vg1 --size=3072 --grow --maxsize=500000 logvol /var --fstype=ext3 --name=var --vgname=vg1 --size=2048 --grow --maxsize=20480 logvol /tmp --fstype=ext3 --name=tmp --vgname=vg1 --size=4096 --grow --maxsize=8192 logvol /home --fstype=ext3 --name=home -vgname=vg1 --size=2048 --grow --maxsize=20480 logvol swap --fstype=swap --name=swap --vgname=vg1 --size=2048 --grow --maxsize=8192 I do not know yet if it will take all lines into consideration, or if it will look at the first line, grow / to 20GB, and then say, "I'm done." Is --percent about the only way I could do this? That seems a little messy. Maybe combined with --maxsize? Has anyone else slain this dragon? -- *********************************************************************** * 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 Mon Nov 9 19:32:55 2009 From: joliver at john-oliver.net (John Oliver) Date: Mon, 9 Nov 2009 11:32:55 -0800 Subject: Kickstart, partitioning, differing disk space In-Reply-To: References: <20091109185220.GA26611@ns.sdsitehosting.net> Message-ID: <20091109193255.GA28087@ns.sdsitehosting.net> On Mon, Nov 09, 2009 at 11:04:22AM -0800, Shabazian, Chip wrote: > We have three different partitioning schemes. The kickstart figures > out how big the disk is, then uses one of three different schemes based > on the size. However, if it's a VM, we automatically select the > smallest partitioning scheme What are these "three schemes"? How do they know when they're on a VM? Could you include a copy of the relevant section of your ks file? Thanks... -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From chip.shabazian at bankofamerica.com Mon Nov 9 20:20:15 2009 From: chip.shabazian at bankofamerica.com (Shabazian, Chip) Date: Mon, 09 Nov 2009 12:20:15 -0800 Subject: Kickstart, partitioning, differing disk space In-Reply-To: <20091109193255.GA28087@ns.sdsitehosting.net> References: <20091109185220.GA26611@ns.sdsitehosting.net> <20091109193255.GA28087@ns.sdsitehosting.net> Message-ID: # Default value for disks (27G layout) BOOTSIZE=256 ROOTSIZE=8192 VARSIZE=8192 SWAPSIZE=2048 BANKTOOLSIZE=8192 GRIDSIZE=0 # check for small disk sizes < default 27G layout: if [ ${DISKSIZE} -lt 27648 ] then # create small disk (16G layout) ROOTSIZE=5120 VARSIZE=5120 SWAPSIZE=2048 BANKTOOLSIZE=3072 fi # force it if it's a VMware system with more than 20G of space dmidecode | grep Manufacturer | head -1 | grep -q VMware if [ $? = "0" ] then # create small disk xen/vmware (16G layout) ROOTSIZE=5120 VARSIZE=5120 SWAPSIZE=2048 BANKTOOLSIZE=3072 fi -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of John Oliver Sent: Monday, November 09, 2009 11:33 AM To: Discussion list about Kickstart Subject: Re: Kickstart, partitioning, differing disk space On Mon, Nov 09, 2009 at 11:04:22AM -0800, Shabazian, Chip wrote: > We have three different partitioning schemes. The kickstart figures > out how big the disk is, then uses one of three different schemes based > on the size. However, if it's a VM, we automatically select the > smallest partitioning scheme What are these "three schemes"? How do they know when they're on a VM? Could you include a copy of the relevant section of your ks file? 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 mrose at n-able.com Mon Nov 9 20:34:22 2009 From: mrose at n-able.com (Matt Rose) Date: Mon, 9 Nov 2009 15:34:22 -0500 Subject: Kickstart, partitioning, differing disk space In-Reply-To: References: <20091109185220.GA26611@ns.sdsitehosting.net> <20091109193255.GA28087@ns.sdsitehosting.net> Message-ID: <4AF87CCE.2010001@n-able.com> If we're gonna be showing our work... Here's how I partition my drives. This grabs the driveinfo from the python libs, and apportions the drive as /backup is 15% /var/log is 5%, with a min of 1G. and a max of 5G. /boot is 128M / is whatever's left. See Chip's entry for how to detect vmware. Hyper-V identifies as Microsoft Corp as the system-manufacturer. This will *probably* not work for FC12 and RHEL-6, whenever that comes out, as they've entirely re-written the storage layer, but it works for redhat 5 based -distros. drive = isys.hardDriveDict().keys()[0] dev = parted.PedDevice.get("/dev/%s" % drive) sizeMB = (float(dev.heads * dev.cylinders * dev.sectors) / (1024 * 1024) * dev.sector_size) sizeMB_i = int(math.floor(sizeMB)) backup_size = int(math.floor(float(sizeMB * .15))) if int(math.floor(float(sizeMB * .05))) < 1000: log_size = 1000 elif int(math.floor(float(sizeMB * .05))) > 5000: log_size = 5000 else: log_size = int(math.floor(float(sizeMB * .05))) print "/var/log size is %i " % log_size print "/backup size is %i " % backup_size root_size = (sizeMB_i - backup_size - log_size - 128 - iutil.swapSuggestion()[1] ) print "/ size is %i " % root_size Matt Shabazian, Chip wrote: > # Default value for disks (27G layout) > BOOTSIZE=256 > ROOTSIZE=8192 > VARSIZE=8192 > SWAPSIZE=2048 > BANKTOOLSIZE=8192 > GRIDSIZE=0 > > # check for small disk sizes < default 27G layout: > if [ ${DISKSIZE} -lt 27648 ] > then > # create small disk (16G layout) > ROOTSIZE=5120 > VARSIZE=5120 > SWAPSIZE=2048 > BANKTOOLSIZE=3072 > fi > > # force it if it's a VMware system with more than 20G of space > dmidecode | grep Manufacturer | head -1 | grep -q VMware > if [ $? = "0" ] > then > # create small disk xen/vmware (16G layout) > ROOTSIZE=5120 > VARSIZE=5120 > SWAPSIZE=2048 > BANKTOOLSIZE=3072 > fi > > > > -----Original Message----- > From: kickstart-list-bounces at redhat.com > [mailto:kickstart-list-bounces at redhat.com] On Behalf Of John Oliver > Sent: Monday, November 09, 2009 11:33 AM > To: Discussion list about Kickstart > Subject: Re: Kickstart, partitioning, differing disk space > > On Mon, Nov 09, 2009 at 11:04:22AM -0800, Shabazian, Chip wrote: > >> We have three different partitioning schemes. The kickstart figures >> out how big the disk is, then uses one of three different schemes >> > based > >> on the size. However, if it's a VM, we automatically select the >> smallest partitioning scheme >> > > What are these "three schemes"? How do they know when they're on a VM? > Could you include a copy of the relevant section of your ks file? > > 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 > > _______________________________________________ > 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 gbailey at terremark.com Mon Nov 9 20:43:34 2009 From: gbailey at terremark.com (Glenn Bailey) Date: Mon, 9 Nov 2009 15:43:34 -0500 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: <4AF84C96.1070005@trueblade.com> References: <4AF230D1.8070908@trueblade.com> <4AF84C96.1070005@trueblade.com> Message-ID: > Glenn Bailey wrote: > >> See: > >> http://www.trueblade.com/techblog/user-input-during-a-fedora- > kickstart > >> > > > > worked perfect, thanks! it does get a garbled screen on RHEL4 builds, > but RHEL4 for us should only be re-builds, not net new so I think I can > get away with a basic console. > > I'm glad it helped. I forgot to mention the problems on RHEL4 (and I > think FC2 as well), but I haven't used either in a while. Did you ever have any success with getting user input on RHEL4 w/o using snack (or heck, with)? I've been messing around with it in python and haven't had any success so far .. From gbailey at terremark.com Wed Nov 11 20:37:49 2009 From: gbailey at terremark.com (Glenn Bailey) Date: Wed, 11 Nov 2009 15:37:49 -0500 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: References: <4AF230D1.8070908@trueblade.com> <4AF84C96.1070005@trueblade.com> Message-ID: > > I'm glad it helped. I forgot to mention the problems on RHEL4 (and I > > think FC2 as well), but I haven't used either in a while. > > Did you ever have any success with getting user input on RHEL4 w/o > using snack (or heck, with)? I've been messing around with it in python > and haven't had any success so far .. Well, here's the hack I came up with to support RHEL4. The "/tmp/pre" is in there as for some reason RHEL4 has been wanting to execute the %pre section twice???? Note that I use Cobbler so the $os_version is replaced on Kickstart generation .. Convoluted, but it works .. Basically using python for anything not RHEL4 and Python for everything else. Solves for not being able to properly set tty in RHEL4 in python. if [ ! -e /tmp/pre ]; then #disk lay stuff omitted if [ $os_version != "rhel4" ]; then /usr/bin/python << EOF import os, sys from snack import * def set_tty(n): f = open('/dev/tty%d' % n, 'a') os.dup2(f.fileno(), sys.stdin.fileno()) os.dup2(f.fileno(), sys.stdout.fileno()) os.dup2(f.fileno(), sys.stderr.fileno()) title = "Terremark Linux Build System" buttons = ['Ok', 'Cancel'] allowCancel = 1 width = 40 entryWidth = 20 help = "None" scroll = 1 height = -1 default = "None" textItems = "Hello!" text = "Confirm options" set_tty(1) screen = SnackScreen() ButtonChoiceWindow(screen, title, textItems, ['Start Build', 'Re-input Items'], width, 0,0,help) screen.finish() set_tty(3) EOF fi if [ $os_version = "rhel4" ]; then chvt 3 echo "Build system: " read BLAH chvt 1 fi touch /tmp/pre fi From eric at trueblade.com Wed Nov 11 20:40:12 2009 From: eric at trueblade.com (Eric Smith) Date: Wed, 11 Nov 2009 15:40:12 -0500 Subject: Grabbing user input in the %pre section using the python snack library In-Reply-To: References: <4AF230D1.8070908@trueblade.com> <4AF84C96.1070005@trueblade.com> Message-ID: <4AFB212C.4070500@trueblade.com> Glenn Bailey wrote: >>> I'm glad it helped. I forgot to mention the problems on RHEL4 (and I >>> think FC2 as well), but I haven't used either in a while. >> Did you ever have any success with getting user input on RHEL4 w/o >> using snack (or heck, with)? I've been messing around with it in python >> and haven't had any success so far .. I might not have answered this when you first asked it. I think I gave up on RHEL4 without ever getting it to work. I think the issue on FC2 was that it worked okay, but the borders were drawn incorrectly. That doesn't bother me so much. Eric. From mikem at redhat.com Fri Nov 13 03:48:00 2009 From: mikem at redhat.com (Mike McLean) Date: Thu, 12 Nov 2009 22:48:00 -0500 Subject: [PATCH] except..as Message-ID: <1258084081-11425-1-git-send-email-mikem@redhat.com> pykickstart uses the 3.0ism except..as in two places. Elsewhere, it uses the older syntax. The except..as syntax is supported by 2.6 without any from __future__ imports, but not in earlier python versions, such as the 2.4 version in RHEL5. This change provides consistency with the rest of the code and compatibility with less-than-bleeding-edge distros. Mike McLean (1): use python 2.x exception syntax pykickstart/parser.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) From mikem at redhat.com Fri Nov 13 03:48:01 2009 From: mikem at redhat.com (Mike McLean) Date: Thu, 12 Nov 2009 22:48:01 -0500 Subject: [PATCH] use python 2.x exception syntax In-Reply-To: <1258084081-11425-1-git-send-email-mikem@redhat.com> References: <1258084081-11425-1-git-send-email-mikem@redhat.com> Message-ID: <1258084081-11425-2-git-send-email-mikem@redhat.com> Signed-off-by: Mike McLean --- pykickstart/parser.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pykickstart/parser.py b/pykickstart/parser.py index 160874c..21525f1 100644 --- a/pykickstart/parser.py +++ b/pykickstart/parser.py @@ -136,7 +136,7 @@ def preprocessKickstart (file): """ try: fh = urlopen(file) - except grabber.URLGrabError as e: + except grabber.URLGrabError, e: raise IOError, formatErrorMsg(0, msg=_("Unable to open input kickstart file: %s") % e.strerror) rc = _preprocessStateMachine (lambda: fh.readline()) @@ -764,7 +764,7 @@ class KickstartParser: try: fh = urlopen(f) - except grabber.URLGrabError as e: + except grabber.URLGrabError, e: raise IOError, formatErrorMsg(0, msg=_("Unable to open input kickstart file: %s") % e.strerror) self._stateMachine (lambda: fh.readline()) -- 1.6.2.5 From clumens at redhat.com Fri Nov 13 14:15:08 2009 From: clumens at redhat.com (Chris Lumens) Date: Fri, 13 Nov 2009 09:15:08 -0500 Subject: [PATCH] use python 2.x exception syntax In-Reply-To: <1258084081-11425-2-git-send-email-mikem@redhat.com> References: <1258084081-11425-1-git-send-email-mikem@redhat.com> <1258084081-11425-2-git-send-email-mikem@redhat.com> Message-ID: <20091113141507.GN2208@localhost.localdomain> > diff --git a/pykickstart/parser.py b/pykickstart/parser.py > index 160874c..21525f1 100644 > --- a/pykickstart/parser.py > +++ b/pykickstart/parser.py > @@ -136,7 +136,7 @@ def preprocessKickstart (file): > """ > try: > fh = urlopen(file) > - except grabber.URLGrabError as e: > + except grabber.URLGrabError, e: > raise IOError, formatErrorMsg(0, msg=_("Unable to open input kickstart file: %s") % e.strerror) > > rc = _preprocessStateMachine (lambda: fh.readline()) > @@ -764,7 +764,7 @@ class KickstartParser: > > try: > fh = urlopen(f) > - except grabber.URLGrabError as e: > + except grabber.URLGrabError, e: > raise IOError, formatErrorMsg(0, msg=_("Unable to open input kickstart file: %s") % e.strerror) > > self._stateMachine (lambda: fh.readline()) Which version of pykickstart is this meant to apply to? - Chris From mikem at redhat.com Fri Nov 13 14:47:22 2009 From: mikem at redhat.com (Mike McLean) Date: Fri, 13 Nov 2009 09:47:22 -0500 Subject: [PATCH] use python 2.x exception syntax In-Reply-To: <20091113141507.GN2208@localhost.localdomain> References: <1258084081-11425-1-git-send-email-mikem@redhat.com> <1258084081-11425-2-git-send-email-mikem@redhat.com> <20091113141507.GN2208@localhost.localdomain> Message-ID: <4f50e0680911130647m5fd0215ahb317beae0c64f32f@mail.gmail.com> On Fri, Nov 13, 2009 at 9:15 AM, Chris Lumens wrote: > Which version of pykickstart is this meant to apply to? patch was based on HEAD in git. The commit that introduced the except..as lines was 4e1f0ff30bf1cb1d261d4920d82fc77a33761ff8 (just before 1.59). A later commit (1ab2d9d798734e9e552d2bfa80f56166bc83d334, a little before 1.62) changed the line after one of the except..as lines. So the basic change (except foo as bar -> except foo, bar) should apply from 1.59 onward. My particular patch should apply cleanly from 1.62 onward. From lippold at gmail.com Mon Nov 16 02:52:33 2009 From: lippold at gmail.com (Aaron Lippold) Date: Sun, 15 Nov 2009 21:52:33 -0500 Subject: Package installation order In-Reply-To: <5f7b4ce70911090803j4bd6ff36ya5490b838d756aa6@mail.gmail.com> References: <5f7b4ce70911090803j4bd6ff36ya5490b838d756aa6@mail.gmail.com> Message-ID: <39d2723b0911151852m7941fdbfudc07483306d9665f@mail.gmail.com> Hi, You could just do it in the %post section either by setting up the right repos or wgetting the rpms. There are lots of examples of this but if you need one let me know. Yours, Aaron On Mon, Nov 9, 2009 at 11:03 AM, Ed wrote: > I'm building a custom distro with secure SELinux policy and an automated > puppet configuration. Both the custom puppet-rpm and SELinux policy-rpm need > to be installed last (after all other rpms). Is there any way to specify > this easily? > > Currently I just make ALL packages a requirement in the .spec file, but this > isn't a very clean way to do it. I customize the stage2.img as well if there > are any modifications in there that could be made. > > Thanks for your help and genius!! > > ~Ed > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > From kaushalshriyan at gmail.com Wed Nov 18 16:08:21 2009 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Wed, 18 Nov 2009 21:38:21 +0530 Subject: kickstart installation of Ubuntu Desktop Message-ID: <6b16fb4c0911180808q100a51e9idf6a5793c1ca5229@mail.gmail.com> Hi, Can i post my question in this mailing list about kickstart automated installation (http method) of Ubuntu Desktop ? Thanks, Kaushal From bjs at redhat.com Wed Nov 18 16:44:19 2009 From: bjs at redhat.com (Bryan J Smith) Date: Wed, 18 Nov 2009 11:44:19 -0500 Subject: kickstart installation of Ubuntu Desktop In-Reply-To: <6b16fb4c0911180808q100a51e9idf6a5793c1ca5229@mail.gmail.com> References: <6b16fb4c0911180808q100a51e9idf6a5793c1ca5229@mail.gmail.com> Message-ID: <1258562659.3902.6.camel@localhost.localdomain> On Wed, 2009-11-18 at 21:38 +0530, Kaushal Shriyan wrote: > Hi, > Can i post my question in this mailing list about kickstart automated > installation (http method) of Ubuntu Desktop ? So you're using Kickstart for Ubuntu? --- more info --- I haven't kept up with Canonical's developments. Last time I checked (within the last year), there was ... 1. Debian installer's pre-seeding 2. Kickstart from the Anaconda (Fedora/Red Hat) "Python stack" Indeed, the Canonical training materials still teach these two: http://www.ubuntu.com/training/certificationcourses/server/objectives Debian pre-seeding isn't exactly the same as, despite claims by Ubuntu apologists, Ubuntu is not quite Debian. Likewise, there is still a bit of support missing from the Kickstart implementations for Ubuntu, and it's not integrated with Landscape IIRC -- whereas the Anaconda stack is supported by both base tools and the Spacewalk/RHN system. Anyone been keeping up with Canonical's developments on this front? Are they moving towards just adoption of more of the Anaconda stack? -- Bryan J Smith Senior Consultant Red Hat, Inc Professional Consulting http://www.redhat.com/consulting mailto:bjs at redhat.com +1 (407) 489-7013 (Mobile) mailto:b.j.smith at ieee.org (Blackberry/Red Hat-External) -------------------------------------------------------- You already know Red Hat as the entity dedicated to 100% no-IP-strings-attached, community software development. But do you know where CIOs rate Red Hat versus other software and services firms for their own, direct needs, year after year? http://www.redhat.com/promo/vendor/ From kaushalshriyan at gmail.com Thu Nov 19 05:08:50 2009 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Thu, 19 Nov 2009 10:38:50 +0530 Subject: kickstart installation of Ubuntu Desktop In-Reply-To: <1258562659.3902.6.camel@localhost.localdomain> References: <6b16fb4c0911180808q100a51e9idf6a5793c1ca5229@mail.gmail.com> <1258562659.3902.6.camel@localhost.localdomain> Message-ID: <6b16fb4c0911182108r2cbaac81ifacc2f4e08adf80a@mail.gmail.com> Hi, I have put the following under %post section in ks.cfg (kickstart.cfg file) ##################################################################### %post cd /tmp wget http://192.xxx.xxx.xxx/ocsinventory-agent.sh sh /tmp/ocsinventory-agent.sh wget http://192.xxx.xxx.xxx/ocsinventory-agent.cfg -O /etc/ocsinventory/ocsinventory-agent.cfg -o /tmp/log ###contents of ocsinventory-agent.sh file################# apt-get -y install ocsinventory-agent ##################################################################### when i run by hand while running the command apt-get install ocsinventory-agent, It gives me a dialog window saying *http* or *local* and the next screen in the dialog window says server ............................................. How can i handle the above scenario in the automatically installation of Ubuntu Desktop using http method? Please suggest/guide. Thanks Kaushal From kaushalshriyan at gmail.com Thu Nov 19 06:24:54 2009 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Thu, 19 Nov 2009 11:54:54 +0530 Subject: username/password Message-ID: <6b16fb4c0911182224v7556cfcrb211a1ebddc1d194@mail.gmail.com> Hi, is there a way to prompt for username/password during the kickstart installation ? Thanks, Kaushal From kaushalshriyan at gmail.com Thu Nov 19 07:14:17 2009 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Thu, 19 Nov 2009 12:44:17 +0530 Subject: username/password In-Reply-To: <6b16fb4c0911182224v7556cfcrb211a1ebddc1d194@mail.gmail.com> References: <6b16fb4c0911182224v7556cfcrb211a1ebddc1d194@mail.gmail.com> Message-ID: <6b16fb4c0911182314x695657cq18aec5e40fa7b70f@mail.gmail.com> On Thu, Nov 19, 2009 at 11:54 AM, Kaushal Shriyan wrote: > Hi, > > is there a way to prompt for username/password during the kickstart > installation ? > > Thanks, > > Kaushal > Hi Again, commented the #rootpw line in ks.cfg and it prompted me for username and password Thanks, Kaushal From kaushalshriyan at gmail.com Thu Nov 19 15:37:44 2009 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Thu, 19 Nov 2009 21:07:44 +0530 Subject: prompt for hostname Message-ID: <6b16fb4c0911190737w2963f6efo338bd51082447560@mail.gmail.com> Hi, I did comment out the network config line in ks.cfg file the installation process did not prompt me for key in the hostname. is there a way to handle this issue ? How about in the %post section. ################################################################ %post exec < /dev/tty6 > /dev/tty6 chvt 6 clear echo "################################" echo "# Running Post Configuration #" echo "################################" echo -n "Give hostname: " read hostn hostname $hostn echo $hostn > /etc/hostname ###Go back to tty1## exec < /dev/tty1 > /dev/tty1 chvt 1 ################################################################ is there a better way to do it ? Please suggest/guide Thanks, Kaushal From linux at alteeve.com Thu Nov 19 19:53:56 2009 From: linux at alteeve.com (Madison Kelly) Date: Thu, 19 Nov 2009 14:53:56 -0500 Subject: This ks script isn't working on CentOS 4.8... Should it? Message-ID: <4B05A254.50201@alteeve.com> Hi all, I've got an installer that I've been trying to get to work on various servers depending on their under-lying disk type. I adapted a KS from the web and came up with the kickstart below. In short though; I'm trying to use it on CentOS 4.8 i386. It creates the '/tmp/part-include' file but only with the 'clear-part' line. It doesn't seem to run the bash script after it. Do I need some magic to make it run? Thanks! ----------- text install cdrom lang en_US langsupport en_US keyboard us xconfig --resolution 1024x768 --depth 24 --startxonboot --defaultdesktop gnome network --device eth0 --bootproto dhcp --hostname usrvr.lab.opticalonline.com rootpw --iscrypted $1$xxxxxxxxxxxxxxxxxxxxxxxx firewall --disabled selinux --disabled authconfig --enableshadow --enablemd5 timezone --utc America/Toronto ignoredisk --drives=sda,sdb,sdc,sdd bootloader --location=partition # This will run whatever was created by the script below. %include /tmp/part-include %packages --resolvedeps @ development-tools @ editors @ legacy-network-server @ legacy-software-development @ server-cfg @ system-tools @ sound-and-video @ network-server @ admin-tools @ smb-server @ base-x @ gnome-desktop @ text-internet @ printing @ graphical-internet k3b dhcp expect ncompress vnc tftp uucp perl-Crypt-SSLeay perl-TimeDate system-config-printer # # Exclude the following packages: # -lksctp-tools -HelixPlayer -cdparanoia -rhythmbox -sound-juicer ### Script to setup partitions. %pre --log=/tmp/ks-preinstall.log #!/bin/sh # This should detect what disk parition layout to used depending on the # partitions found. # Prepare the disks. echo "zerombr yes" > /tmp/part-include echo "clearpart --all --initlabel" > /tmp/part-include ### Some detection. if [grep -q cciss/c0d0]; then ### No RAID is needed at the software level, it's managed by the controller. # '/boot' partition echo "part /boot --size=200 --asprimary --ondisk=cciss/c0d0p1" > /tmp/part-include # '/' partition echo "part / --size=200 --asprimary --ondisk=cciss/c0d0p2" > /tmp/part-include # partitions (RAID 0) echo "part swap --size=1000 --asprimary --ondisk=cciss/c0d0p3" > /tmp/part-include # '/backup' partition echo "part /backup --size=5000 --ondisk=cciss/c0d0p4" > /tmp/part-include # '/u' partition (grows to fill disk). echo "part /u --size=1 --grow --ondisk=cciss/c0d0p5" > /tmp/part-include elif [grep -q cciss/c1d0]; then ### No RAID is needed at the software level, it's managed by the controller. # '/boot' partition echo "part /boot --size=200 --asprimary --ondisk=cciss/c1d0p1" > /tmp/part-include # '/' partition echo "part / --size=200 --asprimary --ondisk=cciss/c1d0p2" > /tmp/part-include # partitions (RAID 0) echo "part swap --size=1000 --asprimary --ondisk=cciss/c1d0p3" > /tmp/part-include # '/backup' partition echo "part /backup --size=5000 --ondisk=cciss/c1d0p4" > /tmp/part-include # '/u' partition (grows to fill disk). echo "part /u --size=1 --grow --ondisk=cciss/c1d0p5" > /tmp/part-include elif [grep -q hdb /proc/partitions]; then ### /dev/hdX RAID # '/boot' partition echo "part raid.10 --size=200 --asprimary --ondisk=hda" > /tmp/part-include echo "part raid.20 --size=200 --asprimary --ondisk=hdb" > /tmp/part-include # '/' partition echo "part raid.11 --size=20000 --asprimary --ondisk=hda" > /tmp/part-include echo "part raid.21 --size=20000 --asprimary --ondisk=hdb" > /tmp/part-include # partitions (RAID 0) echo "part raid.12 --size=1000 --asprimary --ondisk=hda" > /tmp/part-include echo "part raid.22 --size=1000 --asprimary --ondisk=hdb" > /tmp/part-include # '/backup' partition echo "part raid.13 --size=5000 --ondisk=hda" > /tmp/part-include echo "part raid.23 --size=5000 --ondisk=hdb" > /tmp/part-include # '/u' partition (grows to fill disk). echo "part raid.14 --size=1 --grow --ondisk=hda" > /tmp/part-include echo "part raid.24 --size=1 --grow --ondisk=hdb" > /tmp/part-include # Build the RAID arrays echo "raid /boot --fstype ext3 --level=RAID1 --device=md0 raid.10 raid.20" > /tmp/part-include echo "raid / --fstype ext3 --level=RAID1 --device=md1 raid.11 raid.21" > /tmp/part-include echo "raid swap --fstype swap --level=RAID0 --device=md4 raid.12 raid.22" > /tmp/part-include echo "raid /backup --fstype ext3 --level=RAID1 --device=md2 raid.13 raid.23" > /tmp/part-include echo "raid /u --fstype ext3 --level=RAID1 --device=md3 raid.14 raid.24" > /tmp/part-include elif [grep -q hda /proc/partitions]; then ### /dev/hda single # '/boot' partition echo "part /boot --size=200 --asprimary --ondisk=hda" > /tmp/part-include # '/' partition echo "part / --size=20000 --asprimary --ondisk=hda" > /tmp/part-include # partitions echo "part swap --size=1000 --asprimary --ondisk=hda" > /tmp/part-include # '/backup' partition echo "part /backup --size=5000 --ondisk=hda" > /tmp/part-include # '/u' partition (grows to fill disk). echo "part /u --size=1 --grow --ondisk=hda" > /tmp/part-include elif [grep -q hdb /proc/partitions]; then ### /dev/sdX RAID - This should be the majority. # '/boot' partition echo "part raid.10 --size=200 --asprimary --ondisk=sda" > /tmp/part-include echo "part raid.20 --size=200 --asprimary --ondisk=sdb" > /tmp/part-include # '/' partition echo "part raid.11 --size=20000 --asprimary --ondisk=sda" > /tmp/part-include echo "part raid.21 --size=20000 --asprimary --ondisk=sdb" > /tmp/part-include # partitions (RAID 0) echo "part raid.12 --size=1000 --asprimary --ondisk=sda" > /tmp/part-include echo "part raid.22 --size=1000 --asprimary --ondisk=sdb" > /tmp/part-include # '/backup' partition echo "part raid.13 --size=5000 --ondisk=sda" > /tmp/part-include echo "part raid.23 --size=5000 --ondisk=sdb" > /tmp/part-include # '/u' partition (grows to fill disk). echo "part raid.14 --size=1 --grow --ondisk=sda" > /tmp/part-include echo "part raid.24 --size=1 --grow --ondisk=sdb" > /tmp/part-include # Build the RAID arrays echo "raid /boot --fstype ext3 --level=RAID1 --device=md0 raid.10 raid.20" > /tmp/part-include echo "raid / --fstype ext3 --level=RAID1 --device=md1 raid.11 raid.21" > /tmp/part-include echo "raid swap --fstype swap --level=RAID0 --device=md4 raid.12 raid.22" > /tmp/part-include echo "raid /backup --fstype ext3 --level=RAID1 --device=md2 raid.13 raid.23" > /tmp/part-include echo "raid /u --fstype ext3 --level=RAID1 --device=md3 raid.14 raid.24" > /tmp/part-include elif [grep -q hda /proc/partitions]; then ### /dev/sda single # '/boot' partition echo "part /boot --size=200 --asprimary --ondisk=sda" > /tmp/part-include # '/' partition echo "part / --size=20000 --asprimary --ondisk=sda" > /tmp/part-include # partitions echo "part swap --size=1000 --asprimary --ondisk=sda" > /tmp/part-include # '/backup' partition echo "part /backup --size=5000 --ondisk=sda" > /tmp/part-include # '/u' partition (grows to fill disk). echo "part /u --size=1 --grow --ondisk=sda" > /tmp/part-include fi From hbrown at divms.uiowa.edu Thu Nov 19 20:08:39 2009 From: hbrown at divms.uiowa.edu (Hugh Brown) Date: Thu, 19 Nov 2009 14:08:39 -0600 Subject: This ks script isn't working on CentOS 4.8... Should it? In-Reply-To: <4B05A254.50201@alteeve.com> References: <4B05A254.50201@alteeve.com> Message-ID: <4B05A5C7.5080702@divms.uiowa.edu> Madison Kelly wrote: > Hi all, > > I've got an installer that I've been trying to get to work on various > servers depending on their under-lying disk type. I adapted a KS from > the web and came up with the kickstart below. In short though; I'm > trying to use it on CentOS 4.8 i386. > > It creates the '/tmp/part-include' file but only with the 'clear-part' > line. It doesn't seem to run the bash script after it. Do I need some > magic to make it run? > > Thanks! > > ----------- > > text > install > cdrom > lang en_US > langsupport en_US > keyboard us > xconfig --resolution 1024x768 --depth 24 --startxonboot --defaultdesktop > gnome > network --device eth0 --bootproto dhcp --hostname > usrvr.lab.opticalonline.com > rootpw --iscrypted $1$xxxxxxxxxxxxxxxxxxxxxxxx > firewall --disabled > selinux --disabled > authconfig --enableshadow --enablemd5 > timezone --utc America/Toronto > ignoredisk --drives=sda,sdb,sdc,sdd > bootloader --location=partition > > # This will run whatever was created by the script below. > %include /tmp/part-include > > %packages --resolvedeps > @ development-tools > @ editors > @ legacy-network-server > @ legacy-software-development > @ server-cfg > @ system-tools > @ sound-and-video > @ network-server > @ admin-tools > @ smb-server > @ base-x > @ gnome-desktop > @ text-internet > @ printing > @ graphical-internet > k3b > dhcp > expect > ncompress > vnc > tftp > uucp > perl-Crypt-SSLeay > perl-TimeDate > system-config-printer > # > # Exclude the following packages: > # > -lksctp-tools > -HelixPlayer > -cdparanoia > -rhythmbox > -sound-juicer > > > ### Script to setup partitions. > %pre --log=/tmp/ks-preinstall.log > > #!/bin/sh > # This should detect what disk parition layout to used depending on the > # partitions found. > > # Prepare the disks. > echo "zerombr yes" > /tmp/part-include > echo "clearpart --all --initlabel" > /tmp/part-include > > ### Some detection. > if [grep -q cciss/c0d0]; then > ### No RAID is needed at the software level, it's managed by the > controller. > # '/boot' partition > echo "part /boot --size=200 --asprimary --ondisk=cciss/c0d0p1" > > /tmp/part-include > # '/' partition > echo "part / --size=200 --asprimary --ondisk=cciss/c0d0p2" > > /tmp/part-include > # partitions (RAID 0) > echo "part swap --size=1000 --asprimary --ondisk=cciss/c0d0p3" > > /tmp/part-include > # '/backup' partition > echo "part /backup --size=5000 --ondisk=cciss/c0d0p4" > > /tmp/part-include > # '/u' partition (grows to fill disk). > echo "part /u --size=1 --grow --ondisk=cciss/c0d0p5" > > /tmp/part-include > elif [grep -q cciss/c1d0]; then > ### No RAID is needed at the software level, it's managed by the > controller. > # '/boot' partition > echo "part /boot --size=200 --asprimary --ondisk=cciss/c1d0p1" > > /tmp/part-include > # '/' partition > echo "part / --size=200 --asprimary --ondisk=cciss/c1d0p2" > > /tmp/part-include > # partitions (RAID 0) > echo "part swap --size=1000 --asprimary --ondisk=cciss/c1d0p3" > > /tmp/part-include > # '/backup' partition > echo "part /backup --size=5000 --ondisk=cciss/c1d0p4" > > /tmp/part-include > # '/u' partition (grows to fill disk). > echo "part /u --size=1 --grow --ondisk=cciss/c1d0p5" > > /tmp/part-include > elif [grep -q hdb /proc/partitions]; then > ### /dev/hdX RAID > # '/boot' partition > echo "part raid.10 --size=200 --asprimary --ondisk=hda" > > /tmp/part-include > echo "part raid.20 --size=200 --asprimary --ondisk=hdb" > > /tmp/part-include > > # '/' partition > echo "part raid.11 --size=20000 --asprimary --ondisk=hda" > > /tmp/part-include > echo "part raid.21 --size=20000 --asprimary --ondisk=hdb" > > /tmp/part-include > > # partitions (RAID 0) > echo "part raid.12 --size=1000 --asprimary --ondisk=hda" > > /tmp/part-include > echo "part raid.22 --size=1000 --asprimary --ondisk=hdb" > > /tmp/part-include > > # '/backup' partition > echo "part raid.13 --size=5000 --ondisk=hda" > > /tmp/part-include > echo "part raid.23 --size=5000 --ondisk=hdb" > > /tmp/part-include > > # '/u' partition (grows to fill disk). > echo "part raid.14 --size=1 --grow --ondisk=hda" > > /tmp/part-include > echo "part raid.24 --size=1 --grow --ondisk=hdb" > > /tmp/part-include > > # Build the RAID arrays > echo "raid /boot --fstype ext3 --level=RAID1 --device=md0 raid.10 > raid.20" > /tmp/part-include > echo "raid / --fstype ext3 --level=RAID1 --device=md1 raid.11 > raid.21" > /tmp/part-include > echo "raid swap --fstype swap --level=RAID0 --device=md4 raid.12 > raid.22" > /tmp/part-include > echo "raid /backup --fstype ext3 --level=RAID1 --device=md2 raid.13 > raid.23" > /tmp/part-include > echo "raid /u --fstype ext3 --level=RAID1 --device=md3 raid.14 > raid.24" > /tmp/part-include > elif [grep -q hda /proc/partitions]; then > ### /dev/hda single > # '/boot' partition > echo "part /boot --size=200 --asprimary --ondisk=hda" > > /tmp/part-include > # '/' partition > echo "part / --size=20000 --asprimary --ondisk=hda" > > /tmp/part-include > # partitions > echo "part swap --size=1000 --asprimary --ondisk=hda" > > /tmp/part-include > # '/backup' partition > echo "part /backup --size=5000 --ondisk=hda" > > /tmp/part-include > # '/u' partition (grows to fill disk). > echo "part /u --size=1 --grow --ondisk=hda" > > /tmp/part-include > elif [grep -q hdb /proc/partitions]; then > ### /dev/sdX RAID - This should be the majority. > # '/boot' partition > echo "part raid.10 --size=200 --asprimary --ondisk=sda" > > /tmp/part-include > echo "part raid.20 --size=200 --asprimary --ondisk=sdb" > > /tmp/part-include > > # '/' partition > echo "part raid.11 --size=20000 --asprimary --ondisk=sda" > > /tmp/part-include > echo "part raid.21 --size=20000 --asprimary --ondisk=sdb" > > /tmp/part-include > > # partitions (RAID 0) > echo "part raid.12 --size=1000 --asprimary --ondisk=sda" > > /tmp/part-include > echo "part raid.22 --size=1000 --asprimary --ondisk=sdb" > > /tmp/part-include > > # '/backup' partition > echo "part raid.13 --size=5000 --ondisk=sda" > > /tmp/part-include > echo "part raid.23 --size=5000 --ondisk=sdb" > > /tmp/part-include > > # '/u' partition (grows to fill disk). > echo "part raid.14 --size=1 --grow --ondisk=sda" > > /tmp/part-include > echo "part raid.24 --size=1 --grow --ondisk=sdb" > > /tmp/part-include > > # Build the RAID arrays > echo "raid /boot --fstype ext3 --level=RAID1 --device=md0 raid.10 > raid.20" > /tmp/part-include > echo "raid / --fstype ext3 --level=RAID1 --device=md1 raid.11 > raid.21" > /tmp/part-include > echo "raid swap --fstype swap --level=RAID0 --device=md4 raid.12 > raid.22" > /tmp/part-include > echo "raid /backup --fstype ext3 --level=RAID1 --device=md2 raid.13 > raid.23" > /tmp/part-include > echo "raid /u --fstype ext3 --level=RAID1 --device=md3 raid.14 > raid.24" > /tmp/part-include > elif [grep -q hda /proc/partitions]; then > ### /dev/sda single > # '/boot' partition > echo "part /boot --size=200 --asprimary --ondisk=sda" > > /tmp/part-include > # '/' partition > echo "part / --size=20000 --asprimary --ondisk=sda" > > /tmp/part-include > # partitions > echo "part swap --size=1000 --asprimary --ondisk=sda" > > /tmp/part-include > # '/backup' partition > echo "part /backup --size=5000 --ondisk=sda" > > /tmp/part-include > # '/u' partition (grows to fill disk). > echo "part /u --size=1 --grow --ondisk=sda" > > /tmp/part-include > fi > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list If you try and run the script on a regular box, it fails. While you are working on fine tuning the script, run it on a regular box and verify that the file it creates that to test with initially before you move to the load testing situation. You need spaces between [ and the contents of the test. For example, if [grep -q cciss/c0d0]; then should be if [ grep -q cciss/c0d0 ]; then You also need to append to the file after your first echo command so that you don't overwrite it each time e.g. echo "foo" >/tmp/part-include will overwrite. echo "foo" >>/tmp/part-include will append. Those were the things that stuck out to me right away. Hugh From terry.mcintyre at gmail.com Thu Nov 19 20:28:42 2009 From: terry.mcintyre at gmail.com (Terry McIntyre) Date: Thu, 19 Nov 2009 12:28:42 -0800 Subject: This ks script isn't working on CentOS 4.8... Should it? In-Reply-To: <4B05A5C7.5080702@divms.uiowa.edu> References: <4B05A254.50201@alteeve.com> <4B05A5C7.5080702@divms.uiowa.edu> Message-ID: <67f096ea0911191228p4eeea92es9cbf505aeb2d8d65@mail.gmail.com> Inline redirection, like this, will make it easier to read your script. cat > /tmp/part-include << TAG part /boot --size=200 --asprimary --ondisk=sda part / --size=20000 --asprimary --ondisk=sda part swap --size=1000 --asprimary --ondisk=sda part /backup --size=5000 --ondisk=sda part /u --size=1 --grow --ondisk=sda TAG Test your script on a working machine before trying to use it for kickstart. Test bits of the script in isolation, then put them all together. Lastly, I don't know whether kickstart supports an include which refers to a file which is created by the kickstart itself. You are essentially asking kickstart to read the file, process the %pre block, and then re-read the file. Some processors might read the file only once, parsing and reading all include directives along the way, and execute the %pre block, and then execute the main body - the contents of which may already have been frozen. The question ( to which I have no answer ) is "when does kickstart expand include directives?" YMMV. Good luck. From chip.shabazian at bankofamerica.com Thu Nov 19 20:37:35 2009 From: chip.shabazian at bankofamerica.com (Shabazian, Chip) Date: Thu, 19 Nov 2009 12:37:35 -0800 Subject: This ks script isn't working on CentOS 4.8... Should it? In-Reply-To: <67f096ea0911191228p4eeea92es9cbf505aeb2d8d65@mail.gmail.com> References: <4B05A254.50201@alteeve.com> <4B05A5C7.5080702@divms.uiowa.edu> <67f096ea0911191228p4eeea92es9cbf505aeb2d8d65@mail.gmail.com> Message-ID: The kickstart file is read multiple times, but you cannot %include certain items such as the source of your install files. -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Terry McIntyre Sent: Thursday, November 19, 2009 12:29 PM To: Discussion list about Kickstart Subject: Re: This ks script isn't working on CentOS 4.8... Should it? Inline redirection, like this, will make it easier to read your script. cat > /tmp/part-include << TAG part /boot --size=200 --asprimary --ondisk=sda part / --size=20000 --asprimary --ondisk=sda part swap --size=1000 --asprimary --ondisk=sda part /backup --size=5000 --ondisk=sda part /u --size=1 --grow --ondisk=sda TAG Test your script on a working machine before trying to use it for kickstart. Test bits of the script in isolation, then put them all together. Lastly, I don't know whether kickstart supports an include which refers to a file which is created by the kickstart itself. You are essentially asking kickstart to read the file, process the %pre block, and then re-read the file. Some processors might read the file only once, parsing and reading all include directives along the way, and execute the %pre block, and then execute the main body - the contents of which may already have been frozen. The question ( to which I have no answer ) is "when does kickstart expand include directives?" YMMV. Good luck. _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list From tru at pasteur.fr Thu Nov 19 21:44:13 2009 From: tru at pasteur.fr (Tru Huynh) Date: Thu, 19 Nov 2009 22:44:13 +0100 Subject: This ks script isn't working on CentOS 4.8... Should it? In-Reply-To: <4B05A254.50201@alteeve.com> References: <4B05A254.50201@alteeve.com> Message-ID: <20091119214413.GR20392@sillage.bis.pasteur.fr> On Thu, Nov 19, 2009 at 02:53:56PM -0500, Madison Kelly wrote: > Hi all, ... > # Prepare the disks. > echo "zerombr yes" > /tmp/part-include > echo "clearpart --all --initlabel" > /tmp/part-include should be ">>" not ">" /tmp/part-include you need to append, not replace your file ;) Tru -- Dr Tru Huynh | http://www.pasteur.fr/recherche/unites/Binfs/ mailto:tru at pasteur.fr | tel/fax +33 1 45 68 87 37/19 Institut Pasteur, 25-28 rue du Docteur Roux, 75724 Paris CEDEX 15 France From linux at alteeve.com Thu Nov 19 21:49:11 2009 From: linux at alteeve.com (Madison Kelly) Date: Thu, 19 Nov 2009 16:49:11 -0500 Subject: This ks script isn't working on CentOS 4.8... Should it? In-Reply-To: <4B05A5C7.5080702@divms.uiowa.edu> References: <4B05A254.50201@alteeve.com> <4B05A5C7.5080702@divms.uiowa.edu> Message-ID: <4B05BD57.1010807@alteeve.com> Hugh Brown wrote: > If you try and run the script on a regular box, it fails. While you are > working on fine tuning the script, run it on a regular box and verify > that the file it creates that to test with initially before you move to > the load testing situation. > > You need spaces between [ and the contents of the test. For example, > > if [grep -q cciss/c0d0]; then > > should be > > if [ grep -q cciss/c0d0 ]; then > > You also need to append to the file after your first echo command so > that you don't overwrite it each time > > e.g. echo "foo" >/tmp/part-include > > will overwrite. > > echo "foo" >>/tmp/part-include > > will append. > > Those were the things that stuck out to me right away. > > Hugh Well now, isn't that embarrassing... :) I was so focused on the kickstart script that I missed the most basic step. Thanks. madi From linux at alteeve.com Sat Nov 21 12:35:01 2009 From: linux at alteeve.com (Madison Kelly) Date: Sat, 21 Nov 2009 07:35:01 -0500 Subject: Solved; Was: This ks script isn't working on CentOS 4.8... Should it? In-Reply-To: <4B05A5C7.5080702@divms.uiowa.edu> References: <4B05A254.50201@alteeve.com> <4B05A5C7.5080702@divms.uiowa.edu> Message-ID: <4B07DE75.6090303@alteeve.com> Hugh Brown wrote: > If you try and run the script on a regular box, it fails. While you are > working on fine tuning the script, run it on a regular box and verify > that the file it creates that to test with initially before you move to > the load testing situation. I want to thank Hugh for the note on me being a bash dork and Terry for his cat suggestion. Thanks also to Chip and Tru for taking the time to respond. I got a working kickstart file now that, finally, handles underlying disks properly. It took me forever to find a working sample of a logical kickstart script, so now that I have one working, I'd like to post it here, "for the record", in case someone else finds it trying to sort out how to do something similar down the road. :) Madi -=] Begin 'ks_unified.cfg', careful of email-induced line wraps [=- # Disk type detecting kickstart script. Tested on CentOS 4.8 text install cdrom lang en_US langsupport en_US keyboard us xconfig --resolution 1024x768 --depth 24 --startxonboot --defaultdesktop gnome network --device eth0 --bootproto dhcp --hostname sysX.example.com rootpw --iscrypted $1$cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx firewall --disabled selinux --disabled authconfig --enableshadow --enablemd5 timezone --utc America/Toronto # This will run whatever was created by the script below. %include /tmp/part-include %packages --resolvedeps @ development-tools @ editors @ legacy-network-server @ legacy-software-development @ server-cfg @ system-tools @ sound-and-video @ network-server @ admin-tools @ smb-server @ base-x @ gnome-desktop @ text-internet @ printing @ graphical-internet k3b dhcp expect ncompress vnc tftp uucp perl-Crypt-SSLeay perl-TimeDate system-config-printer # # Exclude the following packages: # -lksctp-tools -HelixPlayer -cdparanoia -rhythmbox -sound-juicer ### Script to setup partitions. %pre --log=/tmp/ks-preinstall.log #!/bin/sh # Prepare the disks in the script below. It checks '/proc/partitions' to see # what configuration to use. ### Some detection. if grep -q "cciss/c0d0" /proc/partitions; then ### No RAID is needed at the software level, it's managed by the # controller. cat >> /tmp/part-include < partitions part swap --size=1000 --asprimary --ondisk=cciss/c0d0 # '/backup' partition part /backup --size=5000 --ondisk=cciss/c0d0 # '/u' partition (grows to fill disk). part /u --size=1 --grow --ondisk=cciss/c0d0 END elif grep -q "cciss/c1d0" /proc/partitions; then ### No RAID is needed at the software level, it's managed by the # controller. cat >> /tmp/part-include < partitions part swap --size=1000 --asprimary --ondisk=cciss/c1d0 # '/backup' partition part /backup --size=5000 --ondisk=cciss/c1d0 # '/u' partition (grows to fill disk). part /u --size=1 --grow --ondisk=cciss/c1d0 END elif grep -q hdb /proc/partitions; then ### /dev/hdX RAID cat >> /tmp/part-include < partitions part raid.12 --size=1000 --asprimary --ondisk=hda part raid.22 --size=1000 --asprimary --ondisk=hdb # '/backup' partition part raid.13 --size=5000 --ondisk=hda part raid.23 --size=5000 --ondisk=hdb # '/u' partition (grows to fill disk). part raid.14 --size=1 --grow --ondisk=hda part raid.24 --size=1 --grow --ondisk=hdb # Build the RAID arrays raid /boot --fstype ext3 --level=RAID1 --device=md0 raid.10 raid.20 raid / --fstype ext3 --level=RAID1 --device=md1 raid.11 raid.21 raid swap --fstype swap --level=RAID1 --device=md4 raid.12 raid.22 raid /backup --fstype ext3 --level=RAID1 --device=md2 raid.13 raid.23 raid /u --fstype ext3 --level=RAID1 --device=md3 raid.14 raid.24 END elif grep -q hda /proc/partitions; then ### /dev/hda single cat >> /tmp/part-include < partitions part swap --size=1000 --asprimary --ondisk=hda # '/backup' partition part /backup --size=5000 --ondisk=hda # '/u' partition (grows to fill disk). part /u --size=1 --grow --ondisk=hda END elif grep -q sdb /proc/partitions; then ### /dev/sdX RAID - This should be the majority. cat >> /tmp/part-include < partitions part raid.12 --size=1000 --asprimary --ondisk=sda part raid.22 --size=1000 --asprimary --ondisk=sdb # '/backup' partition part raid.13 --size=5000 --ondisk=sda part raid.23 --size=5000 --ondisk=sdb # '/u' partition (grows to fill disk). part raid.14 --size=1 --grow --ondisk=sda part raid.24 --size=1 --grow --ondisk=sdb # Build the RAID arrays raid /boot --fstype ext3 --level=RAID1 --device=md0 raid.10 raid.20 raid / --fstype ext3 --level=RAID1 --device=md1 raid.11 raid.21 raid swap --fstype swap --level=RAID1 --device=md4 raid.12 raid.22 raid /backup --fstype ext3 --level=RAID1 --device=md2 raid.13 raid.23 raid /u --fstype ext3 --level=RAID1 --device=md3 raid.14 raid.24 END elif grep -q sda /proc/partitions; then ### /dev/sda single cat >> /tmp/part-include < partitions part swap --size=1000 --asprimary --ondisk=sda # '/backup' partition part /backup --size=5000 --ondisk=sda # '/u' partition (grows to fill disk). part /u --size=1 --grow --ondisk=sda END fi From gianluca.varenni at gmail.com Tue Nov 24 00:26:49 2009 From: gianluca.varenni at gmail.com (Gianluca Varenni) Date: Mon, 23 Nov 2009 16:26:49 -0800 Subject: How to cause an installation failure in the %pre script Message-ID: <33F185C7F3D04E2C9179CD1E0F66A1FA@NELSON3> Hi all. I'm preparing a custom Fedora 10 Install CD with kickstart. In the %pre script, I check the presence of a specific RAID controller (and disks) and reconfigure it. If the RAID controller is not there (or something fails during the reconfiguration), I need to fail the installation of Fedora. Is there a way from the %pre script to return a failure? Have a nice day GV From bschneiders at woti.com Tue Nov 24 16:56:21 2009 From: bschneiders at woti.com (Bryan Schneiders) Date: Tue, 24 Nov 2009 11:56:21 -0500 Subject: How to cause an installation failure in the %pre script In-Reply-To: <33F185C7F3D04E2C9179CD1E0F66A1FA@NELSON3> References: <33F185C7F3D04E2C9179CD1E0F66A1FA@NELSON3> Message-ID: <4B0C1035.2020907@woti.com> >From http://fedoraproject.org/wiki/Anaconda/Kickstart %pre --erroronfail If the pre-installation script fails, this option will cause an error dialog to be displayed and will halt installation. The error message will direct you to where the cause of the failure is logged. - Bryan Schneiders Gianluca Varenni wrote: > Hi all. > > I'm preparing a custom Fedora 10 Install CD with kickstart. In the %pre > script, I check the presence of a specific RAID controller (and disks) > and reconfigure it. If the RAID controller is not there (or something > fails during the reconfiguration), I need to fail the installation of > Fedora. > > Is there a way from the %pre script to return a failure? > > Have a nice day > GV > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list From pg_rhk at rhk.for.sabi.co.UK Mon Nov 23 07:59:52 2009 From: pg_rhk at rhk.for.sabi.co.UK (Peter Grandi) Date: Mon, 23 Nov 2009 07:59:52 +0000 Subject: Solved; Was: This ks script isn't working on CentOS 4.8... Should it? In-Reply-To: <4B07DE75.6090303@alteeve.com> References: <4B05A254.50201@alteeve.com> <4B05A5C7.5080702@divms.uiowa.edu> <4B07DE75.6090303@alteeve.com> Message-ID: <19210.16632.455303.26445@tree.ty.sabi.co.uk> [ ... ] > It took me forever to find a working sample of a logical > kickstart script, so now that I have one working, I'd like to > post it here, "for the record", in case someone else finds it > trying to sort out how to do something similar down the road. :) While commuting to work I have cleaned up your script so it is hopefully much more readable, and it is attached. Some would think to "leave elegance to tailors" (and RedHat developers seem to think so, as most of their scripts seem appalling to me), but I think it helps cope with complexity and maintainability. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: rhel_ksalteeve.ks URL: From linux at alteeve.com Tue Nov 24 18:53:09 2009 From: linux at alteeve.com (Madison Kelly) Date: Tue, 24 Nov 2009 13:53:09 -0500 Subject: Solved; Was: This ks script isn't working on CentOS 4.8... Should it? In-Reply-To: <19210.16632.455303.26445@tree.ty.sabi.co.uk> References: <4B05A254.50201@alteeve.com> <4B05A5C7.5080702@divms.uiowa.edu> <4B07DE75.6090303@alteeve.com> <19210.16632.455303.26445@tree.ty.sabi.co.uk> Message-ID: <4B0C2B95.7080901@alteeve.com> Peter Grandi wrote: > [ ... ] > >> It took me forever to find a working sample of a logical >> kickstart script, so now that I have one working, I'd like to >> post it here, "for the record", in case someone else finds it >> trying to sort out how to do something similar down the road. :) > > While commuting to work I have cleaned up your script so it is > hopefully much more readable, and it is attached. Some would > think to "leave elegance to tailors" (and RedHat developers seem > to think so, as most of their scripts seem appalling to me), but > I think it helps cope with complexity and maintainability. It is cleaner, and I do appreciate that. It's my weakness in bash scripting that hurts me here (spoiled by perl :P ). Thanks! Madi From gianluca.varenni at gmail.com Wed Nov 25 16:47:39 2009 From: gianluca.varenni at gmail.com (Gianluca Varenni) Date: Wed, 25 Nov 2009 08:47:39 -0800 Subject: How to cause an installation failure in the %pre script References: <33F185C7F3D04E2C9179CD1E0F66A1FA@NELSON3> <4B0C1035.2020907@woti.com> Message-ID: <21DD1D4089904102BA05A2B83D3B3CCC@NELSON3> That did the trick. Thanks! GV ----- Original Message ----- From: "Bryan Schneiders" To: "Discussion list about Kickstart" Sent: Tuesday, November 24, 2009 8:56 AM Subject: Re: How to cause an installation failure in the %pre script > >From http://fedoraproject.org/wiki/Anaconda/Kickstart > > %pre --erroronfail > If the pre-installation script fails, this option will cause an > error dialog to be displayed and will halt installation. The error message > will direct you to where the cause of the failure is logged. > - Bryan Schneiders > > Gianluca Varenni wrote: >> Hi all. >> >> I'm preparing a custom Fedora 10 Install CD with kickstart. In the %pre >> script, I check the presence of a specific RAID controller (and disks) >> and reconfigure it. If the RAID controller is not there (or something >> fails during the reconfiguration), I need to fail the installation of >> Fedora. >> >> Is there a way from the %pre script to return a failure? >> >> Have a nice day >> GV >> _______________________________________________ >> 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 S.Reber at lcsys.ch Fri Nov 27 12:44:01 2009 From: S.Reber at lcsys.ch (Simon Reber) Date: Fri, 27 Nov 2009 13:44:01 +0100 Subject: Kickstart using static IP address Message-ID: <1209832B38DC214CB373A59426B91DFE644F13@chbsex01.lcsys.ch> Hi List, I have a problem with my kickstart environment. The kickstart file and the packages are located on a web server and to start the installation, I've created an ISO from isolinux (Source is CentOS 5.4) Everything works very well so far, since I have DHCP available in almost every network. But now the environment is being extended to an additional DMZ where I won't get DHCP running. But everything is build to support static IP address as well and at the beginning it was working fine. The system booted from the ISO (mentioned above) then asked my which Interface I want to use for installation (took eth0) and started looking for a DHCP server to obtain an IP address. Since there was no DHCP Server present, anaconda came up with a mask where I could define static IP configuration and afterwards configure the selected NIC (IP, Netmask, Gateway and DNS Server). When I pressed OK it contacted successfully my kickstart web server and downloaded the kickstart file (activity was logged in the web server log). But as soon as the kickstart file arrived on the server it starts again determine an IP address form a DHCP server which fails (obviously). Because of this all IP information I've entered before are lost and the further installation steps are failing (loading stage2.img, etc.) Since this is happening in such an early state I am not able to obtain any log files from anaconda. I know that I can define static information directly during boot (with ip=, etc.) But I'd like to avoid this and use the way described above (I hardly remeber that I was successfully using this in the past) So my question is: Does somebody know this behavior? And If yes is there a way to get around this or to make it working? If you need my kickstart file, feel free to ask for it. I won't past it into this mail to keep it simple. Thanks and all the best, Si From rpr at 9it.de Fri Nov 27 13:57:36 2009 From: rpr at 9it.de (=?iso-8859-1?Q?Pretzlaff_R=FCdiger?=) Date: Fri, 27 Nov 2009 14:57:36 +0100 Subject: Kickstart using static IP address In-Reply-To: <1209832B38DC214CB373A59426B91DFE644F13@chbsex01.lcsys.ch> References: <1209832B38DC214CB373A59426B91DFE644F13@chbsex01.lcsys.ch> Message-ID: Am 27.11.2009 um 13:44 schrieb Simon Reber: > Hi List, > > I have a problem with my kickstart environment. > The kickstart file and the packages are located on a web server and to > start the installation, I've created an ISO from isolinux (Source is > CentOS 5.4) > > Everything works very well so far, since I have DHCP available in > almost > every network. But now the environment is being extended to an > additional DMZ where I won't get DHCP running. > But everything is build to support static IP address as well and at > the > beginning it was working fine. > The system booted from the ISO (mentioned above) then asked my which > Interface I want to use for installation (took eth0) and started > looking > for a DHCP server to obtain an IP address. Since there was no DHCP > Server present, anaconda came up with a mask where I could define > static > IP configuration and afterwards configure the selected NIC (IP, > Netmask, > Gateway and DNS Server). When I pressed OK it contacted successfully > my > kickstart web server and downloaded the kickstart file (activity was > logged in the web server log). > But as soon as the kickstart file arrived on the server it starts > again > determine an IP address form a DHCP server which fails (obviously). > Because of this all IP information I've entered before are lost and > the > further installation steps are failing (loading stage2.img, etc.) > Since this is happening in such an early state I am not able to obtain > any log files from anaconda. > > I know that I can define static information directly during boot (with > ip=, etc.) But I'd like to avoid this and use the way > described above (I hardly remeber that I was successfully using this > in > the past) > So my question is: > Does somebody know this behavior? And If yes is there a way to > get around this or to make it working? network --device eth0 --bootproto static --ip 10.10.10.XX --netmask 255.255.255.0 --gateway 10.10.10.1 --nameserver 10.10.10.1 > If you need my kickstart file, feel free to ask for it. I won't past > it > into this mail to keep it simple. > > Thanks and all the best, > Si From S.Reber at lcsys.ch Fri Nov 27 14:05:30 2009 From: S.Reber at lcsys.ch (Simon Reber) Date: Fri, 27 Nov 2009 15:05:30 +0100 Subject: AW: Kickstart using static IP address In-Reply-To: References: <1209832B38DC214CB373A59426B91DFE644F13@chbsex01.lcsys.ch> Message-ID: <1209832B38DC214CB373A59426B91DFE644F20@chbsex01.lcsys.ch> > Am 27.11.2009 um 13:44 schrieb Simon Reber: > > > Hi List, > > > > I have a problem with my kickstart environment. > > The kickstart file and the packages are located on a web > server and to > > start the installation, I've created an ISO from isolinux (Source is > > CentOS 5.4) > > > > Everything works very well so far, since I have DHCP available in > > almost > > every network. But now the environment is being extended to an > > additional DMZ where I won't get DHCP running. > > But everything is build to support static IP address as > well and at > > the > > beginning it was working fine. > > The system booted from the ISO (mentioned above) then asked my which > > Interface I want to use for installation (took eth0) and started > > looking > > for a DHCP server to obtain an IP address. Since there was no DHCP > > Server present, anaconda came up with a mask where I could define > > static > > IP configuration and afterwards configure the selected NIC (IP, > > Netmask, > > Gateway and DNS Server). When I pressed OK it contacted > successfully > > my > > kickstart web server and downloaded the kickstart file (activity was > > logged in the web server log). > > But as soon as the kickstart file arrived on the server it starts > > again > > determine an IP address form a DHCP server which fails (obviously). > > Because of this all IP information I've entered before are > lost and > > the > > further installation steps are failing (loading stage2.img, etc.) > > Since this is happening in such an early state I am not > able to obtain > > any log files from anaconda. > > > > I know that I can define static information directly during > boot (with > > ip=, etc.) But I'd like to avoid this and use the way > > described above (I hardly remeber that I was successfully > using this > > in > > the past) > > So my question is: > > Does somebody know this behavior? And If yes is there a way to > > get around this or to make it working? > > network --device eth0 --bootproto static --ip 10.10.10.XX --netmask > 255.255.255.0 --gateway 10.10.10.1 --nameserver 10.10.10.1 Hi Ruediger, the problem is that this stuff is build during installation in the kickstart file So I am not able to pre-define this information! > > > If you need my kickstart file, feel free to ask for it. I > won't past > > it > > into this mail to keep it simple. > > > > Thanks and all the best, > > Si > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > From rpr at 9it.de Fri Nov 27 15:35:02 2009 From: rpr at 9it.de (=?iso-8859-1?Q?Pretzlaff_R=FCdiger?=) Date: Fri, 27 Nov 2009 16:35:02 +0100 Subject: AW: Kickstart using static IP address In-Reply-To: <1209832B38DC214CB373A59426B91DFE644F20@chbsex01.lcsys.ch> References: <1209832B38DC214CB373A59426B91DFE644F13@chbsex01.lcsys.ch> <1209832B38DC214CB373A59426B91DFE644F20@chbsex01.lcsys.ch> Message-ID: <96E479C1-8960-43E3-B19B-3EC1778604C5@9it.de> Am 27.11.2009 um 15:05 schrieb Simon Reber: >> Am 27.11.2009 um 13:44 schrieb Simon Reber: >>> So my question is: >>> Does somebody know this behavior? And If yes is there a way to >>> get around this or to make it working? >> >> network --device eth0 --bootproto static --ip 10.10.10.XX --netmask >> 255.255.255.0 --gateway 10.10.10.1 --nameserver 10.10.10.1 > Hi Ruediger, the problem is that this stuff is build during > installation > in the kickstart file > So I am not able to pre-define this information! You want to set only the IP. This allows the computer to load the kickstart script? /tftpboot/pxelinux.cfg/default: label Install kernel vmlinuz append initrd=initrd.img eth0=10.10.10.xx .... ks=nfs:....... Is that what you are looking for? cya Ruediger From S.Reber at lcsys.ch Fri Nov 27 14:47:09 2009 From: S.Reber at lcsys.ch (Simon Reber) Date: Fri, 27 Nov 2009 15:47:09 +0100 Subject: AW: Kickstart using static IP address In-Reply-To: <1209832B38DC214CB373A59426B91DFE644F20@chbsex01.lcsys.ch> References: <1209832B38DC214CB373A59426B91DFE644F13@chbsex01.lcsys.ch> <1209832B38DC214CB373A59426B91DFE644F20@chbsex01.lcsys.ch> Message-ID: <1209832B38DC214CB373A59426B91DFE644F27@chbsex01.lcsys.ch> Hi List, It seems that I have found the problem. After I've entered the IP address information, anaconda is downloading the kickstart file and parsing it directly. Unfortunately do I configure the network information in the %pre section and include it afterwards Like: %include /tmp/network-include And since the kickstart parse does not find anything network related at the first time it parse the file it switches back to DHCP: >From anaconda log: ... file location http://
/ks.cfg transferring ks setting up kickstart kickstartFromUrl result of url ks setting language to need to setup networking going to pick interface going to do getNetConfig sending dhcp request through device eth0 Does anyone has an idea, how I can avoid that anaconda is switching back to DHCP (meaning using the information I've entered)? Thanks and all the best, Si > -----Urspr?ngliche Nachricht----- > Von: kickstart-list-bounces at redhat.com > [mailto:kickstart-list-bounces at redhat.com] Im Auftrag von Simon Reber > Gesendet: Freitag, 27. November 2009 15:05 > An: Discussion list about Kickstart > Betreff: AW: Kickstart using static IP address > > > Am 27.11.2009 um 13:44 schrieb Simon Reber: > > > > > Hi List, > > > > > > I have a problem with my kickstart environment. > > > The kickstart file and the packages are located on a web > > server and to > > > start the installation, I've created an ISO from isolinux > (Source is > > > CentOS 5.4) > > > > > > Everything works very well so far, since I have DHCP > available in > > > almost > > > every network. But now the environment is being extended to an > > > additional DMZ where I won't get DHCP running. > > > But everything is build to support static IP address as > > well and at > > > the > > > beginning it was working fine. > > > The system booted from the ISO (mentioned above) then > asked my which > > > Interface I want to use for installation (took eth0) and started > > > looking > > > for a DHCP server to obtain an IP address. Since there was no DHCP > > > Server present, anaconda came up with a mask where I > could define > > > static > > > IP configuration and afterwards configure the selected NIC (IP, > > > Netmask, > > > Gateway and DNS Server). When I pressed OK it contacted > > successfully > > > my > > > kickstart web server and downloaded the kickstart file > (activity was > > > logged in the web server log). > > > But as soon as the kickstart file arrived on the server > it starts > > > again > > > determine an IP address form a DHCP server which fails > (obviously). > > > Because of this all IP information I've entered before are > > lost and > > > the > > > further installation steps are failing (loading stage2.img, etc.) > > > Since this is happening in such an early state I am not > > able to obtain > > > any log files from anaconda. > > > > > > I know that I can define static information directly during > > boot (with > > > ip=, etc.) But I'd like to avoid this and use the way > > > described above (I hardly remeber that I was successfully > > using this > > > in > > > the past) > > > So my question is: > > > Does somebody know this behavior? And If yes is there a way to > > > get around this or to make it working? > > > > network --device eth0 --bootproto static --ip 10.10.10.XX > --netmask > > 255.255.255.0 --gateway 10.10.10.1 --nameserver 10.10.10.1 > Hi Ruediger, the problem is that this stuff is build during > installation > in the kickstart file > So I am not able to pre-define this information! > > > > > > If you need my kickstart file, feel free to ask for it. I > > won't past > > > it > > > into this mail to keep it simple. > > > > > > Thanks and all the best, > > > Si > > > > _______________________________________________ > > 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 peter.scheie at visionshareinc.com Mon Nov 30 14:03:02 2009 From: peter.scheie at visionshareinc.com (Peter Scheie) Date: Mon, 30 Nov 2009 08:03:02 -0600 Subject: AW: Kickstart using static IP address In-Reply-To: <1209832B38DC214CB373A59426B91DFE644F27@chbsex01.lcsys.ch> References: <1209832B38DC214CB373A59426B91DFE644F13@chbsex01.lcsys.ch> <1209832B38DC214CB373A59426B91DFE644F20@chbsex01.lcsys.ch> <1209832B38DC214CB373A59426B91DFE644F27@chbsex01.lcsys.ch> Message-ID: <1259589782.28820.10.camel@pscheie-ubuntu810> On Fri, 2009-11-27 at 08:47 -0600, Simon Reber wrote: > Hi List, > > It seems that I have found the problem. > After I've entered the IP address information, anaconda is downloading the kickstart file and parsing it directly. > Unfortunately do I configure the network information in the %pre section and include it afterwards > Like: %include /tmp/network-include > > And since the kickstart parse does not find anything network related at the first time it parse the file it switches back to DHCP: > >From anaconda log: > > ... > file location http://
/ks.cfg > transferring ks > setting up kickstart > kickstartFromUrl > result of url ks > setting language to > need to setup networking > going to pick interface > going to do getNetConfig > sending dhcp request through device eth0 > > Does anyone has an idea, how I can avoid that anaconda is switching back to DHCP (meaning using the information I've entered)? > > Thanks and all the best, > Si > I have run into this problem as well. The solution I'm using at the moment is three-part: 1) add 'network bootproto=query' to the kickstart file; 2) put the kickstart file into the initrd.img; 3) in the boot command use 'ks=file:/kickstart.cfg. This works all though it is a bit clumsy. When the kickstart is read from the initrd, it will trigger the network config dialogs (net.c). This info is then used to retrieve stage2. But in stage2 a second set of network dialogs will appear, also triggered by the 'network' setting in the kickstart.cfg. The good news is that all the values you just entered in loader (stage1) will be auto-filled in the dialogs in stage2, so you can just hit enter. Unfortunately for me, this is still too cumbersome for my needs, so I'm having to hack loader (net.c) in stage1 and anaconda in stage2 to reduce the number of dialogs, e.g why, if I've specified bootproto=query, is there a dialog asking me if I want to configure the network, when I've already told it to do so?. It would be nice if stage2 were smart enough to deduce that if network values are passed to it from stage1, that it doesn't need to prompt for them again. Peter Peter From shailusodhi at gmail.com Mon Nov 30 22:13:13 2009 From: shailusodhi at gmail.com (shailendra sodhi) Date: Tue, 1 Dec 2009 11:13:13 +1300 Subject: upgrading using kickstart Message-ID: hi all, I am attempting an upgrade from CentOS 5.3 to CentOS 5.4. The system I am running has three 1 terabyte drives /sda/b/c configured as soft raid0 with xfs file system and one solid state 32 GB drive (/sdd)with linux(CentOS 5.3) on it. Now the problem is when I attempt an upgrade installer complains about unreadable partition table on sda/b/c and ask for intialization, which is fine since I can ignore the message but than it try to mount /dev/md0 soft raid partition and fails the upgrade. Now before attempting an upgrade if I unmount the /dev/md0 and remove the entry from fstab, installer dosen't complain about any thing and the upgrade is successful. Now the company I work for ships the boxes with above configurations and I don't want customers to playing around with fstab and than upgrade their boxes. Any work around ....?? Apart from performing upgrade over net as it must be thru DVD. -------------- next part -------------- An HTML attachment was scrubbed... URL: