Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Installing all build dependencies with ROOT=

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
mid-kid
n00b
n00b
Posts: 26
Joined: Sun Aug 24, 2014 9:51 am

Installing all build dependencies with ROOT=

  • Quote

Post by mid-kid » Tue Nov 03, 2020 10:47 pm

Hi, I'm trying to kickstart a chroot from a full set of @system binpkgs I've built, but running:

Code: Select all

emerge --root /chroot -K @system
Doesn't install everything.

I've read around the `emerge` man page, and stumbled upon a few flags that ended up installing a "fuller" @system set:

Code: Select all

emerge --root /chroot --sysroot /chroot -K --with-bdeps=y --root-deps @system
But even this doesn't install *everything*.

Am I missing some arcane flag, or is this completely unsupported? As far as I gather, --root-deps should take care of installing the DEPEND variable of any pre-EAPI7 packages, while --sysroot would take care of DEPEND in EAPI7. However, app-arch/unzip is a DEPEND of app-text/docbook-xml-dtd, which is EAPI7, and it's not being installed.
I'm sure the profile is being inherited from my root system, and the binpkg set is fresh and complete; installing the missing dependencies by directly "emerge"ing them works.
What gives?

I'll add a second question while I'm at it: Is it possible to install a set of binpkgs from a directory, without having to add a repository to `emerge` from and listing the full atoms?
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Wed Nov 04, 2020 6:50 pm

Unfortunately, there is only a partial support for --root.
It works most of the times, but some particular packages don't.
Creating system users for daemons can fail.

Some things can be dealt with using binary packages (like in build and install a package with all dependencies in a stage3, then only install the package and its runtime dependencies in --root)
Other issues require manual intervention.
I'll add a second question while I'm at it: Is it possible to install a set of binpkgs from a directory, without having to add a repository to `emerge` from and listing the full atoms?
I suppose you can do that using a lower-level command: ebuild
Also an emerge-created binary package is essentially a compressed tar archive with some garbage appended to it. You can "install" it by simply extracting it. It makes a bit of a mess, since portage is not aware of files created this way and will not track them, but you can do that to a throw-away system you're not going to maintain.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Wed Nov 04, 2020 7:07 pm

alias acer-build='sudo PORTAGE_CONFIGROOT="/n/gentoo/acer/" ROOT="/n/gentoo/acer/" SYSROOT="/n/gentoo/acer/" BROOT="/n/gentoo/acer/" emerge --root-deps=rdeps -v '
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
mid-kid
n00b
n00b
Posts: 26
Joined: Sun Aug 24, 2014 9:51 am

  • Quote

Post by mid-kid » Wed Nov 04, 2020 8:09 pm

szatox wrote:Unfortunately, there is only a partial support for --root.
It works most of the times, but some particular packages don't.
Creating system users for daemons can fail.
That's a shame. I was hoping I would be able to avoid the issues with binpkgs...
I guess I can see if I can figure out a command to list all packages + deps in the @system set, and then pass that list to portage, but that's less than ideal.
szatox wrote:
I'll add a second question while I'm at it: Is it possible to install a set of binpkgs from a directory, without having to add a repository to `emerge` from and listing the full atoms?
I suppose you can do that using a lower-level command: ebuild
Also an emerge-created binary package is essentially a compressed tar archive with some garbage appended to it. You can "install" it by simply extracting it. It makes a bit of a mess, since portage is not aware of files created this way and will not track them, but you can do that to a throw-away system you're not going to maintain.
Just extracting the packages is not an option because of what you said and pkg_postinst() isn't ran.
I thought `ebuild` was just for, you know, ebuilds? The man page seems to imply that, at least, and running `ebuild gzip-1.10.tbz2 merge` tells me "ebuild: gzip-1.10.tbz2: does not end with '.ebuild'".
Anon-E-moose wrote:alias acer-build='sudo PORTAGE_CONFIGROOT="/n/gentoo/acer/" ROOT="/n/gentoo/acer/" SYSROOT="/n/gentoo/acer/" BROOT="/n/gentoo/acer/" emerge --root-deps=rdeps -v '
This doesn't seem to do anything more than the second command in OP, after adding the `-K` option...

I should add that specifying the `-e` option in the second command I wrote in OP installs a bunch of the dependencies on the host instead of the ROOT, so I'm sure some dependencies are still not being redirected to the target system.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Wed Nov 04, 2020 8:24 pm

Code: Select all

       --usepkg [ y | n ], -k
              Tells emerge to use binary packages (from $PKGDIR) if they are available, thus possibly  avoiding  some
              time-consuming compiles.  This option is useful for CD installs; you can export PKGDIR=/mnt/cdrom/pack‐
              ages and then use this option to have emerge "pull" binary packages from the CD in order to satisfy de‐
              pendencies.

       --usepkgonly [ y | n ], -K
              Tells  emerge to only use binary packages (from $PKGDIR).  All the binary packages must be available at
              the time of dependency calculation or emerge will simply abort.  Portage does not use ebuild  reposito‐
              ries when calculating dependency information so all masking information is ignored.
From the man page, what happens if you use -k instead of -K (use the pretend option to see what it would do without doing anything)

Edit to add:
How did you build the binpkgs?
Last edited by Anon-E-moose on Wed Nov 04, 2020 8:29 pm, edited 1 time in total.
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
mid-kid
n00b
n00b
Posts: 26
Joined: Sun Aug 24, 2014 9:51 am

  • Quote

Post by mid-kid » Wed Nov 04, 2020 8:28 pm

Anon-E-moose wrote:what happens if you use -k instead of -K (use the pretend option to see what it would do without doing anything)
Same thing because all the @system packages, including build dependencies, are present as binpkgs.

EDIT: Didn't notice the edit in the previous post until right now
Anon-E-moose wrote:How did you build the binpkgs?
By running "emerge -be @system"
Top
mid-kid
n00b
n00b
Posts: 26
Joined: Sun Aug 24, 2014 9:51 am

  • Quote

Post by mid-kid » Fri Nov 06, 2020 3:39 pm

I didn't end up solving my first issue, but the second issue can be solved by generating a proper binhost directory, and then running something akin to:

Code: Select all

PKGDIR="$PWD" emerge -K =category/package-version
It's not the prettiest, but it works for what I needed to.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Fri Nov 06, 2020 3:58 pm

This is what I originally used to build binaries for my laptop on my ryzen

CFLAGS="-march=skylake -O2 -pipe" CXXFLAGS="-march=skylake -O2 -pipe" PKGDIR="/usr/local/portage/packages.acer" emerge -av -B

It was just a one-off in several tries, it works, but it won't properly build using @world/@system or it won't build all packages, as the ryzen doesn't have things like touchpad, wifi, etc and the laptop does.

I've since gone on to having a chroot to build the stuiff in, but yes, if PKGDIR isn't set in make.conf OR you want to use some other directory for storage (outside of portage) then set PKGDIR.
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
Slippery Jim
Guru
Guru
User avatar
Posts: 300
Joined: Sat Jan 08, 2005 9:25 pm

  • Quote

Post by Slippery Jim » Sun Nov 14, 2021 6:21 am

I like to install the @system runtime into a root, and then chroot into it to install the missing bdeps.

This is how I do it:

As a regular user (in the portage group)

Code: Select all

PKGDIR=binpkgs emerge --root=myroot -Kv @system
As root:

Code: Select all

mkdir -p myroot/{dev,proc,sys,var/{cache/binpkgs,db/repos}}

mount --bind /dev myroot/dev
mount --bind /proc myroot/proc
mount --bind /run myroot/run
mount --bind /sys myroot/sys

mount -o bind,ro binpkgs myroot/var/cache/binpkgs
mount -o bind,ro /var/db/repos myroot/var/db/repos

chroot myroot env -i /bin/bash
In the chroot:

Code: Select all

export TERM=xterm
source /etc/profile
env-update
source /etc/profile
export PS1="(chroot) ${PS1}"
eselect profile set 1

emerge -eKv --with-bdeps=y @system
After exiting the chroot:

Code: Select all

umount -l myroot/{dev,proc,run,sys,var/{cache/binpkgs,db/repos,tmp}}
Top
Post Reply

9 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic