wok-6.x annotate linux-source/stuff/get-linux-source @ rev 11173
Up: clamav to 0.97.3.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Nov 02 15:36:42 2011 +0000 (2011-11-02) |
parents | ff2fcdc165fc |
children | 9dcbd66afec8 |
rev | line source |
---|---|
slaxemulator@6975 | 1 #!/bin/sh |
slaxemulator@6975 | 2 |
gokhlayeh@9232 | 3 |
gokhlayeh@9232 | 4 source /etc/slitaz/slitaz.conf |
gokhlayeh@9232 | 5 SOURCES_REPOSITORY=$SLITAZ_DIR/$SLITAZ_VERSION/src |
slaxemulator@6975 | 6 VERSION=XXX |
slaxemulator@6975 | 7 |
slaxemulator@7111 | 8 url=$(cat /usr/src/kernel-patches/slitaz/url) |
slaxemulator@6975 | 9 |
slaxemulator@7110 | 10 if [ ! -d $SOURCES_REPOSITORY ]; then |
slaxemulator@7110 | 11 mkdir -p $SOURCES_REPOSITORY |
slaxemulator@7110 | 12 fi |
slaxemulator@7110 | 13 |
gokhlayeh@9232 | 14 cd /usr/src/ |
gokhlayeh@9232 | 15 if [ -f $SOURCE_REPOSITORY/$(basename ${url//bz2/lzma}) ]; then |
gokhlayeh@9232 | 16 unlzma -c $SOURCES_REPOSITORY/$(basename ${url//bz2/lzma}) | tar xf - -C $PWD |
gokhlayeh@9232 | 17 elif [ -f $SOURCES_REPOSITORY/$(basename $url) ]; then |
slaxemulator@7131 | 18 tar xjf $SOURCES_REPOSITORY/$(basename $url) |
slaxemulator@6975 | 19 else |
slaxemulator@7110 | 20 wget -O $SOURCES_REPOSITORY/$(basename $url) -c $url |
slaxemulator@7131 | 21 tar xjf $SOURCES_REPOSITORY/$(basename $url) |
slaxemulator@6975 | 22 fi |
slaxemulator@6975 | 23 |
slaxemulator@6975 | 24 cp -a /usr/src/kernel-patches/slitaz /usr/src/linux-$VERSION |
slaxemulator@7206 | 25 if [ -d /usr/src/linux-$VERSION/slitaz/aufs2 ]; then |
slaxemulator@7111 | 26 cp -pa /usr/src/linux-$VERSION/slitaz/aufs2/* /usr/src/linux-$VERSION |
slaxemulator@7111 | 27 fi |
slaxemulator@6975 | 28 |
slaxemulator@6975 | 29 # Add tazpkg support |
slaxemulator@6975 | 30 if [ -d "/usr/src/linux-$VERSION/scripts/package" ]; then |
slaxemulator@6975 | 31 cp -pa /usr/src/linux-$VERSION/slitaz/buildtaz /usr/src/linux-$VERSION/scripts/package |
slaxemulator@6975 | 32 cd /usr/src/linux-$VERSION |
slaxemulator@6975 | 33 patch -p1 -i slitaz/make-tazpkg.u |
slaxemulator@6975 | 34 fi |
slaxemulator@6975 | 35 |
slaxemulator@6975 | 36 cd /usr/src/linux-$VERSION |
slaxemulator@6975 | 37 while read patch_file; do |
slaxemulator@6975 | 38 echo "Apply $patch_file" |
slaxemulator@6975 | 39 patch -p1 < slitaz/$patch_file |
slaxemulator@6975 | 40 done < slitaz/patches |
slaxemulator@6975 | 41 [ ! -f System.map ] && cp slitaz/config .config && |
slaxemulator@6975 | 42 make oldconfig && make modules_prepare |
pascal@10950 | 43 ln -s /usr/src/linux-$VERSION /lib/modules/$VERSION-slitaz/build |
pascal@10950 | 44 ln -s linux-$VERSION /usr/src/linux |
slaxemulator@6975 | 45 |
slaxemulator@6975 | 46 cat <<EOT |
slaxemulator@6975 | 47 ---- |
slaxemulator@6975 | 48 To modify the kernel configuration: |
slaxemulator@6975 | 49 $ cd /usr/src/linux-$VERSION |
slaxemulator@6975 | 50 $ make menuconfig |
slaxemulator@6975 | 51 |
slaxemulator@6975 | 52 To build the kernel and the modules: |
slaxemulator@6975 | 53 $ cd /usr/src/linux-$VERSION |
slaxemulator@6975 | 54 $ make bzImage && make modules |
slaxemulator@6975 | 55 |
slaxemulator@6975 | 56 To install the new kernel and the modules: |
slaxemulator@6975 | 57 $ make modules_install |
slaxemulator@6975 | 58 $ cp -a arch/x86/boot/bzImage /boot/vmlinuz-$VERSION-slitaz |
slaxemulator@6975 | 59 |
slaxemulator@6975 | 60 To make a Slitaz package with the new kernel and the modules: |
slaxemulator@6975 | 61 $ make tazpkg |
slaxemulator@6975 | 62 |
slaxemulator@6977 | 63 See /usr/src/linux-$VERSION/README |
slaxemulator@6975 | 64 ---- |
gokhlayeh@9232 | 65 EOT |