--- admin/PlamoBuild-template-20180815 2018-08-15 16:18:50.000000000 +0900 +++ plamo/00_base/kernel/PlamoBuild.kernel-5.4.51_plamo@LV@ 2021-09-22 19:58:03.000000000 +0900 @@ -1,19 +1,31 @@ -#!/bin/sh +#!/bin/sh -x ###################################################################### -url="" +url="https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.51.tar.xz + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/UNICON/vd_unicon-kernel-20191130-5.4.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/UNICON/vd_unicon-kernel-device_set_font_noarg.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/UNICON/vd_unicon-kernel-fonts-20140614.patch.bz2 + https://github.com/sfjro/aufs5-standalone.git + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/mcp/5.4-panic_beep.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/mcp/5.4-morse_code_panics.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/toi/tuxonice-for-linux-5.4.39-2020-05-09.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/misc/5.4-mt7615-define-to_rssi-macro.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/rpi/rpi-5.4.51-20200715-7d9a391.patch.xz + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/rpi/5.4-CLK_BCM2835-RESET_CONTROLLER.patch + ftp://plamo.linet.gr.jp/pub/Plamo-test/kernelsrc_patches/config-5.4.51-plamo@LV@" verify= digest= -branch= -commitid= -pkgbase= -vers= +branch[4]=aufs5.4.3 +commitid[4]=1d622ad +pkgbase=kernel +vers=5.4.51_plamo@LV@ arch=`uname -m` -build=P1 -src=$pkgbase-$vers +build=P2 +src=linux-5.4.51 patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="" template=20180815 tmplurl=ftp://plamo.linet.gr.jp/pub/Plamo-src/admin ###################################################################### @@ -28,6 +40,11 @@ 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} +if [ `uname -m` == armv7l ] ; then + src[0]=linux-5.4.51 ; src[1]=${src[0]} +fi prepare "$@" if [ $opt_download -eq 1 ] ; then download_sources @@ -39,6 +56,69 @@ apply_patches for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} + patch -Np1 -i $W/vd_unicon-kernel-20191130-5.4.patch + patch -Np1 -i $W/vd_unicon-kernel-device_set_font_noarg.patch + bunzip2 -c $W/vd_unicon-kernel-fonts-20140614.patch.bz2 | patch -Np1 -i - + patch -Np1 -i $W/aufs5-standalone/aufs5-kbuild.patch + patch -Np1 -i $W/aufs5-standalone/aufs5-base.patch + patch -Np1 -i $W/aufs5-standalone/aufs5-mmap.patch + patch -Np1 -i $W/aufs5-standalone/aufs5-standalone.patch + cp -av $W/aufs5-standalone/Documentation . + cp -av $W/aufs5-standalone/fs . + cp -pv $W/aufs5-standalone/include/uapi/linux/aufs_type.h include/uapi/linux + patch -Np1 -i $W/5.4-panic_beep.patch + patch -Np1 -i $W/5.4-morse_code_panics.patch + bunzip2 -c $W/tuxonice-for-linux-5.4.39-2020-05-09.patch.bz2 | patch -Np1 -i - + chmod 755 scripts/tuxonice_output_to_csv.sh + patch -Np1 -i $W/overlayfs-allow_unprivileged_mounts.patch + patch -Np1 -i $W/5.4-mt7615-define-to_rssi-macro.patch + if [ `uname -m` == armv7l ] ; then + unxz -c $W/rpi-5.4.51-20200715-7d9a391.patch.xz | patch -Np1 -i - + patch -Np1 -i $W/5.4-CLK_BCM2835-RESET_CONTROLLER.patch + rm -rf .github + chmod 755 drivers/net/wireless/realtek/rtl8192cu/{clean,runwpa,wlan0dhcp} + fi + cp -p $W/config-5.4.51-plamo$lv .config + if [ $i -eq 1 ] ; then + scripts/config --set-str LOCALVERSION "-plamoLPAE" -e ARM_LPAE \ + -e VMSPLIT_3G -d VMSPLIT_2G -e HIGHMEM -e PCIE_BRCMSTB --refresh + fi + 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,43 + > l=`[[ $1 =~ LPAE ]] && echo l` + > cp .config $4/config$l-$1 + > + 44c47 + < base=vmlinuz + --- + > base=kernel7$l.img + 57,58c60,61 + < if [ -f $4/System.map-$1 ]; then + < mv $4/System.map-$1 $4/System.map-$1.old + --- + > if [ -f $4/System$l.map-$1 ]; then + > mv $4/System$l.map-$1 $4/System$l.map-$1.old + 60c63 + < cp $3 $4/System.map-$1 + --- + > cp $3 $4/System$l.map-$1 + EOF + fi + done + for i in `seq 0 $((${#B[@]} - 1))` ; do + cd ${B[$i]} if [ -x configure ] ; then ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --libdir='${exec_prefix}'/$libdir --infodir='${prefix}'/share/info \ @@ -62,19 +142,51 @@ 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 + cd $B + 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,} + krel2=${krel//RPi2/LPAE} + cp -p $P/boot/configl{-$krel2,} + cp -p $P/boot/kernel7l.img{-$krel2,} + cp -p $P/boot/Systeml.map{-$krel2,} + install -m 644 arch/arm/boot/dts/*.dtb $P/boot + install -d $P/boot/overlays + install -m 644 arch/arm/boot/dts/overlays/README $P/boot/overlays + install -m 644 arch/arm/boot/dts/overlays/*.dtbo $P/boot/overlays + fi + ln -sfn /usr/src/$src $P/lib/modules/$krel/source + ln -sfn /usr/src/$src $P/lib/modules/$krel/build + if [ $arch == armv7l ] ; then + ln -sfn /usr/src/$src $P/lib/modules/$krel2/source + ln -sfn /usr/src/$src $P/lib/modules/$krel2/build + fi touch $W/i.et cd $W TZ=UTC find $P ! -type l -newer i.st ! -newer i.et \ -exec touch -t `date -u '+%m%d0000'` {} \; 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 + TZ=UTC touch -t `date -u '+%m%d0000'` $P/lib/modules/* + tar cvpf $pkg.tar -C $P `cd $P ; find boot -maxdepth 1 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find lib/modules -maxdepth 1 | tail -n+2` tar rvpf $pkg.tar -C $P usr/share/doc/$src + tar rvpf $pkg.tar -C $P install/doinst.sh TZ=UTC touch -t `date -u '+%m%d0000'` $pkg.tar xz $pkg.tar ; touch $pkg.tar.xz ; mv $pkg.tar.xz $pkg.txz cleanup