From: Donald Zickus <dzickus@xxxxxxxxxx> Date: Wed, 12 Jul 2023 09:58:35 -0400 > Resending without the html cruft to pass through the linux-kbuild mail daemon > > ---------- Forwarded message --------- > From: Donald Zickus <dzickus@xxxxxxxxxx> > Date: Tue, Jul 11, 2023 at 6:27 PM > Subject: Looking for a hack to remove auto-selected items from .config output > To: <masahiroy@xxxxxxxxxx> > Cc: <linux-kbuild@xxxxxxxxxxxxxxx> > > > Hi Masahiro, > > I am trying to cleanup some stale config data with some of the Red Hat > configs. Like most distros, Red Hat sets a bunch of 'menu choice' > configs and then merges them together then runs something like 'make > olddefconfig' to autoselect the rest of the configs. Been working > great for many years. > > Lately, we are trying to audit the configs and ran into many stale Red > Hat set configs that no longer exist upstream (removed, renamed, > whatever). Ok, running a script detects these and we can remove them > by hand. > > One corner case we ran into is dropping configs. Like upstream we try > and match the merged configs with the final setting from 'make > olddefconfig' and fail if there is a mismatch. However, not every > config is applicable to every arch, so those configs are dropped and > we were always ok with it. But now those dropped configs are > confusing folks who think configs are set but they are really dropped. > Yes, a Red Hat problem. > > I am trying to untangle this. Is there a hack I can use that takes a > generated .config file and removes all the 'selected' and 'implied' > options out? Leaving me with just the minimum configs that need to be > set? Then I can de-merge it and re-create our original set config `make savedefconfig`? It saves a very minimal config with only manually selectable entries, which differ from the default config. IOW, if you take the default config and then change only CONFIG_FOO, your config saved via this command will contain 1 entry, even if _FOO also automatically selects _BAR. > options. Basically reversing the normal config generating process, I > think. > > Not looking for anything complicated, just something simple I can quickly apply. > > Thoughts? > > Cheers, > Don > > Thanks, Olek