Hi Philip, >So far I've failed to persuade this code to leave a mktemp generated >name in /etc (or elsewhere), so I'm obviously not running it in the >correct context. Please explain the circumstances under which this bug >can be reproduced.
The answer to this lies here[1]. If the `if` condition is run, the `cached_*.kmap.gz` file is used from `etc/console-setup`. If the `else` condition is run, a temp file is created `tmpkbd.*` is created. The control variable (`KMAP`) for the above mentioned `if` condition comes from here[2]. `KMAP` is set to the value of `cached` which is set here[3]. Its essentially down to the existence of this `cached` file in `/etc/console-setup` which is controlling the creation of the temp file (`tmpkbd.*`) in question. >Even so, I'm dubious about the way this is being fixed, because it seems >to me that a randomly named file seems unlikely to be used by anything >for its configuration, so I'm left wondering why it's being saved at all. This temporary file is being referenced in a script named `setupcon`(which is generated here[4]) under the `/bin` directory within the "setup-dir" specified. The name of the temporary file would be updated in the `/bin/setupcon` script for everyrun. >Have we actually established why the file is being saved? Based on the intended use [5] of the "--setup-dir" option in setupcon, my understanding is that the option is meant to used for initrd where the loading of the config file (tmpkbd.* or cached_*.kmap) happens via scripts in the initrd stage. Hence the need to store the configs in a file (like tmpkbd.* etc) Apologies for the long answer. Hope this clarifies your initial queries. Having said this, the most recent patch I shared does not handle the case where a `cached_*.kmap.gz` file is saved in the setup directory. Please find a revised patch to handle this case as well. [1] https://salsa.debian.org/installer-team/console-setup/-/blob/master/setupcon?ref_type=heads#L1179 [2] https://salsa.debian.org/installer-team/console-setup/-/blob/master/setupcon?ref_type=heads#L1172 [3] https://salsa.debian.org/installer-team/console-setup/-/blob/master/setupcon?ref_type=heads#L882 [4] https://salsa.debian.org/installer-team/console-setup/-/blob/master/setupcon?ref_type=heads#L1286 [5] https://manpages.debian.org/testing/console-setup/setupcon.1.en.html#setup-dir Thanks and Regards, Adithya Balakumar ________________________________ From: Philip Hands <p...@hands.com> Sent: Monday, May 26, 2025 8:52 PM To: balakumar adithya(TSIP DITC_DIT-OST) <adithya.balaku...@toshiba-tsip.com>; 977...@bugs.debian.org <977...@bugs.debian.org>; an...@lml.bas.bg <an...@lml.bas.bg> Cc: dinesh kumar(TSIP DITC_DIT-OST) <dinesh.ku...@toshiba-tsip.com>; kunijadar shivanand(TSIP DITC_DIT-OST) <shivanand.kunija...@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 □DITC○CPT) <kazuhiro3.haya...@toshiba.co.jp>; yoshida toshiko(吉田 敏子 □DITC○OSPO) <toshiko.yosh...@toshiba.co.jp> Subject: Re: Bug#977877: console-setup: setupcon --setup-dir ... generates temporary file name inside etc/console-setup directory <adithya.balaku...@toshiba-tsip.com> writes: > Hi Anton, > > Apologies for my late reply. > >> I don't feel myself competent to answer this question. > > You are listed as the maintainer of the console-setup package under > packages.debian.org [1]. Hence the question. Is the package maintained by > someone else now ? > On that note, I have also proposed the same patch shared before in this mail > thread as a MR [2] to the console-setup salsa repository as well. But no > feedback for the MR yet. > > Any suggestions on how to proceed would be helpful. So far I've failed to persuade this code to leave a mktemp generated name in /etc (or elsewhere), so I'm obviously not running it in the correct context. Please explain the circumstances under which this bug can be reproduced. Even so, I'm dubious about the way this is being fixed, because it seems to me that a randomly named file seems unlikely to be used by anything for its configuration, so I'm left wondering why it's being saved at all. Have we actually established why the file is being saved? If not, I really think we should do that before changing things, because either it is currently being used for something, and we need to know what for to be sure that switching to a fixed name is totally OK, or it is not actually being used for anything, in which case the correct way to fix the entropy issue would be to simply stop saving the file. Cheers, Phil. -- Philip Hands -- https://hands.com/~phil
0001-setupcon-Copy-temp-files-into-etc-console-setup-with.patch
Description: 0001-setupcon-Copy-temp-files-into-etc-console-setup-with.patch