From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1S3G32-0007Zg-LR for garchives@archives.gentoo.org; Fri, 02 Mar 2012 00:08:37 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1AB60E0908 for ; Fri, 2 Mar 2012 00:08:35 +0000 (UTC) Received: from toothrot.meleeweb.net (fr1.as29.net [88.190.23.70]) by pigeon.gentoo.org (Postfix) with ESMTP id C5394E05ED for ; Thu, 1 Mar 2012 23:11:17 +0000 (UTC) Received: from scabb.meleeweb.net ([82.66.45.165] helo=otis.scabb) by toothrot.meleeweb.net with esmtps (TLSv1:AES256-SHA:256 []) id 1S3F9X-0004D2-P7 for gentoo-embedded@lists.gentoo.org; Fri, 02 Mar 2012 00:11:15 +0100 Received: from lemonhead.scabb ([192.168.34.11]) by otis.scabb (envelope-from ) with esmtp id 1S3F9X-00041X-8d for gentoo-embedded@lists.gentoo.org; Fri, 02 Mar 2012 00:11:15 +0100 Date: Fri, 2 Mar 2012 00:11:15 +0100 From: Bertrand Jacquin To: gentoo-embedded@lists.gentoo.org Subject: Re: [gentoo-embedded] multi-project workflow Message-ID: <20120301231115.GE29220@lemonhead.scabb> References: <20120122233723.GA21870@titan.lakedaemon.net> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-embedded@lists.gentoo.org Reply-to: gentoo-embedded@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d8Lz2Tf5e5STOWUP" Content-Disposition: inline In-Reply-To: <20120122233723.GA21870@titan.lakedaemon.net> Jabber-ID: beber@meleeweb.net X-GPG-Key: 0x39BB8CF4 X-GPG-DirectLink: https://www.cacert.org/gpg.php?id=3&cert=14964 X-GPG-Fingerprint: 2CBD 6A23 D980 3E32 66D1 573D 89B8 C953 39BB 8CF4 X-Pants: Off User-Agent: Mutt/1.5.21 (2010-09-15) X-Archives-Salt: 353e6627-e8e3-426d-876d-60dd02d4b6dc X-Archives-Hash: d89b806a90816b8d56973b884336b723 --d8Lz2Tf5e5STOWUP Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, This is a good question that I try to resolv for some times, and actually here is the solution I use. For my use, this is a bit more complex than one toolchain for multiple projects as I use different toolchains for one project, and have many projects. So I decline this in (what I call) PLATFORM and VARIANT that I call PLATFORM-VARIANT. PLATFORM is generally a hardware type and VARIANT the main project. For exemple I have : - PLATFORM=3Dalix3-i586 VARIANT=3Dmaintenance that use i586-pc-linux-gnu- = toolchain - PLATFORM=3Dalix3-i586 VARIANT=3Dfirmware that use i586-pc-linux-uclibc- = toolchain Toolchains are created with crossdev (without any patches or specific things). Then my bunch of scripts. This is a not really completed and some parts are hardcoded (aka ROOT=3D/data/cross). Once toolchains are made, I use variant-init that create : $ROOT/$PLATFORM/$VARIANT/etc $ROOT/$PLATFORM/$VARIANT/etc/make.profile -> /usr/portage/profiles/embedded $ROOT/etc/portage/make.conf-$PLATFORM-$VARIANT $PLATFORM-$VARIANT-emerge -> emerge-wrapper $PLATFORM-$VARIANT-q -> wrapper-q $PLATFORM-$VARIANT-etc-update -> wrapper-etc-update The ROOT for each project is /data/cross/$PLATFORM/$VARIANT $PLATFORM-$VARIANT-q and $PLATFORM-$VARIANT-etc-update are simple wrapper to q and etc-update that performs things in ROOT. All the portage configuration goes into $ROOT/etc to simplify things, let's talk later about how to have specific things for PLATFORM and VARIANT. $PLATFORM-$VARIANT-emerge (the symlink) is mostly a wrapper to emerge-wrapp= er from crossdev that export some variables : - PORTAGE_CONFIGROOT=3D/data/cross/$PLATFORM/$VARIANT - ROOT - SYSROOT - original CHOST and ELIBC This is also responsible to sync /data/cross/etc/portage to /data/cross/$PLATFORM/$VARIANT/etc/portage with some variances : All files in /data/cross/etc/portage that have leading name *-$PLATEFORM-$VARIANT are priorise, then *-$PLATEFORM So I get then following in my /data/cross/etc/portage : /data/cross/etc/portage/package.use/app-shells /data/cross/etc/portage/make.conf-alix3-i586-firmware /data/cross/etc/portage/make.conf-alix3-i586-maintenance /data/cross/etc/portage/make.conf-desktop-lemonhead /data/cross/etc/portage/make.conf-kvm32-firmware /data/cross/etc/portage/make.conf-kvm32-maintenance /data/cross/etc/portage/package.mask/sys-apps-alix3-i586-firmware /data/cross/etc/portage/package.mask/sys-apps-kvm32-firmware =2E. In this case, if I call alix3-i586-firmware-emerge then only /data/cross/etc/portage/make.conf-alix3-i586-firmware is move in /data/cross/alix3-i586/firmware/etc/portage/make.conf, all other are ignored This is to simplify portage configuration tree and avoid effort duplication. Then I have a specific make.conf that is sourced by all others for the same reason. Specific things are done in each VARIANT make.conf, generic in main one. Specific set CHOST, ARCH, E_MACHINE, ELIBC, USE and CFLAGS While generic have all the rest : - CBUILD - HOSTCC - FEATURES : collision-protect sandbox buildpkg noman noinfo nodoc -news -assume-digests fixlafiles - ROOT - SYSROOT - CFLAGS - CXXFLAGS - LDFLAGS - PKGDIR - PORTAGE_TMPDIR - PKG_CONFIG_PATH - PORTDIR - DISTDIR - EMERGE_DEFAULT_OPTS - MAKEOPTS - GENTOO_MIRRORS - FETCHCOMMAND - ... SYSROOT is always crossdev tree (for libtool and default gcc options). See #404529 While packages are build for ROOT with a SYSROOT different to ROOT, I use a specific bashrc that determin package SYSROOT dependencies and unpack .so .a and .h files to $SYSROOT (/usr/) as all my builded packages are FEATURES=3Dbuildpkg I keep trace of unpacked files and remove them from SYROOT at the end (with some exclusion (glibc, bintuils, linux-headers, gcc ...)). And another tool toolchain-clean that list unknown files in SYSROOT to keep things clean. It also fix .la files to use the SYSROOT as ROOT This bashrc also rsync $PORTAGE_CONFIGROOT/etc/portage/files to $D for generic configuration files or others things that are unrelated to generic gentoo utilisation. I added some features to sstrip files and/or upx them, you just have to declare do_upx or do_sstrip in env portage files. All the things I use are available in a tar tree here : http://people.meleeweb.net/~beber/gentoo/boest-gentoo.tgz Comments are welcome ! Beber D'ar lun 23 a viz Genver 2012 e 00 eur 37, =C2=AB Jason =C2=BB he deus skri= vet : > All, >=20 > I'm getting back into embedded projects and thus, gentoo/crossdev. > Things have changed a bit since I last used it (~4 years ago). This: >=20 > $ crossdev -S -t arm-none-linux-gnueabi >=20 > worked out of the box. Awesome! It looks like I'll want to use > arm-none-linux-gnueabi-emerge to build the target system, but before I > get started, I have a question. >=20 > How do folks out there handle multiple projects with the same toolchain? > I'm thinking, since crossdev worked so well, to just build a > 'arm-projectA-linux-gnueabi' and then 'arm-projectB-linux-gnueabi' to > keep the roots separate. >=20 > My other idea was use symlinks: >=20 > /usr/ > arm-none-linux-gnueabi/ -> projectA/ > arm-none-linux-gnueabi.orig/ > projectA/ > projectB/ > ... > projectN/ >=20 > with arm-none-linux-gnueabi.orig/ being the original contents after > crossdev built the toolchain. As I create projects, I would 'cp -a > arm....orig/* projectN/' >=20 > What do you guys use? >=20 > thx, >=20 > Jason. >=20 --=20 Beber --d8Lz2Tf5e5STOWUP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAk9QAhMACgkQibjJUzm7jPR+/gCgjwfO+bzRvqFE4ewdYeOfgUlU kc0An01PEHXgRBUephFe81gBjGiPngAf =wj6m -----END PGP SIGNATURE----- --d8Lz2Tf5e5STOWUP--