--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/09_kernel/old/kernelsrc-20160219/PlamoBuild.kernelsrc-4.1.15_plamoRPi2 2016-02-19 08:31:04.000000000 +0900 @@ -1,15 +1,22 @@ -#!/bin/sh +#!/bin/sh -x ###################################################################### -url="" -pkgbase= -vers= -arch=`uname -m` -build=P1 -src=$pkgbase-$vers -patchfiles="" +url="https://github.com/raspberry/linux.git + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/UNICON/vd_unicon-kernel-20150627-4.1.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.1-panic_beep.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/mcp/4.1-morse_code_panics.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/toi/tuxonice-for-linux-4.1.6-2015-08-22.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/config-4.1.15-plamoRPi2" +pkgbase=kernelsrc +vers=4.1.15_plamoRPi2 +arch=noarch +build=P3 +src=linux OPT_CONFIG="" -DOCS="README" +DOCS="" ###################################################################### fscheck() { @@ -186,35 +193,22 @@ fi if [ $opt_download -eq 1 ] ; then for i in $url ; do - if [ ! -f ${i##*/} ] ; then - wget $i ; j=${i%.*} - for sig in asc sig{,n} {sha{256,1},md5}{,sum} ; do - if wget --spider $i.$sig ; then wget $i.$sig ; break ; fi - if wget --spider $j.$sig ; then - case ${i##*.} in - gz) gunzip -c ${i##*/} > ${j##*/} ;; - bz2) bunzip2 -c ${i##*/} > ${j##*/} ;; - xz) unxz -c ${i##*/} > ${j##*/} ;; - esac - touch -r ${i##*/} ${j##*/} ; i=$j ; wget $i.$sig ; break - fi - done - if [ -f ${i##*/}.$sig ] ; then - case $sig in - asc|sig|sign) gpg2 --verify ${i##*/}.$sig ;; - sha256|sha1|md5) ${sig}sum -c ${i##*/}.$sig ;; - *) $sig -c ${i##*/}.$sig ;; - esac - if [ $? -ne 0 ] ; then echo "archive verify failed" ; exit ; fi - fi - fi + case ${i##*.} in + git) if [ ! -d `basename ${i##*/} .git` ] ; then git clone $i ; fi ;; + *) if [ ! -f ${i##*/} ] ; then wget $i ; fi ;; + esac done for i in $url ; do case ${i##*.} in tar) tar xvpf ${i##*/} ;; - gz|tgz) tar xvpzf ${i##*/} ;; - bz2|tbz) tar xvpjf ${i##*/} ;; - xz|txz) tar xvpJf ${i##*/} ;; + gz) tar xvpzf ${i##*/} ;; + bz2) tar xvpjf ${i##*/} ;; + xz) tar xvpJf ${i##*/} ;; + git) ( cd `basename ${i##*/} .git` + case `basename ${i##*/} .git` in + linux) git checkout origin/rpi-4.1.y ; git reset --hard d51c7d8 ;; + aufs4-*) git checkout origin/aufs4.1 ; git reset --hard 2b569cf ;; + esac ) ;; esac done fi @@ -222,17 +216,22 @@ for i in `seq 0 $((${#B[@]} - 1))` ; do if [ -d ${B[$i]} ] ; then rm -rf ${B[$i]} ; fi ; cp -a ${S[$i]} ${B[$i]} done - for i in `seq 0 $((${#B[@]} - 1))` ; do - cd ${B[$i]} - for j in ${patchfiles[$i]} ; do - case ${j##*.} in - gz) gunzip -c $W/$j | patch -Np1 -i - ;; - bz2) bunzip2 -c $W/j | patch -Np1 -i - ;; - xz) unxz -c $W/$j | patch -Np1 -i - ;; - *) patch -Np1 -i $W/$j ;; - esac - done - done + cd $B + rm -rf .git ; touch .git + patch -Np1 -i $W/vd_unicon-kernel-20150627-4.1.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.1-panic_beep.patch + patch -Np1 -i $W/4.1-morse_code_panics.patch + bunzip2 -c $W/tuxonice-for-linux-4.1.6-2015-08-22.patch.bz2 | patch -Np1 -i - + patch -Np1 -i $W/overlayfs-allow_unprivileged_mounts.patch + cp -p $W/config-4.1.15-plamoRPi2 .config for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -f Makefile ] ; then @@ -242,8 +241,8 @@ rm -rf config.cache config.log fi if [ -x configure ] ; then - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ - --libdir='${exec_prefix}'/$libdir --infodir='${prefix}'/share/info \ + ./configure --prefix=/usr --libdir='${exec_prefix}'/$libdir \ + --infodir='${prefix}'/share/info \ --mandir='${prefix}'/share/man ${OPT_CONFIG[$i]} fi done @@ -252,7 +251,10 @@ for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -f Makefile ] ; then - make + make prepare scripts + mv include/generated/bounds.h $W + make clean + mv $W/bounds.h include/generated fi done fi @@ -268,10 +270,55 @@ touch $W/i.st ; sleep 1 for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} - if [ -f Makefile ] ; then + false && if [ -f Makefile ] ; then make install DESTDIR=$P fi done + install -d $P/usr/src + cp -dR . $P/usr/src/$src-4.1.15 + rm $P/usr/src/$src-4.1.15/.git + find $P/usr/src/$src-4.1.15 \( -name ".get_maintainer.ignore" \ + -o -name ".gitignore" -o -name ".mailmap" -o -name "*.orig" \) \ + -exec rm {} \; + ln -s $src-4.1.15 $P/usr/src/linux + install -d $P/sbin + cat <<- "EOF" > $P/sbin/installkernel + #!/bin/sh + # + # arch/arm/boot/install.sh + # + # This file is subject to the terms and conditions of the GNU General Public + # License. See the file "COPYING" in the main directory of this archive + # for more details. + # + # Copyright (C) 1995 by Linus Torvalds + # + # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin + # Adapted from code in arch/i386/boot/install.sh by Russell King + # + # "make install" script for arm architecture + # + # Arguments: + # $1 - kernel version + # $2 - kernel image file + # $3 - kernel map file + # $4 - default install path (blank if root directory) + # + + [ -f $4/config ] && mv $4/config $4/config.old + cp .config $4/config + [ -f $4/kernel7.img ] && mv $4/kernel7.img $4/kernel7.old + scripts/mkknlimg $2 > $4/kernel7.img + [ -f $4/System.map ] && mv $4/System.map $4/System.old + cp $3 $4/System.map + + if [ -x /sbin/loadmap ] ; then + /sbin/loadmap + else + sync + fi + EOF + chmod 755 $P/sbin/installkernel touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ @@ -285,6 +332,7 @@ gzip_one $docdir/${src[$i]}/${k#${S[$i]}/} done done + install -d $docdir/$src if [ $i -eq 0 ] ; then install $myname $docdir/$src touch -t `date '+%m%d0900'` $docdir/$src/$myname @@ -294,10 +342,18 @@ fi ( cd $docdir ; find ${src[$i]} -type d -exec touch -r $W/{} {} \; ) done + touch -t `date '+%m%d0900'` $docdir/$src convert - 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/usr/src + touch -t `date '+%m%d0900'` $P/usr/src/$src-4.1.15/arch/arm/boot/dts/include + touch -t `date '+%m%d0900'` $P/usr/src/$src-4.1.15/arch/metag/boot/dts/include + touch -t `date '+%m%d0900'` $P/usr/src/$src-4.1.15/arch/mips/boot/dts/include + touch -t `date '+%m%d0900'` $P/usr/src/$src-4.1.15/arch/powerpc/boot/dts/include + touch -t `date '+%m%d0900'` $P/usr/src/$src-4.1.15/tools/testing/selftests/powerpc/copyloops + tar cvpf $pkg.tar -C $P `cd $P ; find usr/src -maxdepth 1 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find sbin | tail -n+2` 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 read -p "Do you want to keep work files? [y/N] " ans