Thursday, January 22, 2004

Debian schmebian
sourced from here

Building a kernel
You can do a make menuconfig; make dep; make clean; make bzImage, but to do all these in a debian way - Configure it the normal way and do make-kpkg --revision= kernel_image.This will build a debian package.
For example, if you ran this on a linux-2.4.16 kernel, the file of the package would be named kernel-image-2.4.16_rev1_i386.deb

Once you have the .deb file, install it using 'dpkg -i'. After the package installation, cross-check /etc/lilo.conf and /sbin/lilo -v before rebooting.


How to rebuild the dselect database from scratch:
(useful, as the apt db and dselect can get out of sync if you forget to do an update):

perl -i.bak -pe 'if (/^Status: [^\s]+ ([^\s]+) ([^\s]+)/) { $_="Status: ".($2 eq "installed" ? "install" : "purge")." $1 $2\n"}' /var/lib/dpkg/status

Remove any lingering packages in your list
dpkg --get-selections|sed -e 's/deinstall$/purge/'|dpkg --set-selections apt-get dselect-upgrade