Discussion:
[arch-ports] Easier to cross-bootstrap or bootstrap with another distro?
Sijie Bu via arch-ports
2021-04-29 00:52:06 UTC
Permalink
Hello,

I do have a quick follow-up question. My friends who works for CIP United told me that they've already got a full Debian port, and it can be run with either qemu-system or qemu-user (unfortunately it seems actual hardware for MIPS64 R6 aren't available yet, probably due to the global silicon shortage). So I'm wondering will it be easier if I first compile pacman against Debian libraries, and use that to natively bootstrap a stage1 image than using cross compiler for bootstrapping?

Thank you for your time and have a nice day.

Sincerely
________________________________________
From: Andreas Baumann
Sent: Monday, April 26, 2021 02:27
To: Discussion regarding the porting of Arch Linux to non-x86_64 architectures
Cc: Sijie Bu
Subject: Re: [arch-ports] Advice on bootstrapping Arch onto a new


architecture?
(This message was originally posted on arch-general and I was redirected by a member to this list.)
Hello,
Hi,
I am about to start working as an intern at CIP United, a company focusing on MIPS chips, and I will be bootstrapping Arch Linux onto the MIPS64r6 architecture, in a fashion similar to Arch Linux ARM.
- Intuitively, I think I should cross-compile the packages of the "core" section (sans a few x64-specific packages) and build a bootable rootfs, but I was having some trouble finding how should I set makepkg to cross-compile. Do I just set up an Arch developer environment as usual, but substitute the toolchain with the cross ones?
I did a "cross-compile" from x86_64 to i486 some time ago, you can maybe
find some useful information in https://git.archlinux32.org/bootstrap32/.

I can also recommend the oakensource's RISC-V port at
https://github.com/oaken-source/parabola-cross-bootstrap

Basically yes, you'll need a cross toolchain for MIPS, either from the AUR
or use a cross-platorm distro like http://t2sde.org/ to bootstrap directly
from MIPS (in qemu or so).
- Does adding a new architecture require modifications to the pacman source code? Or pacman itself should support new architectures? I have also tried looking at pacman source code, and it seems to not have hard-coded list of architectures, but I am not 100% sure about this (if I'll have to modify the source code of pacman, I will be emailing the pacman-dev mailing list regarding their policies on patches etc.).
In theory pacman should be quite portable (it runs at least on x86_64, IA32,
ARM 32-bit, AARCH64). So the typical 32-/64-bit issues should have been
fixed.

You will have to make pacman know about your new architecture (and
eventually subarchitectures). See our fork of pacman on
https://git.archlinux32.org/pacman/
(basically auto-detection for SSE2, support for sub-architectures
'i486', 'i686', 'pentium4').

Most work I expect in breaking cycles and dependencies in PKGBUILDs.
Thank you for your time and have a nice day.
Sincerely
_______________________________________________
arch-ports mailing list
https://lists.archlinux.org/listinfo/arch-ports
Happy porting, feel free to ask questions on IRC at #archinux-ports or #archlinux32. :-)

Cheers

Andreas

--
Andreas Baumann
Trottenstrasse 20
CH-8037 Zuerich
Telefon: +41(0)76/373 01 29
E-mail: ***@andreasbaumann.cc
Homepage: www.andreasbaumann.cc
Andreas Baumann via arch-ports
2021-04-29 04:57:15 UTC
Permalink
Post by Sijie Bu via arch-ports
(This message was originally posted on arch-general and I was redirected by a member to this list.)
Hello,
Hi,
I am about to start working as an intern at CIP United, a company focusing on MIPS chips, and I will be bootstrapping Arch Linux onto the MIPS64r6 architecture, in a fashion similar to Arch Linux ARM.
- Intuitively, I think I should cross-compile the packages of the "core" section (sans a few x64-specific packages) and build a bootable rootfs, but I was having some trouble finding how should I set makepkg to cross-compile. Do I just set up an Arch developer environment as usual, but substitute the toolchain with the cross ones?
I did a "cross-compile" from x86_64 to i486 some time ago, you can maybe
find some useful information in https://git.archlinux32.org/bootstrap32/.
I can also recommend the oakensource's RISC-V port at
https://github.com/oaken-source/parabola-cross-bootstrap
Basically yes, you'll need a cross toolchain for MIPS, either from the AUR
or use a cross-platorm distro like http://t2sde.org/ to bootstrap directly
from MIPS (in qemu or so).
- Does adding a new architecture require modifications to the pacman source code? Or pacman itself should support new architectures? I have also tried looking at pacman source code, and it seems to not have hard-coded list of architectures, but I am not 100% sure about this (if I'll have to modify the source code of pacman, I will be emailing the pacman-dev mailing list regarding their policies on patches etc.).
In theory pacman should be quite portable (it runs at least on x86_64, IA32,
ARM 32-bit, AARCH64). So the typical 32-/64-bit issues should have been
fixed.
You will have to make pacman know about your new architecture (and
eventually subarchitectures). See our fork of pacman on
https://git.archlinux32.org/pacman/
(basically auto-detection for SSE2, support for sub-architectures
'i486', 'i686', 'pentium4').
Most work I expect in breaking cycles and dependencies in PKGBUILDs.
Thank you for your time and have a nice day.
Sincerely
_______________________________________________
arch-ports mailing list
https://lists.archlinux.org/listinfo/arch-ports
Happy porting, feel free to ask questions on IRC at #archinux-ports or #archlinux32. :-)
Cheers
Andreas
--
Andreas Baumann
Trottenstrasse 20
CH-8037 Zuerich
Telefon: +41(0)76/373 01 29
Homepage: www.andreasbaumann.cc
Hello,
I do have a quick follow-up question. My friends who works for CIP United told me that
they've already got a full Debian port, and it can be run with either qemu-system or
qemu-user (unfortunately it seems actual hardware for MIPS64 R6 aren't available yet,
probably due to the global silicon shortage). So I'm wondering will it be easier if
I first compile pacman against Debian libraries, and use that to natively bootstrap
a stage1 image than using cross compiler for bootstrapping?
Hi,

You can in this case start right away to build a minimal Archlinux chroot
on Debian containing all essential packages (at least the C/C++ toolchain, base
packages and pacman and its dependencies). It's definitely easier to
do so, as you don't have to deal with cross-compilation issues in packages.

On the other hand running this in qemu might me unthinkable slow, without
ccache/distcc-ing the load to the native CPU, this will take forever.
Post by Sijie Bu via arch-ports
Thank you for your time and have a nice day.
Sincerely
Cheers

Andreas

--
Andreas Baumann
Trottenstrasse 20
CH-8037 Zuerich
Telefon: +41(0)76/373 01 29
E-mail: ***@andreasbaumann.cc
Homepage: www.andreasbaumann.cc
Sijie Bu via arch-ports
2021-05-01 17:10:22 UTC
Permalink
Thank you for your input. The Debian port in question seems to have been bootstrapped by cross compiling, but the later stages are mostly done with qemu-user chroots. So there's still hope that I can qemu-user all the way if my host is fast enough...

Have a nice day.

Sincerely

________________________________________
From: Andreas Baumann
Sent: Wednesday, April 28, 2021 21:57
To: Sijie Bu
Cc: Discussion regarding the porting of Arch Linux to non-x86_64 architectures
Subject: Re: Easier to cross-bootstrap or bootstrap with another distro?
Post by Sijie Bu via arch-ports
(This message was originally posted on arch-general and I was redirected by a member to this list.)
Hello,
Hi,
I am about to start working as an intern at CIP United, a company focusing on MIPS chips, and I will be bootstrapping Arch Linux onto the MIPS64r6 architecture, in a fashion similar to Arch Linux ARM.
- Intuitively, I think I should cross-compile the packages of the "core" section (sans a few x64-specific packages) and build a bootable rootfs, but I was having some trouble finding how should I set makepkg to cross-compile. Do I just set up an Arch developer environment as usual, but substitute the toolchain with the cross ones?
I did a "cross-compile" from x86_64 to i486 some time ago, you can maybe
find some useful information in https://git.archlinux32.org/bootstrap32/.
I can also recommend the oakensource's RISC-V port at
https://github.com/oaken-source/parabola-cross-bootstrap
Basically yes, you'll need a cross toolchain for MIPS, either from the AUR
or use a cross-platorm distro like http://t2sde.org/ to bootstrap directly
from MIPS (in qemu or so).
- Does adding a new architecture require modifications to the pacman source code? Or pacman itself should support new architectures? I have also tried looking at pacman source code, and it seems to not have hard-coded list of architectures, but I am not 100% sure about this (if I'll have to modify the source code of pacman, I will be emailing the pacman-dev mailing list regarding their policies on patches etc.).
In theory pacman should be quite portable (it runs at least on x86_64, IA32,
ARM 32-bit, AARCH64). So the typical 32-/64-bit issues should have been
fixed.
You will have to make pacman know about your new architecture (and
eventually subarchitectures). See our fork of pacman on
https://git.archlinux32.org/pacman/
(basically auto-detection for SSE2, support for sub-architectures
'i486', 'i686', 'pentium4').
Most work I expect in breaking cycles and dependencies in PKGBUILDs.
Thank you for your time and have a nice day.
Sincerely
_______________________________________________
arch-ports mailing list
https://lists.archlinux.org/listinfo/arch-ports
Happy porting, feel free to ask questions on IRC at #archinux-ports or #archlinux32. :-)
Cheers
Andreas
--
Andreas Baumann
Trottenstrasse 20
CH-8037 Zuerich
Telefon: +41(0)76/373 01 29
Homepage: www.andreasbaumann.cc
Hello,
I do have a quick follow-up question. My friends who works for CIP United told me that
they've already got a full Debian port, and it can be run with either qemu-system or
qemu-user (unfortunately it seems actual hardware for MIPS64 R6 aren't available yet,
probably due to the global silicon shortage). So I'm wondering will it be easier if
I first compile pacman against Debian libraries, and use that to natively bootstrap
a stage1 image than using cross compiler for bootstrapping?
Hi,

You can in this case start right away to build a minimal Archlinux chroot
on Debian containing all essential packages (at least the C/C++ toolchain, base
packages and pacman and its dependencies). It's definitely easier to
do so, as you don't have to deal with cross-compilation issues in packages.

On the other hand running this in qemu might me unthinkable slow, without
ccache/distcc-ing the load to the native CPU, this will take forever.
Post by Sijie Bu via arch-ports
Thank you for your time and have a nice day.
Sincerely
Cheers

Andreas

--
Andreas Baumann
Trottenstrasse 20
CH-8037 Zuerich
Telefon: +41(0)76/373 01 29
E-mail: ***@andreasbaumann.cc
Homepage: www.andreasbaumann.cc

Loading...