wok-next view linux-source/stuff/get-linux-source @ rev 11146

Up: git to 1.7.7.1.
author Christopher Rogers <slaxemulator@gmail.com>
date Wed Oct 26 21:25:07 2011 +0000 (2011-10-26)
parents ff2fcdc165fc
children 9dcbd66afec8
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)
10 if [ ! -d $SOURCES_REPOSITORY ]; then
11 mkdir -p $SOURCES_REPOSITORY
12 fi
14 cd /usr/src/
15 if [ -f $SOURCE_REPOSITORY/$(basename ${url//bz2/lzma}) ]; then
16 unlzma -c $SOURCES_REPOSITORY/$(basename ${url//bz2/lzma}) | tar xf - -C $PWD
17 elif [ -f $SOURCES_REPOSITORY/$(basename $url) ]; then
18 tar xjf $SOURCES_REPOSITORY/$(basename $url)
19 else
20 wget -O $SOURCES_REPOSITORY/$(basename $url) -c $url
21 tar xjf $SOURCES_REPOSITORY/$(basename $url)
22 fi
24 cp -a /usr/src/kernel-patches/slitaz /usr/src/linux-$VERSION
25 if [ -d /usr/src/linux-$VERSION/slitaz/aufs2 ]; then
26 cp -pa /usr/src/linux-$VERSION/slitaz/aufs2/* /usr/src/linux-$VERSION
27 fi
29 # Add tazpkg support
30 if [ -d "/usr/src/linux-$VERSION/scripts/package" ]; then
31 cp -pa /usr/src/linux-$VERSION/slitaz/buildtaz /usr/src/linux-$VERSION/scripts/package
32 cd /usr/src/linux-$VERSION
33 patch -p1 -i slitaz/make-tazpkg.u
34 fi
36 cd /usr/src/linux-$VERSION
37 while read patch_file; do
38 echo "Apply $patch_file"
39 patch -p1 < slitaz/$patch_file
40 done < slitaz/patches
41 [ ! -f System.map ] && cp slitaz/config .config &&
42 make oldconfig && make modules_prepare
43 ln -s /usr/src/linux-$VERSION /lib/modules/$VERSION-slitaz/build
44 ln -s linux-$VERSION /usr/src/linux
46 cat <<EOT
47 ----
48 To modify the kernel configuration:
49 $ cd /usr/src/linux-$VERSION
50 $ make menuconfig
52 To build the kernel and the modules:
53 $ cd /usr/src/linux-$VERSION
54 $ make bzImage && make modules
56 To install the new kernel and the modules:
57 $ make modules_install
58 $ cp -a arch/x86/boot/bzImage /boot/vmlinuz-$VERSION-slitaz
60 To make a Slitaz package with the new kernel and the modules:
61 $ make tazpkg
63 See /usr/src/linux-$VERSION/README
64 ----
65 EOT