From adamwill at shaw.ca Tue Jul 8 01:10:53 2014 From: adamwill at shaw.ca (Adam Williamson) Date: Mon, 07 Jul 2014 18:10:53 -0700 Subject: $releasever and $arch substitution in url and mirrorlist, and "Closest mirror" kickstart support? Message-ID: <1404781853.2620.15.camel@adam.happyassassin.net> So like Vadym Chepkov way back in 2010, I find myself wanting to write very generic kickstart files, for validation testing. The Kickstart docs claim: https://fedoraproject.org/wiki/Anaconda/Kickstart#url " --mirrorlist= The mirror URL to install from. Variable substitution is done for $releasever and $basearch in the url (added in F19)." but I tried using this, and it doesn't seem to work. A kickstart with this line: url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$arch or this one: url --url=https://dl.fedoraproject.org/pub/fedora/linux/releases/$releasever/Fedora/$arch/os/ just gives me an error on the Installation Source spoke. When I enter the spoke, $releasever and $arch are included verbatim in the URL. If I manually substitute them with correct values then go back to hub, it works (indicating I'm using the right URL, but the substitution just isn't happening). I've tested with 19 and 20; it doesn't work with either. Am I doing something wrong, or did this never actually work in a release? Can it be fixed? Also, shouldn't there be a way to duplicate the interactive network install's default "Closest mirror" behaviour in a kickstart without having to pass any URL explicitly at all? I'd expect that simply "url --mirrorlist" would do this, but in fact it just dies, stating that a URL is required...I don't see that this limitation makes sense, a kickstart-driven install should be able to 'just use defaults' like an interactive one can here. Thanks! (yeah, this is the usual adamw, I subscribed to this list ages ago, with an old personal address...) -- adamw From oguzyilmazlist at gmail.com Wed Jul 23 11:12:30 2014 From: oguzyilmazlist at gmail.com (Oguz Yilmaz) Date: Wed, 23 Jul 2014 14:12:30 +0300 Subject: dynamic partition size in a kickstart file Message-ID: Hello I want to dynamically set tmpfs size acc.to the ram the server has in my kickstart. Is there a way for such dynamic value setting? Best Regards, -- Oguz YILMAZ From Firas.Alshafei at ventyx.abb.com Wed Jul 23 16:44:52 2014 From: Firas.Alshafei at ventyx.abb.com (Firas Alshafei) Date: Wed, 23 Jul 2014 16:44:52 +0000 Subject: dynamic partition size in a kickstart file In-Reply-To: References: Message-ID: Oguz, I was doing something similar in my RHEL 5.8 kickstart. In the pre-script I have a function that calculates swap space based on RAM available: function func_dynamic_swap(){ # Determine the ammount of RAM available mem_size_kb=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'` # Determing the amount of GB RAM - AWK is used to round up since meminfo doesn't provide accurate info mem_size_gb=`awk -v MSZKB=$mem_size_kb 'BEGIN{printf("%.2f\n",(MSZKB/1024/1024))}' | awk '{printf("%d\n",$1+0.5)}'` # Set swap value depending on RAM. If RAM is 16GB or if [ $mem_size_gb -ge 16 ]; then dyn_swap=$(( ( $mem_size_gb + 2 ) * 1024 )) else dyn_swap=$(( 16 * 1024 )) fi echo $dyn_swap } That should return the value I want. I then use it in another function to create the partitioning # Set disk sizing values sizeOverhead=200 sizeSwap=$(func_dynamic_swap) sizeRoot=20480 sizeVar=5120 sizeUsers=39936 # Create boot partition echo "part /boot --fstype ext4 --size $sizeBoot --asprimary --ondisk $disk1" >> /tmp/disk-config.ks # Partition Disk1 echo "part pv.1 --size=1 --grow --ondisk $disk1" >> /tmp/disk-config.ks # Create Volume Group echo "volgroup VG1 --pesize $sizePeKB pv.1" >> /tmp/disk-config.ks # Create logical volumes echo "logvol swap --fstype swap --name lv_swap --vgname VG1 --size=$sizeSwap" >> /tmp/disk-config.ks echo "logvol / --fstype ext4 --name lv_root --vgname VG1 --size=$sizeRoot " >> /tmp/disk-config.ks echo "logvol /var --fstype ext4 --name lv_var --vgname VG1 --size=$sizeVar " >> /tmp/disk-config.ks echo "logvol /usr/users --fstype ext4 --name lv_users --vgname VG1 --size=$sizeUsers " >> /tmp/disk-config.ks and call that disk-config.ks file in your kickstart file ################################################################################ # DISK CONFIGURATION ################################################################################ #System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr %include /tmp/abb-disk-config Hope that helps :) FIRAS ALSHAFEI Lead Engineer Email:?firas.alshafei at ventyx.abb.com (O) +1-281-274-5023 (M) +1-330-647-6477 VENTYX An ABB Company www.ventyx.com 1601 Industrial Blvd. | Sugar Land TX 77478 | U.S.A. -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Oguz Yilmaz Sent: Wednesday, July 23, 2014 6:13 AM To: Discussion list about Kickstart Subject: dynamic partition size in a kickstart file Hello I want to dynamically set tmpfs size acc.to the ram the server has in my kickstart. Is there a way for such dynamic value setting? Best Regards, -- Oguz YILMAZ _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list From bruno at wolff.to Wed Jul 23 20:53:25 2014 From: bruno at wolff.to (Bruno Wolff III) Date: Wed, 23 Jul 2014 15:53:25 -0500 Subject: $releasever and $arch substitution in url and mirrorlist, and "Closest mirror" kickstart support? In-Reply-To: <1404781853.2620.15.camel@adam.happyassassin.net> References: <1404781853.2620.15.camel@adam.happyassassin.net> Message-ID: <20140723205325.GA22553@wolff.to> On Mon, Jul 07, 2014 at 18:10:53 -0700, Adam Williamson wrote: >So like Vadym Chepkov way back in 2010, I find myself wanting to write >very generic kickstart files, for validation testing. The Kickstart docs >claim: > >https://fedoraproject.org/wiki/Anaconda/Kickstart#url > >" --mirrorlist= > > The mirror URL to install from. Variable substitution is done >for $releasever and $basearch in the url (added in F19)." > >but I tried using this, and it doesn't seem to work. A kickstart with >this line: It looks like it is supposed to work for live images and I thought anaconda and livecd-creator shared code for this. You can look at /usr/lib/python2.7/site-packages/imgcreate/yuminst.py around line 150 and you'll see stuff like this: def addRepository(self, name, url = None, mirrorlist = None): def _varSubstitute(option): # takes a variable and substitutes like yum configs do option = option.replace("$basearch", rpmUtils.arch.getBaseArch()) option = option.replace("$arch", rpmUtils.arch.getCanonArch()) # If the url includes $releasever substitute user's value or # current system's version. From oguzyilmazlist at gmail.com Thu Jul 24 17:17:51 2014 From: oguzyilmazlist at gmail.com (Oguz Yilmaz) Date: Thu, 24 Jul 2014 20:17:51 +0300 Subject: dynamic partition size in a kickstart file In-Reply-To: References: Message-ID: Firas, Bypassing anaconda is a very good idea. Thank you for this important clue. -- Oguz YILMAZ On Wed, Jul 23, 2014 at 7:44 PM, Firas Alshafei wrote: > Oguz, > > I was doing something similar in my RHEL 5.8 kickstart. > > In the pre-script I have a function that calculates swap space based on RAM available: > function func_dynamic_swap(){ > # Determine the ammount of RAM available > mem_size_kb=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'` > > # Determing the amount of GB RAM - AWK is used to round up since meminfo doesn't provide accurate info > mem_size_gb=`awk -v MSZKB=$mem_size_kb 'BEGIN{printf("%.2f\n",(MSZKB/1024/1024))}' | awk '{printf("%d\n",$1+0.5)}'` > > # Set swap value depending on RAM. If RAM is 16GB or > if [ $mem_size_gb -ge 16 ]; then > dyn_swap=$(( ( $mem_size_gb + 2 ) * 1024 )) > else > dyn_swap=$(( 16 * 1024 )) > fi > > echo $dyn_swap > } > > That should return the value I want. I then use it in another function to create the partitioning > # Set disk sizing values > sizeOverhead=200 > sizeSwap=$(func_dynamic_swap) > sizeRoot=20480 > sizeVar=5120 > sizeUsers=39936 > > # Create boot partition > echo "part /boot --fstype ext4 --size $sizeBoot --asprimary --ondisk $disk1" >> /tmp/disk-config.ks > # Partition Disk1 > echo "part pv.1 --size=1 --grow --ondisk $disk1" >> /tmp/disk-config.ks > # Create Volume Group > echo "volgroup VG1 --pesize $sizePeKB pv.1" >> /tmp/disk-config.ks > # Create logical volumes > echo "logvol swap --fstype swap --name lv_swap --vgname VG1 --size=$sizeSwap" >> /tmp/disk-config.ks > echo "logvol / --fstype ext4 --name lv_root --vgname VG1 --size=$sizeRoot " >> /tmp/disk-config.ks > echo "logvol /var --fstype ext4 --name lv_var --vgname VG1 --size=$sizeVar " >> /tmp/disk-config.ks > echo "logvol /usr/users --fstype ext4 --name lv_users --vgname VG1 --size=$sizeUsers " >> /tmp/disk-config.ks > > and call that disk-config.ks file in your kickstart file > ################################################################################ > # DISK CONFIGURATION > ################################################################################ > #System bootloader configuration > bootloader --location=mbr > # Clear the Master Boot Record > zerombr > %include /tmp/abb-disk-config > > Hope that helps :) > > FIRAS ALSHAFEI > Lead Engineer > Email: firas.alshafei at ventyx.abb.com > (O) +1-281-274-5023 > (M) +1-330-647-6477 > VENTYX > An ABB Company > www.ventyx.com > 1601 Industrial Blvd. | Sugar Land TX 77478 | U.S.A. > > -----Original Message----- > From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Oguz Yilmaz > Sent: Wednesday, July 23, 2014 6:13 AM > To: Discussion list about Kickstart > Subject: dynamic partition size in a kickstart file > > Hello > > I want to dynamically set tmpfs size acc.to the ram the server has in my kickstart. Is there a way for such dynamic value setting? > > Best Regards, > > -- > Oguz YILMAZ > > _______________________________________________ > 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 rjiejie at gmail.com Sun Jul 27 04:14:25 2014 From: rjiejie at gmail.com (jojo) Date: Sun, 27 Jul 2014 12:14:25 +0800 Subject: How to copy data from CDROM(iso) to installed system in kickstart in CentOS 7.0 ? Message-ID: Hi, I rebuild CentOS iso target with a customized directory named "Test" in directory "isolinux/" . In the old CentOS 6.x version, i do copy like following command in kickstart is ok: %post --nochroot cp -af /mnt/source/Test /mnt/sysimage/ %end but in CentOS 7.0, the same command is failed :( something what i did is wrong ? Thanks, - Jojo -------------- next part -------------- An HTML attachment was scrubbed... URL: From chavanpushpendra at gmail.com Mon Jul 28 09:16:46 2014 From: chavanpushpendra at gmail.com (Mr. Pushpendra Chavan) Date: Mon, 28 Jul 2014 14:46:46 +0530 Subject: How to copy data from CDROM(iso) to installed system in kickstart in CentOS 7.0 ? In-Reply-To: References: Message-ID: Hello Jojo, I think the DVD iso is not mounted at /mnt/source in CentOS 7 but at /run/install/repo So try out the following script. %post --nochroot cp -af /run/install/repo/Test /mnt/sysimage/ %end Is this working? In case this too not working, you can simply have a workaround as follows. %post --nochroot mkdir /tmp/repo mount /dev/sr0 /mnt/repo cp -af /mnt/repo/Test /mnt/sysimage/ %end On Sun, Jul 27, 2014 at 9:44 AM, jojo wrote: > Hi, > > I rebuild CentOS iso target with a customized directory named "Test" in > directory "isolinux/" . > > In the old CentOS 6.x version, > > i do copy like following command in kickstart is ok: > > %post --nochroot > cp -af /mnt/source/Test /mnt/sysimage/ > %end > > but in CentOS 7.0, > > the same command is failed :( > > something what i did is wrong ? > > Thanks, > > - Jojo > > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list