summaryrefslogtreecommitdiffstats
path: root/grub-gfxmenu
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2009-01-27 17:30:08 +0000
committerPascal Rigaux <pixel@mandriva.com>2009-01-27 17:30:08 +0000
commit5ce8d30439463838f845c78bc926cc9b310a8743 (patch)
treebb1852dc58711c7baee31216a765067dfa49b65b /grub-gfxmenu
parent10658e71475bd964263d09f1a661f24fadfaf496 (diff)
downloadbootloader-theme-5ce8d30439463838f845c78bc926cc9b310a8743.tar
bootloader-theme-5ce8d30439463838f845c78bc926cc9b310a8743.tar.gz
bootloader-theme-5ce8d30439463838f845c78bc926cc9b310a8743.tar.bz2
bootloader-theme-5ce8d30439463838f845c78bc926cc9b310a8743.tar.xz
bootloader-theme-5ce8d30439463838f845c78bc926cc9b310a8743.zip
imported openSUSE.tar.bz2 (from gfxboot-4.1.19-2.1.src.rpm)4.1.19.1
Diffstat (limited to 'grub-gfxmenu')
-rwxr-xr-xgrub-gfxmenu79
1 files changed, 0 insertions, 79 deletions
diff --git a/grub-gfxmenu b/grub-gfxmenu
deleted file mode 100755
index 9da113a..0000000
--- a/grub-gfxmenu
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Long;
-
-my $gfxmenu = '/boot/gfxmenu';
-
-my %options = (
- "lang=s" => \ (my $lang),
- "update-theme" => \ (my $update_theme),
- "update-gfxmenu" => \ (my $update_gfxmenu),
- "quiet" => \ (my $quiet),
- );
-
-GetOptions(%options) && @ARGV == 0 && ($lang || $update_theme || $update_gfxmenu) or usage();
-
-if ($update_gfxmenu) {
- $update_theme = 1;
- $lang ||= eval { get_lang() };
- sys('cp', '/usr/share/gfxboot/themes/Mandriva/boot/message', $gfxmenu);
-}
-
-if (!-e $gfxmenu) {
- warn "$gfxmenu doesn't exist\n" if !$quiet;
- exit;
-}
-
-if ($lang) {
- set_lang($lang);
-}
-if ($update_theme) {
- set_theme();
-}
-
-sub usage {
- die "grub-gfxmenu [--quiet] [--lang <lang>] [--update-theme] [--update-gfxmenu]\n";
-}
-
-sub set_theme() {
- my $background_dir = '/usr/share/gfxboot/themes/current';
-
- #checking
- -f "$background_dir/back.jpg" or return;
- remove_file('back.jpg');
- sys("echo back.jpg | (cd $background_dir ; cpio -o --quiet -O $gfxmenu --append)");
-}
-
-sub remove_file {
- my ($file) = @_;
- sys("cpio-filter --in-place --exclude $file $gfxmenu");
-}
-
-sub get_lang() {
- require Archive::Cpio;
-
- my $cpio = Archive::Cpio->new;
- $cpio->read($gfxmenu);
- my $e = $cpio->get_file('lang') or return;
- my $lang = $e->{data};
- chomp $lang;
- $lang;
-}
-
-sub set_lang {
- my ($lang) = @_;
-
- require Archive::Cpio;
-
- my $cpio = Archive::Cpio->new;
- $cpio->read($gfxmenu);
- if (my $e = $cpio->get_file('lang')) {
- $e->{data} = "$lang\n";
- } else {
- $cpio->add_data('lang', "$lang\n");
- }
- $cpio->write($gfxmenu);
-}
-
-sub system_verbose { print join(' ', @_), "\n"; system(@_) }
-sub sys { system(@_); $? and die }