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://
cd tip/
git reset --hard
git checkout -b xen-next origin/linux-next
git pull

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

cd /usr/src/
wget ""

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 = .slackxenreiser4

ls -al .config # does not exist yet
wget -O - > .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
cat >> .config <<-EOF9
make oldconfig

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

grep CONFIG_UFS .config
cat >> .config <<-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 / 4.19--9476768
mv /vmlinuz /vmlinux.old
cp arch/x86/boot/bzImage /vmlinuz

for templating servers,

cd /lib/modules/
tar czf 4.19.0-rc7.slackxenreiser4+.tar.gz 4.19.0-rc7.slackxenreiser4+