From stickster at gmail.com Mon Feb 2 00:51:54 2009 From: stickster at gmail.com (Paul W. Frields) Date: Sun, 1 Feb 2009 19:51:54 -0500 Subject: [PATCH] Create new unittest for key.py In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233535914-20779-1-git-send-email-stickster@gmail.com> --- tests/commands/key.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) create mode 100644 tests/commands/key.py diff --git a/tests/commands/key.py b/tests/commands/key.py new file mode 100644 index 0000000..ce34a16 --- /dev/null +++ b/tests/commands/key.py @@ -0,0 +1,40 @@ +# +# Paul W. Frields +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# +import unittest, shlex +import warnings +from tests.baseclass import * + +from pykickstart.errors import * +from pykickstart.commands.key import * + +class F7_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("key 012345abcd", "key 012345abcd\n") + self.assert_parse("key --skip", "key --skip\n") + + # fail - command needs argument + self.assert_parse_error("key", KickstartValueError) + # fail - invalid option w/argument + self.assert_parse_error("key --badflag foobar", KickstartValueError) + +if __name__ == "__main__": + unittest.main() + -- 1.6.0.6 From stickster at gmail.com Mon Feb 2 01:49:56 2009 From: stickster at gmail.com (Paul W. Frields) Date: Sun, 1 Feb 2009 20:49:56 -0500 Subject: [PATCH] Teach driverdisk.py command to reject extra partitions In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233539396-23787-1-git-send-email-stickster@gmail.com> --- pykickstart/commands/driverdisk.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/pykickstart/commands/driverdisk.py b/pykickstart/commands/driverdisk.py index 2423d93..656ec06 100644 --- a/pykickstart/commands/driverdisk.py +++ b/pykickstart/commands/driverdisk.py @@ -74,6 +74,9 @@ class FC3_DriverDisk(KickstartCommand): def parse(self, args): (opts, extra) = self.op.parse_args(args=args) + if len(extra) > 1: + raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one partition may be specified for driverdisk command.")) + if len(extra) == 1 and opts.source: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one of --source and partition may be specified for driverdisk command.")) -- 1.6.0.6 From stickster at gmail.com Mon Feb 2 01:50:08 2009 From: stickster at gmail.com (Paul W. Frields) Date: Sun, 1 Feb 2009 20:50:08 -0500 Subject: [PATCH] Create new unittest for driverdisk.py In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1233539408-23826-1-git-send-email-stickster@gmail.com> --- tests/commands/driverdisk.py | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) create mode 100644 tests/commands/driverdisk.py diff --git a/tests/commands/driverdisk.py b/tests/commands/driverdisk.py new file mode 100644 index 0000000..d90954c --- /dev/null +++ b/tests/commands/driverdisk.py @@ -0,0 +1,46 @@ +# +# Paul W. Frields +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# +import unittest, shlex +import warnings +from tests.baseclass import * + +from pykickstart.errors import * +from pykickstart.commands.driverdisk import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("driverdisk /dev/sdb2", "driverdisk /dev/sdb2\n") + self.assert_parse("driverdisk --source=http://10.0.0.1/disk.img", "driverdisk --source=http://10.0.0.1/disk.img\n") + self.assert_parse("driverdisk /dev/sdb2 --type=vfat", "driverdisk /dev/sdb2 --type=vfat\n") + # pass - need separate tests per fstype? + self.assert_parse("driverdisk /dev/sdb2 --type=ext2", "driverdisk /dev/sdb2 --type=ext2\n") + + # fail - no arguments + self.assert_parse_error("driverdisk", KickstartValueError) + # fail - spurious argument or extra partition + self.assert_parse_error("driverdisk /dev/sdb2 foobar", KickstartValueError) + # fail - specifying both partition and source + self.assert_parse_error("driverdisk /dev/sdb2 --source=http://10.0.0.1/disk.img", KickstartValueError) + +if __name__ == "__main__": + unittest.main() + + -- 1.6.0.6 From piotr.romanus at gmail.com Mon Feb 2 15:11:58 2009 From: piotr.romanus at gmail.com (Piotr Romanus) Date: Mon, 2 Feb 2009 10:11:58 -0500 Subject: 64-bit installation Message-ID: <241464b20902020711t7e9f1cf8j97bae532301a3256@mail.gmail.com> I would like to create 64-bit installation based on Red Hat V5 that is capable of running 32-bit binaries. I wonder what should I put in my package list. Do I have to put both i386 and x86_64 arch rpms? Correct me if I am wrong but it seems to me that the way to create a 64-bit installation is to first install i386 package and than force installation of the same x86_64 package. One more question: Is it possible to pass options (like nodpes) to individual packages when using Anaconda? Any help greatly appreciated Piotr -------------- next part -------------- An HTML attachment was scrubbed... URL: From jos at xos.nl Mon Feb 2 15:18:59 2009 From: jos at xos.nl (Jos Vos) Date: Mon, 2 Feb 2009 16:18:59 +0100 Subject: 64-bit installation In-Reply-To: <241464b20902020711t7e9f1cf8j97bae532301a3256@mail.gmail.com> References: <241464b20902020711t7e9f1cf8j97bae532301a3256@mail.gmail.com> Message-ID: <20090202151859.GA24975@jasmine.xos.nl> On Mon, Feb 02, 2009 at 10:11:58AM -0500, Piotr Romanus wrote: > I would like to create 64-bit installation based on Red Hat V5 that is > capable of running 32-bit binaries. I wonder what should I put in my package > list. Do I have to put both i386 and x86_64 arch rpms? Correct me if I am > wrong but it seems to me that the way to create a 64-bit installation is to > first install i386 package and than force installation of the same x86_64 > package. This is absolutely wrong. It in principle should "just work" if you do a 64-bit installation. RPM has a built-in mechanism of "knowing what's good for you" ;-): 64-bit binaries have a higher precedence than 32-bit binaries. -- -- Jos Vos -- X/OS Experts in Open Systems BV | Phone: +31 20 6938364 -- Amsterdam, The Netherlands | Fax: +31 20 6948204 From jlaska at redhat.com Mon Feb 2 15:43:42 2009 From: jlaska at redhat.com (James Laska) Date: Mon, 2 Feb 2009 10:43:42 -0500 Subject: [PATCH] Add KSOptionParser to all commands ... enables more strick option checking In-Reply-To: <20090129195449.GB30009@localhost.localdomain> References: <20090129195449.GB30009@localhost.localdomain> Message-ID: <1233589422-24292-1-git-send-email-jlaska@redhat.com> --- pykickstart/commands/authconfig.py | 7 +++++++ pykickstart/commands/deviceprobe.py | 9 ++++++++- pykickstart/commands/displaymode.py | 6 ++++++ pykickstart/commands/interactive.py | 8 +++++++- pykickstart/commands/iscsiname.py | 10 ++++++++-- pykickstart/commands/key.py | 12 +++++++++--- pykickstart/commands/lang.py | 11 +++++++++-- pykickstart/commands/lilocheck.py | 8 +++++++- pykickstart/commands/mediacheck.py | 8 +++++++- pykickstart/commands/skipx.py | 8 +++++++- pykickstart/commands/updates.py | 14 +++++++++++--- pykickstart/commands/zerombr.py | 13 +++++++++++-- 12 files changed, 97 insertions(+), 17 deletions(-) diff --git a/pykickstart/commands/authconfig.py b/pykickstart/commands/authconfig.py index 9af9c0f..e3680f3 100644 --- a/pykickstart/commands/authconfig.py +++ b/pykickstart/commands/authconfig.py @@ -18,6 +18,7 @@ # with the express permission of Red Hat, Inc. # from pykickstart.base import * +from pykickstart.options import * class FC3_Authconfig(KickstartCommand): removedKeywords = KickstartCommand.removedKeywords @@ -25,6 +26,7 @@ class FC3_Authconfig(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, *args, **kwargs) + self.op = self._getParser() self.authconfig = kwargs.get("authconfig", "") def __str__(self): @@ -35,6 +37,11 @@ class FC3_Authconfig(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): + (opts, extra) = self.op.parse_args(args=args) self.authconfig = self.currentLine[len(self.currentCmd):].strip() return self diff --git a/pykickstart/commands/deviceprobe.py b/pykickstart/commands/deviceprobe.py index 435ff97..bed2b0e 100644 --- a/pykickstart/commands/deviceprobe.py +++ b/pykickstart/commands/deviceprobe.py @@ -20,6 +20,7 @@ import string from pykickstart.base import * +from pykickstart.options import * class FC3_DeviceProbe(KickstartCommand): removedKeywords = KickstartCommand.removedKeywords @@ -27,6 +28,7 @@ class FC3_DeviceProbe(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.deviceprobe = kwargs.get("deviceprobe", "") def __str__(self): @@ -37,6 +39,11 @@ class FC3_DeviceProbe(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - self.deviceprove = string.join(args) + (opts, extra) = self.op.parse_args(args=args) + self.deviceprove = string.join(extra) return self diff --git a/pykickstart/commands/displaymode.py b/pykickstart/commands/displaymode.py index 24566f0..3446d03 100644 --- a/pykickstart/commands/displaymode.py +++ b/pykickstart/commands/displaymode.py @@ -27,6 +27,7 @@ class FC3_DisplayMode(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.displayMode = kwargs.get("displayMode", None) def __str__(self): @@ -44,7 +45,12 @@ class FC3_DisplayMode(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): + (opts, extra) = self.op.parse_args(args=args) if self.currentCmd == "cmdline": self.displayMode = DISPLAY_MODE_CMDLINE elif self.currentCmd == "graphical": diff --git a/pykickstart/commands/interactive.py b/pykickstart/commands/interactive.py index 422491f..c65570a 100644 --- a/pykickstart/commands/interactive.py +++ b/pykickstart/commands/interactive.py @@ -30,6 +30,7 @@ class FC3_Interactive(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.interactive = kwargs.get("interactive", False) def __str__(self): @@ -40,8 +41,13 @@ class FC3_Interactive(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) > 0: + (opts, extra) = self.op.parse_args(args=args) + if len(extra) > 0: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s does not take any arguments") % "interactive") self.interactive = True diff --git a/pykickstart/commands/iscsiname.py b/pykickstart/commands/iscsiname.py index 8ff9494..e8301bc 100644 --- a/pykickstart/commands/iscsiname.py +++ b/pykickstart/commands/iscsiname.py @@ -31,6 +31,7 @@ class FC6_IscsiName(KickstartCommand): def __init__(self, writePriority=70, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.iscsiname = kwargs.get("iscsiname", "") def __str__(self): @@ -41,8 +42,13 @@ class FC6_IscsiName(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) != 1: + (opts, extra) = self.op.parse_args(args=args) + if len(extra) != 1: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s requires one argument") % "iscsiname") - self.iscsiname = args[0] + self.iscsiname = extra[0] return self diff --git a/pykickstart/commands/key.py b/pykickstart/commands/key.py index 18ab45e..6bc3487 100644 --- a/pykickstart/commands/key.py +++ b/pykickstart/commands/key.py @@ -31,6 +31,7 @@ class F7_Key(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.key = kwargs.get("key", "") def __str__(self): @@ -43,13 +44,18 @@ class F7_Key(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) != 1: + (opts, extra) = self.op.parse_args(args=args) + if len(extra) != 1: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s requires one argument") % "key") - if args[0] == "--skip": + if extra[0] == "--skip": self.key = KS_INSTKEY_SKIP else: - self.key = args[0] + self.key = extra[0] return self diff --git a/pykickstart/commands/lang.py b/pykickstart/commands/lang.py index 1b8e13a..d89a8a2 100644 --- a/pykickstart/commands/lang.py +++ b/pykickstart/commands/lang.py @@ -19,6 +19,7 @@ # from pykickstart.base import * from pykickstart.errors import * +from pykickstart.options import * import gettext _ = lambda x: gettext.ldgettext("pykickstart", x) @@ -29,6 +30,7 @@ class FC3_Lang(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.lang = kwargs.get("lang", "") def __str__(self): @@ -39,11 +41,16 @@ class FC3_Lang(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) != 1: + (opts, extra) = self.op.parse_args(args=args) + if len(extra) != 1: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s requires one argument") % "lang") - self.lang = args[0] + self.lang = extra[0] return self def apply(self, instroot="/"): diff --git a/pykickstart/commands/lilocheck.py b/pykickstart/commands/lilocheck.py index ac1f151..827b509 100644 --- a/pykickstart/commands/lilocheck.py +++ b/pykickstart/commands/lilocheck.py @@ -30,6 +30,7 @@ class FC3_LiloCheck(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.check = kwargs.get("check", False) def __str__(self): @@ -40,8 +41,13 @@ class FC3_LiloCheck(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) > 0: + (opts, extra) = self.op.parse_args(args=args) + if len(extra) > 0: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s does not take any arguments") % "lilocheck") self.check = True diff --git a/pykickstart/commands/mediacheck.py b/pykickstart/commands/mediacheck.py index 2d4de53..aa40e87 100644 --- a/pykickstart/commands/mediacheck.py +++ b/pykickstart/commands/mediacheck.py @@ -30,6 +30,7 @@ class FC4_MediaCheck(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.mediacheck = kwargs.get("mediacheck", False) def __str__(self): @@ -39,8 +40,13 @@ class FC4_MediaCheck(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) > 0: + (opts, extra) = self.op.parse_args(args=args) + if len(extra) > 0: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s does not take any arguments") % "mediacheck") self.mediacheck = True diff --git a/pykickstart/commands/skipx.py b/pykickstart/commands/skipx.py index 5569f32..3ac0966 100644 --- a/pykickstart/commands/skipx.py +++ b/pykickstart/commands/skipx.py @@ -30,6 +30,7 @@ class FC3_SkipX(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.skipx = kwargs.get("skipx", False) def __str__(self): @@ -40,8 +41,13 @@ class FC3_SkipX(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) > 0: + (opts, extra) = self.op.parse_args(args=args) + if len(extra) > 0: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s does not take any arguments") % "skipx") self.skipx = True diff --git a/pykickstart/commands/updates.py b/pykickstart/commands/updates.py index 4139f59..b915c59 100644 --- a/pykickstart/commands/updates.py +++ b/pykickstart/commands/updates.py @@ -19,6 +19,7 @@ # from pykickstart.base import * from pykickstart.errors import * +from pykickstart.options import * import gettext _ = lambda x: gettext.ldgettext("pykickstart", x) @@ -29,6 +30,7 @@ class F7_Updates(KickstartCommand): def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.url = kwargs.get("url", "") def __str__(self): @@ -41,12 +43,18 @@ class F7_Updates(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) > 1: + (opts, extra) = self.op.parse_args(args=args) + + if len(extra) > 1: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s only takes one argument") % "updates") - elif len(args) == 0: + elif len(extra) == 0: self.url = "floppy" else: - self.url = args[0] + self.url = extra[0] return self diff --git a/pykickstart/commands/zerombr.py b/pykickstart/commands/zerombr.py index a97969b..2716777 100644 --- a/pykickstart/commands/zerombr.py +++ b/pykickstart/commands/zerombr.py @@ -31,6 +31,7 @@ class FC3_ZeroMbr(KickstartCommand): def __init__(self, writePriority=110, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() self.zerombr = kwargs.get("zerombr", False) def __str__(self): @@ -41,8 +42,14 @@ class FC3_ZeroMbr(KickstartCommand): return retval + def _getParser(self): + op = KSOptionParser(lineno=self.lineno) + return op + def parse(self, args): - if len(args) > 0: + (opts, extra) = self.op.parse_args(args=args) + + if len(extra) > 0: warnings.warn(_("Ignoring deprecated option on line %s: The zerombr command no longer takes any options. In future releases, this will result in a fatal error from kickstart. Please modify your kickstart file to remove any options.") % self.lineno, DeprecationWarning) self.zerombr = True @@ -53,7 +60,9 @@ class F9_ZeroMbr(FC3_ZeroMbr): removedAttrs = FC3_ZeroMbr.removedAttrs def parse(self, args): - if len(args) > 0: + (opts, extra) = self.op.parse_args(args=args) + + if len(extra) > 0: raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s does not take any arguments") % "zerombr") self.zerombr = True -- 1.6.0.6 From clumens at redhat.com Mon Feb 2 16:07:59 2009 From: clumens at redhat.com (Chris Lumens) Date: Mon, 2 Feb 2009 11:07:59 -0500 Subject: [PATCH] Add KSOptionParser to all commands ... enables more strick option checking In-Reply-To: <1233589422-24292-1-git-send-email-jlaska@redhat.com> References: <20090129195449.GB30009@localhost.localdomain> <1233589422-24292-1-git-send-email-jlaska@redhat.com> Message-ID: <20090202160758.GN30009@localhost.localdomain> > pykickstart/commands/authconfig.py | 7 +++++++ > pykickstart/commands/deviceprobe.py | 9 ++++++++- > pykickstart/commands/displaymode.py | 6 ++++++ > pykickstart/commands/interactive.py | 8 +++++++- > pykickstart/commands/iscsiname.py | 10 ++++++++-- > pykickstart/commands/key.py | 12 +++++++++--- > pykickstart/commands/lang.py | 11 +++++++++-- > pykickstart/commands/lilocheck.py | 8 +++++++- > pykickstart/commands/mediacheck.py | 8 +++++++- > pykickstart/commands/skipx.py | 8 +++++++- > pykickstart/commands/updates.py | 14 +++++++++++--- > pykickstart/commands/zerombr.py | 13 +++++++++++-- > 12 files changed, 97 insertions(+), 17 deletions(-) Applied, minus the authconfig part. Authconfig is truly special. - Chris From clumens at redhat.com Tue Feb 3 18:59:54 2009 From: clumens at redhat.com (Chris Lumens) Date: Tue, 3 Feb 2009 13:59:54 -0500 Subject: [PATCH] Create new unittest for driverdisk.py In-Reply-To: <1233539408-23826-1-git-send-email-stickster@gmail.com> References: <1232731389.3647.308.camel@localhost.localdomain> <1233539408-23826-1-git-send-email-stickster@gmail.com> Message-ID: <20090203185954.GS30009@localhost.localdomain> > tests/commands/driverdisk.py | 46 ++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 46 insertions(+), 0 deletions(-) > create mode 100644 tests/commands/driverdisk.py Applied. Thanks for the test case. - Chris From clumens at redhat.com Tue Feb 3 19:02:09 2009 From: clumens at redhat.com (Chris Lumens) Date: Tue, 3 Feb 2009 14:02:09 -0500 Subject: [PATCH] Teach driverdisk.py command to reject extra partitions In-Reply-To: <1233539396-23787-1-git-send-email-stickster@gmail.com> References: <1232731389.3647.308.camel@localhost.localdomain> <1233539396-23787-1-git-send-email-stickster@gmail.com> Message-ID: <20090203190208.GT30009@localhost.localdomain> > pykickstart/commands/driverdisk.py | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/pykickstart/commands/driverdisk.py b/pykickstart/commands/driverdisk.py > index 2423d93..656ec06 100644 > --- a/pykickstart/commands/driverdisk.py > +++ b/pykickstart/commands/driverdisk.py > @@ -74,6 +74,9 @@ class FC3_DriverDisk(KickstartCommand): > def parse(self, args): > (opts, extra) = self.op.parse_args(args=args) > > + if len(extra) > 1: > + raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one partition may be specified for driverdisk command.")) > + > if len(extra) == 1 and opts.source: > raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one of --source and partition may be specified for driverdisk command.")) > Applied. Thanks for the patch. - Chris From clumens at redhat.com Tue Feb 3 19:14:54 2009 From: clumens at redhat.com (Chris Lumens) Date: Tue, 3 Feb 2009 14:14:54 -0500 Subject: [PATCH] Create new unittest for key.py In-Reply-To: <1233535914-20779-1-git-send-email-stickster@gmail.com> References: <1232731389.3647.308.camel@localhost.localdomain> <1233535914-20779-1-git-send-email-stickster@gmail.com> Message-ID: <20090203191454.GU30009@localhost.localdomain> > tests/commands/key.py | 40 ++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 40 insertions(+), 0 deletions(-) > create mode 100644 tests/commands/key.py Thanks for this test case as well. Committed, and pushing this and everything else I've committed recently. - Chris From piotr.romanus at gmail.com Tue Feb 3 20:15:53 2009 From: piotr.romanus at gmail.com (Piotr Romanus) Date: Tue, 3 Feb 2009 15:15:53 -0500 Subject: 64-bit installation In-Reply-To: <20090202151859.GA24975@jasmine.xos.nl> References: <241464b20902020711t7e9f1cf8j97bae532301a3256@mail.gmail.com> <20090202151859.GA24975@jasmine.xos.nl> Message-ID: <241464b20902031215k38195466pd7b861b99d0d7894@mail.gmail.com> On Mon, Feb 2, 2009 at 10:18 AM, Jos Vos wrote: > > It in principle should "just work" if you do a 64-bit installation. > RPM has a built-in mechanism of "knowing what's good for you" ;-): > 64-bit binaries have a higher precedence than 32-bit binaries. > So my question is how do I install 32-bit libraries? I installed RHEL5.2 (x86_64) on a PC. After the installation this PC has 2 sets of libraries (64-bit and 32-bit): /lib, /lib64, /usr/lib, /usr/lib64 I looked at a single package to see what it contains: $ rpm -ql zlib /usr/lib64/libz.so.1 /usr/lib64/libz.so.1.2.3 /usr/share/doc/zlib-1.2.3 /usr/share/doc/zlib-1.2.3/README /usr/lib/libz.so.1 /usr/lib/libz.so.1.2.3 /usr/share/doc/zlib-1.2.3 /usr/share/doc/zlib-1.2.3/README But this set of files comes from 2 packages: zlib-1.2.3-3.i386.rpm and zlib-1.2.3-3.x86_64.rpm: rpm -qlp zlib-1.2.3-3.x86_64.rpm /usr/lib64/libz.so.1 /usr/lib64/libz.so.1.2.3 /usr/share/doc/zlib-1.2.3 /usr/share/doc/zlib-1.2.3/README $ rpm -qlp zlib-1.2.3-3.i386.rpm /usr/lib/libz.so.1 /usr/lib/libz.so.1.2.3 /usr/share/doc/zlib-1.2.3 /usr/share/doc/zlib-1.2.3/README My question is how to make sure that I have /lib and /usr/lib populated with 32-bit libraries? Do I first install 32-bit version of the package and then 64-bit version? Or do I list both packages on a single rpm line? Or maybe there is some other way? Thanks, Piotr P.S. I also executed the line below: $ rpm -q zlib-1.2.3-3 zlib-1.2.3-3 zlib-1.2.3-3 The output seems to suggest that 2 packages of zlib are installed. Am I right is suspecting that one of them is i386 and the other x86_64? From jos at xos.nl Tue Feb 3 20:24:57 2009 From: jos at xos.nl (Jos Vos) Date: Tue, 3 Feb 2009 21:24:57 +0100 Subject: 64-bit installation In-Reply-To: <241464b20902031215k38195466pd7b861b99d0d7894@mail.gmail.com> References: <241464b20902020711t7e9f1cf8j97bae532301a3256@mail.gmail.com> <20090202151859.GA24975@jasmine.xos.nl> <241464b20902031215k38195466pd7b861b99d0d7894@mail.gmail.com> Message-ID: <20090203202457.GB17549@jasmine.xos.nl> On Tue, Feb 03, 2009 at 03:15:53PM -0500, Piotr Romanus wrote: > I looked at a single package to see what it contains: > > $ rpm -ql zlib > /usr/lib64/libz.so.1 > /usr/lib64/libz.so.1.2.3 > /usr/share/doc/zlib-1.2.3 > /usr/share/doc/zlib-1.2.3/README > /usr/lib/libz.so.1 > /usr/lib/libz.so.1.2.3 > /usr/share/doc/zlib-1.2.3 > /usr/share/doc/zlib-1.2.3/README > > But this set of files comes from 2 packages: zlib-1.2.3-3.i386.rpm and > zlib-1.2.3-3.x86_64.rpm: Yes, you should do "rpm -ql zlib.i386" or "rpm -ql zlib.x86_64" to see the files from one package. > My question is how to make sure that I have /lib and /usr/lib > populated with 32-bit libraries? Do I first install 32-bit version of > the package and then 64-bit version? Or do I list both packages on a > single rpm line? Or maybe there is some other way? List packages like this: rpm -qa --qf '%{name}.%{arch}' and you'll see what's there. Normally on RHEL5, if you install a package, both 32-bit and 64-bit are installed if they exist both. You can always explicitly install one version with "yum install pkg.i386" or "yum install pkg.x86_64". > $ rpm -q zlib-1.2.3-3 > zlib-1.2.3-3 > zlib-1.2.3-3 > > The output seems to suggest that 2 packages of zlib are installed. Am > I right is suspecting that one of them is i386 and the other x86_64? Yes, see above for how to get a better listing. The arch is listed by default on Fedora 9+ (IIRC), but not on RHEL yet. -- -- Jos Vos -- X/OS Experts in Open Systems BV | Phone: +31 20 6938364 -- Amsterdam, The Netherlands | Fax: +31 20 6948204 From philipp.rusch at gw-world.com Thu Feb 5 09:24:36 2009 From: philipp.rusch at gw-world.com (Rusch Philipp pru09) Date: Thu, 5 Feb 2009 10:24:36 +0100 Subject: Partition layout for system recovery Message-ID: Hello all, I have a general question to you. I hope that this is the right list for my question. What do you do if you have changed some LVM configs and you have to restore the whole server with the initial kickstart file where those changes are not listed? Actually I am using the following scenario: Mostly the disk space in our servers vary (attached SAN storage, local disks...). I have a general partition layout with LVM for the /, /tmp and /var filesystem. The application is installed on a separate logical volume. So, if you have to resize the logical volume, you should add the lvol configuration to the initial kickstart file. In a disaster recovery I install the server again with a minimal kickstart file (only the essential packages) and restore the whole filesystem from the tape. The problem is, if you have changed something in the LVM config the restore kickstart file does not contain this information. Does anyone of you had the same problem and how have you solved it? Is there a possibility to automate this process or to get the whole partition and LVM config in a kickstartable layout?! :-) Thanks in advance for your input! rgds -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.ellam at dfs.de Thu Feb 5 16:06:09 2009 From: chris.ellam at dfs.de (chris.ellam at dfs.de) Date: Thu, 5 Feb 2009 17:06:09 +0100 Subject: %include files query for packages. Message-ID: I would like to dynamically generate my include file for the package selection, i.e. this means that it doesnt initially exist and would be generated from my preinstall script. However, it appears that the include file, at least for packages and key, is required to exist prior to the running of the preinstall section. Is there an alternative mechanism for this or a better prefered way of doing this as I many profiles and systems and am trying to use just 1 configuration script which does a Mac address to profile look-up. It also appears that and include of a key file has similar restrictions, well at least in 5.2. Many Thanks, Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- DFS Deutsche Flugsicherung GmbH Am DFS-Campus 10 D - 63225 Langen Tel.: +49-(0)6103-707-0 Sitz der Gesellschaft: Langen/Hessen Zust?ndiges Registergericht: AG Offenbach am Main, HRB 34977 Vorsitzender des Aufsichtsrates: Robert Scholl Gesch?ftsf?hrer: Dieter Kaden (Vors.), Ralph Riedle, Jens Bergmann Internet: http://www.dfs.de Public-Key der DFS: http://www.dfs.de/dfs/public_key.asc From email at jasonkohles.com Thu Feb 5 18:51:10 2009 From: email at jasonkohles.com (Jason Kohles) Date: Thu, 5 Feb 2009 13:51:10 -0500 Subject: %include files query for packages. In-Reply-To: References: Message-ID: On Feb 5, 2009, at 11:06 AM, chris.ellam at dfs.de wrote: > I would like to dynamically generate my include file for the package > selection, i.e. this means that it doesnt initially exist and would > be generated from my preinstall script. However, it appears that the > include file, at least for packages and key, is required to exist > prior to the running of the preinstall section. Is there an > alternative mechanism for this or a better prefered way of doing > this as I many profiles and systems and am trying to use just 1 > configuration script which does a Mac address to profile look-up. > It also appears that and include of a key file has similar > restrictions, well at least in 5.2. > How is it not working? I've used %include to build packages sections before without a problem... I generally do it something like this: # ks.cfg # %include /tmp/packages.txt %pre wget -O /tmp/packages.txt http://install-server/ks/packages.txt # packages.txt # %packages @core @base ... -- Jason Kohles, RHCA RHCDS RHCE email at jasonkohles.com - http://www.jasonkohles.com/ "A witty saying proves nothing." -- Voltaire -------------- next part -------------- An HTML attachment was scrubbed... URL: From joliver at john-oliver.net Fri Feb 6 00:28:04 2009 From: joliver at john-oliver.net (John Oliver) Date: Thu, 5 Feb 2009 16:28:04 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <497751A6.5040404@redhat.com> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <497751A6.5040404@redhat.com> Message-ID: <20090206002804.GA16935@ns.sdsitehosting.net> On Wed, Jan 21, 2009 at 11:47:34AM -0500, Kyle Powell wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > John Oliver wrote: > > Someone has offered to send me a patched image, but... this has been > > known about for 18 months now. In Bugzilla, a fix is promised in 5.2, but > > that never happened, and nobody at Red Hat has updated since. > > > > https://bugzilla.redhat.com/show_bug.cgi?id=239002 > > > > Very frustrating. > > > > Hi John, > > Yes, it did happen. Here's the link to the relevant RHEL 5.2 errata: > http://rhn.redhat.com/errata/RHBA-2008-0397.html > "* do not eject the CD before the %post scripts are run." That's great, but... what good does an RPM do me when this fix needs to be applied to the DVD? I can't install an RPM to a directory structure. I suppose I can try to crack an RPM open on a running machine and copy the resulting files around, but... this is a pretty silly way to distribute this fix. > Can we back up a step? I'd like to help you get fixed up, but your original post > doesn't describe the problem you're having. What happens when you try to install > RHEL 5.2? I need to mount the DVD in %post to copy files off, and I cannot do that when the DVD is ejected before the kickstart gets to %post. -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From debian at herakles.homelinux.org Fri Feb 6 09:34:10 2009 From: debian at herakles.homelinux.org (John Summerfield) Date: Fri, 06 Feb 2009 18:34:10 +0900 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090206002804.GA16935@ns.sdsitehosting.net> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <497751A6.5040404@redhat.com> <20090206002804.GA16935@ns.sdsitehosting.net> Message-ID: <498C0412.9000704@herakles.homelinux.org> John Oliver wrote: > On Wed, Jan 21, 2009 at 11:47:34AM -0500, Kyle Powell wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> John Oliver wrote: >>> Someone has offered to send me a patched image, but... this has been >>> known about for 18 months now. In Bugzilla, a fix is promised in 5.2, but >>> that never happened, and nobody at Red Hat has updated since. >>> >>> https://bugzilla.redhat.com/show_bug.cgi?id=239002 >>> >>> Very frustrating. >>> >> Hi John, >> >> Yes, it did happen. Here's the link to the relevant RHEL 5.2 errata: >> http://rhn.redhat.com/errata/RHBA-2008-0397.html >> "* do not eject the CD before the %post scripts are run." > > That's great, but... what good does an RPM do me when this fix needs to > be applied to the DVD? I can't install an RPM to a directory structure. > > I suppose I can try to crack an RPM open on a running machine and copy > the resulting files around, but... this is a pretty silly way to > distribute this fix. > >> Can we back up a step? I'd like to help you get fixed up, but your original post >> doesn't describe the problem you're having. What happens when you try to install >> RHEL 5.2? > > I need to mount the DVD in %post to copy files off, and I cannot do that > when the DVD is ejected before the kickstart gets to %post. > The fixed package has to come first. Hopefully, any and all future DVDs will incorporate the fix. _I_ would be looking at the changes in the rpm and exploring whether I could apply the updates at boot time by 1. Creating an updates image for floppy (if I had one) or USB (if that works) 2. Remastering the DVD, incorporating this any any other needed fixes. 3. Hacking on the DVD image itself. This might be something I could do to the image, it might be something I could do in a %pre script. As an alternative to all that, I'd look at alternative means such as: 1. Install off USB. 2. Copy preconfigured image off USB. Takes me five minutes to install Windows XP this way, booting systemimager off a USB flash drive, and (since the flash drive is tiny), I copied the image off a lappy disk in a USB enclosure. The image is a little over 6 Gbytes. 3. Copy preconfigured image off the LAN. This takes me about nine minutes doing one install booting the same USB disk. It has the advantage I don't have to wait to remove the USB drives, the systemimager disk is ready as soon as it's taking my orders. Note, the systemimager USB boot disk is created from the CD image. One can add any commands one wishes to autorun[0-9] files in the USB disk's root directory. Since it's rw (as compared with CD), one can configure it from itself. Note, the systemimager image can function as an NFS server, so having set one system up it can be cloned to any others with any kind of network. -- Cheers John -- spambait 1aaaaaaa at coco.merseine.nu Z1aaaaaaa at coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-) From joliver at john-oliver.net Fri Feb 6 18:23:45 2009 From: joliver at john-oliver.net (John Oliver) Date: Fri, 6 Feb 2009 10:23:45 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <496E33A9.9000003@woti.com> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <496E33A9.9000003@woti.com> Message-ID: <20090206182345.GC10756@ns.sdsitehosting.net> On Wed, Jan 14, 2009 at 01:49:13PM -0500, Bryan Schneiders wrote: > I worked around this in the past by modifying usr/lib/anaconda/kickstart.py > in the stage2.img and adding dispatch.skipStep("methodcomplete") to the > list in the setSteps function. Where, exactly, would that line go? Every suggestion I've had for this problem results in a stage2.img that does not work. I can go through the motions of creating a new stage2.img, and so long as I do not change anything, it will work, so I know I'm not screwing that up. But if I change any files, I get stuck with the message: The Red Hat Enterprise Linux Server CD was not found in any of your CDROM drives. Please insert the Red Hat Enterprise Linux Server CD and press OK to retry. That tells me that either there's some very particular way in which the contents of the img need to be modified, or that every suggestion I've found so far has been a guess as to "what might work". So, a very precise description of what *does* work would be greatly appreciated. -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From bschneiders at woti.com Fri Feb 6 19:52:08 2009 From: bschneiders at woti.com (Bryan Schneiders) Date: Fri, 06 Feb 2009 14:52:08 -0500 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090206182345.GC10756@ns.sdsitehosting.net> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <496E33A9.9000003@woti.com> <20090206182345.GC10756@ns.sdsitehosting.net> Message-ID: <498C94E8.8090308@woti.com> Here is everything I have in my notes from last time I did this. I don't remember why I used tar to copy the contents of the stage2.img, but probably because it preserved something that 'cp' didn't. # Do the following to disable the CDROM eject using kickstart: * to make changes to files on the ram filesystem: mkdir /mnt/image mount -o loop /mnt/cdrom/images/stage2.img /mnt/image/ cd /mnt/image tar -cvf ~/stage2.tar . mkdir ~/stage2 cd ~/stage2 tar -xvf ~/stage2.tar vim usr/lib/anaconda/kickstart.py * add this line into the setSteps function dispatch.skipStep("methodcomplete") * to recreate the ram file system: cd ~ mksquashfs stage2/ stage2.img.new cp stage2.img.new ~/dvd/images/stage2.img # Create the custom iso with mkisofs mkisofs -o custom.iso -V "Customized" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T /tmp/cdrom I added the line to kickstart.py on line 880. Here's the surrounding lines for context: ... dispatch.skipStep("bootdisk") dispatch.skipStep("betanag") dispatch.skipStep("installtype") dispatch.skipStep("tasksel") dispatch.skipStep("network") dispatch.skipStep("methodcomplete") # Don't show confirmation screens on non-interactive installs. if not self.ksdata.interactive: dispatch.skipStep("confirminstall") dispatch.skipStep("confirmupgrade") dispatch.skipStep("welcome") ... Also make sure your new CD or DVD includes the .discinfo and .treeinfo files from the root of the original DVD. Bryan Schneiders bschneiders at woti.com 301-562-1900 ext 305 John Oliver wrote: > On Wed, Jan 14, 2009 at 01:49:13PM -0500, Bryan Schneiders wrote: >> I worked around this in the past by modifying usr/lib/anaconda/kickstart.py >> in the stage2.img and adding dispatch.skipStep("methodcomplete") to the >> list in the setSteps function. > > Where, exactly, would that line go? > > Every suggestion I've had for this problem results in a stage2.img that > does not work. > > I can go through the motions of creating a new stage2.img, and so long > as I do not change anything, it will work, so I know I'm not screwing > that up. But if I change any files, I get stuck with the message: > > The Red Hat Enterprise Linux Server CD was not found in any of your > CDROM drives. Please insert the Red Hat Enterprise Linux Server CD and > press OK to retry. > > That tells me that either there's some very particular way in which the > contents of the img need to be modified, or that every suggestion I've > found so far has been a guess as to "what might work". So, a very > precise description of what *does* work would be greatly appreciated. > From joliver at john-oliver.net Fri Feb 6 23:21:21 2009 From: joliver at john-oliver.net (John Oliver) Date: Fri, 6 Feb 2009 15:21:21 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <498C94E8.8090308@woti.com> References: <20090114174046.GA12381@ns.sdsitehosting.net> <20090114180853.GB12824@ns.sdsitehosting.net> <496E33A9.9000003@woti.com> <20090206182345.GC10756@ns.sdsitehosting.net> <498C94E8.8090308@woti.com> Message-ID: <20090206232121.GC18088@ns.sdsitehosting.net> On Fri, Feb 06, 2009 at 02:52:08PM -0500, Bryan Schneiders wrote: > Here is everything I have in my notes from last time I did this. I don't > remember why I used tar to copy the contents of the stage2.img, but > probably because it preserved something that 'cp' didn't. Thanks, Brian. RHEL5.3 is out. I grabbed that DVD, and my kickstart is working (mostly). -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From joliver at john-oliver.net Fri Feb 6 23:23:37 2009 From: joliver at john-oliver.net (John Oliver) Date: Fri, 6 Feb 2009 15:23:37 -0800 Subject: RHEL5.3, kickstart, and timezone Message-ID: <20090206232337.GD18088@ns.sdsitehosting.net> I grabbed RHEL5.3, copied my kickstart over, and ran with it. The install stopped at the timezone. OK, I figured that somebody changed something. I finished the install and looked in /root/anaconda-ks.cfg... and the timezone vaule was the same as what I have. Another bug? Is there a way to get around this? I'm setting to Etc/GMT if it makes any difference... -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From rvandolson at esri.com Fri Feb 6 23:26:58 2009 From: rvandolson at esri.com (Ray Van Dolson) Date: Fri, 6 Feb 2009 15:26:58 -0800 Subject: RHEL5.3, kickstart, and timezone In-Reply-To: <20090206232337.GD18088@ns.sdsitehosting.net> References: <20090206232337.GD18088@ns.sdsitehosting.net> Message-ID: <20090206232658.GA7079@esri.com> On Fri, Feb 06, 2009 at 03:23:37PM -0800, John Oliver wrote: > I grabbed RHEL5.3, copied my kickstart over, and ran with it. The > install stopped at the timezone. OK, I figured that somebody changed > something. I finished the install and looked in > /root/anaconda-ks.cfg... and the timezone vaule was the same as what I > have. > > Another bug? Is there a way to get around this? I'm setting to Etc/GMT > if it makes any difference... Anecdotal, but... using the same KS as 5.2 for our 5.3 installs and haven't run into this issue. Setting to America/Los_Angeles. Ray From bryan.gartner at hp.com Fri Feb 6 23:34:23 2009 From: bryan.gartner at hp.com (Bryan Gartner) Date: Fri, 6 Feb 2009 16:34:23 -0700 Subject: RHEL5.3, kickstart, and timezone In-Reply-To: <20090206232337.GD18088@ns.sdsitehosting.net> References: <20090206232337.GD18088@ns.sdsitehosting.net> Message-ID: <20090206233423.GE28298@postino.fc.hp.com> John, On Fri, Feb 06, 2009 at 11:23:37PM +0000, John Oliver wrote: > I grabbed RHEL5.3, copied my kickstart over, and ran with it. The > install stopped at the timezone. OK, I figured that somebody changed > something. I finished the install and looked in > /root/anaconda-ks.cfg... and the timezone vaule was the same as what I > have. https://bugzilla.redhat.com/show_bug.cgi?id=461526 bryang From gwaugh at frontstreetnetworks.com Sun Feb 8 16:14:15 2009 From: gwaugh at frontstreetnetworks.com (Gerald Waugh) Date: Sun, 8 Feb 2009 10:14:15 -0600 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090206232121.GC18088@ns.sdsitehosting.net> Message-ID: <0588ABE894D74F479AFCF737017A0902@systemax> > I tried to the cdrom eject issue using below, but I can't seem to edit the file in my stage2-image directory below as I get the error that it is a read only file. Note using an ISO BlueOnyx-5.2-20090107 from http://www.blueonyx.it/pub/BlueOnyx/ISO/ I have used this procedure on an old mandrake system and had no problems. # insert install-cd into cdrom mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom mkdir /home/BlueOnyx mkdir /home/BlueOnyx/BlueOnyx-5.2-20090107 cd /mnt/cdrom # move the iso to a rw area tar -c * | tar -C /home/BlueOnyx/BlueOnyx-5.2-20090107 -xf- cd /home/BlueOnyx/BlueOnyx-5.2-20090107 mkdir ../stage2-image mount -o loop -t squashfs images/stage2.img ../stage2-image cd ../stage2-image vi usr/lib/anaconda/kickstart.py Tried to add * add this line into the setSteps function dispatch.skipStep("methodcomplete") * to recreate the ram file system: Get Error about file not writeable. I can't seem to chmod it as writeable. A Confused Gerald From drkludge at cox.net Sun Feb 8 17:27:01 2009 From: drkludge at cox.net (Greg Morgan) Date: Sun, 08 Feb 2009 10:27:01 -0700 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <0588ABE894D74F479AFCF737017A0902@systemax> References: <0588ABE894D74F479AFCF737017A0902@systemax> Message-ID: <498F15E5.1080401@cox.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Gerald Waugh wrote: | I tried to the cdrom eject issue using below, | but I can't seem to edit the file in my stage2-image directory below | as I get the error that it is a read only file. | Note using an ISO BlueOnyx-5.2-20090107 from | http://www.blueonyx.it/pub/BlueOnyx/ISO/ | I have used this procedure on an old mandrake system and had no | problems. | | # insert install-cd into cdrom | mkdir /mnt/cdrom | mount /dev/cdrom /mnt/cdrom | mkdir /home/BlueOnyx | mkdir /home/BlueOnyx/BlueOnyx-5.2-20090107 | cd /mnt/cdrom | # move the iso to a rw area | tar -c * | tar -C /home/BlueOnyx/BlueOnyx-5.2-20090107 -xf- | cd /home/BlueOnyx/BlueOnyx-5.2-20090107 | mkdir ../stage2-image | mount -o loop -t squashfs images/stage2.img ../stage2-image Treat squashfs just like the iso mount as squashfs is a readonly file system just like the iso is. You have to copy the files to a read/write area to edit them. The -w short for -o rw gives no joy to prove out where you are having trouble. You will still get the readonly file system message. ~ mount -o loop -t squashfs -w /mnt/iso/images/install.img /mnt/stage | cd ../stage2-image | vi usr/lib/anaconda/kickstart.py | | Tried to add | * add this line into the setSteps function | dispatch.skipStep("methodcomplete") | * to recreate the ram file system: | | Get Error about file not writeable. I can't seem to chmod it as | writeable. [root at kaa ~]# cd /mnt/stage [root at kaa stage]# mkdir -p /mnt/stage2 [root at kaa stage]# cp -rp * !$ cp -rp * /mnt/stage2 [root at kaa stage]# cd !$ cd /mnt/stage2 [root at kaa stage2]# ls etc firmware lib modules proc usr var [root at kaa stage2]# cd usr/lib/anaconda [root at kaa anaconda]# ls -l kick* - -r--r--r-- 1 root root 47267 2008-11-19 09:24 kickstart.py lrwxrwxrwx 1 root root 9 2009-02-08 10:14 kickstart.pyc -> /dev/null [root at kaa anaconda]# chmod u+w kickstart.py [root at kaa anaconda]# ls -l !$ ls -l kickstart.py - -rw-r--r-- 1 root root 47267 2008-11-19 09:24 kickstart.py [root at kaa anaconda]# vim kickstart.py [root at kaa anaconda]# -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iEYEARECAAYFAkmPFeUACgkQxyxe5L6mr7LQywCfauLRfCc+2YOE2wmmQdrxWep8 oNQAnjeE4datqLtgHSK4whOR/CmysXEZ =NgeL -----END PGP SIGNATURE----- From mgracik at redhat.com Mon Feb 9 16:40:56 2009 From: mgracik at redhat.com (Martin Gracik) Date: Mon, 9 Feb 2009 11:40:56 -0500 (EST) Subject: Fwd: [PATCH] Added rescue.py test case In-Reply-To: <1233935245-6869-1-git-send-email-mgracik@redhat.com> Message-ID: <576690875.319631234197656485.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> ----- Forwarded Message ----- From: "Martin Gracik" To: kickstart-list at redhat.com Cc: "Martin Gracik" Sent: Friday, February 6, 2009 4:47:23 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PATCH] Added rescue.py test case --- tests/commands/rescue.py | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 tests/commands/rescue.py diff --git a/tests/commands/rescue.py b/tests/commands/rescue.py new file mode 100644 index 0000000..50b9e3c --- /dev/null +++ b/tests/commands/rescue.py @@ -0,0 +1,36 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class F10_TestCase(CommandTest): + def runTest(self): + #pass + self.assert_parse("rescue", "rescue\n") + self.assert_parse("rescue --nomount", "rescue --nomount\n") + self.assert_parse("rescue --romount", "rescue --romount\n") + + #fail + self.assert_parse_error("rescue --badflag", KickstartParseError) + self.assert_parse_error("rescue --nomount --romount", KickstartValueError) + +if __name__ == "__main__": + unittest.main() \ No newline at end of file -- 1.6.0.6 From mgracik at redhat.com Mon Feb 9 16:41:04 2009 From: mgracik at redhat.com (Martin Gracik) Date: Mon, 9 Feb 2009 11:41:04 -0500 (EST) Subject: Fwd: [PATCH] Added iscsiname.py test case In-Reply-To: <1233935245-6869-2-git-send-email-mgracik@redhat.com> Message-ID: <730982892.319661234197664216.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> ----- Forwarded Message ----- From: "Martin Gracik" To: kickstart-list at redhat.com Cc: "Martin Gracik" Sent: Friday, February 6, 2009 4:47:24 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PATCH] Added iscsiname.py test case --- tests/commands/iscsiname.py | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) create mode 100644 tests/commands/iscsiname.py diff --git a/tests/commands/iscsiname.py b/tests/commands/iscsiname.py new file mode 100644 index 0000000..204bc57 --- /dev/null +++ b/tests/commands/iscsiname.py @@ -0,0 +1,34 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC6_TestCase(CommandTest): + def runTest(self): + #pass + self.assert_parse("iscsiname foo", "iscsiname foo\n") + + #fail + self.assert_parse_error("iscsiname", KickstartValueError) + self.assert_parse_error("iscsiname foo bar", KickstartValueError) + +if __name__ == "__main__": + unittest.main() \ No newline at end of file -- 1.6.0.6 From mgracik at redhat.com Mon Feb 9 16:41:11 2009 From: mgracik at redhat.com (Martin Gracik) Date: Mon, 9 Feb 2009 11:41:11 -0500 (EST) Subject: Fwd: [PATCH] Added lilocheck.py test case In-Reply-To: <1233935245-6869-3-git-send-email-mgracik@redhat.com> Message-ID: <800597972.319691234197671348.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> ----- Forwarded Message ----- From: "Martin Gracik" To: kickstart-list at redhat.com Cc: "Martin Gracik" Sent: Friday, February 6, 2009 4:47:25 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PATCH] Added lilocheck.py test case --- tests/commands/lilocheck.py | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) create mode 100644 tests/commands/lilocheck.py diff --git a/tests/commands/lilocheck.py b/tests/commands/lilocheck.py new file mode 100644 index 0000000..b835b5b --- /dev/null +++ b/tests/commands/lilocheck.py @@ -0,0 +1,33 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC3_TestCase(CommandTest): + def runTest(self): + #pass + self.assert_parse("lilocheck", "lilocheck\n") + + #fail + self.assert_parse_error("lilocheck foo", KickstartValueError) + +if __name__ == "__main__": + unittest.main() \ No newline at end of file -- 1.6.0.6 From mgracik at redhat.com Mon Feb 9 16:41:18 2009 From: mgracik at redhat.com (Martin Gracik) Date: Mon, 9 Feb 2009 11:41:18 -0500 (EST) Subject: Fwd: [PATCH] Corrected return value of FC6_Iscsi parse method; Added iscsi, ignoredisk, langsupport test cases. In-Reply-To: <1234185426-9975-1-git-send-email-mgracik@redhat.com> Message-ID: <793112870.319721234197678598.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> ----- Forwarded Message ----- From: "Martin Gracik" To: kickstart-list at redhat.com Cc: "Martin Gracik" Sent: Monday, February 9, 2009 2:17:06 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PATCH] Corrected return value of FC6_Iscsi parse method; Added iscsi, ignoredisk, langsupport test cases. --- pykickstart/commands/iscsi.py | 4 +- tests/commands/ignoredisk.py | 58 ++++++++++++++++++++++++++++++++++ tests/commands/iscsi.py | 70 +++++++++++++++++++++++++++++++++++++++++ tests/commands/langsupport.py | 47 +++++++++++++++++++++++++++ 4 files changed, 177 insertions(+), 2 deletions(-) create mode 100644 tests/commands/ignoredisk.py create mode 100644 tests/commands/iscsi.py create mode 100644 tests/commands/langsupport.py diff --git a/pykickstart/commands/iscsi.py b/pykickstart/commands/iscsi.py index 3a451e6..582dfc3 100644 --- a/pykickstart/commands/iscsi.py +++ b/pykickstart/commands/iscsi.py @@ -16,7 +16,7 @@ # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat # trademarks that are incorporated in the source code or documentation are not # subject to the GNU General Public License and may only be used or replicated -# with the express permission of Red Hat, Inc. +# with the express permission of Red Hat, Inc. # from pykickstart.base import * from pykickstart.errors import * @@ -114,7 +114,7 @@ class FC6_Iscsi(KickstartCommand): dd = self.handler.IscsiData() self._setToObj(self.op, opts, dd) - return self + return dd def dataList(self): return self.iscsi diff --git a/tests/commands/ignoredisk.py b/tests/commands/ignoredisk.py new file mode 100644 index 0000000..99bf69f --- /dev/null +++ b/tests/commands/ignoredisk.py @@ -0,0 +1,58 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("ignoredisk --drives=sda", "ignoredisk --drives=sda\n") + self.assert_parse("ignoredisk --drives=sda,sdb", "ignoredisk --drives=sda,sdb\n") + # empty + self.assert_parse("ignoredisk", "") + + # fail + # wrong option name + self.assert_parse_error("ignoredisk --devices=sda", KickstartParseError) + # missing arguments + self.assert_parse_error("ignoredisk --drives", KickstartParseError) + + +class F8_TestCase(FC3_TestCase): + def runTest(self): + # run FC3 test case + FC3_TestCase.runTest(self) + + # pass + self.assert_parse("ignoredisk --only-use=sda", "ignoredisk --only-use=sda\n") + self.assert_parse("ignoredisk --only-use=sda,sdb", "ignoredisk --only-use=sda,sdb\n") + + # ignore --only-use option if also --drives provided + self.assert_parse("ignoredisk --drives=sda --only-use=sdb", "ignoredisk --drives=sda\n") + self.assert_parse("ignoredisk --only-use=sda --drives=sdb", "ignoredisk --drives=sdb\n") + + # fail + # missing arguments + self.assert_parse_error("ignoredisk --only-use", KickstartParseError) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/commands/iscsi.py b/tests/commands/iscsi.py new file mode 100644 index 0000000..6bf312a --- /dev/null +++ b/tests/commands/iscsi.py @@ -0,0 +1,70 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC6_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("iscsi --ipaddr=1.1.1.1", "iscsi --ipaddr=1.1.1.1\n") + self.assert_parse("iscsi --ipaddr=1.1.1.1 --target=tar --port=1234 --user=name --password=secret", + "iscsi --target=tar --ipaddr=1.1.1.1 --port=1234 --user=name --password=secret\n") + self.assert_parse("iscsi --ipaddr=1.1.1.1 --target=tar", "iscsi --target=tar --ipaddr=1.1.1.1\n") + self.assert_parse("iscsi --ipaddr=1.1.1.1 --port=1234", "iscsi --ipaddr=1.1.1.1 --port=1234\n") + self.assert_parse("iscsi --ipaddr=1.1.1.1 --user=name", "iscsi --ipaddr=1.1.1.1 --user=name\n") + self.assert_parse("iscsi --ipaddr=1.1.1.1 --password=secret", "iscsi --ipaddr=1.1.1.1 --password=secret\n") + + # fail + # missing required option --ipaddr + self.assert_parse_error("iscsi", KickstartValueError) + self.assert_parse_error("iscsi --target=tar --user=name --password=secret --port=1234", KickstartValueError) + # missing --ipaddr argument + self.assert_parse_error("iscsi --ipaddr", KickstartParseError) + # unexpected arguments + self.assert_parse_error("iscsi --ipaddr=1.2.3.4 not expected", KickstartValueError) + # unknown flag + self.assert_parse_error("iscsi --ipaddr=1.2.3.4 --unknown=value", KickstartParseError) + # empty arguments + self.assert_parse_error("iscsi --target --ipaddr=1.2.3.4", KickstartParseError) + self.assert_parse_error("iscsi --ipaddr=1.2.3.4 --user", KickstartParseError) + self.assert_parse_error("iscsi --ipaddr=1.2.3.4 --password", KickstartParseError) + self.assert_parse_error("iscsi --ipaddr=1.2.3.4 --port", KickstartParseError) + + +class F10_TestCase(FC6_TestCase): + def runTest(self): + # run FC6 test case + FC6_TestCase.runTest(self) + + # pass + self.assert_parse("iscsi --ipaddr=1.1.1.1 --reverse-user=name --reverse-password=secret", + "iscsi --ipaddr=1.1.1.1 --reverse-user=name --reverse-password=secret\n") + self.assert_parse("iscsi --ipaddr=1.1.1.1 --reverse-user=name", "iscsi --ipaddr=1.1.1.1 --reverse-user=name\n") + self.assert_parse("iscsi --ipaddr=1.1.1.1 --reverse-password=secret", "iscsi --ipaddr=1.1.1.1 --reverse-password=secret\n") + + # fail + # empty arguments + self.assert_parse_error("iscsi --ipaddr=1.1.1.1 --reverse-user", KickstartParseError) + self.assert_parse_error("iscsi --ipaddr=1.1.1.1 --reverse-password", KickstartParseError) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/commands/langsupport.py b/tests/commands/langsupport.py new file mode 100644 index 0000000..eaebea3 --- /dev/null +++ b/tests/commands/langsupport.py @@ -0,0 +1,47 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("langsupport --default=sk_SK.UTF-8", "langsupport --default=sk_SK.UTF-8\n") + self.assert_parse("langsupport", "langsupport --default=en_US.UTF-8\n") + self.assert_parse("langsupport --default=sk_SK.UTF-8 en_US cs_CZ", "langsupport --default=sk_SK.UTF-8 en_US cs_CZ\n") + self.assert_parse("langsupport en_US cs_CZ", "langsupport --default=en_US.UTF-8 en_US cs_CZ\n") + + # fail + # wrong option name + self.assert_parse_error("langsupport --locale=en_US", KickstartParseError) + # missing --default argument + self.assert_parse_error("langsupport --default", KickstartParseError) + + +class FC5_TestCase(FC3_TestCase): + def runTest(self): + # pass + # deprecated command + pass + + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From mgracik at redhat.com Mon Feb 9 16:41:24 2009 From: mgracik at redhat.com (Martin Gracik) Date: Mon, 9 Feb 2009 11:41:24 -0500 (EST) Subject: Fwd: [PATCH] Added method test case; Corrected newline char in return value of FC6_Method. In-Reply-To: <1234188742-10781-1-git-send-email-mgracik@redhat.com> Message-ID: <401858286.319751234197684681.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> ----- Forwarded Message ----- From: "Martin Gracik" To: kickstart-list at redhat.com Cc: "Martin Gracik" Sent: Monday, February 9, 2009 3:12:22 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PATCH] Added method test case; Corrected newline char in return value of FC6_Method. When using nfs command without the --opts, the FC6_Method.__str__() didn't append the "\n" character to the end of the string. --- pykickstart/commands/method.py | 5 +- tests/commands/method.py | 88 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 tests/commands/method.py diff --git a/pykickstart/commands/method.py b/pykickstart/commands/method.py index 025dd4b..9d6558c 100644 --- a/pykickstart/commands/method.py +++ b/pykickstart/commands/method.py @@ -15,7 +15,7 @@ # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat # trademarks that are incorporated in the source code or documentation are not # subject to the GNU General Public License and may only be used or replicated -# with the express permission of Red Hat, Inc. +# with the express permission of Red Hat, Inc. # from pykickstart.base import * from pykickstart.errors import * @@ -115,7 +115,8 @@ class FC6_Method(FC3_Method): elif self.method == "nfs": retval += "# Use NFS installation media\nnfs --server=%s --dir=%s" % (self.server, self.dir) if self.opts is not None: - retval += " --opts=\"%s\"\n" % self.opts + retval += " --opts=\"%s\"" % self.opts + retval += "\n" elif self.method == "url": retval += "# Use network installation\nurl --url=%s\n" % self.url diff --git a/tests/commands/method.py b/tests/commands/method.py new file mode 100644 index 0000000..1c17630 --- /dev/null +++ b/tests/commands/method.py @@ -0,0 +1,88 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + # cdrom + self.assert_parse("cdrom", "cdrom\n") + + # harddrive + self.assert_parse("harddrive --dir=/install --biospart=part", "harddrive --dir=/install --biospart=part\n") + self.assert_parse("harddrive --dir=/install --partition=part", "harddrive --dir=/install --partition=part\n") + + # nfs + self.assert_parse("nfs --server=1.2.3.4 --dir=/install", "nfs --server=1.2.3.4 --dir=/install\n") + + # url + self.assert_parse("url --url=http://domain.com", "url --url=http://domain.com\n") + + # fail + # harddrive + # required option --dir missing + self.assert_parse_error("harddrive", KickstartValueError) + # required --dir argument missing + self.assert_parse_error("harddrive --dir", KickstartParseError) + # missing --biospart or --partition option + self.assert_parse_error("harddrive --dir=/install", KickstartValueError) + # both --biospart and --partition specified + self.assert_parse_error("harddrive --dir=/install --biospart=bios --partition=part", KickstartValueError) + # --biospart and --partition require argument + self.assert_parse_error("harddrive --dir=/install --biospart", KickstartParseError) + self.assert_parse_error("harddrive --dir=/install --partition", KickstartParseError) + # unknown option + self.assert_parse_error("harddrive --unknown=value", KickstartParseError) + + # nfs + # missing required options --server and --dir + self.assert_parse_error("nfs", KickstartValueError) + self.assert_parse_error("nfs --server=1.2.3.4", KickstartValueError) + self.assert_parse_error("nfs --server", KickstartParseError) + self.assert_parse_error("nfs --dir=/install", KickstartValueError) + self.assert_parse_error("nfs --dir", KickstartParseError) + # unknown option + self.assert_parse_error("nfs --unknown=value", KickstartParseError) + + # url + # missing required option --url + self.assert_parse_error("url", KickstartValueError) + self.assert_parse_error("url --url", KickstartParseError) + + +class FC6_TestCase(FC3_TestCase): + def runTest(self): + # run FC3 test case + FC3_TestCase.runTest(self) + + # pass + # nfs + self.assert_parse("nfs --server=1.2.3.4 --dir=/install --opts=options", "nfs --server=1.2.3.4 --dir=/install --opts=\"options\"\n") + + # fail + # nfs + # --opts requires argument if specified + self.assert_parse_error("nfs --server=1.2.3.4 --dir=/install --opts", KickstartParseError) + + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From mgracik at redhat.com Mon Feb 9 16:41:29 2009 From: mgracik at redhat.com (Martin Gracik) Date: Mon, 9 Feb 2009 11:41:29 -0500 (EST) Subject: Fwd: [PATCH] Added mouse test case. Edited command mouse.py to raise KickstartValueError instead of IndexError when no argument given. In-Reply-To: <1234190766-11312-1-git-send-email-mgracik@redhat.com> Message-ID: <154196448.319781234197689758.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> ----- Forwarded Message ----- From: "Martin Gracik" To: kickstart-list at redhat.com Cc: "Martin Gracik" Sent: Monday, February 9, 2009 3:46:06 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PATCH] Added mouse test case. Edited command mouse.py to raise KickstartValueError instead of IndexError when no argument given. --- pykickstart/commands/mouse.py | 10 ++++++- tests/commands/mouse.py | 49 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 tests/commands/mouse.py diff --git a/pykickstart/commands/mouse.py b/pykickstart/commands/mouse.py index 27e248f..b1c3255 100644 --- a/pykickstart/commands/mouse.py +++ b/pykickstart/commands/mouse.py @@ -15,11 +15,15 @@ # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat # trademarks that are incorporated in the source code or documentation are not # subject to the GNU General Public License and may only be used or replicated -# with the express permission of Red Hat, Inc. +# with the express permission of Red Hat, Inc. # from pykickstart.base import * +from pykickstart.errors import * from pykickstart.options import * +import gettext +_ = lambda x: gettext.ldgettext("pykickstart", x) + class RHEL3_Mouse(KickstartCommand): removedKeywords = KickstartCommand.removedKeywords removedAttrs = KickstartCommand.removedAttrs @@ -39,7 +43,7 @@ class RHEL3_Mouse(KickstartCommand): if self.device: opts += "--device=%s " % self.device if self.emulthree: - opts += "--emulthree " + opts += "--emulthree " if self.mouse: retval += "# System mouse\nmouse %s%s\n" % (opts, self.mouse) @@ -54,6 +58,8 @@ class RHEL3_Mouse(KickstartCommand): def parse(self, args): (opts, extra) = self.op.parse_args(args=args) self._setToSelf(self.op, opts) + if len(extra) < 1: + raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Mouse command requires an argument.")) self.mouse = extra[0] return self diff --git a/tests/commands/mouse.py b/tests/commands/mouse.py new file mode 100644 index 0000000..9c0a9c5 --- /dev/null +++ b/tests/commands/mouse.py @@ -0,0 +1,49 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class RHEL3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("mouse jerry", "mouse jerry\n") + self.assert_parse("mouse --device=/dev/mice --emulthree jerry", "mouse --device=/dev/mice --emulthree jerry\n") + self.assert_parse("mouse jerry --device=/dev/mice", "mouse --device=/dev/mice jerry\n") + self.assert_parse("mouse jerry --emulthree", "mouse --emulthree jerry\n") + + # fail + # empty + self.assert_parse_error("mouse", KickstartValueError) + # unknown option + self.assert_parse_error("mouse jerry --bad-flag", KickstartParseError) + # --device requires argument + self.assert_parse_error("mouse jerry --device", KickstartParseError) + + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + # deprecated command + pass + + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From mgracik at redhat.com Mon Feb 9 16:41:36 2009 From: mgracik at redhat.com (Martin Gracik) Date: Mon, 9 Feb 2009 11:41:36 -0500 (EST) Subject: Fwd: [PATCH] Added reboot, upgrade, user, zerombr test cases. In-Reply-To: <1234196691-12789-1-git-send-email-mgracik@redhat.com> Message-ID: <530948441.319811234197696358.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> ----- Forwarded Message ----- From: "Martin Gracik" To: kickstart-list at redhat.com Cc: "Martin Gracik" Sent: Monday, February 9, 2009 5:24:51 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PATCH] Added reboot, upgrade, user, zerombr test cases. --- tests/commands/reboot.py | 43 +++++++++++++++++++++++++++++ tests/commands/upgrade.py | 52 +++++++++++++++++++++++++++++++++++ tests/commands/user.py | 66 +++++++++++++++++++++++++++++++++++++++++++++ tests/commands/zerombr.py | 46 +++++++++++++++++++++++++++++++ 4 files changed, 207 insertions(+), 0 deletions(-) create mode 100644 tests/commands/reboot.py create mode 100644 tests/commands/upgrade.py create mode 100644 tests/commands/user.py create mode 100644 tests/commands/zerombr.py diff --git a/tests/commands/reboot.py b/tests/commands/reboot.py new file mode 100644 index 0000000..258a7bf --- /dev/null +++ b/tests/commands/reboot.py @@ -0,0 +1,43 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("reboot", "reboot\n") + self.assert_parse("shutdown", "shutdown\n") + + # fail + + +class FC6_TestCase(FC3_TestCase): + def runTest(self): + # pass + self.assert_parse("reboot --eject", "reboot --eject\n") + self.assert_parse("shutdown --eject", "shutdown --eject\n") + + # fail + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/commands/upgrade.py b/tests/commands/upgrade.py new file mode 100644 index 0000000..dd7e878 --- /dev/null +++ b/tests/commands/upgrade.py @@ -0,0 +1,52 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("upgrade", "upgrade\n") + self.assert_parse("install", "install\n") + + # fail + self.assert_parse_error("upgrade install", KickstartValueError) + self.assert_parse_error("upgrade --bad-flag", KickstartValueError) + self.assert_parse_error("install --bad-flag", KickstartValueError) + + +class F11_TestCase(FC3_TestCase): + def runTest(self): + # pass + self.assert_parse("upgrade", "upgrade\n") + self.assert_parse("install", "install\n") + self.assert_parse("upgrade --root-device=/dev/sda", "upgrade --root-device=/dev/sda\n") + self.assert_parse("install --root-device=/dev/sda", "install\n") + + # fail + # --root-device requires argument + self.assert_parse_error("upgrade --root-device", KickstartParseError) + # unknown option + self.assert_parse_error("upgrade --bad-flag", KickstartParseError) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/commands/user.py b/tests/commands/user.py new file mode 100644 index 0000000..9f1a74d --- /dev/null +++ b/tests/commands/user.py @@ -0,0 +1,66 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC6_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("user --name=user", "user --name=user\n") + self.assert_parse("user --name=user --groups=grp1,grp2 --homedir=/home/user --shell=/bin/bash --uid=1000 --password=secret --iscrypted", + "user --groups=grp1,grp2 --homedir=/home/user --name=user --password=secret --iscrypted --shell=/bin/bash --uid=1000\n") + self.assert_parse("user --name=user --groups=grp1", "user --groups=grp1 --name=user\n") + self.assert_parse("user --name=user --homedir=/home/user --shell=/bin/bash", "user --homedir=/home/user --name=user --shell=/bin/bash\n") + self.assert_parse("user --name=user --password=secret", "user --name=user --password=secret\n") + self.assert_parse("user --name=user --uid=1000", "user --name=user --uid=1000\n") + + # fail + # missing required option --name + self.assert_parse_error("user", KickstartValueError) + # --name requires an argument + self.assert_parse_error("user --name", KickstartParseError) + # --uid requires int argument + self.assert_parse_error("user --name=user --uid=id", KickstartParseError) + # unknown option + self.assert_parse_error("user --name=user --unknown=value", KickstartParseError) + # required option arguments + self.assert_parse_error("user --name=user --groups", KickstartParseError) + self.assert_parse_error("user --name=user --homedir", KickstartParseError) + self.assert_parse_error("user --name=user --shell", KickstartParseError) + self.assert_parse_error("user --name=user --uid", KickstartParseError) + self.assert_parse_error("user --name=user --password", KickstartParseError) + + +class F8_TestCase(FC6_TestCase): + def runTest(self): + # run FC6 test case + FC6_TestCase.runTest(self) + + # pass + self.assert_parse("user --name=user --lock --plaintext", "user --name=user --lock\n") + self.assert_parse("user --name=user --lock", "user --name=user --lock\n") + self.assert_parse("user --name=user --plaintext", "user --name=user\n") + + # fail + + +if __name__ == "__main__": + unittest.main() \ No newline at end of file diff --git a/tests/commands/zerombr.py b/tests/commands/zerombr.py new file mode 100644 index 0000000..8a31436 --- /dev/null +++ b/tests/commands/zerombr.py @@ -0,0 +1,46 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("zerombr", "zerombr\n") + # ignoring arguments + self.assert_parse("zerombr arg", "zerombr\n") + + # fail + + +class F9_TestCase(FC3_TestCase): + def runTest(self): + # pass + self.assert_parse("zerombr", "zerombr\n") + + # fail + # zerombr does not take any arguments + self.assert_parse_error("zerombr arg", KickstartParseError) + self.assert_parse_error("zerombr --bad-flag", KickstartParseError) + + +if __name__ == "__main__": + unittest.main() -- 1.6.0.6 From joliver at john-oliver.net Mon Feb 9 16:54:05 2009 From: joliver at john-oliver.net (John Oliver) Date: Mon, 9 Feb 2009 08:54:05 -0800 Subject: RHEL5.3, kickstart, and timezone In-Reply-To: <20090206233423.GE28298@postino.fc.hp.com> References: <20090206232337.GD18088@ns.sdsitehosting.net> <20090206233423.GE28298@postino.fc.hp.com> Message-ID: <20090209165405.GA466@ns.sdsitehosting.net> On Fri, Feb 06, 2009 at 04:34:23PM -0700, Bryan Gartner wrote: > John, > > On Fri, Feb 06, 2009 at 11:23:37PM +0000, John Oliver wrote: > > I grabbed RHEL5.3, copied my kickstart over, and ran with it. The > > install stopped at the timezone. OK, I figured that somebody changed > > something. I finished the install and looked in > > /root/anaconda-ks.cfg... and the timezone vaule was the same as what I > > have. > > https://bugzilla.redhat.com/show_bug.cgi?id=461526 Thanks, Bryan. Frickin' anaconda... if it isn't one thing, it's another. At least this should be easier to work around than the eject before %post bug... -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From gwaugh at frontstreetnetworks.com Mon Feb 9 17:03:34 2009 From: gwaugh at frontstreetnetworks.com (Gerald Waugh) Date: Mon, 9 Feb 2009 11:03:34 -0600 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <498C94E8.8090308@woti.com> Message-ID: Hi, I have tried several things. Including changing usr/lib/anaconda/kickstart.py > > * add this line into the setSteps function > dispatch.skipStep("methodcomplete") and changing usr/lib/anaconda/dispatch.py > ("methodcomplete", doMethodComplete, ), > ("dopostaction", doPostAction, ), >> > for >> > ("dopostaction", doPostAction, ), > ("methodcomplete", doMethodComplete, ), - But always get "CentOS CD not found error" Gerald > -----Original Message----- > From: kickstart-list-bounces at redhat.com > [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Bryan > Schneiders > Sent: Friday, February 06, 2009 1:52 PM > To: Discussion list about Kickstart > Subject: Re: RHEL5 - copy files from DVD during %post > > > Here is everything I have in my notes from last time I did > this. I don't remember why I used tar to copy the contents > of the stage2.img, but probably because it preserved > something that 'cp' didn't. > > > # Do the following to disable the CDROM eject using kickstart: > > * to make changes to files on the ram filesystem: > > mkdir /mnt/image > mount -o loop /mnt/cdrom/images/stage2.img /mnt/image/ > cd /mnt/image > tar -cvf ~/stage2.tar . > mkdir ~/stage2 > cd ~/stage2 > tar -xvf ~/stage2.tar > vim usr/lib/anaconda/kickstart.py > > * add this line into the setSteps function > dispatch.skipStep("methodcomplete") > * to recreate the ram file system: > > cd ~ > mksquashfs stage2/ stage2.img.new > cp stage2.img.new ~/dvd/images/stage2.img > > # Create the custom iso with mkisofs > mkisofs -o custom.iso -V "Customized" -b > isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot > -boot-load-size 4 -boot-info-table -R -J -v -T /tmp/cdrom > > > > I added the line to kickstart.py on line 880. Here's the > surrounding lines for context: > ... > dispatch.skipStep("bootdisk") > dispatch.skipStep("betanag") > dispatch.skipStep("installtype") > dispatch.skipStep("tasksel") > dispatch.skipStep("network") > dispatch.skipStep("methodcomplete") > > # Don't show confirmation screens on non-interactive installs. > if not self.ksdata.interactive: > dispatch.skipStep("confirminstall") > dispatch.skipStep("confirmupgrade") > dispatch.skipStep("welcome") > ... > > > Also make sure your new CD or DVD includes the .discinfo and > .treeinfo files from the root of the original DVD. > > Bryan Schneiders > bschneiders at woti.com > 301-562-1900 ext 305 > > > John Oliver wrote: > > On Wed, Jan 14, 2009 at 01:49:13PM -0500, Bryan Schneiders wrote: > >> I worked around this in the past by modifying > usr/lib/anaconda/kickstart.py > >> in the stage2.img and adding > dispatch.skipStep("methodcomplete") to the > >> list in the setSteps function. > > > > Where, exactly, would that line go? > > > > Every suggestion I've had for this problem results in a > stage2.img that > > does not work. > > > > I can go through the motions of creating a new stage2.img, > and so long > > as I do not change anything, it will work, so I know I'm > not screwing > > that up. But if I change any files, I get stuck with the message: > > > > The Red Hat Enterprise Linux Server CD was not found in any of your > > CDROM drives. Please insert the Red Hat Enterprise Linux > Server CD and > > press OK to retry. > > > > That tells me that either there's some very particular way > in which the > > contents of the img need to be modified, or that every > suggestion I've > > found so far has been a guess as to "what might work". So, a very > > precise description of what *does* work would be greatly > appreciated. > > > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > From clumens at redhat.com Mon Feb 9 18:08:32 2009 From: clumens at redhat.com (Chris Lumens) Date: Mon, 9 Feb 2009 13:08:32 -0500 Subject: Fwd: [PATCH] Added iscsiname.py test case In-Reply-To: <730982892.319661234197664216.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> References: <1233935245-6869-2-git-send-email-mgracik@redhat.com> <730982892.319661234197664216.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <20090209180832.GP30009@localhost.localdomain> > +class FC6_TestCase(CommandTest): > + def runTest(self): > + #pass > + self.assert_parse("iscsiname foo", "iscsiname foo\n") > + > + #fail > + self.assert_parse_error("iscsiname", KickstartValueError) > + self.assert_parse_error("iscsiname foo bar", KickstartValueError) > + > +if __name__ == "__main__": > + unittest.main() I added another assert_parse_error for "iscsiname --whatever", just to make sure that works as expected too. Otherwise, applied. Thanks. - Chris From clumens at redhat.com Mon Feb 9 18:13:41 2009 From: clumens at redhat.com (Chris Lumens) Date: Mon, 9 Feb 2009 13:13:41 -0500 Subject: Fwd: [PATCH] Added lilocheck.py test case In-Reply-To: <800597972.319691234197671348.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> References: <1233935245-6869-3-git-send-email-mgracik@redhat.com> <800597972.319691234197671348.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <20090209181340.GQ30009@localhost.localdomain> > tests/commands/lilocheck.py | 33 +++++++++++++++++++++++++++++++++ > 1 files changed, 33 insertions(+), 0 deletions(-) > create mode 100644 tests/commands/lilocheck.py Applied this one as well, plus the extra test mentioned in the last commit. Thanks. - Chris From clumens at redhat.com Mon Feb 9 18:44:31 2009 From: clumens at redhat.com (Chris Lumens) Date: Mon, 9 Feb 2009 13:44:31 -0500 Subject: Fwd: [PATCH] Corrected return value of FC6_Iscsi parse method; Added iscsi, ignoredisk, langsupport test cases. In-Reply-To: <793112870.319721234197678598.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> References: <1234185426-9975-1-git-send-email-mgracik@redhat.com> <793112870.319721234197678598.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <20090209184431.GR30009@localhost.localdomain> > +class FC3_TestCase(CommandTest): > + def runTest(self): > + # pass > + self.assert_parse("ignoredisk --drives=sda", "ignoredisk --drives=sda\n") > + self.assert_parse("ignoredisk --drives=sda,sdb", "ignoredisk --drives=sda,sdb\n") > + # empty > + self.assert_parse("ignoredisk", "") I'm going to make --drives required for FC3 but not F8, so I'll change this to be a failing test. > +class FC5_TestCase(FC3_TestCase): > + def runTest(self): > + # pass > + # deprecated command > + pass This shouldn't be necessary here. Eventually, we need to have tests for the parser that'll check that commands were removed or deprecated. However for now, this isn't the level to be adding these sorts of checks. Other than that, looks fine. I'll make the modifications I outlined above and commit. Thanks. - Chris From clumens at redhat.com Mon Feb 9 19:09:23 2009 From: clumens at redhat.com (Chris Lumens) Date: Mon, 9 Feb 2009 14:09:23 -0500 Subject: Fwd: [PATCH] Added mouse test case. Edited command mouse.py to raise KickstartValueError instead of IndexError when no argument given. In-Reply-To: <154196448.319781234197689758.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> References: <1234190766-11312-1-git-send-email-mgracik@redhat.com> <154196448.319781234197689758.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <20090209190923.GS30009@localhost.localdomain> > pykickstart/commands/mouse.py | 10 ++++++- > tests/commands/mouse.py | 49 +++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 57 insertions(+), 2 deletions(-) > create mode 100644 tests/commands/mouse.py Applied this one too. Thanks. - Chris From clumens at redhat.com Mon Feb 9 19:23:26 2009 From: clumens at redhat.com (Chris Lumens) Date: Mon, 9 Feb 2009 14:23:26 -0500 Subject: Fwd: [PATCH] Added reboot, upgrade, user, zerombr test cases. In-Reply-To: <530948441.319811234197696358.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> References: <1234196691-12789-1-git-send-email-mgracik@redhat.com> <530948441.319811234197696358.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <20090209192326.GT30009@localhost.localdomain> > +class FC3_TestCase(CommandTest): > + def runTest(self): > + # pass > + self.assert_parse("reboot", "reboot\n") > + self.assert_parse("shutdown", "shutdown\n") > + > + # fail > + > + > +class FC6_TestCase(FC3_TestCase): > + def runTest(self): > + # pass > + self.assert_parse("reboot --eject", "reboot --eject\n") > + self.assert_parse("shutdown --eject", "shutdown --eject\n") > + > + # fail > + > + This one can also be called as halt or poweroff, so we should definitely make sure to handle those cases too. I've applied all the rest. - Chris From debian at herakles.homelinux.org Tue Feb 10 12:59:38 2009 From: debian at herakles.homelinux.org (John Summerfield) Date: Tue, 10 Feb 2009 21:59:38 +0900 Subject: Fwd: [PATCH] Added rescue.py test case In-Reply-To: <576690875.319631234197656485.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> References: <576690875.319631234197656485.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <49917A3A.8040800@herakles.homelinux.org> Martin Gracik wrote: > ----- Forwarded Message ----- > From: "Martin Gracik" > To: kickstart-list at redhat.com > Cc: "Martin Gracik" > Sent: Friday, February 6, 2009 4:47:23 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna > Subject: [PATCH] Added rescue.py test case > > --- > tests/commands/rescue.py | 36 ++++++++++++++++++++++++++++++++++++ > 1 files changed, 36 insertions(+), 0 deletions(-) > create mode 100644 tests/commands/rescue.py > > diff --git a/tests/commands/rescue.py b/tests/commands/rescue.py Isn't this Anaconda stuff? As I understand it, ks is a _process_ implemented in Anaconda, a software product. -- Cheers John -- spambait 1aaaaaaa at coco.merseine.nu Z1aaaaaaa at coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-) From jlaska at redhat.com Tue Feb 10 13:50:43 2009 From: jlaska at redhat.com (James Laska) Date: Tue, 10 Feb 2009 08:50:43 -0500 Subject: Fwd: [PATCH] Added rescue.py test case In-Reply-To: <49917A3A.8040800@herakles.homelinux.org> References: <576690875.319631234197656485.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <49917A3A.8040800@herakles.homelinux.org> Message-ID: <1234273843.5130.1.camel@localhost.localdomain> On Tue, 2009-02-10 at 21:59 +0900, John Summerfield wrote: > Isn't this Anaconda stuff? > > As I understand it, ks is a _process_ implemented in Anaconda, a > software product. Hey John, It is and it isn't. Pykickstart is a library used by anaconda and other tools to read+write kickstart files. I've tried to explain the process a bit in the links below ... but let me know if something is unclear. http://jlaska.livejournal.com/4383.html http://jlaska.livejournal.com/4931.html Thanks, James -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From gwaugh at frontstreetnetworks.com Tue Feb 10 14:31:23 2009 From: gwaugh at frontstreetnetworks.com (Gerald Waugh) Date: Tue, 10 Feb 2009 08:31:23 -0600 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: Message-ID: Gerald Waugh wrote; February 09, 2009 11:04 AM Excuse me, for answering my own post... I managed to fix the cdrom eject issue. Using unsquashfs worked, and the CD worked OK after editing. Previously we tried 'cp -rp' and 'tar' the stage2.img to an rw directory. But always got the "can't find cd' issue. We used; changing usr/lib/anaconda/dispatch.py reversing these lines. ("methodcomplete", doMethodComplete, ), ("dopostaction", doPostAction, ), Gerald From mgracik at redhat.com Tue Feb 10 15:39:38 2009 From: mgracik at redhat.com (Martin Gracik) Date: Tue, 10 Feb 2009 16:39:38 +0100 Subject: [PATCH] Added firewall, partition, repo tests; Made minor changes to firewall, partition, repo commands. In-Reply-To: <1232731389.3647.308.camel@localhost.localdomain> References: <1232731389.3647.308.camel@localhost.localdomain> Message-ID: <1234280378-32462-1-git-send-email-mgracik@redhat.com> Added checking of unexpected arguments, and raising a KickstartValueError, if they are given. Also edited some output strings formatting, to ensure there are no double spaces, if some of the values are missing. --- pykickstart/commands/firewall.py | 29 ++++++--- pykickstart/commands/partition.py | 2 +- pykickstart/commands/repo.py | 6 ++- tests/commands/firewall.py | 98 +++++++++++++++++++++++++++++ tests/commands/partition.py | 124 +++++++++++++++++++++++++++++++++++++ tests/commands/repo.py | 88 ++++++++++++++++++++++++++ 6 files changed, 335 insertions(+), 12 deletions(-) create mode 100644 tests/commands/firewall.py create mode 100644 tests/commands/partition.py create mode 100644 tests/commands/repo.py diff --git a/pykickstart/commands/firewall.py b/pykickstart/commands/firewall.py index 8a968c6..9a26a8a 100644 --- a/pykickstart/commands/firewall.py +++ b/pykickstart/commands/firewall.py @@ -20,8 +20,12 @@ import string from pykickstart.base import * +from pykickstart.errors import * from pykickstart.options import * +import gettext +_ = lambda x: gettext.ldgettext("pykickstart", x) + class FC3_Firewall(KickstartCommand): removedKeywords = KickstartCommand.removedKeywords removedAttrs = KickstartCommand.removedAttrs @@ -38,7 +42,7 @@ class FC3_Firewall(KickstartCommand): extra = [] filteredPorts = [] - retval = BaseData.__str__(self) + retval = KickstartCommand.__str__(self) if self.enabled is None: return retval @@ -49,35 +53,35 @@ class FC3_Firewall(KickstartCommand): # out into their own list leaving what we expect. for port in self.ports: if port == "ssh": - extra.append("--ssh") + extra.append(" --ssh") elif port == "telnet": - extra.append("--telnet") + extra.append(" --telnet") elif port == "smtp": - extra.append("--smtp") + extra.append(" --smtp") elif port == "http": - extra.append("--http") + extra.append(" --http") elif port == "ftp": - extra.append("--ftp") + extra.append(" --ftp") else: filteredPorts.append(port) # All the port:proto strings go into a comma-separated list. portstr = string.join (filteredPorts, ",") if len(portstr) > 0: - portstr = "--port=" + portstr + portstr = " --port=" + portstr else: portstr = "" - extrastr = string.join (extra, " ") + extrastr = string.join (extra, "") truststr = string.join (self.trusts, ",") if len(truststr) > 0: - truststr = "--trust=" + truststr + truststr = " --trust=" + truststr # The output port list consists only of port:proto for # everything that we don't recognize, and special options for # those that we do. - retval += "# Firewall configuration\nfirewall --enabled %s %s %s\n" % (extrastr, portstr, truststr) + retval += "# Firewall configuration\nfirewall --enabled%s%s%s\n" % (extrastr, portstr, truststr) else: retval += "# Firewall configuration\nfirewall --disabled\n" @@ -110,6 +114,11 @@ class FC3_Firewall(KickstartCommand): def parse(self, args): (opts, extra) = self.op.parse_args(args=args) + + if len(extra) != 0: + mapping = {"command": "firewall", "options": extra} + raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Unexpected arguments to %(command)s command: %(options)s") % mapping) + self._setToSelf(self.op, opts) return self diff --git a/pykickstart/commands/partition.py b/pykickstart/commands/partition.py index 1a162fe..434f210 100644 --- a/pykickstart/commands/partition.py +++ b/pykickstart/commands/partition.py @@ -79,7 +79,7 @@ class FC3_PartData(BaseData): def __str__(self): retval = BaseData.__str__(self) - retval += "part %s %s\n" % (self.mountpoint, self._getArgsAsStr()) + retval += "part %s%s\n" % (self.mountpoint, self._getArgsAsStr()) return retval class FC4_PartData(FC3_PartData): diff --git a/pykickstart/commands/repo.py b/pykickstart/commands/repo.py index 071838c..4eefdc2 100644 --- a/pykickstart/commands/repo.py +++ b/pykickstart/commands/repo.py @@ -86,7 +86,7 @@ class F11_RepoData(F8_RepoData): retval = F8_RepoData._getArgsAsStr(self) if self.ignoregroups: - retval += " --ignoregroups true" + retval += " --ignoregroups=true" return retval class FC6_Repo(KickstartCommand): @@ -115,6 +115,10 @@ class FC6_Repo(KickstartCommand): def parse(self, args): (opts, extra) = self.op.parse_args(args=args) + + if len(extra) != 0: + mapping = {"command": "repo", "options": extra} + raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Unexpected arguments to %(command)s command: %(options)s") % mapping) # This is lame, but I can't think of a better way to make sure only # one of these two is specified. diff --git a/tests/commands/firewall.py b/tests/commands/firewall.py new file mode 100644 index 0000000..2da14e8 --- /dev/null +++ b/tests/commands/firewall.py @@ -0,0 +1,98 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC3_TestCase(CommandTest): + def runTest(self): + # pass + # enable firewall + self.assert_parse("firewall --enabled --trust=eth0 --ssh --port=imap:tcp", + "firewall --enabled --port=22:tcp,imap:tcp --trust=eth0\n") + self.assert_parse("firewall --enable --trust=eth0,eth1 --ssh --telnet --http --smtp --ftp --port=1234:udp" + "firewall --enabled --port=22:tcp,23:tcp,80:tcp,443:tcp,25:tcp,21:tcp,1234:udp --trust=eth0,eth1\n") + self.assert_parse("firewall --enabled --ssh --ftp", "firewall --enabled --port=22:tcp,21:tcp\n") + self.assert_parse("firewall --enable --port=1234:udp,4321:tcp", "firewall --enabled --port=1234:udp,4321:tcp\n") + + # disable firewall + self.assert_parse("firewall --disabled", "firewall --disabled\n") + self.assert_parse("firewall --disable", "firewall --disabled\n") + + # enable by default + self.assert_parse("firewall --trust=eth0", "firewall --enabled --trust=eth0\n") + self.assert_parse("firewall", "firewall --enabled\n") + + # deprecated + self.assert_deprecated("firewall", "--high") + self.assert_deprecated("firewall", "--medium") + + # fail + # unknown option + self.assert_parse_error("firewall --bad-flag", KickstartParseError) + # unexpected argument + self.assert_parse_error("firewall arg", KickstartValueError) + + +class F9_TestCase(FC3_TestCase): + def runTest(self): + # run FC3 test case + FC3_TestCase.runTest(self) + + # removed + self.assert_removed("firewall", "--high") + self.assert_removed("firewall", "--medium") + + +class F10_TestCase(F9_TestCase): + def runTest(self): + # run F9 test case + #F9_TestCase.runTest(self) + + # pass + # enable firewall + self.assert_parse("firewall --enabled --trust=eth0 --ssh --port=imap:tcp", + "firewall --enabled --port=imap:tcp --trust=eth0 --service=ssh\n") + self.assert_parse("firewall --enable --trust=eth0,eth1 --ssh --http --smtp --ftp --port=1234:udp" + "firewall --enabled --port=1234:udp --trust=eth0,eth1 --service=ssh,http,smtp,ftp\n") + self.assert_parse("firewall --enabled --ssh --ftp", "firewall --enabled --service=ssh,ftp\n") + self.assert_parse("firewall --enable --port=1234:udp,4321:tcp", "firewall --enabled --port=1234:udp,4321:tcp\n") + + # disable firewall + self.assert_parse("firewall --disabled", "firewall --disabled\n") + self.assert_parse("firewall --disable", "firewall --disabled\n") + + # enable by default + self.assert_parse("firewall --trust=eth0", "firewall --enabled --trust=eth0\n") + self.assert_parse("firewall", "firewall --enabled\n") + + # deprecated + self.assert_deprecated("firewall", "--telnet") + + # fail + # unknown option + self.assert_parse_error("firewall --bad-flag", KickstartParseError) + # unexpected argument + self.assert_parse_error("firewall arg", KickstartValueError) + + +if __name__ == "__main__": + unittest.main() + diff --git a/tests/commands/partition.py b/tests/commands/partition.py new file mode 100644 index 0000000..a0151dd --- /dev/null +++ b/tests/commands/partition.py @@ -0,0 +1,124 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC3_TestCase(CommandTest): + def runTest(self, bytes_per_inode=False): + bpi = "" + if bytes_per_inode: + bpi = " --bytes-per-inode=4096" + + # pass + self.assert_parse("part /home", "part /home%s\n" % bpi) + self.assert_parse("partition raid.1 --active --asprimary --start=0 --end=10 --fstype=ext3 --noformat", + "part raid.1 --active --asprimary --end=10 --fstype=\"ext3\" --noformat%s\n" % bpi) + self.assert_parse("part pv.1 --ondisk=sda --onpart=sda1 --recommended", + "part pv.1 --ondisk=sda --onpart=sda1 --recommended%s\n" % bpi) + self.assert_parse("part pv.1 --ondrive=sda --usepart=sda1 --recommended", + "part pv.1 --ondisk=sda --onpart=sda1 --recommended%s\n" % bpi) + self.assert_parse("part / --onbiosdisk=hda --size=100", "part / --onbiosdisk=hda --size=100%s\n" % bpi) + self.assert_parse("part swap --grow --maxsize=100", "part swap --grow --maxsize=100%s\n" % bpi) + + # does not remove the /dev/ part + self.assert_parse("part /usr --ondisk=/dev/sda --recommended --noformat --active", + "part /usr --active --noformat --ondisk=/dev/sda --recommended%s\n" % bpi) + + # fail + # missing mountpoint + self.assert_parse_error("part", KickstartValueError) + self.assert_parse_error("part --ondisk=sda --size=100", KickstartValueError) + + for opt in ("start", "end", "size", "maxsize"): + # integer argument required + self.assert_parse_error("part / --%s=string" % opt, KickstartParseError) + # value required + self.assert_parse_error("part / --%s" % opt, KickstartParseError) + + for opt in ("fstype", "onbiosdisk", "ondisk", "ondrive", "onpart", "usepart"): + # value required + self.assert_parse_error("part / --%s" % opt, KickstartParseError) + + # only one argument allowed + self.assert_parse_error("part / /home /usr", KickstartValueError) + # unknown option + self.assert_parse_error("part /home --unknown=value", KickstartParseError) + + + +class FC4_TestCase(FC3_TestCase): + def runTest(self): + # run FC3 test case + FC3_TestCase.runTest(self, bytes_per_inode=True) + + # pass + self.assert_parse("part /home --bytes-per-inode=2048 --fsoptions=blah --label=home", + "part /home --bytes-per-inode=2048 --fsoptions=\"blah\" --label=home\n") + + # fail + # --bytes-per-inode requires int argument + self.assert_parse_error("part /home --bytes-per-inode=string", KickstartParseError) + self.assert_parse_error("part /home --bytes-per-inode", KickstartParseError) + # missing required arguments + for opt in ("fsoptions", "label"): + self.assert_parse_error("part /home --%s" % opt, KickstartParseError) + + + +class RHEL5_TestCase(FC4_TestCase): + def runTest(self): + # run FC4 test case + FC4_TestCase.runTest(self) + + # pass + self.assert_parse("part / --encrypted --passphrase=blahblah", + "part / --bytes-per-inode=4096 --encrypted --passphrase=\"blahblah\"\n") + + # fail + # missing required --passphrase argument + self.assert_parse_error("part / --encrypted --passphrase", KickstartParseError) + + + +class F9_TestCase(FC3_TestCase): + def runTest(self): + # run FC3 test case + FC3_TestCase.runTest(self, bytes_per_inode=False) + + # pass + self.assert_parse("part / --encrypted --passphrase=blahblah", + "part / --encrypted --passphrase=\"blahblah\"\n") + self.assert_parse("part /home --fsprofile=blah", "part /home --fsprofile=\"blah\"\n") + + # deprecated + self.assert_deprecated("part", "--bytes-per-inode") + + # fail + # missing required --passphrase argument + self.assert_parse_error("part / --encrypted --passphrase", KickstartParseError) + # missing required --fsprofile argument + self.assert_parse_error("part / --fsprofile", KickstartParseError) + + + +if __name__ == "__main__": + unittest.main() + diff --git a/tests/commands/repo.py b/tests/commands/repo.py new file mode 100644 index 0000000..fbaf589 --- /dev/null +++ b/tests/commands/repo.py @@ -0,0 +1,88 @@ +# +# Martin Gracik +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# + +import unittest +from tests.baseclass import * + +class FC6_TestCase(CommandTest): + def runTest(self): + # pass + self.assert_parse("repo --name=blah --baseurl=http://www.domain.com", + "repo --name=blah --baseurl=http://www.domain.com\n") + self.assert_parse("repo --name=blah --mirrorlist=http://www.domain.com", + "repo --name=blah --mirrorlist=http://www.domain.com\n") + + # fail + # missing required option --name + self.assert_parse_error("repo --baseurl=www.domain.com", KickstartValueError) + self.assert_parse_error("repo --name --baseurl=www.domain.com", KickstartParseError) + # missing one of required options --baseurl or --mirrorlist + self.assert_parse_error("repo --name=blah", KickstartValueError) + self.assert_parse_error("repo --name=blah --baseurl", KickstartParseError) + self.assert_parse_error("repo --name=blah --mirrorlist", KickstartParseError) + # only one of --baseurl or --mirrorlist must be specified + self.assert_parse_error("repo --name=blah --baseurl=www.domain.com --mirrorlist=www.domain.com", + KickstartValueError) + # unknown option + self.assert_parse_error("repo --name=blah --baseurl=www.domain.com --unknown", KickstartParseError) + # not expected argument + self.assert_parse_error("repo --name=blah --baseurl=www.domain.com blah", KickstartValueError) + + +class F8_TestCase(FC6_TestCase): + def runTest(self): + # run FC6 test case + FC6_TestCase.runTest(self) + + # pass + self.assert_parse("repo --name=blah --baseurl=www.domain.com --cost=10 --excludepkgs=pkg1,pkg2 --includepkgs=pkg3,pkg4", + "repo --name=blah --baseurl=www.domain.com --cost=10 --includepkgs=\"pkg3,pkg4\" --excludepkgs=\"pkg1,pkg2\"\n") + self.assert_parse("repo --name=blah --baseurl=123xyz --cost=10 --excludepkgs=pkg1,pkg2 --includepkgs=pkg3,pkg4", + "repo --name=blah --baseurl=123xyz --cost=10 --includepkgs=\"pkg3,pkg4\" --excludepkgs=\"pkg1,pkg2\"\n") + + # fail + # missing required arguments + for opt in ("--cost", "--includepkgs", "--excludepkgs"): + self.assert_parse_error("repo --name=blah --baseurl=www.domain.com %s" % opt, KickstartParseError) + # --cost argument not integer + self.assert_parse_error("repo --name=blah --baseurl=www.domain.com --cost=high", KickstartParseError) + + +class F11_TestCase(F8_TestCase): + def runTest(self): + # run F8 test case + F8_TestCase.runTest(self) + + # pass + for val in ("1", "true", "on"): + self.assert_parse("repo --name=blah --baseurl=www.domain.com --cost=10 --excludepkgs=pkg1,pkg2 --includepkgs=pkg3,pkg4 --ignoregroups=%s" % val, + "repo --name=blah --baseurl=www.domain.com --cost=10 --includepkgs=\"pkg3,pkg4\" --excludepkgs=\"pkg1,pkg2\" --ignoregroups=true\n") + for val in ("0", "false", "off"): + self.assert_parse("repo --name=blah --baseurl=www.domain.com --cost=10 --excludepkgs=pkg1,pkg2 --includepkgs=pkg3,pkg4 --ignoregroups=%s" % val, + "repo --name=blah --baseurl=www.domain.com --cost=10 --includepkgs=\"pkg3,pkg4\" --excludepkgs=\"pkg1,pkg2\"\n") + + # fail + # missing --ignoregroups argument + self.assert_parse_error("repo --name=blah --baseurl=www.domain.com --ignoregroups", KickstartParseError) + + +if __name__ == "__main__": + unittest.main() + -- 1.6.0.6 From debian at herakles.homelinux.org Tue Feb 10 22:04:04 2009 From: debian at herakles.homelinux.org (John Summerfield) Date: Wed, 11 Feb 2009 07:04:04 +0900 Subject: Fwd: [PATCH] Added rescue.py test case In-Reply-To: <1234273843.5130.1.camel@localhost.localdomain> References: <576690875.319631234197656485.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <49917A3A.8040800@herakles.homelinux.org> <1234273843.5130.1.camel@localhost.localdomain> Message-ID: <4991F9D4.8080704@herakles.homelinux.org> James Laska wrote: > On Tue, 2009-02-10 at 21:59 +0900, John Summerfield wrote: >> Isn't this Anaconda stuff? >> >> As I understand it, ks is a _process_ implemented in Anaconda, a >> software product. > > Hey John, > > It is and it isn't. Pykickstart is a library used by anaconda and other > tools to read+write kickstart files. I've tried to explain the process > a bit in the links below ... but let me know if something is unclear. > > http://jlaska.livejournal.com/4383.html > http://jlaska.livejournal.com/4931.html > > Thanks, > James I _wish_ you people wouldn't scatter your documentation over innumerable random websites. - Stuff at livejournal automatically has less cred that stuff at the official Fedora project website or Red Hat's. - If I want to find what the developers have been doing, the obvious technique is to include "site:fedoraproject.org" in Google's search arguments. That fails when you put stuff some other place. That aside, it looks to me that Martin is hacking on Anaconda, there's nothing in the file/path names that suggests otherwise. -- Cheers John -- spambait 1aaaaaaa at coco.merseine.nu Z1aaaaaaa at coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-) From clumens at redhat.com Tue Feb 10 22:16:09 2009 From: clumens at redhat.com (Chris Lumens) Date: Tue, 10 Feb 2009 17:16:09 -0500 Subject: Fwd: [PATCH] Added rescue.py test case In-Reply-To: <4991F9D4.8080704@herakles.homelinux.org> References: <576690875.319631234197656485.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <49917A3A.8040800@herakles.homelinux.org> <1234273843.5130.1.camel@localhost.localdomain> <4991F9D4.8080704@herakles.homelinux.org> Message-ID: <20090210221609.GI8293@localhost.localdomain> > That aside, it looks to me that Martin is hacking on Anaconda, there's > nothing in the file/path names that suggests otherwise. James sent a mail to this list at the end of last month indicating we were working on unit tests for the pykickstart project (which is about three years old at this point, by the way - not exactly new stuff) and soliciting help. That mail is: https://www.redhat.com/archives/kickstart-list/2009-January/msg00042.html Therefore, it stands to reason that the long string of patch emails that include test cases might have something to do with that original mail. Anyway, patches to anaconda itself tend to go to anaconda-devel-list. - Chris From debian at herakles.homelinux.org Tue Feb 10 23:44:22 2009 From: debian at herakles.homelinux.org (John Summerfield) Date: Wed, 11 Feb 2009 08:44:22 +0900 Subject: Fwd: [PATCH] Added rescue.py test case In-Reply-To: <20090210221609.GI8293@localhost.localdomain> References: <576690875.319631234197656485.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <49917A3A.8040800@herakles.homelinux.org> <1234273843.5130.1.camel@localhost.localdomain> <4991F9D4.8080704@herakles.homelinux.org> <20090210221609.GI8293@localhost.localdomain> Message-ID: <49921156.4040600@herakles.homelinux.org> Chris Lumens wrote: >> That aside, it looks to me that Martin is hacking on Anaconda, there's >> nothing in the file/path names that suggests otherwise. > > James sent a mail to this list at the end of last month indicating we > were working on unit tests for the pykickstart project (which is about > three years old at this point, by the way - not exactly new stuff) and > soliciting help. That mail is: > > https://www.redhat.com/archives/kickstart-list/2009-January/msg00042.html I've been too busy to read much email at all recently. > > Therefore, it stands to reason that the long string of patch emails that > include test cases might have something to do with that original mail. > > Anyway, patches to anaconda itself tend to go to anaconda-devel-list. I know that, and that's where I expected these to go. :-) I got tired of seeing Anaconda patches, the focus has changed since I subscribed many years ago, so I left it. I'm pretty happy reviewing proposed changes to Anaconda, some of them I disagree with strongly, but not the patches thanks. I can't help thinking that if I did want to find where stuff relevant to installing RHEL/Fedora got changed, it's the Anaconda list that I'd search. I don't think (until now) I'd have thought of the ks list. The difference is a bit murky, and I see the argument that discussion of (including implementation of changes to) tools to configure kickstart process belongs here, but if I were setting up or managing these lists I'd prefer all _development_ of RH/Fedora installation tools on the anaconda list, and use of those tools on this. The audiences are different, this list caters well to those using the installation tools. fwiw I did review the official descriptions of these (and some other lists) and generally they are pretty vague, and I suspect that of redhat-devel has been changed from when RHL 6,x were current (it was pretty busy then). -- Cheers John -- spambait 1aaaaaaa at coco.merseine.nu Z1aaaaaaa at coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-) From joliver at john-oliver.net Wed Feb 11 00:16:38 2009 From: joliver at john-oliver.net (John Oliver) Date: Tue, 10 Feb 2009 16:16:38 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: References: <498C94E8.8090308@woti.com> Message-ID: <20090211001638.GA21557@ns.sdsitehosting.net> On Mon, Feb 09, 2009 at 11:03:34AM -0600, Gerald Waugh wrote: > Hi, > > I have tried several things. > Including changing usr/lib/anaconda/kickstart.py > > > > * add this line into the setSteps function > > dispatch.skipStep("methodcomplete") > > and changing usr/lib/anaconda/dispatch.py > > > ("methodcomplete", doMethodComplete, ), > > ("dopostaction", doPostAction, ), > >> > > for > >> > > ("dopostaction", doPostAction, ), > > ("methodcomplete", doMethodComplete, ), > - > > But always get "CentOS CD not found error" I'm glad I'm not the only one who got that! I'm not sure when CentOS 5.3 will be released, but using RHEL5.3 got me past this issue. I could put the stage2.img from RHEL5.3 on an FTP server for you to try if you like. -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From gwaugh at frontstreetnetworks.com Wed Feb 11 05:02:30 2009 From: gwaugh at frontstreetnetworks.com (Gerald Waugh) Date: Tue, 10 Feb 2009 23:02:30 -0600 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <20090211001638.GA21557@ns.sdsitehosting.net> Message-ID: <35DEF84700BB486E93655B46898951E4@systemax> John Oliver wrote; > > On Mon, Feb 09, 2009 at 11:03:34AM -0600, Gerald Waugh wrote: > > Hi, > > > > I have tried several things. > > Including changing usr/lib/anaconda/kickstart.py > > > > > > * add this line into the setSteps function > > > dispatch.skipStep("methodcomplete") > > > > and changing usr/lib/anaconda/dispatch.py > > > > > ("methodcomplete", doMethodComplete, ), > > > ("dopostaction", doPostAction, ), > > >> > > > for > > >> > > > ("dopostaction", doPostAction, ), > > > ("methodcomplete", doMethodComplete, ), > > - > > > > But always get "CentOS CD not found error" > > I'm glad I'm not the only one who got that! > > I'm not sure when CentOS 5.3 will be released, but using > RHEL5.3 got me past this issue. I could put the stage2.img > from RHEL5.3 on an FTP server for you to try if you like. > John, I used unsquashfs for stage2, edited usr/lib/anaconda/dispatch.py changing the following lines. ("methodcomplete", doMethodComplete, ), ("dopostaction", doPostAction, ), changed to; ("dopostaction", doPostAction, ), ("methodcomplete", doMethodComplete, ), ran ksquashfs on the unsquashed stage2 and it worked fine! :) full description below... I was using BlueOnyx-5.2-20090107.iso ================================================================== # Do the following to fix the issue not running %post scripts: # Note that the *.img files use the squashfs file system. # if the tools are not on the system yum install them. yum -y install squashfs-tools mkisofs cdrecord # insert install-cd into cdrom mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom mkdir /home/BlueOnyx mkdir /home/BlueOnyx/ISOs mkdir /home/BlueOnyx/BlueOnyx-5.2-20090107 cd /mnt/cdrom # move the iso to a rw area tar -c * | tar -C /home/BlueOnyx/BlueOnyx-5.2-20090107 -xf- cd /home/BlueOnyx/BlueOnyx-5.2-20090107 cp /mnt/cdrom/.discinfo . umount /mnt/cdrom # remove the install cd and insert a fresh CD cd /home/BlueOnyx/BlueOnyx-5.2-20090107/images unsquashfs stage2.img cd squashfs-root vi usr/lib/anaconda/dispatch.py # find these lines (need to reverse them) ("methodcomplete", doMethodComplete, ), ("dopostaction", doPostAction, ), #and change to ("dopostaction", doPostAction, ), ("methodcomplete", doMethodComplete, ), # note with vi you will have to use :w! to write the ro file # recreate the ram file system: cd .. mksquashfs squashfs-root ../../stage2.img cp ../../stage2.img stage2.img rm -rf squashfs-root cd ../ mkisofs -P CentOS -b isolinux/isolinux.bin -c isolinux/boot.cat\ -no-emul-boot -boot-load-size 4 -boot-info-table -r -J -T -o ../ISOs/BlueOnyx-5.2-20090107-1.iso . cd ../ISOs # note dev arguement may be different execute 'cdrecord scanbus' to find dev= info cdrecord -v dev=5,0,0 BlueOnyx-5.2-20090107-1.iso Gerald From clumens at redhat.com Wed Feb 11 20:24:05 2009 From: clumens at redhat.com (Chris Lumens) Date: Wed, 11 Feb 2009 15:24:05 -0500 Subject: [PATCH] Added firewall, partition, repo tests; Made minor changes to firewall, partition, repo commands. In-Reply-To: <1234280378-32462-1-git-send-email-mgracik@redhat.com> References: <1232731389.3647.308.camel@localhost.localdomain> <1234280378-32462-1-git-send-email-mgracik@redhat.com> Message-ID: <20090211202405.GN8293@localhost.localdomain> > Added checking of unexpected arguments, and raising a KickstartValueError, if they are given. > Also edited some output strings formatting, to ensure there are no double spaces, if some of the values are missing. > --- > pykickstart/commands/firewall.py | 29 ++++++--- > pykickstart/commands/partition.py | 2 +- > pykickstart/commands/repo.py | 6 ++- > tests/commands/firewall.py | 98 +++++++++++++++++++++++++++++ > tests/commands/partition.py | 124 +++++++++++++++++++++++++++++++++++++ > tests/commands/repo.py | 88 ++++++++++++++++++++++++++ > 6 files changed, 335 insertions(+), 12 deletions(-) > create mode 100644 tests/commands/firewall.py > create mode 100644 tests/commands/partition.py > create mode 100644 tests/commands/repo.py Pushed. Thanks for all the hard work. - Chris From rmercer at harris.com Thu Feb 12 18:42:41 2009 From: rmercer at harris.com (Rodney Mercer) Date: Thu, 12 Feb 2009 13:42:41 -0500 Subject: ks pre script to determine hw raid drive to install to Message-ID: <1234464161.18977.75.camel@ratbert.evn.harris.com> I just purchased a Sun Fire X2250 rack mounted server to use as a build machine. I have set it up to use the built in hardware raid to mirror the two 250 GB disks. I am using RHEL 5 update2 X86_64. On our normal Dell desktops we don't use a raid configuration. So to install via pxeboot, I setup my generic kickstart config file to use a pre script that includes: ---- # Determine how many drives we have and use the first drive only. set $(list-harddrives) let numd=$#/2 d1=$1 d2=$3 cat << EOF > /tmp/part-include bootloader --location=mbr --driveorder=$d1 --append="apic rhgb quiet" clearpart --all zerombr part /boot --fstype ext3 --size=100 --ondisk=$d1 part / --fstype ext3 --size=1000 --grow --ondisk=$d1 part /usr --fstype ext3 --size=4000 --grow --ondisk=$d1 part /var --fstype ext3 --size=1000 --grow --ondisk=$d1 part /tmp --fstype ext3 --size=250 --grow --ondisk=$d1 part /usr1 --fstype ext3 --size=10000 --grow --ondisk=$d1 part swap --size=1000 --grow --maxsize=2000 --ondisk=$d1 EOF ----- This setup works great on the non hardware raid machines. With the raided Sun Fire X2250, it fails to determine the device name of the raided Volume but sees the individual disks, /dev/sda and /dev/sdb. Of course it fails the partition. Commenting out the part directives shows me that raided volume name is /dev/mapper/isw_dficaggeej_Volume0. If I hardcode "d1=isw_dficaggeej_Volume0" and restore the part directives, the install completes without a problem. Does anyone know how to have the pre script recognize the hardware mirrored device volume name and use it automatically? Thanks in advance. Rodney Mercer. Nobody said computers were going to be polite. From bjs at redhat.com Thu Feb 12 19:24:57 2009 From: bjs at redhat.com (Bryan J Smith) Date: Thu, 12 Feb 2009 14:24:57 -0500 Subject: ks pre script to determine hw raid drive to install to In-Reply-To: <1234464161.18977.75.camel@ratbert.evn.harris.com> References: <1234464161.18977.75.camel@ratbert.evn.harris.com> Message-ID: <1234466697.4113.50.camel@localhost.localdomain> On Thu, 2009-02-12 at 13:42 -0500, Rodney Mercer wrote: > I just purchased a Sun Fire X2250 rack mounted server to use as a build > machine. I have set it up to use the built in hardware raid to mirror > the two 250 GB disks. I am using RHEL 5 update2 X86_64 ... > This setup works great on the non hardware raid machines. With the > raided Sun Fire X2250, it fails to determine the device name of the > raided Volume but sees the individual disks, /dev/sda and /dev/sdb. That's not hardware RAID. That's Fake [Hardware] RAID (FRAID). The RAID is done 100% in software. The only "additive" is that there is a "trick" in the 16-bit BIOS so the functions write to the organization. Once the OS starts, it sees the "real" drives and nothing more. So a "trick" must be done on the OS side as well. In either case, whether the 16-bit BIOS or 32/64-bit OS software, it's 100% software RAID. Under Windows, this is some 3rd party licensed logic. It's very proprietary and non-portable. Many times, I've seen it break and ruin different volumes. > Of course it fails the partition. Commenting out the part directives > shows me that raided volume name > is /dev/mapper/isw_dficaggeej_Volume0. Under Linux, that's Device Mapper RAID (dmraid) mapping the /dev/sda and /dev/sdb drives as /dev/mapper/isw_dficaggeej. DeviceMapper can read a number of the FRAID disk organizations and figure out how to map appropriately for striping, mirroring, parity, etc..., leveraging more generic RAID code in the Linux kernel. It's actually much safer than the Windows driver. The big problem though is rebuilding after a failure. The tools don't seem to be there for dmraid the last time I checked. > If I hardcode "d1=isw_dficaggeej_Volume0" and restore the part > directives, the install completes without a problem. Correct. Because you are now installing to the device mapping setup for the FRAID volume. > Does anyone know how to have the pre script recognize the hardware > mirrored device volume name and use it automatically? I haven't seen a problem with Anaconda since Fedora Core 5/6 or so and Red Hat Enterprise Linux/CentOS 5. What is the Intel ICH, nVidia MCP, etc... chipset here? If you don't know, use "lspci" -- Bryan J Smith - Senior Consultant - Red Hat GPS SE US mailto:bjs at redhat.com +1 (407) 489-7013 (Mobile) mailto:b.j.smith at ieee.org (non-RH/ext to Blackberry) ----------------------------------------------------- For every dollar you spend on Red Hat solutions, you not only fund the leading community development re- source, but you receive the #1 IT industry leader in corporate value. http://www.redhat.com/promo/vendor/ From joliver at john-oliver.net Fri Feb 13 02:43:06 2009 From: joliver at john-oliver.net (John Oliver) Date: Thu, 12 Feb 2009 18:43:06 -0800 Subject: RHEL5 - copy files from DVD during %post In-Reply-To: <35DEF84700BB486E93655B46898951E4@systemax> References: <20090211001638.GA21557@ns.sdsitehosting.net> <35DEF84700BB486E93655B46898951E4@systemax> Message-ID: <20090213024306.GA15148@ns.sdsitehosting.net> On Tue, Feb 10, 2009 at 11:02:30PM -0600, Gerald Waugh wrote: > > John, > > I used unsquashfs for stage2, edited usr/lib/anaconda/dispatch.py > changing the following lines. > ("methodcomplete", doMethodComplete, ), > ("dopostaction", doPostAction, ), > changed to; > ("dopostaction", doPostAction, ), > ("methodcomplete", doMethodComplete, ), > ran ksquashfs on the unsquashed stage2 and it worked fine! :) > > full description below... I was using BlueOnyx-5.2-20090107.iso > ================================================================== > # Do the following to fix the issue not running %post scripts: > # Note that the *.img files use the squashfs file system. > # if the tools are not on the system yum install them. > yum -y install squashfs-tools mkisofs cdrecord > # insert install-cd into cdrom > mkdir /mnt/cdrom > mount /dev/cdrom /mnt/cdrom > mkdir /home/BlueOnyx > mkdir /home/BlueOnyx/ISOs > mkdir /home/BlueOnyx/BlueOnyx-5.2-20090107 > cd /mnt/cdrom > # move the iso to a rw area > tar -c * | tar -C /home/BlueOnyx/BlueOnyx-5.2-20090107 -xf- > cd /home/BlueOnyx/BlueOnyx-5.2-20090107 > cp /mnt/cdrom/.discinfo . > umount /mnt/cdrom > # remove the install cd and insert a fresh CD > cd /home/BlueOnyx/BlueOnyx-5.2-20090107/images > unsquashfs stage2.img > cd squashfs-root > vi usr/lib/anaconda/dispatch.py > # find these lines (need to reverse them) > ("methodcomplete", doMethodComplete, ), > ("dopostaction", doPostAction, ), > #and change to > ("dopostaction", doPostAction, ), > ("methodcomplete", doMethodComplete, ), > # note with vi you will have to use :w! to write the ro file > # recreate the ram file system: > cd .. > mksquashfs squashfs-root ../../stage2.img > cp ../../stage2.img stage2.img Thanks, Gerald... this is the first time I've seen unsquashfs mentioned. I am very hopeful, and will be testing on Tuesday! -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From rmercer at harris.com Mon Feb 16 14:52:16 2009 From: rmercer at harris.com (Rodney Mercer) Date: Mon, 16 Feb 2009 09:52:16 -0500 Subject: ks pre script to determine hw raid drive to install to In-Reply-To: <20090213170021.092E68E055B@hormel.redhat.com> References: <20090213170021.092E68E055B@hormel.redhat.com> Message-ID: <1234795936.7211.21.camel@ratbert.evn.harris.com> > > From: Bryan J Smith > > Reply-To: Discussion list about Kickstart > > > > To: Discussion list about Kickstart > > Subject: Re: ks pre script to determine hw raid drive to install to > > Date: Thu, 12 Feb 2009 14:24:57 -0500 > > > > On Thu, 2009-02-12 at 13:42 -0500, Rodney Mercer wrote: > > > I just purchased a Sun Fire X2250 rack mounted server to use as a build > > > machine. I have set it up to use the built in hardware raid to mirror > > > the two 250 GB disks. I am using RHEL 5 update2 X86_64 ... > > > This setup works great on the non hardware raid machines. With the > > > raided Sun Fire X2250, it fails to determine the device name of the > > > raided Volume but sees the individual disks, /dev/sda and /dev/sdb. > > > > That's not hardware RAID. That's Fake [Hardware] RAID (FRAID). The > > RAID is done 100% in software. The only "additive" is that there is a > > "trick" in the 16-bit BIOS so the functions write to the organization. > > > > Once the OS starts, it sees the "real" drives and nothing more. So a > > "trick" must be done on the OS side as well. In either case, whether > > the 16-bit BIOS or 32/64-bit OS software, it's 100% software RAID. > > > > Under Windows, this is some 3rd party licensed logic. It's very > > proprietary and non-portable. Many times, I've seen it break and ruin > > different volumes. > > > > > Of course it fails the partition. Commenting out the part directives > > > shows me that raided volume name > > > is /dev/mapper/isw_dficaggeej_Volume0. > > > > Under Linux, that's Device Mapper RAID (dmraid) mapping the /dev/sda > > and /dev/sdb drives as /dev/mapper/isw_dficaggeej. DeviceMapper can > > read a number of the FRAID disk organizations and figure out how to map > > appropriately for striping, mirroring, parity, etc..., leveraging more > > generic RAID code in the Linux kernel. > > > > It's actually much safer than the Windows driver. > > > > The big problem though is rebuilding after a failure. The tools don't > > seem to be there for dmraid the last time I checked. > > > > > If I hardcode "d1=isw_dficaggeej_Volume0" and restore the part > > > directives, the install completes without a problem. > > > > Correct. Because you are now installing to the device mapping setup for > > the FRAID volume. > > > > > Does anyone know how to have the pre script recognize the hardware > > > mirrored device volume name and use it automatically? > > > > I haven't seen a problem with Anaconda since Fedora Core 5/6 or so and > > Red Hat Enterprise Linux/CentOS 5. What is the Intel ICH, nVidia MCP, > > etc... chipset here? > > > > If you don't know, use "lspci" > > > > Brian, Thanks for the explanation on the fake raid implementation. With the use of: ----- set $(list-harddrives) let numd=$#/2 d1=$1 ---- Are you saying that Anaconda should recognize the Fake RAID using dmraid and set the d1 variable to isw_dficaggeej? If not, is there something else that I can use to set the d1 variable if dmraid creates the mapping? Here is the output of lspci on the machine: ---- 00:00.0 Host bridge: Intel Corporation 5400 Chipset Memory Controller Hub (rev 20) 00:01.0 PCI bridge: Intel Corporation 5400 Chipset PCI Express Port 1 (rev 20) 00:05.0 PCI bridge: Intel Corporation 5400 Chipset PCI Express Port 5 (rev 20) 00:09.0 PCI bridge: Intel Corporation 5400 Chipset PCI Express Port 9 (rev 20) 00:0f.0 System peripheral: Intel Corporation 5400 Chipset QuickData Technology Device (rev 20) 00:10.0 Host bridge: Intel Corporation 5400 Chipset FSB Registers (rev 20) 00:10.1 Host bridge: Intel Corporation 5400 Chipset FSB Registers (rev 20) 00:10.2 Host bridge: Intel Corporation 5400 Chipset FSB Registers (rev 20) 00:10.3 Host bridge: Intel Corporation 5400 Chipset FSB Registers (rev 20) 00:10.4 Host bridge: Intel Corporation 5400 Chipset FSB Registers (rev 20) 00:11.0 Host bridge: Intel Corporation 5400 Chipset CE/SF Registers (rev 20) 00:15.0 Host bridge: Intel Corporation 5400 Chipset FBD Registers (rev 20) 00:15.1 Host bridge: Intel Corporation 5400 Chipset FBD Registers (rev 20) 00:16.0 Host bridge: Intel Corporation 5400 Chipset FBD Registers (rev 20) 00:16.1 Host bridge: Intel Corporation 5400 Chipset FBD Registers (rev 20) 00:1d.0 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #1 (rev 09) 00:1d.1 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #2 (rev 09) 00:1d.2 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #3 (rev 09) 00:1d.3 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #4 (rev 09) 00:1d.7 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset EHCI USB2 Controller (rev 09) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d9) 00:1f.0 ISA bridge: Intel Corporation 631xESB/632xESB/3100 Chipset LPC Interface Controller (rev 09) 00:1f.1 IDE interface: Intel Corporation 631xESB/632xESB IDE Controller (rev 09) 00:1f.2 RAID bus controller: Intel Corporation 631xESB/632xESB SATA RAID Controller (rev 09) 00:1f.3 SMBus: Intel Corporation 631xESB/632xESB/3100 Chipset SMBus Controller (rev 09) 01:0b.0 VGA compatible controller: ASPEED Technology, Inc. AST2000 02:00.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Upstream Port (rev 01) 02:00.3 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express to PCI-X Bridge (rev 01) 03:00.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Downstream Port E1 (rev 01) 03:01.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Downstream Port E2 (rev 01) 03:02.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Downstream Port E3 (rev 01) 04:00.0 Ethernet controller: Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper) (rev 01) 04:00.1 Ethernet controller: Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper) (rev 01) Regards, Rodney. From jlaska at redhat.com Wed Feb 18 13:31:29 2009 From: jlaska at redhat.com (James Laska) Date: Wed, 18 Feb 2009 08:31:29 -0500 Subject: [PATCH] Only show autostep command when requested In-Reply-To: <20090129195449.GB30009@localhost.localdomain> References: <20090129195449.GB30009@localhost.localdomain> Message-ID: <1234963889-9363-1-git-send-email-jlaska@redhat.com> --- pykickstart/commands/autostep.py | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pykickstart/commands/autostep.py b/pykickstart/commands/autostep.py index 8ad7604..44d2023 100644 --- a/pykickstart/commands/autostep.py +++ b/pykickstart/commands/autostep.py @@ -28,15 +28,17 @@ class FC3_AutoStep(KickstartCommand): KickstartCommand.__init__(self, writePriority, *args, **kwargs) self.op = self._getParser() + self.autostep = kwargs.get("autostep", False) self.autoscreenshot = kwargs.get("autoscreenshot", False) def __str__(self): retval = KickstartCommand.__str__(self) - if self.autoscreenshot: - retval += "autostep --autoscreenshot\n" - else: - retval += "autostep\n" + if self.autostep: + if self.autoscreenshot: + retval += "autostep --autoscreenshot\n" + else: + retval += "autostep\n" return retval @@ -49,4 +51,5 @@ class FC3_AutoStep(KickstartCommand): def parse(self, args): (opts, extra) = self.op.parse_args(args=args) self._setToSelf(self.op, opts) + self.autostep = True return self -- 1.6.0.6 From clumens at redhat.com Wed Feb 18 18:22:14 2009 From: clumens at redhat.com (Chris Lumens) Date: Wed, 18 Feb 2009 13:22:14 -0500 Subject: [PATCH] Only show autostep command when requested In-Reply-To: <1234963889-9363-1-git-send-email-jlaska@redhat.com> References: <20090129195449.GB30009@localhost.localdomain> <1234963889-9363-1-git-send-email-jlaska@redhat.com> Message-ID: <20090218182214.GC8293@localhost.localdomain> > pykickstart/commands/autostep.py | 11 +++++++---- > 1 files changed, 7 insertions(+), 4 deletions(-) Great, thanks for the patch. I've applied, and will rebuild shortly. - Chris From tony.chamberlain at lemko.com Thu Feb 19 16:48:10 2009 From: tony.chamberlain at lemko.com (tony.chamberlain at lemko.com) Date: Thu, 19 Feb 2009 16:48:10 +0000 Subject: driver Message-ID: We have a special machine that, when you try to install CentOS on it, says there are no hard drives. The vendor gave us a zip file which we unzip and then do a "linux dd" to have it ask us for a driver disk which we then install. We would like to rebuild the Linux install DVD and CDS (which I know how to do) with this driver there that gets automatically found during installation somehow (probably via a kickstart file) or at the minimum give the user a menu of drivers with this one in it, and the user knows which to pick. Is this possible? Tony From jos at xos.nl Thu Feb 19 16:53:29 2009 From: jos at xos.nl (Jos Vos) Date: Thu, 19 Feb 2009 17:53:29 +0100 Subject: driver In-Reply-To: References: Message-ID: <20090219165329.GA19444@jasmine.xos.nl> On Thu, Feb 19, 2009 at 04:48:10PM +0000, tony.chamberlain at lemko.com wrote: > We have a special machine that, when you try to install CentOS on it, > says there are no hard drives. The vendor gave us a zip file which we > unzip and then do a "linux dd" to have it ask us for a driver disk which > we then install. > > We would like to rebuild the Linux install DVD and CDS (which I know how > to do) with this driver there that gets automatically found during > installation somehow (probably via a kickstart file) or at the minimum > give the user a menu of drivers with this one in it, and the user knows which > to pick. > > Is this possible? *If* the driverdisk works, yuou can address it in kickstart: driverdisk --source=http://host/path/to/dd.img (or ftp or nfs source paths, just like you specify a kickstart file on the boot prompt). -- -- Jos Vos -- X/OS Experts in Open Systems BV | Phone: +31 20 6938364 -- Amsterdam, The Netherlands | Fax: +31 20 6948204 From tony.chamberlain at lemko.com Thu Feb 19 17:41:09 2009 From: tony.chamberlain at lemko.com (tony.chamberlain at lemko.com) Date: Thu, 19 Feb 2009 17:41:09 +0000 Subject: driver Message-ID: -----Original Message----- From: Jos Vos [mailto:jos at xos.nl] Sent: Thursday, February 19, 2009 10:53 AM To: 'Discussion list about Kickstart' Subject: Re: driver On Thu, Feb 19, 2009 at 04:48:10PM +0000, tony.chamberlain at lemko.com wrote: > We have a special machine that, when you try to install CentOS on it, > says there are no hard drives. The vendor gave us a zip file which we > unzip and then do a "linux dd" to have it ask us for a driver disk which > we then install. > > We would like to rebuild the Linux install DVD and CDS (which I know how > to do) with this driver there that gets automatically found during > installation somehow (probably via a kickstart file) or at the minimum > give the user a menu of drivers with this one in it, and the user knows which > to pick. > > Is this possible? *If* the driverdisk works, yuou can address it in kickstart: driverdisk --source=http://host/path/to/dd.img (or ftp or nfs source paths, just like you specify a kickstart file on the boot prompt). ========================== The files they gave us, and that worked when we just inserted the memory stick and it found it, are listed below. I pleaced them into a directory called raiddisk. Can I just specify this directory (like cdrom:/addon/raiddisk or do I have to put a filename after raiddisk? These are the files: modules.alias modules.pcimap replace_ahci_readme.txt disk-info modules.cgz pci.ids replace_ahci.sh modinfo modules.dep pcitable rhdd My question is can I say driverdisk --source=cdrom:/addon/raiddrive/ in isolinux.cfg or do I have to say driverdisk --source=cdrom:/addon/raiddrive/SOMEFILE and if the second is true, what should SOMEFILE be? I have the files in a subdirectory under the CentOS4.5 directory where I succesfully made Centos installs before doing other stuff. It is in a subdir called addon/raiddrive From chip.shabazian at bankofamerica.com Thu Feb 19 18:15:11 2009 From: chip.shabazian at bankofamerica.com (Shabazian, Chip) Date: Thu, 19 Feb 2009 10:15:11 -0800 Subject: driver In-Reply-To: References: Message-ID: The driverdisk directive uses a disk image. If you can put the drivers on a floppy, then use dd to create an image of the floppy, that is what you reference. Also, you don't NEED a physical disk, you can do this all with loopback devices mounted, but if you don't know how to do that, just use a physical floppy so you can test it as well. Chip -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of tony.chamberlain at lemko.com Sent: Thursday, February 19, 2009 9:41 AM To: Discussion list about Kickstart Subject: Re: driver -----Original Message----- From: Jos Vos [mailto:jos at xos.nl] Sent: Thursday, February 19, 2009 10:53 AM To: 'Discussion list about Kickstart' Subject: Re: driver On Thu, Feb 19, 2009 at 04:48:10PM +0000, tony.chamberlain at lemko.com wrote: > We have a special machine that, when you try to install CentOS on it, > says there are no hard drives. The vendor gave us a zip file which we > unzip and then do a "linux dd" to have it ask us for a driver disk which > we then install. > > We would like to rebuild the Linux install DVD and CDS (which I know how > to do) with this driver there that gets automatically found during > installation somehow (probably via a kickstart file) or at the minimum > give the user a menu of drivers with this one in it, and the user knows which > to pick. > > Is this possible? *If* the driverdisk works, yuou can address it in kickstart: driverdisk --source=http://host/path/to/dd.img (or ftp or nfs source paths, just like you specify a kickstart file on the boot prompt). ========================== The files they gave us, and that worked when we just inserted the memory stick and it found it, are listed below. I pleaced them into a directory called raiddisk. Can I just specify this directory (like cdrom:/addon/raiddisk or do I have to put a filename after raiddisk? These are the files: modules.alias modules.pcimap replace_ahci_readme.txt disk-info modules.cgz pci.ids replace_ahci.sh modinfo modules.dep pcitable rhdd My question is can I say driverdisk --source=cdrom:/addon/raiddrive/ in isolinux.cfg or do I have to say driverdisk --source=cdrom:/addon/raiddrive/SOMEFILE and if the second is true, what should SOMEFILE be? I have the files in a subdirectory under the CentOS4.5 directory where I succesfully made Centos installs before doing other stuff. It is in a subdir called addon/raiddrive _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list From tony.chamberlain at lemko.com Fri Feb 20 13:35:17 2009 From: tony.chamberlain at lemko.com (tony.chamberlain at lemko.com) Date: Fri, 20 Feb 2009 13:35:17 +0000 Subject: driver Message-ID: I was able to take the directory with all the driver stuff in, put it and only it onto a thumb drive and do dd if=/dev/sdc1 of=raid.img I put it on a thumb drive because dd seems only to take devices not directories. Do you know how to make an img from a directory? Anyway I could access it via --driver source=http://192.168.5.18/raid.img (when I put it there). My KS file can be cdrom:/config/ks.cfg to get it right from the install disk. Doesn't seem to work with the driver disk though. Is that true? I tried --source=cdrom:/addon/raid.img where I placed it when I built the ISO image but when I installed it still said "do you have a driver disk?" (which means it couldn't find it). -----Original Message----- From: Shabazian, Chip [mailto:chip.shabazian at bankofamerica.com] Sent: Thursday, February 19, 2009 12:15 PM To: 'Discussion list about Kickstart' Subject: RE: driver The driverdisk directive uses a disk image. If you can put the drivers on a floppy, then use dd to create an image of the floppy, that is what you reference. Also, you don't NEED a physical disk, you can do this all with loopback devices mounted, but if you don't know how to do that, just use a physical floppy so you can test it as well. Chip -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of tony.chamberlain at lemko.com Sent: Thursday, February 19, 2009 9:41 AM To: Discussion list about Kickstart Subject: Re: driver -----Original Message----- From: Jos Vos [mailto:jos at xos.nl] Sent: Thursday, February 19, 2009 10:53 AM To: 'Discussion list about Kickstart' Subject: Re: driver On Thu, Feb 19, 2009 at 04:48:10PM +0000, tony.chamberlain at lemko.com wrote: > We have a special machine that, when you try to install CentOS on it, > says there are no hard drives. The vendor gave us a zip file which we > unzip and then do a "linux dd" to have it ask us for a driver disk which > we then install. > > We would like to rebuild the Linux install DVD and CDS (which I know how > to do) with this driver there that gets automatically found during > installation somehow (probably via a kickstart file) or at the minimum > give the user a menu of drivers with this one in it, and the user knows which > to pick. > > Is this possible? *If* the driverdisk works, yuou can address it in kickstart: driverdisk --source=http://host/path/to/dd.img (or ftp or nfs source paths, just like you specify a kickstart file on the boot prompt). ========================== The files they gave us, and that worked when we just inserted the memory stick and it found it, are listed below. I pleaced them into a directory called raiddisk. Can I just specify this directory (like cdrom:/addon/raiddisk or do I have to put a filename after raiddisk? These are the files: modules.alias modules.pcimap replace_ahci_readme.txt disk-info modules.cgz pci.ids replace_ahci.sh modinfo modules.dep pcitable rhdd My question is can I say driverdisk --source=cdrom:/addon/raiddrive/ in isolinux.cfg or do I have to say driverdisk --source=cdrom:/addon/raiddrive/SOMEFILE and if the second is true, what should SOMEFILE be? I have the files in a subdirectory under the CentOS4.5 directory where I succesfully made Centos installs before doing other stuff. It is in a subdir called addon/raiddrive _______________________________________________ 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 email at jasonkohles.com Fri Feb 20 16:50:17 2009 From: email at jasonkohles.com (Jason Kohles) Date: Fri, 20 Feb 2009 11:50:17 -0500 Subject: driver In-Reply-To: References: Message-ID: <400BA529-03ED-4F75-9576-8C9B9F04B044@jasonkohles.com> On Feb 20, 2009, at 8:35 AM, tony.chamberlain at lemko.com wrote: > I was able to take the directory with all the driver stuff in, > put it and only it onto a thumb drive and do dd if=/dev/sdc1 > of=raid.img > I put it on a thumb drive because dd seems only to take devices not > directories. Do you know how to make an img from a directory? > To make an image from a directory (assuming the directory is named raid_directory and the image should be named raid.img): # Figure out how much space you need host# du -ksh raid_directory 6M raid_directory # Make an empty file a little bit larger than that host# dd if=/dev/zero of=raid.img bs=1M count=7 7+0 records in 7+0 records out 7340032 bytes (7.3 MB) copied, 0.0836722 s, 87.7 MB/s # Create a filesystem on it host# mkfs.ext2 -F raid.img -L driverdisk mke2fs 1.41.3 (12-Oct-2008) Filesystem label=driverdisk OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) 1792 inodes, 7168 blocks 358 blocks (4.99%) reserved for the super user First data block=1 Maximum filesystem blocks=7340032 1 block group 8192 blocks per group, 8192 fragments per group 1792 inodes per group Writing inode tables: done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 33 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. # Mount it via loopback host# mount -o loop raid.img /mnt # Copy the directory contents to the mountpoint host# rsync -av raid_directory/ /mnt/ # Unmount it host# umount /mnt -- Jason Kohles, RHCA RHCDS RHCE email at jasonkohles.com - http://www.jasonkohles.com/ "A witty saying proves nothing." -- Voltaire From Joe_Wulf at yahoo.com Tue Feb 24 06:21:49 2009 From: Joe_Wulf at yahoo.com (Joe_Wulf) Date: Tue, 24 Feb 2009 01:21:49 -0500 Subject: chroot /path/to/start/in Multi-COMMAND In-Reply-To: <20090219165329.GA19444@jasmine.xos.nl> References: <20090219165329.GA19444@jasmine.xos.nl> Message-ID: Hi everyone I've got a script that works its magic on the local directory, since it could be anywhere (by design). In a %post --nochroot'd environment, I'd created the following command: chroot /mnt/sysimage ( cd /workingdir; myscript ) except kickstart errors it out, complianing about the open paren. I'd looked on the fedora anaconda/kickstart site for further guidance, but it doesn't even list chroot as an available command, much less document/explain it. I'm asking the group for advice on how to address this. Much thanks. R, -Joe Wulf From ian-list at securitypimp.com Tue Feb 24 15:21:38 2009 From: ian-list at securitypimp.com (Ian Lists) Date: Tue, 24 Feb 2009 15:21:38 +0000 (UTC) Subject: RHEL 5.3 Kickstart In-Reply-To: <26508708.2271235488628517.JavaMail.root@postal.insourcedsecurity.com> Message-ID: <15183618.2291235488898321.JavaMail.root@postal.insourcedsecurity.com> I am having an issue using disk 1 of RHEL 5.3x86_64 to start a install. I boot to the disk, put in the url to my kickstart server, set the IP and the kickstart looks like it starts. It grabs the kickstart file off the webserver, but when it starts looking for the install tree it fails. Has anything changed with the files it searches for in the tree? It doesn't seem like any of the files it is looking for are there. My tree is built from the 5.3 DVD. I see this in my apache logs. File does not exist: /var/www/cobbler/ks_mirror/RHEL-5.3-x86_64/disc1 File does not exist: /var/www/cobbler/ks_mirror/RHEL-5.3-x86_64/RELEASE-NOTES-en_US.UTF-8.html File does not exist: /var/www/cobbler/ks_mirror/RHEL-5.3-x86_64/RELEASE-NOTES.en_US.UTF-8 File does not exist: /var/www/cobbler/ks_mirror/RHEL-5.3-x86_64/RELEASE-NOTES-en_US.html File does not exist: /var/www/cobbler/ks_mirror/RHEL-5.3-x86_64/RELEASE-NOTES.en_US Thanks, Ian From kpowell at redhat.com Tue Feb 24 15:36:29 2009 From: kpowell at redhat.com (Kyle Powell) Date: Tue, 24 Feb 2009 10:36:29 -0500 Subject: chroot /path/to/start/in Multi-COMMAND In-Reply-To: References: <20090219165329.GA19444@jasmine.xos.nl> Message-ID: <49A413FD.30908@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joe_Wulf wrote: > Hi everyone > > I've got a script that works its magic on the local directory, since it could be > anywhere (by design). > In a %post --nochroot'd environment, I'd created the following command: > > chroot /mnt/sysimage ( cd /workingdir; myscript ) I'm not sure why you're running chroot in a %post --nochroot script. Seems like it'd be easier to just run "myscript" in a regular %post script. But you could give this a shot: chroot /mnt/sysimage /mnt/sysimage/workingdir/myscript This will run /mnt/sysimage/workingdir/myscript with /mnt/sysimage as /. > I'd looked on the fedora anaconda/kickstart site for further guidance, but it > doesn't even list > chroot as an available command, much less document/explain it. Because the chroot utility is not provided by anaconda. It's part of the coreutils package. - -- Kyle Powell | Red Hat | Senior Consultant, RHCE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFJpBP97pTtanQdBU4RAgbeAJ0QSXHzpOr7MYJkOwdg0rEKVgYB8QCeJuyh 7qwrRIiNQfq7A1thlDTcRGI= =1HTB -----END PGP SIGNATURE----- From joliver at john-oliver.net Tue Feb 24 15:53:01 2009 From: joliver at john-oliver.net (John Oliver) Date: Tue, 24 Feb 2009 07:53:01 -0800 Subject: chroot /path/to/start/in Multi-COMMAND In-Reply-To: References: <20090219165329.GA19444@jasmine.xos.nl> Message-ID: <20090224155301.GB30056@ns.sdsitehosting.net> On Tue, Feb 24, 2009 at 01:21:49AM -0500, Joe_Wulf wrote: > Hi everyone > > I've got a script that works its magic on the local directory, since it could be > anywhere (by design). > In a %post --nochroot'd environment, I'd created the following command: > > chroot /mnt/sysimage ( cd /workingdir; myscript ) > > except kickstart errors it out, complianing about the open paren. > > I'd looked on the fedora anaconda/kickstart site for further guidance, but it > doesn't even list > chroot as an available command, much less document/explain it. I deal with this by copying over a script that does this stuff to /tmp, then echo "/tmp/firstboot.sh" >> /etc/rc.d/rc.local The last couple of lines in firstboot.sh remove that line from rc.local and reboot the machine. It is a little messy, but it works, and I have the RPM db and such available to me because the system is actually running from the installed OS. -- *********************************************************************** * John Oliver http://www.john-oliver.net/ * * * *********************************************************************** From chip.shabazian at bankofamerica.com Tue Feb 24 17:05:35 2009 From: chip.shabazian at bankofamerica.com (Shabazian, Chip) Date: Tue, 24 Feb 2009 09:05:35 -0800 Subject: chroot /path/to/start/in Multi-COMMAND In-Reply-To: <20090224155301.GB30056@ns.sdsitehosting.net> References: <20090219165329.GA19444@jasmine.xos.nl> <20090224155301.GB30056@ns.sdsitehosting.net> Message-ID: Remember that you can run multiple %post sections, moving in and out of chroot as much as you want too: %post --nochroot All my non chrooted tasks %post All my chrooted tasks -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of John Oliver Sent: Tuesday, February 24, 2009 7:53 AM To: Discussion list about Kickstart Subject: Re: chroot /path/to/start/in Multi-COMMAND On Tue, Feb 24, 2009 at 01:21:49AM -0500, Joe_Wulf wrote: > Hi everyone > > I've got a script that works its magic on the local directory, since it could be > anywhere (by design). > In a %post --nochroot'd environment, I'd created the following command: > > chroot /mnt/sysimage ( cd /workingdir; myscript ) > > except kickstart errors it out, complianing about the open paren. > > I'd looked on the fedora anaconda/kickstart site for further guidance, but it > doesn't even list > chroot as an available command, much less document/explain it. I deal with this by copying over a script that does this stuff to /tmp, then echo "/tmp/firstboot.sh" >> /etc/rc.d/rc.local The last couple of lines in firstboot.sh remove that line from rc.local and reboot the machine. It is a little messy, but it works, and I have the RPM db and such available to me because the system is actually running from the installed OS. -- *********************************************************************** * 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 stan.hearn at nscorp.com Tue Feb 24 19:05:56 2009 From: stan.hearn at nscorp.com (Hearn, Stan J.) Date: Tue, 24 Feb 2009 14:05:56 -0500 Subject: kickstart post chroot section logging In-Reply-To: <49A413FD.30908@redhat.com> References: <49A413FD.30908@redhat.com> Message-ID: If I'm running a post chroot then the log file specified should be relative to the chroot root (/), right? %post --log=/var/log/anac-ks-post-chrootcfg.log and not %post --log=/mnt/sysimage/var/log/anac-ks-post-chrootcfg.log I'm getting an error in anacdump.txt IOError: [Errno 2] No such file or directory: '/var/log/anac-ks-post-chrootcfg.log' Or does this change mid-stream depending on which version of RHEL I'm kickstarting? I think it was working on RHEL4. Thanks, Stan From Joe_Wulf at yahoo.com Wed Feb 25 06:31:54 2009 From: Joe_Wulf at yahoo.com (Joe_Wulf) Date: Wed, 25 Feb 2009 01:31:54 -0500 Subject: chroot /path/to/start/in Multi-COMMAND In-Reply-To: <49A413FD.30908@redhat.com> References: <20090219165329.GA19444@jasmine.xos.nl> <49A413FD.30908@redhat.com> Message-ID: To Kyle, John and Shabazian---thank you each for your replies to my problem. Ended up tweaking the script so that it took an argument, which I conveniently passed to it, of the dir it was acting on. R, -Joe Wulf, CISSP, VCP, USN(RET) Senior IA Engineer ProSync Technology Group, LLC www.prosync.com -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Kyle Powell Sent: Tuesday, February 24, 2009 10:36 To: Discussion list about Kickstart Subject: Re: chroot /path/to/start/in Multi-COMMAND -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joe_Wulf wrote: > Hi everyone > > I've got a script that works its magic on the local directory, since > it could be anywhere (by design). > In a %post --nochroot'd environment, I'd created the following command: > > chroot /mnt/sysimage ( cd /workingdir; myscript ) I'm not sure why you're running chroot in a %post --nochroot script. Seems like it'd be easier to just run "myscript" in a regular %post script. But you could give this a shot: chroot /mnt/sysimage /mnt/sysimage/workingdir/myscript This will run /mnt/sysimage/workingdir/myscript with /mnt/sysimage as /. > I'd looked on the fedora anaconda/kickstart site for further guidance, > but it doesn't even list chroot as an available command, much less > document/explain it. Because the chroot utility is not provided by anaconda. It's part of the coreutils package. - -- Kyle Powell | Red Hat | Senior Consultant, RHCE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFJpBP97pTtanQdBU4RAgbeAJ0QSXHzpOr7MYJkOwdg0rEKVgYB8QCeJuyh 7qwrRIiNQfq7A1thlDTcRGI= =1HTB -----END PGP SIGNATURE----- _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list From larry.brigman at gmail.com Wed Feb 25 22:22:18 2009 From: larry.brigman at gmail.com (Larry Brigman) Date: Wed, 25 Feb 2009 14:22:18 -0800 Subject: ethernet detection Message-ID: I am doing kickstart with RHEL5(.3) and IBM x3650 servers. We have Intel IGB GigE cards installed in these machines and sometimes when we do the pxeboot install, it picks the IGB device as eth0 which is on the PCI-E bus and misses the Broadcom BNX2 device on the motherboard. Is there a way to detect or control this process. We specify eth0 as our ksdevice. BTW this is using the newer Red hat kernel, 2.6.18-128.