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

xtel: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jun 15 16:06:40 2012 +0200 (2012-06-15)
parents abe27fd0192d
children 9e8d7fd12ee2
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@11396 9 for i in http://linux-kernel.uio.no/pub http://www.gtlib.gatech.edu/pub/kernel.org http://www.kernel.org/pub ; do
gokhlayeh@11396 10 busybox wget -s $url && break
gokhlayeh@11396 11 url=$(echo $url | sed "s|.*/linux/kernel|$i/linux/kernel|")
gokhlayeh@11396 12 done
gokhlayeh@9257 13
gokhlayeh@9257 14 if [ ! -d $SOURCES_REPOSITORY ]; then
gokhlayeh@9257 15 mkdir -p $SOURCES_REPOSITORY
gokhlayeh@9257 16 fi
gokhlayeh@9257 17
gokhlayeh@9257 18 cd /usr/src/
gokhlayeh@9257 19 if [ -f $SOURCE_REPOSITORY/$(basename ${url//bz2/lzma}) ]; then
gokhlayeh@9257 20 unlzma -c $SOURCES_REPOSITORY/$(basename ${url//bz2/lzma}) | tar xf - -C $PWD
gokhlayeh@9257 21 elif [ -f $SOURCES_REPOSITORY/$(basename $url) ]; then
gokhlayeh@9257 22 tar xjf $SOURCES_REPOSITORY/$(basename $url)
gokhlayeh@9257 23 else
gokhlayeh@9257 24 wget -O $SOURCES_REPOSITORY/$(basename $url) -c $url
gokhlayeh@9257 25 tar xjf $SOURCES_REPOSITORY/$(basename $url)
gokhlayeh@9257 26 fi
gokhlayeh@9257 27
gokhlayeh@9257 28 cp -a /usr/src/kernel-patches/slitaz /usr/src/linux-$VERSION
gokhlayeh@9257 29 if [ -d /usr/src/linux-$VERSION/slitaz/aufs2 ]; then
gokhlayeh@9257 30 cp -pa /usr/src/linux-$VERSION/slitaz/aufs2/* /usr/src/linux-$VERSION
gokhlayeh@9257 31 fi
gokhlayeh@9257 32
gokhlayeh@9257 33 # Add tazpkg support
gokhlayeh@9257 34 if [ -d "/usr/src/linux-$VERSION/scripts/package" ]; then
gokhlayeh@9257 35 cp -pa /usr/src/linux-$VERSION/slitaz/buildtaz /usr/src/linux-$VERSION/scripts/package
gokhlayeh@9257 36 cd /usr/src/linux-$VERSION
gokhlayeh@9257 37 patch -p1 -i slitaz/make-tazpkg.u
gokhlayeh@9257 38 fi
gokhlayeh@9257 39
gokhlayeh@9257 40 cd /usr/src/linux-$VERSION
gokhlayeh@9257 41 while read patch_file; do
gokhlayeh@9257 42 echo "Apply $patch_file"
gokhlayeh@9257 43 patch -p1 < slitaz/$patch_file
gokhlayeh@9257 44 done < slitaz/patches
gokhlayeh@9257 45 [ ! -f System.map ] && cp slitaz/config .config &&
gokhlayeh@9257 46 make oldconfig && make modules_prepare
gokhlayeh@11396 47 ln -s /usr/src/linux-$VERSION /lib/modules/$VERSION-slitaz/build
gokhlayeh@11396 48 ln -s linux-$VERSION /usr/src/linux
gokhlayeh@9257 49
gokhlayeh@9257 50 cat <<EOT
gokhlayeh@9257 51 ----
gokhlayeh@9257 52 To modify the kernel configuration:
gokhlayeh@9257 53 $ cd /usr/src/linux-$VERSION
gokhlayeh@9257 54 $ make menuconfig
gokhlayeh@9257 55
gokhlayeh@9257 56 To build the kernel and the modules:
gokhlayeh@9257 57 $ cd /usr/src/linux-$VERSION
gokhlayeh@9257 58 $ make bzImage && make modules
gokhlayeh@9257 59
gokhlayeh@9257 60 To install the new kernel and the modules:
gokhlayeh@9257 61 $ make modules_install
gokhlayeh@9257 62 $ cp -a arch/x86/boot/bzImage /boot/vmlinuz-$VERSION-slitaz
gokhlayeh@9257 63
gokhlayeh@9257 64 To make a Slitaz package with the new kernel and the modules:
gokhlayeh@9257 65 $ make tazpkg
gokhlayeh@9257 66
gokhlayeh@9257 67 See /usr/src/linux-$VERSION/README
gokhlayeh@9257 68 ----
gokhlayeh@9257 69 EOT