Currently, grub-mkstandalone includes all modules in memdisk. It would be nice to be able to include only the specified modules, with automatic dependency resolution.

It is not hard to do even in a wrapper script, without access to dependency resolution routines. I do something like this before invoking grub-mkimage ($moddir is a temporary directory for building memdisk, $mods is the list of modules):