Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 457148 - Suggest using stage3 chroot for old systems
Summary: Suggest using stage3 chroot for old systems
Alias: None
Product: [OLD] Docs on
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
Depends on:
Reported: 2013-02-13 19:17 UTC by Michał Górny
Modified: 2013-04-06 12:09 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-02-13 19:17:47 UTC
I think it would be helpful if our upgrade guides suggested using the following method for really outdated systems: extracting a stage3 into a chroot, bind-mount host system, and upgrading it using 'ROOT=... emerge ...' inside the chroot.
Comment 1 Zac Medico gentoo-dev 2013-04-03 15:03:45 UTC
Maybe it makes sense for the portage team to maintain this kind of doc. I was thinking about creating a doc like this to go along with this other one:
Comment 2 Sven Vermeulen (RETIRED) gentoo-dev 2013-04-06 07:58:52 UTC
I don't mind updating the upgrade guides (but I'm not against a separate doc maintained by the Portage team as Zac suggested, and then only link to it in the upgrade guide).

However, I'm a bit at loss with the instructions you gave. If we extract stage3 in a chroot, but then bind-mount the host system on top of it, doesn't that remove the stage3 again? Or do you think in the other order (i.e. first bind-mount, then extract stage3)?
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-04-06 08:59:00 UTC
Let me write that a bit clearer :).

Step 1: create a temporary build root, say, /mnt/build and unpack stage3 there. Prepare the build root for chroot, so like:

  mkdir /mnt/build
  cd /mnt/build
  tar -xf ...
  mount --bind /dev dev

Step 2: create a mount point for the host system inside the chroot and bind-mount it there.

  mkdir /mnt/build/mnt/host
  mount --rbind / /mnt/build/mnt/host

Step 3: enter the chroot and upgrade the host system using portage's ROOT support.

  chroot /mnt/build
  ROOT=/mnt/host emerge -1v portage [and potentially others]

This way, the packages in host system can be updated using build tools from stage3 even if the host system is way too old to be able to handle the upgrade itself.
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2013-04-06 11:51:00 UTC
Aha, makes sense. /me goes after a cup of coffee.

@Zac: I'll put this in the upgrade guide for now, but when you guys would like to maintain a similar document, just give me a shout and I'll point towards the new doc.
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2013-04-06 12:09:23 UTC
Committed to the tree; Michał, thanks for the instructions!