summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@gentoo.org>2005-10-05 06:58:46 +0000
committerGunnar Wrobel <wrobel@gentoo.org>2005-10-05 06:58:46 +0000
commit9763c3677f58a8368b84c8af148292f0473765ba (patch)
treeb04b6de03e38f7ac5e70f9ef07a859d7d4a619ff /z-distfiles
parentFixed ssh_wrapper (diff)
downloadmisc-9763c3677f58a8368b84c8af148292f0473765ba.tar.gz
misc-9763c3677f58a8368b84c8af148292f0473765ba.tar.bz2
misc-9763c3677f58a8368b84c8af148292f0473765ba.zip
Added a script to make kernel recompiles more standardized
svn path=/local/; revision=440
Diffstat (limited to 'z-distfiles')
-rw-r--r--z-distfiles/scripts-gw/kernel-recompile50
1 files changed, 50 insertions, 0 deletions
diff --git a/z-distfiles/scripts-gw/kernel-recompile b/z-distfiles/scripts-gw/kernel-recompile
new file mode 100644
index 0000000..65632f9
--- /dev/null
+++ b/z-distfiles/scripts-gw/kernel-recompile
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+
+import os, sys, shutil
+
+src_d = '/usr/src/linux'
+
+config_d = '/home/wrobel/usr/devel/website/config/kernel/' + os.environ['HOSTNAME']
+os.makedirs(config_d)
+
+norm_kernel = '/boot/kernel'
+safe_kernel = '/boot/kernel-safe'
+
+norm_sysmap = '/boot/System.map'
+safe_sysmap = '/boot/System.map-safe'
+
+os.chdir(src_d)
+
+shutil.copyfile('.config', config_d + '/kernel-config')
+
+os.system('make && make modules_install')
+
+suffix = '-'.join(os.path.basename(os.path.realpath(src_d)).split('-')[1:])
+
+if os.path.exists(safe_kernel):
+ safe_kernel_d = os.path.realpath(safe_kernel)
+ os.unlink(safe_kernel_d)
+ os.unlink(safe_kernel)
+
+if os.path.exists(safe_sysmap):
+ safe_sysmap_d = os.path.realpath(safe_sysmap)
+ os.unlink(safe_sysmap_d)
+ os.unlink(safe_sysmap)
+
+
+norm_kernel_d = os.path.realpath(norm_kernel)
+norm_sysmap_d = os.path.realpath(norm_sysmap)
+
+os.symlink(safe_kernel, norm_kernel_d)
+os.symlink(safe_sysmap, norm_sysmap_d)
+
+new_kernel_d = 'kernel-' + suffix
+new_sysmap_d = 'System.map-' + suffix
+
+shutil.copyfile(src_d + '/arch/i386/boot/bzImage', new_kernel_d)
+shutil.copyfile(src_d + '/System.map', new_sysmap_d)
+
+os.symlink(norm_kernel, new_kernel_d)
+os.symlink(norm_sysmap, new_sysmap_d)
+
+print 'Do not forget to commit the kernel config changes to your repository with a useful comment!'