wok-6.x view linux-source/stuff/get-linux-source @ rev 11281
linux-source: try some mirrors
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Nov 10 15:34:23 2011 +0100 (2011-11-10) |
parents | 14a02389406d |
children | 181077a51c57 |
line source
1 #!/bin/sh
4 source /etc/slitaz/slitaz.conf
5 SOURCES_REPOSITORY=$SLITAZ_DIR/$SLITAZ_VERSION/src
6 VERSION=XXX
8 url=$(cat /usr/src/kernel-patches/slitaz/url)
9 for i in http://linux-kernel.uio.no/pub http://www.gtlib.gatech.edu/pub/kernel.org http://www.kernel.org/pub ; do
10 busybox wget -s $url && break
11 url=$(echo $url | sed "s|.*/linux/kernel|$i/linux/kernel|")
12 done
14 if [ ! -d $SOURCES_REPOSITORY ]; then
15 mkdir -p $SOURCES_REPOSITORY
16 fi
18 cd /usr/src/
19 if [ -f $SOURCE_REPOSITORY/$(basename ${url//bz2/lzma}) ]; then
20 unlzma -c $SOURCES_REPOSITORY/$(basename ${url//bz2/lzma}) | tar xf - -C $PWD
21 elif [ -f $SOURCES_REPOSITORY/$(basename $url) ]; then
22 tar xjf $SOURCES_REPOSITORY/$(basename $url)
23 else
24 wget -O $SOURCES_REPOSITORY/$(basename $url) -c $url
25 tar xjf $SOURCES_REPOSITORY/$(basename $url)
26 fi
28 cp -a /usr/src/kernel-patches/slitaz /usr/src/linux-$VERSION
29 if [ -d /usr/src/linux-$VERSION/slitaz/aufs2 ]; then
30 cp -pa /usr/src/linux-$VERSION/slitaz/aufs2/* /usr/src/linux-$VERSION
31 fi
33 # Add tazpkg support
34 if [ -d "/usr/src/linux-$VERSION/scripts/package" ]; then
35 cp -pa /usr/src/linux-$VERSION/slitaz/buildtaz /usr/src/linux-$VERSION/scripts/package
36 cd /usr/src/linux-$VERSION
37 patch -p1 -i slitaz/make-tazpkg.u
38 fi
40 cd /usr/src/linux-$VERSION
41 while read patch_file; do
42 echo "Apply $patch_file"
43 patch -p1 < slitaz/$patch_file
44 done < slitaz/patches
45 [ ! -f System.map ] && cp slitaz/config .config &&
46 make oldconfig && make modules_prepare
47 ln -s /usr/src/linux-$VERSION /lib/modules/$VERSION-slitaz/build
48 ln -s linux-$VERSION /usr/src/linux
50 cat <<EOT
51 ----
52 To modify the kernel configuration:
53 $ cd /usr/src/linux-$VERSION
54 $ make menuconfig
56 To build the kernel and the modules:
57 $ cd /usr/src/linux-$VERSION
58 $ make bzImage && make modules
60 To install the new kernel and the modules:
61 $ make modules_install
62 $ cp -a arch/x86/boot/bzImage /boot/vmlinuz-$VERSION-slitaz
64 To make a Slitaz package with the new kernel and the modules:
65 $ make tazpkg
67 See /usr/src/linux-$VERSION/README
68 ----
69 EOT