{"id":45,"date":"2022-06-22T13:46:47","date_gmt":"2022-06-22T13:46:47","guid":{"rendered":"https:\/\/blogs.gentoo.org\/gsoc\/?p=45"},"modified":"2022-07-08T14:52:06","modified_gmt":"2022-07-08T14:52:06","slug":"week-1-report-for-risc-v-support-for-gentoo-prefix","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc\/2022\/06\/22\/week-1-report-for-risc-v-support-for-gentoo-prefix\/","title":{"rendered":"Week 1 Report for RISC-V Support for Gentoo Prefix"},"content":{"rendered":"<div>Hello all,<\/div>\n<div><\/div>\n<div>\u00a0\u00a0\u00a0 Hope you all are doing great, this is my weekly report for the first week of Google Summer of Code. For the initial weeks I have planned to fix issues which occur during the 3 stages of Prefix.<\/div>\n<div><\/div>\n<div>\u00a0\u00a0\u00a0 During the first week I have made pr&#8217;s to fix errors that occur during compilation of stage 1 and 2. I have uploaded all the logs and issues I faced in prefix_on_riscv repository[7].<\/div>\n<div><\/div>\n<div><\/div>\n<p><!--more--><\/p>\n<div><\/div>\n<div>\u00a0\u00a0\u00a0 To start with, I worked on making a riscv profile for prefix[2] and added a symlink[4] which allowed stage 1 to continue. As we don&#8217;t use multilib in prefix, we have decided to settle on one ABI (lp64d).<\/div>\n<div><\/div>\n<div>\u00a0\u00a0 Added patches to some of the issues that occur during stage 2: The <code>app-misc\/pax_utils<\/code>\u200b failed to compile[1] due to files getting compiled outside of prefix. To fix this, In src_install, I changed <code>_emake DESTDIR=\"${D}\"<\/code>\u200b &#8230; to <code>_emake DESTDIR=\"${ED}\"<\/code>\u200b &#8230; in <code>pax-utils-1.3.4.ebuild<\/code>\u200b. The `<span data-size=\"33\" data-position=\"2567\">sys-libs\/pam` failed to compile[3] due to similar reasons as `app-misc\/pax_utils`. And also caused further issues while compiling `pkgconf`. To fix this we had initially decided to fix the ebuild and add support for prefix to it, but it will be better to avoid pulling it by any other package as its not required for prefix. A lot of package depend on it so we started working on the latter solution.<\/span><\/div>\n<div><\/div>\n<div>\u00a0\u00a0\u00a0 To test on riscv using my local machine I am using riscv-chroot-env[5], plct-lab\u2019s machine, dlan\u2019s qemu image. I found riscv-chroot-env pretty fast and easy to use, after using the riscv profile and solving issues with pam, pax-utils and pkgconf, the build went upto stage 3 but couldn&#8217;t continue due to the limitations of the chroot environment[6], it couldn&#8217;t run <code>emerge -uDNv system<\/code>\u200b and stopped working there, also got <span data-size=\"92\" data-position=\"1734\">permission errors when changing ownership (chown), but its fine to ignore when bootstrapping Prefix<\/span>. I am working on fixing chroot env issue[6] so we can continue running <code>emerge -uDNv system<\/code>\u200b.<\/div>\n<div><\/div>\n<div>\u00a0\u00a0\u00a0 Then comes plct-lab\u2019s real riscv machine, I have access to it via ssh and it is pretty fast so far. After using the profile it got through stage 1 but couldn&#8217;t compile gcc after that due to missing gcc-multilib and due to less privileges to users we can&#8217;t install packages on the machine. Also while fixing things on this machine we found out host system needs to have pax-utils installed to use scanelf, to fix this we are planning to add a check in the script to make bootstrapping process more independent from the host.<\/div>\n<div><\/div>\n<div>\u00a0\u00a0\u00a0 I discussed this with mentors and we are planning to have a common environment to share the work done and to fix the limited privilege issues we faced earlier.<\/div>\n<div><\/div>\n<div>\u00a0\u00a0\u00a0 This is my summary of my work done in week one. I learned more about writing ebuilds and testing them, made scripts to speed up my testing and made pull requests to fix pam, pax-utils, created a to riscv profile for prefix and symlink to riscv profile. My mentors have been really helpful and helped me during all problems I came across.<\/div>\n<div><\/div>\n<div>[1]: <a href=\"https:\/\/github.com\/gentoo\/gentoo\/pull\/25855\" target=\"_blank\" rel=\"noreferrer nofollow noopener\">https:\/\/github.com\/gentoo\/gentoo\/pull\/25855<\/a><\/div>\n<div>[2]: <a href=\"https:\/\/github.com\/gentoo\/gentoo\/pull\/25667\" target=\"_blank\" rel=\"noreferrer nofollow noopener\">https:\/\/github.com\/gentoo\/gentoo\/pull\/25667<\/a><\/div>\n<div>[3]: <a href=\"https:\/\/github.com\/gentoo\/gentoo\/pull\/25850\" target=\"_blank\" rel=\"noreferrer nofollow noopener\">https:\/\/github.com\/gentoo\/gentoo\/pull\/25850<\/a><\/div>\n<div>[4]: <a href=\"https:\/\/github.com\/gentoo\/prefix\/pull\/6\" target=\"_blank\" rel=\"noreferrer nofollow noopener\">https:\/\/github.com\/gentoo\/prefix\/pull\/6<\/a><\/div>\n<div>[5]: <a href=\"https:\/\/gitlab.com\/cwittlut\/riscv-chroot-env\" target=\"_blank\" rel=\"noreferrer nofollow noopener\">https:\/\/gitlab.com\/cwittlut\/riscv-chroot-env<\/a><\/div>\n<div>[6]: <a href=\"https:\/\/github.com\/bekcpear\/riscv-chroot-env\/issues\/1\" target=\"_blank\" rel=\"noreferrer nofollow noopener\">https:\/\/github.com\/bekcpear\/riscv-chroot-env\/issues\/1<\/a><\/div>\n<div>[7]: <a href=\"https:\/\/github.com\/wiredhikari\/prefix_on_riscv\/tree\/main\/logs\" target=\"_blank\" rel=\"noreferrer nofollow noopener\">https:\/\/github.com\/wiredhikari\/prefix_on_riscv\/tree\/main\/logs<\/a><\/div>\n<div><\/div>\n<div>&#8212;<\/div>\n<div>Regards,<\/div>\n<div>wiredhikari<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hello all, \u00a0\u00a0\u00a0 Hope you all are doing great, this is my weekly report for the first week of Google Summer of Code. For the initial weeks I have planned to fix issues which occur during the 3 stages of &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2022\/06\/22\/week-1-report-for-risc-v-support-for-gentoo-prefix\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":178,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/45"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/users\/178"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":5,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":65,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/45\/revisions\/65"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}