diff options
| -rw-r--r-- | meta/recipes-core/util-linux/util-linux.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-core/util-linux/util-linux/0003-agetty-fix-stdin-conversion-to-tty-name.patch | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc index 4e8701ffdf..cbf148073b 100644 --- a/meta/recipes-core/util-linux/util-linux.inc +++ b/meta/recipes-core/util-linux/util-linux.inc | |||
| @@ -40,6 +40,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin | |||
| 40 | file://fcntl-lock.c \ | 40 | file://fcntl-lock.c \ |
| 41 | file://0001-cfdisk-add-sector-size-commanand-line-option.patch \ | 41 | file://0001-cfdisk-add-sector-size-commanand-line-option.patch \ |
| 42 | file://0002-sfdisk-add-sector-size-commanand-line-option.patch \ | 42 | file://0002-sfdisk-add-sector-size-commanand-line-option.patch \ |
| 43 | file://0003-agetty-fix-stdin-conversion-to-tty-name.patch \ | ||
| 43 | " | 44 | " |
| 44 | 45 | ||
| 45 | SRC_URI[sha256sum] = "5c1daf733b04e9859afdc3bd87cc481180ee0f88b5c0946b16fdec931975fb79" | 46 | SRC_URI[sha256sum] = "5c1daf733b04e9859afdc3bd87cc481180ee0f88b5c0946b16fdec931975fb79" |
diff --git a/meta/recipes-core/util-linux/util-linux/0003-agetty-fix-stdin-conversion-to-tty-name.patch b/meta/recipes-core/util-linux/util-linux/0003-agetty-fix-stdin-conversion-to-tty-name.patch new file mode 100644 index 0000000000..2766ee2c0d --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/0003-agetty-fix-stdin-conversion-to-tty-name.patch | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | From bd6c104f931329ce6fbc5a1250c8c80a1d8223ee Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Karel Zak <kzak@redhat.com> | ||
| 3 | Date: Mon, 24 Feb 2025 13:37:04 +0100 | ||
| 4 | Subject: [PATCH] agetty: fix stdin conversion to tty name | ||
| 5 | |||
| 6 | Addresses: https://github.com/util-linux/util-linux/issues/3304 | ||
| 7 | |||
| 8 | Upstream-Status: Backport | ||
| 9 | [https://github.com/util-linux/util-linux/commit/bd6c104f931329ce6fbc5a1250c8c80a1d8223ee] | ||
| 10 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
| 11 | --- | ||
| 12 | term-utils/agetty.c | 10 +++++++--- | ||
| 13 | 1 file changed, 7 insertions(+), 3 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/term-utils/agetty.c b/term-utils/agetty.c | ||
| 16 | index aa859c27b..0dfe52c90 100644 | ||
| 17 | --- a/term-utils/agetty.c | ||
| 18 | +++ b/term-utils/agetty.c | ||
| 19 | @@ -928,11 +928,15 @@ static void parse_args(int argc, char **argv, struct options *op) | ||
| 20 | |||
| 21 | /* resolve the tty path in case it was provided as stdin */ | ||
| 22 | if (strcmp(op->tty, "-") == 0) { | ||
| 23 | + int fd; | ||
| 24 | + const char *name = op->tty; | ||
| 25 | + | ||
| 26 | op->tty_is_stdin = 1; | ||
| 27 | - int fd = get_terminal_name(NULL, &op->tty, NULL); | ||
| 28 | - if (fd < 0) { | ||
| 29 | + fd = get_terminal_name(NULL, &name, NULL); | ||
| 30 | + if (fd >= 0) | ||
| 31 | + op->tty = name; /* set real device name */ | ||
| 32 | + else | ||
| 33 | log_warn(_("could not get terminal name: %d"), fd); | ||
| 34 | - } | ||
| 35 | } | ||
| 36 | |||
| 37 | /* On virtual console remember the line which is used for */ | ||
| 38 | -- | ||
| 39 | 2.46.2 | ||
| 40 | |||
