Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264482AbUFNVPv (ORCPT ); Mon, 14 Jun 2004 17:15:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264484AbUFNVPv (ORCPT ); Mon, 14 Jun 2004 17:15:51 -0400 Received: from pfepb.post.tele.dk ([195.41.46.236]:11141 "EHLO pfepb.post.tele.dk") by vger.kernel.org with ESMTP id S264482AbUFNVN0 (ORCPT ); Mon, 14 Jun 2004 17:13:26 -0400 Date: Mon, 14 Jun 2004 23:22:15 +0200 From: Sam Ravnborg To: Sam Ravnborg , Andrew Morton , linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: [PATCH 3/5] kbuild: add deb-pkg target Message-ID: <20040614212214.GB15555@mars.ravnborg.org> Mail-Followup-To: Sam Ravnborg , Andrew Morton , linux-kernel@vger.kernel.org, Linus Torvalds References: <20040614204029.GA15243@mars.ravnborg.org> <20040614204602.GD15243@mars.ravnborg.org> <20040614205827.GD619@wiggy.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040614205827.GD619@wiggy.net> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4373 Lines: 154 On Mon, Jun 14, 2004 at 10:58:27PM +0200, Wichert Akkerman wrote: > Previously Sam Ravnborg wrote: > > +# Deb target > > +# --------------------------------------------------------------------------- > > +# > > +.PHONY: rpm-pkg rpm > > +deb-pkg: > > Shouldn't that .PHONY reference deb-pkg instead? Obviously - thanks. Fixed patch below. Sam # 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 # Modified to support multiple architectures. # # Signed-off-by: Sam Ravnborg # # 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: deb-pkg +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 +# +# 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 < "$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 < debian/changelog +linux ($version) unstable; urgency=low + + * A standard release + + -- $name $(date -R) +EOF + +# Generate a control file +cat < 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 + - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/