I've at last performed the first debian deployment tests. They are
still unsuccessful, but promising. That means that I'm able to
get cobbler up to the point of really attempt to install. I send
attached the patch required.
One side of the problems come to the fact that I'm using a mix of
debian media from different epochs, and the other one is that my
local mirror (now managed with reposync) lacks some installation
packages.

Up to know I've identified two problems (that might be outdated), but
that forces to follow a different path with debian trees. To say fast,
a simple import of DVD media will never work.

* The kernel/initrd from media seems not network capable so neither
  preseed nor packages can be downloaded

* The kernel/initrd from minimal netinstall media perform checks the
  gpg signatures for some files, and they are not available on media

These are the reasons why even a media import plus a distro rewrite
(with kernel/initrd from net media) will fail. To have a chance, that
should be completed with an updated repository including some other
relevant sections.
I'm on the way to test with recently downloaded media, and to identify
which installer sections are required.

Javier Palacios
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index 05c7e7b..ea414b9 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -293,14 +293,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)
@@ -308,17 +305,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)
 
    # 
============================================================================
 
@@ -814,6 +812,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 
@@ -991,12 +994,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)):
@@ -1031,7 +1045,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 3a858b4..b3b5bc8 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 f6cd13c..1a95cf5 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 9335dc1..43ff7f7 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    
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to