Compiling a XEN dom0 Linux kernel

You need at least Linux v4.2. Slackware 14.2 has v4.4 so that is fine: you could just recompile the sources provided from the K set. But let us get things straight: grab the latest mainline or xen testing kernel,

cd /usr/src/
git clone git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git
ln -s tip linux

Prepare a dom0 capable kernel (this also makes it domU capable but we do not care!,

cd /usr/src/
wget "https://sourceforge.net/projects/reiser4/files/reiser4-for-linux-4.x/reiser4-for-4.17.0.patch.gz"

cd /usr/src/linux/
zcat ../reiser4-for-4.17.0.patch.gz | patch -p1

#make distclean
#make mrproper

cp -pi Makefile Makefile.dist
vi Makefile

EXTRAVERSION = .slackxen

ls -al .config # does not exist yet
wget -O - http://mirror.yandex.ru/slackware/slackware64-current/kernels/huge.s/config > .config
make oldconfig
cp -f .config .config.slack

make xenconfig
cp -f .config .config.slackxen

(optional) eventually enable DEBUG,

grep CONFIG_DEBUG_INFO .config
grep CONFIG_CRASH_DUMP .config
grep CONFIG_PROC_VMCORE .config
cat >> .config <<-EOF9
CONFIG_DEBUG_INFO=y
CONFIG_CRASH_DUMP=y
CONFIG_PROC_VMCORE=y
EOF9
make oldconfig

now we surely want to be able to write to NetBSD FFS file-systems,

grep CONFIG_UFS .config
cat >> .config <<-EOF9
CONFIG_UFS_FS=y
CONFIG_UFS_FS_WRITE=y
EOF9
make oldconfig

(optional) and funky reiser4 as long as you have applied the patch,

grep REISER4 .config
echo 'CONFIG_REISER4_FS=y' >> .config
make oldconfig

grep CEPH .config
grep BLK_DEV_RBD .config

and build it,

j=$((`grep ^processor /proc/cpuinfo  | tail -1 | awk '{print $3}'` + 1))
echo $j
time make -j$j > make.dom0.log && echo done

ls -lhF /lib/modules/
uname -r
rm -rf /lib/modules/other-than-currently-running-and-freshly-compiled-one
make -j$j modules_install >/dev/null && echo done

#make install
ls -lF arch/x86_64/boot/bzImage
ls -lF arch/x86/boot/bzImage # 9104912 / 9258112
mv /vmlinuz /vmlinux.old
cp arch/x86/boot/bzImage /vmlinuz