Friday, December 5, 2008

mkisofs(8) and HEAD

For reasons that I cannot remember, I needed to make a basic livecd from NetBSD -current to test some behaviour with the new modules style. Interestingly this triggered a problem with the bootloader not finding the modules at its standard path: /stand/arch/version/modules.

On HEAD for a while now, the GENERIC kernel hasn't built in the file systems by default; instead they are provided as modules and NetBSD's bootloader autoloads the required one. That works very fine currently for ffs, but not for ISO 9660 images built with mkisofs(8) with default options!

The root of the problem comes from the ISO 9660 level: by default mkisofs(8) uses level 1 and it only allows 8.3 file names (8 + 3 for the extension), as well as only a single dot in between; a leading dot is not allowed either. Also internally the ISO 9660 file system, converts all dots to underscores, so with default modules path (/stand/i386/5.99.4/modules), the bootloader is not able to find the module and the livecd is not able to mount the root file system.

After looking at makefs(8) I've found that to build the installcd, the allow-multidot option is required, as well as ISO level 2. Knowing this I've looked at the mkisofs(8) manpage and there's an option for exactly specify the ISO level; NOTE: if using mkisofs(8) you should only use -iso-level 2 exactly, don't use any other, it won't work.

In summary, if you want to build an ISO image with mkisofs(8) for booting NetBSD, now it's required to use the following options: -allow-multidot -iso-level 2.

No comments: