Erich Focht wrote:
> Hi Andrea,
>
> some time ago you introduced the rewriting of the image's systemconfig.conf.
> This is what is does for my client:
>
> /etc/fstab (of client) will be:
> /dev/sda1 /boot ext3 ...
> /dev/sda3 / ext3 ...
>
> The originally created systemconfig.conf:
> [BOOT]
> ROOTDEV = /dev/sda3
> BOOTDEV = /dev/sda
> [KERNEL0]
> PATH = /boot/vmlinuz
> LABEL = vmlinuz
>
> The rewritten systemconfig.conf (done in the autoinstallscript):
> [BOOT]
> ROOTDEV = /dev/sda3
> BOOTDEV = /dev/sda1
> [KERNEL0]
> PATH = /vmlinuz
> LABEL = vmlinuz
>
>
> This is wrong! It will lead to
> grub-install /dev/sda1
> i.e. install the grub stuff onto the partition, not the device.
>
> Also replacing the kernel path leads to failure of systemconfigurator. It
> doesn't
> find the kernel in the correct place (which is /boot/vmlinuz).
>
> I believe you wanted to fix something, but think it might have been fixed in
> the
> wrong way. Do you remember what you needed to fix? Maybe there is something
> which
> needs to be changed in systemconfigurator?
AFAIR systemconfig.conf is changed by the auto-install script to fix the
device names when the imaging client has a different type of disk (sda /
hda / ...) respect to the golden client.
But done in this way is surely a bug! So, systemconfigurator
automatically understands that for example grub should use /vmlinuz if
you have a separate partition for boot (/dev/sda1), instead of using
/boot/vmlinuz? can you confirm this? Moreover it seems that I totally
misunderstood the meaning of BOOTDEV, that is not the /boot mountpoint,
but the disk where you want to install the boot loader (and not a
partition).
This is surely another issue to be addressed for 4.0.2.
What do you think about the following patch (untested)? the meaningful
part is in lib/SystemImager/Server.pm that creates the piece of code in
the auto-install script that change disk names in systemconfig.conf.
-Andrea
Index: lib/SystemImager/Server.pm
===================================================================
--- lib/SystemImager/Server.pm (revision 4335)
+++ lib/SystemImager/Server.pm (working copy)
@@ -1818,10 +1818,18 @@
print $out "if [ -e $sc_conf_file ]; then\n";
unless ($bootdev) {
$bootdev = $rootdev;
+ }
+ my $bootdev_disk = $bootdev;
+ if ($bootdev_disk =~ /^\/dev\/([hs]|ps3)d/) {
+ # Standard disk naming (hd*, sd*, ps3d*).
+ $bootdev_disk =~ s/[0-9]+$//;
+ } elsif ($bootdev_disk =~ /^UUID|^LABEL/) {
+ # XXX: Boot device in UUID or LABEL form: do nothing.
} else {
- print $out " sed -i 's:/boot::g' $sc_conf_file\n";
+ # Hardware RAID device.
+ $bootdev_disk =~ s/p[0-9]+$//;
}
- print $out " sed -i 's:[[:space:]]*BOOTDEV[[:space:]]*=.*:BOOTDEV =
$bootdev:g' $sc_conf_file\n";
+ print $out " sed -i 's:[[:space:]]*BOOTDEV[[:space:]]*=.*:BOOTDEV =
$bootdev_disk:g' $sc_conf_file\n";
print $out " sed -i 's:[[:space:]]*ROOTDEV[[:space:]]*=.*:ROOTDEV =
$rootdev:g' $sc_conf_file\n";
print $out " sed -i 's:[[:space:]]*root=[^ \\t]*: root=$rootdev :g'
$sc_conf_file\n";
print $out " sed -i \"s:DEFAULTBOOT = systemimager:DEFAULTBOOT =
\$IMAGENAME:g\" $sc_conf_file\n";
Index: sbin/si_prepareclient
===================================================================
--- sbin/si_prepareclient (revision 4335)
+++ sbin/si_prepareclient (working copy)
@@ -731,19 +731,17 @@
}
my @boots = grep(/ \/boot /, reverse @_);
my $boot_dev = (split(/ /, $boots[0]))[0] if (@boots);
- if ($boot_dev) {
- if ($boot_dev =~ /^\/dev\/([hs]|ps3)d/) {
- # Standard disk naming (hd*, sd*, ps3d*).
- $boot_dev =~ s/[0-9]+$//;
- } else {
- # Hardware RAID device.
- $boot_dev =~ s/p[0-9]+$//;
- }
- }
unless ($boot_dev) {
- print STDERR "WARNING: unable to detect boot device (using the root
device)!\n";
+ # Unable to detect boot device (using the root device)
$boot_dev = $root_dev;
}
+ if ($boot_dev =~ /^\/dev\/([hs]|ps3)d/) {
+ # Standard disk naming (hd*, sd*, ps3d*).
+ $boot_dev =~ s/[0-9]+$//;
+ } else {
+ # Hardware RAID device.
+ $boot_dev =~ s/p[0-9]+$//;
+ }
# OK, we've all the info needed by systemconfigurator! Write the
# configuration file.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sisuite-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-devel