• Re: [gentoo-dev] Progress of the Gentoo/LoongArch port, and question on

    From Alexey 'Alexxy' Shvetsov@21:1/5 to All on Fri Feb 18 11:21:28 2022
    Hi!

    Its interesting thing. Is there a possibility to get LoongArch hw outside of China?

    В письме от суббота, 1 января 2022 г. 20:28:16 MSK пользователь WANG Xuerui
    написал:
    Hi everyone,

    I'm the guy who previously announced the Gentoo/LoongArch port [1];
    since that post, some nice progress has been made, and here's a heads-up
    and a procedural question regarding how to continue work upstream.


    ## Progress of the port

    After some minimal forking and tweaking, it's already possible to build working stage3 tarballs with catalyst;
    with quick-and-dirty catalyst[2] and genkernel[3] patches, even working installation CDs can be built (confirmed by LiveUSB-making and booting
    on real 3A5000 hardware).
    The built stages and installation CD images are already available in
    several mirrors like [4] or [5].

    The toolchain development of Loongson has gone more-or-less quiet
    lately, and many projects (eselect, icu, systemd, etc.) have already had releases that contain LoongArch bring-up changes, so it's time to push
    more things upstream (in this case, the main gentoo.git repo).


    ## How to test this?

    The necessary changes are all brewing in the loongson-overlay[6], which
    is available via layman (`sudo layman -a loongson`). You'll need this
    for the loong profile and toolchain patches.

    The stages can be tested with QEMU linux-user emulation, if you don't
    have the LoongArch hardware;
    but the LoongArch target is not upstream yet, so you'll have to compile Loongson's fork ([7]; qemu-devel threads [8] [9]) yourself. The
    necessary binfmt-misc declaration is like this (remove all whitespaces

    and newlines before using):
    :loongarch64:M:: \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01: \xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff

    \xff\xff:/usr/local/bin/qemu-loongarch64:
    You can use your favorite way to set up this (manually, via rc-scripts,
    via systemd-binfmt.service, whatever), replacing the interpreter path to
    suit your setup, then just proceed like every chroot.

    Inside the chroot, you need to `git clone` the loongson-overlay, add it
    to /etc/portage/repos.conf, and fix the profile symlink; after that you should be able to emerge packages as usual. Keywords are mostly missing,
    so you may use ACCEPT_KEYWORDS=~riscv or something similar to get
    through, in case everything is masked and not package.accept_keywords-ed.

    Note that their system emulation is currently in a worse state than linux-user (horribly slow and dependent on prebuilt firmware blob),
    according to review comments, so you may as well ignore the installation
    CDs for now.


    ## Problem regarding further upstream work

    As described above, there is already some nice progress, but a
    procedural problem still remains: every new architecture needs a backing project and arch team [10], yet I'm not a Gentoo dev and it's unclear if
    any Gentoo dev would be interested in such a niche architecture with
    limited hardware availability outside China, so we may get stuck in this state for an extended period.

    Any suggestion is welcome; and thank you for your attention.


    Regards,
    WANG "xen0n" Xuerui


    [1]: https://archives.gentoo.org/gentoo-dev/message/ef0b1812e9b66cdf5978ecc2ad4ed a4e [2]: https://github.com/xen0n/catalyst/tree/3.0.20-for-loong
    [3]: https://github.com/xen0n/genkernel/tree/loong
    [4]: https://mirrors.tuna.tsinghua.edu.cn/loongson/gentoo/experimental/
    [5]: https://mirrors.bfsu.edu.cn/loongson/gentoo/experimental/
    [6]: https://github.com/xen0n/loongson-overlay
    [7]: https://github.com/loongson/qemu/tree/tcg-dev
    [8]: https://patchew.org/QEMU/1638610165-15036-1-git-send-email-gaosong@loongson. cn/ [9]: https://patchew.org/QEMU/1638619645-11283-1-git-send-email-yangxiaojuan@loon gson.cn/ [10]: https://projects.gentoo.org/council/meeting-logs/20180114-summary.txt


    --
    Best regards,
    Alexey 'Alexxy' Shvetsov
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEE+WVL/tIVJamPnFyWcubNMgpvc2oFAmIPVwgACgkQcubNMgpv c2o69BAAk0s0+vsCozmBpdklnjbZKcikM1m81482j5GMAWB6hCMeH3WSa3hzWyl0 nFqfwUVhzsqjdpJI7dwfk5z0M66Dk/vkrAYcrTl7SrVbl8c+CIlZyMO6T9UFHfX+ 22BlQM67tub9+cSKat4pPzf2jT/np3X2dEuN4DRSv9y+9mTQHXswqN2bGYeV9cIb wyMPPNJQ01hMvSh5MQbv5DO4l0cJUWyJZ6nhrve+Z78LplzA41ryI4+6U5mkUJa6 dfQz7jcRv0AUzCjcmjguKTr5Pyt44md2IJ1wzYyKLEYKvIUllvUeOcb5lWeAD2wD nDXKghcmW8Ods/gf6LfWM9kBaiG0jwJ/USRRqF06+2i36IeM2w6ovgh5GvWxXeDM x2DSGo5l6ozyFJ8Mp/vnxAU5cdrijkGlZJOwKAEAV2NdJNPsEyFt/KVhdUZIvvJZ Gmarul5QXM+Ns69khShLNFWN67Adxlkyp4TiD+PHmwpnaNT687Ri0mskPgfDiprg aimgvqel0PfE7zvCkFuiuIICDnCyPNJfsuuSmSXOYnxoDoA0t61k1HdubErutfhN 7icdfLpCq3Qqy/tfQ4ukWED2wXxHyoucm6PRLk3IRbhqB06kXKGiY+8jVhX0zzQs BwDPj+QER5we6GrMZINznN5oFN+HgifYw7EUrZxcGOLkUUh5+uA=
    =3Fyl
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)