mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	kbuild: create linux-headers package in deb-pkg
Create a linux-headers-$KVER.deb package which can be used to build external modules without having the source tree around. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
		
							parent
							
								
									55f88eccf9
								
							
						
					
					
						commit
						cd8d60a20a
					
				
					 1 changed files with 27 additions and 1 deletions
				
			
		| 
						 | 
					@ -76,15 +76,17 @@ else
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
tmpdir="$objtree/debian/tmp"
 | 
					tmpdir="$objtree/debian/tmp"
 | 
				
			||||||
fwdir="$objtree/debian/fwtmp"
 | 
					fwdir="$objtree/debian/fwtmp"
 | 
				
			||||||
 | 
					hdrdir="$objtree/debian/hdrtmp"
 | 
				
			||||||
packagename=linux-image-$version
 | 
					packagename=linux-image-$version
 | 
				
			||||||
fwpackagename=linux-firmware-image
 | 
					fwpackagename=linux-firmware-image
 | 
				
			||||||
 | 
					hdrpackagename=linux-headers-$version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$ARCH" = "um" ] ; then
 | 
					if [ "$ARCH" = "um" ] ; then
 | 
				
			||||||
	packagename=user-mode-linux-$version
 | 
						packagename=user-mode-linux-$version
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Setup the directory structure
 | 
					# Setup the directory structure
 | 
				
			||||||
rm -rf "$tmpdir" "$fwdir"
 | 
					rm -rf "$tmpdir" "$fwdir" "$hdrdir"
 | 
				
			||||||
mkdir -m 755 -p "$tmpdir/DEBIAN"
 | 
					mkdir -m 755 -p "$tmpdir/DEBIAN"
 | 
				
			||||||
mkdir -p  "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename"
 | 
					mkdir -p  "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename"
 | 
				
			||||||
mkdir -m 755 -p "$fwdir/DEBIAN"
 | 
					mkdir -m 755 -p "$fwdir/DEBIAN"
 | 
				
			||||||
| 
						 | 
					@ -226,6 +228,30 @@ EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Build header package
 | 
				
			||||||
 | 
					find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$
 | 
				
			||||||
 | 
					find arch/x86/include include scripts -type f >> /tmp/files$$
 | 
				
			||||||
 | 
					(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$)
 | 
				
			||||||
 | 
					destdir=$hdrdir/usr/src/linux-headers-$version
 | 
				
			||||||
 | 
					mkdir -p "$destdir" "$hdrdir/DEBIAN" "$hdrdir/usr/share/doc/$hdrpackagename"
 | 
				
			||||||
 | 
					tar -c -f - -T /tmp/files$$ | (cd $destdir; tar -xf -)
 | 
				
			||||||
 | 
					(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
 | 
				
			||||||
 | 
					rm -f /tmp/files$$ /tmp/objfiles$$
 | 
				
			||||||
 | 
					arch=$(dpkg --print-architecture)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cat <<EOF >> debian/control
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Package: $hdrpackagename
 | 
				
			||||||
 | 
					Provides: linux-headers, linux-headers-2.6
 | 
				
			||||||
 | 
					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
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					create_package "$hdrpackagename" "$hdrdir"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Do we have firmware? Move it out of the way and build it into a package.
 | 
					# Do we have firmware? Move it out of the way and build it into a package.
 | 
				
			||||||
if [ -e "$tmpdir/lib/firmware" ]; then
 | 
					if [ -e "$tmpdir/lib/firmware" ]; then
 | 
				
			||||||
	mv "$tmpdir/lib/firmware" "$fwdir/lib/"
 | 
						mv "$tmpdir/lib/firmware" "$fwdir/lib/"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue