Pelagicore / meta-pelux

PELUX is an open source, GENIVI compliant development platform that supports the Qt Automotive Suite
https://pelux.io
MIT License
39 stars 28 forks source link

swupdate: run as a service #259

Closed TSAnsari closed 5 years ago

TSAnsari commented 5 years ago

Signed-off-by: Tariq Ansari tansari@luxoft.com

sashko commented 5 years ago

Did you write or copied those lua scripts from somewhere?

TSAnsari commented 5 years ago

The scripts are from before. They had preinst function implemented. I have only added postinst function to them. Also split the single emmcsetup.lua scripts into 2 emmcsetup1.lua and emmcsetup2.lua as logic in postinst changes for different partitions.

And there was no way of creating a helper lua script that contained common functionality, hence, this duplication of code.

TSAnsari commented 5 years ago

There are a lot of duplicate code (lua-code). Would it be possible to refactor the code/files, and put the duplicate code into a file with common functions taking the variants as arguments?

Yes I tried to find a way to refactor code to so that there is no duplication. But its not possible to add a common helper lua file based on the swupdate design. We can only add one lua file per handler. So everything needs to be in that file. I discussed this with swupdate author and his reply was this is not supported.