So I tweaked this a bit trying to get it to work:
require ("swupdate")
function kobs_ng_lua(image)
local spl_img_path, part_erase_cmd, part_write_cmd, err, msg
spl_img_path = string.format("%s/%s", "/tmp", tostring(image.filename))
part_erase_cmd = string.format("flash_erase %s 0 0", image.device)
part_write_cmd = string.format("kobs-ng init
--chip_0_device_path=%s -x %s --search_exponent=1", image.device,
spl_img_path)
err, msg = image:copy2file(spl_img_path)
if err ~= 0 then
swupdate.error(string.format("Failed to copy image %s to %s:
%s!", tostring(image.filename), spl_img_path, msg))
return 1
end
err = os.execute(part_erase_cmd)
if not err then
swupdate.error(string.format("Error: %s return %s!",
part_erase_cmd, tostring(err)))
return 1
end
err = os.execute(part_write_cmd)
if not err then
swupdate.error(string.format("Error: %s return %s!",
part_write_cmd, tostring(err)))
return 1
end
return 0
end
swupdate.register_handler("kobs-ng", kobs_ng_lua,
swupdate.HANDLER_MASK.IMAGE_HANDLER)
However I'm getting a sha256 mismatch error somehow:
[TRACE] : SWUPDATE running : [install_single_image] : Found installer
for stream SPL kobs-ng
[ERROR] : SWUPDATE failed [0] ERROR cpio_utils.c : __swupdate_copy :
637 : HASH mismatch :
aa57483e484f97b0e37fa7038eee98cfb09875e68f0000bebfed130140ead238 <-->
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
[ERROR] : SWUPDATE failed [0] ERROR lua_interface.c : notify_helper :
730 : Failed to copy image SPL to /tmp/SPL: Success!
[TRACE] : SWUPDATE running : [l_handler_wrapper] : [Lua handler] returned: 1
[TRACE] : SWUPDATE running : [install_single_image] : Installer for
kobs-ng not successful !
When used with this image node:{
filename = "SPL";
device = "/dev/mtd0";
type = "kobs-ng";
sha256 = "@SPL";
},
Anyone have any idea how I would be hitting a sha256 error like this?
I'm pretty sure the sha256 is correct as it validates correctly with
the flash handler.
> To unsubscribe from this group and stop receiving emails from it, send an email to
swupdate+u...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/swupdate/6e333956-409a-4726-854b-e41b9e53469dn%40googlegroups.com.