diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2009-04-28 13:09:04 +0000 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2009-04-28 13:09:04 +0000 |
commit | cf4419ef4e654952f09bbb8bf31b4247ece0f9ec (patch) | |
tree | 0fcd0f4d4db0d40229f2defc08527152fb94d8e5 | |
parent | 737667619a414817e94ec93d081858c0c5e5843a (diff) | |
download | draklive-cf4419ef4e654952f09bbb8bf31b4247ece0f9ec.tar draklive-cf4419ef4e654952f09bbb8bf31b4247ece0f9ec.tar.gz draklive-cf4419ef4e654952f09bbb8bf31b4247ece0f9ec.tar.bz2 draklive-cf4419ef4e654952f09bbb8bf31b4247ece0f9ec.tar.xz draklive-cf4419ef4e654952f09bbb8bf31b4247ece0f9ec.zip |
Remove unneeded locales from gfxboot data file
The gfxboot data file (bootlogo) installed by mandriva-gfxboot-theme
package contains translations for all known languages. However, if this
file is too big, this causes boot problems on some systems (bug #48688).
On Ones, since we know the languages that will be included on the live
cd, we can remove all the locales we don't need from the bootlogo file.
-rwxr-xr-x | draklive | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -480,6 +480,38 @@ sub create_bootloader { } } +sub remove_unneeded_bootlogo_locales { + use File::Temp; + use Cwd; + + my ($bootlogo, @locales) = @_; + + $bootlogo = Cwd::realpath ($bootlogo); + -f $bootlogo or return; + + my $cwd = Cwd::getcwd(); + my $tempdir = File::Temp::tempdir ("mdvgfxbootXXXX", CLEANUP => 1); + chdir $tempdir; + !system ("cpio -id < $bootlogo") or return; + + # Make sure we include the en locale + push @locales, 'en'; + my @kept_locales; + foreach my $file (glob "*.tr") { + if (!grep { $file =~ /^$_\.tr$/ } @locales) { + unlink $file; + } else { + my ($locale_name) = ($file =~ /(.*)\.tr$/); + push @kept_locales, $locale_name; + } + } + system("echo init 16x16.fnt *.tr |sed \"s/ /\\n/g\" |cpio -o >$bootlogo"); + chdir $cwd; + + print "gfxboot locales: " . join(" ", @kept_locales) . "\n"; + return @kept_locales; +} + sub create_media_bootloader { my ($live) = @_; cp_f($live->get_system_root . '/boot/vmlinuz-' . $live->find_kernel, $live->get_builddir . $live->{prefix}{build}{boot} . '/vmlinuz'); @@ -499,6 +531,8 @@ sub create_media_bootloader { } my $bootlogo = $syslinux_dir . '/bootlogo'; warn "unable to find gfxboot splash ($bootlogo)\n" if ! -f $bootlogo; + my @locales = remove_unneeded_bootlogo_locales($bootlogo, get_langs($live)); + output_p($syslinux_dir . '/langs', join("\n", @locales) . "\n"); output_p($syslinux_dir . '/gfxboot.cfg', join("\n", "livecd=1", "mainmenu.pos=210,235", "mainmenu.bar.minwidth=400", "panel.f-key.fg=0x33358c")); |