#!/bin/bash -e

# EXAMPLE
# $ cd ~/src32/linux-2.6.37.y
# $ meego-new-kernel-git.sh ~/kernel-adaptation-mrst-2.6.37-51.1.src.rpm
# 
# checks out git branch kernel-adaptation-mrst-2.6.37-51.1
# creates sub-directory kernel-adaptation-mrst-2.6.37-51.1
#       unloads and refreshes git series there
# imports quilt series into git
# generate .config from the release

# you are ready build in your git tree!

if [ $# != 1 ]; then
        echo usage: $0 kernelname.src.rpm
        exit 1;
fi

RPM=$1
KERNEL_NAME=`basename $RPM .src.rpm`
echo $KERNEL_NAME is kernel name '^C if not okay? '
read x

git checkout -b $KERNEL_NAME v2.6.37.6

# meego-new-kernel-tree kernel-adaptation-mrst-2.6.37-51.1.src.rpm

mkdir $KERNEL_NAME
rpm2cpio $RPM | (cd $KERNEL_NAME ; cpio -i)

# refresh the quilt series so git will digest it

QUILT_PATCHES=$KERNEL_NAME
export QUILT_PATCHES

while quilt push; do quilt refresh; done
while quilt pop; do /bin/true; done

git reset --hard
git quiltimport --author "MeeGo-Quilt-Tree <[email protected]>" --patches 
$QUILT_PATCHES

# generate .config
(cd $QUILT_PATCHES; make -f Makefile.config)
cp $QUILT_PATCHES/kernel-adaptation-mrst.config .config
yes "" | make oldconfig

# remove the space hogs that we can easily get back
rm $QUILT_PATCHES/linux-2.6.37.tar.bz2
rm $QUILT_PATCHES/patch-2.6.37.6.bz2

exit 0

# if you want to undo all this:
git checkout master
git branch -D $KERNEL_NAME
rm -rf $QUILT_PATCHES
_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to