wok-undigest annotate linux-source/stuff/get-linux-source @ rev 1087

Add: linux with Kultex kernel config
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sat Dec 28 10:14:11 2013 +0100 (2013-12-28)
parents
children
rev   line source
erjo@1087 1 #!/bin/sh
erjo@1087 2
erjo@1087 3
erjo@1087 4 source /etc/slitaz/slitaz.conf
erjo@1087 5 SOURCES_REPOSITORY=$SLITAZ_DIR/$SLITAZ_VERSION/src
erjo@1087 6 VERSION=XXX
erjo@1087 7
erjo@1087 8 url=$(cat /usr/src/kernel-patches/slitaz/url | sed "s/-${VERSION:0:3}.tar/-$VERSION.tar/")
erjo@1087 9 for i in http://linux-kernel.uio.no/pub http://www.gtlib.gatech.edu/pub/kernel.org http://www.kernel.org/pub ; do
erjo@1087 10 busybox wget -s $url && break
erjo@1087 11 url=$(echo $url | sed "s|.*/linux/kernel|$i/linux/kernel|")
erjo@1087 12 done
erjo@1087 13
erjo@1087 14 mirror_src=http://mirror.slitaz.org/sources/packages-$(cat /etc/slitaz-release)
erjo@1087 15 busybox wget -s $url || url=$mirror_src/l/$(basename $url)
erjo@1087 16
erjo@1087 17 if [ ! -d $SOURCES_REPOSITORY ]; then
erjo@1087 18 mkdir -p $SOURCES_REPOSITORY
erjo@1087 19 fi
erjo@1087 20
erjo@1087 21 cd /usr/src/
erjo@1087 22 if [ -f $SOURCE_REPOSITORY/$(basename ${url//bz2/lzma}) ]; then
erjo@1087 23 unlzma -c $SOURCES_REPOSITORY/$(basename ${url//bz2/lzma}) | tar xf - -C $PWD
erjo@1087 24 elif [ -f $SOURCES_REPOSITORY/$(basename $url) ]; then
erjo@1087 25 tar xf $SOURCES_REPOSITORY/$(basename $url)
erjo@1087 26 else
erjo@1087 27 wget -O $SOURCES_REPOSITORY/$(basename $url) -c $url
erjo@1087 28 tar xf $SOURCES_REPOSITORY/$(basename $url)
erjo@1087 29 fi
erjo@1087 30
erjo@1087 31 cp -a /usr/src/kernel-patches/slitaz /usr/src/linux-$VERSION
erjo@1087 32 if [ -d /usr/src/linux-$VERSION/slitaz/aufs2 ]; then
erjo@1087 33 cp -pa /usr/src/linux-$VERSION/slitaz/aufs2/* /usr/src/linux-$VERSION
erjo@1087 34 fi
erjo@1087 35
erjo@1087 36 # Add tazpkg support
erjo@1087 37 if [ -d "/usr/src/linux-$VERSION/scripts/package" ]; then
erjo@1087 38 cp -pa /usr/src/linux-$VERSION/slitaz/buildtaz /usr/src/linux-$VERSION/scripts/package
erjo@1087 39 cd /usr/src/linux-$VERSION
erjo@1087 40 patch -p1 -i slitaz/make-tazpkg.u
erjo@1087 41 fi
erjo@1087 42
erjo@1087 43 cd /usr/src/linux-$VERSION
erjo@1087 44 while read patch_file; do
erjo@1087 45 echo "Apply $patch_file"
erjo@1087 46 patch -p1 < slitaz/$patch_file
erjo@1087 47 done < slitaz/patches
erjo@1087 48 [ ! -f System.map ] && cp slitaz/config .config &&
erjo@1087 49 make oldconfig && make modules_prepare
erjo@1087 50 ln -s /usr/src/linux-$VERSION /lib/modules/$VERSION-slitaz/build
erjo@1087 51 ln -s linux-$VERSION /usr/src/linux
erjo@1087 52
erjo@1087 53 cat <<EOT
erjo@1087 54 ----
erjo@1087 55 To modify the kernel configuration:
erjo@1087 56 $ cd /usr/src/linux-$VERSION
erjo@1087 57 $ make menuconfig
erjo@1087 58
erjo@1087 59 To build the kernel and the modules:
erjo@1087 60 $ cd /usr/src/linux-$VERSION
erjo@1087 61 $ make bzImage && make modules
erjo@1087 62
erjo@1087 63 To install the new kernel and the modules:
erjo@1087 64 $ make modules_install
erjo@1087 65 $ cp -a arch/x86/boot/bzImage /boot/vmlinuz-$VERSION-slitaz
erjo@1087 66
erjo@1087 67 To make a Slitaz package with the new kernel and the modules:
erjo@1087 68 $ make tazpkg
erjo@1087 69
erjo@1087 70 See /usr/src/linux-$VERSION/README
erjo@1087 71 ----
erjo@1087 72 EOT