Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Revert stripping of executable in release mode (#1234)
Browse files Browse the repository at this point in the history
Revert stripping of executable in release mode
  • Loading branch information
lbonn authored and Zee314159 committed Jun 19, 2019
2 parents 6f99217 + 18cb136 commit 8b3702b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ if(FAULT_INJECTION)
endif(FAULT_INJECTION)

# flags for different build types
list(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " -s")

set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
set(CMAKE_C_FLAGS_DEBUG "-Og -g")

Expand Down
3 changes: 2 additions & 1 deletion scripts/build_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export TEST_WITH_TESTSUITE=0

# build and copy aktualizr.deb and garage_deploy.deb to $TEST_INSTALL_DESTDIR
mkdir -p "$TEST_INSTALL_DESTDIR"
"$GITREPO_ROOT/scripts/test.sh"
# note: executables are stripped, following common conventions in .deb packages
LDFLAGS="-s" "$GITREPO_ROOT/scripts/test.sh"

# copy provisioning data and scripts
cp -rf "$GITREPO_ROOT/tests/test_data/prov_selfupdate" "$TEST_INSTALL_DESTDIR"
Expand Down
11 changes: 11 additions & 0 deletions src/aktualizr_repo/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ int main(int argc, char **argv) {
if (command == "generate") {
KeyType key_type = parseKeyType(vm);
repo.generateRepo(key_type);
std::cout << "Uptane metadata repos generated at " << vm["path"].as<boost::filesystem::path>() << std::endl;
} else if (command == "image") {
if (vm.count("targetname") == 0 && vm.count("filename") == 0) {
std::cerr << "image command requires --targetname or --filename\n";
Expand All @@ -102,9 +103,11 @@ int main(int argc, char **argv) {
std::cerr << "Image path doesn't match delegation!\n";
exit(EXIT_FAILURE);
}
std::cout << "added a target to a delegated role" << std::endl;
}
if (vm.count("filename") > 0) {
repo.addImage(vm["filename"].as<boost::filesystem::path>(), targetname, delegation);
std::cout << "added a target to the images metadata" << std::endl;
} else {
if ((vm.count("targetsha256") == 0 && vm.count("targetsha512") == 0) || vm.count("targetlength") == 0) {
std::cerr << "image command requires --targetsha256 or --targetsha512, and --targetlength when --filename "
Expand All @@ -130,6 +133,7 @@ int main(int argc, char **argv) {
custom["targetFormat"] = vm["targetformat"].as<std::string>();
}
repo.addCustomImage(targetname.string(), *hash, vm["targetlength"].as<uint64_t>(), delegation, custom);
std::cout << "added a custom image" << std::endl;
}
} else if (command == "addtarget") {
if (vm.count("targetname") == 0 || vm.count("hwid") == 0 || vm.count("serial") == 0) {
Expand All @@ -138,6 +142,8 @@ int main(int argc, char **argv) {
}
repo.addTarget(vm["targetname"].as<std::string>(), vm["hwid"].as<std::string>(),
vm["serial"].as<std::string>());
std::cout << "prepared direcor targets metadata for a given device: "
<< vm["hwid"].as<std::string>() << " " << vm["serial"].as<std::string>() << std::endl;
} else if (command == "adddelegation") {
if (vm.count("dname") == 0 || vm.count("dpattern") == 0) {
std::cerr << "adddelegation command requires --dname and --dpattern\n";
Expand All @@ -148,18 +154,23 @@ int main(int argc, char **argv) {
repo.addDelegation(Uptane::Role(vm["dname"].as<std::string>(), true),
Uptane::Role(dparent, dparent != "targets"), vm["dpattern"].as<std::string>(),
vm["dterm"].as<bool>(), key_type);
std::cout << "added a delegated role" << std::endl;
} else if (command == "revokedelegation") {
if (vm.count("dname") == 0) {
std::cerr << "revokedelegation command requires --dname\n";
exit(EXIT_FAILURE);
}
repo.revokeDelegation(Uptane::Role(vm["dname"].as<std::string>(), true));
std::cout << "revoked the delegation" << std::endl;
} else if (command == "signtargets") {
repo.signTargets();
std::cout << "signed the director targets metadata" << std::endl;
} else if (command == "emptytargets") {
repo.emptyTargets();
std::cout << "reset the director targets metadata" << std::endl;
} else if (command == "oldtargets") {
repo.oldTargets();
std::cout << "populated the director targets metadata with the currently signed metadata" << std::endl;
} else if (command == "sign") {
if (vm.count("repotype") == 0 || vm.count("keyname") == 0) {
std::cerr << "sign command requires --repotype and --keyname\n";
Expand Down

0 comments on commit 8b3702b

Please sign in to comment.