[2/2] Revert "events: Do not warn on left mounts by default"

Message ID 20241002203156.149572-3-florian.bezdeka@siemens.com
State Superseded, archived
Headers show
Series Fix leftover mounts in rootfs.bbclass | expand

Commit Message

Florian Bezdeka Oct. 2, 2024, 8:31 p.m. UTC
This reverts commit 72ec986d9cd3a3913e8592554456d5968d6b659a.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 meta/classes/isar-events.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Kiszka Oct. 3, 2024, 7:25 a.m. UTC | #1
On 02.10.24 22:31, 'Florian Bezdeka' via isar-users wrote:
> This reverts commit 72ec986d9cd3a3913e8592554456d5968d6b659a.
> 

This needs reasoning why the original motivation for this change no
longer applies or was wrong.

Jan

> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> ---
>  meta/classes/isar-events.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass
> index f5061a8b..77dfecee 100644
> --- a/meta/classes/isar-events.bbclass
> +++ b/meta/classes/isar-events.bbclass
> @@ -53,7 +53,7 @@ python build_completed() {
>      with open('/proc/mounts') as f:
>          for line in f.readlines():
>              if basepath in line:
> -                bb.debug(1, '%s left mounted, unmounting...' % line.split()[1])
> +                bb.warn('%s left mounted, unmounting...' % line.split()[1])
>                  subprocess.call(
>                      ["sudo", "umount", line.split()[1]],
>                      stdout=subprocess.DEVNULL,
Anton Mikanovich Oct. 3, 2024, 7:42 a.m. UTC | #2
03/10/2024 10:25, 'Jan Kiszka' via isar-users wrote:
> On 02.10.24 22:31, 'Florian Bezdeka' via isar-users wrote:
>> This reverts commit 72ec986d9cd3a3913e8592554456d5968d6b659a.
>>
> This needs reasoning why the original motivation for this change no
> longer applies or was wrong.
>
> Jan
>
>> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
>> ---
>>   meta/classes/isar-events.bbclass | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass
>> index f5061a8b..77dfecee 100644
>> --- a/meta/classes/isar-events.bbclass
>> +++ b/meta/classes/isar-events.bbclass
>> @@ -53,7 +53,7 @@ python build_completed() {
>>       with open('/proc/mounts') as f:
>>           for line in f.readlines():
>>               if basepath in line:
>> -                bb.debug(1, '%s left mounted, unmounting...' % line.split()[1])
>> +                bb.warn('%s left mounted, unmounting...' % line.split()[1])
>>                   subprocess.call(
>>                       ["sudo", "umount", line.split()[1]],
>>                       stdout=subprocess.DEVNULL,

The motivation of original change was discussed here:
https://groups.google.com/g/isar-users/c/mz-7DWob0O0/m/8hLr6cw4AgAJ
Jan Kiszka Oct. 10, 2024, 4:33 a.m. UTC | #3
On 03.10.24 09:42, Anton Mikanovich wrote:
> 03/10/2024 10:25, 'Jan Kiszka' via isar-users wrote:
>> On 02.10.24 22:31, 'Florian Bezdeka' via isar-users wrote:
>>> This reverts commit 72ec986d9cd3a3913e8592554456d5968d6b659a.
>>>
>> This needs reasoning why the original motivation for this change no
>> longer applies or was wrong.
>>
>> Jan
>>
>>> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
>>> ---
>>>   meta/classes/isar-events.bbclass | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-
>>> events.bbclass
>>> index f5061a8b..77dfecee 100644
>>> --- a/meta/classes/isar-events.bbclass
>>> +++ b/meta/classes/isar-events.bbclass
>>> @@ -53,7 +53,7 @@ python build_completed() {
>>>       with open('/proc/mounts') as f:
>>>           for line in f.readlines():
>>>               if basepath in line:
>>> -                bb.debug(1, '%s left mounted, unmounting...' %
>>> line.split()[1])
>>> +                bb.warn('%s left mounted, unmounting...' %
>>> line.split()[1])
>>>                   subprocess.call(
>>>                       ["sudo", "umount", line.split()[1]],
>>>                       stdout=subprocess.DEVNULL,
> 
> The motivation of original change was discussed here:
> https://groups.google.com/g/isar-users/c/mz-7DWob0O0/m/8hLr6cw4AgAJ
> 

Exactly. I wonder if we cannot limit bb.warn to error-free build
completion, somehow. On build errors, this remains a cleanup that should
not warn.

Jan

Patch

diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass
index f5061a8b..77dfecee 100644
--- a/meta/classes/isar-events.bbclass
+++ b/meta/classes/isar-events.bbclass
@@ -53,7 +53,7 @@  python build_completed() {
     with open('/proc/mounts') as f:
         for line in f.readlines():
             if basepath in line:
-                bb.debug(1, '%s left mounted, unmounting...' % line.split()[1])
+                bb.warn('%s left mounted, unmounting...' % line.split()[1])
                 subprocess.call(
                     ["sudo", "umount", line.split()[1]],
                     stdout=subprocess.DEVNULL,