'kernel' and 'kernel-old' modules added
authorJacek Konieczny <jajcus@jajcus.net>
Thu, 24 Oct 2013 19:31:24 +0000 (21:31 +0200)
committerJacek Konieczny <jajcus@jajcus.net>
Thu, 24 Oct 2013 19:31:24 +0000 (21:31 +0200)
efi-boot-update.spec
kernel-old.conf [new file with mode: 0644]
kernel.conf [new file with mode: 0644]

index 27cb610..297c7b0 100644 (file)
@@ -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 (file)
index 0000000..8fb8dfc
--- /dev/null
@@ -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 (file)
index 0000000..3d60407
--- /dev/null
@@ -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
This page took 0.194911 seconds and 4 git commands to generate.