Merge pull request #12972 from intelfx/cryptsetup-enable-libcryptsetup-debug
cryptsetup: properly handle libcryptsetup debug logging
This commit is contained in:
+2
-2
@@ -1110,11 +1110,11 @@ void log_parse_environment_realm(LogRealm realm) {
|
||||
|
||||
e = getenv("SYSTEMD_LOG_COLOR");
|
||||
if (e && log_show_color_from_string(e) < 0)
|
||||
log_warning("Failed to parse bool '%s'. Ignoring.", e);
|
||||
log_warning("Failed to parse log color '%s'. Ignoring.", e);
|
||||
|
||||
e = getenv("SYSTEMD_LOG_LOCATION");
|
||||
if (e && log_show_location_from_string(e) < 0)
|
||||
log_warning("Failed to parse bool '%s'. Ignoring.", e);
|
||||
log_warning("Failed to parse log location '%s'. Ignoring.", e);
|
||||
}
|
||||
|
||||
LogTarget log_get_target(void) {
|
||||
|
||||
@@ -637,6 +637,11 @@ static int run(int argc, char *argv[]) {
|
||||
|
||||
log_setup_service();
|
||||
|
||||
crypt_set_log_callback(NULL, cryptsetup_log_glue, NULL);
|
||||
if (DEBUG_LOGGING)
|
||||
/* libcryptsetup won't even consider debug messages by default */
|
||||
crypt_set_debug_level(CRYPT_DEBUG_ALL);
|
||||
|
||||
umask(0022);
|
||||
|
||||
if (streq(argv[1], "attach")) {
|
||||
|
||||
@@ -129,7 +129,8 @@ static int maybe_resize_slave_device(const char *mountpath, dev_t main_devno) {
|
||||
|
||||
#if HAVE_LIBCRYPTSETUP
|
||||
crypt_set_log_callback(NULL, cryptsetup_log_glue, NULL);
|
||||
crypt_set_debug_level(1);
|
||||
if (DEBUG_LOGGING)
|
||||
crypt_set_debug_level(CRYPT_DEBUG_ALL);
|
||||
#endif
|
||||
|
||||
r = get_block_device_harder(mountpath, &devno);
|
||||
|
||||
Reference in New Issue
Block a user