lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 19 Oct 2007 18:00:26 -0700
From:	Florin Andrei <florin@...rei.myip.org>
To:	linux-kernel@...r.kernel.org
Subject: [PATCH] scripts: enhancements to the RPM spec file generator

From: Florin Andrei <florin@...rei.myip.org>

"make rpm" creates a plain package that does not update grub.conf
and does not create an initrd. This patch modifies scripts/package/mkspec
to create an RPM spec file that updates grub.conf after install/uninstall
and also that creates an initrd file after install. These new functions
are activated via an environment variable (export RPM_RH5_STYLE=true)
when running "make rpm".

Signed-off-by: Florin Andrei <florin@...rei.myip.org>
---

--- linux-2.6.23.1.orig/scripts/package/mkspec  2007-10-19 02:07:58.000000000 -0700
+++ linux-2.6.23.1/scripts/package/mkspec       2007-10-19 05:42:47.000000000 -0700
@@ -81,6 +81,11 @@ echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"
 echo "%endif"
 echo "%endif"
 
+if $RPM_RH5_STYLE; then
+echo 'touch $RPM_BUILD_ROOT'"/boot/initrd-$KERNELRELEASE.img"
+echo 'gzip -c9 < Module.symvers > $RPM_BUILD_ROOT'"/boot/symvers-$KERNELRELEASE.gz"
+fi
+
 echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
 
 echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"
@@ -88,9 +93,44 @@ echo ""
 echo "%clean"
 echo '#echo -rf $RPM_BUILD_ROOT'
 echo ""
+
+if $RPM_RH5_STYLE; then
+cat <<RH5_POST_PREUN
+%post
+if [ `uname -i` == "x86_64" -o `uname -i` == "i386" ]; then
+  if [ -f /etc/sysconfig/kernel ]; then
+    /bin/sed -i -e 's/^DEFAULTKERNEL=kernel-smp$/DEFAULTKERNEL=kernel/' /etc/sysconfig/kernel || exit $?
+  fi
+fi
+/sbin/new-kernel-pkg --package kernel --mkinitrd --depmod --install $KERNELRELEASE || exit $?
+if [ -x /sbin/weak-modules ]
+then
+    /sbin/weak-modules --add-kernel $KERNELRELEASE || exit $?
+fi
+
+%preun
+/sbin/new-kernel-pkg --rminitrd --rmmoddep --remove $KERNELRELEASE || exit $?
+if [ -x /sbin/weak-modules ]
+then
+    /sbin/weak-modules --remove-kernel $KERNELRELEASE || exit $?
+fi
+
+RH5_POST_PREUN
+fi
+
 echo "%files"
 echo '%defattr (-, root, root)'
 echo "%dir /lib/modules"
 echo "/lib/modules/$KERNELRELEASE"
+if $RPM_RH5_STYLE; then
+cat <<RH5_FILES
+/boot/vmlinuz-$KERNELRELEASE
+/boot/System.map-$KERNELRELEASE
+/boot/symvers-$KERNELRELEASE.gz
+/boot/config-$KERNELRELEASE
+%ghost /boot/initrd-$KERNELRELEASE.img
+RH5_FILES
+else
 echo "/boot/*"
+fi
 echo ""


-- 
Florin Andrei

http://florin.myip.org/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ