The included changes add support for a new architecture 'ppc64'. Any cobbler imports on a ppc tree will detect and add the appropriate distro's and profiles for the ppc32 or ppc64 if applicable. For example:
$ cobbler import --name rawhide --path /mnt/rawhide/nightly/rawhide-20081113/ppc/os --available-as http://gromit.redhat.com/pub/fedora/linux/development/ppc/os ---------------- (adding distros) - found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc32 - creating new distro: rawhide-ppc - creating new profile: rawhide-ppc - creating new profile: rescue-rawhide-ppc - found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc64 - creating new distro: rawhide-ppc64 - creating new profile: rawhide-ppc64 - creating new profile: rescue-rawhide-ppc64 ---------------- (associating kickstarts) - found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc32 --os-version for breed redhat must be one of rhel2.1, rhel3, rhel4, rhel5, fedora5, fedora6, fedora7, fedora8, fedora9, fedora10, generic24, generic26, other, given was rhel9
$ cobbler import --name RHEL-5-Server-U2 --path /mnt/redhat/released/RHEL-5-Server/U2/ppc/os --available-as http://porkchop.redhat.com/released/RHEL-5-Server/U2/ppc/os ---------------- (adding distros) - found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64 - creating new distro: RHEL-5-Server-U2-ppc64 - creating new profile: RHEL-5-Server-U2-ppc64 - creating new profile: rescue-RHEL-5-Server-U2-ppc64 ---------------- (associating kickstarts) - found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64 - found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64 ---------------- (syncing)
$ cobbler import --name RHEL-4-U7-AS --path /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree --available-as http://porkchop.redhat.com/released/RHEL-4/U7/AS/ppc/tree ---------------- (adding distros) - found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp - creating new distro: RHEL-4-U7-AS-ppc64 - creating new profile: RHEL-4-U7-AS-ppc64 - creating new profile: rescue-RHEL-4-U7-AS-ppc64 ---------------- (associating kickstarts) - found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp - found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp ---------------- (syncing)
Comments welcome/appreciated.
Thanks, James --- cobbler/action_import.py | 22 +++++++++++++++------- cobbler/utils.py | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/cobbler/action_import.py b/cobbler/action_import.py index 2808340..f22395a 100644 --- a/cobbler/action_import.py +++ b/cobbler/action_import.py @@ -88,8 +88,8 @@ class Importer: if self.arch == "x86": # be consistent self.arch = "i386" - if self.arch not in [ "i386", "ia64", "ppc", "s390x", "x86_64", ]: - raise CX(_("arch must be i386, ia64, ppc, s390x or x86_64")) + if self.arch not in [ "i386", "ia64", "ppc", "ppc64", "s390x", "x86_64", ]: + raise CX(_("arch must be i386, ia64, ppc, ppc64, s390x or x86_64"))
# if we're going to do any copying, set where to put things # and then make sure nothing is already there. @@ -113,7 +113,7 @@ class Importer: if self.arch: # append the arch path to the name if the arch is not already # found in the name. - for x in [ "i386", "ia64", "ppc", "s390x", "x86_64", "x86", ]: + for x in [ "i386", "ia64", "ppc", "ppc64", "s390x", "x86_64", "x86", ]: if self.mirror_name.lower().find(x) != -1: if self.arch != x : raise CX(_("Architecture found on pathname (%s) does not fit the one given in command line (%s)")%(x,self.arch)) @@ -679,8 +679,10 @@ class Importer:
# remove any architecture name related string, as real arch will be appended later
+ name = name.replace("chrp","ppc64") + for separator in [ '-' , '_' , '.' ] : - for arch in [ "i386" , "x86_64" , "ia64" , "x86" , "s390x" , "ppc", "386" , "amd" ]: + for arch in [ "i386" , "x86_64" , "ia64" , "ppc64", "ppc32", "ppc", "x86" , "s390x" , "386" , "amd" ]: name = name.replace("%s%s" % ( separator , arch ),"")
return name @@ -700,6 +702,10 @@ class Importer: return "i386" if dirname.find("s390") != -1: return "s390x" + if dirname.find("ppc64") != -1 or dirname.find("chrp") != -1: + return "ppc64" + if dirname.find("ppc32") != -1: + return "ppc" if dirname.find("ppc") != -1: return "ppc" return None @@ -728,6 +734,7 @@ def guess_breed(kerneldir,path): [ 'CentOS/rpms' , "redhat" ], [ 'CentOS' , "redhat" ], [ 'Packages' , "redhat" ], + [ 'Fedora' , "redhat" ], [ 'Server' , "redhat" ], ] guess = None @@ -812,7 +819,7 @@ class BaseImporter: for x in fnames: if self.match_kernelarch_file(x): # print _("- kernel header found: %s") % x - for arch in [ "i386" , "x86_64" , "ia64" , "ppc", "s390x" ]: + for arch in [ "i386" , "x86_64" , "ia64" , "ppc64", "ppc", "s390x" ]: if x.find(arch) != -1: foo[arch] = 1 for arch in [ "i686" , "amd64" ]: @@ -892,8 +899,9 @@ class RedHatImporter ( BaseImporter ) :
if not filename.endswith("rpm") and not filename.endswith("deb"): return False - if filename.find("kernel-header") != -1 or filename.find("kernel-source") != -1 or filename.find("kernel-smp") !=- 1 or filename.find("kernel-largesmp") != -1 or filename.find("kernel-hugemem") != -1 or filename.find("linux-headers-") != -1: - return True + for match in ["kernel-header", "kernel-source", "kernel-smp", "kernel-largesmp", "kernel-hugemem", "linux-headers-", "kernel-devel", "kernel-"]: + if filename.find(match) != -1: + return True return False
# ================================================================ diff --git a/cobbler/utils.py b/cobbler/utils.py index 539ff81..9c3c967 100644 --- a/cobbler/utils.py +++ b/cobbler/utils.py @@ -886,13 +886,13 @@ def mkdir(path,mode=0777): raise CX(_("Error creating") % path)
def set_arch(self,arch): - if arch in [ "standard", "ia64", "x86", "i386", "ppc", "x86_64", "s390x" ]: + if arch in [ "standard", "ia64", "x86", "i386", "ppc", "ppc64", "x86_64", "s390x" ]: if arch == "x86" or arch == "standard": # be consistent arch = "i386" self.arch = arch return True - raise CX(_("arch choices include: x86, x86_64, ppc, s390x and ia64")) + raise CX(_("arch choices include: x86, x86_64, ppc, ppc64, s390x and ia64"))
def set_os_version(self,os_version): if os_version is None:
James Laska wrote:
The included changes add support for a new architecture 'ppc64'. Any cobbler imports on a ppc tree will detect and add the appropriate distro's and profiles for the ppc32 or ppc64 if applicable. For example:
Will merge this in and test shortly, looks like you might have missed webui_templates/distro_edit.tmpl, which also contains an arch field.
--Michael
$ cobbler import --name rawhide --path /mnt/rawhide/nightly/rawhide-20081113/ppc/os --available-as http://gromit.redhat.com/pub/fedora/linux/development/ppc/os ---------------- (adding distros)
- found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc32
- creating new distro: rawhide-ppc
- creating new profile: rawhide-ppc
- creating new profile: rescue-rawhide-ppc
- found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc64
- creating new distro: rawhide-ppc64
- creating new profile: rawhide-ppc64
- creating new profile: rescue-rawhide-ppc64
---------------- (associating kickstarts)
- found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc32
--os-version for breed redhat must be one of rhel2.1, rhel3, rhel4, rhel5, fedora5, fedora6, fedora7, fedora8, fedora9, fedora10, generic24, generic26, other, given was rhel9
$ cobbler import --name RHEL-5-Server-U2 --path /mnt/redhat/released/RHEL-5-Server/U2/ppc/os --available-as http://porkchop.redhat.com/released/RHEL-5-Server/U2/ppc/os ---------------- (adding distros)
- found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64
- creating new distro: RHEL-5-Server-U2-ppc64
- creating new profile: RHEL-5-Server-U2-ppc64
- creating new profile: rescue-RHEL-5-Server-U2-ppc64
---------------- (associating kickstarts)
- found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64
- found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64
---------------- (syncing)
$ cobbler import --name RHEL-4-U7-AS --path /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree --available-as http://porkchop.redhat.com/released/RHEL-4/U7/AS/ppc/tree ---------------- (adding distros)
- found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp
- creating new distro: RHEL-4-U7-AS-ppc64
- creating new profile: RHEL-4-U7-AS-ppc64
- creating new profile: rescue-RHEL-4-U7-AS-ppc64
---------------- (associating kickstarts)
- found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp
- found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp
---------------- (syncing)
Comments welcome/appreciated.
Thanks, James
cobbler/action_import.py | 22 +++++++++++++++------- cobbler/utils.py | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/cobbler/action_import.py b/cobbler/action_import.py index 2808340..f22395a 100644 --- a/cobbler/action_import.py +++ b/cobbler/action_import.py @@ -88,8 +88,8 @@ class Importer: if self.arch == "x86": # be consistent self.arch = "i386"
if self.arch not in [ "i386", "ia64", "ppc", "s390x", "x86_64", ]:
raise CX(_("arch must be i386, ia64, ppc, s390x or x86_64"))
if self.arch not in [ "i386", "ia64", "ppc", "ppc64", "s390x", "x86_64", ]:
raise CX(_("arch must be i386, ia64, ppc, ppc64, s390x or x86_64")) # if we're going to do any copying, set where to put things # and then make sure nothing is already there.
@@ -113,7 +113,7 @@ class Importer: if self.arch: # append the arch path to the name if the arch is not already # found in the name.
for x in [ "i386", "ia64", "ppc", "s390x", "x86_64", "x86", ]:
for x in [ "i386", "ia64", "ppc", "ppc64", "s390x", "x86_64", "x86", ]: if self.mirror_name.lower().find(x) != -1: if self.arch != x : raise CX(_("Architecture found on pathname (%s) does not fit the one given in command line (%s)")%(x,self.arch))
@@ -679,8 +679,10 @@ class Importer:
# remove any architecture name related string, as real arch will be appended later
name = name.replace("chrp","ppc64")
for separator in [ '-' , '_' , '.' ] :
for arch in [ "i386" , "x86_64" , "ia64" , "x86" , "s390x" , "ppc", "386" , "amd" ]:
for arch in [ "i386" , "x86_64" , "ia64" , "ppc64", "ppc32", "ppc", "x86" , "s390x" , "386" , "amd" ]: name = name.replace("%s%s" % ( separator , arch ),"") return name
@@ -700,6 +702,10 @@ class Importer: return "i386" if dirname.find("s390") != -1: return "s390x"
if dirname.find("ppc64") != -1 or dirname.find("chrp") != -1:
return "ppc64"
if dirname.find("ppc32") != -1:
return "ppc" if dirname.find("ppc") != -1: return "ppc" return None
@@ -728,6 +734,7 @@ def guess_breed(kerneldir,path): [ 'CentOS/rpms' , "redhat" ], [ 'CentOS' , "redhat" ], [ 'Packages' , "redhat" ],
] guess = None[ 'Fedora' , "redhat" ], [ 'Server' , "redhat" ],
@@ -812,7 +819,7 @@ class BaseImporter: for x in fnames: if self.match_kernelarch_file(x): # print _("- kernel header found: %s") % x
for arch in [ "i386" , "x86_64" , "ia64" , "ppc", "s390x" ]:
for arch in [ "i386" , "x86_64" , "ia64" , "ppc64", "ppc", "s390x" ]: if x.find(arch) != -1: foo[arch] = 1 for arch in [ "i686" , "amd64" ]:
@@ -892,8 +899,9 @@ class RedHatImporter ( BaseImporter ) :
if not filename.endswith("rpm") and not filename.endswith("deb"): return False
if filename.find("kernel-header") != -1 or filename.find("kernel-source") != -1 or filename.find("kernel-smp") !=- 1 or filename.find("kernel-largesmp") != -1 or filename.find("kernel-hugemem") != -1 or filename.find("linux-headers-") != -1:
return True
for match in ["kernel-header", "kernel-source", "kernel-smp", "kernel-largesmp", "kernel-hugemem", "linux-headers-", "kernel-devel", "kernel-"]:
if filename.find(match) != -1:
return True return False
# ================================================================
diff --git a/cobbler/utils.py b/cobbler/utils.py index 539ff81..9c3c967 100644 --- a/cobbler/utils.py +++ b/cobbler/utils.py @@ -886,13 +886,13 @@ def mkdir(path,mode=0777): raise CX(_("Error creating") % path)
def set_arch(self,arch):
- if arch in [ "standard", "ia64", "x86", "i386", "ppc", "x86_64", "s390x" ]:
- if arch in [ "standard", "ia64", "x86", "i386", "ppc", "ppc64", "x86_64", "s390x" ]: if arch == "x86" or arch == "standard": # be consistent arch = "i386" self.arch = arch return True
- raise CX(_("arch choices include: x86, x86_64, ppc, s390x and ia64"))
- raise CX(_("arch choices include: x86, x86_64, ppc, ppc64, s390x and ia64"))
def set_os_version(self,os_version): if os_version is None:
The included changes add support for a new architecture 'ppc64'. Any cobbler imports on a ppc tree will detect and add the appropriate distro's and profiles for the ppc32 or ppc64 if applicable. For example:
$ cobbler import --name rawhide --path /mnt/rawhide/nightly/rawhide-20081113/ppc/os --available-as http://gromit.redhat.com/pub/fedora/linux/development/ppc/os ---------------- (adding distros) - found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc32 - creating new distro: rawhide-ppc - creating new profile: rawhide-ppc - creating new profile: rescue-rawhide-ppc - found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc64 - creating new distro: rawhide-ppc64 - creating new profile: rawhide-ppc64 - creating new profile: rescue-rawhide-ppc64 ---------------- (associating kickstarts) - found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc32 --os-version for breed redhat must be one of rhel2.1, rhel3, rhel4, rhel5, fedora5, fedora6, fedora7, fedora8, fedora9, fedora10, generic24, generic26, other, given was rhel9
$ cobbler import --name RHEL-5-Server-U2 --path /mnt/redhat/released/RHEL-5-Server/U2/ppc/os --available-as http://porkchop.redhat.com/released/RHEL-5-Server/U2/ppc/os ---------------- (adding distros) - found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64 - creating new distro: RHEL-5-Server-U2-ppc64 - creating new profile: RHEL-5-Server-U2-ppc64 - creating new profile: rescue-RHEL-5-Server-U2-ppc64 ---------------- (associating kickstarts) - found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64 - found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64 ---------------- (syncing)
$ cobbler import --name RHEL-4-U7-AS --path /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree --available-as http://porkchop.redhat.com/released/RHEL-4/U7/AS/ppc/tree ---------------- (adding distros) - found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp - creating new distro: RHEL-4-U7-AS-ppc64 - creating new profile: RHEL-4-U7-AS-ppc64 - creating new profile: rescue-RHEL-4-U7-AS-ppc64 ---------------- (associating kickstarts) - found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp - found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp ---------------- (syncing)
Comments welcome/appreciated.
Thanks, James --- cobbler/action_import.py | 22 +++++++++++++++------- cobbler/utils.py | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/cobbler/action_import.py b/cobbler/action_import.py index 2808340..f22395a 100644 --- a/cobbler/action_import.py +++ b/cobbler/action_import.py @@ -88,8 +88,8 @@ class Importer: if self.arch == "x86": # be consistent self.arch = "i386" - if self.arch not in [ "i386", "ia64", "ppc", "s390x", "x86_64", ]: - raise CX(_("arch must be i386, ia64, ppc, s390x or x86_64")) + if self.arch not in [ "i386", "ia64", "ppc", "ppc64", "s390x", "x86_64", ]: + raise CX(_("arch must be i386, ia64, ppc, ppc64, s390x or x86_64"))
# if we're going to do any copying, set where to put things # and then make sure nothing is already there. @@ -113,7 +113,7 @@ class Importer: if self.arch: # append the arch path to the name if the arch is not already # found in the name. - for x in [ "i386", "ia64", "ppc", "s390x", "x86_64", "x86", ]: + for x in [ "i386", "ia64", "ppc", "ppc64", "s390x", "x86_64", "x86", ]: if self.mirror_name.lower().find(x) != -1: if self.arch != x : raise CX(_("Architecture found on pathname (%s) does not fit the one given in command line (%s)")%(x,self.arch)) @@ -679,8 +679,10 @@ class Importer:
# remove any architecture name related string, as real arch will be appended later
+ name = name.replace("chrp","ppc64") + for separator in [ '-' , '_' , '.' ] : - for arch in [ "i386" , "x86_64" , "ia64" , "x86" , "s390x" , "ppc", "386" , "amd" ]: + for arch in [ "i386" , "x86_64" , "ia64" , "ppc64", "ppc32", "ppc", "x86" , "s390x" , "386" , "amd" ]: name = name.replace("%s%s" % ( separator , arch ),"")
return name @@ -700,6 +702,10 @@ class Importer: return "i386" if dirname.find("s390") != -1: return "s390x" + if dirname.find("ppc64") != -1 or dirname.find("chrp") != -1: + return "ppc64" + if dirname.find("ppc32") != -1: + return "ppc" if dirname.find("ppc") != -1: return "ppc" return None @@ -728,6 +734,7 @@ def guess_breed(kerneldir,path): [ 'CentOS/rpms' , "redhat" ], [ 'CentOS' , "redhat" ], [ 'Packages' , "redhat" ], + [ 'Fedora' , "redhat" ], [ 'Server' , "redhat" ], ] guess = None @@ -812,7 +819,7 @@ class BaseImporter: for x in fnames: if self.match_kernelarch_file(x): # print _("- kernel header found: %s") % x - for arch in [ "i386" , "x86_64" , "ia64" , "ppc", "s390x" ]: + for arch in [ "i386" , "x86_64" , "ia64" , "ppc64", "ppc", "s390x" ]: if x.find(arch) != -1: foo[arch] = 1 for arch in [ "i686" , "amd64" ]: @@ -892,8 +899,9 @@ class RedHatImporter ( BaseImporter ) :
if not filename.endswith("rpm") and not filename.endswith("deb"): return False - if filename.find("kernel-header") != -1 or filename.find("kernel-source") != -1 or filename.find("kernel-smp") !=- 1 or filename.find("kernel-largesmp") != -1 or filename.find("kernel-hugemem") != -1 or filename.find("linux-headers-") != -1: - return True + for match in ["kernel-header", "kernel-source", "kernel-smp", "kernel-largesmp", "kernel-hugemem", "linux-headers-", "kernel-devel", "kernel-"]: + if filename.find(match) != -1: + return True return False
# ================================================================ diff --git a/cobbler/utils.py b/cobbler/utils.py index 539ff81..9c3c967 100644 --- a/cobbler/utils.py +++ b/cobbler/utils.py @@ -886,13 +886,13 @@ def mkdir(path,mode=0777): raise CX(_("Error creating") % path)
def set_arch(self,arch): - if arch in [ "standard", "ia64", "x86", "i386", "ppc", "x86_64", "s390x" ]: + if arch in [ "standard", "ia64", "x86", "i386", "ppc", "ppc64", "x86_64", "s390x" ]: if arch == "x86" or arch == "standard": # be consistent arch = "i386" self.arch = arch return True - raise CX(_("arch choices include: x86, x86_64, ppc, s390x and ia64")) + raise CX(_("arch choices include: x86, x86_64, ppc, ppc64, s390x and ia64"))
def set_os_version(self,os_version): if os_version is None:
Oops apologies. Didn't mean to include the original patch in the 2nd round of emails.
Thanks, James
On Tue, 2008-11-18 at 11:57 -0500, James Laska wrote:
The included changes add support for a new architecture 'ppc64'. Any cobbler imports on a ppc tree will detect and add the appropriate distro's and profiles for the ppc32 or ppc64 if applicable. For example:
$ cobbler import --name rawhide --path /mnt/rawhide/nightly/rawhide-20081113/ppc/os --available-as http://gromit.redhat.com/pub/fedora/linux/development/ppc/os ---------------- (adding distros)
- found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc32
- creating new distro: rawhide-ppc
- creating new profile: rawhide-ppc
- creating new profile: rescue-rawhide-ppc
- found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc64
- creating new distro: rawhide-ppc64
- creating new profile: rawhide-ppc64
- creating new profile: rescue-rawhide-ppc64
---------------- (associating kickstarts)
- found content (breed=redhat) at /mnt/rawhide/nightly/rawhide-20081113/ppc/os/ppc/ppc32
--os-version for breed redhat must be one of rhel2.1, rhel3, rhel4, rhel5, fedora5, fedora6, fedora7, fedora8, fedora9, fedora10, generic24, generic26, other, given was rhel9
$ cobbler import --name RHEL-5-Server-U2 --path /mnt/redhat/released/RHEL-5-Server/U2/ppc/os --available-as http://porkchop.redhat.com/released/RHEL-5-Server/U2/ppc/os ---------------- (adding distros)
- found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64
- creating new distro: RHEL-5-Server-U2-ppc64
- creating new profile: RHEL-5-Server-U2-ppc64
- creating new profile: rescue-RHEL-5-Server-U2-ppc64
---------------- (associating kickstarts)
- found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64
- found content (breed=redhat) at /mnt/redhat/released/RHEL-5-Server/U2/ppc/os/ppc/ppc64
---------------- (syncing)
$ cobbler import --name RHEL-4-U7-AS --path /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree --available-as http://porkchop.redhat.com/released/RHEL-4/U7/AS/ppc/tree ---------------- (adding distros)
- found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp
- creating new distro: RHEL-4-U7-AS-ppc64
- creating new profile: RHEL-4-U7-AS-ppc64
- creating new profile: rescue-RHEL-4-U7-AS-ppc64
---------------- (associating kickstarts)
- found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp
- found content (breed=redhat) at /mnt/redhat/released/RHEL-4/U7/AS/ppc/tree/ppc/chrp
---------------- (syncing)
Comments welcome/appreciated.
Thanks, James
cobbler/action_import.py | 22 +++++++++++++++------- cobbler/utils.py | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/cobbler/action_import.py b/cobbler/action_import.py index 2808340..f22395a 100644 --- a/cobbler/action_import.py +++ b/cobbler/action_import.py @@ -88,8 +88,8 @@ class Importer: if self.arch == "x86": # be consistent self.arch = "i386"
if self.arch not in [ "i386", "ia64", "ppc", "s390x", "x86_64", ]:
raise CX(_("arch must be i386, ia64, ppc, s390x or x86_64"))
if self.arch not in [ "i386", "ia64", "ppc", "ppc64", "s390x", "x86_64", ]:
raise CX(_("arch must be i386, ia64, ppc, ppc64, s390x or x86_64")) # if we're going to do any copying, set where to put things # and then make sure nothing is already there.
@@ -113,7 +113,7 @@ class Importer: if self.arch: # append the arch path to the name if the arch is not already # found in the name.
for x in [ "i386", "ia64", "ppc", "s390x", "x86_64", "x86", ]:
for x in [ "i386", "ia64", "ppc", "ppc64", "s390x", "x86_64", "x86", ]: if self.mirror_name.lower().find(x) != -1: if self.arch != x : raise CX(_("Architecture found on pathname (%s) does not fit the one given in command line (%s)")%(x,self.arch))
@@ -679,8 +679,10 @@ class Importer:
# remove any architecture name related string, as real arch will be appended later
name = name.replace("chrp","ppc64")
for separator in [ '-' , '_' , '.' ] :
for arch in [ "i386" , "x86_64" , "ia64" , "x86" , "s390x" , "ppc", "386" , "amd" ]:
for arch in [ "i386" , "x86_64" , "ia64" , "ppc64", "ppc32", "ppc", "x86" , "s390x" , "386" , "amd" ]: name = name.replace("%s%s" % ( separator , arch ),"") return name
@@ -700,6 +702,10 @@ class Importer: return "i386" if dirname.find("s390") != -1: return "s390x"
if dirname.find("ppc64") != -1 or dirname.find("chrp") != -1:
return "ppc64"
if dirname.find("ppc32") != -1:
return "ppc" if dirname.find("ppc") != -1: return "ppc" return None
@@ -728,6 +734,7 @@ def guess_breed(kerneldir,path): [ 'CentOS/rpms' , "redhat" ], [ 'CentOS' , "redhat" ], [ 'Packages' , "redhat" ],
] guess = None[ 'Fedora' , "redhat" ], [ 'Server' , "redhat" ],
@@ -812,7 +819,7 @@ class BaseImporter: for x in fnames: if self.match_kernelarch_file(x): # print _("- kernel header found: %s") % x
for arch in [ "i386" , "x86_64" , "ia64" , "ppc", "s390x" ]:
for arch in [ "i386" , "x86_64" , "ia64" , "ppc64", "ppc", "s390x" ]: if x.find(arch) != -1: foo[arch] = 1 for arch in [ "i686" , "amd64" ]:
@@ -892,8 +899,9 @@ class RedHatImporter ( BaseImporter ) :
if not filename.endswith("rpm") and not filename.endswith("deb"): return False
if filename.find("kernel-header") != -1 or filename.find("kernel-source") != -1 or filename.find("kernel-smp") !=- 1 or filename.find("kernel-largesmp") != -1 or filename.find("kernel-hugemem") != -1 or filename.find("linux-headers-") != -1:
return True
for match in ["kernel-header", "kernel-source", "kernel-smp", "kernel-largesmp", "kernel-hugemem", "linux-headers-", "kernel-devel", "kernel-"]:
if filename.find(match) != -1:
return True return False
# ================================================================
diff --git a/cobbler/utils.py b/cobbler/utils.py index 539ff81..9c3c967 100644 --- a/cobbler/utils.py +++ b/cobbler/utils.py @@ -886,13 +886,13 @@ def mkdir(path,mode=0777): raise CX(_("Error creating") % path)
def set_arch(self,arch):
- if arch in [ "standard", "ia64", "x86", "i386", "ppc", "x86_64", "s390x" ]:
- if arch in [ "standard", "ia64", "x86", "i386", "ppc", "ppc64", "x86_64", "s390x" ]: if arch == "x86" or arch == "standard": # be consistent arch = "i386" self.arch = arch return True
- raise CX(_("arch choices include: x86, x86_64, ppc, s390x and ia64"))
- raise CX(_("arch choices include: x86, x86_64, ppc, ppc64, s390x and ia64"))
def set_os_version(self,os_version): if os_version is None:
--- webui_templates/distro_edit.tmpl | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/webui_templates/distro_edit.tmpl b/webui_templates/distro_edit.tmpl index 8681d8a..2e772b4 100644 --- a/webui_templates/distro_edit.tmpl +++ b/webui_templates/distro_edit.tmpl @@ -151,6 +151,18 @@ function disablename(value) <input type="radio" name="arch" id="arch" value="x86_64">x86_64 #end if
+ #if $distro and $distro.arch == "ppc" + <input type="radio" name="arch" id="arch" value="ppc" checked>ppc + #else + <input type="radio" name="arch" id="arch" value="ppc">ppc + #end if + + #if $distro and $distro.arch == "ppc64" + <input type="radio" name="arch" id="arch" value="ppc64" checked>ppc64 + #else + <input type="radio" name="arch" id="arch" value="ppc64">ppc64 + #end if + #if $distro and $distro.arch == "s390x" <input type="radio" name="arch" id="arch" value="s390x" checked>s390x #else
--- webui_templates/repo_edit.tmpl | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/webui_templates/repo_edit.tmpl b/webui_templates/repo_edit.tmpl index 3ed74a9..6ac2de4 100644 --- a/webui_templates/repo_edit.tmpl +++ b/webui_templates/repo_edit.tmpl @@ -218,6 +218,16 @@ function disablename(value) #else <input type="radio" name="arch" id="arch" value="x86_64">x86_64 #end if + #if $repo and $repo.arch == "ppc" + <input type="radio" name="arch" id="arch" value="ppc" checked>ppc + #else + <input type="radio" name="arch" id="arch" value="ppc">ppc + #end if + #if $repo and $repo.arch == "ppc64" + <input type="radio" name="arch" id="arch" value="ppc64" checked>ppc64 + #else + <input type="radio" name="arch" id="arch" value="ppc64">ppc64 + #end if #if $repo and $repo.arch == "s390x" <input type="radio" name="arch" id="arch" value="s390x" checked>s390x #else
cobbler@lists.fedorahosted.org