From 272b14501e974b2731bac808265b2b94f48e6071 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 31 May 2008 18:53:21 +0000 Subject: * moved code from MakeInitRamFS::Engine that determines the list of available busybox applets into a separate function * use this function in OSSetup::Engine instead of relying on busybox.links, which may not be kept in sync. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1827 95ad53e4-c205-0410-b2fa-d234c58c8868 --- lib/OpenSLX/Utils.pm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'lib/OpenSLX/Utils.pm') diff --git a/lib/OpenSLX/Utils.pm b/lib/OpenSLX/Utils.pm index 346e9d4d..6ebd4d7c 100644 --- a/lib/OpenSLX/Utils.pm +++ b/lib/OpenSLX/Utils.pm @@ -34,6 +34,7 @@ $VERSION = 1.01; getFQDN readPassword hostIs64Bit + getAvailableBusyboxApplets ); =head1 NAME @@ -558,4 +559,29 @@ sub hostIs64Bit return $arch =~ m[64]; } +=item B + +Returns the list of the applets that is provided by the given busybox binary. + +=cut + +sub getAvailableBusyboxApplets +{ + my $busyboxBinary = shift; + + my $busyboxHelp = qx{$busyboxBinary --help}; + if ($busyboxHelp !~ m{defined functions:(.+)\z}ims) { + die "unable to parse busybox --help output:\n$busyboxHelp"; + } + my $rawAppletList = $1; + my @busyboxApplets + = map { + $_ =~ s{\s+}{}igms; + $_; + } + split m{,}, $rawAppletList; + + return @busyboxApplets; +} + 1; -- cgit v1.2.3-55-g7522