3 # (c) 2009 Technische Universität Dresden
4 # This file is part of TUD:OS and distributed under the terms of the
5 # GNU General Public License 2.
6 # Please see the COPYING-GPL-2 file for details.
8 # Adam Lackorzynski <adam@os.inf.tu-dresden.de>
13 BEGIN { unshift @INC, $ENV{L4DIR}.'/tool/lib'
14 if $ENV{L4DIR} && -d $ENV{L4DIR}.'/tool/lib/L4';}
17 use File::Temp qw/tempdir/;
19 my $qemu = $ENV{QEMU} || 'qemu';
20 my $kernelname = $ENV{KERNEL} || 'bootstrap';
21 my $module_path = $ENV{SEARCHPATH} || ".";
22 my $modulesfile = shift;
23 my $entryname = shift;
24 my $unzip_tmp = tempdir(CLEANUP => 1);
31 my $fp = L4::ModList::get_file_uncompressed_or_die($command, $module_path,
34 $cmdline =~ s/^\S+\s*//;
39 die "No entry name given" unless defined $entryname;
41 my %entry = L4::ModList::get_module_entry($modulesfile, $entryname);
43 my @mods = @{$entry{mods}};
44 my $kernel = L4::ModList::search_file_or_die($entry{bootstrap}{command}, $module_path);
45 my $initrd = join(',', map { get_file($_->{command}, $_->{cmdline}) } @mods);
48 "$qemu -kernel $kernel -append \"$entry{bootstrap}{cmdline}\" ".
49 "-initrd \"$initrd\" ".join(' ', @ARGV);
51 print "Note: At least QEmu 0.13 is required for the loading to work.\n";