may i know is there anyway i can avoid fleet fetch...
# general
may i know is there anyway i can avoid fleet fetching this to present as value of osquery?
It looks like you are building custom can customize that by setting the
env variable when building it locally as described here
I’m not sure about that but you can choose the version that osquery has to use when you build it, if you want to do a custom build. In that thread Kathy has pointed you to the CMake option that can be overridden while configuring (OSQUERY_VERSION). So when you do
cmake […]
-DOSQUERY_VERSION="<your version>"
ah 😄
but the weird thing is this is the pkg i built by debian flow, and you can see the package info. FVFHP07CQ05Q:Downloads bytedance$ dpkg --info osquery_5.4.0_amd64.deb new Debian package, version 2.0. size 12923020 bytes: control archive=6988 bytes. 43 bytes, 2 lines conffiles 221 bytes, 10 lines control 19298 bytes, 241 lines md5sums 583 bytes, 23 lines * postinst #!/bin/sh Package: osquery Version: 5.4.0 Architecture: amd64 Maintainer: wennan.he Installed-Size: 51166 Depends: sudo, wget Section: admin Priority: extra Homepage:XXX Description: osquery agent you can see the version is 5.4.0. but the present one is another val in fleet.
Yeah I think the wiki has to be updated, there are 2 versions involved, one is for the binary itself and it’s hardcoded into it. That one is provided via cmake and can be seen either via
osqueryd --version
or querying the
Then you have the version the package, which is passed via
as a cmake flag too but when building the
I’m not too sure why we have
as an env var
because it’s not read from there
ah, sorry, it’s that one has to read the whole process; the env var is just there so that later you can do:
Copy code
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DOSQUERY_SOURCE_DIRECTORY_LIST="osquery-src-path;osquery-build-path" \
but otherwise everything is given via CMake options
so you mean if i run cmake -DOSQUERY_PACKAGE_VERSION=${OSQUERY_VERSION} is also working? and i will see OSQUERY_VERSION i setup in fleet page?
That is for the package version itself, Fleet will ignore that because at that point osquery is already installed. What Fleet is picking up is the version hardcoded in the osquery binary, that has to be passed via
but as a CMake flag in the osquery binary configuration process and build
OK, thank you for explain, and is there any way i can setup that osquery_version?
Yes, as I was mentioning here;cid=C08V7KTJB you have to pass that as a CMake flag when you are configuring and building osquery
ok gotta, thx.
i tried but right now the val os osquery of my new built package is still 5.4.0-dirty, looks like "-dirty" means there is commit checked in after last commit of my tag, even i tried to move the tag to cover all my commits, it still doesn't work. any suggestion?
message has been deleted
How have you provided the version to the build?
Because if you use the cmake flag
, then that will override the version with what you’ve passed, so unless somehow you passed that
after the version number, it means to me that you haven’t used
? If you don’t pass it, then
git describe --tags --always --dirty
is what gets used internally. You might want to check again Kathy answer;cid=C01DXJL16D8
Dirty doesn’t mean that you have a commit after the tag, but that you have changes not staged for commit in your working dir
So file changes that have not been committed. You might want to check your source folder with
git status
you have changes not staged for commit in your working dir what does it mean?
i really have some commits
this is my git log
you can see my commit after the last commit of 5.4.0
That’s not how it works. The tag is on the top commit (the last), so
git describe […]
it’s correctly taking 5.4.0; but you don’t have to look there. You have to look at
git status
. When you make a change to a file and not do
git add
to it or fully commit it, that in git parlance is a
change not staged for commit
, or another way to say it is that you have your working tree dirty/not clean
That again means that what you’re building is not actually the state the code would have if you cloned the source code at your tag; there’s some other modification in your source folder which is not tracked
i don't add any change when building osquery but i would generate some temp folders to store all the generated files by build itself. So you mean that is the not staged change?
Have you checked what
git status
i will check it
thx 4 explain.
by the official doc, i will create a folder of build to store these tmp files, would this cause that suffix of dirty?
directory will not cause an issue because that's part of
so it gets ignored
And could anyone help to explain where did the middle part of the name come from?
do you mean the
part? that always comes from
git describe --always --tags --dirty
, but more specifically is the short form of the SHA of the commit the binary has been built from
you can also obtain it with
git rev-parse --short HEAD
And it shows because you’re not on a tag
thx, i am trying to figure out that how to make it align with pervious name like 5.4.0