/[smeserver]/rpms/e-smith-base/sme7/e-smith-base-4.18.0-raidfix.patch
ViewVC logotype

Contents of /rpms/e-smith-base/sme7/e-smith-base-4.18.0-raidfix.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Wed Mar 26 17:01:38 2008 UTC (16 years, 2 months ago) by slords
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
* Wed Mar 26 2008 Shad L. Lords <slords@mail.com> 4.18.1-2
- Fix gettext strings returned by password checks [SME: 4104]

1 diff -Nur -x '*.orig' -x '*.rej' e-smith-base-4.18.0/root/sbin/e-smith/add_drive_to_raid mezzanine_patched_e-smith-base-4.18.0/root/sbin/e-smith/add_drive_to_raid
2 --- e-smith-base-4.18.0/root/sbin/e-smith/add_drive_to_raid 2007-06-03 16:07:36.000000000 -0600
3 +++ mezzanine_patched_e-smith-base-4.18.0/root/sbin/e-smith/add_drive_to_raid 2007-06-03 16:07:29.000000000 -0600
4 @@ -42,6 +42,7 @@
5 die "There are no RAID devices configured\n" unless $#devices >= 0;
6
7 my %partitions = $raid->get_partitions();
8 +my @partitions;
9
10 my $minsize = 0;
11
12 @@ -85,20 +86,43 @@
13 $boot = "-";
14 }
15 print SFDISK ",0\n" for (1..4);
16 - close(SFDISK) || die "SFDISK kid exited $?";
17 + close(SFDISK) || die "SFDISK kid exited $?\n";
18 }
19 else
20 {
21 # child
22 exec("/sbin/sfdisk", "-uB", "--no-reread", "--force", "/dev/$newdev")
23 - or die "can't exec program: $!";
24 + or die "can't exec program: $!\n";
25 # NOTREACHED
26 }
27
28 - %partitions = $raid->get_partitions();
29 + print "\nChecking partitions on /dev/$newdev...\n";
30 + sleep(3);
31 + my $good;
32 + my $cnt = 0;
33 + do {
34 + $cnt++;
35 + $good = 1;
36 + sleep(1);
37 +
38 + %partitions = $raid->get_partitions();
39 + @partitions = sort grep m#^$newdev.+$#, keys %partitions;
40 + if ( $#devices == $#partitions ) {
41 + foreach my $part ( 0..($#devices-1) ) {
42 + $good &= $partitions{$partitions[$part]}{blocks} == $devices{$devices[$part]}{DeviceSize} + 64;
43 + $good &= -b "/dev/$partitions[$part]" || 0;
44 + }
45 + $good &= $partitions{$partitions[$#devices]}{blocks} >= $devices{$devices[$#devices]}{DeviceSize} + 64;
46 + $good &= -b "/dev/$partitions[$#devices]" || 0;
47 + } else {
48 + $good = 0;
49 + }
50 + } until ( $good || $cnt > 60 );
51 + print "\n";
52
53 - my @partitions = sort grep m#^$newdev.+$#, keys %partitions;
54 + die "\nPartitions on /dev/$newdev aren't correct. Reboot may be necessary.\n" unless $good;
55
56 + sleep(3);
57 foreach my $part (0..$#devices)
58 {
59 print "Going to add /dev/$partitions[$part] to $devices[$part]\n";
60 @@ -106,7 +130,7 @@
61 sleep(2);
62 }
63
64 - print "\nWaiting for things to settle down before installing GRUB...\n";
65 + print "\nWaiting for boot partition to sync before installing grub...\n";
66 sleep(15);
67
68 $pid = open(GRUB, "|-");
69 @@ -117,14 +141,14 @@
70 print GRUB "root (hd0,0)\n";
71 print GRUB "setup (hd0)\n";
72 print GRUB "quit\n";
73 - close(GRUB) || die "GRUB kid exited $?";
74 + close(GRUB) || die "GRUB kid exited $?\n";
75 exit(0);
76 }
77 else
78 {
79 # child
80 exec("/sbin/grub", "--no-floppy", "--batch")
81 - or die "can't exec program: $!";
82 + or die "can't exec program: $!\n";
83 # NOTREACHED
84 }
85 }
86 @@ -134,5 +158,5 @@
87 next unless $_;
88 warn "$_";
89 }
90 -close(OUTPUT) or die "Closing stdin pipe reported: $!";
91 +close(OUTPUT) or die "Closing stdin pipe reported: $!\n";
92
93 diff -Nur -x '*.orig' -x '*.rej' e-smith-base-4.18.0/root/sbin/e-smith/console-menu-items/manageRAID.pl mezzanine_patched_e-smith-base-4.18.0/root/sbin/e-smith/console-menu-items/manageRAID.pl
94 --- e-smith-base-4.18.0/root/sbin/e-smith/console-menu-items/manageRAID.pl 2007-06-03 16:07:36.000000000 -0600
95 +++ mezzanine_patched_e-smith-base-4.18.0/root/sbin/e-smith/console-menu-items/manageRAID.pl 2007-06-03 15:59:03.000000000 -0600
96 @@ -147,10 +147,11 @@
97 ($rc, $choice) = $console->yesno_page(title => $title, text => $text, defaultno => 1);
98 return unless ($rc == 0);
99
100 - unless (system(@cmd) == 0)
101 + my $cmd_out = qx( @cmd 2>&1 );
102 + unless ($? == 0)
103 {
104 - $text = gettext("The command @cmd failed.") .
105 - "\n\n" .
106 + $text = gettext("The command @cmd failed:") .
107 + "\n\n" . $cmd_out . "\n\n" .
108 gettext("This configuration is not yet fully supported in these screens.");
109
110 ($rc, $choice) = $console->message_page(title => $title, text => $text);

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed