File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed
Documentation/admin-guide Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -209,15 +209,22 @@ Configuring the kernel
209
209
store the lsmod of that machine into a file
210
210
and pass it in as a LSMOD parameter.
211
211
212
+ Also, you can preserve modules in certain folders
213
+ or kconfig files by specifying their paths in
214
+ parameter LMC_KEEP.
215
+
212
216
target$ lsmod > /tmp/mylsmod
213
217
target$ scp /tmp/mylsmod host:/tmp
214
218
215
- host$ make LSMOD=/tmp/mylsmod localmodconfig
219
+ host$ make LSMOD=/tmp/mylsmod \
220
+ LMC_KEEP="drivers/usb:drivers/gpu:fs" \
221
+ localmodconfig
216
222
217
223
The above also works when cross compiling.
218
224
219
225
"make localyesconfig" Similar to localmodconfig, except it will convert
220
- all module options to built in (=y) options.
226
+ all module options to built in (=y) options. You can
227
+ also preserve modules by LMC_KEEP.
221
228
222
229
"make kvmconfig" Enable additional options for kvm guest kernel support.
223
230
Original file line number Diff line number Diff line change @@ -123,7 +123,9 @@ help:
123
123
@echo ' gconfig - Update current config utilising a GTK+ based front-end'
124
124
@echo ' oldconfig - Update current config utilising a provided .config as base'
125
125
@echo ' localmodconfig - Update current config disabling modules not loaded'
126
+ @echo ' except those preserved by LMC_KEEP environment variable'
126
127
@echo ' localyesconfig - Update current config converting local mods to core'
128
+ @echo ' except those preserved by LMC_KEEP environment variable'
127
129
@echo ' defconfig - New config with default from ARCH supplied defconfig'
128
130
@echo ' savedefconfig - Save current config as ./defconfig (minimal config)'
129
131
@echo ' allnoconfig - New config where all options are answered with no'
Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ sub read_config {
143
143
my %selects ;
144
144
my %prompts ;
145
145
my %objects ;
146
+ my %config2kfile ;
146
147
my $var ;
147
148
my $iflevel = 0;
148
149
my @ifdeps ;
@@ -201,6 +202,7 @@ sub read_kconfig {
201
202
if (/ ^\s *(menu)?config\s +(\S +)\s *$ / ) {
202
203
$state = " NEW" ;
203
204
$config = $2 ;
205
+ $config2kfile {" CONFIG_$config " } = $kconfig ;
204
206
205
207
# Add depends for 'if' nesting
206
208
for (my $i = 0; $i < $iflevel ; $i ++) {
@@ -591,6 +593,20 @@ sub loop_select {
591
593
}
592
594
593
595
my %setconfigs ;
596
+ my @preserved_kconfigs = split (/ :/ ,$ENV {LMC_KEEP });
597
+
598
+ sub in_preserved_kconfigs {
599
+ my $kconfig = $config2kfile {$_ [0]};
600
+ if (!defined ($kconfig )) {
601
+ return 0;
602
+ }
603
+ foreach my $excl (@preserved_kconfigs ) {
604
+ if ($kconfig =~ / ^$excl / ) {
605
+ return 1;
606
+ }
607
+ }
608
+ return 0;
609
+ }
594
610
595
611
# Finally, read the .config file and turn off any module enabled that
596
612
# we could not find a reason to keep enabled.
@@ -644,6 +660,11 @@ sub loop_select {
644
660
}
645
661
646
662
if (/ ^(CONFIG.*)=(m|y)/ ) {
663
+ if (in_preserved_kconfigs($1 )) {
664
+ dprint " Preserve config $1 " ;
665
+ print ;
666
+ next ;
667
+ }
647
668
if (defined ($configs {$1 })) {
648
669
if ($localyesconfig ) {
649
670
$setconfigs {$1 } = ' y' ;
You can’t perform that action at this time.
0 commit comments