initial commit of file from CVS for e-smith-grub on Wed 12 Jul 08:55:23 BST 2023

This commit is contained in:
Brian Read
2023-07-12 08:55:23 +01:00
parent 02dc245d5a
commit 6f93c1b6c7
100 changed files with 1607 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
#!/usr/bin/perl
use strict;
use warnings;
use esmith::ConfigDB;
my $c = esmith::ConfigDB->open_ro or die "Could not open Config DB";
my $sysconfig = $c->get('sysconfig') or die "Missing db entry sysconfig";
my $locale = $sysconfig->prop('Language') || "en_US.UTF-8";
my $orilang=$ENV{LANG};
# here we force the environement as it is empty if launched by server-manager
if ( ! defined $ENV{LANG}|| $ENV{LANG}eq "" || $ENV{LANG} eq "C") {
$ENV{LANG}=$locale;
}
my $grubpath;
if (-e "/sys/firmware/efi") {
$grubpath = "/boot/efi/EFI/centos/grub.cfg";
} else {
$grubpath = "/boot/grub2/grub.cfg";
}
system("/usr/sbin/grub2-mkconfig", "-o", $grubpath) == 0
or die("Unable to update grub2\n");
$ENV{LANG}=$orilang;