summary refs log tree commit diff
path: root/nixos/modules/system/boot/loader/grub/install-grub.pl
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-02-22 18:47:53 +0000
committerAlyssa Ross <hi@alyssa.is>2019-02-22 18:47:53 +0000
commit43c723b3c60350eb72b11e658b2e6a122fda6bfc (patch)
treeafc0f8933110431cfbe7f246720077d0f2a82221 /nixos/modules/system/boot/loader/grub/install-grub.pl
parent6141939d6e0a77c84905efd560c03c3032164ef1 (diff)
downloadnixlib-sixos.tar
nixlib-sixos.tar.gz
nixlib-sixos.tar.bz2
nixlib-sixos.tar.lz
nixlib-sixos.tar.xz
nixlib-sixos.tar.zst
nixlib-sixos.zip
s6 experiments sixos
Diffstat (limited to 'nixos/modules/system/boot/loader/grub/install-grub.pl')
-rw-r--r--nixos/modules/system/boot/loader/grub/install-grub.pl17
1 files changed, 17 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl
index bda6a3136407..9ad86763f06e 100644
--- a/nixos/modules/system/boot/loader/grub/install-grub.pl
+++ b/nixos/modules/system/boot/loader/grub/install-grub.pl
@@ -372,6 +372,10 @@ sub addEntry {
         "systemConfig=" . Cwd::abs_path($path) . " " .
         "init=" . Cwd::abs_path("$path/init") . " " .
         readFile("$path/kernel-params");
+    my $kernelParams6 =
+        "systemConfig=" . Cwd::abs_path($path) . " " .
+        "init=" . Cwd::abs_path($path) . "/s6/init " .
+        readFile("$path/kernel-params");
     my $xenParams = $xen && -e "$path/xen-params" ? readFile("$path/xen-params") : "";
 
     if ($grubVersion == 1) {
@@ -393,6 +397,19 @@ sub addEntry {
         $conf .= "  multiboot $xen $xenParams\n" if $xen;
         $conf .= "  " . ($xen ? "module" : "linux") . " $kernel $kernelParams\n";
         $conf .= "  " . ($xen ? "module" : "initrd") . " $initrd\n";
+        $conf .= "}\n";
+        $conf .= "menuentry \"$name - s6\" {\n";
+        $conf .= $grubBoot->search . "\n";
+        if ($copyKernels == 0) {
+            $conf .= $grubStore->search . "\n";
+        }
+        if ($extraInitrd) {
+            $conf .= $extraInitrdPath->search . "\n";
+        }
+        $conf .= "  $extraPerEntryConfig\n" if $extraPerEntryConfig;
+        $conf .= "  multiboot $xen $xenParams\n" if $xen;
+        $conf .= "  " . ($xen ? "module" : "linux") . " $kernel $kernelParams6\n";
+        $conf .= "  " . ($xen ? "module" : "initrd") . " $initrd\n";
         $conf .= "}\n\n";
     }
 }