Installing new kernel within Linux kickstart
I have to build a Ubuntu installer ISO using the kickstart utility but I need the installer to install a particular version of kernel. Here is the link for a quick guide on setting up Ubuntu kickstart. First, I added the following line into %packages section in the installer build script to install the target kernel package, ks.cfg:
%packages @ ubuntu-server linux-image-3.5.0-39
But this produces a boot error with kernel panic from the new installed Ubuntu system.
kernel panic-not syncing: VFS: unable to mount root fs on unknown block(0,0)
This is because the grub update for the default kernel hasn’t been performed yet during the %packages stage (The grub update is performed after %packages and before the %post stages). So the kernel update should be placed within the post installation stage. This will resolve the above boot error.
%post --interpreter /bin/bash dpkg -i /media/cdrom/pool/extras/linux-image-3.5.0-39-generic_3.5.0-39.60_amd64.deb
The above dpkg line is basically to install the kernel image package file pre-packed inside the installer ISO. So that the installer can work straight offline. For details on how to create an installer ISO with pre-packed packges, see this link.