source: trunk/debirf/fs/usr/bin/build-debirf-kernel @ 778

Last change on this file since 778 was 778, checked in by jrollins, 5 years ago

debirf: see changelog (moved to GPLv3)

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/sh -e
2
3# build-debirf-kernel: script to build debianized linux kernel package with
4#                      the inittmpfs patch from Kent Robotti
5#
6# The debirf scripts were written by
7# Jameson Rollins <jrollins@fifthhorseman.net>
8# and
9# Daniel Kahn Gillmor <dkg-debian.org@fifthhorseman.net>.
10#
11# They are Copyright 2007, and are all released under the GPL,
12# version 3 or later.
13
14CMD=$(basename $0)
15
16BUILDDIR=${BUILDDIR:-~/src/linux}
17KVERS=$(uname -r | cut -f1 -d-)
18KAPPEND=$(uname -r | cut -f1 -d- --complement)
19PKGREV=${KVERS}-${1:-1}
20
21usage() {
22cat <<EOF
23usage: $CMD [N]
24N is package revision number (defaults to 1)
25
26Build a kernel for debirf.
27
28'man build-debirf-kernel' for more information.
29EOF
30}
31
32die() {
33    echo "$1" >&2
34    exit $2
35}
36
37# check for the proper packages:
38if (! dpkg -l "linux-source-$KVERS" kernel-package fakeroot linux-patch-inittmpfs >/dev/null ); then
39    die "Not continuing until you have the right packages installed." 1
40fi
41
42# create a build directory
43mkdir -p "$BUILDDIR"
44cd "$BUILDDIR"
45tar xjf "/usr/src/linux-source-$KVERS.tar.bz2"
46cd "linux-source-$KVERS"
47
48# copy in your current config file:
49cp "/boot/config-${KVERS}-${KAPPEND}" .config
50# pre-answer "y" to "Unpack the early userspace onto tmpfs":
51echo 'CONFIG_EARLYUSERSPACE_ON_TMPFS=y' >> .config
52make-kpkg --rootcmd fakeroot --initrd --append_to_version "-${KAPPEND}+inittmpfs" --revision "$PKGREV" --added_patches inittmpfs kernel_image
53
54# now you should have a .deb in
55# $BUILDDIR/linux-image-${KVERS}-${KAPPEND}_${PKGREV}_*.deb
Note: See TracBrowser for help on using the repository browser.