Update uswsusp resume device name
svn path=/dists/trunk/linux-2.6/; revision=15353
This commit is contained in:
parent
c1021b3bb4
commit
ef5cb9f2c2
|
@ -14,6 +14,7 @@ linux-2.6 (2.6.33-1~experimental.3) UNRELEASED; urgency=low
|
||||||
than labels where both are available (Closes: #572376)
|
than labels where both are available (Closes: #572376)
|
||||||
- Replace CD/DVD/BD device names with udev-provided persistent aliases
|
- Replace CD/DVD/BD device names with udev-provided persistent aliases
|
||||||
- Fix update of boot device name for LILO and related loaders
|
- Fix update of boot device name for LILO and related loaders
|
||||||
|
- Update uswsusp resume device name
|
||||||
|
|
||||||
-- Ben Hutchings <ben@decadent.org.uk> Sun, 28 Feb 2010 17:01:33 +0000
|
-- Ben Hutchings <ben@decadent.org.uk> Sun, 28 Feb 2010 17:01:33 +0000
|
||||||
|
|
||||||
|
|
|
@ -1013,6 +1013,59 @@ sub initramfs_resume_update {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# uswsusp resume
|
||||||
|
|
||||||
|
sub uswsusp_next {
|
||||||
|
# Based on parse_line() in config_parser.c
|
||||||
|
|
||||||
|
my ($file) = @_;
|
||||||
|
my $text = <$file>;
|
||||||
|
|
||||||
|
if (!defined($text) || $text eq '') {
|
||||||
|
return ();
|
||||||
|
}
|
||||||
|
|
||||||
|
local $_ = $text;
|
||||||
|
s/^\s*(?:#.*)?//;
|
||||||
|
s/\s*$//;
|
||||||
|
|
||||||
|
if ($text =~ /^([\w ]*\w)[ \t]*[:=][ \t]*(.+)$/) {
|
||||||
|
return ($text, $1, $2);
|
||||||
|
} else {
|
||||||
|
return ($text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub uswsusp_resume_list {
|
||||||
|
my ($file) = @_;
|
||||||
|
my @results = ();
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
my ($text, $name, $value) = uswsusp_next($file);
|
||||||
|
last unless defined($text);
|
||||||
|
if (defined($name) && $name eq 'resume device') {
|
||||||
|
$results[0] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return @results;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub uswsusp_resume_update {
|
||||||
|
my ($old, $new, $map) = @_;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
my ($text, $name, $value) = uswsusp_next($old);
|
||||||
|
last unless defined($text);
|
||||||
|
if (defined($name) && $name eq 'resume device' &&
|
||||||
|
defined(my $new_value = $map->{$value})) {
|
||||||
|
$text =~ s/^/# /gm;
|
||||||
|
$text .= sprintf("%s = %s\n", $name, id_to_path($new_value));
|
||||||
|
}
|
||||||
|
$new->print($text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
### list of all configuration files and functions
|
### list of all configuration files and functions
|
||||||
|
|
||||||
my @config_files = ({packages => 'mount',
|
my @config_files = ({packages => 'mount',
|
||||||
|
@ -1089,7 +1142,11 @@ my @config_files = ({packages => 'mount',
|
||||||
update => \&initramfs_resume_update,
|
update => \&initramfs_resume_update,
|
||||||
# udev will source all files in this directory,
|
# udev will source all files in this directory,
|
||||||
# with few exceptions. Such as including a '^'.
|
# with few exceptions. Such as including a '^'.
|
||||||
suffix => '^old'});
|
suffix => '^old'},
|
||||||
|
{packages => 'uswsusp',
|
||||||
|
path => '/etc/uswsusp.conf',
|
||||||
|
list => \&uswsusp_resume_list,
|
||||||
|
update => \&uswsusp_resume_update});
|
||||||
|
|
||||||
### Filesystem labels and UUIDs
|
### Filesystem labels and UUIDs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue