summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 34e51c442..eb6fe6418 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -781,4 +781,15 @@ sub write_passwd_user {
} "$prefix/etc/passwd";
}
+sub runlevel {
+ my ($prefix, $runlevel) = @_;
+ my $f = "$prefix/etc/inittab";
+ -r $f or log::l("missing inittab!!!"), return;
+ if ($runlevel) {
+ substInFile { s/^id:\d:initdefault:\s*$/id:$runlevel:initdefault:\n/ } $f;
+ } else {
+ cat_($f) =~ /^id:(\d):initdefault:\s*$/ && $1;
+ }
+}
+
1;