{"action":"created","issue":{"url":"https://api.github.com/repos/sedutil/sedutil/issues/21","repository_url":"https://api.github.com/repos/sedutil/sedutil","labels_url":"https://api.github.com/repos/sedutil/sedutil/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/sedutil/sedutil/issues/21/comments","events_url":"https://api.github.com/repos/sedutil/sedutil/issues/21/events","html_url":"https://github.com/sedutil/sedutil/issues/21","id":243130092,"number":21,"title":"Buildsystem refactoring and speedup by removing buildroot","user":{"login":"cristim","id":95209,"avatar_url":"https://avatars1.githubusercontent.com/u/95209?v=4","gravatar_id":"","url":"https://api.github.com/users/cristim","html_url":"https://github.com/cristim","followers_url":"https://api.github.com/users/cristim/followers","following_url":"https://api.github.com/users/cristim/following{/other_user}","gists_url":"https://api.github.com/users/cristim/gists{/gist_id}","starred_url":"https://api.github.com/users/cristim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristim/subscriptions","organizations_url":"https://api.github.com/users/cristim/orgs","repos_url":"https://api.github.com/users/cristim/repos","events_url":"https://api.github.com/users/cristim/events{/privacy}","received_events_url":"https://api.github.com/users/cristim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-07-14T22:47:57Z","updated_at":"2018-02-14T18:59:19Z","closed_at":null,"author_association":"NONE","body":"# Problem\r\nThe builds are too slow, which is painful for local development and makes the project fail to build on  TravisCI.\r\n\r\nI got this idea from #2, you can see the discussion there for more background/context.\r\n\r\nEven with the newly added incremental builds introduced in #16, the initial build for local development is still really slow, and incremental builds wouldn't help on the CI build infrastructure.\r\n\r\n# Root cause\r\nThe main culprit for the slow builds is the buildroot cross-compilation environment which we would compile from scratch, and it would be nice if we could avoid it to speed up builds significantly. \r\n\r\n# Proposal\r\n\r\nOn #2 I suggested to switch entirely to another embedded Linux OS based on binary packages which could be installed on top of a precompiled base, but then I did a bit of research and it turns out that TinyCore, the embedded Linux distribution used as base of the PBA, also supports additional precompiled packages just like we need to get rid of buildroot.\r\n\r\nWe could simply build TinyCore packages without using the buildroot cross-compiled toolchain. The TinyCore packages be easily compiled in a native environment running in a TinyCore Docker container image, which avoids the need to create the cross-compilation buildroot environment that makes the builds so slow.\r\n\r\nThe PBA/Rescue build would consist mainly of the following steps:\r\n- Download a TinyCore Docker container image and install some development TinyCore packages such as gcc and make, which is what we need to build sedutil and linuxpba. We could even create a Docker image with these build dependencies preinstalled.\r\n- Build sedutil and linuxpba into TinyCore native packages inside a  TInyCore development docker container, and leave the binary packages in the filesystem after the compilation completed.\r\n- Download the TinyCore ISO/USB image (and cache it locally) and remaster it by introducing the newly created sedutil packages. The only difference between the Rescue and PBA images is which packages we install and how we configure the init scripts (the PBA image needs some custom init configuration which we already have, in order to run the password prompt at boot). We could create both images really fast based on these prebuilt binaries.\r\n\r\nAll these steps should be pretty fast since we remove the painfully slow buildroot build process which is actually building a full cross-compilation environment, and replace it with a TInyCore native build environment running in a Docker container.\r\n\r\n# Benefits\r\n- The speed gain would make sedutil more developer-friendly\r\n- It would allow us to run builds from CI. \r\n- This approach could be reused later on if we decide to rewrite sedutil/linuxpba into a new tool  leveraging the latest Linux Kernel 4.12+ OPAL support and nvme-cli."},"comment":{"url":"https://api.github.com/repos/sedutil/sedutil/issues/comments/365709481","html_url":"https://github.com/sedutil/sedutil/issues/21#issuecomment-365709481","issue_url":"https://api.github.com/repos/sedutil/sedutil/issues/21","id":365709481,"user":{"login":"cristim","id":95209,"avatar_url":"https://avatars1.githubusercontent.com/u/95209?v=4","gravatar_id":"","url":"https://api.github.com/users/cristim","html_url":"https://github.com/cristim","followers_url":"https://api.github.com/users/cristim/followers","following_url":"https://api.github.com/users/cristim/following{/other_user}","gists_url":"https://api.github.com/users/cristim/gists{/gist_id}","starred_url":"https://api.github.com/users/cristim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristim/subscriptions","organizations_url":"https://api.github.com/users/cristim/orgs","repos_url":"https://api.github.com/users/cristim/repos","events_url":"https://api.github.com/users/cristim/events{/privacy}","received_events_url":"https://api.github.com/users/cristim/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T18:59:19Z","updated_at":"2018-02-14T18:59:19Z","author_association":"NONE","body":"Thanks, that's awesome!"}}
{"actor":{"display_login":"cristim"}}