#!/bin/ksh set -e mem=`free -m | grep ^Mem | awk '{print $2}'` (( mem < 4096 )) && print at least 4GB of RAM is recommended && exit 1 unset mem cd /usr/src/ version=5.0.9 print extracting linux-$version... \\c rm -rf domU/ linux-$version/ tar xf linux-$version.tar mv linux-$version/ domU/ cd domU/ && print done print applying reiser4 patch... \\c #zcat ../reiser4-for-4.20.1.patch.gz | patch -p1 >/dev/null && print done zcat ../reiser4-for-5.0.0.patch.gz | patch -p1 >/dev/null && print done mv -i Makefile Makefile.dist sed 's/^EXTRAVERSION =/EXTRAVERSION = .domureiser4/' Makefile.dist > Makefile print x86_64_defconfig... \\c make -j16 x86_64_defconfig >/dev/null && print done print BASE AND FILE-SYSTEMS: cat >> .config <<-EOF9 CONFIG_BTRFS_FS=y CONFIG_GFS2_FS=y CONFIG_JFS_FS=y CONFIG_REISERFS_FS=y CONFIG_REISER4_FS=y CONFIG_XFS_FS=y CONFIG_BRIDGE=y CONFIG_VLAN_8021Q=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_NFS_V4_1=y CONFIG_NFS_V4_2=y CONFIG_NFS_V4_1_MIGRATION=y CONFIG_NFSD=y CONFIG_NFSD_V3=y CONFIG_NFSD_V4=y CONFIG_CIFS=y EOF9 make -j16 olddefconfig >/dev/null && print done grep REISER4_FS .config print DOCKER: ../check-config.sh .config | grep missing | sed -r 's/^[[:space:]]*- .*(CONFIG_[^:]+).*: .*missing.*/\1=y/' | grep ^CONFIG > .config.docker.tmp sed 's/[^[:alnum:]_]//g' .config.docker.tmp | sed -r 's/my$/=y/' >> .config make -j16 olddefconfig && print done grep VXLAN .config grep OVERLAY_FS .config print K8S: cat >> .config <<-EOF9 CONFIG_NETFILTER_ADVANCED=y CONFIG_IP_NF_TARGET_REDIRECT=y CONFIG_NETFILTER_XT_MATCH_COMMENT=y EOF9 make -j16 olddefconfig && print done grep NETFILTER_ADVANCED .config grep IP_NF_TARGET_REDIRECT .config grep NETFILTER_XT_MATCH_COMMENT .config print xenconfig... \\c make -j16 xenconfig >/dev/null && print done grep CONFIG_XEN_PVH= .config print + spinlocks - dom0 + TMEM cat >> .config <<-EOF9 CONFIG_PARAVIRT_SPINLOCKS=y CONFIG_XEN_DOM0=n CONFIG_XEN_TMEM=y CONFIG_CLEANCACHE=y CONFIG_FRONTSWAP=y CONFIG_SWAP=y CONFIG_XEN_SELFBALLOONING=y EOF9 make -j16 olddefconfig && print done grep CONFIG_PARAVIRT_SPINLOCKS .config print almost no modules mv -f .config .config.m sed 's/=m$/=y/' .config.m > .config make -j16 olddefconfig && print done grep =m$ .config print tail -F /usr/src/make.domU.$version.log \\c time nice make -j16 > ../make.domU.$version.log && print \\ndone tail -1 /usr/src/make.domU.$version.log fullversion=`file arch/x86/boot/bzImage | awk '{print $9}'` echo VERSION IS $fullversion [[ -d /lib/modules/$fullversion/ ]] && rm -rf /lib/modules/$fullversion/ && echo cleaned-up print modules_install... \\c make -j16 modules_install >/dev/null && echo done du -sh /lib/modules/$fullversion/ # domU 84K print /data/kernels/lib.modules.$fullversion.tar.gz... \\c tar czf /data/kernels/lib.modules.$fullversion.tar.gz -C /lib/modules $fullversion/ && print done [[ -z $fullversion ]] && print ERROR \$fullversion NOT DEFINED && exit 1 print cleaning-up /lib/modules/$fullversion/... \\c rm -rf /lib/modules/$fullversion/ && print done print delivering kernel to /data/kernels/vmlinuz... \\c mv -f /data/kernels/vmlinuz.config /data/kernels/vmlinuz.config.old mv -f /data/kernels/vmlinuz.map /data/kernels/vmlinuz.map.old mv -f /data/kernels/vmlinuz /data/kernels/vmlinuz.old cp .config /data/kernels/vmlinuz.config cp System.map /data/kernels/vmlinuz.map cp arch/x86/boot/bzImage /data/kernels/vmlinuz && print done print ALL DONE