Create a Slackware kernel (initrd) for Hyper-V

Posted by in Lagom

If you are installing Slackware, after setup is done and before reboot, first chroot into the root partition:
# mount -t ext4 /dev/sda1 /mnt
# mount -o bind /proc /mnt/proc
# mount -o bind /dev /mnt/dev
# mount -o bind /sys /mnt/sys
# chroot /mnt

# mkinitrd -c -f ext4 -r /dev/sda1 -m hv_vmbus:hv_storvsc:mbcache:jbd2:ext4 -u -o /boot/initrd.gz -k

-r = boot partition
-k = kernel version

edit /etc/lilo.conf (or grub, elilo.conf etc) to match new initrd and generic kernel:

# nano -w /etc/lilo.conf

image = /boot/
append = "elevator=noop"
initrd = /boot/initrd.gz
root = /dev/sda1
label = hyperv

# lilo

Fix (the annoying) “argument list too long”

Posted by in Lagom

In this example we want to archive a huge number of .xml files in the current directory:

# find . -name "*.xml" -print > ./file.lst
# tar czvf ./archive.tgz --files-from ./file.lst

And delete all archived files:

# xargs -a ./file.lst rm -v
# rm ./file.lst