/usr/share/gfxboot/bin/unpack_bootlogo is in gfxboot-dev 4.4.3-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #! /usr/bin/perl
sub unpack_bootlogo;
$src = shift;
$xdir = shift;
unpack_bootlogo $src, $xdir;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub unpack_bootlogo
{
my ($dir, $tmp, $files, @files, @ext);
local $_;
$dir = shift;
$tmp = "$dir/bootlogo.unpacked";
mkdir "$tmp", 0755;
mkdir "$dir/$xdir", 0755 if $xdir;
@files = `cpio --quiet -t <$dir/bootlogo`;
system "cd $tmp; cpio --quiet -i <../bootlogo";
for (@files) {
chomp;
if(-k("$tmp/$_") && ! -l("$tmp/$_")) {
push @ext, $_;
undef $_;
}
}
if($xdir) {
rename "$dir/gfxboot.cfg", "$dir/$xdir/gfxboot.cfg.tmp" if -f "$dir/gfxboot.cfg";
system "chmod -t $tmp/$_ ; mv $tmp/$_ $dir/$xdir ; ln -s $xdir/$_ $tmp/$_" for @ext;
if(-f "$dir/$xdir/gfxboot.cfg.tmp") {
system "cat $dir/$xdir/gfxboot.cfg.tmp >>$dir/$xdir/gfxboot.cfg";
unlink "$dir/$xdir/gfxboot.cfg.tmp";
}
}
else {
rename "$dir/gfxboot.cfg", "$dir/gfxboot.cfg.tmp" if -f "$dir/gfxboot.cfg";
system "chmod -t $tmp/$_ ; mv $tmp/$_ $dir" for @ext;
if(-f "$dir/gfxboot.cfg.tmp") {
system "cat $dir/gfxboot.cfg.tmp >>$dir/gfxboot.cfg";
unlink "$dir/gfxboot.cfg.tmp";
}
}
open P, "| cd $tmp; cpio --quiet -o >../bootlogo";
print P "$_\n" for grep $_, @files;
if($xdir) { print P "$_\n" for @ext }
close P;
system "rm -rf $tmp";
return ( 'bootlogo', @ext );
}
|