[packages/efi-boot-update] 'kernel' and 'kernel-old' modules added

jajcus jajcus at pld-linux.org
Thu Oct 24 21:38:40 CEST 2013


commit 7dca6d58e3ee4e5236dfd474e80c65eb40aa8f18
Author: Jacek Konieczny <jajcus at jajcus.net>
Date:   Thu Oct 24 21:31:24 2013 +0200

    'kernel' and 'kernel-old' modules added

 efi-boot-update.spec |  5 +++++
 kernel-old.conf      | 35 +++++++++++++++++++++++++++++++++++
 kernel.conf          | 31 +++++++++++++++++++++++++++++++
 3 files changed, 71 insertions(+)
---
diff --git a/efi-boot-update.spec b/efi-boot-update.spec
index 27cb610..297c7b0 100644
--- a/efi-boot-update.spec
+++ b/efi-boot-update.spec
@@ -10,6 +10,8 @@ Source0:	%{name}
 Source1:	update.conf
 Source2:	grub.conf
 Source3:	grub-installed.conf
+Source4:	kernel.conf
+Source5:	kernel-old.conf
 Source10:	README
 Source11:	TODO
 URL:		http://www.pld-linux.org/
@@ -44,6 +46,7 @@ install %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
 install %{name}.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/efi-boot
 install %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT/etc/efi-boot/update.d
+install %{SOURCE4} %{SOURCE5} $RPM_BUILD_ROOT/etc/efi-boot/update.d
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -64,6 +67,8 @@ rm -rf $RPM_BUILD_ROOT
 %dir /etc/efi-boot/update.d
 %config(noreplace) %verify(not md5 mtime size) /etc/efi-boot/update.d/grub.conf
 %config(noreplace) %verify(not md5 mtime size) /etc/efi-boot/update.d/grub-installed.conf
+%config(noreplace) %verify(not md5 mtime size) /etc/efi-boot/update.d/kernel.conf
+%config(noreplace) %verify(not md5 mtime size) /etc/efi-boot/update.d/kernel-old.conf
 %dir /lib/efi
 %dir /lib/efi/ia32
 %dir /lib/efi/x64
diff --git a/kernel-old.conf b/kernel-old.conf
new file mode 100644
index 0000000..8fb8dfc
--- /dev/null
+++ b/kernel-old.conf
@@ -0,0 +1,35 @@
+ENABLED=yes
+LABEL="old kernel"
+BINARY=vmlinuz_old.efi
+ARGS="root=/dev/sda2 ro add_efi_memmap"
+
+ARGS="initrd=@EFI_PLATFORM_PATH@\\initrd_old $ARGS"
+
+if is_yes "$ENABLED" ; then
+	if [ -e /boot/vmlinuz.old ] ; then
+		_kernel_filetype="$(file -k -L /boot/vmlinuz.old)"
+	else
+		_kernel_filetype="$(file -k -L /boot/vmlinuz)"
+	fi
+
+	if [ "${_kernel_filetype#*PE32 executable}" != "${_kernel_filetype}" ] ; then
+		# PE32 - 32 bit EFI stub
+		ARCH=ia32
+		verbose "Kernel with 32 bit EFI stub found at /boot/vmlinuz.old"
+	elif [ "${_kernel_filetype#*PE32+ executable}" != "${_kernel_filetype}" ] ; then
+		# PE32+ - 64 bit EFI stub
+		ARCH=x64
+		verbose "Kernel with 64 bit EFI stub found at /boot/vmlinuz.old"
+	else
+		msg "/boot/vmlinuz.old does not contain EFI stub"
+		ENABLED=no
+	fi
+fi
+
+install_files() {
+
+    update_file --missingok /boot/initrd.old initrd_old
+    update_file --missingok /boot/vmlinuz.old vmlinuz_old.efi
+}
+
+# vi: ft=sh
diff --git a/kernel.conf b/kernel.conf
new file mode 100644
index 0000000..3d60407
--- /dev/null
+++ b/kernel.conf
@@ -0,0 +1,31 @@
+ENABLED=yes
+LABEL="kernel"
+BINARY=vmlinuz.efi
+ARGS="root=/dev/sda2 ro add_efi_memmap"
+
+ARGS="initrd=@EFI_PLATFORM_PATH@\\initrd $ARGS"
+
+if is_yes "$ENABLED" ; then
+	_kernel_filetype="$(file -k -L /boot/vmlinuz)"
+
+	if [ "${_kernel_filetype#*PE32 executable}" != "${_kernel_filetype}" ] ; then
+		# PE32 - 32 bit EFI stub
+		ARCH=ia32
+		verbose "Kernel with 32 bit EFI stub found at /boot/vmlinuz"
+	elif [ "${_kernel_filetype#*PE32+ executable}" != "${_kernel_filetype}" ] ; then
+		# PE32+ - 64 bit EFI stub
+		ARCH=x64
+		verbose "Kernel with 64 bit EFI stub found at /boot/vmlinuz"
+	else
+		msg "/boot/vmlinuz does not contain EFI stub"
+		ENABLED=no
+	fi
+fi
+
+install_files() {
+
+    update_file /boot/initrd initrd
+    update_file /boot/vmlinuz vmlinuz.efi
+}
+
+# vi: ft=sh
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/efi-boot-update.git/commitdiff/34a0c5933dc61abd51c721da00d365322d02841e



More information about the pld-cvs-commit mailing list