aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package/builddeb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /scripts/package/builddeb
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'scripts/package/builddeb')
-rw-r--r--scripts/package/builddeb79
1 files changed, 79 insertions, 0 deletions
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
new file mode 100644
index 000000000000..c279b6310f02
--- /dev/null
+++ b/scripts/package/builddeb
@@ -0,0 +1,79 @@
1#!/bin/sh
2#
3# builddeb 1.2
4# Copyright 2003 Wichert Akkerman <wichert@wiggy.net>
5#
6# Simple script to generate a deb package for a Linux kernel. All the
7# complexity of what to do with a kernel after it is installer or removed
8# is left to other scripts and packages: they can install scripts in the
9# /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on
10# package install and removal.
11
12set -e
13
14# Some variables and settings used throughout the script
15version=$KERNELRELEASE
16tmpdir="$objtree/debian/tmp"
17
18# Setup the directory structure
19rm -rf "$tmpdir"
20mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot"
21
22# Build and install the kernel
23cp System.map "$tmpdir/boot/System.map-$version"
24cp .config "$tmpdir/boot/config-$version"
25cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
26
27if grep -q '^CONFIG_MODULES=y' .config ; then
28 INSTALL_MOD_PATH="$tmpdir" make modules_install
29fi
30
31# Install the maintainer scripts
32for script in postinst postrm preinst prerm ; do
33 mkdir -p "$tmpdir/etc/kernel/$script.d"
34 cat <<EOF > "$tmpdir/DEBIAN/$script"
35#!/bin/sh
36
37set -e
38
39test -d /etc/kernel/$script.d && run-parts --arg="$version" /etc/kernel/$script.d
40exit 0
41EOF
42 chmod 755 "$tmpdir/DEBIAN/$script"
43done
44
45name="Kernel Compiler <$(id -nu)@$(hostname -f)>"
46# Generate a simple changelog template
47cat <<EOF > debian/changelog
48linux ($version) unstable; urgency=low
49
50 * A standard release
51
52 -- $name $(date -R)
53EOF
54
55# Generate a control file
56cat <<EOF > debian/control
57Source: linux
58Section: base
59Priority: optional
60Maintainer: $name
61Standards-Version: 3.6.1
62
63Package: linux-$version
64Architecture: any
65Description: Linux kernel, version $version
66 This package contains the Linux kernel, modules and corresponding other
67 files version $version.
68EOF
69
70# Fix some ownership and permissions
71chown -R root:root "$tmpdir"
72chmod -R go-w "$tmpdir"
73
74# Perform the final magic
75dpkg-gencontrol -isp
76dpkg --build "$tmpdir" ..
77
78exit 0
79