Commands

When DKMS Build Fails Due to Missing Source

The kernel headers are enought to build a module. However, if building the DKMS fails and kernel headers package are installed, it usually means there is no build symlink under /lib/modules/`uname -r`.

Do the following to create the symlink:

$ sudo ln -s /usr/src/linux-headers-$(uname -r)/ /lib/modules/$(uname -r)/build

No configure script, only configure.ac

Need to run the following set of commands to build a working configure script from a configure.ac:

$ libtoolize --force
$ aclocal
$ autoheader
$ automake --force-missing --add-missing
$ autoconf
$ ./configure --prefix=/usr

Transferring files over netcat

Sometimes this is useful when you need to transfer some files from a unit that has busybox or booted up to an initramfs shell.

First, on PC that you would like the file to be transferred to:

$ nc -l -p 6666 > dmesg.out

You can check if port 6666 is open by running:

$ lsof -i :6666
COMMAND PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
nc      953 amit    3u  IPv4 54834351      0t0  TCP \*:6666 (LISTEN)

Then on busybox shell:

(initramfs) ip link set dev eth0 up
(initramfs) ip addr add 192.168.1.123/24 dev eth0
(initramfs) dmesg > /tmp/dmesg
(initramfs) nc 192.168.1.175:6666 < /tmp/dmesg