0

I am new to Buildroot and I am just experimenting with the make, make menuconfig, and make clean commands. I noticed that oftentimes, -dirty will be present at the top of my .config file after changes are saved out of the curses menuconfig. For example:

+# Buildroot 2020.02-gcdd8689-dirty Configuration

I think this has something to do with the build directory state versus the configuration, but the more I look at it, the less sense the behavior of -dirty makes to me. For instance, one time I ran make which built the kernel successfully, followed by make menuconfig. I changed something and saved a new .config out of the dialog. It was not -dirty. So far, so good. Then I re-ran make menuconfig to change something else. After a save, .config was suddenly -dirty.

Does anyone know what this -dirty flag means or how it is computed? I don't want to be committing a dirty configuration file to my repo. I can't seem to find documentation about this anywhere.

Thanks!

rwilliso
  • 11
  • 2
  • The `-dirty` part is appended by `git describe` under conditions documented in [the `git describe` documentation](https://git-scm.com/docs/git-describe); the rest is up to the build process. – torek Aug 10 '21 at 21:48
  • Thanks, this helped a lot! I did not know that Buildroot was interacting with Git. I think the solution to remove `-dirty` in my case is to commit all my files before running "make menuconfig", or to commit my `-dirty` state, re-run make menuconfig, and commit again to eliminate the "-dirty". Does that sound correct? – rwilliso Aug 10 '21 at 22:16

2 Answers2

0

As torek mentioned, this -dirty suffix is added by git describe when invoked in a certain way. It indicates that there are uncommitted changes in the working tree.

You can indeed avoid this by committing changes before running the command. However, it sounds like this file is a generated file, in which case you probably don't want to check it into the repository at all. That's because at least this line is going to change every time you make a commit, and you're going to end up with a lot of potentially unpleasant merge conflicts down the line. If you need to specify a default configuration, it would be better to make this tooling spit one out for you.

bk2204
  • 64,793
  • 6
  • 84
  • 100
0

I use 'savedefconfig' to avoid -dirty, but that needs a couple extra steps:

make arch=XXX platform_y_defconfig
make menuconfig
(you make changes to config)
make arch=XXX savedefconfig
cp defconfig arch/XXX/configs/platform_y_defconfig
git add -u ; git commit -m"updated defconfig"
Joe Kul
  • 2,454
  • 16
  • 16