Skip to content

Commit

Permalink
rework version info injection
Browse files Browse the repository at this point in the history
  • Loading branch information
RehabMan committed Sep 4, 2015
1 parent 6a6e6bf commit 3ccd00a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
13 changes: 9 additions & 4 deletions ACPIDebug.xcodeproj/project.pbxproj
Expand Up @@ -235,6 +235,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"DEBUG_MSG=1",
"LOGNAME=\\\"${LOGNAME}\\\"",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
Expand All @@ -249,6 +250,7 @@
"OTHER_LDFLAGS[arch=x86_64]" = "-dead_strip";
SDKROOT = macosx10.8;
STRIP_STYLE = "non-global";
SYMROOT = build/Products;
};
name = Debug;
};
Expand All @@ -260,6 +262,10 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_POSTPROCESSING = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"LOGNAME=\\\"${LOGNAME}\\\"",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
Expand All @@ -272,19 +278,19 @@
"OTHER_LDFLAGS[arch=x86_64]" = "-dead_strip";
SDKROOT = macosx10.8;
STRIP_STYLE = "non-global";
SYMROOT = build/Products;
};
name = Release;
};
0C4B239114598AD20080D960 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 0.1.3;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ACPIDebug/ACPIDebug-Prefix.pch";
INFOPLIST_FILE = "ACPIDebug/ACPIDebug-Info.plist";
MODULE_NAME = com.rehabman.driver.ACPIDebug;
MODULE_VERSION = 0.1.3;
MODULE_VERSION = 0.1.4;
PRODUCT_NAME = ACPIDebug;
PROVISIONING_PROFILE = "";
STRIP_INSTALLED_PRODUCT = YES;
Expand All @@ -295,12 +301,11 @@
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 0.1.3;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ACPIDebug/ACPIDebug-Prefix.pch";
INFOPLIST_FILE = "ACPIDebug/ACPIDebug-Info.plist";
MODULE_NAME = com.rehabman.driver.ACPIDebug;
MODULE_VERSION = 0.1.3;
MODULE_VERSION = 0.1.4;
PRODUCT_NAME = ACPIDebug;
PROVISIONING_PROFILE = "";
STRIP_INSTALLED_PRODUCT = YES;
Expand Down
4 changes: 0 additions & 4 deletions ACPIDebug/ACPIDebug-Info.plist
Expand Up @@ -28,10 +28,6 @@
<dict>
<key>ACPI Debug</key>
<dict>
<key>RM,Version</key>
<string>${PRODUCT_NAME} ${MODULE_VERSION}</string>
<key>RM,Build</key>
<string>${CONFIGURATION}-${LOGNAME}</string>
<key>CFBundleIdentifier</key>
<string>${MODULE_NAME}</string>
<key>IOClass</key>
Expand Down
15 changes: 15 additions & 0 deletions ACPIDebug/ACPIDebug.cpp
Expand Up @@ -19,6 +19,7 @@
*
*/

#include <libkern/version.h>
#include <IOKit/IOCommandGate.h>
#include "ACPIDebug.h"

Expand Down Expand Up @@ -85,6 +86,20 @@ bool ACPIDebug::start(IOService *provider)
{
DEBUG_LOG("ACPIDebug::start: called\n");

// announce version
extern kmod_info_t kmod_info;
IOLog("ACPIDebug: Version %s starting on OS X Darwin %d.%d.\n", kmod_info.version, version_major, version_minor);

// place version/build info in ioreg properties RM,Build and RM,Version
char buf[128];
snprintf(buf, sizeof(buf), "%s %s", kmod_info.name, kmod_info.version);
setProperty("RM,Version", buf);
#ifdef DEBUG
setProperty("RM,Build", "Debug-" LOGNAME);
#else
setProperty("RM,Build", "Release-" LOGNAME);
#endif

m_pDevice = OSDynamicCast(IOACPIPlatformDevice, provider);
if (NULL == m_pDevice || !super::start(provider))
return false;
Expand Down
9 changes: 5 additions & 4 deletions makefile
Expand Up @@ -2,6 +2,7 @@

KEXT=ACPIDebug.kext
DIST=RehabMan-Debug
BUILDDIR=./Build/Products
INSTDIR=/System/Library/Extensions

ifeq ($(findstring 32,$(BITS)),32)
Expand Down Expand Up @@ -30,23 +31,23 @@ update_kernelcache:
.PHONY: install_debug
install_debug:
sudo rm -Rf $(INSTDIR)/$(KEXT)
sudo cp -R ./Build/Debug/$(KEXT) $(INSTDIR)
sudo cp -R $(BUILDDIR)/Debug/$(KEXT) $(INSTDIR)
if [ "`which tag`" != "" ]; then sudo tag -a Purple $(INSTDIR)/$(KEXT); fi
make update_kernelcache

.PHONY: install
install:
sudo rm -Rf $(INSTDIR)/$(KEXT)
sudo cp -R ./Build/Release/$(KEXT) $(INSTDIR)
sudo cp -R $(BUILDDIR)/Release/$(KEXT) $(INSTDIR)
if [ "`which tag`" != "" ]; then sudo tag -a Blue $(INSTDIR)/$(KEXT); fi
make update_kernelcache

.PHONY: distribute
distribute:
if [ -e ./Distribute ]; then rm -r ./Distribute; fi
mkdir ./Distribute
#cp -R ./Build/Debug ./Distribute
cp -R ./Build/Release ./Distribute
#cp -R $(BUILDDIR)/Debug ./Distribute
cp -R $(BUILDDIR)/Release ./Distribute
find ./Distribute -path *.DS_Store -delete
find ./Distribute -path *.dSYM -exec echo rm -r {} \; >/tmp/org.voodoo.rm.dsym.sh
chmod +x /tmp/org.voodoo.rm.dsym.sh
Expand Down

0 comments on commit 3ccd00a

Please sign in to comment.