All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH 3/5] kbuild: add deb-pkg target
Date: Mon, 14 Jun 2004 22:46:02 +0200	[thread overview]
Message-ID: <20040614204602.GD15243@mars.ravnborg.org> (raw)
In-Reply-To: <20040614204029.GA15243@mars.ravnborg.org>

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/06/14 21:44:27+02:00 sam@mars.ravnborg.org 
#   kbuild: Added deb target
#   
#   Script originally from Wichert Akkerman <wichert@wiggy.net>
#   Modified to support multiple architectures.
#   
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# scripts/package/builddeb
#   2004/06/14 21:44:12+02:00 sam@mars.ravnborg.org +79 -0
# 
# scripts/package/builddeb
#   2004/06/14 21:44:12+02:00 sam@mars.ravnborg.org +0 -0
#   BitKeeper file /home/sam/bk/kbuild/scripts/package/builddeb
# 
# scripts/package/Makefile
#   2004/06/14 21:44:12+02:00 sam@mars.ravnborg.org +13 -1
#   Added deb-pkg target
# 
diff -Nru a/scripts/package/Makefile b/scripts/package/Makefile
--- a/scripts/package/Makefile	2004-06-14 22:25:41 +02:00
+++ b/scripts/package/Makefile	2004-06-14 22:25:41 +02:00
@@ -46,10 +46,22 @@
 	$(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz
 	rm ../$(KERNELPATH).tar.gz
 
-clean-rule +=  rm $(objtree)/kernel.spec
+clean-rule +=  rm -f $(objtree)/kernel.spec
+
+# Deb target
+# ---------------------------------------------------------------------------
+# 
+.PHONY: rpm-pkg rpm
+deb-pkg:
+	@$(MAKE)
+	@$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
+
+clean-rule += && rm -rf debian/
+
 
 # Help text displayed when executing 'make help'
 # ---------------------------------------------------------------------------
 help:
 	@echo  '  rpm-pkg         - Build the kernel as an RPM package'
+	@echo  '  deb-pkg         - Build the kernel as an deb package'
 
diff -Nru a/scripts/package/builddeb b/scripts/package/builddeb
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/scripts/package/builddeb	2004-06-14 22:25:41 +02:00
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# builddeb 1.2
+# Copyright 2003 Wichert Akkerman <wichert@wiggy.net>
+#
+# Simple script to generate a deb package for a Linux kernel. All the
+# complexity of what to do with a kernel after it is installer or removed
+# is left to other scripts and packages: they can install scripts in the
+# /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on 
+# package install and removal.
+
+set -e
+
+# Some variables and settings used throughout the script
+version="$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
+tmpdir="$(pwd)/debian/tmp"
+
+# Setup the directory structure
+rm -rf "$tmpdir"
+mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot"
+
+# Build and install the kernel
+cp System.map "$tmpdir/boot/System.map-$version"
+cp .config "$tmpdir/boot/config-$version"
+cp $KERNEL_IMAGE "$tmpdir/boot/vmlinuz-$version"
+
+if grep -q '^CONFIG_MODULES=y' .config ; then
+	INSTALL_MOD_PATH="$tmpdir" make modules_install
+fi
+
+# Install the maintainer scripts
+for script in postinst postrm preinst prerm ; do
+	mkdir -p "$tmpdir/etc/kernel/$script.d"
+	cat <<EOF > "$tmpdir/DEBIAN/$script"
+#!/bin/sh
+
+set -e
+
+test -d /etc/kernel/$script.d && run-parts --arg="$version" /etc/kernel/$script.d
+exit 0
+EOF
+	chmod 755 "$tmpdir/DEBIAN/$script"
+done
+
+name="Kernel Compiler <$(id -nu)@$(hostname -f)>"
+# Generate a simple changelog template
+cat <<EOF > debian/changelog
+linux ($version) unstable; urgency=low
+
+  * A standard release
+
+ -- $name  $(date -R)
+EOF
+
+# Generate a control file
+cat <<EOF > debian/control
+Source: linux
+Section: base
+Priority: optional
+Maintainer: $name
+Standards-Version: 3.6.1
+
+Package: linux-$version
+Architecture: any
+Description: Linux kernel, version $version
+ This package contains the Linux kernel, modules and corresponding other
+ files version $version.
+EOF
+
+# Fix some ownership and permissions
+chown -R root:root "$tmpdir"
+chmod -R go-w "$tmpdir"
+
+# Perform the final magic
+dpkg-gencontrol -isp
+dpkg --build "$tmpdir" ..
+
+exit 0
+

  parent reply	other threads:[~2004-06-14 20:37 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-14 20:40 [PATCH 0/5] kbuild Sam Ravnborg
2004-06-14 20:44 ` [PATCH 1/5] kbuild: default kernel image Sam Ravnborg
2004-06-14 21:05   ` Russell King
2004-06-15  4:40     ` Sam Ravnborg
2004-06-15  8:38       ` Russell King
2004-06-15  8:59         ` Christoph Hellwig
2004-06-15 21:07           ` Sam Ravnborg
2004-06-15 21:17             ` Russell King
2004-06-16 15:34             ` Tom Rini
2004-06-15 15:38         ` Tom Rini
2004-06-15 15:53           ` Russell King
2004-06-14 20:45 ` [PATCH 2/5] kbuild: move rpm to scripts/package Sam Ravnborg
2004-06-14 20:46 ` Sam Ravnborg [this message]
2004-06-14 20:58   ` [PATCH 3/5] kbuild: add deb-pkg target Wichert Akkerman
2004-06-14 21:22     ` Sam Ravnborg
2004-06-14 20:46 ` [PATCH 4/5] kbuild: make clean improved Sam Ravnborg
2004-06-14 20:50   ` Russell King
2004-06-14 21:19     ` Sam Ravnborg
2004-06-14 21:38       ` Tom Rini
2004-06-15  4:36         ` Sam Ravnborg
2004-06-15 18:50     ` V13
2004-06-14 20:48 ` [PATCH 5/5] kbuild: external module build doc Sam Ravnborg
2004-06-15 12:13   ` Horst von Brand
2004-06-15 20:09     ` Sam Ravnborg
2004-06-15 19:21   ` Jari Ruusu
2004-06-15 19:55     ` Sam Ravnborg
2004-06-15 23:00       ` Martin Schlemmer
2004-06-16 17:32       ` Jari Ruusu
2004-06-14 20:59 ` [PATCH 0/5] kbuild Sam Ravnborg
2004-06-14 23:56 ` Jeff Garzik
2004-06-15 15:41 ` Tom Rini
2004-06-15 17:49   ` Sam Ravnborg
2004-06-15 17:54     ` Tom Rini
2004-06-15 19:01       ` Sam Ravnborg
2004-06-15 19:27         ` Tom Rini
2004-06-15 21:02           ` Sam Ravnborg
2004-06-15 21:24             ` Tom Rini
2004-06-15 18:09     ` Russell King
2004-06-15 19:14       ` Sam Ravnborg
2004-06-15 19:46         ` Russell King
2004-06-15 20:12           ` Sam Ravnborg
2004-06-15 20:55           ` Sam Ravnborg
2004-06-15 20:59             ` Tom Rini
2004-06-15 21:24               ` Sam Ravnborg
2004-06-15 21:06             ` Russell King
2004-06-16 19:49               ` Sam Ravnborg
2004-06-16 20:08                 ` Tom Rini
2004-06-16 20:54                   ` Sam Ravnborg
2004-06-16 20:49                     ` Tom Rini
2004-06-17  6:56                     ` Jan-Benedict Glaw
2004-06-18 20:58                       ` Sam Ravnborg
     [not found] <sam@ravnborg.org>
2004-09-05 20:12 ` kbuild: Simplify vmlinux generation Sam Ravnborg
2004-09-05 20:19   ` Sam Ravnborg
2004-09-06 18:41   ` Horst von Brand
2004-09-06 19:00     ` Sam Ravnborg
2004-09-06 19:12     ` Sam Ravnborg
2014-06-11 19:25 ` [PATCH v2] x86,vdso: Fix vdso_install Andy Lutomirski
2014-06-11 19:45   ` Sam Ravnborg
2014-06-12 13:19   ` Josh Boyer
2014-06-12 15:28     ` [PATCH v3] " Andy Lutomirski
2014-06-12 15:28       ` Andy Lutomirski
2014-06-12 17:01       ` Josh Boyer
2014-06-13 17:24         ` H. Peter Anvin
2014-06-13 17:28           ` Andy Lutomirski
2014-06-13 18:19       ` [tip:x86/vdso] x86/vdso: " tip-bot for Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040614204602.GD15243@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.