From b1675dff9e409b53d0275fed6afe3a761867a57c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 24 Sep 2002 17:05:17 +0000 Subject: also create a raidtab if it doesn't exist (occurs when / has been formatted) --- perl-install/patch/patch-raidtab.pl | 18 ++++++++++++++++++ perl-install/raid.pm | 2 ++ 2 files changed, 20 insertions(+) (limited to 'perl-install') diff --git a/perl-install/patch/patch-raidtab.pl b/perl-install/patch/patch-raidtab.pl index bd54546c8..de03a1b2a 100644 --- a/perl-install/patch/patch-raidtab.pl +++ b/perl-install/patch/patch-raidtab.pl @@ -17,3 +17,21 @@ log::l("PATCHING"); } unlink "/tmp/raidtab"; }; + +use raid; +package raid; + +*prepare_prefixed = sub { + my ($raids, $prefix) = @_; + + log::l("patched prepare_prefixed"); + + $raids or return; + + &write($raids, "/etc/raidtab") if ! -e "/etc/raidtab"; + + eval { cp_af("/etc/raidtab", "$prefix/etc/raidtab") }; + foreach (grep { $_ } @$raids) { + devices::make("$prefix/dev/$_->{device}") foreach @{$_->{disks}}; + } +}; diff --git a/perl-install/raid.pm b/perl-install/raid.pm index 492225ceb..048de72f1 100644 --- a/perl-install/raid.pm +++ b/perl-install/raid.pm @@ -158,6 +158,8 @@ sub prepare_prefixed { my ($raids, $prefix) = @_; $raids or return; + &write($raids, "/etc/raidtab") if ! -e "/etc/raidtab"; + eval { cp_af("/etc/raidtab", "$prefix/etc/raidtab") }; foreach (grep { $_ } @$raids) { devices::make("$prefix/dev/$_->{device}") foreach @{$_->{disks}}; -- cgit v1.2.1