|
|
@ -169,6 +169,10 @@ function OTAManager:_buildLocalPackage()
|
|
|
|
if lfs.attributes(installed_package, "mode") == "file" then
|
|
|
|
if lfs.attributes(installed_package, "mode") == "file" then
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if lfs.attributes(self.package_indexfile, "mode") ~= "file" then
|
|
|
|
|
|
|
|
logger.err("Missing ota metadata:", self.package_indexfile)
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
end
|
|
|
|
if Device:isAndroid() then
|
|
|
|
if Device:isAndroid() then
|
|
|
|
return os.execute(string.format(
|
|
|
|
return os.execute(string.format(
|
|
|
|
"./tar cvf %s -T %s --no-recursion",
|
|
|
|
"./tar cvf %s -T %s --no-recursion",
|
|
|
@ -182,11 +186,14 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function OTAManager:zsync()
|
|
|
|
function OTAManager:zsync()
|
|
|
|
if self:_buildLocalPackage() == 0 then
|
|
|
|
if self:_buildLocalPackage() == 0 then
|
|
|
|
return os.execute(string.format(
|
|
|
|
return os.execute(
|
|
|
|
"./zsync -i %s -o %s -u %s %s",
|
|
|
|
("./zsync -i %s -o %s -u %s %s%s"):format(
|
|
|
|
self.installed_package, self.updated_package,
|
|
|
|
self.installed_package,
|
|
|
|
self:getOTAServer(), ota_dir .. self:getZsyncFilename()
|
|
|
|
self.updated_package,
|
|
|
|
))
|
|
|
|
self:getOTAServer(),
|
|
|
|
|
|
|
|
ota_dir,
|
|
|
|
|
|
|
|
self:getZsyncFilename())
|
|
|
|
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|