diff mbox series

[isar-cip-core,RFC,6/7] swupdate: Add luahandler for secureboot

Message ID 20200625141015.31719-7-Quirin.Gylstorff@siemens.com (mailing list archive)
State Accepted
Headers show
Series secureboot with efibootguard | expand

Commit Message

Gylstorff Quirin June 25, 2020, 2:10 p.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 recipes-core/swupdate/files/swupdate_handlers.lua | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Jan Kiszka June 29, 2020, 8:14 a.m. UTC | #1
On 25.06.20 16:10, Q. Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>   recipes-core/swupdate/files/swupdate_handlers.lua | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/recipes-core/swupdate/files/swupdate_handlers.lua b/recipes-core/swupdate/files/swupdate_handlers.lua
> index c9b9962..f2ecc54 100644
> --- a/recipes-core/swupdate/files/swupdate_handlers.lua
> +++ b/recipes-core/swupdate/files/swupdate_handlers.lua
> @@ -311,8 +311,12 @@ function handler_roundrobin(image)
>           if rootparam and rootdevice then break end
>       end
>       if not rootdevice then
> -      swupdate.error("Cannot determine current root device.")
> -      return 1
> +        -- Use findmnt to get the rootdev
> +      rootdevice = io.popen('findmnt -nl / -o PARTUUID'):read("*l")
> +      if not rootdevice then
> +        swupdate.error("Cannot determine current root device.")
> +        return 1
> +      end
>       end
>       swupdate.info(string.format("Current root device is: %s", rootdevice))
>   
> 

Seems not really specific to secure-boot, rather related to the 
initramfs-based rootfs selection. But is that one actually using 
PARTUUID in the end? Or rather device paths?

Anyway, I'm not against merging this. It should just be correctly 
labeled. Or maybe even merged into the swupdate patch from the first series.

Jan
Gylstorff Quirin June 29, 2020, 9:01 a.m. UTC | #2
On 6/29/20 10:14 AM, Jan Kiszka wrote:
> On 25.06.20 16:10, Q. Gylstorff wrote:
>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>
>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> ---
>>   recipes-core/swupdate/files/swupdate_handlers.lua | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/recipes-core/swupdate/files/swupdate_handlers.lua 
>> b/recipes-core/swupdate/files/swupdate_handlers.lua
>> index c9b9962..f2ecc54 100644
>> --- a/recipes-core/swupdate/files/swupdate_handlers.lua
>> +++ b/recipes-core/swupdate/files/swupdate_handlers.lua
>> @@ -311,8 +311,12 @@ function handler_roundrobin(image)
>>           if rootparam and rootdevice then break end
>>       end
>>       if not rootdevice then
>> -      swupdate.error("Cannot determine current root device.")
>> -      return 1
>> +        -- Use findmnt to get the rootdev
>> +      rootdevice = io.popen('findmnt -nl / -o PARTUUID'):read("*l")
>> +      if not rootdevice then
>> +        swupdate.error("Cannot determine current root device.")
>> +        return 1
>> +      end
>>       end
>>       swupdate.info(string.format("Current root device is: %s", 
>> rootdevice))
>>
> 
> Seems not really specific to secure-boot, rather related to the 
> initramfs-based rootfs selection. But is that one actually using 
> PARTUUID in the end? Or rather device paths?

it uses the partuuid from root. If someone finds a better way to get
the current root without parsing the  kernel commandline I would use
that.
> 
> Anyway, I'm not against merging this. It should just be correctly 
> labeled. Or maybe even merged into the swupdate patch from the first 
> series.

I move the patch to the a/b update patch.

> 
> Jan
>
diff mbox series

Patch

diff --git a/recipes-core/swupdate/files/swupdate_handlers.lua b/recipes-core/swupdate/files/swupdate_handlers.lua
index c9b9962..f2ecc54 100644
--- a/recipes-core/swupdate/files/swupdate_handlers.lua
+++ b/recipes-core/swupdate/files/swupdate_handlers.lua
@@ -311,8 +311,12 @@  function handler_roundrobin(image)
         if rootparam and rootdevice then break end
     end
     if not rootdevice then
-      swupdate.error("Cannot determine current root device.")
-      return 1
+        -- Use findmnt to get the rootdev
+      rootdevice = io.popen('findmnt -nl / -o PARTUUID'):read("*l")
+      if not rootdevice then
+        swupdate.error("Cannot determine current root device.")
+        return 1
+      end
     end
     swupdate.info(string.format("Current root device is: %s", rootdevice))