--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/00_base/old/kernel-20160219/PlamoBuild.kernel-4.1.15_plamoRPi2 2016-02-19 08:11:19.000000000 +0900 @@ -1,15 +1,22 @@ -#!/bin/sh +#!/bin/sh -x ###################################################################### -url="" -pkgbase= -vers= +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=kernel +vers=4.1.15_plamoRPi2 arch=`uname -m` -build=P1 -src=$pkgbase-$vers -patchfiles="" +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,33 @@ 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 + 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 + < cat $2 > $4/$base-$1 + --- + > scripts/mkknlimg $2 $4/kernel7.img-$1 + EOF for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -f Makefile ] ; then @@ -242,8 +252,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 @@ -269,9 +279,21 @@ for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -f Makefile ] ; then - make install DESTDIR=$P + install -d $P/boot + make zinstall INSTALL_PATH=$P/boot + make modules_install INSTALL_MOD_PATH=$P fi done + krel=${vers//_/-} + cp -p $P/boot/config{-$krel,} + cp -p $P/boot/kernel7.img{-$krel,} + cp -p $P/boot/System.map{-$krel,} + 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/*.dtb $P/boot/overlays + install -m 644 $B/arch/arm/boot/dts/*.dtb $P/boot + ln -snf /usr/src/linux $P/lib/modules/$krel/source + ln -snf /usr/src/linux $P/lib/modules/$krel/build touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ @@ -285,6 +307,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 +317,15 @@ 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/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 read -p "Do you want to keep work files? [y/N] " ans