From: Lennart Poettering Date: Thu, 18 Sep 2025 07:30:57 +0000 (+0200) Subject: kernel-install: when listing kernels sort them by version X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F38983%2Fhead;p=thirdparty%2Fsystemd.git kernel-install: when listing kernels sort them by version --- diff --git a/src/kernel-install/kernel-install.c b/src/kernel-install/kernel-install.c index a2faa0f8506..c9ea1f15745 100644 --- a/src/kernel-install/kernel-install.c +++ b/src/kernel-install/kernel-install.c @@ -1368,7 +1368,7 @@ static int verb_inspect(int argc, char *argv[], void *userdata) { TABLE_FIELD, "Entry Directory", TABLE_STRING, c->entry_dir, TABLE_FIELD, "Kernel Version", - TABLE_STRING, c->version, + TABLE_VERSION, c->version, TABLE_FIELD, "Kernel", TABLE_STRING, c->kernel, TABLE_FIELD, "Initrds", @@ -1430,6 +1430,7 @@ static int verb_list(int argc, char *argv[], void *userdata) { table_set_ersatz_string(table, TABLE_ERSATZ_DASH); table_set_align_percent(table, table_get_cell(table, 0, 1), 100); + (void) table_set_sort(table, (size_t) 0); FOREACH_ARRAY(d, de->entries, de->n_entries) { _cleanup_free_ char *j = path_join("/usr/lib/modules/", (*d)->d_name); @@ -1460,7 +1461,7 @@ static int verb_list(int argc, char *argv[], void *userdata) { exists = true; r = table_add_many(table, - TABLE_STRING, (*d)->d_name, + TABLE_VERSION, (*d)->d_name, TABLE_BOOLEAN_CHECKMARK, exists, TABLE_SET_COLOR, ansi_highlight_green_red(exists), TABLE_PATH, j);