Created attachment 852088 [details] patch (not tested yet) Outsourcing more of the details out of the kernel scripts might be worthwhile. Here is a draft patch that combines the scripts