Skip to contentSkip to conversation

scripts/package/builddeb: upgrade to current practices

PATCH In review Martin-Éric Racine 5 participants 11 messages Jul 17, 2012 – Aug 14, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/package/builddeb: upgrade to current practices

This patch sanitizes and updates the Debian package building script:

1) Updates $fwpackagename to 'firmware-linux' as used by Debian,
2) Removes trailing whitespace,
3) Updates Linus' copyright in the generated packaging files,
4) Updates URL of Linus' GIT tree in the generated packaging files,
5) Removes obsolete references to linux-2.6,
6) Adds installation of missing subarch components to header package,
7) Adds dependency relationships to the firmware package.

---
 scripts/package/builddeb |   25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
scripts/package/builddeb +14 -11
index c95fdda..44ef3d1 100644
@@ -79,9 +79,9 @@ fwdir="$objtree/debian/fwtmp"
 kernel_headers_dir="$objtree/debian/hdrtmp"
 libc_headers_dir="$objtree/debian/headertmp"
 packagename=linux-image-$version
-fwpackagename=linux-firmware-image
 kernel_headers_packagename=linux-headers-$version
 libc_headers_packagename=linux-libc-dev
+fwpackagename=firmware-linux
 
 if [ "$ARCH" = "um" ] ; then
 	packagename=user-mode-linux-$version
@@ -109,7 +109,7 @@ if [ "$ARCH" = "um" ] ; then
 	cp .config "$tmpdir/usr/share/doc/$packagename/config"
 	gzip "$tmpdir/usr/share/doc/$packagename/config"
 	cp $KBUILD_IMAGE "$tmpdir/usr/bin/linux-$version"
-else 
+else
 	cp System.map "$tmpdir/boot/System.map-$version"
 	cp .config "$tmpdir/boot/config-$version"
 	# Not all arches include the boot path in KBUILD_IMAGE
@@ -188,17 +188,17 @@ This is a packacked upstream version of the Linux kernel.
 The sources may be found at most Linux ftp sites, including:
 ftp://ftp.kernel.org/pub/linux/kernel
 
-Copyright: 1991 - 2009 Linus Torvalds and others.
+Copyright: 1991-2012 Linus Torvalds and others.
 
-The git repository for mainline kernel development is at:
-git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+The GIT repository for mainline kernel development is at:
+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; version 2 dated June, 1991.
 
 On Debian GNU/Linux systems, the complete text of the GNU General Public
-License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
+License version 2 can be found in /usr/share/common-licenses/GPL-2.
 EOF
 
 # Generate a control file
@@ -215,7 +215,7 @@ if [ "$ARCH" = "um" ]; then
 	cat <<EOF >> debian/control
 
 Package: $packagename
-Provides: linux-image, linux-image-2.6, linux-modules-$version
+Provides: linux-image, linux-modules-$version
 Architecture: any
 Description: User Mode Linux kernel, version $version
  User-mode Linux is a port of the Linux kernel to its own system call
@@ -232,7 +232,7 @@ else
 	cat <<EOF >> debian/control
 
 Package: $packagename
-Provides: linux-image, linux-image-2.6, linux-modules-$version
+Provides: linux-image, linux-modules-$version
 Suggests: $fwpackagename
 Architecture: any
 Description: Linux kernel, version $version
@@ -243,7 +243,7 @@ EOF
 fi
 
 # Build header package
-(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
+(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
 (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")
 (cd $objtree; find arch/$SRCARCH/include .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
@@ -257,12 +257,12 @@ arch=$(dpkg --print-architecture)
 cat <<EOF >> debian/control
 
 Package: $kernel_headers_packagename
-Provides: linux-headers, linux-headers-2.6
+Provides: linux-headers
 Architecture: $arch
 Description: Linux kernel headers for $KERNELRELEASE on $arch
  This package provides kernel header files for $KERNELRELEASE on $arch
  .
- This is useful for people who need to build external modules
+ This is useful for people who need to build external modules.
 EOF
 
 # Do we have firmware? Move it out of the way and build it into a package.
@@ -273,6 +273,9 @@ if [ -e "$tmpdir/lib/firmware" ]; then
 
 Package: $fwpackagename
 Architecture: all
+Conflicts: firmware-linux-free, firmware-linux-nonfree
+Provides: firmware-linux-free, firmware-linux-nonfree
+Replaces: firmware-linux-free, firmware-linux-nonfree
 Description: Linux kernel firmware, version $version
  This package contains firmware from the Linux kernel, version $version.
 EOF
Signature · 1 line
1.7.10.4
#1 lore raw

Hi,

Quoted 1 line · Martin-Éric Racine

Thanks. This patch does many things at once instead of the usual practice of "one patch per logical change", but oh well.

[...]

scripts/package/builddeb fwdir="$objtree/debian/fwtmp" · line 84

Quoted 10 lines
scripts/package/builddeb +1 -1
@@ -79,9 +79,9 @@ fwdir="$objtree/debian/fwtmp"
 kernel_headers_dir="$objtree/debian/hdrtmp"
 libc_headers_dir="$objtree/debian/headertmp"
 packagename=linux-image-$version
-fwpackagename=linux-firmware-image
 kernel_headers_packagename=linux-headers-$version
 libc_headers_packagename=linux-libc-dev
+fwpackagename=firmware-linux

Micronit: any reason the lines are reordered here?

scripts/package/builddeb This is a packacked upstream version of the Linux kernel. · line 194

Quoted 11 lines
scripts/package/builddeb +3 -3
@@ -188,17 +188,17 @@ This is a packacked upstream version of the Linux kernel.
 The sources may be found at most Linux ftp sites, including:
 ftp://ftp.kernel.org/pub/linux/kernel
 
-Copyright: 1991 - 2009 Linus Torvalds and others.
+Copyright: 1991-2012 Linus Torvalds and others.
 
-The git repository for mainline kernel development is at:
-git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+The GIT repository for mainline kernel development is at:
+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

I personally like to spell it as "Git". ;-)

[...]

scripts/package/builddeb if [ -e "$tmpdir/lib/firmware" ]; then · line 278

Quoted 7 lines
scripts/package/builddeb +3 -0
@@ -273,6 +273,9 @@ if [ -e "$tmpdir/lib/firmware" ]; then
 
 Package: $fwpackagename
 Architecture: all
+Conflicts: firmware-linux-free, firmware-linux-nonfree
+Provides: firmware-linux-free, firmware-linux-nonfree
+Replaces: firmware-linux-free, firmware-linux-nonfree

I assume you mean Breaks+Replaces. Do the files actually overlap, or is this change being overly cautious? I would expect the files not to overlap because the package build with deb-pkg puts firmware in a versioned subdirectory "/lib/firmware/<version>".

Hope that helps,
Jonathan

#2 lore raw

2012/7/17 Jonathan Nieder <[email protected]>:

Quoted 10 lines

Hi,

Quoted 1 line · Martin-Éric Racine

Thanks. This patch does many things at once instead of the usual practice of "one patch per logical change", but oh well.

[...]

Quoted 12 lines

scripts/package/builddeb fwdir="$objtree/debian/fwtmp" · line 84

Quoted 10 lines
scripts/package/builddeb +1 -1
@@ -79,9 +79,9 @@ fwdir="$objtree/debian/fwtmp"
 kernel_headers_dir="$objtree/debian/hdrtmp"
 libc_headers_dir="$objtree/debian/headertmp"
 packagename=linux-image-$version
-fwpackagename=linux-firmware-image
 kernel_headers_packagename=linux-headers-$version
 libc_headers_packagename=linux-libc-dev
+fwpackagename=firmware-linux

Micronit: any reason the lines are reordered here?

Mostly to differenciate between versioned and non-versioned package targets.

Quoted 7 lines
Quoted 7 lines
scripts/package/builddeb +1 -1
@@ -188,17 +188,17 @@ This is a packacked upstream version of the Linux kernel.
 The sources may be found at most Linux ftp sites, including:
 ftp://ftp.kernel.org/pub/linux/kernel
 
-Copyright: 1991 - 2009 Linus Torvalds and others.
+Copyright: 1991-2012 Linus Torvalds and others.
 
Quoted 6 lines

scripts/package/builddeb This is a packacked upstream version of the Linux kernel. · line 194

Quoted 4 lines
scripts/package/builddeb +2 -2
-The git repository for mainline kernel development is at:
-git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+The GIT repository for mainline kernel development is at:
+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

I personally like to spell it as "Git". ;-)

That works for me too. Actually, what's the official spelling for it?

Quoted 13 lines

[...]

scripts/package/builddeb if [ -e "$tmpdir/lib/firmware" ]; then · line 278

Quoted 7 lines
scripts/package/builddeb +3 -0
@@ -273,6 +273,9 @@ if [ -e "$tmpdir/lib/firmware" ]; then
 
 Package: $fwpackagename
 Architecture: all
+Conflicts: firmware-linux-free, firmware-linux-nonfree
+Provides: firmware-linux-free, firmware-linux-nonfree
+Replaces: firmware-linux-free, firmware-linux-nonfree

I assume you mean Breaks+Replaces. Do the files actually overlap, or is this change being overly cautious? I would expect the files not to overlap because the package build with deb-pkg puts firmware in a versioned subdirectory "/lib/firmware/<version>".

AFAIK they would overlap, hence the Conflicts.

Martin-Éric

#3 lore raw
Quoted 13 lines · Martin-Éric Racine

2012/7/17 Jonathan Nieder <[email protected]>:

Quoted 11 lines

scripts/package/builddeb if [ -e "$tmpdir/lib/firmware" ]; then · line 278

Quoted 6 lines

Package: $fwpackagename
Architecture: all

scripts/package/builddeb +3 -0
+Conflicts: firmware-linux-free, firmware-linux-nonfree
+Provides: firmware-linux-free, firmware-linux-nonfree
+Replaces: firmware-linux-free, firmware-linux-nonfree

I assume you mean Breaks+Replaces. Do the files actually overlap, or is this change being overly cautious? I would expect the files not to overlap because the package build with deb-pkg puts firmware in a versioned subdirectory "/lib/firmware/<version>".

Quoted 1 line

AFAIK they would overlap, hence the Conflicts.

This is wrong and properly fixed in -next.

Signature · 1 line
maks
#4 lore raw

2012/7/18 maximilian attems <[email protected]>:

Quoted 14 lines · Martin-Éric Racine
Quoted 13 lines

2012/7/17 Jonathan Nieder <[email protected]>:

Quoted 11 lines

scripts/package/builddeb if [ -e "$tmpdir/lib/firmware" ]; then · line 278

Quoted 6 lines

Package: $fwpackagename
Architecture: all

scripts/package/builddeb +3 -0
+Conflicts: firmware-linux-free, firmware-linux-nonfree
+Provides: firmware-linux-free, firmware-linux-nonfree
+Replaces: firmware-linux-free, firmware-linux-nonfree

I assume you mean Breaks+Replaces. Do the files actually overlap, or is this change being overly cautious? I would expect the files not to overlap because the package build with deb-pkg puts firmware in a versioned subdirectory "/lib/firmware/<version>".

Quoted 3 lines
Quoted 1 line

AFAIK they would overlap, hence the Conflicts.

This is wrong and properly fixed in -next.

Max,

Exactly what is wrong with this fix? Could you tell us exactly what you did differently and why?

Martin-Éric

#5 lore raw
Quoted 2 lines · Martin-Éric Racine

Could you tell us exactly what
you did differently and why?

At least the "what" should be answerable by looking at what is in linux-next.

#6 lore raw
In reply to Martin-Éric Racine
Quoted 15 lines · Martin-Éric Racine

2012/7/18 maximilian attems <[email protected]>:

Quoted 14 lines · Martin-Éric Racine
Quoted 13 lines

2012/7/17 Jonathan Nieder <[email protected]>:

Quoted 11 lines

scripts/package/builddeb if [ -e "$tmpdir/lib/firmware" ]; then · line 278

Quoted 6 lines

Package: $fwpackagename
Architecture: all

scripts/package/builddeb +3 -0
+Conflicts: firmware-linux-free, firmware-linux-nonfree
+Provides: firmware-linux-free, firmware-linux-nonfree
+Replaces: firmware-linux-free, firmware-linux-nonfree

I assume you mean Breaks+Replaces. Do the files actually overlap, or is this change being overly cautious? I would expect the files not to overlap because the package build with deb-pkg puts firmware in a versioned subdirectory "/lib/firmware/<version>".

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

AFAIK they would overlap, hence the Conflicts.

This is wrong and properly fixed in -next.

Exactly what is wrong with this fix? Could you tell us exactly what you did differently and why?

Jonathan already answered it, saying that firmwares are put in versioned dir.

Just use git to look it up, easy:
~/src/linux-next (master %=)$ git log scripts/package/builddeb

6607ddadf93d19c7f64139f1475c342152f39fe5

Your conflict would mean to kick out the official debian firmware packages which is not something we want!

Signature · 1 line
maks
#7 lore raw

2012/7/18 maximilian attems <[email protected]>:

Quoted 18 lines · Martin-Éric Racine
Quoted 17 lines

2012/7/18 maximilian attems <[email protected]>:

Quoted 16 lines · Martin-Éric Racine
Quoted 14 lines

2012/7/17 Jonathan Nieder <[email protected]>:

Quoted 11 lines

scripts/package/builddeb if [ -e "$tmpdir/lib/firmware" ]; then · line 278

Quoted 6 lines

Package: $fwpackagename
Architecture: all

scripts/package/builddeb +3 -0
+Conflicts: firmware-linux-free, firmware-linux-nonfree
+Provides: firmware-linux-free, firmware-linux-nonfree
+Replaces: firmware-linux-free, firmware-linux-nonfree

I assume you mean Breaks+Replaces. Do the files actually overlap, or is this change being overly cautious? I would expect the files not to overlap because the package build with deb-pkg puts firmware in a versioned subdirectory "/lib/firmware/<version>".

AFAIK they would overlap, hence the Conflicts.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

This is wrong and properly fixed in -next.

Exactly what is wrong with this fix? Could you tell us exactly what you did differently and why?

Jonathan already answered it, saying that firmwares are put in versioned dir.

Does the kernel look for modules in versioned, then non-versioned directories, in that order? More importantly, does it even attempt looking in the versioned directory at all?

Martin-Éric

#8 lore raw
Quoted 3 lines · Martin-Éric Racine

Does the kernel look for modules in versioned, then non-versioned directories, in that order? More importantly, does it even attempt looking in the versioned directory at all?

/lib/udev/firmware.agent does this:

FIRMWARE_DIRS="/lib/firmware/$(uname -r) /lib/firmware /usr/local/lib/firmware /usr/lib/hotplug/firmware"

for DIR in $FIRMWARE_DIRS; do

    [ -e "$DIR/$FIRMWARE" ] || continue

Bjørn

#9 lore raw
In reply to maximilian attems
Quoted 7 lines · maximilian attems

Jonathan already answered it, saying that firmwares are put in versioned dir.

Just use git to look it up, easy:
~/src/linux-next (master %=)$ git log scripts/package/builddeb

6607ddadf93d19c7f64139f1475c342152f39fe5

But..but.. won't that prevent installing firmware for more than one builddeb kernel? I.e., shouldn't the fw package name also be versioned if you are going to do this (which it seems you are)?

But then again, I thought versioned firmware was dropped from the official packages for good reasons. Any reason why you couldn't add /lib/firmware/something (where "something" is fixed and independent of version) to the firmware.agent search path, and use that for unofficial linux-firmware packages?

That would allow unofficial firmware packages from different kernel versions to continue sharing their package name without conflicting with the official packages in any way.

Bjørn

#10 lore raw
In reply to Martin-Éric Racine
Quoted 7 lines · Martin-Éric Racine
Quoted 7 lines
Quoted 7 lines
scripts/package/builddeb +1 -1
@@ -188,17 +188,17 @@ This is a packacked upstream version of the Linux kernel.
 The sources may be found at most Linux ftp sites, including:
 ftp://ftp.kernel.org/pub/linux/kernel
 
-Copyright: 1991 - 2009 Linus Torvalds and others.
+Copyright: 1991-2012 Linus Torvalds and others.
 
Quoted 8 lines
Quoted 6 lines

scripts/package/builddeb This is a packacked upstream version of the Linux kernel. · line 194

Quoted 4 lines
scripts/package/builddeb +2 -2
-The git repository for mainline kernel development is at:
-git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+The GIT repository for mainline kernel development is at:
+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

I personally like to spell it as "Git". ;-)

That works for me too. Actually, what's the official spelling for it?

The acronymic usage of "GIT" to mean Global Information Tracker has not caught on. Therefore most likely "Git"; like "Linux", a noun, a name.