diff options
| author | Florent Villard <warly@mandriva.com> | 2006-04-10 15:54:05 +0000 |
|---|---|---|
| committer | Florent Villard <warly@mandriva.com> | 2006-04-10 15:54:05 +0000 |
| commit | 644d2f982aeb403fea58f851fadf0c26508aa67d (patch) | |
| tree | 70c53ed8b23287ed1a4b4877dca0fca64cddef0a /scripts/remove-boot-splash | |
| parent | 1697e7a5fce440e9785055360673f11413fda59b (diff) | |
| download | bootsplash-644d2f982aeb403fea58f851fadf0c26508aa67d.tar bootsplash-644d2f982aeb403fea58f851fadf0c26508aa67d.tar.gz bootsplash-644d2f982aeb403fea58f851fadf0c26508aa67d.tar.bz2 bootsplash-644d2f982aeb403fea58f851fadf0c26508aa67d.tar.xz bootsplash-644d2f982aeb403fea58f851fadf0c26508aa67d.zip | |
handle initramfs initrd in make-boot-splash and remove-boot-splash
Diffstat (limited to 'scripts/remove-boot-splash')
| -rw-r--r-- | scripts/remove-boot-splash | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/remove-boot-splash b/scripts/remove-boot-splash index e63c3b5..3ab7425 100644 --- a/scripts/remove-boot-splash +++ b/scripts/remove-boot-splash @@ -6,6 +6,24 @@ my $magic = 'BOOTSPL3'; my $buffer_size = 15; my ($initrd) = @ARGV; + +# FIXME it must have a clear way to do that in perl +if (!system("/bin/zcat $initrd 2> /dev/null | /bin/cpio -t &> /dev/null")) { + print STDERR "remove-boot-splash: initrd in initramfs format\n"; + chomp(my $tmp_dir = `mktemp -d`); + chdir $tmp_dir; + system("/bin/zcat $initrd 2>/dev/null | /bin/cpio -id 2>/dev/null"); + if (-f "$tmp_dir/bootsplash") { + unlink "$tmp_dir/bootsplash" or die "FATAL: removing of $tmp_dir/bootsplash failed"; + print STDERR "remove-boot-splash: removing bootsplash from initrd\n"; + system("/bin/find . -print | /bin/cpio -o 2> /dev/null | gzip -c > $initrd") + } else { + print STDERR "ERROR remove-boot-splash: bootsplash image not found in $initrd\n" + } + system("rm -rf $tmp_dir"); + exit +} + open(my $F, "+< $initrd") or die "can't open $initrd: $!\n"; while (1) { |
