diff options
author | Oliver Tappe | 2008-05-31 20:53:21 +0200 |
---|---|---|
committer | Oliver Tappe | 2008-05-31 20:53:21 +0200 |
commit | 272b14501e974b2731bac808265b2b94f48e6071 (patch) | |
tree | 826135d7525f9c3fa7261c0dd38c9f60e8be1e21 /lib/OpenSLX/Utils.pm | |
parent | Complete renaming in the main Makefile (for proper installation). (diff) | |
download | core-272b14501e974b2731bac808265b2b94f48e6071.tar.gz core-272b14501e974b2731bac808265b2b94f48e6071.tar.xz core-272b14501e974b2731bac808265b2b94f48e6071.zip |
* 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
Diffstat (limited to 'lib/OpenSLX/Utils.pm')
-rw-r--r-- | lib/OpenSLX/Utils.pm | 26 |
1 files changed, 26 insertions, 0 deletions
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<getAvailableBusyboxApplets()> + +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; |