Notes and bookmarks I’ve gathered by doing the Eyduptula challenge

Must read

Grab yourself a copy of the mainline kernel repository

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Build steps

.config CONFIG_LOCALVERSION_AUTO=y

make localmodconfig
make silentoldconfig
make menuconfig
make -j4 all
make modules_install
make install

Make a patch

SRCTREE= linux
MYFILE= drivers/net/mydriver.c
cp $MYFILE $MYFILE.orig
vi $MYFILE # make your change
cd ..
diff -up $SRCTREE/$MYFILE{.orig,} > /tmp/patch

Multiple files

MYSRC= /dev/linux
tar xvzf linux-3.19.tar.gz
mv linux-3.19 linux-3.19-vanilla
diff -uprN linux-3.19-vanilla/Documentation/dontdiff \
  linux-3.19-vanilla $MYSRC > /tmp/patch

Check your patches with the patch style checker scripts/checkpatch.pl