view sources/native-builds/gentoo-bootstrap/build/portage-build @ 1252:ba951c11fb48

Refactor the gentoo bootstrap build some more. Add "build" and "files" subdirectories, split each package build into a separate file, break out reusable shell functions into Flow control now init chrooting into calling the individual package scripts.
author Rob Landley <>
date Sat, 25 Sep 2010 13:40:04 -0500
line wrap: on
line source


. /mnt/

# Portage isn't really designed to be portable, so this script contains
# the "make install" stage that portage really should have within itself.

set_titlebar "portage" && cd /mnt/portage &&

# Install portage user/group, and libraries.

echo portage:x:250:250:portage:/var/tmp/portage:/bin/false >> /etc/passwd &&
echo portage::250:portage >> /etc/group &&
mkdir -p /usr/lib/portage &&
cp -a bin pym /usr/lib/portage/ &&

# Add portage python modules to the python search path.

echo /usr/lib/portage/pym > /usr/lib/python2.6/site-packages/gentoo.pth ||
  exit 1

# Install portage binaries into bin and sbin

for i in archive-conf dispatch-conf emaint emerge-webrsync env-update \
         etc-update fixpackages quickpkg regenworld
  ln /usr/lib/portage/bin/$i /usr/sbin/$i || exit 1

for i in  ebuild egencache emerge portageq repoman
  ln /usr/lib/portage/bin/$i /usr/bin/$i || exit 1

# Install portage man pages

cp cnf/make.globals /etc/ &&
cp man/*.1 /usr/man/man1 &&
cp man/*.5 /usr/man/man5 &&

mkdir -p /var/log /etc/portage/profile || exit 1