It sometimes happen at the end of the script that a command depmod which write in some file give an error...

You've to look at this error and find why it happen... in order to modify the command in the script or to comment it

for ex: if you only look for compiling module you don't need to "automate" their loading at boot time ...

But it's hard helping you in sense that i don't know what are the result of your errors...

May you post the error message or tell us which "modem" or driver you want to compil ?