wok annotate linux-libre-source/stuff/get-linux-source @ rev 9847

Up: libgphoto2 to 2.4.11.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun May 15 21:17:14 2011 +0000 (2011-05-15)
parents
children 903c03d31ebf
rev   line source
gokhlayeh@9257 1 #!/bin/sh
gokhlayeh@9257 2
gokhlayeh@9257 3
gokhlayeh@9257 4 source /etc/slitaz/slitaz.conf
gokhlayeh@9257 5 SOURCES_REPOSITORY=$SLITAZ_DIR/$SLITAZ_VERSION/src
gokhlayeh@9257 6 VERSION=XXX
gokhlayeh@9257 7
gokhlayeh@9257 8 url=$(cat /usr/src/kernel-patches/slitaz/url)
gokhlayeh@9257 9
gokhlayeh@9257 10 if [ ! -d $SOURCES_REPOSITORY ]; then
gokhlayeh@9257 11 mkdir -p $SOURCES_REPOSITORY
gokhlayeh@9257 12 fi
gokhlayeh@9257 13
gokhlayeh@9257 14 cd /usr/src/
gokhlayeh@9257 15 if [ -f $SOURCE_REPOSITORY/$(basename ${url//bz2/lzma}) ]; then
gokhlayeh@9257 16 unlzma -c $SOURCES_REPOSITORY/$(basename ${url//bz2/lzma}) | tar xf - -C $PWD
gokhlayeh@9257 17 elif [ -f $SOURCES_REPOSITORY/$(basename $url) ]; then
gokhlayeh@9257 18 tar xjf $SOURCES_REPOSITORY/$(basename $url)
gokhlayeh@9257 19 else
gokhlayeh@9257 20 wget -O $SOURCES_REPOSITORY/$(basename $url) -c $url
gokhlayeh@9257 21 tar xjf $SOURCES_REPOSITORY/$(basename $url)
gokhlayeh@9257 22 fi
gokhlayeh@9257 23
gokhlayeh@9257 24 cp -a /usr/src/kernel-patches/slitaz /usr/src/linux-$VERSION
gokhlayeh@9257 25 if [ -d /usr/src/linux-$VERSION/slitaz/aufs2 ]; then
gokhlayeh@9257 26 cp -pa /usr/src/linux-$VERSION/slitaz/aufs2/* /usr/src/linux-$VERSION
gokhlayeh@9257 27 fi
gokhlayeh@9257 28
gokhlayeh@9257 29 # Add tazpkg support
gokhlayeh@9257 30 if [ -d "/usr/src/linux-$VERSION/scripts/package" ]; then
gokhlayeh@9257 31 cp -pa /usr/src/linux-$VERSION/slitaz/buildtaz /usr/src/linux-$VERSION/scripts/package
gokhlayeh@9257 32 cd /usr/src/linux-$VERSION
gokhlayeh@9257 33 patch -p1 -i slitaz/make-tazpkg.u
gokhlayeh@9257 34 fi
gokhlayeh@9257 35
gokhlayeh@9257 36 cd /usr/src/linux-$VERSION
gokhlayeh@9257 37 while read patch_file; do
gokhlayeh@9257 38 echo "Apply $patch_file"
gokhlayeh@9257 39 patch -p1 < slitaz/$patch_file
gokhlayeh@9257 40 done < slitaz/patches
gokhlayeh@9257 41 [ ! -f System.map ] && cp slitaz/config .config &&
gokhlayeh@9257 42 make oldconfig && make modules_prepare
gokhlayeh@9257 43
gokhlayeh@9257 44 cat <<EOT
gokhlayeh@9257 45 ----
gokhlayeh@9257 46 To modify the kernel configuration:
gokhlayeh@9257 47 $ cd /usr/src/linux-$VERSION
gokhlayeh@9257 48 $ make menuconfig
gokhlayeh@9257 49
gokhlayeh@9257 50 To build the kernel and the modules:
gokhlayeh@9257 51 $ cd /usr/src/linux-$VERSION
gokhlayeh@9257 52 $ make bzImage && make modules
gokhlayeh@9257 53
gokhlayeh@9257 54 To install the new kernel and the modules:
gokhlayeh@9257 55 $ make modules_install
gokhlayeh@9257 56 $ cp -a arch/x86/boot/bzImage /boot/vmlinuz-$VERSION-slitaz
gokhlayeh@9257 57
gokhlayeh@9257 58 To make a Slitaz package with the new kernel and the modules:
gokhlayeh@9257 59 $ make tazpkg
gokhlayeh@9257 60
gokhlayeh@9257 61 See /usr/src/linux-$VERSION/README
gokhlayeh@9257 62 ----
gokhlayeh@9257 63 EOT