wok-next view linux/stuff/linux-source/get-linux-source @ rev 20893
linux: update split rules
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Jul 20 08:15:10 2018 +0300 (2018-07-20) |
parents | b19a1b511a74 |
children |
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 | sed "s/-${VERSION:0:3}.tar/-$VERSION.tar/")
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 --spider $url && break
11 url=$(echo $url | sed "s|.*/linux/kernel|$i/linux/kernel|")
12 done
14 mirror_src=http://mirror.slitaz.org/sources/packages-$(cat /etc/slitaz-release)
15 busybox wget --spider $url || url=$mirror_src/l/$(basename $url)
17 mkdir -p $SOURCES_REPOSITORY
19 cd /usr/src/
20 if [ -f $SOURCE_REPOSITORY/$(basename ${url//bz2/lzma}) ]; then
21 unlzma -c $SOURCES_REPOSITORY/$(basename ${url//bz2/lzma}) | tar -xf - -C $PWD
22 elif [ -f $SOURCES_REPOSITORY/$(basename $url) ]; then
23 tar -xf $SOURCES_REPOSITORY/$(basename $url)
24 else
25 wget -O $SOURCES_REPOSITORY/$(basename $url) -c $url
26 tar -xf $SOURCES_REPOSITORY/$(basename $url)
27 fi
29 cp -a /usr/src/kernel-patches/slitaz /usr/src/linux-$VERSION
31 # Add tazpkg support
32 if [ -d "/usr/src/linux-$VERSION/scripts/package" ]; then
33 cp -pa /usr/src/linux-$VERSION/slitaz/buildtaz /usr/src/linux-$VERSION/scripts/package
34 cd /usr/src/linux-$VERSION
35 patch -p1 -i slitaz/make-tazpkg.u
36 fi
38 cd /usr/src/linux-$VERSION
39 while read patch_file; do
40 echo "Apply $patch_file"
41 patch -p1 < slitaz/$patch_file
42 done < slitaz/patches
44 [ ! -f System.map ] && cp slitaz/config .config &&
45 make oldconfig && make modules_prepare
46 ln -s /usr/src/linux-$VERSION /lib/modules/$VERSION-slitaz/build
47 ln -s linux-$VERSION /usr/src/linux
49 cat <<EOT
50 ----
51 To modify the kernel configuration:
52 $ cd /usr/src/linux-$VERSION
53 $ make menuconfig
55 To build the kernel and the modules:
56 $ cd /usr/src/linux-$VERSION
57 $ make bzImage && make modules
59 To install the new kernel and the modules:
60 $ make modules_install
61 $ cp -a arch/x86/boot/bzImage /boot/vmlinuz-$VERSION-slitaz
63 To make a Slitaz package with the new kernel and the modules:
64 $ make tazpkg
66 See /usr/src/linux-$VERSION/README
67 ----
68 EOT