linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* make rpm
@ 2001-07-29  0:20 Alan Cox
  2001-07-29  0:33 ` Horst von Brand
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Alan Cox @ 2001-07-29  0:20 UTC (permalink / raw)
  To: linux-kernel

I've been meaning to do this one for a while and I now have it working so
that with my current -ac kernel working tree I can type

	make rpm

and out puts kernel-2.4.7ac3-1.i386.rpm

All this took was the pieces below.

Anyone care to knock up a "make dpkg" to go with it ?

Alan

---

#
# RPM target
#
#	If you do a make spec before packing the tarball you can rpm -ta it
#
spec:
 	. scripts/mkspec >kernel.spec

#
# 	Build a tar ball , generate an rpm from it and pack the result
# 	There arw two bits of magic here
#  	1) The use of /. to avoid tar packing just the symlink
# 	2) Removing the .dep files as they have source paths in them that
# 		will become invalid
#
rpm:    clean newversion spec
        find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f
        cd $(TOPDIR)/.. ; \
        ln -s $(TOPDIR) $(KERNELPATH) ; \
        tar cvfz $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
        rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz


--

scripts/mkspec


#!/bin/sh
#
#	Output a simple RPM spec file that uses no fancy features requring
#	RPM v4. This is intended to work with any RPM distro.
#
#	The only gothic bit here is redefining install_post to avoid 
#	stripping the symbols from files in the kernel which we want
#
echo "Name: kernel"
echo "Summary: The Linux Kernel"
echo "Version: "$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION | sed -e "s/-//"
echo -n "Release: "
cat .version
echo "Copyright: GPL"
echo "Group: System Environment/Kernel"
echo "Vendor: The Linux Community"
echo "URL: http://www.kernel.org"
echo -n "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL"
echo "$EXTRAVERSION.tar.gz" | sed -e "s/-//"
echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root"
echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
echo ""
echo "%description"
echo "The Linux Kernel, the operating system core itself"
echo ""
echo "%prep"
echo "%setup -q"
echo ""
echo "%build"
echo "make oldconfig dep clean bzImage modules"
echo ""
echo "%install"
echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib
$RPM_BUILD_ROOT/lib/modules'
echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make modules_install'
echo 'cp arch/i386/boot/bzImage
$RPM_BUILD_ROOT'"/boot/vmlinuz-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
echo ""
echo "%clean"
echo '#echo -rf $RPM_BUILD_ROOT'
echo ""
echo "%files"
echo '%defattr (-, root, root)'
echo "%dir /lib/modules"
echo "/lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
echo ""

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29  0:20 make rpm Alan Cox
@ 2001-07-29  0:33 ` Horst von Brand
  2001-07-29  1:05 ` Ben Pfaff
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Horst von Brand @ 2001-07-29  0:33 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Alan Cox <alan@lxorguk.ukuu.org.uk> said:
> I've been meaning to do this one for a while and I now have it working so
> that with my current -ac kernel working tree I can type
> 
> 	make rpm
> 
> and out puts kernel-2.4.7ac3-1.i386.rpm

Great idea!

Just the bunch of "echo this or that" is ugly as sin... why not a
kernel.spec template that gets its version &c substituted by sed(1) or
something?
-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Vin~a del Mar, Chile                               +56 32 672616

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29  0:20 make rpm Alan Cox
  2001-07-29  0:33 ` Horst von Brand
@ 2001-07-29  1:05 ` Ben Pfaff
  2001-07-29  2:53   ` Mike Touloumtzis
  2001-07-29  8:22 ` Kai Henningsen
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Ben Pfaff @ 2001-07-29  1:05 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

> I've been meaning to do this one for a while and I now have it working so
> that with my current -ac kernel working tree I can type
> 
> 	make rpm
> 
> and out puts kernel-2.4.7ac3-1.i386.rpm
> 
> All this took was the pieces below.
> 
> Anyone care to knock up a "make dpkg" to go with it ?

Debian has had a package that does this for years now.  It's
called `kernel-package' and works through a program called
`make-kpkg' that does all sorts of nice things.  Using
kernel-package, you could implement `make dpkg' as a single
command: `make-kpkg kernel_image'.

Here's some more about kernel-package in the program's own words:

blp:~(0)$ make-kpkg --targets
 Known Targets are:
===============================================================================
|     Targets                      |   Automatically builds                   |
===============================================================================
| clean                            |                                          |
| buildpackage                     | Builds the whole package                 |
| binary                           | Builds kernel_{source,headers,image,doc} |
|       binary-indep               |                                          |
|            kernel_source         |                                          |
|            kernel_doc            |                                          |
|       binary-arch                |                                          |
|            kernel_headers        |                                          |
|            kernel_image          | Builds build                             |
|                           build  |                                          |
| modules                          |                                          |
| modules_image                    |                                          |
| modules_config                   |                                          |
| modules_clean                    |                                          |
| configure                        | If you wish to edit files                |
|                           debian | generated by make config                 |
| debian                           | Creates ./debian dir, and                |
|                                  | optionally patches the source            |
===============================================================================
See /usr/share/kernel-package/rules for details.
blp:~(0)$ make-kpkg --help
This program should be run in a linux kernel source top level directory.
/usr/share/doc/kernel-package/Problems.gz contains a list of known problems.

usage: make-kpkg [options] target [target ...]
  where options are:
 --help                This message.
 --revision number     The debian revision number. ([a-zA-Z.+0-9]) (Must
                         have digit, no hyphen allowed)
 --flavour  foo        an additional kernel sub-version. ([-a-z.+0-9])
                       OBSOLETE
 --append-to-version foo
 --append_to_version foo an additional kernel sub-version. ([-a-z.+0-9])
                         Does not require editing the kernel Makefile
                         over rides env var APPEND_TO_VERSION. 
                         requires a make-kpg clean
 --added-modules foo
 --added_modules foo   Comma/space separated list of add on modules
                       affected by the modules_<blah> targets
 --added-patches bar 
 --added_patches bar   Comma/space separated list of patches applicable
                        when patch_the_kernel is turned on
 --arch     foo        architecture
 --cross-compile
 --cross_compile       target string
 --subarch  bar        Set the subarch for the image being compiled
                        (have to be on a compatible machine).
 --arch-in-name
 --arch_in_name        Embed the subarch in the image package name
 --initrd              Create a image package suitable for initrd  
 --pgpsign  name       An ID used to sign the changes file using pgp.
 --targets             Lists the known targets.
 --zimage              Create a kernel using zImage rather than bzImage
 --bzimage             Create a kernel using bzImage (in case the site
                       wide default is zimage, as set in
                       /etc/kernel-pkg.conf) 
 --rootcmd method      A command that provides a means of gaining
              	       superuser access (for example, `sudo' or
              	       `fakeroot') as needed by dpkg-buildpackages'
              	       -r option.  This is only relevant for the
              	       buildpackage target.
 --us                  This option is passed to dpkg-buildpackage, and
                       directs that package not to sign the
                       source. This is only relevant for the
                       buildpackage target. 
 --uc                  This option is passed to dpkg-buildpackage, and
                       directs that package not to sign the
                       changelog. This is only relevant for the
                       buildpackage target. 

Use one of --zimage or --bzimage, or none, but not both.

Option Format: The options may be shortened to the smallest unique
string, and may be entered with either a - or a -- prefix, and you may
use a space between an option string and a value. Please refer to man
Getopt::Long for details on how the options may be entered.

Version: $Revision: 1.60 $ 
Manoj Srivastava <srivasta@debian.org>
blp:~(0)$ 



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29  1:05 ` Ben Pfaff
@ 2001-07-29  2:53   ` Mike Touloumtzis
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Touloumtzis @ 2001-07-29  2:53 UTC (permalink / raw)
  To: linux-kernel

On Sat, Jul 28, 2001 at 09:05:46PM -0400, Ben Pfaff wrote:
> 
> Debian has had a package that does this for years now.  It's
> called `kernel-package' and works through a program called
> `make-kpkg' that does all sorts of nice things.  Using
> kernel-package, you could implement `make dpkg' as a single
> command: `make-kpkg kernel_image'.

I suggest '$(FAKEROOT) make-kpkg kernel_image'

miket

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29  0:20 make rpm Alan Cox
  2001-07-29  0:33 ` Horst von Brand
  2001-07-29  1:05 ` Ben Pfaff
@ 2001-07-29  8:22 ` Kai Henningsen
  2001-07-29 11:58 ` Jean Charles Delepine
  2001-07-30 19:34 ` Andreas Dilger
  4 siblings, 0 replies; 12+ messages in thread
From: Kai Henningsen @ 2001-07-29  8:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: alan

pfaffben@msu.edu (Ben Pfaff)  wrote on 28.07.01 in <87g0bg7ded.fsf@pfaffben.user.msu.edu>:

> Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
>
> > I've been meaning to do this one for a while and I now have it working so
> > that with my current -ac kernel working tree I can type
> >
> > 	make rpm
> >
> > and out puts kernel-2.4.7ac3-1.i386.rpm
> >
> > All this took was the pieces below.
> >
> > Anyone care to knock up a "make dpkg" to go with it ?
>
> Debian has had a package that does this for years now.  It's
> called `kernel-package' and works through a program called
> `make-kpkg' that does all sorts of nice things.  Using
> kernel-package, you could implement `make dpkg' as a single
> command: `make-kpkg kernel_image'.

Well, kernel-package certainly could do with more publicity. There are  
still many Debian users who don't know about it.

MfG Kai

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29  0:20 make rpm Alan Cox
                   ` (2 preceding siblings ...)
  2001-07-29  8:22 ` Kai Henningsen
@ 2001-07-29 11:58 ` Jean Charles Delepine
  2001-07-29 12:19   ` Wichert Akkerman
  2001-07-30 19:34 ` Andreas Dilger
  4 siblings, 1 reply; 12+ messages in thread
From: Jean Charles Delepine @ 2001-07-29 11:58 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, debian-devel, Herbert Xu, Manoj Srivastava

Alan Cox <alan@lxorguk.ukuu.org.uk> écrivait (wrote) :

> I've been meaning to do this one for a while and I now have it working so
> that with my current -ac kernel working tree I can type
> 
> 	make rpm
> 
> and out puts kernel-2.4.7ac3-1.i386.rpm
> 
> All this took was the pieces below.
> 
> Anyone care to knock up a "make dpkg" to go with it ?

Maybe Herbert Xu, the actual developper of the Debian kernel package or 
Manoj Srivastava, for the Debian Linux kernel package build scripts can
do that.

debian-devel, Herbert and Manoj are Cc-ed.

For those cc-ed who don't read linux-kernel, the entire thread can be read on
http://groups.google.com/groups?hl=en&safe=off&th=228bf616886d8b69,5&seekm=linux.kernel.E15Qeav-0008P4-00%40the-village.bc.nu#p

              Jean Charles
-- 
Jean Charles Delépine - Équipe Réseaux Télécoms - Université de Picardie

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29 11:58 ` Jean Charles Delepine
@ 2001-07-29 12:19   ` Wichert Akkerman
  2001-07-29 14:49     ` Steve Kowalik
  0 siblings, 1 reply; 12+ messages in thread
From: Wichert Akkerman @ 2001-07-29 12:19 UTC (permalink / raw)
  To: Jean Charles Delepine
  Cc: Alan Cox, linux-kernel, debian-devel, Herbert Xu, Manoj Srivastava

Previously Jean Charles Delepine wrote:
> Maybe Herbert Xu, the actual developper of the Debian kernel package or 
> Manoj Srivastava, for the Debian Linux kernel package build scripts can
> do that.

We've had that option for years, just call "make-kpkg kernel_image".
It would be trivial to add a rule to the Makefile in the kernel tree
that calls that if you do "make deb".

Wichert.

-- 
  _________________________________________________________________
 /       Nothing is fool-proof to a sufficiently talented fool     \
| wichert@wiggy.net                   http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29 12:19   ` Wichert Akkerman
@ 2001-07-29 14:49     ` Steve Kowalik
  2001-07-29 15:26       ` Wichert Akkerman
  0 siblings, 1 reply; 12+ messages in thread
From: Steve Kowalik @ 2001-07-29 14:49 UTC (permalink / raw)
  To: Wichert Akkerman
  Cc: Jean Charles Delepine, Alan Cox, linux-kernel, Debian-Devel List,
	Herbert Xu, Manoj Srivastava

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

On Sun, Jul 29, 2001 at 02:19:59PM +0200, Wichert Akkerman uttered:
> Previously Jean Charles Delepine wrote:
> > Maybe Herbert Xu, the actual developper of the Debian kernel package or 
> > Manoj Srivastava, for the Debian Linux kernel package build scripts can
> > do that.
> 
> We've had that option for years, just call "make-kpkg kernel_image".
> It would be trivial to add a rule to the Makefile in the kernel tree
> that calls that if you do "make deb".
> 
make-kpkg --revision=${KERNELRELEASE} kernel_image",surely?

-- 
                                                    Steve
Synthetic Transforming Entity Viable for Exploration and Nocturnal Killing

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29 14:49     ` Steve Kowalik
@ 2001-07-29 15:26       ` Wichert Akkerman
  2001-07-29 21:23         ` Dominik Kubla
  0 siblings, 1 reply; 12+ messages in thread
From: Wichert Akkerman @ 2001-07-29 15:26 UTC (permalink / raw)
  To: Alan Cox, linux-kernel, Debian-Devel List
  Cc: Jean Charles Delepine, Herbert Xu, Manoj Srivastava

Previously Steve Kowalik wrote:
> make-kpkg --revision=${KERNELRELEASE} kernel_image",surely?

No, the package revision is completely seperate from the kernel
release version.

Wichert.



-- 
  _________________________________________________________________
 /       Nothing is fool-proof to a sufficiently talented fool     \
| wichert@wiggy.net                   http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29 15:26       ` Wichert Akkerman
@ 2001-07-29 21:23         ` Dominik Kubla
  0 siblings, 0 replies; 12+ messages in thread
From: Dominik Kubla @ 2001-07-29 21:23 UTC (permalink / raw)
  To: Alan Cox, linux-kernel, Debian-Devel List, Jean Charles Delepine,
	Herbert Xu, Manoj Srivastava

On Sun, Jul 29, 2001 at 05:26:30PM +0200, Wichert Akkerman wrote:
> Previously Steve Kowalik wrote:
> > make-kpkg --revision=${KERNELRELEASE} kernel_image",surely?
> 
> No, the package revision is completely seperate from the kernel
> release version.
> 
> Wichert.

Perhaps one should use:
	make-kpkg --revision=$(shell cat .version) kernel_image

Like the "Build" number used by a certain software from Redmond, WA.

Dominik
-- 
ScioByte GmbH, Zum Schiersteiner Grund 2, 55127 Mainz (Germany)
Phone: +49 6131 550 117  Fax: +49 6131 610 99 16

GnuPG: 717F16BB / A384 F5F1 F566 5716 5485  27EF 3B00 C007 717F 16BB

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
  2001-07-29  0:20 make rpm Alan Cox
                   ` (3 preceding siblings ...)
  2001-07-29 11:58 ` Jean Charles Delepine
@ 2001-07-30 19:34 ` Andreas Dilger
  4 siblings, 0 replies; 12+ messages in thread
From: Andreas Dilger @ 2001-07-30 19:34 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Alan writes:
> scripts/mkspec

Probably clearer to make it a "here" document (untested).  EXTRASHORT could
have been left inline (inside ``), but it is a bit clearer this way, I think.

#!/bin/sh
#
#	Output a simple RPM spec file that uses no fancy features requring
#	RPM v4. This is intended to work with any RPM distro.
#
#	The only gothic bit here is redefining install_post to avoid 
#	stripping the symbols from files in the kernel which we want
#
EXTRASHORT=`echo $EXTRAVERSION | sed -e "s/-//"`

cat - << EOT
Name: kernel
Summary: The Linux Kernel
Version: $VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRASHORT
Release: `cat .version`
Copyright: GPL
Group: System Environment/Kernel
Vendor: The Linux Community
URL: http://www.kernel.org
Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRASHORT.tar.gz
BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root
%define __spec_install_post /usr/lib/rpm/brp-compress || :

%description
The Linux Kernel, the operating system core itself

%prep
%setup -q

%build
make oldconfig dep clean bzImage modules

%install
mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules
INSTALL_MOD_PATH=$RPM_BUILD_ROOT make modules_install
cp arch/i386/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION

%clean
#echo -rf $RPM_BUILD_ROOT

%files
%defattr (-, root, root)
%dir /lib/modules
lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION

EOT

-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: make rpm
       [not found] <no.id>
@ 2001-07-29  0:38 ` Alan Cox
  0 siblings, 0 replies; 12+ messages in thread
From: Alan Cox @ 2001-07-29  0:38 UTC (permalink / raw)
  To: Horst von Brand; +Cc: Alan Cox, linux-kernel

> Alan Cox <alan@lxorguk.ukuu.org.uk> said:
> > I've been meaning to do this one for a while and I now have it working so
> > that with my current -ac kernel working tree I can type
> > 
> > 	make rpm
> > 
> > and out puts kernel-2.4.7ac3-1.i386.rpm
> 
> Great idea!
> 
> Just the bunch of "echo this or that" is ugly as sin... why not a
> kernel.spec template that gets its version &c substituted by sed(1) or
> something?

Well for one because its easier to hack on at the moment. I still need to
finish up packing the right pieces, and also checking if the user
has an /sbin/installkernel and also if they are not using GRUB need to then
rerun lilo

Alan


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2001-07-30 19:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-29  0:20 make rpm Alan Cox
2001-07-29  0:33 ` Horst von Brand
2001-07-29  1:05 ` Ben Pfaff
2001-07-29  2:53   ` Mike Touloumtzis
2001-07-29  8:22 ` Kai Henningsen
2001-07-29 11:58 ` Jean Charles Delepine
2001-07-29 12:19   ` Wichert Akkerman
2001-07-29 14:49     ` Steve Kowalik
2001-07-29 15:26       ` Wichert Akkerman
2001-07-29 21:23         ` Dominik Kubla
2001-07-30 19:34 ` Andreas Dilger
     [not found] <no.id>
2001-07-29  0:38 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).