/[smeserver]/rpms/e-smith-base/sme8/e-smith-base-5.2.0-perform_restore-hal.patch
ViewVC logotype

Annotation of /rpms/e-smith-base/sme8/e-smith-base-5.2.0-perform_restore-hal.patch

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


Revision 1.1 - (hide annotations) (download)
Thu Jan 14 12:10:20 2010 UTC (14 years, 9 months ago) by filippocarletti
Branch: MAIN
CVS Tags: e-smith-base-5_2_0-34_el5_sme, e-smith-base-5_2_0-32_el5_sme, e-smith-base-5_2_0-30_el5_sme, e-smith-base-5_2_0-11_el5_sme, e-smith-base-5_2_0-67_el5_sme, e-smith-base-5_2_0-14_el5_sme, e-smith-base-5_2_0-71_el5_sme, e-smith-base-5_2_0-12_el5_sme, e-smith-base-5_2_0-52_el5_sme, e-smith-base-5_2_0-51_el5_sme, e-smith-base-5_2_0-53_el5_sme, e-smith-base-5_2_0-68_el5_sme, e-smith-base-5_2_0-77_el5_sme, e-smith-base-5_2_0-21_el5_sme, e-smith-base-5_2_0-26_el5_sme, e-smith-base-5_2_0-59_el5_sme, e-smith-base-5_2_0-36_el5_sme, e-smith-base-5_2_0-56_el5_sme, e-smith-base-5_2_0-55_el5_sme, e-smith-base-5_2_0-78_el5_sme, e-smith-base-5_2_0-86_el5_sme, e-smith-base-5_2_0-76_el5_sme, e-smith-base-5_2_0-84_el5_sme, e-smith-base-5_2_0-38_el5_sme, e-smith-base-5_2_0-65_el5_sme, e-smith-base-5_2_0-88_el5_sme, e-smith-base-5_2_0-64_el5_sme, e-smith-base-5_2_0-47_el5_sme, e-smith-base-5_2_0-81_el5_sme, e-smith-base-5_2_0-82_el5_sme, e-smith-base-5_2_0-50_el5_sme, e-smith-base-5_2_0-57_el5_sme, e-smith-base-5_2_0-15_el5_sme, e-smith-base-5_2_0-89_el5_sme, e-smith-base-5_2_0-49_el5_sme, e-smith-base-5_2_0-90_el5_sme, e-smith-base-5_2_0-48_el5_sme, e-smith-base-5_2_0-33_el5_sme, e-smith-base-5_2_0-87_el5_sme, e-smith-base-5_2_0-80_el5_sme, e-smith-base-5_2_0-16_el5_sme, e-smith-base-5_2_0-28_el5_sme, e-smith-base-5_2_0-24_el5_sme, e-smith-base-5_2_0-70_el5_sme, e-smith-base-5_2_0-66_el5_sme, e-smith-base-5_2_0-63_el5_sme, e-smith-base-5_2_0-17_el5_sme, e-smith-base-5_2_0-41_el5_sme, e-smith-base-5_2_0-42_el5_sme, e-smith-base-5_2_0-61_el5_sme, e-smith-base-5_2_0-19_el5_sme, e-smith-base-5_2_0-60_el5_sme, e-smith-base-5_2_0-58_el5_sme, e-smith-base-5_2_0-20_el5_sme, e-smith-base-5_2_0-31_el5_sme, e-smith-base-5_2_0-45_el5_sme, e-smith-base-5_2_0-46_el5_sme, e-smith-base-5_2_0-29_el5_sme, e-smith-base-5_2_0-85_el5_sme, e-smith-base-5_2_0-69_el5_sme, e-smith-base-5_2_0-79_el5_sme, e-smith-base-5_2_0-27_el5_sme, e-smith-base-5_2_0-72_el5_sme, e-smith-base-5_2_0-75_el5_sme, e-smith-base-5_2_0-22_el5_sme, e-smith-base-5_2_0-73_el5_sme, e-smith-base-5_2_0-54_el5_sme, e-smith-base-5_2_0-37_el5_sme, e-smith-base-5_2_0-43_el5_sme, e-smith-base-5_2_0-44_el5_sme, e-smith-base-5_2_0-62_el5_sme, e-smith-base-5_2_0-25_el5_sme, e-smith-base-5_2_0-74_el5_sme, e-smith-base-5_2_0-35_el5_sme, e-smith-base-5_2_0-83_el5_sme, e-smith-base-5_2_0-23_el5_sme, e-smith-base-5_2_0-18_el5_sme
* Thu Jan 14 2010 Filippo Carletti <filippo.carletti@gmail.com> 5.2.0-11.sme
- Fix console restore from removable media (Federico Simoncelli) [SME: 5521]

1 filippocarletti 1.1 --- e-smith-base-5.2.0-old/root/usr/lib/perl5/site_perl/esmith/console/perform_restore.pm.orig 2008-03-26 17:49:00.000000000 +0100
2     +++ e-smith-base-5.2.0/root/usr/lib/perl5/site_perl/esmith/console/perform_restore.pm 2010-01-13 16:03:01.000000000 +0100
3     @@ -25,6 +25,7 @@
4     gettext("Do you wish to restore from backup?"),
5     );
6     return unless $rc == 0;
7     + mkdir("/mnt/bootstrap-console-backup");
8     system("/etc/init.d/messagebus", "start");
9     system("/etc/init.d/haldaemon", "start");
10     INITIATE_RESTORE:
11     @@ -39,19 +40,22 @@
12     unless ($rc == 0) {
13     system("/etc/init.d/haldaemon", "stop");
14     system("/etc/init.d/messagebus", "stop");
15     + rmdir("/mnt/bootstrap-console-backup");
16     return;
17     }
18     sleep(3);
19     my @dirs;
20     @dirs = ();
21     - open(FSTAB, "</etc/fstab");
22     - while (<FSTAB>)
23     - {
24     - next unless m:^(\S+)\s+(/media/\S+)\s+(\S+)\s+(\S+):;
25     - my ($dev, $mount, $filesys, $options) = ($1, $2, $3, $4);
26     - push @dirs, $mount;
27     + foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) {
28     + $udi =~ m/^(\S+)/;
29     + my $is_mounted = qx(hal-get-property --udi $1 --key volume.is_mounted);
30     +
31     + if ($is_mounted eq "false\n") {
32     + my $blkdev = qx(hal-get-property --udi $1 --key block.device);
33     + $blkdev =~ m/^(\S+)/;
34     + push @dirs, $1;
35     + }
36     }
37     - close FSTAB;
38     unless ($dirs[0])
39     {
40     ($rc, $choice) = $console->message_page
41     @@ -82,10 +86,10 @@
42     my %args_hash = ( @args );
43     $device = $args_hash{$choice};
44     }
45     - system("/bin/mount", "$device");
46     + system("/bin/mount", "$device", "/mnt/bootstrap-console-backup");
47     sleep(1);
48    
49     - unless (-f "$device/smeserver.tgz")
50     + unless (-f "/mnt/bootstrap-console-backup/smeserver.tgz")
51     {
52     system("/bin/umount", "$device");
53     ($rc, $choice) = $console->message_page
54     @@ -98,14 +102,14 @@
55     goto INITIATE_RESTORE;
56     }
57     use File::stat;
58     - my $st = stat("$device/smeserver.tgz");
59     + my $st = stat("/mnt/bootstrap-console-backup/smeserver.tgz");
60     my $size = $st->size;
61    
62     ($rc, $choice) = $console->yesno_page
63     (
64     title => gettext("Start restore from backup"),
65     text =>
66     - gettext("Backup file found:") . " $device/smeserver.tgz " .
67     + gettext("Backup file found:") . " smeserver.tgz ($device) " .
68     gettext("size") . " $size " . gettext("bytes") .
69     "\n\n" .
70     gettext("Do you wish to restore from this file?"),
71     @@ -115,7 +119,7 @@
72     goto INITIATE_RESTORE;
73     }
74     system("/sbin/e-smith/signal-event", "pre-restore");
75     - system("(cd / ; cat $device/smeserver.tgz |
76     + system("(cd / ; cat /mnt/bootstrap-console-backup/smeserver.tgz |
77     pv -n -s $size |
78     gunzip |
79     tar xf - > /dev/null ) 2>&1 |
80     @@ -124,6 +128,7 @@
81     system("/bin/umount", "$device");
82     system("/etc/init.d/haldaemon", "stop");
83     system("/etc/init.d/messagebus", "stop");
84     + rmdir("/mnt/bootstrap-console-backup");
85     }
86    
87     #use esmith::console;

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