Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
When did /usr/portage -> /var/db/repos/gentoo ?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Goverp
l33t
l33t


Joined: 07 Mar 2007
Posts: 863

PostPosted: Fri Sep 27, 2019 7:31 pm    Post subject: When did /usr/portage -> /var/db/repos/gentoo ? Reply with quote

While reading the Steam instructions for a chroot I came across /var/db/repos/gentoo, which I didn't have. Searching the wiki, I find an article on the new locations for Gentoo's stuff, and a reference to a bug, which shows things really started to happen in 2018.

Anyway, my point is that I didn't know about the changes, but having read about them, the changed layout strikes me much more sensible. As everything still works for me using old /usr/portage and friends, it's all been implemented in a transparent way, which is great. Is the new layout bleeding edge? Presumably not, as the handbook has been updated.

Perhaps I'd like to migrate. Is there a tool? Perhaps not needed, just "grep -R '/usr/portage' /etc/portage" and edit all the hits (and related stuff).
_________________
Greybeard
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10459
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Sep 27, 2019 7:39 pm    Post subject: Reply with quote

There are still a couple of tools that don't use the new (I agree, more sensible) locations, so for now the stage3 tarballs still contains a make.conf that overrides back to their traditional locations. If you use any of the tools referenced in that bug, you might want to hold off until that bug is resolved.

The issue hardly seems worth a tool. As root, just:
  1. Move your /usr/portage/distfiles and /usr/portage/packages and /usr/portage to the new locations (in that order):
    Code:
    mkdir -p /var/db/repos/gentoo /var/cache/{distfiles,binpkgs}
    mv /usr/portage/distfiles/* /var/cache/distfiles
    mv /usr/portage/packages/* /var/cache/binpkgs
    rmdir /usr/portage/{distfiles,packages}
    mv /usr/portage/{*,.git} /var/db/repos/gentoo
    rmdir /usr/portage
    Note that the next-to-last last line will produce a harmless error if you're using a method other than git for sync.
  2. Edit /etc/portage/make.conf to remove any overrides, and
  3. Edit /etc/portage/repos.conf/gentoo.conf to refer to the new location. This is the "location =" line.
  4. Since the /etc/portage/make.profile symlink will be invalid, find your correct profile with "eselect profile list" and then set a valid profile with "eselect profile set xx" (of course, substitute your profile number for "xx").
Not that hard. ;)

Edit: Updated my post to include a full command line recipe.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.


Last edited by John R. Graham on Tue Dec 03, 2019 9:35 pm; edited 4 times in total
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 354
Location: South America

PostPosted: Fri Sep 27, 2019 7:54 pm    Post subject: Reply with quote

Goverp wrote:
Searching the wiki, I find an article on the new locations for Gentoo's stuff, and a reference to a bug, which shows things really started to happen in 2018.

Yes, and defaults were changed in Portage version 2.3.64.

John R. Graham wrote:
  1. Move your /usr/portage/distfiles and /usr/portage/packages and /usr/portage to the new locations (in that order),
  2. Edit /etc/portage/make.conf to remove any overrides,
  3. Edit /etc/portage/repos.conf/gentoo.conf to refer to the new locations, and
  4. rm -r /usr/portage

That's pretty much what I did. Actually, one could always change Portage's default settings, and I think I never actually used /usr/portage. I always thought some subdirectory in /var was a better fit that /usr. I used a subdirectory of /var/lib/portage until /var/db/repos and /var/cache became the new defaults.
Back to top
View user's profile Send private message
sitquietly
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2010
Posts: 95
Location: On the Wolf River, Tennessee

PostPosted: Fri Sep 27, 2019 8:15 pm    Post subject: Reply with quote

The change caught me by surprise on my new gentoo installation. For a moment I was asking "Who the heck stole my portage tree!?" Alas it was hidden away in /var/db/repos/gentoo. The change is ok, maybe, /usr/portage for 20 years was growing too familiar and memorized by too many fingers. I don't understand the appeal to the Linux Filesystem Hierarchy Standard(1). I can't find that the standard lists any such location as /var/db/ -- it does allow for /usr/src/ as the system-specific location for system source code such as the kernel source code and headers. If we're being pedantic (the bug report leading to the change from /usr/portage is probably pendantic), I would argue that most Linux systems have no source code in their standard filesystem so the FHS glosses over the need for a place to put it, but in a system such as Gentoo for which source code is essential to the system the only standard-sanctioned location is /usr/src. So /usr/src/linux holds the source code for the kernel and /usr/src/gentoo holds the scripts for everything else.

It doesn't matter. My fingers are trained on BSD now where the standard location for these essential scripts is /usr/ports. I do use overlays and so divide the ports as
Code:
/usr/ports/gentoo , /usr/ports/sage-on-gentoo , /usr/ports/calculate
, etc.

Without the portage scripts you can not have a functioning system. To call that a "db" strikes me as a strange misunderstanding. It is the source code, The System. Without /usr/portage (or /usr/src/gentoo) you can't have anything else in /usr. :idea:

NB: The latest FSH 3.0 defines /var as
/var contains variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.

The standard lists known subdirs as {account, cache, crash, games, lib, lock, log, mail, opt, run, spool, tmp, yp}. It does not know any /var/db.

The standard allows /usr/src: Source code may be placed in this subdirectory

I've made my system 100% FHS compliant and multi-repo compliant by putting all source in /usr/src -- /usr/src/linux*, /usr/src/gentoo, /usr/src/sage-on-gentoo, /usr/src/lisp, /usr/src/distfiles, with a link /usr/portage -> src/gentoo. /usr/src is on its own partittion. I find this layout to be very pleasant and recommend it for folks looking for a logical useable layout that makes it easy to share source codes between multiple gentoo roots. I find that 32 GB is about right for the /usr/src partition.


Last edited by sitquietly on Sun Sep 29, 2019 9:35 pm; edited 2 times in total
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6572

PostPosted: Fri Sep 27, 2019 8:43 pm    Post subject: Reply with quote

I thought people here were generally against attempts to force /usr/ to live on a read-write root partition?
Back to top
View user's profile Send private message
sitquietly
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2010
Posts: 95
Location: On the Wolf River, Tennessee

PostPosted: Fri Sep 27, 2019 10:50 pm    Post subject: Reply with quote

Ant P. wrote:
I thought people here were generally against attempts to force /usr/ to live on a read-write root partition?


Force? Doing it right :lol: doesn't force anything. In BSD systems (from whence the portage came) /usr/ports is usually its own partition, as is /usr/src. And /usr is (almost) always on its own partition, which can be mounted read-only. The separate partitions not only allow /usr to be read-only but allow no-binaries partitions to be mounted with reduced priviledges (noexec, nosuid, nodev). Don't get me confused with those who are confused. I'm confused enough before finding that /usr/portage isn't.
Back to top
View user's profile Send private message
sitquietly
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2010
Posts: 95
Location: On the Wolf River, Tennessee

PostPosted: Sun Sep 29, 2019 9:45 pm    Post subject: Reply with quote

sitquietly wrote:
.....The standard allows /usr/src: Source code may be placed in this subdirectory

I've made my system 100% FHS compliant and multi-repo compliant by putting all source in /usr/src -- /usr/src/linux*, /usr/src/gentoo, /usr/src/sage-on-gentoo, /usr/src/lisp, /usr/src/distfiles, with a link /usr/portage -> src/gentoo. /usr/src is on its own partittion. I find this layout to be very pleasant and recommend it for folks looking for a logical useable layout that makes it easy to share source codes between multiple gentoo roots. I find that 32 GB is about right for the /usr/src partition.


If I put a stage tarball in my /usr/src directory then I can define /usr/src as everything needed to build a Gentoo Linux system.

So now I'll use my new src partition to build my next gentoo root with OpenRC Plasma Science. Gentoo is so cool. 8)
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10459
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Sep 30, 2019 3:11 pm    Post subject: Reply with quote

Updated my post above to include a full command line recipe.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1108
Location: sweden

PostPosted: Mon Dec 23, 2019 6:39 am    Post subject: Reply with quote

John R. Graham wrote:

[*]Edit /etc/portage/make.conf to remove any overrides, and
[*]Edit /etc/portage/repos.conf/gentoo.conf to refer to the new location. This is the "location =" line.


- John


John R. Graham

you can not just remove the overrides..you will get :
Code:


mya51 /home/hedmo # eselect profile list
!!! Error: Failed to get a list of valid profiles
exiting
mya51 /home/hedmo # emerge -av1 eselect-profile
!!! Section 'gentoo' in repos.conf has location attribute set to nonexistent directory: '/usr/portage'
!!! Invalid Repository Location (not a dir): '/usr/portage'


!!! /etc/portage/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)


!!! Your current profile is invalid. If you have just changed your profile
!!! configuration, you should revert back to the previous configuration.
!!! Allowed actions are limited to --help, --info, --search, --sync, and
!!! --version.
mya51 /home/hedmo #


i had to put :
Code:


# NOTE: This stage was built with the bindist Use flag enabled
PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
PKGDIR="/var/cache/binpkgs"


and
Code:


mya51 /home/hedmo # emerge --newuse --sync && layman -S


to make it work.i dont know why but one thing i dont have is : /etc/portage/repos.conf/gentoo.conf



Edit:

if you want to remove the overrides from make.conf.create the gentoo.conf :
Code:


nano -w  /etc/portage/repos.conf/gentoo.conf


and put this in the file :
Code:


[DEFAULT]
main-repo = gentoo

[gentoo]
location = /var/db/repos/gentoo
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes
sync-rsync-verify-jobs = 1
sync-rsync-verify-metamanifest = yes
sync-rsync-verify-max-age = 24
sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc
sync-openpgp-keyserver = hkps://keys.gentoo.org
sync-openpgp-key-refresh-retry-count = 40
sync-openpgp-key-refresh-retry-overall-timeout = 1200
sync-openpgp-key-refresh-retry-delay-exp-base = 2
sync-openpgp-key-refresh-retry-delay-max = 60
sync-openpgp-key-refresh-retry-delay-mult = 4
sync-webrsync-verify-signature = yes


regards hedmo


Last edited by hedmo on Mon Dec 23, 2019 8:07 am; edited 1 time in total
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1613

PostPosted: Mon Dec 23, 2019 7:44 am    Post subject: Reply with quote

John R. Graham wrote:
Updated my post above to include a full command line recipe.

- John
Migrated as told.
Seems like crossdev doesn't work out of the box.

Any ideas?

Thks 4 ur attention.
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1108
Location: sweden

PostPosted: Mon Dec 23, 2019 8:00 am    Post subject: Reply with quote

wrote:
[]Migrated as told.
Seems like crossdev doesn't work out of the box.

Any ideas?

Thks 4 ur attention.


CaptainBlood

you have a file in /etc/portage/repo.conf:
Code:


mya51 / # cat /etc/portage/repos.conf/crossdev.conf
[crossdev]
location = /var/lib/local/portage-crossdev

mya51 / #



i have moved it to this place and it is working for me.

regards hedmo
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1464

PostPosted: Mon Dec 23, 2019 8:26 am    Post subject: Reply with quote

John R. Graham wrote:
[*]Move your /usr/portage/distfiles and /usr/portage/packages and /usr/portage to the new locations (in that order):[code]mkdir -p /var/db/repos/gentoo /var/cache/{distfiles,binpkgs}


According to this logic, where is the right place for the localrepo?

Thank you in advance
Ma
_________________
Thank you for your attention, interest and support.
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1108
Location: sweden

PostPosted: Mon Dec 23, 2019 8:39 am    Post subject: Reply with quote

Marlo wrote:

According to this logic, where is the right place for the localrepo?

Thank you in advance
Ma


Marlo

can this help?

https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/CustomTree#Defining_a_custom_repository

i have unofficial and custom repositorys =:

Code:
 
mya51 / # cat /etc/portage/repos.conf/eselect-repo.conf
# created by eselect-repo



[nvidia-vulkan]
location = /var/db/repos/nvidia-vulkan
sync-type = git
sync-uri = https://github.com/kakra/nvidia-vulkan.git

mya51 / # ls /var//db/repos
gentoo  hedmos-overlay  nvidia-vulkan
mya51 / #


regards hedmo
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3377

PostPosted: Mon Dec 23, 2019 8:44 am    Post subject: Reply with quote

Marlo wrote:
According to this logic, where is the right place for the localrepo?

See https://wiki.gentoo.org/wiki/Custom_repository.
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1464

PostPosted: Mon Dec 23, 2019 9:22 am    Post subject: Reply with quote

hedmo wrote:

Marlo

can this help?


Yes, thank you,
it was very helpful.
Code:
/etc/portage/repos.conf # cat localrepo.conf
[localrepo]
location = /var/db/repos/localrepo
masters = gentoo
auto-sync = no


I don't want to bother you, but is in this logic the place for layman still right? "storage: /var/lib/layman"

Shouldn't it be: "storage: /var/db/repos/layman" ?

Ma
_________________
Thank you for your attention, interest and support.
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1464

PostPosted: Mon Dec 23, 2019 9:40 am    Post subject: Reply with quote

charles17 wrote:

See https://wiki.gentoo.org/wiki/Custom_repository.


Thank you charles17,

this wiki article also uses 2 places:
/var/db/repos/localrepo/
and
/usr/local/portage/

It doesn't seem to be consistent. Or I don't understand the difference. Hence my questions.

Ma
_________________
Thank you for your attention, interest and support.
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1108
Location: sweden

PostPosted: Mon Dec 23, 2019 10:09 am    Post subject: Reply with quote

Marlo wrote:


I don't want to bother you, but is in this logic the place for layman still right? "storage: /var/lib/layman"

Shouldn't it be: "storage: /var/db/repos/layman" ?

Ma


Mario

i am still using the older method=/etc/portage/make.conf but if you want to upgrade that one to: https://wiki.gentoo.org/wiki/Layman

Edit:about : /var/db/repos/layman . as i understand it.this will default all stuff to one place:

"portage"= /var/db/repos/gentoo
"custom repos" for example (google) =/var/db/repos/google
"layman" for example (/var/lib/layman/google2)=/var/db/repos/google2
"local overlay" for example (/var/lib/local_overlay/google3)=/var/db/repos/google3

it does not matter where you have them as long as you know where they are but for me with many computers to handle it is a good idea to have Gentoo at the same place.i dont know in the future but for now i will hold :

layman=/var/lib/layman/google2
local overlay=/var/lib/local_overlay/google3

regards hedmo
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1464

PostPosted: Mon Dec 23, 2019 11:43 am    Post subject: Reply with quote

hedmo wrote:

Edit:about :


I have now decided to keep all repos in one place.
Code:
/var/db/repos # ls
gentoo  layman  localrepo


How it works with "eselect repository XXX", I haven't tested it.

greetings
Ma
_________________
Thank you for your attention, interest and support.
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7412

PostPosted: Mon Dec 23, 2019 3:06 pm    Post subject: Reply with quote

using /var/cache locations is breaking LFHS, the /var/cache location is to hold datas nobody cares except an application, with the sole purpose to speed up, missing the datas that were in them may imply only a slow down, never a breakage.
loosing sources and binpkg will break user system (first idea of binpkg wasn't to be use as shortcut or backup, but for non networked user usage)

/var/cache should always be a safe location to delete without looking into it, it is perfectly fine to have a script that clear it or to clear it to get back some space without trouble.

How ironic it is to break LFHS to be compliant with LFHS !
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1108
Location: sweden

PostPosted: Mon Dec 23, 2019 3:51 pm    Post subject: Reply with quote

krinn wrote:
using /var/cache locations is breaking LFHS, the /var/cache location is to hold datas nobody cares except an application, with the sole purpose to speed up, missing the datas that were in them may imply only a slow down, never a breakage.
loosing sources and binpkg will break user system (first idea of binpkg wasn't to be use as shortcut or backup, but for non networked user usage)

/var/cache should always be a safe location to delete without looking into it, it is perfectly fine to have a script that clear it or to clear it to get back some space without trouble.

How ironic it is to break LFHS to be compliant with LFHS !


krinn

this is the default that Gentoo is using so why have they moved it?.but i understand you about /var/cache/binpkg and if you care about stuff in /var/cache,move it......that is the best about gentoo.i have more then one gentoo box and if someone gets in trouble,i can always lend from another.this is what i did with /etc/portage/repos.conf/gentoo.conf.


regards hedmo
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10459
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Dec 23, 2019 3:58 pm    Post subject: Reply with quote

It's true that it's trivial to change the default, but the default should make sense. krinn, I hadn't picked up on this. Worth a bug maybe?

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7412

PostPosted: Mon Dec 23, 2019 4:06 pm    Post subject: Reply with quote

John R. Graham wrote:
It's true that it's trivial to change the default, but the default should make sense. krinn, I hadn't picked up on this. Worth a bug maybe?

- John

It should be worth a bug of course.
How could changing a location to be compliant with LFHS into a location not compliant with it is a better step? If it's to do that, no change is need
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4622
Location: Dallas area

PostPosted: Mon Dec 23, 2019 4:11 pm    Post subject: Reply with quote

I just modified the location= to be where I've always had them /usr/portage & /usr/local/portage.

I'd have to retrain my fingers for a new location, not worth it IMO.
_________________
PRIME x570-pro, 3700x, RX 550 & 560
Acer E5-575 (laptop), i3-7100u - i965
---both---
5.5.18 zen kernel, gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 18489

PostPosted: Mon Dec 23, 2019 10:32 pm    Post subject: Reply with quote

Anon-E-moose wrote:
I just modified the location= to be where I've always had them /usr/portage & /usr/local/portage.

I'd have to retrain my fingers for a new location, not worth it IMO.
I switched from /usr/portage to /var/portage a long time ago. I recently switched to the new /var/db/repos, and the muscle memory difference is less than an improvement :). I'm not sure where I'm going to put them, but it won't be /var/db/repos for much longer.
_________________
The media sells it and you live the role.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3780
Location: Illinois, USA

PostPosted: Mon Dec 23, 2019 11:26 pm    Post subject: Reply with quote

Anon-E-moose wrote:
I just modified the location= to be where I've always had them /usr/portage & /usr/local/portage.

I'd have to retrain my fingers for a new location, not worth it IMO.

A little more work but I created the new locations as symlinks to the old locations.

EDIT:
/var is the new root /
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
Goto page 1, 2  Next
Page 1 of 2

 
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