Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] aarch64-cross compiled portage fails due to profile
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
nameiwillforget
n00b
n00b


Joined: 07 May 2024
Posts: 19

PostPosted: Thu Jul 04, 2024 2:55 pm    Post subject: [Solved] aarch64-cross compiled portage fails due to profile Reply with quote

I'm setting up portage on my desktop so I can use it to cross-compile packages for my Raspberry Pi 4. I've been following the wiki, but it has instructions for the original Pi, so I had to adapt them a bit. I set the profile to

Code:

default/linux/arm64/23.0/desktop/systemd


which is what I got from running eselect-profile-show on my Pi. With that and a newly configured make.conf I wanted to run

Code:

ARCH=aarch64 PORTAGE_CONFIGROOT=/usr/aarch64-unknown-linux-gnu eselect profile set default/linux/arm64/23.0/desktop/systemd


But for each package I get

Code:

 * Your profile is of type merged-usr, but your directories
 * on-disk are of type split-usr.
 * Please switch back to your last valid profile setting and
 * read the documentation about merged-usr and profile changes.
 *
 * ERROR: acct-user/systemd-journal-remote-0-r3::gentoo failed (setup phase):
 *   ERROR: 23.0 merged-usr profile, but disk is split-usr


For completeness sake, this is my /usr/aarch64-unknown-linux-gnu/etc/portage/make.conf:

Code:

# Note: profile variables are set/overridden in profile/ files:
# etc/portage/profile/use.force (overrides kernel_* USE variables)
# etc/portage/profile/make.defaults (overrides ARCH, KERNEL, ELIBC variables)

ARCH="arm64"

CHOST=aarch64-unknown-linux-gnu
CBUILD=x86_64-pc-linux-gnu

ROOT=/usr/${CHOST}/

ACCEPT_KEYWORDS="${ARCH} ~${ARCH}"

USE="${ARCH} -acl"

MAKEOPTS="-j15 -l15"

COMMON_FLAGS="-mcpu=cortex-a72 -ftree-vectorize -O2 -pipe -fomit-frame-pointer"
CFLAGS="${CFLAGS}"
CXXFLAGS="${CFLAGS}"

FEATURES="-collision-protect -sandbox-pid buildpkg noman noinfo nodoc ${ARCH}"
# Be sure we dont overwrite pkgs from another repo..
PKGDIR=${ROOT}var/cache/binpkgs/
PORTAGE_TMPDIR=${ROOT}tmp/

PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/"
#PORTDIR_OVERLAY="/var/db/repos/local/"


Any ideas?


Last edited by nameiwillforget on Thu Jul 04, 2024 5:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22021

PostPosted: Thu Jul 04, 2024 3:25 pm    Post subject: Reply with quote

This message can only be generated in one place: profiles/releases/23.0/profile.bashrc. Your profile is 23.0, and lacks the substring split-usr. Your $EROOT/bin exists and is not a symlink. Either convert the configroot to be merged-usr, or use a split-usr Portage profile for it.
Back to top
View user's profile Send private message
nameiwillforget
n00b
n00b


Joined: 07 May 2024
Posts: 19

PostPosted: Thu Jul 04, 2024 4:01 pm    Post subject: Reply with quote

Quote:

Either convert the configroot to be merged-usr, or use a split-usr Portage profile for it.


I'm assuming since I have set the Pi to this profile already it's better to convert the configroot, right? But how do I do that?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22021

PostPosted: Thu Jul 04, 2024 5:01 pm    Post subject: Reply with quote

I think recent systemd only supports merged-usr, so yes, changing the disk layout of the root to merged-usr is the right path forward. See the news item 2022-12-01: /usr merge for systemd users for instructions.
Back to top
View user's profile Send private message
nameiwillforget
n00b
n00b


Joined: 07 May 2024
Posts: 19

PostPosted: Thu Jul 04, 2024 5:04 pm    Post subject: Reply with quote

I found the entry in the wiki where it describes what the merge-usr script does and since nothing important was installed on that portage-setup I decided to try simply moving all files in usr/aarch64-unknown-linux-gnu//bin as well as in the sbin, lib and lib64 subdirectories of /usr/aarch64-unknown-linux-gnu to their corresponding directories in /usr/aarch64-unknown-linux-gnu/usr and to then remove the now-empty bin, sbin, lib and lib64 directories and replace them with symlinks to their counterparts in ./usr. It seemed to work but when I tried to emerge @system again I got an error while installing bzip2 that it conflicted with a file bzcat in bin, so I removed bzcat, and now I'm getting lots of errors. I guess I shouldn't have done that?

Edit: I tried to simply run crossdev --stable -t aarch64-unknown-linux-gnu again, but it didn't re-create bzcat, so I'm thinking I'd just remove the entire /usr/aarch64-unknown-linux-gnu/usr directory. But since simply removing a file was what got me into trouble in the first place I'll instead back it up, then run crossdev again. But what kept me from using the script was that it only applies to the base portage, not the cross-compiled version, right? How can I set it to apply to the cross-compiled system?
Back to top
View user's profile Send private message
nameiwillforget
n00b
n00b


Joined: 07 May 2024
Posts: 19

PostPosted: Thu Jul 04, 2024 5:29 pm    Post subject: Reply with quote

So I simply started anew and did the cross-compile setup again, then, before I emerged anything removed the lib directory in the /usr/aarch64-unknown-linux-gnu directory, which was the only one of the problematic directories that existed, and replaced it with a symlink to the usr/lib directory. So far I'm getting no errors because of that. I'm getting lots of other errors, but the wiki says that's normal. So I'll mark this as solved, though the solution is super-hackneyed.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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