#!/bin/ksh set -e # # everything that we need incl. features for docker (not k8s) # reiser4 mandatory # grabs config for you # # Slackware - make sure you've got elfutils and bc packages installed [[ -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 [[ -z $MAKEFLAGS ]] && echo MAKEFLAGS not defined && exit 1 echo MAKEFLAGS is $MAKEFLAGS mem=`free -m | grep ^Mem | awk '{print $2}'` (( mem < 4096 )) && print at least 4GB of RAM is recommended && exit 1 print extracting $linux/ ... \\c rm -rf $linux/ tar xf $linuxtar && print done cd $linux/ print applying reiser4 patc h... \\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 ... \\c #wget -q -O - $mirror/kernels/huge.s/config > .config wget -q -O - https://lab.nethence.com/confdiff/config.txt > .config echo CONFIG_X86_X32=n >> .config make 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 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 olddefconfig && print done\\n #grep VXLAN .config #grep OVERLAY_FS .config print XEN CONFIG make xen.config >/dev/null make olddefconfig && print done\\n #grep CONFIG_XEN_PVH= .config #print spinlocks... \\c #cat >> .config <<-EOF9 #CONFIG_PARAVIRT_SPINLOCKS=y #EOF9 #make 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 >> ../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 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 READY $fullversion.vmlinuz $fullversion.config $fullversion.modules.tar.gz $fullversion.src.tar.gz DEPLOY ON HOSTS mv -f /vmlinuz /vmlinuz.old mv -f /config /config.old cp -f $linux/arch/x86/boot/bzImage /vmlinuz cp -f $linux/.config /config file /vmlinuz* chmod 444 /vmlinuz* /config* EOF