Description of problem: When more than one -k option is passed to dkms mktarball, only the first has any effect. Error messages indicate the problem: Marking modules for 3.10.0-862.14.4.el7.x86_64 (x86_64) for archiving... /usr/sbin/dkms: line 1677: local: intree_module_dir: readonly variable /usr/sbin/dkms: line 1678: local: temp_module_dir: readonly variable The errors are generated for the 2nd and subsequent iteration of the first "for" loop of the make_tarball() function. Version-Release number of selected component (if applicable): 3.0.2-1.el7 How reproducible: Very Steps to Reproduce: 1. mktarball -m foo -v 1.0 -k 3.10.0-862.14.4.el7.x86_64 -k 3.10.0-957.27.2.el7.x86_64 2. Look in the resulting tarball Actual results: Only the first kernel's modules are included in the tarball Expected results: Modules for all specified kernels should be included. Additional info: It seems to work if the two -r options are removed for the two local variables defined in that first "for" loop of make_tarball(). Shell local variables have function scope, not loop iteration scope.
The same mistake with local -r appears in the last "for" loop of load_tarball(), and causes all but one kernel to be ignored there, with similar error messages from the shell.