>> 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

Time turns statements into lies, and now I reject my previous words.
After some research, and with I little of luck, the issue is fixed and included
in the attached patch. Also some other bugs are fixed there, and I've able to
perform a deployment completelly automated except for the harddisk issues,
which I do by hand because of the risk of deletion of existing partitions. The
procedure is not so straightforward as other imports, but it will be
improved soon.

1 - Normal import of a debian media
2 - Import of a proper debian mini.iso image, just to put kernel and
initrd in local fs
3 - Modify the distros created on step 1 to use the boot files from step 2

And now you can deploy your new distros

Javier Palacios
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index a6344c1..a1ac7a8 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -353,6 +353,7 @@ class Importer:
                importer = import_factory(basepath,self.path)
                top = importer.get_rootdir()
                print _("- descent into %s") % top
+               # FIXME : The location of repo definition is known from breed
                os.path.walk(top, self.repo_scanner, distro)
            else:
                print _("- this distro isn't mirrored")
@@ -828,6 +829,7 @@ class BaseImporter:
        for producing predictable distro names (and profile names) from 
differing import sources
        """
        result = {}
+       # FIXME : this is called only once, should not be a walk      
        os.path.walk(self.get_pkgdir(), self.arch_walker, result)      
        # print _("- architectures found at %s: %s") % ( self.get_pkgdir(), 
result.keys() )
        if result.pop("amd64",False):
@@ -1011,7 +1013,7 @@ class DebianImporter ( BaseImporter ) :
 
        idx = url.find("/")
        distro.ks_meta["hostname"] = url[:idx]
-       distro.ks_meta["directory"] = url[idx+1:]
+       distro.ks_meta["directory"] = url[idx:]
        if not distro.os_version :
            raise CX(_("OS version is required for debian distros"))
        distro.ks_meta["suite"] = distro.os_version
diff --git a/cobbler/item_repo.py b/cobbler/item_repo.py
index 0b033f5..113e9ab 100644
--- a/cobbler/item_repo.py
+++ b/cobbler/item_repo.py
@@ -601,7 +601,10 @@ class AptRepo(Repo):
         if self.rpm_list != "":
             raise CX(_("has_rpm_list not yet supported on apt repos"))
 
-        # create yum config file for use by reposync
+        if not self.arch:
+            raise CX(_("Architecture is required for apt repositories"))
+
+        # built destination path for the repo
         dest_path = os.path.join(repo_mirror, self.name)
          
         if self.mirror_locally:
@@ -615,8 +618,8 @@ class AptRepo(Repo):
             host = mirror[:idx]
             mirror = mirror[idx+1:]
 
-            idx = mirror.rfind("/")
-            suite = mirror[idx+1:]
+            idx = mirror.rfind("/dists/")
+            suite = mirror[idx+7:]
             mirror = mirror[:idx]
 
             mirror_data = "--method=%s --host=%s --root=%s --dist=%s " % ( 
method , host , mirror , suite )
@@ -624,15 +627,15 @@ class AptRepo(Repo):
             # FIXME : flags should come from obj_sync instead of being 
hardcoded
             rflags = "--passive --nocleanup --ignore-release-gpg --verbose"
             cmd = "%s %s %s %s" % (mirror_program, rflags, mirror_data, 
dest_path)
-            if not self.arch:
-                raise CX(_("Architecture is required for apt repositories"))
             if self.arch == "src":
-                cmd = "%s --source"
+                cmd = "%s --source" % cmd
             else:
-                use_source = "--source"
-                if self.arch == "x86":
-                   self.arch = "i386" # FIX potential arch errors
-                cmd = "%s -a %s" % (cmd, self.arch)
+                arch = self.arch
+                if arch == "x86":
+                   arch = "i386" # FIX potential arch errors
+                if arch == "x86_64":
+                   arch = "amd64" # FIX potential arch errors
+                cmd = "%s --nosource -a %s" % (cmd, arch)
                     
             print _("- %s") % cmd
 
diff --git a/kickstarts/sample.seed b/kickstarts/sample.seed
index 43ff7f7..74410b2 100644
--- a/kickstarts/sample.seed
+++ b/kickstarts/sample.seed
@@ -13,8 +13,7 @@
 
 # System keyboard
 d-i    console-setup/dont_ask_layout   note    
-d-i    console-setup/layoutcode        string  us
-d-i    console-setup/layout    select  U.S. English
+d-i    console-keymaps-at/keymap       select  us
 # System language
 
 # Use network installation
@@ -50,3 +49,21 @@ tzsetup-udeb time/zone       select  America/New_York
 # Clear the Master Boot Record
 
 
+# Select individual packages and groups for install
+d-i    pkgsel/include  string  openssh-server
+tasksel        tasksel/first   multiselect     standard, desktop
+
+# Debian specific configuration
+# See http://www.debian.org/releases/stable/i386/apbs04.html.en & preseed 
documentation
+
+# By default the installer requires that repositories be authenticated
+# using a known gpg key. This setting can be used to disable that
+# authentication. Warning: Insecure, not recommended.
+d-i    debian-installer/allow_unauthenticated  string  true
+
+# Some versions of the installer can report back on what software you have
+# installed, and what software you use. The default is not to report back,
+# but sending reports helps the project determine what software is most
+# popular and include it on CDs.
+popularity-contest     popularity-contest/participate  boolean false
+
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to