[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mini-Howto: Build linux-kbuild-3.5



[ Please CC me I am not subscribed to debian-kernel ML ]

[ QUOTE ]

On Saturday 18 August 2012 02:52 AM, Sedat Dilek wrote:
> Hi,
>
> today, I was discussing with Michael and at some point he was
> complaining about the missing linux-kbuild-3.5 package in the
> Debian software archives. He was not able to install
> linux-headers-3.5 Debian package as it depends on it.
>
> So, this is for you, Michael.
>
> Hope this helps others as well.

Thanks for writing this up. Maybe you would want to put this up on wiki.
http://wiki.debian.org/HowToRebuildAnOfficialDebianKernelPackage

[ /QUOTE ]

Please, check the history of contributions ("Info" button) :-).
Then you will see I have done a lot of in the section "The story of
linux-kbuild-2.6".

The appropriate wiki is always a good place to put such a step-by-step
build-instructions.
BUT I am describing a corner-case:
The move to linux-tools affects Debian-kernels >=3.2, so you have to
split within this wiki-section as there is for example Debian/lenny
with 2.6.32-kernel.
And... my base is a Linux vanilla source - I never liked that
DFSG-pruned tarball - it's additional work.
I respect the Debian philosophy - but I have the work - it's my time.
The GPL-v2 Linux vanilla kernel-source is easier from handling for me
(as I have it stored on my local hdd).

An idea could be to attach my Mini-Howto TXT-file (v2 attached)...

- Sedat (dileks on IRC) -
#####     Filename: Mini-Howto_Build_linux-kbuild-3-5.txt
#####       Author: Sedat Dilek <sedat.dilek@gmail.com>
#####      Created: 17-Aug-2012
##### Last Changed: 18-Aug-2012 (v2)

#####  NOTE-1: Source for linux-kbuild-3.5 Debian binaries is linux-tools!
#####  NOTE-2: linux-headers-3.5 package depends on linux-kbuild-3.5 (1st exists in the archives 2nd not)
#####          ( Known problem: "Same procedure as with every linux-trunk release, Mrs. Sophie?" )

##### WARNING: firebird-dev breaks perf compilation due to sh*t shipped within "/usr/include/perf.h" !
#####     XXX: Workaround: Deinstall firebird-dev package!

##### EXPORTS

export LANG=C
export LC_ALL=C

##### SOME USEFUL VARIABLES

### Package names
PKG_NAME="linux-tools"
PKG_NAME_LATEST="${PKG_NAME}-latest"

### Version strings
PKG_VER="3.5"
KERNEL_VERSION="$PKG_VER"
PKG_VER_LATEST="3.4-1~experimental.1"

### Tarballs
KERNEL_TARBALL="linux-${KERNEL_VERSION}.tar.xz"
DEBIAN_TARBALL="${PKG_NAME}_${PKG_VER}.orig.tar.gz"

### XXX: Workaround for new naming-scheme from upstream (tarball: 2 digits VS. Makefile: 3 digits)
KERNEL_VERSION_REPACKED="${PKG_VER}.0"
KERNEL_TARBALL_REPACKED="linux-${KERNEL_VERSION_REPACKED}.tar.gz"

### URLs
KERNEL_FTP_URL="http://ftp.kernel.org/pub/linux/kernel/v3.x";
DEBIAN_SVN_URL="svn://svn.debian.org/kernel/releases/${PKG_NAME}"

### Working and build directories
WORK_DIR="${HOME}/src/${PKG_NAME}"
BUILD_DIR="${WORK_DIR}/${PKG_NAME}-${PKG_VER}"

##### PREPARE DEBIAN PACKAGE

### Create and enter working directory
[ -d $WORK_DIR ] || mkdir -p $WORK_DIR
cd $WORK_DIR

### Download Linux vanilla source file
wget $KERNEL_FTP_URL/$KERNEL_TARBALL

### Checkout $PKG_NAME_LATEST from $DEBIAN_SVN_URL
svn co $DEBIAN_SVN_URL/$PKG_VER_LATEST $PKG_NAME_LATEST

### Enter the arena
cd $PKG_NAME_LATEST

### Remove unwanted SVN-repository related files and dirs
rm -v -rf $(find ./ -name .svn)

### Generate missing debian/control file to satisfy dch (included in devscripts package)
make -f debian/rules debian/control-real

### Bump package-name and debian-version
dch -i

### Re-create and check debian/control file for "linux-kbuild" (should contain $PKG_VER)
make -f debian/rules debian/control-real
grep linux-kbuild debian/control

### XXX: Workaround: Repack Linux vanilla tarball
cd $WORK_DIR
tar -xf $KERNEL_TARBALL
mv linux-${KERNEL_VERSION} linux-${KERNEL_VERSION_REPACKED}
tar -c --gzip -f $KERNEL_TARBALL_REPACKED linux-${KERNEL_VERSION_REPACKED}
rm -rf linux-${KERNEL_VERSION_REPACKED}

### Generate DFSG-pruned $DEBIAN_TARBALL
cd $PKG_NAME_LATEST
./debian/bin/genorig.py ../$KERNEL_TARBALL_REPACKED

### Unpack $DEBIAN_TARBALL
cd $WORK_DIR
tar -xf orig/$DEBIAN_TARBALL

# Copy debian-dir from SVN checkout
cp -av ${PKG_NAME_LATEST}/debian $BUILD_DIR

### Delete symlink to orig/$DEBIAN_TARBALL, move the real file and delete orig-dir
rm -v -f $DEBIAN_TARBALL
mv -v orig/$DEBIAN_TARBALL ./
rm -v -rf orig/

##### BUILD DEBIAN PACKAGE

### Enter build-dir
cd $BUILD_DIR

### Check build-dependencies (run 'apt-get build-dep linux-tools' to satisfy build-deps)
dpkg-checkbuilddeps

### Start the build (alternatively: run 'dpkg-buildpackage -us -uc')
debuild

##### CLEAN-UP

cd $WORK_DIR

### Remove kernel tarballs
rm -v -f $KERNEL_TARBALL
rm -v -f $KERNEL_TARBALL_REPACKED

### Remove directory from SVN checkout
rm -v -rf $PKG_NAME_LATEST

### Remove build-dir
rm -v -rf $BUILD_DIR

##### INSTALL DEBIAN PACKAGE

### Install linux-kbuild package manually
dpkg -i linux-kbuild-${PKG_VER}_*.deb


Reply to: