Title
#macos
a

asparamancer

06/24/2020, 6:18 PM
when building osquery from source, is it possible to customise the build script to add postflight scripts (eg move the plist & load it) if so, where is the build script?
s

seph

06/24/2020, 6:24 PM
The package built? That’s cmake’s
cpack
does that. I’m not sure what customizing options you have. I tend to just make my own packages.
a

alessandrogario

06/24/2020, 6:26 PM
You can update the packaging.cmake file and add
set(CPACK_PREFLIGHT_APPLICATIONBUNDLE_SCRIPT "/path/to/preflight.sh")
set(CPACK_POSTFLIGHT_APPLICATIONBUNDLE_SCRIPT "/path/to/postflight.sh")
6:27 PM
not familiar with how we handle packaging on macOS; if we already have those two files you may have to edit them
a

asparamancer

06/24/2020, 6:38 PM
thank you, I can't see it is set in the current cmake file - will test it out though
5:43 PM
@alessandrogario do I need to put that in a specific bit of the packaging.cmake file for macos packages? so far It's not executing for me - at this point just trying to get it to run the included
osqueryctl start
a

alessandrogario

06/25/2020, 5:55 PM
It should be inside an if(PLATFORM_MACOS) block, like here: https://github.com/osquery/osquery/blob/master/cmake/packaging.cmake#L367
5:55 PM
then the
make package
command should import those two files in the .pkg
a

asparamancer

06/25/2020, 6:02 PM
thank you, had them in the wrong block