wok-undigest diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/linux-source/stuff/get-linux-source	Sat Dec 28 10:14:11 2013 +0100
     1.3 @@ -0,0 +1,72 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +
     1.7 +source /etc/slitaz/slitaz.conf
     1.8 +SOURCES_REPOSITORY=$SLITAZ_DIR/$SLITAZ_VERSION/src
     1.9 +VERSION=XXX
    1.10 +
    1.11 +url=$(cat /usr/src/kernel-patches/slitaz/url | sed "s/-${VERSION:0:3}.tar/-$VERSION.tar/")
    1.12 +for i in http://linux-kernel.uio.no/pub http://www.gtlib.gatech.edu/pub/kernel.org http://www.kernel.org/pub ; do
    1.13 +	busybox wget -s $url && break
    1.14 +	url=$(echo $url | sed "s|.*/linux/kernel|$i/linux/kernel|")
    1.15 +done
    1.16 +
    1.17 +mirror_src=http://mirror.slitaz.org/sources/packages-$(cat /etc/slitaz-release)
    1.18 +busybox wget -s $url || url=$mirror_src/l/$(basename $url)
    1.19 +
    1.20 +if [ ! -d $SOURCES_REPOSITORY ]; then
    1.21 +	mkdir -p $SOURCES_REPOSITORY
    1.22 +fi
    1.23 +
    1.24 +cd /usr/src/
    1.25 +if [ -f $SOURCE_REPOSITORY/$(basename ${url//bz2/lzma}) ]; then
    1.26 +	unlzma -c $SOURCES_REPOSITORY/$(basename ${url//bz2/lzma}) | tar xf - -C $PWD
    1.27 +elif [ -f $SOURCES_REPOSITORY/$(basename $url) ]; then
    1.28 +	tar xf $SOURCES_REPOSITORY/$(basename $url)
    1.29 +else
    1.30 +	wget -O $SOURCES_REPOSITORY/$(basename $url) -c $url
    1.31 +	tar xf $SOURCES_REPOSITORY/$(basename $url)
    1.32 +fi
    1.33 +
    1.34 +cp -a /usr/src/kernel-patches/slitaz /usr/src/linux-$VERSION
    1.35 +if [ -d /usr/src/linux-$VERSION/slitaz/aufs2 ]; then
    1.36 +	cp -pa /usr/src/linux-$VERSION/slitaz/aufs2/* /usr/src/linux-$VERSION
    1.37 +fi
    1.38 +
    1.39 +# Add tazpkg support
    1.40 +if [ -d "/usr/src/linux-$VERSION/scripts/package" ]; then
    1.41 +	cp -pa /usr/src/linux-$VERSION/slitaz/buildtaz /usr/src/linux-$VERSION/scripts/package
    1.42 +	cd /usr/src/linux-$VERSION
    1.43 +	patch -p1 -i slitaz/make-tazpkg.u
    1.44 +fi
    1.45 +
    1.46 +cd /usr/src/linux-$VERSION
    1.47 +while read patch_file; do
    1.48 +	echo "Apply $patch_file"
    1.49 +	patch -p1 < slitaz/$patch_file
    1.50 +done < slitaz/patches
    1.51 +[ ! -f System.map ] && cp slitaz/config .config &&
    1.52 +make oldconfig && make modules_prepare
    1.53 +ln -s /usr/src/linux-$VERSION /lib/modules/$VERSION-slitaz/build
    1.54 +ln -s linux-$VERSION /usr/src/linux
    1.55 +
    1.56 +	cat <<EOT
    1.57 +----
    1.58 +To modify the kernel configuration:
    1.59 +$ cd /usr/src/linux-$VERSION
    1.60 +$ make menuconfig
    1.61 +
    1.62 +To build the kernel and the modules:
    1.63 +$ cd /usr/src/linux-$VERSION
    1.64 +$ make bzImage && make modules
    1.65 +
    1.66 +To install the new kernel and the modules:
    1.67 +$ make modules_install
    1.68 +$ cp -a arch/x86/boot/bzImage /boot/vmlinuz-$VERSION-slitaz
    1.69 +
    1.70 +To make a Slitaz package with the new kernel and the modules:
    1.71 +$ make tazpkg
    1.72 +
    1.73 +See /usr/src/linux-$VERSION/README
    1.74 +----
    1.75 +EOT