source: trunk/tools/ptest.pl @ 1041

Last change on this file since 1041 was 406, checked in by bcornec, 13 years ago

Busybox script to create the links

  • Property svn:executable set to *
File size: 681 bytes
Line 
1#!/usr/bin/perl -w
2
3use strict;
4use Data::Dumper;
5
6sub get_cmds {
7
8    my $dumb;
9    my $f;
10
11    open (FILE,"/bin/busybox --help 2>&1|") or die "Unable to call busybox";
12    undef $/;
13    ($dumb,$f) = split /functions:/,<FILE>;
14    close(FILE);
15    $f =~ s/\s//g;
16return (split /,/,$f);
17}
18
19# Should probably be an absolute path
20my $basedir = "symlinks";
21my $tarfile = "$basedir.tgz";
22
23print "Making tarfile $tarfile ...\n";
24
25system ("rm -rf $basedir");
26unlink $tarfile;
27
28mkdir $basedir,0755;
29mkdir "$basedir/usr",0755;
30mkdir "$basedir/usr/bin",0755;
31
32chdir "$basedir/usr/bin";
33for my $l (get_cmds) {
34    symlink "../../bin/busybox",$l;
35}
36
37chdir "../..";
38system("tar cfz ../$tarfile .");
39print "Done.\n";
40
Note: See TracBrowser for help on using the repository browser.