# HG changeset patch
# User Timo Lindfors <timo.lindfors@iki.fi>
# Date 1647554325 -7200
#      Thu Mar 17 23:58:45 2022 +0200
# Node ID b35cb59d10c51d9ec901833898ca9e3065bd4f27
# Parent  97aaba204e327e32dc064418e67bad7045aaaccf
Introduce GRUB_TBOOT_SINIT_LIST for selecting SINIT modules to use
Signed-off-by: Timo Lindfors <timo.lindfors@iki.fi>

diff -r 97aaba204e32 -r b35cb59d10c5 tboot/20_linux_tboot
--- a/tboot/20_linux_tboot	Thu Mar 17 23:58:41 2022 +0200
+++ b/tboot/20_linux_tboot	Thu Mar 17 23:58:45 2022 +0200
@@ -39,12 +39,15 @@
 [ -z "${GRUB_CMDLINE_TBOOT}" ] && unset GRUB_CMDLINE_TBOOT
 [ -z "${GRUB_CMDLINE_LINUX_TBOOT}" ] && unset GRUB_CMDLINE_LINUX_TBOOT
 [ -z "${GRUB_TBOOT_POLICY_DATA}" ] && unset GRUB_TBOOT_POLICY_DATA
+[ -z "${GRUB_TBOOT_SINIT_LIST}" ] && unset GRUB_TBOOT_SINIT_LIST
 # Command line for tboot itself
 : ${GRUB_CMDLINE_TBOOT='logging=serial,memory,vga'}
 # Linux kernel parameters to append for tboot
 : ${GRUB_CMDLINE_LINUX_TBOOT='intel_iommu=on'}
 # Base name of LCP policy data file for list policy
 : ${GRUB_TBOOT_POLICY_DATA=''}
+# List of SINIT modules to use, glob patterns are supported
+: ${GRUB_TBOOT_SINIT_LIST='/boot/*sinit* /boot/*SINIT*'}
 
 export TEXTDOMAIN=grub
 export TEXTDOMAINDIR=${prefix}/share/locale
@@ -161,7 +164,7 @@
 tboot_list=`for i in /boot/tboot*.gz; do
         if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
       done`
-sinit_list=`for i in /boot/*sinit* /boot/*SINIT*; do
+sinit_list=`for i in ${GRUB_TBOOT_SINIT_LIST}; do
         basename=$(basename $i)
         if grub_file_is_not_garbage "$i" ; then echo -n "$basename " ; fi
       done`
diff -r 97aaba204e32 -r b35cb59d10c5 tboot/20_linux_xen_tboot
--- a/tboot/20_linux_xen_tboot	Thu Mar 17 23:58:41 2022 +0200
+++ b/tboot/20_linux_xen_tboot	Thu Mar 17 23:58:45 2022 +0200
@@ -40,6 +40,7 @@
 [ -z "${GRUB_CMDLINE_XEN_TBOOT}" ] && unset GRUB_CMDLINE_XEN_TBOOT
 [ -z "${GRUB_CMDLINE_LINUX_XEN_TBOOT}" ] && unset GRUB_CMDLINE_LINUX_XEN_TBOOT
 [ -z "${GRUB_TBOOT_POLICY_DATA}" ] && unset GRUB_TBOOT_POLICY_DATA
+[ -z "${GRUB_TBOOT_SINIT_LIST}" ] && unset GRUB_TBOOT_SINIT_LIST
 # Command line for tboot itself
 : ${GRUB_CMDLINE_TBOOT='logging=serial,memory,vga'}
 # Xen parameters to append for tboot
@@ -48,6 +49,8 @@
 : ${GRUB_CMDLINE_LINUX_XEN_TBOOT=''}
 # Base name of LCP policy data file for list policy
 : ${GRUB_TBOOT_POLICY_DATA=''}
+# List of SINIT modules to use, glob patterns are supported
+: ${GRUB_TBOOT_SINIT_LIST='/boot/*sinit* /boot/*SINIT*'}
 
 export TEXTDOMAIN=grub
 export TEXTDOMAINDIR=${prefix}/share/locale
@@ -191,7 +194,7 @@
 tboot_list=`for i in /boot/tboot*.gz; do
         if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
       done`
-sinit_list=`for i in /boot/*sinit* /boot/*SINIT*; do
+sinit_list=`for i in ${GRUB_TBOOT_SINIT_LIST}; do
         basename=$(basename $i)
         if grub_file_is_not_garbage "$i" ; then echo -n "$basename " ; fi
       done`
