]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
templates: Add support for acpi on Hurd
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 26 Sep 2022 19:51:32 +0000 (21:51 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 11 Oct 2022 12:19:28 +0000 (14:19 +0200)
This adds acpi as bootstrap module whenever it is available. This opens the
path for proper IRQ routing for fully-userland disk drivers.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub.d/10_hurd.in

index 4294bbe4cc216d036fd1cacc0c22cebb498d0dde..a021d02c28daf50ae8fd471dc9f3a5661abffe5e 100644 (file)
@@ -68,6 +68,12 @@ for i in /hurd/${hurd_fs}.static /hurd/exec ; do
   fi
 done
 
+if test -e '/hurd/acpi.static' ; then
+  acpi=true
+else
+  acpi=false
+fi
+
 if test -e '/hurd/pci-arbiter.static' ; then
   pci_arbiter=true
 else
@@ -153,6 +159,24 @@ EOF
        echo            '$(echo "$message" | grub_quote)'
 EOF
 
+  if [ "$acpi" = true ] ; then
+    if [ "$pci_arbiter" = true ] ; then
+      next_task='${pci-task}'
+    elif [ "$rumpdisk" = true ] ; then
+      next_task='${disk-task}'
+    else
+      next_task='${fs-task}'
+    fi
+    sed "s/^/$submenu_indentation/" << EOF
+       module          /hurd/acpi.static acpi \\
+                       $host_ports \\
+                       --next-task='$next_task' \\
+                       '\$(acpi-task=task-create)' $resume_task
+EOF
+    host_ports=""
+    resume_task=""
+  fi
+
   if [ "$pci_arbiter" = true ] ; then
     if [ "$rumpdisk" = true ] ; then
       next_task='${disk-task}'