summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initramfs/OpenSLX/MakeInitRamFS/Engine.pm12
-rw-r--r--installer/OpenSLX/OSSetup/Engine.pm5
-rw-r--r--lib/OpenSLX/Utils.pm26
3 files changed, 29 insertions, 14 deletions
diff --git a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm
index 996d5f93..a5adb835 100644
--- a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm
+++ b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm
@@ -362,17 +362,7 @@ sub _copyBusybox
= "$openslxConfig{'base-path'}/share/busybox/busybox"
. ( hostIs64Bit() ? '.x86_64' : '.i586' );
- my $busyboxHelp = qx{$busyboxForHost --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;
+ my @busyboxApplets = getAvailableBusyboxApplets($busyboxForHost);
foreach my $applet (@busyboxApplets) {
$self->addCMD("ln -sf /bin/busybox $self->{'build-path'}/bin/$applet");
}
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm
index 86b262d8..2af1c3f1 100644
--- a/installer/OpenSLX/OSSetup/Engine.pm
+++ b/installer/OpenSLX/OSSetup/Engine.pm
@@ -1226,9 +1226,8 @@ sub _stage1A_createBusyboxEnvironment
}
# create all needed links to busybox:
- my $links
- = slurpFile("$openslxConfig{'base-path'}/share/busybox/busybox.links");
- foreach my $linkTarget (split "\n", $links) {
+ my @busyboxApplets = getAvailableBusyboxApplets($self->{'busybox-binary'});
+ foreach my $linkTarget (@busyboxApplets) {
linkFile('/bin/busybox', "$self->{stage1aDir}/$linkTarget");
}
if ($self->_hostIs64Bit()) {
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;