{"action":"opened","issue":{"url":"https://api.github.com/repos/UltimateHackingKeyboard/agent/issues/681","repository_url":"https://api.github.com/repos/UltimateHackingKeyboard/agent","labels_url":"https://api.github.com/repos/UltimateHackingKeyboard/agent/issues/681/labels{/name}","comments_url":"https://api.github.com/repos/UltimateHackingKeyboard/agent/issues/681/comments","events_url":"https://api.github.com/repos/UltimateHackingKeyboard/agent/issues/681/events","html_url":"https://github.com/UltimateHackingKeyboard/agent/issues/681","id":333363809,"node_id":"MDU6SXNzdWUzMzMzNjM4MDk=","number":681,"title":"blhost segfaults","user":{"login":"mondalaci","id":300402,"node_id":"MDQ6VXNlcjMwMDQwMg==","avatar_url":"https://avatars3.githubusercontent.com/u/300402?v=4","gravatar_id":"","url":"https://api.github.com/users/mondalaci","html_url":"https://github.com/mondalaci","followers_url":"https://api.github.com/users/mondalaci/followers","following_url":"https://api.github.com/users/mondalaci/following{/other_user}","gists_url":"https://api.github.com/users/mondalaci/gists{/gist_id}","starred_url":"https://api.github.com/users/mondalaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mondalaci/subscriptions","organizations_url":"https://api.github.com/users/mondalaci/orgs","repos_url":"https://api.github.com/users/mondalaci/repos","events_url":"https://api.github.com/users/mondalaci/events{/privacy}","received_events_url":"https://api.github.com/users/mondalaci/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-18T17:24:20Z","updated_at":"2018-06-18T17:24:20Z","closed_at":null,"author_association":"MEMBER","body":"The firmware update process of Agent calls a command line utility called blhost. This utility is critical for the firmware update to be successful. Apparently, on some machines blhost segfaults for some reason, making the firmware update unsuccesful.\r\n\r\nYou can easily tell if blhost is the culprit. Consider the following firmware update log:\r\n\r\n```\r\n[00:51:25.742] [blhost] RUN: /tmp/.mount_UHK.Agp1hZSj/app/resources/packages/blhost/linux/x86_64/blhost --usb 0x1d50,0x6120 flash-security-disable 0403020108070605\r\n[00:51:25.750] [blhost] EXIT_CODE: null\r\n[00:51:25.750] [blhost] FINISHED: null\r\n```\r\n\r\nblhost should never return with null. If it does, it has most likely segfaulted. There is an easy and a hard way to solve this.\r\n\r\nThe easy way is to try to build blhost on your operating system, instead of using the binary provided by Agent. This may or may not work, but it's worth a try. You can clone the [UHK booltloader repo](https://github.com/UltimateHackingKeyboard/bootloader), then run `make` in its `validation/blhost/gcc` directory. Then according to your firmware update log, overwrite the blhost binary provided by Agent with your compiled version. In the above example blhost is located at `/tmp/.mount_UHK.Agp1hZSj/app/resources/packages/blhost/linux/x86_64/blhost`. Then retry the firmware update. You're welcome to let me know if it works.\r\n\r\nThe hard way is to reimplement blhost in TypeScript and make it a part of Agent. To be more exact, I'll reimplement [pyKBoot](https://github.com/molejar/pyKBoot) it also implements the KBOOT protocol, and  being written in Python, it's so much more readable than blhost. I'm confident that this will work, but it'll take me some time."}}
{"actor":{"display_login":"mondalaci"}}