[Fai-commit] r5789 - branches/experimental/patches
Julien Blache
jblache at alioth.debian.org
Fri May 28 10:31:07 UTC 2010
Author: jblache
Date: 2010-05-28 10:31:03 +0000 (Fri, 28 May 2010)
New Revision: 5789
Modified:
branches/experimental/patches/grub-pc
Log:
- Fix Perl warnings on partitions with no mount point defined
- Fix boot devices code for /boot on RAID
Modified: branches/experimental/patches/grub-pc
===================================================================
--- branches/experimental/patches/grub-pc 2010-05-27 20:20:21 UTC (rev 5788)
+++ branches/experimental/patches/grub-pc 2010-05-28 10:31:03 UTC (rev 5789)
@@ -8,10 +8,10 @@
volumes and RAID volumes are resolved to underlying disks.
* setup-storage.8: Documented this new behavior
* Makefile: Make sure that all example scripts are executable
-Index: trunk/Makefile
+Index: trunk-w-exp/Makefile
===================================================================
---- trunk.orig/Makefile
-+++ trunk/Makefile
+--- trunk-w-exp.orig/Makefile 2010-05-28 11:22:37.000000000 +0200
++++ trunk-w-exp/Makefile 2010-05-28 11:23:00.000000000 +0200
@@ -47,6 +47,7 @@
install -p -m644 pixmaps/*.gif $(DESTDIR)/usr/share/fai/pixmaps
perl -pi -e 's/FAIVERSIONSTRING/$(VERSIONSTRING)/' $(DESTDIR)/usr/sbin/fai
@@ -20,10 +20,10 @@
cp -a utils $(DOCDIR)/examples
find $(DOCDIR) -name .svn | xargs rm -rf
-Index: trunk/examples/simple/package_config/DEFAULT
+Index: trunk-w-exp/examples/simple/package_config/DEFAULT
===================================================================
---- trunk.orig/examples/simple/package_config/DEFAULT
-+++ trunk/examples/simple/package_config/DEFAULT
+--- trunk-w-exp.orig/examples/simple/package_config/DEFAULT 2010-05-28 11:22:37.000000000 +0200
++++ trunk-w-exp/examples/simple/package_config/DEFAULT 2010-05-28 11:23:00.000000000 +0200
@@ -17,10 +17,10 @@
dhcp3-client
@@ -37,10 +37,10 @@
PACKAGES aptitude LILO
-lilo grub-
+lilo grub- grub-pc-
-Index: trunk/examples/simple/scripts/GRUB_PC/10-setup
+Index: trunk-w-exp/examples/simple/scripts/GRUB_PC/10-setup
===================================================================
---- trunk.orig/examples/simple/scripts/GRUB_PC/10-setup
-+++ trunk/examples/simple/scripts/GRUB_PC/10-setup
+--- trunk-w-exp.orig/examples/simple/scripts/GRUB_PC/10-setup 2010-05-28 11:22:37.000000000 +0200
++++ trunk-w-exp/examples/simple/scripts/GRUB_PC/10-setup 2010-05-28 11:23:00.000000000 +0200
@@ -2,8 +2,25 @@
error=0 ; trap "error=$((error|1))" ERR
@@ -70,30 +70,30 @@
exit $error
+
-Index: trunk/examples/simple/class/50-host-classes
+Index: trunk-w-exp/examples/simple/class/50-host-classes
===================================================================
---- trunk.orig/examples/simple/class/50-host-classes
-+++ trunk/examples/simple/class/50-host-classes
+--- trunk-w-exp.orig/examples/simple/class/50-host-classes 2010-05-28 11:22:37.000000000 +0200
++++ trunk-w-exp/examples/simple/class/50-host-classes 2010-05-28 11:23:00.000000000 +0200
@@ -20,5 +20,4 @@
echo "FAIBASE DHCPC" ;;
esac
-(ifclass I386 || ifclass AMD64) && echo GRUB
exit 0
-Index: trunk/examples/simple/class/51-grub
+Index: trunk-w-exp/examples/simple/class/51-grub
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ trunk/examples/simple/class/51-grub
++++ trunk-w-exp/examples/simple/class/51-grub 2010-05-28 11:23:00.000000000 +0200
@@ -0,0 +1,4 @@
+#! /bin/bash
+
+{ ifclass I386 || ifclass AMD64; } && ! ifclass GRUB_PC && echo GRUB
+exit 0
-Index: trunk/lib/setup-storage/Fstab.pm
+Index: trunk-w-exp/lib/setup-storage/Fstab.pm
===================================================================
---- trunk.orig/lib/setup-storage/Fstab.pm
-+++ trunk/lib/setup-storage/Fstab.pm
-@@ -127,6 +127,45 @@
+--- trunk-w-exp.orig/lib/setup-storage/Fstab.pm 2010-05-28 11:22:37.000000000 +0200
++++ trunk-w-exp/lib/setup-storage/Fstab.pm 2010-05-28 11:24:14.000000000 +0200
+@@ -127,6 +127,54 @@
}
}
@@ -113,6 +113,9 @@
+ if ($c =~ /^PHY_(.+)$/) {
+ foreach my $p (keys %{ $FAI::configs{$c}{partitions} }) {
+ my $this_mp = $FAI::configs{$c}{partitions}{$p}{mountpoint};
++
++ next if (!defined($this_mp));
++
+ return $this_mp if ($this_mp eq "/boot");
+ $mnt_point = $this_mp if ($this_mp eq "/");
+ }
@@ -120,12 +123,18 @@
+ next if ($1 eq "--ANY--");
+ foreach my $l (keys %{ $FAI::configs{$c}{volumes} }) {
+ my $this_mp = $FAI::configs{$c}{volumes}{$l}{mountpoint};
++
++ next if (!defined($this_mp));
++
+ return $this_mp if ($this_mp eq "/boot");
+ $mnt_point = $this_mp if ($this_mp eq "/");
+ }
+ } elsif ($c eq "RAID" || $c eq "CRYPT") {
+ foreach my $r (keys %{ $FAI::configs{$c}{volumes} }) {
+ my $this_mp = $FAI::configs{$c}{volumes}{$r}{mountpoint};
++
++ next if (!defined($this_mp));
++
+ return $this_mp if ($this_mp eq "/boot");
+ $mnt_point = $this_mp if ($this_mp eq "/");
+ }
@@ -139,7 +148,7 @@
################################################################################
#
-@@ -147,6 +186,9 @@
+@@ -147,6 +195,9 @@
# the file to be returned, a list of lines
my @fstab = ();
@@ -149,7 +158,7 @@
# walk through all configured parts
# the order of entries is most likely wrong, it is fixed at the end
foreach my $c (keys %$config) {
-@@ -170,15 +212,11 @@
+@@ -170,15 +221,11 @@
my $device_name = &FAI::make_device_name($device, $p_ref->{number});
@@ -169,7 +178,7 @@
}
push @fstab, &FAI::create_fstab_line($p_ref,
-@@ -215,15 +253,13 @@
+@@ -215,15 +262,13 @@
my $device_name = $fstab_key[0];
@@ -192,7 +201,7 @@
}
push @fstab, &FAI::create_fstab_line($l_ref,
-@@ -242,15 +278,13 @@
+@@ -242,15 +287,13 @@
my $device_name = "/dev/md$r";
@@ -208,14 +217,14 @@
+ # if the mount point the /boot mount point, variables must be set
+ if ($r_ref->{mountpoint} eq $boot_mnt_point) {
+ # set BOOT_DEVICE to the underlying disks
-+ foreach my $dev (@{ $r_ref->{devices} }) {
++ foreach my $dev ($r_ref->{devices}) {
+ my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($dev);
+ $FAI::disk_var{BOOT_DEVICE} .= " $disk" if (1 == $i_p_d);
+ }
}
push @fstab, &FAI::create_fstab_line($r_ref,
-@@ -264,8 +298,7 @@
+@@ -264,8 +307,7 @@
my $device_name = &FAI::enc_name($c_ref->{device});
@@ -225,7 +234,7 @@
die "Boot partition cannot be encrypted\n";
push @fstab, &FAI::create_fstab_line($c_ref, $device_name, $device_name);
-@@ -280,7 +313,10 @@
+@@ -280,7 +322,10 @@
$FAI::disk_var{SWAPLIST} =~ s/\s*$/"/;
# cleanup the list of boot devices (remove leading space and add quotes)
@@ -237,10 +246,10 @@
$FAI::disk_var{BOOT_DEVICE} =~ s/\s*$/"/;
# sort the lines in @fstab to enable all sub mounts
-Index: trunk/man/setup-storage.8
+Index: trunk-w-exp/man/setup-storage.8
===================================================================
---- trunk.orig/man/setup-storage.8
-+++ trunk/man/setup-storage.8
+--- trunk-w-exp.orig/man/setup-storage.8 2010-05-28 11:22:37.000000000 +0200
++++ trunk-w-exp/man/setup-storage.8 2010-05-28 11:23:00.000000000 +0200
@@ -106,10 +106,9 @@
.IR SWAPLIST ,
.IR ROOT_PARTITION ,
More information about the Fai-commit
mailing list