View previous topic :: View next topic |
Author |
Message |
Adel Ahmed Veteran
Joined: 21 Sep 2012 Posts: 1533
|
Posted: Wed Jan 19, 2022 5:06 pm Post subject: unable to bootstrap stage2 |
|
|
I am creating this prefix on a prefix in an android device(had to use the prefix for gcc and bash...etc)
Code: | localhost /data/hdd/bootstrap # time ${EPREFIX}/bootstrap-prefix.sh ${EPREFIX} stage2
* Bootstrapping Gentoo prefixed portage installation using
* host: armv7l-pc-linux-gnu
* prefix: /data/hdd/bootstrap
* ready to bootstrap stage2
* Triggering Linux RAP bootstrap
USE=-acl -berkdb -fortran -gdbm -git -libcxx -nls -pcre -python -qmanifest -qtegrity -readline -sanitize bootstrap clang internal-glib PKG=sys-devel/gnuconfig
Failed to validate a sane '/dev'.
bash process substitution doesn't work; this may be an indication of a broken '/dev/fd'.
localhost /data/hdd/bootstrap # ls -l /dev/fd
lrwxrwxrwx 1 root root 13 Jan 19 16:00 /dev/fd -> /proc/self/fd
localhost /data/hdd/bootstrap # ls -l /proc/self/fd
total 0
lrwx------ 1 root root 64 Jan 19 17:06 0 -> /dev/pts/1
lrwx------ 1 root root 64 Jan 19 17:06 1 -> /dev/pts/1
lrwx------ 1 root root 64 Jan 19 17:06 2 -> /dev/pts/1
lr-x------ 1 root root 64 Jan 19 17:06 3 -> /proc/29605/fd
|
any idea? |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3918
|
|
Back to top |
|
|
Adel Ahmed Veteran
Joined: 21 Sep 2012 Posts: 1533
|
Posted: Thu Jan 20, 2022 7:07 am Post subject: |
|
|
it's a prefix, not a chroot, so I do not bind mount /dev it is there when I execute the ./startprefix that comes with the prefix.
Code: | localhost /data/hdd/prefix # cat startprefix
#!/data/gentoo/bin/bash
# Copyright 2006-2010 Gentoo Foundation; Distributed under the GPL v2
# $Id: startprefix.in 61219 2012-09-04 19:05:55Z grobian $
# Fabian Groffen <grobian@gentoo.org> -- 2007-03-10
# Enters the prefix environment by starting a login shell from the
# prefix. The SHELL environment variable is elevated in order to make
# applications that start login shells to work, such as `screen`.
# if you come from a substantially polluted environment (another
# Prefix), a cleanup as follows resolves most oddities I've ever seen:
# env -i HOME=$HOME TERM=$TERM USER=$USER $SHELL -l
# hence this script starts the Prefix shell like this
# What is our prefix?
EPREFIX="/data/gentoo"
# some adb has LD_PRELOAD polluted.
unset LD_PRELOAD
# Prepare basic directories for Android
export PATH="${EPREFIX}/bin:${EPREFIX}/usr/bin:${PATH}"
if grep -q 'rootfs.*ro' /proc/mounts; then
/system/bin/mount -o remount,rw / || exit 1
fi
sl=( /bin/sh /usr/bin/env )
# /bin/pwd is required by perl cwd
sl+=( /bin/pwd )
# /bin/ln is required by sys-libs/slang
sl+=( /bin/ln )
# /usr/include/errno.h is required by perl Errno_pm.PL
# /usr/include/sys/param.h is required by perl FileCache.pm
sl+=( /usr/include/{sys/param,errno}.h )
# python h2py linux
sl+=( /usr/include/{sys/types,netinet/in,dlfcn,linux/cdrom}.h )
for f in ${sl[@]}; do
dir=$(dirname $f)
[[ -d $dir ]] || mkdir -p $dir || exit 1
[[ -x $f ]] || ln -sf "${EPREFIX}"$f $f || exit 1
done
if [[ ! -d /tmp ]]; then
mkdir /tmp || exit 1
/system/bin/mount -t tmpfs tmpfs /tmp
fi
[[ -d /dev/fd ]] || ln -sf /proc/self/fd /dev/
if [[ ${SHELL#${EPREFIX}} != ${SHELL} ]] ; then
echo "You appear to be in prefix already (SHELL=$SHELL)" > /dev/stderr
exit -1
fi
# not all systems have the same location for shells, however what it
# boils down to, is that we need to know what the shell is, and then we
# can find it in the bin dir of our prefix
# SHELL=${SHELL##*/}
SHELL=bash
# set the prefix shell in the environment
export SHELL=${EPREFIX}/bin/${SHELL}
# check if the shell exists
if [[ ! -x $SHELL ]] ; then
echo "Failed to find the Prefix shell, this is probably" > /dev/stderr
echo "because you didn't emerge the shell ${SHELL##*/}" > /dev/stderr
exit -1
fi
# give a small notice
echo "Entering Gentoo Prefix ${EPREFIX}"
# start the login shell, clean the entire environment but what's needed
# PROFILEREAD is necessary on SUSE not to wipe the env on shell start
[[ -n ${PROFILEREAD} ]] && DOPROFILEREAD="PROFILEREAD=${PROFILEREAD}"
/data/gentoo/usr/bin/env -i HOME=$HOME TERM=$TERM USER=$USER SHELL=$SHELL $DOPROFILEREAD $SHELL -l
# and leave a message when we exit... the shell might return non-zero
# without having real problems, so don't send alarming messages about
# that
echo "Leaving Gentoo Prefix with exit status $?"
|
|
|
Back to top |
|
|
Adel Ahmed Veteran
Joined: 21 Sep 2012 Posts: 1533
|
Posted: Thu Jan 20, 2022 11:37 am Post subject: |
|
|
I have tried the same procedure on a different phone(sony xperia M) and got the same error. |
|
Back to top |
|
|
|