--- admin/PlamoBuild-template-20170713 2017-07-13 13:07:00.000000000 +0900 +++ plamo/00_base/old/kernel-20170813/PlamoBuild.kernel-4.10.17_plamoRPi2 2017-08-13 17:43:47.000000000 +0900 @@ -1,19 +1,28 @@ -#!/bin/sh +#!/bin/sh -x ###################################################################### -url="" +url="https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.10.17.tar.xz + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/UNICON/vd_unicon-kernel-20170225-4.10.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/UNICON/vd_unicon-kernel-fonts-20140614.patch.bz2 + https://github.com/sfjro/aufs4-standalone.git + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/mcp/4.10-panic_beep.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/mcp/4.10-morse_code_panics.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/toi/tuxonice-for-linux-4.10.17-2017-05-24.patch.bz2 + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/ovlfs/overlayfs-allow_unprivileged_mounts.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/rpi/rpi-4.10.17-20170521-78cfe36.patch.xz + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/config-4.10.17-plamo@LV@" verify= digest= -branch= -commitid= -pkgbase= -vers= +branch[3]=aufs4.10 +commitid[3]=a19543b +pkgbase=kernel +vers=4.10.17_plamo@LV@ arch=`uname -m` build=P1 -src=$pkgbase-$vers +src=linux-4.10.17 patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="" template=20170713 tmplurl=ftp://plamo.linet.gr.jp/pub/Plamo-src/admin ###################################################################### @@ -28,6 +37,8 @@ fi fscheck +case `uname -m` in i686) lv=SMP ;; x86_64) lv=64 ;; armv7l) lv=RPi2 ;; esac +url=${url/@LV@/$lv} ; vers=${vers/@LV@/$lv} prepare "$@" if [ $opt_download -eq 1 ] ; then download_sources @@ -37,6 +48,50 @@ if [ -d ${B[$i]} ] ; then rm -rf ${B[$i]} ; fi ; cp -a ${S[$i]} ${B[$i]} done apply_patches + cd $B + patch -Np1 -i $W/vd_unicon-kernel-20170225-4.10.patch + bunzip2 -c $W/vd_unicon-kernel-fonts-20140614.patch.bz2 | patch -Np1 -i - + patch -Np1 -i $W/aufs4-standalone/aufs4-kbuild.patch + patch -Np1 -i $W/aufs4-standalone/aufs4-base.patch + patch -Np1 -i $W/aufs4-standalone/aufs4-mmap.patch + patch -Np1 -i $W/aufs4-standalone/aufs4-standalone.patch + cp -av $W/aufs4-standalone/Documentation . + cp -av $W/aufs4-standalone/fs . + cp -pv $W/aufs4-standalone/include/uapi/linux/aufs_type.h include/uapi/linux + patch -Np1 -i $W/4.10-panic_beep.patch + patch -Np1 -i $W/4.10-morse_code_panics.patch + bunzip2 -c $W/tuxonice-for-linux-4.10.17-2017-05-24.patch.bz2 | patch -Np1 -i - + chmod 755 scripts/tuxonice_output_to_csv.sh + patch -Np1 -i $W/overlayfs-allow_unprivileged_mounts.patch + if [ `uname -m` == armv7l ] ; then + unxz -c $W/rpi-4.10.17-20170521-78cfe36.patch.xz | patch -Np1 -i - + chmod 755 drivers/net/wireless/realtek/rtl8192cu/{clean,runwpa,wlan0dhcp} + chmod 755 scripts/{knlinfo,mkknlimg} + fi + cp -p $W/config-4.10.17-plamo$lv .config + if [ $arch == i686 -o $arch == x86_64 ] ; then + cp -p arch/x86/boot/install.sh{,.orig} + head -n-9 arch/x86/boot/install.sh.orig > arch/x86/boot/install.sh + sed -i '/INSTALLKERNEL/s@^@#@g' arch/x86/boot/install.sh + cat <<- "EOF" | patch arch/x86/boot/install.sh + 48a49 + > cp .config $4/config-$1 + EOF + sed -i '/\(vmlinuz\|System.map\)$/s@$@-\$1@g' arch/x86/boot/install.sh + else + cp -p arch/arm/boot/install.sh{,.orig} + sed -i '/INSTALLKERNEL/s@^@#@g' arch/arm/boot/install.sh + cat <<- "EOF" | patch arch/arm/boot/install.sh + 40a41,42 + > cp .config $4/config-$1 + > + 54c56,57 + < cat $2 > $4/$base-$1 + --- + > scripts/mkknlimg $2 $4/kernel7.img-$1 + > cat ${2/zImage/Image} > $4/Image-$1 + EOF + fi for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -x configure ] ; then @@ -62,19 +117,43 @@ for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -f Makefile ] ; then - make install DESTDIR=$P + install -d $P/boot + make `[ $arch == armv7l ] && echo z`install INSTALL_PATH=$P/boot + make modules_install INSTALL_MOD_PATH=$P fi done + krel=${vers//_/-} + if [ $arch == i686 -o $arch == x86_64 ] ; then + ln -s config-$krel $P/boot/config + ln -s vmlinuz-$krel $P/boot/vmlinuz + ln -s System.map-$krel $P/boot/System.map + else + cp -p $P/boot/config{-$krel,} + cp -p $P/boot/kernel7.img{-$krel,} + cp -p $P/boot/System.map{-$krel,} + install -m 644 $B/arch/arm/boot/dts/*.dtb $P/boot + install -d $P/boot/overlays + install -m 644 $B/arch/arm/boot/dts/overlays/README $P/boot/overlays + install -m 644 $B/arch/arm/boot/dts/overlays/*.dtbo $P/boot/overlays + fi + ln -sfn /usr/src/linux $P/lib/modules/$krel/source + ln -sfn /usr/src/linux $P/lib/modules/$krel/build touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ -exec touch -t `date '+%m%d0900'` {} \; compress + install -d $docdir/$src setup_docdir convert_links - tar cvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` - tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man1 | tail -n+2` + prune_symlink $P/boot + prune_symlink $P/lib/modules/$krel + touch -t `date '+%m%d0900'` $P/lib/modules/$krel + tar cvpf $pkg.tar -C $P `cd $P ; find boot -maxdepth 1 | tail -n+2` + tar rvpf $pkg.tar -C $P lib/modules/$krel + tar rvpf $pkg.tar -C $P lib/firmware tar rvpf $pkg.tar -C $P usr/share/doc/$src + tar rvpf $pkg.tar -C $P install/doinst.sh touch -t `date '+%m%d0900'` $pkg.tar ; xz $pkg.tar ; touch $pkg.tar.xz mv $pkg.tar.xz $pkg.txz cleanup