From f2771a7825bdbc12bfc0ab7ea0aeb89cb5c72d15 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sun, 17 Apr 2011 14:01:53 +0000 Subject: Factorize change_bootloader_config for next commit. --- lib/Xconfig/various.pm | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/Xconfig/various.pm b/lib/Xconfig/various.pm index 59cf92b..516bd12 100644 --- a/lib/Xconfig/various.pm +++ b/lib/Xconfig/various.pm @@ -353,8 +353,8 @@ sub check_xorg_conf_symlink() { } } -sub setupFB { - my ($bios_vga_mode) = @_; +sub change_bootloader_config { + my ($do, @do_params) = @_; require bootloader; my ($bootloader, $all_hds); @@ -372,13 +372,25 @@ sub setupFB { $bootloader = bootloader::read($all_hds) or return; } - foreach (@{$bootloader->{entries}}) { - $_->{vga} = $bios_vga_mode if $_->{vga}; #- replace existing vga= with - } + $do->($bootloader, @do_params) or return; - bootloader::update_splash($bootloader); bootloader::action($bootloader, 'write', $all_hds); bootloader::action($bootloader, 'when_config_changed'); + 1; +} + +sub setupFB { + my ($bios_vga_mode) = @_; + + change_bootloader_config( + sub { + my ($bootloader, $bios_vga_mode) = @_; + foreach (@{$bootloader->{entries}}) { + $_->{vga} = $bios_vga_mode if $_->{vga}; #- replace existing vga= with + } + bootloader::update_splash($bootloader); + 1; + }, $bios_vga_mode); } 1; -- cgit v1.2.1