FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Embedded

 
 
LinkBack Thread Tools
 
Old 10-08-2010, 06:31 AM
Joakim Tjernlund
 
Default crossdev improvements

Mike Frysinger <vapier@gentoo.org> wrote on 2010/10/08 04:54:07:
>
> On Saturday, September 25, 2010 13:11:26 Joakim Tjernlund wrote:
> > setup_portage_vars() {
> > + PORTAGE_CONFIGROOT=$(portageq envvar PORTAGE_CONFIGROOT)
>
> is this necessary ? you cant really put PORTAGE_CONFIGROOT in /etc/make.conf
> as you hit a chicken & egg problem ...

Never got that far, tried it but run into some other problem related to
my private portage tree so I really don't know.

Removing PKGDIR worked OK though, I think my Remove PKGDIR patch is fine.
 
Old 10-08-2010, 06:37 AM
Joakim Tjernlund
 
Default crossdev improvements

Mike Frysinger <vapier@gentoo.org> wrote on 2010/10/08 05:06:13:
>
> On Friday, October 01, 2010 02:56:07 Joakim Tjernlund wrote:
> > Mike Frysinger <vapier@gentoo.org> wrote on 2010/10/01 02:36:44:
> > > On Thursday, September 30, 2010 11:38:58 Joakim Tjernlund wrote:
> > > > Next problem, how do I force other computers to use the bin pkg? Unless
> > > > one passes -G to emerge, emerge rebuilds the pkg and I don't want that
> > > > as I have passed EXTRA_ECONF args and added a small patch to glibc as
> > > > well.
> > >
> > > man emerge -> -K
> >
> > Thanks, but this is not quite what I want. This depends on the user
> > actually passing -K to emerge. I realize I want something like the
> > different -bin ebuilds in portage such as openoffice-bin or firefox-bin.
> > Any pointers on how to create a -bin ebuild from the binary pkgs I
> > get form crossdev ... -portage -b ?
>
> portage has no support for changing PN on the fly

Yeah, I came to the same conclusion. I used qlist and tar instead:
TARGET="powerpc-e300c2-linux-gnu"
MY_ROOT="/usr/${TARGET}"
mkdir -p /tmp/${TARGET}
qlist --quiet --all ${TARGET} > /tmp/${TARGET}/cross-tools
ROOT=${MY_ROOT} qlist --quiet --all > /tmp/${TARGET}/pkgs
#prefix all paths with our target root prefix
sed -i s:/:${MY_ROOT}/: /tmp/${TARGET}/pkgs
tar czf /tmp/${TARGET}.tgz -T /tmp/${TARGET}/cross-tools
-T /tmp/${TARGET}/pkgs

Would be nice if one could get rid of the sed hack by adding
an option to qlist to list the true abs path.

Jocke
 
Old 10-08-2010, 07:32 AM
Joakim Tjernlund
 
Default crossdev improvements

Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote on 2010/10/08 08:37:51:
>
> Mike Frysinger <vapier@gentoo.org> wrote on 2010/10/08 05:06:13:
> >
> > On Friday, October 01, 2010 02:56:07 Joakim Tjernlund wrote:
> > > Mike Frysinger <vapier@gentoo.org> wrote on 2010/10/01 02:36:44:
> > > > On Thursday, September 30, 2010 11:38:58 Joakim Tjernlund wrote:
> > > > > Next problem, how do I force other computers to use the bin pkg? Unless
> > > > > one passes -G to emerge, emerge rebuilds the pkg and I don't want that
> > > > > as I have passed EXTRA_ECONF args and added a small patch to glibc as
> > > > > well.
> > > >
> > > > man emerge -> -K
> > >
> > > Thanks, but this is not quite what I want. This depends on the user
> > > actually passing -K to emerge. I realize I want something like the
> > > different -bin ebuilds in portage such as openoffice-bin or firefox-bin.
> > > Any pointers on how to create a -bin ebuild from the binary pkgs I
> > > get form crossdev ... -portage -b ?
> >
> > portage has no support for changing PN on the fly
>
> Yeah, I came to the same conclusion. I used qlist and tar instead:
> TARGET="powerpc-e300c2-linux-gnu"
> MY_ROOT="/usr/${TARGET}"
> mkdir -p /tmp/${TARGET}
> qlist --quiet --all ${TARGET} > /tmp/${TARGET}/cross-tools
> ROOT=${MY_ROOT} qlist --quiet --all > /tmp/${TARGET}/pkgs
> #prefix all paths with our target root prefix
> sed -i s:/:${MY_ROOT}/: /tmp/${TARGET}/pkgs
> tar czf /tmp/${TARGET}.tgz -T /tmp/${TARGET}/cross-tools
> -T /tmp/${TARGET}/pkgs
>
> Would be nice if one could get rid of the sed hack by adding
> an option to qlist to list the true abs path.

Perhaps a --root=${MY_ROOT} option?
Use like this:
qlist --root=${MY_ROOT} --quiet --all
instead of
ROOT=${MY_ROOT} qlist --quiet --all
The difference being --root lists the abs path, including ${MY_ROOT}

Jocke
 
Old 10-08-2010, 08:09 AM
Joakim Tjernlund
 
Default crossdev improvements

Mike Frysinger <vapier@gentoo.org> wrote on 2010/10/08 04:54:07:
>
> On Saturday, September 25, 2010 13:11:26 Joakim Tjernlund wrote:
> > setup_portage_vars() {
> > + PORTAGE_CONFIGROOT=$(portageq envvar PORTAGE_CONFIGROOT)
>
> is this necessary ? you cant really put PORTAGE_CONFIGROOT in /etc/make.conf
> as you hit a chicken & egg problem ...

Perhaps this is better:
 
Old 10-08-2010, 08:20 AM
Mike Frysinger
 
Default crossdev improvements

On Friday, October 08, 2010 03:32:55 Joakim Tjernlund wrote:
> Joakim Tjernlund wrote on 2010/10/08 08:37:51:
> > Yeah, I came to the same conclusion. I used qlist and tar instead:
> > TARGET="powerpc-e300c2-linux-gnu"
> > MY_ROOT="/usr/${TARGET}"
> > mkdir -p /tmp/${TARGET}
> > qlist --quiet --all ${TARGET} > /tmp/${TARGET}/cross-tools
> > ROOT=${MY_ROOT} qlist --quiet --all > /tmp/${TARGET}/pkgs
> > #prefix all paths with our target root prefix
> > sed -i s:/:${MY_ROOT}/: /tmp/${TARGET}/pkgs
> > tar czf /tmp/${TARGET}.tgz -T /tmp/${TARGET}/cross-tools
> > -T /tmp/${TARGET}/pkgs
> >
> > Would be nice if one could get rid of the sed hack by adding
> > an option to qlist to list the true abs path.
>
> Perhaps a --root=${MY_ROOT} option?
> Use like this:
> qlist --root=${MY_ROOT} --quiet --all
> instead of
> ROOT=${MY_ROOT} qlist --quiet --all
> The difference being --root lists the abs path, including ${MY_ROOT}

tar has a --transform option

i dont think the behavior you propose is intuitive. better to have a
dedicated option to control this behavior (if we choose to include it) ...
-mike
 
Old 10-08-2010, 08:23 AM
Mike Frysinger
 
Default crossdev improvements

On Friday, October 08, 2010 04:09:17 Joakim Tjernlund wrote:
> -source /etc/init.d/functions.sh || exit 1
> +export PORTAGE_CONFIGROOT=${PORTAGE_CONFIGROOT:-/}
> +
> +source ${PORTAGE_CONFIGROOT}/etc/init.d/functions.sh || exit 1

why do you need to source this from the configroot ? this seems to violate
the intended purpose of the configroot variable ...

the rest looks straight forward enough ...
-mike
 
Old 10-08-2010, 09:01 AM
Mike Frysinger
 
Default crossdev improvements

On Friday, September 24, 2010 12:01:21 Joakim Tjernlund wrote:
> - make crossdev respect PORTAGE_CONFIGROOT. We use our own portage
> tree for our pkgs, including the compiler, as we want to be able
> to recreate/rebuild the same sw versions in the future.

try this:
diff --git a/crossdev b/crossdev
index c35a2ed..a782d19 100755
--- a/crossdev
+++ b/crossdev
@@ -12,6 +12,8 @@ if [[ ${ROOT:-/} != "/" ]] ; then
exit 2
fi

+CONFIGROOT="${PORTAGE_CONFIGROOT}/etc/portage"
+
source /etc/init.d/functions.sh || exit 1
esyslog() { :; }
die() {
@@ -265,9 +267,9 @@ uninstall() {

[[ -d ${PORTDIR_OVERLAY}/cross-${CTARGET} ]]
&& rm -r ${PORTDIR_OVERLAY}/cross-${CTARGET}
- sed -i -e "/^cross-${CTARGET}$/d" /etc/portage/categories
+ sed -i -e "/^cross-${CTARGET}$/d" "${CONFIGROOT}"/categories
for f in package.{mask,keywords,use} ; do
- f="/etc/portage/${f}"
+ f="${CONFIGROOT}/${f}"
if [[ -d ${f} ]] ; then
rm -f "${f}"/cross-${CTARGET}
rmdir "${f}" 2>/dev/null
@@ -275,8 +277,8 @@ uninstall() {
sed -i -e "/cross-${CTARGET}//d" "${f}"
fi
done
- rm -rf /etc/portage/env/cross-${CTARGET}
- rmdir /etc/portage/env 2>/dev/null
+ rm -rf "${CONFIGROOT}"/env/cross-${CTARGET}
+ rmdir "${CONFIGROOT}"/env 2>/dev/null

rmdir /var/db/pkg/cross-${CTARGET} 2>/dev/null
if [[ -d /var/db/pkg/cross-${CTARGET} ]] ; then
@@ -461,14 +463,15 @@ fi

# grab user settings
for v in ABI UCLIBC_CPU USE BVER GVER KVER LVER STAGE CFLAGS LDFLAGS ASFLAGS
; do
- if [[ -e /etc/portage/crossdev/${CTARGET}/${v} ]] ; then
+ d="${CONFIGROOT}/crossdev/${CTARGET}"
+ if [[ -e ${d}/${v} ]] ; then
# yes, quotes are needed in this instance (export $var="...")
- export ${v}="$(</etc/portage/crossdev/${CTARGET}/${v})"
+ export ${v}="$(<"${d}"/${v})"
einfo "Restoring user setting '${v}' to '${!v}'"
fi
- if [[ -e /etc/portage/crossdev/${CTARGET}/env ]] ; then
+ if [[ -e ${d}/env ]] ; then
einfo "Restoring generic user env settings"
- source /etc/portage/crossdev/${CTARGET}/env
+ source "${d}"/env
fi
done

@@ -509,6 +512,7 @@ einfo "Extra: insight: DO IT"
echo
einfo "PORTDIR_OVERLAY: ${PORTDIR_OVERLAY}"
einfo "PORT_LOGDIR: ${PORT_LOGDIR}"
+einfo "PORTAGE_CONFIGROOT: ${PORTAGE_CONFIGROOT}"
hr
) >& "${PORT_LOGDIR}"/cross-${CTARGET}-info.log || exit 1
cat "${PORT_LOGDIR}"/cross-${CTARGET}-info.log
@@ -616,15 +620,15 @@ set_portage() {
set_env ${pkg} "${env}"
}

-mkdir -p /etc/portage
-check_trailing_newline /etc/portage/categories
-grep -qs "^cross-${CTARGET}$" /etc/portage/categories
- || echo cross-${CTARGET} >> /etc/portage/categories
-mkdir -p "${PORTDIR_OVERLAY}"/cross-${CTARGET}
-cd /etc/portage
+mkdir -p "${CONFIGROOT}"
+check_trailing_newline "${CONFIGROOT}"/categories
+grep -qs "^cross-${CTARGET}$" "${CONFIGROOT}"/categories
+ || echo cross-${CTARGET} >> "${CONFIGROOT}"/categories
+mkdir -p "${PORTDIR_OVERLAY}"/cross-${CTARGET} || exit 1
+cd "${CONFIGROOT}"
for f in package.{keywords,mask,use} ; do
[[ -f ${f} ]] && continue
- mkdir -p ${f}
+ mkdir -p ${f} || exit 1
rm -f ${f}/cross-${CTARGET}
done

-mike
 
Old 10-08-2010, 09:07 AM
Joakim Tjernlund
 
Default crossdev improvements

Mike Frysinger <vapier@gentoo.org> wrote on 2010/10/08 10:23:24:
>
> On Friday, October 08, 2010 04:09:17 Joakim Tjernlund wrote:
> > -source /etc/init.d/functions.sh || exit 1
> > +export PORTAGE_CONFIGROOT=${PORTAGE_CONFIGROOT:-/}
> > +
> > +source ${PORTAGE_CONFIGROOT}/etc/init.d/functions.sh || exit 1
>
> why do you need to source this from the configroot ? this seems to violate
> the intended purpose of the configroot variable ...

It felt right, but I don't really know. Remove it.

Jocke
 
Old 10-08-2010, 09:37 AM
Joakim Tjernlund
 
Default crossdev improvements

Mike Frysinger <vapier@gentoo.org> wrote on 2010/10/08 10:20:22:
>
> On Friday, October 08, 2010 03:32:55 Joakim Tjernlund wrote:
> > Joakim Tjernlund wrote on 2010/10/08 08:37:51:
> > > Yeah, I came to the same conclusion. I used qlist and tar instead:
> > > TARGET="powerpc-e300c2-linux-gnu"
> > > MY_ROOT="/usr/${TARGET}"
> > > mkdir -p /tmp/${TARGET}
> > > qlist --quiet --all ${TARGET} > /tmp/${TARGET}/cross-tools
> > > ROOT=${MY_ROOT} qlist --quiet --all > /tmp/${TARGET}/pkgs
> > > #prefix all paths with our target root prefix
> > > sed -i s:/:${MY_ROOT}/: /tmp/${TARGET}/pkgs
> > > tar czf /tmp/${TARGET}.tgz -T /tmp/${TARGET}/cross-tools
> > > -T /tmp/${TARGET}/pkgs
> > >
> > > Would be nice if one could get rid of the sed hack by adding
> > > an option to qlist to list the true abs path.
> >
> > Perhaps a --root=${MY_ROOT} option?
> > Use like this:
> > qlist --root=${MY_ROOT} --quiet --all
> > instead of
> > ROOT=${MY_ROOT} qlist --quiet --all
> > The difference being --root lists the abs path, including ${MY_ROOT}
>
> tar has a --transform option

Ah, tried it and it doesn't seem to work for me.
It appears tar applies the transform after reading the files
from the file system

>
> i dont think the behavior you propose is intuitive. better to have a
> dedicated option to control this behavior (if we choose to include it) ...

OK, perhaps --abspath will do?

jocke
 
Old 10-08-2010, 09:45 AM
Joakim Tjernlund
 
Default crossdev improvements

Mike Frysinger <vapier@gentoo.org> wrote on 2010/10/08 11:01:57:
>
> On Friday, September 24, 2010 12:01:21 Joakim Tjernlund wrote:
> > - make crossdev respect PORTAGE_CONFIGROOT. We use our own portage
> > tree for our pkgs, including the compiler, as we want to be able
> > to recreate/rebuild the same sw versions in the future.
>
> try this:

My mail client trashed it, can you sent it as an attachment?
 

Thread Tools




All times are GMT. The time now is 11:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org