summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgenerate_bls_conf.sh28
-rw-r--r--kernel.spec6
2 files changed, 34 insertions, 0 deletions
diff --git a/generate_bls_conf.sh b/generate_bls_conf.sh
new file mode 100755
index 000000000..8d9ec0699
--- /dev/null
+++ b/generate_bls_conf.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -e
+
+. /etc/os-release
+
+kernelver=$1 && shift
+rootfs=$1 && shift
+variant=$1 && shift
+
+output="${rootfs}/lib/modules/${kernelver}/bls.conf"
+date=$(date -u +%Y%m%d%H%M%S)
+
+if [ "${variant:-5}" = "debug" ]; then
+ debugname=" with debugging"
+else
+ debugname=""
+fi
+
+cat >${output} <<EOF
+title ${NAME} (${kernelver}) ${VERSION}${debugname}
+linux ${bootprefix}/vmlinuz-${kernelver}
+initrd ${bootprefix}/initramfs-${kernelver}.img
+options \$kernelopts
+id ${ID}-${date}-${kernelver}
+grub_users \$grub_users
+grub_arg --unrestricted
+grub_class kernel${variant}
+EOF
diff --git a/kernel.spec b/kernel.spec
index 66659ae13..38f5756dd 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -464,6 +464,7 @@ Source40: generate_all_configs.sh
Source41: generate_debug_configs.sh
Source42: process_configs.sh
+Source43: generate_bls_conf.sh
# This file is intentionally left empty in the stock kernel. Its a nicety
# added for those wanting to do custom rebuilds with altered config opts.
@@ -1104,6 +1105,7 @@ cp %{SOURCE1000} .
cp %{SOURCE15} .
cp %{SOURCE40} .
cp %{SOURCE41} .
+cp %{SOURCE43} .
%if !%{debugbuildsenabled}
# The normal build is a really debug build and the user has explicitly requested
@@ -1518,6 +1520,9 @@ BuildKernel() {
# prune junk from kernel-devel
find $RPM_BUILD_ROOT/usr/src/kernels -name ".*.cmd" -exec rm -f {} \;
+
+ # build a BLS config for this kernel
+ ./generate_bls_conf.sh "$KernelVer" "$RPM_BUILD_ROOT" "%{?variant}"
}
###
@@ -1829,6 +1834,7 @@ fi
/lib/modules/%{KVERREL}%{?3:+%{3}}/build\
/lib/modules/%{KVERREL}%{?3:+%{3}}/source\
/lib/modules/%{KVERREL}%{?3:+%{3}}/updates\
+/lib/modules/%{KVERREL}%{?2:+%{2}}/bls.conf\
%if %{1}\
/lib/modules/%{KVERREL}%{?3:+%{3}}/vdso\
/etc/ld.so.conf.d/kernel-%{KVERREL}%{?3:+%{3}}.conf\