diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-10-15 13:46:21 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-10-15 13:46:21 -0400 |
commit | 23c6f54f7f565ebe92e4f2de95213565e987eb68 (patch) | |
tree | cb17179186fd25972f6f0444459262177412730d | |
parent | b5b94ca6bbde852de822445fba63d03140c6d9b8 (diff) | |
download | cobbler-23c6f54f7f565ebe92e4f2de95213565e987eb68.tar.gz cobbler-23c6f54f7f565ebe92e4f2de95213565e987eb68.tar.xz cobbler-23c6f54f7f565ebe92e4f2de95213565e987eb68.zip |
Apply JP's Debian import patch
-rw-r--r-- | cobbler/action_import.py | 38 | ||||
-rw-r--r-- | cobbler/codes.py | 4 | ||||
-rw-r--r-- | cobbler/pxegen.py | 3 | ||||
-rw-r--r-- | kickstarts/sample.seed | 11 |
4 files changed, 39 insertions, 17 deletions
diff --git a/cobbler/action_import.py b/cobbler/action_import.py index fe67923f..dea0f5e7 100644 --- a/cobbler/action_import.py +++ b/cobbler/action_import.py @@ -294,14 +294,11 @@ class Importer: """ base = importer.get_rootdir() - dest_link = os.path.join(self.settings.webdir, "links", distro.name) - - meta = distro.ks_meta - - # create the links directory only if we are mirroring because with - # SELinux Apache can't symlink to NFS (without some doing) if self.network_root is None: + dest_link = os.path.join(self.settings.webdir, "links", distro.name) + # create the links directory only if we are mirroring because with + # SELinux Apache can't symlink to NFS (without some doing) if not os.path.exists(dest_link): try: os.symlink(base, dest_link) @@ -309,17 +306,18 @@ class Importer: # this shouldn't happen but I've seen it ... debug ... print _("- symlink creation failed: %(base)s, %(dest)s") % { "base" : base, "dest" : dest_link } # how we set the tree depends on whether an explicit network_root was specified - meta["tree"] = "http://@@http_server@@/cblr/links/%s" % (distro.name) + tree = "http://@@http_server@@/cblr/links/%s" % (distro.name) + importer.set_install_tree( distro, tree) else: # where we assign the kickstart source is relative to our current directory # and the input start directory in the crawl. We find the path segments # between and tack them on the network source path to find the explicit # network path to the distro that Anaconda can digest. tail = self.path_tail(self.path, base) - meta["tree"] = self.network_root[:-1] + tail + tree = self.network_root[:-1] + tail + importer.set_install_tree( distro, tree) # print _("- tree: %s") % meta["tree"] - distro.set_ksmeta(meta) # ============================================================================ @@ -817,6 +815,11 @@ class BaseImporter: # =================================================================== + def set_install_tree(self, distro, url): + distro.ks_meta["tree"] = url + + # =================================================================== + def learn_arch_from_tree(self): """ If a distribution is imported from DVD, there is a good chance the path doesn't @@ -994,12 +997,23 @@ class DebianImporter ( BaseImporter ) : def set_variance(self, flavor, major, minor): - dist_names = { '4.0' : "Etch" , '5.0' : "Lenny" } + dist_names = { '4.0' : "etch" , '5.0' : "lenny" } dist_vers = "%s.%s" % ( major , minor ) - os_version = "debian%s" % dist_names[dist_vers] + os_version = dist_names[dist_vers] return os_version , "/etc/cobbler/sample.seed" + def set_install_tree(self, distro, url): + idx = url.find("://") + url = url[idx+3:] + + idx = url.find("/") + distro.ks_meta["hostname"] = url[:idx] + distro.ks_meta["directory"] = url[idx+1:] + if not distro.os_version : + raise CX(_("OS version is required for debian distros")) + distro.ks_meta["suite"] = distro.os_version + class UbuntuImporter ( DebianImporter ) : def __init__(self,(rootdir,pkgdir)): @@ -1034,7 +1048,7 @@ class UbuntuImporter ( DebianImporter ) : # Release names taken from wikipedia dist_names = { '4.10':"WartyWarthog", '5.4':"HoaryHedgehog", '5.10':"BreezyBadger", '6.4':"DapperDrake", '6.10':"EdgyEft", '7.4':"FeistyFawn", '7.10':"GutsyGibbon", '8.4':"HardyHeron", '8.10':"IntrepidIbex", '9.4':"JauntyJackalope" } dist_vers = "%s.%s" % ( major , minor ) - os_version = "ubuntu%s" % dist_names[dist_vers] + os_version = dist_names[dist_vers] return os_version , "/etc/cobbler/sample.seed" diff --git a/cobbler/codes.py b/cobbler/codes.py index 3a858b45..b3b5bc8e 100644 --- a/cobbler/codes.py +++ b/cobbler/codes.py @@ -43,8 +43,8 @@ VALID_OS_BREEDS = [ VALID_OS_VERSIONS = { "redhat" : [ "rhel2.1", "rhel3", "rhel4", "rhel5", "fedora5", "fedora6", "fedora7", "fedora8", "fedora9", "generic24", "generic26", "other" ], "suse" : [ "sles10", "generic24", "generic26", "other" ], - "debian" : [ "debianEtch", "debianLenny", "generic24", "generic26", "other" ], - "ubuntu" : [ "ubuntuWartyWarthog", "ubuntuHoaryHedgehog", "ubuntuBreezyBadger", "ubuntuDapperDrake", "ubuntuEdgyEft", "ubuntuFeistyFawn", "ubuntuGutsyGibbon", "ubuntuHardyHeron", "ubuntuIntrepidIbex", "ubuntuJauntyJackalope" ], + "debian" : [ "etch", "lenny", "generic24", "generic26", "other" ], + "ubuntu" : [ "WartyWarthog", "HoaryHedgehog", "BreezyBadger", "DapperDrake", "EdgyEft", "FeistyFawn", "GutsyGibbon", "HardyHeron", "IntrepidIbex", "JauntyJackalope" ], "generic" : [ "generic24", "generic26", "other" ], "windows" : [ "winxp", "win2k", "win2k3", "vista", "other" ], "unix" : [ "solaris9", "solaris10", "freebsd6", "openbsd4", "other" ], diff --git a/cobbler/pxegen.py b/cobbler/pxegen.py index f586310e..bcdaf736 100644 --- a/cobbler/pxegen.py +++ b/cobbler/pxegen.py @@ -424,7 +424,8 @@ class PXEGen: append_line = "%s autoyast=%s" % (append_line, kickstart_path) elif distro.breed == "debian": append_line = "%s auto=true url=%s" % (append_line, kickstart_path) - append_line = append_line.replace("ksdevice","interface") + # interface=bootif causes a failure + # append_line = append_line.replace("ksdevice","interface") if arch == "s390x": # remove the prefix "append" diff --git a/kickstarts/sample.seed b/kickstarts/sample.seed index 9335dc1a..43ff7f79 100644 --- a/kickstarts/sample.seed +++ b/kickstarts/sample.seed @@ -18,11 +18,18 @@ d-i console-setup/layout select U.S. English # System language # Use network installation -#d-i mirror/http/hostname string mirror.domain -#d-i mirror/http/directory string /debian_directory +# NOTE : The suite seems to be hardcoded on installer +d-i mirror/suite string $suite +d-i mirror/country string enter information manually +d-i mirror/http/hostname string $hostname +d-i mirror/http/directory string $directory +d-i mirror/http/proxy string # If any cobbler repo definitions were referenced in the kickstart profile, include them here. # Network information +# NOTE : this questions are asked befor downloading preseed +#d-i netcfg/get_hostname string unassigned-hostname +#d-i netcfg/get_domain string unassigned-hostname # Reboot after installation finish-install finish-install/reboot_in_progress note |