Merge pull request #113570 from xaverdh/remove-systemConfig
Remove system config kernel parameter
This commit is contained in:
commit
68496cb927
@ -91,6 +91,11 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The <literal>systemConfig</literal> kernel parameter is no longer added to boot loader entries. It has been unused since September 2010, but if do have a system generation from that era, you will now be unable to boot into them.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<literal>systemd-journal2gelf</literal> no longer parses json and expects the receiving system to handle it. How to achieve this with Graylog is described in this <link xlink:href="https://github.com/parse-nl/SystemdJournal2Gelf/issues/10">GitHub issue</link>.
|
<literal>systemd-journal2gelf</literal> no longer parses json and expects the receiving system to handle it. How to achieve this with Graylog is described in this <link xlink:href="https://github.com/parse-nl/SystemdJournal2Gelf/issues/10">GitHub issue</link>.
|
||||||
|
@ -26,7 +26,7 @@ let
|
|||||||
# A clue for the kernel loading
|
# A clue for the kernel loading
|
||||||
kernelParams = pkgs.writeText "kernel-params.txt" ''
|
kernelParams = pkgs.writeText "kernel-params.txt" ''
|
||||||
Kernel Parameters:
|
Kernel Parameters:
|
||||||
init=/boot/init systemConfig=/boot/init ${toString config.boot.kernelParams}
|
init=/boot/init ${toString config.boot.kernelParams}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# System wide nixpkgs config
|
# System wide nixpkgs config
|
||||||
|
@ -23,13 +23,13 @@ let
|
|||||||
label nixos
|
label nixos
|
||||||
MENU LABEL ^NixOS using nfsroot
|
MENU LABEL ^NixOS using nfsroot
|
||||||
KERNEL bzImage
|
KERNEL bzImage
|
||||||
append ip=dhcp nfsroot=/home/pcroot systemConfig=${config.system.build.toplevel} init=${config.system.build.toplevel}/init rw
|
append ip=dhcp nfsroot=/home/pcroot init=${config.system.build.toplevel}/init rw
|
||||||
|
|
||||||
# I don't know how to make this boot with nfsroot (using the initrd)
|
# I don't know how to make this boot with nfsroot (using the initrd)
|
||||||
label nixos_initrd
|
label nixos_initrd
|
||||||
MENU LABEL NixOS booting the poor ^initrd.
|
MENU LABEL NixOS booting the poor ^initrd.
|
||||||
KERNEL bzImage
|
KERNEL bzImage
|
||||||
append initrd=initrd ip=dhcp nfsroot=/home/pcroot systemConfig=${config.system.build.toplevel} init=${config.system.build.toplevel}/init rw
|
append initrd=initrd ip=dhcp nfsroot=/home/pcroot init=${config.system.build.toplevel}/init rw
|
||||||
|
|
||||||
label memtest
|
label memtest
|
||||||
MENU LABEL ^${pkgs.memtest86.name}
|
MENU LABEL ^${pkgs.memtest86.name}
|
||||||
|
@ -53,7 +53,7 @@ in
|
|||||||
${pkgs.kexectools}/sbin/kexec -p /run/current-system/kernel \
|
${pkgs.kexectools}/sbin/kexec -p /run/current-system/kernel \
|
||||||
--initrd=/run/current-system/initrd \
|
--initrd=/run/current-system/initrd \
|
||||||
--reset-vga --console-vga \
|
--reset-vga --console-vga \
|
||||||
--command-line="systemConfig=$(readlink -f /run/current-system) init=$(readlink -f /run/current-system/init) irqpoll maxcpus=1 reset_devices ${kernelParams}"
|
--command-line="init=$(readlink -f /run/current-system/init) irqpoll maxcpus=1 reset_devices ${kernelParams}"
|
||||||
'';
|
'';
|
||||||
kernelParams = [
|
kernelParams = [
|
||||||
"crashkernel=${crashdump.reservedMemory}"
|
"crashkernel=${crashdump.reservedMemory}"
|
||||||
|
@ -109,7 +109,7 @@ addEntry() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo " APPEND systemConfig=$path init=$path/init $extraParams"
|
echo " APPEND init=$path/init $extraParams"
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpFile="$target/extlinux/extlinux.conf.tmp.$$"
|
tmpFile="$target/extlinux/extlinux.conf.tmp.$$"
|
||||||
|
@ -102,10 +102,10 @@ if (stat($bootPath)->dev != stat("/nix/store")->dev) {
|
|||||||
|
|
||||||
# Discover information about the location of the bootPath
|
# Discover information about the location of the bootPath
|
||||||
struct(Fs => {
|
struct(Fs => {
|
||||||
device => '$',
|
device => '$',
|
||||||
type => '$',
|
type => '$',
|
||||||
mount => '$',
|
mount => '$',
|
||||||
});
|
});
|
||||||
sub PathInMount {
|
sub PathInMount {
|
||||||
my ($path, $mount) = @_;
|
my ($path, $mount) = @_;
|
||||||
my @splitMount = split /\//, $mount;
|
my @splitMount = split /\//, $mount;
|
||||||
@ -154,16 +154,16 @@ sub GetFs {
|
|||||||
return $bestFs;
|
return $bestFs;
|
||||||
}
|
}
|
||||||
struct (Grub => {
|
struct (Grub => {
|
||||||
path => '$',
|
path => '$',
|
||||||
search => '$',
|
search => '$',
|
||||||
});
|
});
|
||||||
my $driveid = 1;
|
my $driveid = 1;
|
||||||
sub GrubFs {
|
sub GrubFs {
|
||||||
my ($dir) = @_;
|
my ($dir) = @_;
|
||||||
my $fs = GetFs($dir);
|
my $fs = GetFs($dir);
|
||||||
my $path = substr($dir, length($fs->mount));
|
my $path = substr($dir, length($fs->mount));
|
||||||
if (substr($path, 0, 1) ne "/") {
|
if (substr($path, 0, 1) ne "/") {
|
||||||
$path = "/$path";
|
$path = "/$path";
|
||||||
}
|
}
|
||||||
my $search = "";
|
my $search = "";
|
||||||
|
|
||||||
@ -251,8 +251,8 @@ my $conf .= "# Automatically generated. DO NOT EDIT THIS FILE!\n";
|
|||||||
|
|
||||||
if ($grubVersion == 1) {
|
if ($grubVersion == 1) {
|
||||||
$conf .= "
|
$conf .= "
|
||||||
default $defaultEntry
|
default $defaultEntry
|
||||||
timeout $timeout
|
timeout $timeout
|
||||||
";
|
";
|
||||||
if ($splashImage) {
|
if ($splashImage) {
|
||||||
copy $splashImage, "$bootPath/background.xpm.gz" or die "cannot copy $splashImage to $bootPath: $!\n";
|
copy $splashImage, "$bootPath/background.xpm.gz" or die "cannot copy $splashImage to $bootPath: $!\n";
|
||||||
@ -302,51 +302,51 @@ else {
|
|||||||
|
|
||||||
if ($copyKernels == 0) {
|
if ($copyKernels == 0) {
|
||||||
$conf .= "
|
$conf .= "
|
||||||
" . $grubStore->search;
|
" . $grubStore->search;
|
||||||
}
|
}
|
||||||
# FIXME: should use grub-mkconfig.
|
# FIXME: should use grub-mkconfig.
|
||||||
$conf .= "
|
$conf .= "
|
||||||
" . $grubBoot->search . "
|
" . $grubBoot->search . "
|
||||||
if [ -s \$prefix/grubenv ]; then
|
if [ -s \$prefix/grubenv ]; then
|
||||||
load_env
|
load_env
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ‘grub-reboot’ sets a one-time saved entry, which we process here and
|
# ‘grub-reboot’ sets a one-time saved entry, which we process here and
|
||||||
# then delete.
|
# then delete.
|
||||||
if [ \"\${next_entry}\" ]; then
|
if [ \"\${next_entry}\" ]; then
|
||||||
set default=\"\${next_entry}\"
|
set default=\"\${next_entry}\"
|
||||||
set next_entry=
|
set next_entry=
|
||||||
save_env next_entry
|
save_env next_entry
|
||||||
set timeout=1
|
set timeout=1
|
||||||
else
|
else
|
||||||
set default=$defaultEntry
|
set default=$defaultEntry
|
||||||
set timeout=$timeout
|
set timeout=$timeout
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup the graphics stack for bios and efi systems
|
# Setup the graphics stack for bios and efi systems
|
||||||
if [ \"\${grub_platform}\" = \"efi\" ]; then
|
if [ \"\${grub_platform}\" = \"efi\" ]; then
|
||||||
insmod efi_gop
|
insmod efi_gop
|
||||||
insmod efi_uga
|
insmod efi_uga
|
||||||
else
|
else
|
||||||
insmod vbe
|
insmod vbe
|
||||||
fi
|
fi
|
||||||
";
|
";
|
||||||
|
|
||||||
if ($font) {
|
if ($font) {
|
||||||
copy $font, "$bootPath/converted-font.pf2" or die "cannot copy $font to $bootPath: $!\n";
|
copy $font, "$bootPath/converted-font.pf2" or die "cannot copy $font to $bootPath: $!\n";
|
||||||
$conf .= "
|
$conf .= "
|
||||||
insmod font
|
insmod font
|
||||||
if loadfont " . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/converted-font.pf2; then
|
if loadfont " . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/converted-font.pf2; then
|
||||||
insmod gfxterm
|
insmod gfxterm
|
||||||
if [ \"\${grub_platform}\" = \"efi\" ]; then
|
if [ \"\${grub_platform}\" = \"efi\" ]; then
|
||||||
set gfxmode=$gfxmodeEfi
|
set gfxmode=$gfxmodeEfi
|
||||||
set gfxpayload=$gfxpayloadEfi
|
set gfxpayload=$gfxpayloadEfi
|
||||||
else
|
else
|
||||||
set gfxmode=$gfxmodeBios
|
set gfxmode=$gfxmodeBios
|
||||||
set gfxpayload=$gfxpayloadBios
|
set gfxpayload=$gfxpayloadBios
|
||||||
fi
|
fi
|
||||||
terminal_output gfxterm
|
terminal_output gfxterm
|
||||||
fi
|
fi
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
if ($splashImage) {
|
if ($splashImage) {
|
||||||
@ -363,14 +363,14 @@ else {
|
|||||||
}
|
}
|
||||||
copy $splashImage, "$bootPath/background$suffix" or die "cannot copy $splashImage to $bootPath: $!\n";
|
copy $splashImage, "$bootPath/background$suffix" or die "cannot copy $splashImage to $bootPath: $!\n";
|
||||||
$conf .= "
|
$conf .= "
|
||||||
insmod " . substr($suffix, 1) . "
|
insmod " . substr($suffix, 1) . "
|
||||||
if background_image --mode '$splashMode' " . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/background$suffix; then
|
if background_image --mode '$splashMode' " . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/background$suffix; then
|
||||||
set color_normal=white/black
|
set color_normal=white/black
|
||||||
set color_highlight=black/white
|
set color_highlight=black/white
|
||||||
else
|
else
|
||||||
set menu_color_normal=cyan/blue
|
set menu_color_normal=cyan/blue
|
||||||
set menu_color_highlight=white/blue
|
set menu_color_highlight=white/blue
|
||||||
fi
|
fi
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,21 +380,21 @@ else {
|
|||||||
# Copy theme
|
# Copy theme
|
||||||
rcopy($theme, "$bootPath/theme") or die "cannot copy $theme to $bootPath\n";
|
rcopy($theme, "$bootPath/theme") or die "cannot copy $theme to $bootPath\n";
|
||||||
$conf .= "
|
$conf .= "
|
||||||
# Sets theme.
|
# Sets theme.
|
||||||
set theme=" . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/theme/theme.txt
|
set theme=" . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/theme/theme.txt
|
||||||
export theme
|
export theme
|
||||||
# Load theme fonts, if any
|
# Load theme fonts, if any
|
||||||
";
|
";
|
||||||
|
|
||||||
find( { wanted => sub {
|
find( { wanted => sub {
|
||||||
if ($_ =~ /\.pf2$/i) {
|
if ($_ =~ /\.pf2$/i) {
|
||||||
$font = File::Spec->abs2rel($File::Find::name, $theme);
|
$font = File::Spec->abs2rel($File::Find::name, $theme);
|
||||||
$conf .= "
|
$conf .= "
|
||||||
loadfont " . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/theme/$font
|
loadfont " . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/theme/$font
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
}, no_chdir => 1 }, $theme );
|
}, no_chdir => 1 }, $theme );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$conf .= "$extraConfig\n";
|
$conf .= "$extraConfig\n";
|
||||||
@ -433,25 +433,25 @@ sub addEntry {
|
|||||||
|
|
||||||
# Include second initrd with secrets
|
# Include second initrd with secrets
|
||||||
if (-e -x "$path/append-initrd-secrets") {
|
if (-e -x "$path/append-initrd-secrets") {
|
||||||
my $initrdName = basename($initrd);
|
my $initrdName = basename($initrd);
|
||||||
my $initrdSecretsPath = "$bootPath/kernels/$initrdName-secrets";
|
my $initrdSecretsPath = "$bootPath/kernels/$initrdName-secrets";
|
||||||
|
|
||||||
mkpath(dirname($initrdSecretsPath), 0, 0755);
|
mkpath(dirname($initrdSecretsPath), 0, 0755);
|
||||||
my $oldUmask = umask;
|
my $oldUmask = umask;
|
||||||
# Make sure initrd is not world readable (won't work if /boot is FAT)
|
# Make sure initrd is not world readable (won't work if /boot is FAT)
|
||||||
umask 0137;
|
umask 0137;
|
||||||
my $initrdSecretsPathTemp = File::Temp::mktemp("$initrdSecretsPath.XXXXXXXX");
|
my $initrdSecretsPathTemp = File::Temp::mktemp("$initrdSecretsPath.XXXXXXXX");
|
||||||
system("$path/append-initrd-secrets", $initrdSecretsPathTemp) == 0 or die "failed to create initrd secrets: $!\n";
|
system("$path/append-initrd-secrets", $initrdSecretsPathTemp) == 0 or die "failed to create initrd secrets: $!\n";
|
||||||
# Check whether any secrets were actually added
|
# Check whether any secrets were actually added
|
||||||
if (-e $initrdSecretsPathTemp && ! -z _) {
|
if (-e $initrdSecretsPathTemp && ! -z _) {
|
||||||
rename $initrdSecretsPathTemp, $initrdSecretsPath or die "failed to move initrd secrets into place: $!\n";
|
rename $initrdSecretsPathTemp, $initrdSecretsPath or die "failed to move initrd secrets into place: $!\n";
|
||||||
$copied{$initrdSecretsPath} = 1;
|
$copied{$initrdSecretsPath} = 1;
|
||||||
$initrd .= " " . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/kernels/$initrdName-secrets";
|
$initrd .= " " . ($grubBoot->path eq "/" ? "" : $grubBoot->path) . "/kernels/$initrdName-secrets";
|
||||||
} else {
|
} else {
|
||||||
unlink $initrdSecretsPathTemp;
|
unlink $initrdSecretsPathTemp;
|
||||||
rmdir dirname($initrdSecretsPathTemp);
|
rmdir dirname($initrdSecretsPathTemp);
|
||||||
}
|
}
|
||||||
umask $oldUmask;
|
umask $oldUmask;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $xen = -e "$path/xen.gz" ? copyToKernelsDir(Cwd::abs_path("$path/xen.gz")) : undef;
|
my $xen = -e "$path/xen.gz" ? copyToKernelsDir(Cwd::abs_path("$path/xen.gz")) : undef;
|
||||||
@ -459,9 +459,8 @@ sub addEntry {
|
|||||||
# FIXME: $confName
|
# FIXME: $confName
|
||||||
|
|
||||||
my $kernelParams =
|
my $kernelParams =
|
||||||
"systemConfig=" . Cwd::abs_path($path) . " " .
|
"init=" . Cwd::abs_path("$path/init") . " " .
|
||||||
"init=" . Cwd::abs_path("$path/init") . " " .
|
readFile("$path/kernel-params");
|
||||||
readFile("$path/kernel-params");
|
|
||||||
my $xenParams = $xen && -e "$path/xen-params" ? readFile("$path/xen-params") : "";
|
my $xenParams = $xen && -e "$path/xen-params" ? readFile("$path/xen-params") : "";
|
||||||
|
|
||||||
if ($grubVersion == 1) {
|
if ($grubVersion == 1) {
|
||||||
@ -503,9 +502,9 @@ foreach my $link (@links) {
|
|||||||
|
|
||||||
my $date = strftime("%F", localtime(lstat($link)->mtime));
|
my $date = strftime("%F", localtime(lstat($link)->mtime));
|
||||||
my $version =
|
my $version =
|
||||||
-e "$link/nixos-version"
|
-e "$link/nixos-version"
|
||||||
? readFile("$link/nixos-version")
|
? readFile("$link/nixos-version")
|
||||||
: basename((glob(dirname(Cwd::abs_path("$link/kernel")) . "/lib/modules/*"))[0]);
|
: basename((glob(dirname(Cwd::abs_path("$link/kernel")) . "/lib/modules/*"))[0]);
|
||||||
|
|
||||||
if ($cfgName) {
|
if ($cfgName) {
|
||||||
$entryName = $cfgName;
|
$entryName = $cfgName;
|
||||||
@ -530,8 +529,8 @@ sub addProfile {
|
|||||||
sub nrFromGen { my ($x) = @_; $x =~ /\/\w+-(\d+)-link/; return $1; }
|
sub nrFromGen { my ($x) = @_; $x =~ /\/\w+-(\d+)-link/; return $1; }
|
||||||
|
|
||||||
my @links = sort
|
my @links = sort
|
||||||
{ nrFromGen($b) <=> nrFromGen($a) }
|
{ nrFromGen($b) <=> nrFromGen($a) }
|
||||||
(glob "$profile-*-link");
|
(glob "$profile-*-link");
|
||||||
|
|
||||||
my $curEntry = 0;
|
my $curEntry = 0;
|
||||||
foreach my $link (@links) {
|
foreach my $link (@links) {
|
||||||
@ -542,9 +541,9 @@ sub addProfile {
|
|||||||
}
|
}
|
||||||
my $date = strftime("%F", localtime(lstat($link)->mtime));
|
my $date = strftime("%F", localtime(lstat($link)->mtime));
|
||||||
my $version =
|
my $version =
|
||||||
-e "$link/nixos-version"
|
-e "$link/nixos-version"
|
||||||
? readFile("$link/nixos-version")
|
? readFile("$link/nixos-version")
|
||||||
: basename((glob(dirname(Cwd::abs_path("$link/kernel")) . "/lib/modules/*"))[0]);
|
: basename((glob(dirname(Cwd::abs_path("$link/kernel")) . "/lib/modules/*"))[0]);
|
||||||
addEntry("NixOS - Configuration " . nrFromGen($link) . " ($date - $version)", $link);
|
addEntry("NixOS - Configuration " . nrFromGen($link) . " ($date - $version)", $link);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +565,7 @@ $extraPrepareConfig =~ s/\@bootPath\@/$bootPath/g;
|
|||||||
|
|
||||||
# Run extraPrepareConfig in sh
|
# Run extraPrepareConfig in sh
|
||||||
if ($extraPrepareConfig ne "") {
|
if ($extraPrepareConfig ne "") {
|
||||||
system((get("shell"), "-c", $extraPrepareConfig));
|
system((get("shell"), "-c", $extraPrepareConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
# write the GRUB config.
|
# write the GRUB config.
|
||||||
@ -627,13 +626,13 @@ foreach my $fn (glob "$bootPath/kernels/*") {
|
|||||||
#
|
#
|
||||||
|
|
||||||
struct(GrubState => {
|
struct(GrubState => {
|
||||||
name => '$',
|
name => '$',
|
||||||
version => '$',
|
version => '$',
|
||||||
efi => '$',
|
efi => '$',
|
||||||
devices => '$',
|
devices => '$',
|
||||||
efiMountPoint => '$',
|
efiMountPoint => '$',
|
||||||
extraGrubInstallArgs => '@',
|
extraGrubInstallArgs => '@',
|
||||||
});
|
});
|
||||||
# If you add something to the state file, only add it to the end
|
# If you add something to the state file, only add it to the end
|
||||||
# because it is read line-by-line.
|
# because it is read line-by-line.
|
||||||
sub readGrubState {
|
sub readGrubState {
|
||||||
|
@ -49,7 +49,6 @@ addEntry() {
|
|||||||
echo "#!/bin/sh"
|
echo "#!/bin/sh"
|
||||||
echo "# $name"
|
echo "# $name"
|
||||||
echo "# created by init-script-builder.sh"
|
echo "# created by init-script-builder.sh"
|
||||||
echo "export systemConfig=$(readlink -f $path)"
|
|
||||||
echo "exec $stage2"
|
echo "exec $stage2"
|
||||||
)"
|
)"
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ def write_entry(profile, generation, machine_id):
|
|||||||
entry_file = "@efiSysMountPoint@/loader/entries/nixos-generation-%d.conf" % (generation)
|
entry_file = "@efiSysMountPoint@/loader/entries/nixos-generation-%d.conf" % (generation)
|
||||||
generation_dir = os.readlink(system_dir(profile, generation))
|
generation_dir = os.readlink(system_dir(profile, generation))
|
||||||
tmp_path = "%s.tmp" % (entry_file)
|
tmp_path = "%s.tmp" % (entry_file)
|
||||||
kernel_params = "systemConfig=%s init=%s/init " % (generation_dir, generation_dir)
|
kernel_params = "init=%s/init " % generation_dir
|
||||||
|
|
||||||
with open("%s/kernel-params" % (generation_dir)) as params_file:
|
with open("%s/kernel-params" % (generation_dir)) as params_file:
|
||||||
kernel_params = kernel_params + params_file.read()
|
kernel_params = kernel_params + params_file.read()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user