Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo troubles in systemd-nspawn for ia64 cross-compiling
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Swiftloke
n00b
n00b


Joined: 28 Jul 2023
Posts: 1

PostPosted: Sat Jul 29, 2023 2:05 am    Post subject: Gentoo troubles in systemd-nspawn for ia64 cross-compiling Reply with quote

Hello all. I'm not a Gentoo user, but a lot of great people pointed me towards Gentoo as my best bet when trying to do some very silly work related to the Itanium ISA last year. You can read about that here https://nocoffei.com/?p=31 but I'm more interested in my build instructions https://nocoffei.com/?page_id=23 for the emulated environment, as it turns out that they've broken since the last time I built it in mid-2022.

The instructions, which were given to me by some friendly experienced Gentoo users, utilize the systemd-nspawn container environment to enable a chroot with networking access in order to cross-compile the kernel and packages for an Itanium environment. In particular, this is the line used to spawn the container, after extracting the latest amd64 stage 3 into a "gentoo" folder:

Code:
$ sudo systemd-nspawn --property=DeviceAllow='block-loop rmw' --boot --directory=gentoo --capability=CAP_NET_ADMIN /bin/bash


It turns out that, on both Arch Linux (my primary distro) and Ubuntu 22.04 at least, this no longer works correctly. It instead spits out the following error:

Code:
Spawning container gentoo on /home/nocoffei/gentoo.
Press Ctrl-] three times within 1s to kill container.
INIT: version 3.07 booting

   OpenRC 0.47.1 is starting up Gentoo Linux (x86_64) [SYSTEMD-NSPAWN]

 * /proc is already mounted
 * /run/openrc: creating directory
 * /run/lock: creating directory
 * /run/lock: correcting owner
 * Caching service dependencies ...                                     [ ok ]
 * Create Static Devices Nodes in /dev ...                              [ ok ]
 * Creating user login records ...                                      [ ok ]
 * Create Volatile Files and Directories ...                            [ ok ]
INIT: Entering runlevel: 3
 * Starting local ...                                                   [ ok ]
INIT: Id "c1" respawning too fast: disabled for 5 minutes
INIT: Id "c2" respawning too fast: disabled for 5 minutes
INIT: Id "c3" respawning too fast: disabled for 5 minutes
INIT: Id "c4" respawning too fast: disabled for 5 minutes
INIT: Id "c5" respawning too fast: disabled for 5 minutes
INIT: Id "c6" respawning too fast: disabled for 5 minutes
INIT: no more processes left in this runlevel


It would seem that I've stumbled upon a truly arcane error-- the latest reference I can see to this error online is in the mid-2000s, and the earliest reference I can find being 1994. Most people assert that it's an issue with a TTY, but I'm unsure how that could be the case given that this is a chroot'd environment.

I freely admit that I don't know what I'm doing here, and systemd-nspawn seems to be quite lacking in terms of documentation. So if anyone has suggestions on how to debug this problem, or suggestions on an alternative that accomplishes the same effect, I'd be extremely grateful. (Also, as my post mentions-- anyone who uses Itanium please tell me your story!)
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1707

PostPosted: Sat Jul 29, 2023 3:55 pm    Post subject: Reply with quote

You need some hackery to make systemd-nspawn work with --boot if the target is OpenRC. I think it can be done by modifying the default targets OpenRC starts up (you may find inspiration from the stuff on https://wiki.gentoo.org/wiki/OpenRC#Chroot_support, even though it's different).

But it's easier if you either just use a systemd stage3 to nspawn into (then you can use --boot) or if you just drop --boot from the command you gave.

I'd also recommend dropping into #gentoo-ia64 on IRC as it's where a few of the ia64 users & contributors lurk (IRC in general is where a lot of Gentoo is at).

EDIT: In fact, this explains why your instructions aren't working. You're not following them directly ;) (your instructions say to use a systemd stage3).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum