Marsh, Alexander wrote:
> Hello,
>
> I am having some problems with my install disk. I am planning to use a
> USB thumb drive which I set up with:
>
> si_mkautoinstalldisk --device /dev/sdc1 --config /tmp/local.cfg

The --config option in si_mkautoinstalldisk doesn't work as expected...
and this is a bug...

It simply copies the local.cfg file in the root of the USB/disk device,
instead of into the initrd. The correct solution should be to include it
directly into the initrd using
SystemImager::UseYourOwnKernel->create_uyok_initrd() via
si_mkbootpackage or si_prepareclient.

The following patch (just checked in the developers' trunk) move the
--config option from si_mkautoinstalldisk to si_mkbootpackage and
si_prepareclient.

If you don't want to apply the patch, simply add all your installation
parameters into the kernel append string, using --append
option with si_mkautoinstalldisk.

Regards,
-Andrea

Index: sbin/si_prepareclient
===================================================================
--- sbin/si_prepareclient       (revision 4021)
+++ sbin/si_prepareclient       (working copy)
@@ -213,6 +213,13 @@
     Specifies the file that contains the public keys that can be used
     for user authentication from the image server to the imaging clients.

+ --config FILE
+    Where FILE contains all the settings necessary for the client to set
+    its hostname and configure its networking information without DHCP.
+    This file is copied to /local.cfg into the initrd.img.  See
+
/usr/share/doc/systemimager-server-SYSTEMIMAGER_VERSION_STRING/local.cfg
+    for a well commented example.
+
 Download, report bugs, and make suggestions at:
 http://systemimager.org/

@@ -238,6 +245,7 @@
     "yes"                  => \my $yes,
     "ssh-key=s"            => \my $ssh_key,
     "authorized-keys=s"    => \my $authorized_keys,
+    "config=s"             => \my $local_cfg,
 ) || die "$help_info";


@@ -795,7 +803,7 @@
         SystemImager::UseYourOwnKernel->create_uyok_initrd(
             $arch, $my_modules, $custom_kernel, $modules_dir,
             $image, $filesystem, '/etc/systemimager/boot',
-            $ssh_key, $authorized_keys, $verbose
+            $ssh_key, $authorized_keys, $local_cfg, $verbose
         );
     }

Index: sbin/si_mkautoinstalldisk
===================================================================
--- sbin/si_mkautoinstalldisk   (revision 4021)
+++ sbin/si_mkautoinstalldisk   (working copy)
@@ -58,14 +58,6 @@
  --append STRING        A string of options that will be passed to the
                         autoinstall kernel.

- --config FILE          Where FILE contains all the settings necessary
-                        for the client to set it's hostname and
-                        configure it's networking information without
-                        DHCP.  This file is copied to /local.cfg on the
-                        autoinstall disk.
-                        See
/usr/share/doc/systemimager-server-SYSTEMIMAGER_VERSION_STRING/local.cfg
-                        for a well commented example.
-
 EOF

 Getopt::Long::Configure("posix_default");
@@ -83,7 +75,6 @@
        "kernel=s"      => \my $kernel,
        "initrd=s"      => \my $initrd,
        "append=s"      => \my $append,
-       "config=s"      => \my $local_cfg,
 ) or die("$help_info");

 unless ($arch) {
Index: sbin/si_mkbootpackage
===================================================================
--- sbin/si_mkbootpackage       (revision 4021)
+++ sbin/si_mkbootpackage       (working copy)
@@ -137,6 +137,13 @@
     Specifies the file that contains the public keys that can be used
     for user authentication from the image server to the imaging clients.

+ --config FILE
+    Where FILE contains all the settings necessary for the client to set
+    its hostname and configure its networking information without DHCP.
+    This file is copied to /local.cfg into the initrd.img.  See
+
/usr/share/doc/systemimager-server-SYSTEMIMAGER_VERSION_STRING/local.cfg
+    for a well commented example.
+
 Download, report bugs, and make suggestions at:
 http://systemimager.org/

@@ -156,6 +163,7 @@
     "yes"                  => \my $yes,
     "ssh-key=s"            => \my $ssh_key,
     "authorized-keys=s"    => \my $authorized_keys,
+    "config=s"             => \my $local_cfg,
 ) || die "$help_info";


@@ -264,7 +272,7 @@
     SystemImager::UseYourOwnKernel->create_uyok_initrd(
         $arch, $my_modules, $custom_kernel, $modules_dir,
         $image, $filesystem, $destination,
-        $ssh_key, $authorized_keys, $verbose
+        $ssh_key, $authorized_keys, $local_cfg, $verbose
     );

     return 1;
Index: lib/SystemImager/UseYourOwnKernel.pm
===================================================================
--- lib/SystemImager/UseYourOwnKernel.pm        (revision 4021)
+++ lib/SystemImager/UseYourOwnKernel.pm        (working copy)
@@ -31,7 +31,10 @@

 #
 # Usage:
-#       SystemImager::UseYourOwnKernel->create_uyok_initrd($arch,
$my_modules, $custom_kernel, $custom_mod_dir, $image, $filesystem,
$destination, $verbose);
+#       SystemImager::UseYourOwnKernel->create_uyok_initrd(
+#           $arch, $my_modules, $custom_kernel, $custom_mod_dir,
+#           $image, $filesystem, $destination, $ssh_key,
+#           $authorized_keys, $local_cfg, $verbose);
 #
 sub create_uyok_initrd() {

@@ -45,6 +48,7 @@
         my $destination     = shift;
         my $ssh_key         = shift;
         my $authorized_keys = shift;
+        my $local_cfg       = shift;
         $verbose            = shift;

         use File::Copy;
@@ -200,6 +204,16 @@
             }
         }

+        #
+        # Copy local.cfg
+        #
+        if ($local_cfg) {
+            print ">>> Including local.cfg into the initrd.img:
$local_cfg\n" if ($verbose);
+            unless (copy($local_cfg, "$staging_dir/local.cfg")) {
+                die("Couldn't copy $local_cfg to
$staging_dir/local.cfg!\n");
+            }
+        }
+
         #
         # Dir in which to hold stuff.  XXX dannf where should this
really go?
         #

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sisuite-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to