#!/bin/ksh set -e # Slackware - make sure you've got elfutils and bc packages installed export MAKEFLAGS=-j32 mem=`free -m | grep ^Mem | awk '{print $2}'` (( mem < 4096 )) && print at least 4GB of RAM is recommended && exit 1 [[ -z $MAKEFLAGS ]] && echo MAKEFLAGS not defined && exit 1 [[ -z $2 ]] && print usage: $0 \ \ && exit 1 linuxtar=$1 patch=$2 [[ ! -f $linuxtar ]] && print could not find $linuxtar && exit 1 [[ ! -f $patch ]] && print could not find $patch && exit 1 linux=${linuxtar%\.tar} # going for v4 for GFS2/DLM hence using the 14.2 config (4.4.14) #mirror=http://nephtys.lip6.fr/pub/linux/distributions/slackware/slackware64-14.2/ #mirror=http://nephtys.lip6.fr/pub/linux/distributions/slackware/slackware64/ #mirror=https://mirror.yandex.ru/slackware/slackware64-14.2/ #mirror=https://mirror.yandex.ru/slackware/slackware64/ # going for v5 hence -current config (Sep 2020: longterm 5.4.66) mirror=http://nephtys.lip6.fr/pub/linux/distributions/slackware/slackware64-15.0/ #mirror=https://mirror.yandex.ru/slackware/slackware64-15.0/ # not sure this is really necessary #[[ `pwd` != /usr/src ]] && print run this into /usr/src/ && exit 1 print extracting $linux/... \\c rm -rf $linux/ tar xaf $linuxtar && print done cd $linux/ print applying reiser4 patch... \\c zcat ../$patch | patch -p1 > ../dom0.log && print done print extra version .xenreiser4... \\c mv -i Makefile Makefile.dist sed 's/^EXTRAVERSION =/EXTRAVERSION = .xenreiser4/' Makefile.dist > Makefile && print done # no double carriage return # self-verbose wget -q -O - $mirror/kernels/VERSIONS.TXT print applying slackware .config wget -q -O - $mirror/kernels/huge.s/config > .config make -j$j olddefconfig >/dev/null && print done\\n #print applying redhat .config #cat ../kernel-x86_64.config > .config print BASE AND FILE-SYSTEMS cat >> .config <<-EOF9 CONFIG_BTRFS_FS=y CONFIG_GFS2_FS=m CONFIG_GFS2_FS_LOCKING_DLM=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_1_MIGRATION=y CONFIG_NFS_V4_2=y CONFIG_NFSD=y CONFIG_NFSD_V3=y CONFIG_NFSD_V4=y CONFIG_CIFS=y CONFIG_UFS_FS=y CONFIG_UFS_FS_WRITE=y EOF9 make -j$j olddefconfig >/dev/null && print done\\n #grep CEPH .config #grep BLK_DEV_RBD .config #grep INFINIBAND .config #grep INFINIBAND_ISER .config #grep SCSI_LOWLEVEL .config #grep ISCSI_TCP .config #grep BRIDGE_NF_EBTABLES .config #grep BRIDGE_EBT_ .config #grep REISER4_FS .config #grep UFS .config print LXC cat >> .config </dev/null && print done\\n print DOCKER [[ ! -f ../check-config.sh ]] && \ wget -q -O ../check-config.sh https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh chmod +x ../check-config.sh ../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 -j$j olddefconfig && print done\\n #grep VXLAN .config #grep OVERLAY_FS .config # no need #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 && echo done #grep NETFILTER_ADVANCED .config #grep IP_NF_TARGET_REDIRECT .config #grep NETFILTER_XT_MATCH_COMMENT .config print XEN CONFIG make -j$j xen.config >/dev/null make -j$j olddefconfig && print done\\n #grep CONFIG_XEN_PVH= .config #print spinlocks... \\c #cat >> .config <<-EOF9 #CONFIG_PARAVIRT_SPINLOCKS=y #EOF9 #make -j$j olddefconfig && print done #grep CONFIG_PARAVIRT_SPINLOCKS .config date print takes about 26m on pro5s2 print takes about 1h18m on xc print tail -F /usr/src/dom0.log time make -j$j >> ../dom0.log && print BUILT\\n tail -1 /usr/src/dom0.log print fullversion=`file arch/x86/boot/bzImage | awk '{print $9}'` print VERSION IS $fullversion [[ -d /lib/modules/$fullversion/ ]] && rm -rf /lib/modules/$fullversion/ && print cleaned-up print modules install... \\c make -j$j modules_install >/dev/null && print done du -sh /lib/modules/$fullversion/ cd ../ # was $linux/ # # making the built kernel available for other hosts # print $fullversion.config ... \\c cp -f $linux/.config $fullversion.config && print done print $fullversion.vmlinuz ... \\c cp -f $linux/arch/x86/boot/bzImage $fullversion.vmlinuz && print done print $fullversion.modules.tar.gz ... \\c tar czf $fullversion.modules.tar.gz -C /lib/modules $fullversion/ && print done print $fullversion.src.tar.gz ... \\c tar czf $fullversion.src.tar.gz $linux/ && print done echo moving the stuff away to /data/kernels mkdir -p /data/kernels/ mv -f $fullversion.vmlinuz /data/kernels/ mv -f $fullversion.config /data/kernels/ mv -f $fullversion.modules.tar.gz /data/kernels/ mv -f $fullversion.src.tar.gz /data/kernels/ cat <