--- plamo/09_kernel/old/kernelsrc-20210724/PlamoBuild.kernelsrc-5.4.51_plamo@LV@ 2021-07-24 12:02:08.000000000 +0900 +++ plamo/09_kernel/kernelsrc/PlamoBuild.kernelsrc-5.4.51_plamo@LV@ 2021-09-22 20:00:16.000000000 +0900 @@ -21,7 +21,7 @@ pkgbase=kernelsrc vers=5.4.51_plamo@LV@ arch=noarch -build=P1 +build=P2 src=linux-5.4.51 patchfiles="" OPT_CONFIG="" @@ -42,6 +42,9 @@ 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 @@ -51,30 +54,36 @@ 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-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 + 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 + done for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -x configure ] ; then @@ -104,8 +113,12 @@ make install DESTDIR=$P fi done + cd $B install -d $P/usr/src cp -dR . $P/usr/src/$src + if [ `uname -m` == armv7l ] ; then + install -m 644 ${B[1]}/.config $P/usr/src/$src/.configl + fi find $P/usr/src/$src \( -name ".clang-format" -o -name ".cocciconfig" \ -o -name ".get_maintainer.ignore" -o -name ".gitattributes" \ -o -name ".gitignore" -o -name ".mailmap" \ @@ -113,37 +126,32 @@ ln -s $src $P/usr/src/linux install -d $P/sbin if [ `uname -m` == i686 -o `uname -m` == x86_64 ] ; then - sed '/^verify/,$d' $B/arch/x86/boot/install.sh > $P/sbin/installkernel + sed '/^verify/,$d' arch/x86/boot/install.sh > $P/sbin/installkernel else - sed '/^verify/,$d' $B/arch/arm/boot/install.sh > $P/sbin/installkernel + sed '/^verify/,$d' arch/arm/boot/install.sh > $P/sbin/installkernel fi - cat <<- "EOF" >> $P/sbin/installkernel - [ -f $4/config ] && mv $4/config $4/config.old - cp .config $4/config - EOF if [ `uname -m` == i686 -o `uname -m` == x86_64 ] ; then cat <<- "EOF" >> $P/sbin/installkernel + [ -f $4/config ] && mv $4/config $4/config.old + cp .config $4/config [ -f $4/vmlinuz ] && mv $4/vmlinuz $4/vmlinuz.old cat $2 > $4/vmlinuz - EOF - else - cat <<- "EOF" >> $P/sbin/installkernel - [ -f $4/kernel7.img ] && mv $4/kernel7.img $4/kernel7.old - cat $2 > $4/kernel7.img - EOF - fi - cat <<- "EOF" >> $P/sbin/installkernel [ -f $4/System.map ] && mv $4/System.map $4/System.old cp $3 $4/System.map - EOF - if [ `uname -m` == i686 -o `uname -m` == x86_64 ] ; then - cat <<- "EOF" >> $P/sbin/installkernel if [ -x /sbin/lilo -a -f /etc/lilo.conf ] ; then /sbin/lilo EOF else cat <<- "EOF" >> $P/sbin/installkernel + l=`[[ $1 =~ LPAE ]] && echo l` + [ -f $4/config$l ] && mv $4/config$l $4/config$l.old + cp .config $4/config$l + [ -f $4/kernel7$l.img ] && mv $4/kernel7$l.img $4/kernel7$l.old + cat $2 > $4/kernel7$l.img + [ -f $4/System$l.map ] && mv $4/System$l.map $4/System$l.old + cp $3 $4/System$l.map + if [ -x /sbin/loadmap ] ; then /sbin/loadmap EOF