Mageia Bugzilla – Attachment 3765 Details for
Bug 5661
Can not unlock encrypted /home on my LVM to use it (need to write /etc/crypttab)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
add read_crypttab_() & save_crypttab_() that enables to use an alternative crypttab location
5661-3.diff (text/plain), 1.33 KB, created by
Thierry Vignaud
on 2013-04-19 07:53:47 CEST
(
hide
)
Description:
add read_crypttab_() & save_crypttab_() that enables to use an alternative crypttab location
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2013-04-19 07:53:47 CEST
Size:
1.33 KB
patch
obsolete
>add read_crypttab_() & save_crypttab_() that enables to use an alternative >crypttab location > >diff --git a/perl-install/fs/dmcrypt.pm b/perl-install/fs/dmcrypt.pm >index bc61145..1180720 100644 >--- a/perl-install/fs/dmcrypt.pm >+++ b/perl-install/fs/dmcrypt.pm >@@ -25,14 +25,14 @@ sub _ensure_initialized() { > $initialized++ or init(); > } > >-sub read_crypttab { >- my ($all_hds) = @_; >+sub read_crypttab_ { >+ my ($all_hds, $crypttab) = @_; > >- -e _crypttab() or return; >+ -e $crypttab or return; > > my @raw_parts = grep { fs::type::isRawLUKS($_) } fs::get::really_all_fstab($all_hds); > >- foreach (cat_(_crypttab())) { >+ foreach (cat_($crypttab)) { > my ($dm_name, $dev) = split; > > my $raw_part = fs::get::device2part($dev, \@raw_parts) >@@ -42,8 +42,13 @@ sub read_crypttab { > } > } > >-sub save_crypttab { >+sub read_crypttab { > my ($all_hds) = @_; >+ read_crypttab($all_hds, _crypttab()); >+} >+ >+sub save_crypttab_ { >+ my ($all_hds, $crypttab) = @_; > > my @raw_parts = grep { $_->{dm_name} } fs::get::really_all_fstab($all_hds) or return; > >@@ -57,7 +62,12 @@ sub save_crypttab { > if (eof) { > $_ .= join('', map { "$_ $names{$_}\n" } sort keys %names); > } >- } _crypttab(); >+ } $crypttab; >+} >+ >+sub save_crypttab { >+ my ($all_hds) = @_; >+ save_crypttab_($all_hds, _crypttab()); > } > > sub format_part {
add read_crypttab_() & save_crypttab_() that enables to use an alternative crypttab location diff --git a/perl-install/fs/dmcrypt.pm b/perl-install/fs/dmcrypt.pm index bc61145..1180720 100644 --- a/perl-install/fs/dmcrypt.pm +++ b/perl-install/fs/dmcrypt.pm @@ -25,14 +25,14 @@ sub _ensure_initialized() { $initialized++ or init(); } -sub read_crypttab { - my ($all_hds) = @_; +sub read_crypttab_ { + my ($all_hds, $crypttab) = @_; - -e _crypttab() or return; + -e $crypttab or return; my @raw_parts = grep { fs::type::isRawLUKS($_) } fs::get::really_all_fstab($all_hds); - foreach (cat_(_crypttab())) { + foreach (cat_($crypttab)) { my ($dm_name, $dev) = split; my $raw_part = fs::get::device2part($dev, \@raw_parts) @@ -42,8 +42,13 @@ sub read_crypttab { } } -sub save_crypttab { +sub read_crypttab { my ($all_hds) = @_; + read_crypttab($all_hds, _crypttab()); +} + +sub save_crypttab_ { + my ($all_hds, $crypttab) = @_; my @raw_parts = grep { $_->{dm_name} } fs::get::really_all_fstab($all_hds) or return; @@ -57,7 +62,12 @@ sub save_crypttab { if (eof) { $_ .= join('', map { "$_ $names{$_}\n" } sort keys %names); } - } _crypttab(); + } $crypttab; +} + +sub save_crypttab { + my ($all_hds) = @_; + save_crypttab_($all_hds, _crypttab()); } sub format_part {
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 5661
:
3597
|
3626
|
3644
|
3757
|
3758
|
3759
|
3761
|
3762
|
3763
| 3765 |
3766
|
3767
|
3811
|
3812