Compare commits

..

868 Commits
pyro ... edison

Author SHA1 Message Date
Harald Welte 8bb59f081a gpsd: Add patch to enable + configure PPS in TSIP (trimble) driver
In the sysmoBTS 2050, we want to configure the 1PPS output of the
trimble to be active only if it has at least 1 satellite in view,
and want to make the receiver output its time information in UTC,
rather than GPS time.
2013-10-09 23:49:18 +02:00
Holger Hans Peter Freyther 5075145814 openbsc: Big update needed after the upgrade of libosmo-abis 2013-10-09 23:49:18 +02:00
Holger Hans Peter Freyther 74b543bbb1 Merge commit '83edf1dce4ab2a5ae143d0a687c9512d2d1767ff' into edison 2013-10-06 17:08:30 +02:00
Holger Hans Peter Freyther 8062967cf3 Merge commit '0b2ae79dad71e76ebddc24d8f505724dc4ad1a45' into edison 2013-10-06 17:08:29 +02:00
Holger Hans Peter Freyther 0b2ae79dad libosmo-abis: Upgrade git version with semantic/abi changes 2013-10-06 17:05:19 +02:00
Holger Hans Peter Freyther 83edf1dce4 osmo-bts: Build against the new libosmo-abis library 2013-10-06 17:03:45 +02:00
Harald Welte e9ead4c0f3 task-sysmocom-bts: Include sbts2050-util on sysmobts-2050 2013-10-04 23:39:44 +02:00
Harald Welte e003221b02 sbts2050-util: Mark file as executable file 2013-10-04 23:38:25 +02:00
Harald Welte 5cf873f499 Add binary-only package for sbts2050-util
sbts2050-util is a small binary-only userspace program used to
interface with the sysmoBTS 2050 board management controller,
i.e. to enable/disable PA power, read power consumption/temperature
and the like.

This tool is going to disappear once the respective features have been
included in the (open source) sysmobts-util / sysmobts-mgr.  Please be
patient meanwhile.
2013-10-04 22:22:53 +02:00
Harald Welte 3c99769de2 add bb recipes for sysmobts firmware 3.4 and 3.6 2013-10-04 21:53:10 +02:00
Harald Welte a2a2d67e1a femtobts-api: Update to v3.6. Compatible with all v3.x header files. 2013-10-04 21:41:04 +02:00
Harald Welte b16ceec77f update to recent osmo-bts master to include sysmobts-util
sysmobts-util is used to set/get the model_number / trx_nr on the sysmoBTS 2050.
2013-10-04 21:40:30 +02:00
Harald Welte 7fa273ffc2 Initial support for a MACHINE="sysmobts-2050" build
The build differs in that it doesn't use a getty on ttyS0.  In the fuutre,
a modified kernel serial driver as well as a 2050-specific utility
for managing the supervisor processor will follow.
2013-10-04 21:39:52 +02:00
Holger Hans Peter Freyther 8fab0f3222 uucp: opkg works on files and not directories. Create /var/spool/uucp in postinst
Create the spool directory in the post install in case it does
not exist yet. Use the -m 0770 to begin with the right default
for this directory.
2013-08-17 19:14:10 +02:00
Holger Hans Peter Freyther 4f6d4893ce vlan: Add a vlan configuration utility as used on the OHM 2013-08-17 18:50:53 +02:00
Holger Hans Peter Freyther 44c4b09e83 Merge commit '57cc5e9c588d4f9f39f5007afdcaf94a830d1401' into edison 2013-08-01 19:50:24 +02:00
Holger Hans Peter Freyther 2f86725324 Merge commit 'f608e7e4f9bb45905839f4313a7e63b4de7e7b32' into edison 2013-08-01 19:50:23 +02:00
Holger Hans Peter Freyther 57cc5e9c58 osmo-bts: Update to an experimental version that uses libosmo-abis
This is a osmo-bts that will use libosmo-abis for OML and RSL and
is based on master. In one way it should improve quality in another
it is also testing.
2013-08-01 19:45:00 +02:00
Holger Hans Peter Freyther f608e7e4f9 libosmocore/libosmo-abis: Update libosmo-abis to an experimental branch
Update libosmocore to 0.6.2+git and the libosmo-abis to a branch
useful for the osmo-bts.
2013-08-01 19:38:32 +02:00
Holger Hans Peter Freyther ffce9e7f87 osmo-pcu: Build a 'hack'/tmp branch that exits the PCU after a BTS loss
This will make the PCU exit after a BTS is lost. This is because the
PCU is not resetting all the state and then BSSGP might not come up
properly.
2013-07-11 17:05:40 +02:00
Holger Hans Peter Freyther 1a9dd62e22 ortp: gcc 4.8 fails to compile this module because of a wrong memset 2013-07-10 12:55:12 +02:00
Holger Hans Peter Freyther f79726fdcc osmo-bts: Move to a new 0.3.0-next release with EEPROM reading 2013-06-24 08:28:02 +02:00
Holger Hans Peter Freyther f5d3fba955 sysmocom-backup: Save two more files from the etc directory
Save the ifplugd.sh script and hostname in the backup as well. I have
a usecase where these two files were modified.
2013-06-22 17:20:57 +02:00
Holger Hans Peter Freyther 03fd342e14 sysmocom-backup: Backup all of /etc/default
Additional applications might store files in /etc/default and it
is the easiest to backup up all of them. This has the danger that
after an upgrade the default file is not compatible/optimal but
we will need to deal with that once it occurs.
2013-06-22 09:48:01 +02:00
Holger Hans Peter Freyther 69d9a0609d sysmocom-backup: Backup the /etc/network/interfaces file 2013-06-22 09:36:02 +02:00
Holger Hans Peter Freyther 6e7383839c gpsd: Mark the /etc/default/gpsd as a CONFFILE 2013-06-20 20:39:11 +02:00
Holger Hans Peter Freyther 6453080cef gpsd: Make sure the sysmobts-v2 gpsd default version is installed
The sysmobts-v2 version was not installed because the file was
not called properly. Rename it to gpsd-default and the sysmobts-v2
version will be picked and installed.
2013-06-20 19:48:56 +02:00
Holger Hans Peter Freyther 57c0346f56 gpsd: Upgrade to version 3.9 in the hope of some crashes being fixed
GPSD 3.7 is somehow exiting without us really knowing the cause. The
version 3.9 has been released and we hope that it might just fix the
issues we are experiencing.
2013-06-20 18:21:28 +02:00
Holger Hans Peter Freyther 040f4432f5 osmo-bts: Upgrade to the latest sysmocom/0.3.0-next version
This introduces the auto-band that will help in managing configurations.
2013-06-20 18:21:28 +02:00
Holger Hans Peter Freyther fea919fa5d osmo-bts: Build the 0.3.0-next branch with further improvements
This is a bigger update and brings the SAPI queue, readv/writev
and realtime scheduling to the sysmobts software. This will greatly
improve the stability of the software under load.
2013-06-20 14:39:39 +02:00
Holger Hans Peter Freyther 5b35766651 gpsdate: Upgrade with a now fully working init script 2013-06-20 11:19:55 +02:00
Holger Hans Peter Freyther 3f228b8e6e gpsdate: Use SRCPV in the PV and bump the PE
Follow the Poky conventions and use SRCPV for the git package.
Bump the PR because otherwise the package is not upgradable.
2013-06-20 11:19:55 +02:00
Holger Hans Peter Freyther 16f9bbb288 gpsdate: Upgrade to a newer git version with improved init scripts 2013-06-20 11:19:55 +02:00
Holger Hans Peter Freyther 673d53bbf5 linux-sysmocom: Force a rebuild of the kernel with the new config file
The previous change modified the defconfig to not include the legacy
pseudo terminal support. Increase the version for the sysmoBTS to have
a kernel without old terminal files.
2013-06-19 20:45:16 +02:00
Holger Hans Peter Freyther 01e96dd240 linux-sysmocom: Disable the legacy PTY handling in the kernel
There is no need to have the various pty files clobber the /dev
directory when they are never used. Do not force a PR upgrade
right now as we don't have a good upgreade strategy for the v1
and the BSC config.
2013-06-19 18:18:30 +02:00
Holger Hans Peter Freyther b6dc4b91a7 gpsdate_git.bb: Use RDEPENDS_${PN} instead of RDEPENDS for dylan/master 2013-06-19 18:11:37 +02:00
Holger Hans Peter Freyther e9d0aa7cb4 misc: Use ALLOW_EMPTY_${PN} and RDEPENDS_${PN} to silent warnings
Newer versions of poky warn about ALLOW_EMPTY on non _PN versions.
2013-06-19 18:11:28 +02:00
Holger Hans Peter Freyther bd76a6f5b6 Merge commit '286a9a90cfd9ca7c8db489d5942676c8e177b751' into edison 2013-06-13 19:32:53 +02:00
Holger Hans Peter Freyther 286a9a90cf openbsc: Update the OpenBSC SRCREV
* Added NAT MGCP Statistic collection
* SMPP fixes
* BTS type sysmobts is working now
2013-06-13 19:30:15 +02:00
Holger Hans Peter Freyther 212ab87663 sysmocom-openvpn-config: Add a recipe with our generic OpenVPN client config
This way I just need to install sysmocom-openvpn-config and copy
a matching key to the device for the VPN config. The configuration
file is marked as a CONFFILE, this means that modifications to it
will not be lost during upgrade.
2013-06-07 10:30:25 +02:00
Holger Hans Peter Freyther a7946542c8 Merge commit '0c797643dd2120f3118ad4cd4b615a5a86ceb113' into edison 2013-06-06 19:43:37 +02:00
Holger Hans Peter Freyther 0c797643dd gpsdate: Use "" for variable content.
The new poky is more strict. Use quotes around the variable for
the work directory.
2013-06-01 18:54:14 +02:00
Holger Hans Peter Freyther 0ca774fc19 u-boot: Build a new version with the "force" option for the recovery 2013-06-01 18:50:54 +02:00
Holger Hans Peter Freyther f59fe37872 Merge commit '49ca632e9af816b65cd1b0f885fc8c3f4af4cdec' into edison
Conflicts:
	meta-sysmocom-bsp/recipes-sysmobts/osmo-bts/osmo-bts_git.bb
	meta-sysmocom-bsp/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb
2013-05-27 17:48:04 +02:00
Holger Hans Peter Freyther 94a82eeedd Merge commit '4214e03720bcea3776400843ac041916463b7784' into edison 2013-05-27 17:45:57 +02:00
Holger Hans Peter Freyther 5732aadd15 Allow to modify the meta directories (e.g. to resolve merge conflicts) 2013-05-27 17:45:28 +02:00
Harald Welte 49ca632e9a busybox: include support for CIFS mounting 2013-05-27 16:48:30 +02:00
Holger Hans Peter Freyther a144d1c3c0 tasks-sysmocom-tools: Move wget, ca-cacert-rootcert and sysmocom-backup to tools
We have some images that need the real wget for upgrades, the SSL
root certificate of CA-Cert but that doesn't use task-sysmocom to
build the image. Move these utilities into the tools task.
2013-05-15 12:54:27 +02:00
Harald Welte 0c79987641 gpsdate: Update to current git master (includes init script) 2013-05-12 12:00:02 +02:00
Holger Hans Peter Freyther 2761cd97f4 sysmobts-v2: Allow the rootfs to grow to the full size of the flash
The rootfs in the UBI is configured to grow to the full size of the
UBI, currently these are 999 LEBs (when there is no kernel volume)
but we had limited the LEBs the filesystem can hold to 400. After
this change the filesystem will grow from the 42MB to more than 120
MB.

I'm not sure if we really want to have a rootfs of that size but we
can at least experiment with it and see if the failure rate is changing
or not.
2013-05-11 14:32:20 +02:00
Holger Hans Peter Freyther e89d7ce77d images_types_sysmo: Add a new bbclass for creating different ubi images
For the sysmoBTS we want to include a kernel volume inside the UBI as
a fallback in case the mounting of the main kernel is failing. We still
need to modify the boot command of the bootloader to look at this UBI
and to modify the kernel to include the tun/tap modules so the kernel
will be capable of opening a OpenVPN connection.

Currently one needs to write INHERIT += images_types_sysmo into the
conf/local.conf and add ubi-sysmo to the IMAGE_FSTYPES variable.
2013-05-11 14:31:37 +02:00
Holger Hans Peter Freyther 1bca046d23 u-boot: Build a new u-boot with increase system malloc
This should be more than 10MB and should help with the ubifs
recovery needed during boot.
2013-05-10 18:12:13 +02:00
Holger Hans Peter Freyther c83652a73a gpsd: Even when disabling python we still need it to be available during build 2013-05-10 09:55:38 +02:00
Holger Hans Peter Freyther 3105854fcb osmo-pcu: Match the interface version of sysmobts with the pcu 2013-04-25 08:45:36 +02:00
Holger Hans Peter Freyther 8becd5a4bf osmo-bts: Manual upgrade of osmo-bts for reliability improvements
This is a manual upgrade. I do not want to have too many different
things in the build by merging the meta-sysmocom-bsp right now so
I am just bumping this version.
2013-04-25 08:19:10 +02:00
Holger Hans Peter Freyther f9d158b747 watchdog: Rename the master version 2013-04-11 18:44:32 +02:00
Holger Hans Peter Freyther 96c91eb8d6 watchdog: Bump the pr, depend on the $localfs to fix the systemd init
systemd is using the depedencies of the LSB section and according to
the debian documentation all applications accessing /var should depend
on the localfs. This makes the watchdog start properly on systemd systems.
2013-04-11 18:44:20 +02:00
Holger Hans Peter Freyther 9c3b75040a misc: Cleanup the RDEPENDS warning by the latest bitbake parser
This is addressing:
Variable RDEPENDS is set as not being package specific, please
fix this.
2013-04-11 18:44:07 +02:00
Holger Hans Peter Freyther 5e475b6b99 images: Remove the sanity check for including an ext3 filesystem
This sanity check is included in the used bbclass directly and to
support both Edison and master we will need to remove the custom
python code due a change in indention in the python code.
2013-04-11 18:43:51 +02:00
Holger Hans Peter Freyther 8b40a0c2f9 task-sysmocom-debug: Remove oprofile as it is quite outdated
We should use perf for future performance problems but it might
require more work (e.g. not to install the source into the -dbg
package, adding newt, etc.). But oprofile is not very nice to
use right now anyway.
2013-04-11 18:43:35 +02:00
Holger Hans Peter Freyther 4214e03720 misc: Bump PR after fixing warnings in OE-core master 2013-04-11 18:40:58 +02:00
Harald Welte fcfffacfa8 update gpsdate to git master 2013-04-10 15:17:43 +02:00
Harald Welte 920b27acba add new gpsdate recipe 2013-04-10 14:11:41 +02:00
Holger Hans Peter Freyther 336c4212e5 lmsensors-apps: Ask lmsensors to install man pages to the right directory
Ask the buildsystem to install the manpages to the mandir. This will avoid
the following warning.

WARNING: QA Issue: lmsensors-apps: Files/directories were installed but not shipped
  /usr/man
2013-04-07 16:39:58 +02:00
Holger Hans Peter Freyther 40075f5141 misc: Ignore files generated by vi 2013-04-07 16:39:58 +02:00
Holger Hans Peter Freyther 661e10551b gpsd: Fix a warning with newer bitbake parsers
RROR: There is a confusing multiline, partially commented expression on line 22 of file /home/ich/firmen/gesmokom/source/meta-sysmocom-bsp/recipes-extra/gpsd/gpsd_3.7.bb (SRC_URI[md5sum] = "52d9785eaf1a51298bb8900dbde88f98").
2013-04-07 16:39:58 +02:00
Holger Hans Peter Freyther 4a35eb9273 openbsc: Build a newer version with a linker fix for newer gcc/binutils 2013-04-07 14:57:03 +02:00
Holger Hans Peter Freyther 7782174da7 misc: Fix warnings in OE-core master to be included in the future 2013-04-07 14:57:03 +02:00
Harald Welte 558d76a412 openggsn: Add patch to reduce queue depth / memory usage 2013-03-24 09:07:25 +01:00
Holger Hans Peter Freyther 8e4991163e linux-sysmocom: Enable ext3/ext4 support for sysmobts-v1 as well
Some of our target applications require ext3/ext4 support for mounting
an MMC card. While the sysmobts-v1 hardware does not have an external
MMC card slot it is nice to have the same image available for this
hardware.
2013-03-23 09:04:12 +01:00
Christopher Larson 3a01a4f2bc layer.conf: avoid unnecessary early expansion with :=
bitbake handles immediate expansions of LAYERDIR for us automatically.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
2013-03-21 08:17:50 +01:00
Holger Hans Peter Freyther cd0d240314 meta-toolchain-sysmobts: Introduce a toolchain target for the BTS
Install the sysmobts firmware headers on top of the Osmocom toolchain.
This way the SDK can be used to re-compile both the OpenBSC and the
osmo-bts software.

Make sure the -dev package of the femtobts-api has not runtime
dependencies to a library that does not exist.
2013-03-19 19:54:02 +01:00
Holger Hans Peter Freyther 7059d16861 task-sdk-host-nativesdk: Remove qemu from the depedencies
This is a hack and has the risk of "forgetting" a dependency that
we need. This needs to be re-evaluated for each OE-Core version.
2013-03-19 19:54:02 +01:00
Holger Hans Peter Freyther d01ad496af femtobts-api_git.bb: Do not use symbolic names for the SRCREV
The name will be resolved to the hash during parse time. This will
not work when not having access to the internet. Use the sha1 sum
to make offline builds work.
2013-03-19 19:54:02 +01:00
Harald Welte 3cf0f9d338 update libosmocore 2013-03-19 10:39:40 +01:00
Harald Welte 27edfb7481 libosmocore: update to git master (log level everything fix) 2013-03-19 10:18:02 +01:00
Holger Hans Peter Freyther 6e5e1f8b9e meta-toolchain-osmo: Include the builddate in the toolchain
When updating libosmocore and other libraries we would like to
know which toolchain version is used. Add the datetime to the
filename.
2013-03-18 19:38:47 +01:00
Holger Hans Peter Freyther d9a117ed21 busybox-syslog: Increase back to notice (6) for the logging
This sadly still prints the firmware reload messages. But this is
necessary right now. The fpgadl/dspdl drivers do not log fatal
failures so the 'success' is the only information we have. This
is to be fixed in the driver.
2013-03-17 19:46:41 +01:00
Holger Hans Peter Freyther 84f23b2203 syslog: Use /media/mmcblk0p1/log to match /var/log
The nitb configuration expects /media/mmcblk0p1/log and to make it
work and match with unix naming use the singular version.
2013-03-17 19:23:39 +01:00
Harald Welte 1c3982289e osmo-bts: fix git revision. 2013-03-17 17:43:45 +01:00
Harald Welte c793b65258 osmo-pcu: Use parenthesis for osmo-bts version in RDEPENDS 2013-03-17 17:42:00 +01:00
Harald Welte 2bae25e4cd osmo-pcu: make sure to use RDEPENDS to osmo-bts with PCU IF v5
As Holger points out, we need a runtime dependency, not build time
2013-03-17 17:36:56 +01:00
Holger Hans Peter Freyther 7cb8c8d1b5 linux-sysmocom: Always compile MMC support into the kernel
Make mounting using mountall work during the first boot by putting
MMC, MMC-block and the TI Davinci into the kernel.
2013-03-17 17:31:30 +01:00
Harald Welte 410d086a5a update omso-pcu + osmo-bts to current master
This uses PCU API version 5 including RSSI measurements
2013-03-17 17:20:41 +01:00
Holger Hans Peter Freyther 87f47c8586 busybox-syslog: Log to the MMC card if present
If the first partition of a MMC card is mounted and has a logs/
directory syslog will start to write log messages to the MMC card
in the directory /media/mmcblk0p1.
2013-03-17 15:09:44 +01:00
Harald Welte 23689a489f update gsmd to current master 2013-03-17 14:48:22 +01:00
Holger Hans Peter Freyther 7389f6f2b1 busybox-ifplugd: Disable the restart target as it is not working
This issue is documented in PRJ#72. The easiest is to to keep the
old software running as everything else is racy and start-stop-daemon
does not appear to implement the --retry command. Let's see how
far we get with this workaround.
2013-03-17 14:22:55 +01:00
Holger Hans Peter Freyther b7f2cddc23 busybox: Copy the new OE-core syslog startup for the loglevel handling
We want to only log a given loglevel, backport the start up script
from OE-Core to get the LOGLEVEL variable. This removes the MARKINT
and adds DROPDUPLICATES and LOGLEVEL.
2013-03-17 13:59:28 +01:00
Holger Hans Peter Freyther 2257338267 osmo-bts: Update once more for sysvinit related scripts
* The /etc/init.d/sysmobts stop target is now working. It will
  terminate the screen, the run loop, the sysmobts and osmo-pcu.
2013-03-16 23:35:08 +01:00
Holger Hans Peter Freyther 63085244df openmoko-gsmd: Update gsmd/wavecom vendor to fix an unaligned memory access
gsmd/wavecom created unaligned memory access due making a 32bit store
to a 16bit location. The code is now using %hx to avoid this.
2013-03-16 22:27:27 +01:00
Holger Hans Peter Freyther a5d6d983ec openmoko-gsmd: Build a new version with log level changes of the syslog
* The patch is now included in a temporary branch
* LOGL_NOTICE is now used instead og the LOGL_INFO level which will
  be ignored by default on sysmocom systems.
2013-03-16 22:13:01 +01:00
Holger Hans Peter Freyther 41a683d627 linux-sysmocom: Upgrade to 3.2.40 and add two more UARTS
The kernel has been rebased to target 3.2.40 with various bug
fixes in the upstream work. The sysmobts v2 config has been
changed to allocate space for two more UARTs. These are required
for the multi-trx configuration and they make a warning go away.
2013-03-16 20:25:45 +01:00
Holger Hans Peter Freyther 99a6840eb4 osmo-bts: Upgrade for change in respawn scripts and misc fixes
* Fix the link timeout handling as found in post-review.
* Fix the set bts attr parsing due a funny parsing error.
* Sleep 10 seconds after the execution, reload DSP and FPGA firmware
2013-03-16 19:19:36 +01:00
Holger Hans Peter Freyther de0f9b5f3d uucp: We are forced to chown this after the installation
We could use "fakeroot do_install() {}" but this will still not
make the spool directory be owned by uucp. Use a postinst script
to make this up. The logic is copied from the cronie bitbake file
and we will see how this works at image creation time.
2013-03-16 18:24:41 +01:00
Holger Hans Peter Freyther aea5136f30 gpsd: Make the stop work with the busybox start-stop-daemon
The stop command did not stop the GPSD. Let the start-stop-daemon
command stop the command based only on the PID.
2013-03-16 18:01:57 +01:00
Holger Hans Peter Freyther ec29824f84 openmoko-gsmd: Use the shared osmo-service-respawn start script
* The shared script is compatible to the one currently used but
  it has the benefit of being used by more applications.
2013-03-16 11:49:22 +01:00
Holger Hans Peter Freyther 1b7bb4ae95 osmo-service-respawn: Add a shell script that spawns and respawns services
Adjust the oom_score_adj of the shell script to avoid ever beeing
killed. Adjust the score of the child and nice it. Sleep a given
interval before respawning it.

This script creates a .pid file so it can be used by a sysv init
script to stop the respawner and the client.
2013-03-16 11:34:01 +01:00
Holger Hans Peter Freyther 85d5ea4aae openbsc: Fix a typo in the variable name 2013-03-16 11:25:39 +01:00
Holger Hans Peter Freyther 675a2f814f gsmd: Fix the name of the script as it was copied from the gsmd one 2013-03-16 11:09:59 +01:00
Holger Hans Peter Freyther 0f3ea35f17 gpsd: Make sure the chrpath-native is built before packaging gpsd 2013-03-16 09:14:34 +01:00
Holger Hans Peter Freyther a7c614b3dd gsmd: This appears to be a race-free oom adjustment
Use the "() &" syntax to adjust the score before executing the new
command. This is removing the reace from the previous commit. Update
the PR to force rebuilding new packages.
2013-03-15 23:27:55 +01:00
Holger Hans Peter Freyther 3e7dbdcdba gsmd: Adjust the oom score of the monitor process
Adjust the score for the monitor process. The issue is that the
score is inherited by the process. Right now the score of the
child is adjusted _after_ the process has been spawned. This is
obviously a race condition.
2013-03-15 23:21:22 +01:00
Holger Hans Peter Freyther 90d152fcff gsmd: Simplify killing of the children
Kill the entire process group by sending it to pid 0. Found while
searching for better exec examples.
2013-03-15 22:56:26 +01:00
Holger Hans Peter Freyther 7aa59c430e gsmd: Work on stopping the respawn script and children
This is using some brute force. Make the shell script write a PID
file and on stop kill the respawn script and then all process names
that are spawned. For the stop we need to know that this is a bash
script.
2013-03-15 22:37:17 +01:00
Harald Welte 35ff59937b openmoko-gsmd: Update to git master
* reset modem at gsmd startup
* include CME ERROR 515 workaround
* include runtime loglevel setting
2013-03-15 13:05:04 +01:00
Harald Welte 209d4ec0be uucp: make sure /etc/uucp is the config path, not /usr/conf/uucp 2013-03-15 13:02:06 +01:00
Harald Welte cbb7200e61 Add UUCP recipe 2013-03-15 11:52:47 +01:00
Harald Welte fc1c332a7e add libsmpp32-dev and gpsd-dev to osmocom SDK/toolchain
libsmpp34 is needed for OsmoNITB SMPP support, and some of our systems
now run gpsd, thus people might wnat to compile applications against
libgps.
2013-03-15 10:29:56 +01:00
Harald Welte 8d7bfd23e9 ggsn.conf update: use 127.0.0.2 on sysmobts-v2 2013-03-14 22:56:05 +01:00
Harald Welte 85a4948d4b add sysmobts-v2 specific GPSD config file
FIXME: this will actually assume a GPS that is indirectly attached
to a GSM Modem which will be handled by openmoko-gsmd and forwarded via
UDP.  However, we might have a GPS receiver attached directly to the
GPS UART in other hardware versions!
2013-03-14 21:17:30 +01:00
Harald Welte 6c31e6c557 update gsmd to current master for GPS/AIS UDP forward support 2013-03-14 20:56:51 +01:00
Holger Hans Peter Freyther b6780a5826 sysmobts-firmware: Remove comment about both versions being installed
As of issue #48 we do not separate firmware for revc and revd. Remove
the comment about both versions being installed in parallel.
2013-03-14 14:03:40 +01:00
Harald Welte 29263f1625 Build openbsc with SMPP interface 2013-03-13 15:54:58 +01:00
Harald Welte b7d4da72b6 openbsc: Use git revision without SMPP build problem 2013-03-13 15:45:40 +01:00
Harald Welte 2b21fe5ad9 update libosmocore to 0.6.0 and openbsc to 0.13.0
this includes the Osmocom SMPP extensions
2013-03-13 15:33:18 +01:00
Harald Welte b67bed4d3a Add recipes for firmware v3.2 and v3.3 2013-03-13 13:48:43 +01:00
Harald Welte c71b4ead63 osmo-bts: Update to current git master
This will include
* Fix of CHAN_NR IEI in common channel RSL messages generated by BTS
* zecke/request_queueing
* Improve shutdown of DSP on exit
* various calib updates
* GSMTAP: use RxLevel and RxQual
* DSP power control bypass on ul_power_target==0
* Add radio link timeout procedure
2013-03-13 12:47:14 +01:00
Holger Hans Peter Freyther 89df7559e5 Merge commit '5b6ad0ce9dd1e35091d4114381cff51dee953195' into edison 2013-03-12 14:17:17 +01:00
Holger Hans Peter Freyther 78a632ea52 Merge commit 'b1be0d97022c6dd9ef2fbb4b6694aa240df3221a' into edison 2013-03-12 14:17:16 +01:00
Harald Welte b1be0d9702 openbsc: update to 8b29180cad875b396288a22fb252e158fa2a060a 2013-03-12 14:01:30 +01:00
Harald Welte 5b6ad0ce9d osmo-pcu: Make sure to actually build sysmobts support on v2 2013-03-09 01:05:03 +00:00
Harald Welte 766aabc563 import gpsd_3.7 recipe, taken from oe-meta.git, modified
* no longer depen on python
 * no longer depend on dbus
 * disable lots of compile options we don't need
2013-03-02 17:07:30 +01:00
Holger Hans Peter Freyther 52ddf4d91b Merge git://git.sysmocom.de/poky/meta-sysmocom-bsp into edison
e518a3224a
2013-03-02 17:06:31 +01:00
Holger Hans Peter Freyther 0473bf96d3 Merge sysmocom-generic-builder:generic-poky into edison 2013-03-02 16:54:17 +01:00
Harald Welte 9b48f833cf lrzsz: don't symlink the _send_ tools to the _receive_ program
there are two separate multi-call binaries, one for tx and one for rx
2013-03-02 15:37:53 +01:00
Harald Welte e518a3224a osmo-pcu: Only build DSP support on sysmobts v2, not also v1 2013-03-02 15:22:21 +01:00
Harald Welte ad495228e2 update gsmd to current master, MCC fix in cell log as well as GPS/AIS FWD 2013-03-02 15:20:58 +01:00
Holger Hans Peter Freyther 2b59ca73fe task-sysmocom: Add the new sysmocom-backup as dependency
Make sure the sysmocom-backup scripts are installed on the device
so customers can backup and restore these files.
2013-02-16 16:03:39 +01:00
Holger Hans Peter Freyther c4c453a1db sysmocom-backup: Create two shell scripts for backup/restore
Create shell scripts that backup and restore configuration files
used by the sysmocom products.
2013-02-16 16:02:37 +01:00
Holger Hans Peter Freyther e9379558e3 dropbear: Do not kill client connections when restarting the daemon
The upgrade of the unit broke due killing all client connections. opkg
got a SIGHUP and didn't write out the state files. Do not kill the
client connections on upgrade.
2013-02-15 19:23:36 +01:00
Holger Hans Peter Freyther 9383d3a2a6 Merge commit 'cf29168330626bd17a9cc0888149cfb3ad52fb0e' into edison 2013-02-09 14:19:37 +01:00
Harald Welte cf29168330 update osmo-bts for further ortp fixes 2013-02-09 14:19:12 +01:00
Holger Hans Peter Freyther cb0096d041 Merge commit 'bcf77644586e3d411fcae8053a3c8403013c93f1' into edison 2013-02-09 13:31:25 +01:00
Harald Welte bcf7764458 update osmo-bts for the "rtp bind-ip" related fixes 2013-02-09 13:30:42 +01:00
Holger Hans Peter Freyther ffe5723a3a Merge commit '0925b23f069d7d5786a36f90d81d2fbf3f34a20e' into edison 2013-02-09 12:22:19 +01:00
Harald Welte 0925b23f06 update libosmo-abis to include connect() / getaddrinfo() fix 2013-02-09 12:20:01 +01:00
Holger Hans Peter Freyther a060c5d2ab Merge commit '489f392cc63daf1487f4480ebc96a46652766db4' into edison 2013-02-07 15:45:01 +01:00
Harald Welte 489f392cc6 update udhcp.conf to add router/subnet/broadcast
... otherwise busybox-udhcpc is not happy with it
2013-02-07 15:44:22 +01:00
Holger Hans Peter Freyther 487211e30f Merge commit '7a9a2ddecbb2aa91b9c8ecd934299324becac1e6' into edison 2013-02-07 15:06:42 +01:00
Holger Hans Peter Freyther 2deddb9f09 Merge commit 'd0d30fee996328e4c43bc9cb2f0b04faec0c2e1b' into edison 2013-02-07 15:06:34 +01:00
Harald Welte 7a9a2ddecb update openbsc to current git master, including DB revision 3 2013-02-07 15:04:24 +01:00
Holger Hans Peter Freyther 73b77fe9ba libsmpp: Fix the parsing error by removing trailing " 2013-02-06 15:51:56 +01:00
Harald Welte d0d30fee99 sysmobts-firmware_v2.7: Fix build on sysmobts_v1 2013-02-06 15:35:17 +01:00
Harald Welte 4aad63620b openbsc: Add config file and init script for SGSN 2013-01-29 19:54:07 +01:00
Holger Hans Peter Freyther 87a6d04505 Merge commit '557e1b47baeefe01d261092222dadfb67e6d3c56' into edison 2013-01-29 15:26:40 +01:00
Holger Hans Peter Freyther 8523266bce Merge commit 'c88a4fb4c42419fabcabdb212c4ec0a5e99f076b' into edison 2013-01-29 15:26:38 +01:00
Harald Welte 557e1b47ba femtobts-api: ensure SRCREV is set on non-sysmobts machines.
COMPATIBLE_MACHINE didn't work, unfortunately.
2013-01-29 15:25:42 +01:00
Holger Hans Peter Freyther cd37803dab sysmocom-upload-bsc.sh: Add script for uploading a test build 2013-01-29 15:20:07 +01:00
Holger Hans Peter Freyther 267d7a4dab sysmocom-upload.sh: Make sure that not the wrong dir is synced 2013-01-29 15:16:35 +01:00
Holger Hans Peter Freyther c88a4fb4c4 openmoko-gsmd: Add a cell-log patch to use the RF Ctrl interface 2013-01-20 20:16:56 +01:00
Holger Hans Peter Freyther b726969f84 linux-sysmocom: Disable the debug message of the DSPDL loading code 2013-01-17 09:23:16 +01:00
Holger Hans Peter Freyther 0b9c954d0b Merge commit 'fd02a175f62968f8ecc4275c590e2d8fce6ac1cf' into edison 2013-01-15 14:11:30 +01:00
Holger Hans Peter Freyther fd02a175f6 linux-sysmocom: Upgrade the BTS kernel to 3.2.36 2013-01-15 14:10:39 +01:00
Holger Hans Peter Freyther db8e4ec0e4 Merge commit '8b61400347f7276fe74b851eb85f3df1270b6ef9' into edison 2013-01-15 13:54:32 +01:00
Holger Hans Peter Freyther 9bf7206ce7 Upload the tmp cache as well to allow to re-create the build
The git revision counter is local, upload it so one could re-use it
on a different system
2013-01-15 13:53:56 +01:00
Holger Hans Peter Freyther 8b61400347 task-core-boot: Make sure the 'kernel' package is installed
The modules depend on kernel-base (renamed kernel-3.2.35) package,
the tasks depend on some modules and nothing needed the kernel package.

In OE Core/Poky the machines depend on kernel-modules which will pull
the kernel package into the rootfs. We do it by hand using the essential
depends and bumping the PR for the task-core-boot.

I have verified that on a kernel ugrade task-core-boot will be updated
and the kernel package is installed.
2013-01-14 20:28:45 +01:00
Holger Hans Peter Freyther 7370f20647 Merge commit 'c7dc800cc506330d8c3e2cd84079a3ffdc94a22b' into edison 2013-01-14 08:58:31 +01:00
Holger Hans Peter Freyther c7dc800cc5 dropbear: Bump the PRINC after the init script fix 2013-01-14 08:53:20 +01:00
Holger Hans Peter Freyther 5368ea68f1 Merge commit 'aff7df713eb0cbed2c6c27a61310050953f566c9' into edison 2013-01-14 02:07:38 +01:00
Harald Welte aff7df713e bump version number in order to avoid backwards 'gitr3 -> gitr1' 2013-01-14 02:06:56 +01:00
Holger Hans Peter Freyther 738df59de8 Merge commit 'b92f71e94bd0c8b74e191dac72f69e20fd6edcc4' into edison 2013-01-14 01:19:47 +01:00
Holger Hans Peter Freyther e8e126f1eb Merge commit 'd8a23bc0087e898e19cee22f7b37fc44f33fc28d' into edison 2013-01-14 01:19:45 +01:00
Holger Hans Peter Freyther b92f71e94b dropbear: Make sure the dropbear key is generated on first boot
The previous patch made sure a truncated key would be re-generated
but it broke the case that there is no key at all. This code is
handling both cases now. Use quotes as code outside this method
is using them too. Use the -a and not the && operator to work with
the busybox version of [ and ].
2013-01-14 01:18:28 +01:00
Harald Welte d8a23bc008 add recipe for libsmpp34 from git.osmocom.org
this is our local version of libsmpp34 with some fixes/extensions,
mostly related to the build system.
2013-01-14 01:17:41 +01:00
Harald Welte be7111d6c6 osmo-pcu: Update to most recent version including configuration file 2013-01-14 01:16:01 +01:00
Harald Welte 5b7eff1c95 update osmo-bts to current git head
this introduces (among other things) pcu start + re-spawning support
2013-01-14 01:16:01 +01:00
Harald Welte 350981f9a8 update osmo-pcu; enable direct DSP queue access 2013-01-14 01:16:01 +01:00
Harald Welte 8c57364452 update libosmocore to current de6e4983e7f83794e45af5a70b036ed9f4437ab5
this introduces tlvp_val16_unal() and friends.
2013-01-11 19:06:38 +01:00
Harald Welte df64e62c45 update PCU git version to include NS VTY support 2013-01-11 18:46:16 +01:00
Harald Welte e74231478d task-sysmocom-bts needs to be PACKAGE_ARCH=MACHINE_ARCH
otherwise we would still end up with a sysmobts-calib dependency on the v1
hardware.
2013-01-11 18:45:15 +01:00
Harald Welte 98b850cdb7 task-sysmocom-bts: calib is sysmobts-v2-only 2013-01-11 18:45:13 +01:00
Holger Hans Peter Freyther a8c239f2a4 Merge commit '38d2ca2f3653eae020c1754b1f3270474f409226' into edison 2013-01-06 21:11:59 +01:00
Holger Hans Peter Freyther 38d2ca2f36 osmo-bts: Go back to the version from before the congress 2013-01-06 21:11:09 +01:00
Holger Hans Peter Freyther 8431d916a5 dropbear: Add an init script that removes truncated keys
It is possible that the key is truncated, remove it in this case.
2013-01-03 22:47:14 +01:00
Holger Hans Peter Freyther f9756a1ec6 osmo-bts: Another downgrade to look at broken channels 2012-12-30 16:59:42 +01:00
Holger Hans Peter Freyther 1c5bff88f1 osmo-bts: Another downgrade from the experimental branch 2012-12-30 16:50:39 +01:00
Holger Hans Peter Freyther f63bb56056 osmo-bts: Downgrade OpenBSC to have a sacch_deact variable 2012-12-30 15:56:26 +01:00
Holger Hans Peter Freyther 671337f9c8 osmo-bts: Go back to a un-modified channel release handling 2012-12-30 15:43:19 +01:00
Holger Hans Peter Freyther 99d3462a72 osmo-bts: More experimental version with channel ack/release changes/fixes 2012-12-30 11:38:39 +01:00
Holger Hans Peter Freyther 99fabcdfd6 osmo-bts: Upgrade to a test version for channel act and deact 2012-12-29 13:29:31 +01:00
Holger Hans Peter Freyther bd02fdb4a0 Merge commit '0f9b8cb7e60db99427b561195521d73fc2b12725' into edison 2012-12-27 00:31:19 +01:00
Holger Hans Peter Freyther 0f9b8cb7e6 libosmocore: Upgrade for some LAPDm fixes 2012-12-27 00:29:06 +01:00
Holger Hans Peter Freyther 6f27e12588 sysmobts-firmware: Install both 3.0.1pre and 3.1 and add symlinks
The latest release currently does not support the RevC hardware. Install
both 3.0.1pre and 3.1 (luckily ubifs compresses them) and set a symlink.
Use the EEPROM size as an indicator if we are on revD or revC hardware
and then set the symlink. It has been tested for revC and needs to be tested
on revD hardware.
2012-12-22 12:16:00 +01:00
Holger Hans Peter Freyther f8d915a370 Merge commit 'a02d4dfabf5271138bd44aaf18b5bb92bde531b6' into edison 2012-12-21 18:54:47 +01:00
Holger Hans Peter Freyther a02d4dfabf openbsc: Upgrade the OpenBSC code for the new libosmocore 2012-12-21 18:52:32 +01:00
Holger Hans Peter Freyther 790799b138 Merge commit '3e4ffca0b369300813e90a17ffe5b1768142d5f9' into edison 2012-12-21 18:45:07 +01:00
Holger Hans Peter Freyther 3e4ffca0b3 libosmocore: Upgrade for the tlvp_val16.. code
This code has an ABI incompatible change, bump the meta-telephony
version to force a rebuild of downstream.
2012-12-21 18:44:43 +01:00
Holger Hans Peter Freyther 02f61cf522 Merge commit 'f36b6907a9948411b3e35876279773ef14dfe0e7' into edison 2012-12-21 18:40:24 +01:00
Holger Hans Peter Freyther f36b6907a9 osmo-bts: Upgrade to master to get file based calibration 2012-12-21 18:39:18 +01:00
Harald Welte 55b7b92f34 osmo-bts: Update git rev + recipe changes for sysmobts v1 support
sysmobts-calib is currently only compatible with (and built for) v2.
2012-12-18 22:23:18 +01:00
Harald Welte a1aad22e4e sysmobts-firmware: Re-work the firmware and header for v1 and v2
Re-work the way we distribute the header and firmware files. The header
files may be accessed by everyone but the firmware may only be used by
owners of our device. Create a header only repository with all the header
versions of the firmware and create tarballs for specific releases that
will be provided to our customers. Use COMPATIBLE_MACHINE to pick the right
firmware and API version depending on sysmoBTSv1 and sysmoBTSv2.
2012-12-18 22:23:18 +01:00
Harald Welte 638474f669 osmo-bts: update osmo-bts to version 0.1.0 including calibration support 2012-12-18 21:02:22 +01:00
Holger Hans Peter Freyther b272d37c60 osmo-pcu: 3ef16cc04a096ea5bbec5bb4e3988cc5d16766e9 has been GCed
Upgrade the osmo-pcu version to the jolly_merge branch and change
the way the PCU is enabled for the sysmoBTSv2 hardware.
2012-12-18 20:56:29 +01:00
Holger Hans Peter Freyther 9e2fce0fba linux: Fix the symlinking of the uImage symlink in /boot/
This has been fixed in upstream of OE-Core and in newer versions
of Yocto. For Edison provide our own version of the pkg_postinst
and pkg_postrm routines. It is not clear yet if this conflicts with
newer versions of poky but all that could happen is that the symlink
is changed twice and removed twice but the command ends with a || true
so this should not cause any kind of fault.
2012-12-18 18:08:50 +01:00
Holger Hans Peter Freyther 91523445fc Merge commit 'dbb57efcd13952e8a095c902f6cb81eb1e0deda0' into edison 2012-12-18 15:43:35 +01:00
Holger Hans Peter Freyther 65e5ee8e4e Merge commit '12a1b8ea4bb636a3b862c1c2c7d2da5c71a2e8cd' into edison 2012-12-18 15:43:34 +01:00
Holger Hans Peter Freyther 12a1b8ea4b libsmpp34: Switch to the osmocom fork, apps are not installed anymore 2012-12-18 15:20:12 +01:00
Holger Hans Peter Freyther 9e130f1ac1 libsmpp34: Add the C Open SMPP34 implementation 2012-12-18 15:20:07 +01:00
Holger Hans Peter Freyther dbb57efcd1 u-boot: Upgrade for sysmoBTSv2 revision D
Build a newer u-boot for revision D hardware
2012-12-18 15:08:08 +01:00
Holger Hans Peter Freyther d6fd5c09d0 linux-sysmocom: Upgrade to 3.2.35 for RevD and general fixes 2012-12-18 15:02:35 +01:00
Holger Hans Peter Freyther ee7b9cf4fa Merge commit '9106dd27b95e97400542a6312a89c9693370a622' into edison 2012-11-25 23:06:30 +01:00
Holger Hans Peter Freyther 9106dd27b9 sysmobts: Do not print the queue underrun as notice but as debug 2012-11-25 23:04:27 +01:00
Holger Hans Peter Freyther 67ff3d4b8b Merge commit '16aafee394499e3919716426673be395e0f1a719' into edison 2012-11-25 21:14:51 +01:00
Holger Hans Peter Freyther 61eb982980 Upload the data to the testing repository 2012-11-25 21:14:15 +01:00
Holger Hans Peter Freyther 16aafee394 sysmobts: Build experimental version for a possible LAPDm UI idle frame fix 2012-11-25 21:13:13 +01:00
Holger Hans Peter Freyther 653bccdde1 Merge commit 'b13eaf470fca02110928023ed05d1ed1b09d74cc' into edison 2012-11-02 14:12:22 +01:00
Holger Hans Peter Freyther 8d053fb3ae Merge commit '3279c6791f12ccdad2121ff1337473a6ffd46b2c' into edison 2012-11-02 14:12:19 +01:00
Harald Welte b13eaf470f update git revision of osmo-bts and osmo-pcu 2012-11-02 14:00:32 +01:00
Holger Hans Peter Freyther 3279c6791f libosmo-abis: Build a git version of libosmo-abis for a leak fix
Build new unreleased version of libosmo-abis for a memory leak fix.
2012-11-02 13:50:47 +01:00
Holger Hans Peter Freyther 6f54e1b374 gsmd: Increase the PR after changing the default file 2012-11-02 13:50:17 +01:00
Harald Welte d1e0a1f78d gsmd: Use /dev/ttyS2 on sysmobts v2
only the first prototype board (on the v2B mainboard) was using ttyS0, messing
up console access.  This has been fixed in v2.x of the db9 daughterboard for
the v2C mainboards.
2012-11-02 13:50:14 +01:00
Harald Welte 6ae5eefa93 update libosmocore_git to 8ec7f901bb1843b7c29335d5ea0531e7a1527210
this includes a fix for the nasty missing "logging filter" while writing the
config bug.
2012-11-02 13:50:10 +01:00
Harald Welte d07870af73 update libosmocore and openbsc 2012-11-02 13:50:05 +01:00
Holger Hans Peter Freyther 0f4626d2d8 Merge git://git.sysmocom.de/poky/meta-sysmocom-bsp into edison 2012-09-15 18:26:29 +02:00
Jan Luebbe 5e17d8e537 Attempt to target multiple versions of Poky at the same time
The idea is that the basic extension resides inside the the normal
recipe directories. Depending on the version of poky the bbappends
need to be included. Appends applying to all versions will be put
into the shared folder, specific ones into the specific directory.
Once a bbappend can not be shared anymore it needs to be copied.
2012-09-15 17:44:57 +02:00
Holger Hans Peter Freyther a5c48367a6 Merge git://gitorious.org/sysmocom-openembedded/meta-telephony into edison 2012-09-15 16:40:09 +02:00
Holger Hans Peter Freyther 2ae26ee3fa openbsc: Improve the init scripts, do not write counters
Make the start/stop of the NITB, BSC and MGCP HW work, remove the
force-reload option as it didn't do anything and omit writing counters
into the database.
2012-09-15 16:34:21 +02:00
Holger Hans Peter Freyther 3be74372be Merge git://gitorious.org/sysmocom-openembedded/meta-telephony into edison 2012-09-15 15:43:20 +02:00
Holger Hans Peter Freyther 46ea81ade5 Merge commit 'd6415c8069714519ab242f7bb1d493d7744529cb' into edison 2012-09-15 15:37:19 +02:00
Holger Hans Peter Freyther aeb390d1cf libosmocore: Upgrade to newer version with libosmovty improvements 2012-09-13 21:20:19 +02:00
Holger Hans Peter Freyther 6a4abb5830 lmsensors-apps: Package the *.a into a new -staticdev package 2012-09-04 14:14:00 +02:00
Holger Hans Peter Freyther b8b0dff3d4 watchdog: Target both edison and HEAD in this overlay
One needs to use BBMASK or delete depending on the targeted
OE-Core/Poky version.
2012-09-04 14:13:26 +02:00
Holger Hans Peter Freyther 4f78b6ef78 netbase: Target both edison and HEAD in this overlay
One needs to use BBMASK or delete depending on the targeted
OE-Core/Poky version.
2012-09-04 14:12:38 +02:00
Holger Hans Peter Freyther 97ba83f17a busybox: Target both edison and HEAD in this overlay
One needs to use BBMASK or delete depending on the targeted
OE-Core/Poky version.
2012-09-04 14:11:51 +02:00
Holger Hans Peter Freyther 4f61482461 openggsn: Package the *.a into a new -staticdev package 2012-09-04 14:08:36 +02:00
Holger Hans Peter Freyther a6cbcf75d5 libdbi-drivers: Introduce INC_PR for this recipe 2012-09-04 14:07:17 +02:00
Holger Hans Peter Freyther 25a726eea5 libdbi-drivers: Package the *.a into a new -staticdev package 2012-09-04 14:06:23 +02:00
Holger Hans Peter Freyther 1579cdf0fe libdbi-drivers: Add checksums for version 0.8.3 2012-09-03 13:37:41 +02:00
Holger Hans Peter Freyther c0cbc30d4c libdbi: Add checksums for version 0.8.3 2012-09-03 12:18:54 +02:00
Holger Hans Peter Freyther d6415c8069 sysmocom: Make dvnixload and ubl accessible via public git
dvnixload and ubl are available via public git.
2012-08-21 15:14:47 +02:00
Holger Hans Peter Freyther a4331e9bee openggsn-config: Fix the name of the ggsn.conf for the sysmocom-bsc 2012-08-20 23:41:48 +02:00
Holger Hans Peter Freyther 138ac3bc45 libgsm_1.0.13: Add necessary " for the variable assignment
Newer versions of BitBake are more picky about it. Add the quotes.
2012-08-20 21:26:19 +02:00
Holger Hans Peter Freyther c35fa18841 linux-sysmocom.inc: Add quotes around the value for newer versions of bitbake
BitBake is finally more picky about variable assignments. Add the
necessary quotes.
2012-08-20 21:25:04 +02:00
Holger Hans Peter Freyther d9150d375c openggsn-config: Add the GGSN configuration to this layer 2012-08-20 19:34:56 +02:00
Holger Hans Peter Freyther fd604f8497 sysmocom-*-image: Add the IP and E1 image to this layer
Add a BSC IP and BSC E1 image to the meta-sysmocom-bsp.
2012-08-20 19:30:02 +02:00
Holger Hans Peter Freyther bbbc805a2d femtobts: Drop the old femtobts calibration utility
A new version can be found inside the osmo-bts repository.
2012-08-20 19:26:31 +02:00
Holger Hans Peter Freyther ba44e70c38 sysmocom-bsc-e1: Introduce a sysmocom-bsc-e1 machine type 2012-08-20 18:50:58 +02:00
Holger Hans Peter Freyther f5b92b4bf2 u-boot: Upgrade to a version with the recovery mode 2012-08-15 21:34:25 +02:00
Holger Hans Peter Freyther 2d8f097946 openvpn: Introduce OpenVPN from meta-openembedded 2012-08-15 17:50:48 +02:00
Holger Hans Peter Freyther f88c9a6fbd libosmocore: Build a 0.5.3+ version and force rebuild
The behavior of the OSMO_MIN/OSMO_MAX has been fixed. Update
the library and force the rebuild.
2012-08-15 17:09:28 +02:00
Holger Hans Peter Freyther 62e7f7f1bc osmo-bts: Build the latest version of osmo-bts
This has a GSM band selection fix. GSM1900 band is now working properly.
2012-08-15 16:40:03 +02:00
Holger Hans Peter Freyther d03aa9c516 osmo-bts,osmo-pcu: Both applications should be rebuild on osmocore upgrades
Rebuild the BTS and PCU when the SOVERSION of a libosmocore library
is changing. Do that by adding the ${META_TELEPHONY_OSMO_INC} into
the PR.
2012-08-15 16:35:58 +02:00
Harald Welte 2be99ac429 Add a new task 'task-gprscore' containing sgsn/ggsn/routing 2012-08-15 16:34:10 +02:00
Harald Welte 6734e9a695 add osmo-pcu for GPRS support on sysmobts 2012-08-15 16:33:29 +02:00
Harald Welte 5928a0374a update to firware + api version 2.4 2012-08-15 16:30:41 +02:00
Holger Hans Peter Freyther 8479f83f39 libosmocore: Introduce 0.5.3 and bump the META_TELEPHONY_OSMO_INC
META_TELEPHONY_OSMO_INC functions as kind of a reverse dependency,
packages using libosmocore will now rebuild and link to the newer
soversion of the libraries. Upgrade OpenBSC due an ABI change in
the GPRS/GB code.
2012-08-15 16:28:09 +02:00
Harald Welte 73295758f9 libosmocore: update to more recent version including a BSSGP fix 2012-08-15 16:23:56 +02:00
Holger Hans Peter Freyther a641873503 Merge commit '4e2ab7017f80c42a2b112693fa589ac29cee405d' into edison 2012-08-15 09:17:30 +02:00
Holger Hans Peter Freyther 9805fb9f81 Merge commit 'f4320dd67f9681e24bcfbe112832cac2ceacebd0' into edison 2012-08-15 09:17:29 +02:00
Holger Hans Peter Freyther 50dba82586 update: Use the git instead of the ssh protocol 2012-08-15 09:16:54 +02:00
Holger Hans Peter Freyther 4e2ab7017f misc: Move from SSH to Git protocol for the sysmocom source 2012-08-15 08:18:53 +02:00
Holger Hans Peter Freyther 9f0744ce76 debootstrap: Add a version of debootstrap to bootstrap debian images 2012-07-21 18:10:27 +02:00
Holger Hans Peter Freyther 21c475ae4a gnupg/libksba: Add gnupg/libksba from openembedded-contrib for debootstrap 2012-07-21 18:10:27 +02:00
Holger Hans Peter Freyther f4320dd67f dahdi-tools: Build dahdi_pcap and fix the installation of the perl modules 2012-07-21 18:05:25 +02:00
Holger Hans Peter Freyther 1f71735516 dahdi-linux: Enable the mirror mode required for dahdi_pcap, cleanups
Enable the mirror mode to be able to use the dahdi_pcap utility of
dahdi_tools.
2012-07-21 18:05:25 +02:00
Holger Hans Peter Freyther fe53a9d4aa dahdi: Upgrade from 2.5.0.1 to 2.6.0 2012-07-21 18:05:25 +02:00
Holger Hans Peter Freyther 9416f178b1 dvnixload: Deal with UBL being gone but U-Boot is present.
Upgrade the dvnixload to a version that will always flash the
UBL payload to the device.
2012-07-11 14:26:51 +02:00
Holger Hans Peter Freyther d838ac6e80 ubl/dvnixload: Update both ubl and dvnixload for recovery
The UBL allows to interrupt the NAND boot mode and switch to the
UART mode for recovery. Everyone with physical access will be able
to interrupt the boot.
2012-07-11 09:05:53 +02:00
Holger Hans Peter Freyther e2ab56be8f ubl: Initialize the UART0/UART1 on the sysmobts-v2
This is fixing the early printf inside u-boot.
2012-07-11 07:33:19 +02:00
Holger Hans Peter Freyther e0bf4c7fea sysmobts-calib: Build, package and make sure it is installed
Install the sysmobts calibration utility. task-sysmocom-bts is
installed on every bts and will now pull in the calibration utility.
The sysmobts screen needs to be stopped before this application
can run.
2012-07-10 00:17:15 +02:00
Holger Hans Peter Freyther 4166201d03 Merge commit 'a6ae74f721439ddbb6e2c0d23c4e227b4634935d' into edison 2012-07-09 17:06:17 +02:00
Holger Hans Peter Freyther a6ae74f721 ca-cacert-rootcert.bb: Have the complete root for CACert 2012-07-09 17:05:52 +02:00
Holger Hans Peter Freyther 94fa2d9623 Merge commit 'be68ad33d2b2d2df2908a9e5d186c0d0df82f4a6' into edison 2012-07-09 16:39:03 +02:00
Holger Hans Peter Freyther be68ad33d2 ca-cacert-rootcert.bb: Create symlinks for all fingerprints of the cert 2012-07-09 16:38:38 +02:00
Holger Hans Peter Freyther 4cfac93114 Merge commit '4df56218263913830d71b4c48be866279702c78a' into edison 2012-07-09 16:20:06 +02:00
Holger Hans Peter Freyther 4df5621826 ca-cacert-root: Do not use the full-blown ca-certificates
First ca-certificates does not create a symlink from /etc/ssl/certs
to /usr/lib/ssl/certs, second it does not run the c_rehash perl utility
making the recipe pretty useless and third it trusts way too many
cert authorities.
2012-07-09 16:19:40 +02:00
Holger Hans Peter Freyther 5d46944934 Merge commit 'e423b30a83bf4ad14a0a3db619faccd979aa4573' into edison 2012-07-09 14:51:12 +02:00
Holger Hans Peter Freyther d5f6ae1142 sysmocom-upload.sh: Sync all sources and do not expire old sources
We need to keep old sources around for some time and need to remove
them with another script after we stopped distributing them.
2012-07-09 14:50:27 +02:00
Holger Hans Peter Freyther e423b30a83 task-sysmocom: Install wget and certificates for ssl 2012-07-09 14:49:46 +02:00
Holger Hans Peter Freyther ae891be609 ca-certificates: Taken from meta-openembedded needed for wget
I upgraded it to 20120623 and updated checksums.
2012-07-09 14:49:41 +02:00
Holger Hans Peter Freyther 4d8fef32c9 Merge commit 'e568fa2c271a13144811c62fedc72977df8ad9e8' into edison 2012-07-09 10:40:59 +02:00
Holger Hans Peter Freyther a6f1cb82a7 Merge commit '33fe48f3b792563ad99d575750e36dffc9ac808a' into edison 2012-07-09 10:40:57 +02:00
Holger Hans Peter Freyther 33fe48f3b7 openbsc: Upgrade to version v0.12.0 of OpenBSC
This has split out the GPRS library and some bugfixes.
2012-07-09 10:35:55 +02:00
Holger Hans Peter Freyther 794c0e73e6 libosmocore: Upgrade to version 0.5.2 for the libgb split
libosmocore gained a new GPRS helper library.
2012-07-09 10:35:55 +02:00
Holger Hans Peter Freyther d1d9f99eb6 libosmo-abis: Add 0.1.3 with buildsystem changes and minor bugfixes 2012-07-09 10:35:55 +02:00
Holger Hans Peter Freyther e568fa2c27 osmo-bts: The start script is using nice, depend on coreutils for that
Our version of busybox does not provide the nice command, use the
fullblown coreutils instead.
2012-07-09 10:28:22 +02:00
Holger Hans Peter Freyther e6ec2228da osmo-bts: Upgrade the osmo-bts version for various bugfixes
This is fixing the GSMTAP debug support and permanent paging.
2012-07-09 10:25:00 +02:00
Holger Hans Peter Freyther 9257e4b8a1 femtobts-api: Force an upgrade due some local modifications for supporting RevB hardware 2012-07-09 10:08:47 +02:00
Holger Hans Peter Freyther 0f6a89c788 linux-sysmocom: Build the kernel with MMC support, package the modules
Autoload mmc_block and the davinci_mmc module. This will load the mmc_core
module as another dependency.
2012-07-09 10:08:42 +02:00
Holger Hans Peter Freyther c1625ee284 openmoko-gsmd: Package the cell_log separately and respawn 2012-07-09 10:07:46 +02:00
Holger Hans Peter Freyther 40355ff62e Initialize repositories with scripts 2012-06-27 01:12:32 +08:00
Holger Hans Peter Freyther a7befd603b Add 'meta-sysmocom-bsp/' from commit '90a211eb560d7c984a444f9697ff1d06e4bca838'
git-subtree-dir: meta-sysmocom-bsp
git-subtree-mainline: 88c1293c49
git-subtree-split: 90a211eb56
2012-06-27 01:10:49 +08:00
Holger Hans Peter Freyther 88c1293c49 Add 'meta-telephony/' from commit '4fed144378a38115805f986c56d883763f6dab79'
git-subtree-dir: meta-telephony
git-subtree-mainline: e94c542d7c
git-subtree-split: 4fed144378
2012-06-27 01:10:34 +08:00
Jan Luebbe e94c542d7c libpcap: use binconfig class to deploy pcap-config
This fixes building of tcpdump on hosts where libpcap-dev is installed.
Also introduce INC_PR.

(From OE-Core rev: 942cdda2194078755a11efef3ba3f502f72e4f5e)

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-27 01:09:52 +08:00
Holger Hans Peter Freyther 90a211eb56 meta-sysmocom-bsp: Backport the archives 2012-06-26 19:07:11 +02:00
Elizabeth Flanagan 06072024be poky.conf: Flipping for edison point release
Prior to final build, we need to flip DISTRO_* and SDK_VERSION
to new values.

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
2012-06-21 13:07:09 -07:00
Robert Yang 107ec95659 apt 0.7.14: do_compile failed with gcc 4.7
apt do_compile failed with gcc 4.7:

deb/deblistparser.cc: In member function 'virtual short unsigned int debListParser::VersionHash()':
deb/deblistparser.cc:212:13: error: redeclaration of 'char* I'
deb/deblistparser.cc:202:22: error: 'const char** I' previously declared here

Backport the patch from the upstream would fix the problem, both target and
native apt need it.

[YOCTO #2488]

(From OE-Core rev: 80c1ab1248ff38ba97cf5780fc05ff1321e14e10)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 12:04:39 +01:00
Richard Purdie af3e5039e8 apt: Fix parallel make race
I was just going to turn off parallel make but ended up fixing this properly.

(From OE-Core rev: 440a6d5aacf7807536feee5d09484712ba34ca80)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 12:04:30 +01:00
Richard Purdie 08d70734d5 apt: Fix locale header and hardcoded libname issues
apt wasn't building on modern libc/compiler combinations due to missing
header includes.

The libcpp version was also being hardcoded, this patch generates it
dynamically to work on different host systems which no longer have
this.

(From OE-Core rev: 4bcffbcd05c86903fbdf47bb46bf1a52b888dfeb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 12:04:16 +01:00
Holger Hans Peter Freyther f3f2d7149d u-boot: Modified the configuration in regrd to boot interruption
Typing bts-delay will interrupt the boot and enter the command
line of the bootloader.
2012-06-15 23:42:24 +02:00
Yi Zhao 164a4d1bac scripts/qemuimage-testlib: fix typos
(From OE-Core rev: 30c6ec403e1696b5fd94b92328ef9edec535a57a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-14 11:18:51 +01:00
Richard Purdie 7e0dd59e30 ghostscript-native: Ensure the sys/time/h fix is applied for native builds
On my system, the sys/time.h header is in a subdir off /usr/include
which causes a build failure. Apply the target CFLAGS fix to native
builds as well to address this.

(From OE-Core rev: 8968db5fcc99c6580de91f9d6c55478c735ca375)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-14 11:18:40 +01:00
Holger Hans Peter Freyther 4fed144378 openmoko-gsmd: Add support for the sysmobts_v2 with a modem daughterboard 2012-06-11 08:39:36 +02:00
Holger Hans Peter Freyther 914296ad20 sysmobts-v1: Change the defconfig to hide a kallsysms issue 2012-06-10 20:23:33 +02:00
Holger Hans Peter Freyther c0663ce337 osmo-bts: Upgrade the osmo-bts version for a sysmobts-v1 fix and v2 improvement 2012-06-10 20:01:12 +02:00
Holger Hans Peter Freyther 420ea289a2 linux-sysmocom: Upgrade to 3.2.19, this requires a manual symlink
Kernel upgrades on a live system is not well tested, right now the
symlink is not updated but for some reason the old uImage is kept
installed.
2012-06-10 17:16:55 +02:00
Holger Hans Peter Freyther d9a77eb641 task-core-boot.bbappend: Increase PR due the moving of the watchdog
Make sure that on opkg upgrade the watchdog will now be installed due
the new task-core-boot package.
2012-06-10 16:48:00 +02:00
Holger Hans Peter Freyther 17acc4a562 task-sysmocom-bts: Do not package the femtobts-example
This is not available in this layer, remove it.
2012-06-10 15:53:20 +02:00
Holger Hans Peter Freyther 45580f23e8 Merge remote-tracking branch 'origin/master' 2012-06-09 23:21:53 +02:00
Holger Hans Peter Freyther 62ac580831 sysmobts: Upgrade to a BTS version with fixed 2bis SI scheduling
This is a hot fix for the 2bis case, the more generic scheduling
patch needs to be tested a bit more.
2012-06-09 23:17:07 +02:00
Holger Hans Peter Freyther be8f70e8a1 linux: Change the sysmocom-bsc kernel config in regard to USB and FS
* Enable verbose detection, add CP2012 based serial adapter support
* Only enable USB1.1 HCD for now to fix the detection of the USB serial
  adapters
* Enable more filesystems in the config to allow upgrading the boot
  partition during the runtime (after installing the right codepage)
2012-06-09 23:17:07 +02:00
Holger Hans Peter Freyther c29b5d8bb4 pkgconfig: Place the pkg.m4 into the main package
The pkg.m4 should be in the main package, the -dev package will attempt
to pull in X11 header files and will require too much filesystem space.
2012-06-09 23:17:07 +02:00
Holger Hans Peter Freyther 03c9643695 watchdog: Let the machine provide the watchdog dependency
Not every machine has a hardware watchog, let the machine decide
if a watchdog should end up in every image.
2012-06-09 23:17:07 +02:00
Harald Welte ce6f4b0bce update osmo-bts to recent git which adds RF ACTIVE LED support 2012-06-09 23:17:07 +02:00
Holger Hans Peter Freyther 9f86fa35a2 openmoko-gsmd: Add the Openmoko GSMD recipe
This is based on the gsmd recipe from OE classic. There will be
some more tweaking for respawn and the cell log utility.
2012-06-09 22:59:13 +02:00
Harald Welte 242922ceae SDK: make sure to include libosmo-abis, libdbi and libgtp headers
This enables the SDK to do a full openbsc build.
2012-06-09 22:59:05 +02:00
Harald Welte a79df5e650 update osmo-bts to include RF LED / rf_lock support 2012-06-02 01:08:10 +02:00
Harald Welte df89bf00e7 add ntpdate to task-sysmocom-tools 2012-06-02 01:06:43 +02:00
Harald Welte a3c1f02557 import ntp recipe from OE (we need ntpdate) 2012-06-01 16:44:35 +02:00
Lianhao Lu aca161f8a0 bitbake/persist_data: Reconnect when DB is locked
[YOCTO #1761]
Reconnect to the backend Sqlite DB in 'database is locked' exception so
the timeout can be leveraged in each time retry.

(Bitbake rev: b310382764367b573c84f33d847c6eb821266f9e)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2012-05-31 13:16:41 -07:00
Richard Purdie 94c8d01eba runqueue.py: Add inter setscene task dependency handling
This is being added to resolve setscene race issues where we do have
particular dependencies required between setscene tasks. This allows
specific dependencies to be specified. This allows us to fix the races
in sstate with the useradd class in OE-Core.

Any tasks being depended upon have their reverse dependencies cleared to
ensure we don't have circular references.

(Bitbake rev: e1b157d26374a70e6274edcb4c0b9f3bc48f765c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2012-05-31 13:16:41 -07:00
Richard Purdie e1e0dd932b runqueue.py: Fix missing setscene dependencies
When constructing the setscene inter-dependencies, we need to account for all task,
not just the last one found. This patch corrects this oversight and ensures all
dependencies are added, not just the first one found.

(Bitbake rev: b9b5b5129d066e1ff7d3effda116afc3c6657beb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2012-05-31 13:16:41 -07:00
Richard Purdie 6c335846d9 populate_sdk_ipk.bbclass: Ensure the correct environment is setup for postinstalls
Without this, various postinstalls get run with incorrect environments
leading to various failures when building the toolchains.

This adds some duplication and some variables we'd be better off
removing. It does unbreak the SDK ipk code for now though. This needs
revisiting.

(From OE-Core rev: c5e6a533eab2f5af4a52d22f8efe5b49b77cd26c)

(From OE-Core rev: ab2a4591c4c3926a960f18fa7e848f5d41255e14)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:47 +01:00
Beth 'pidge' Flanagan 774f93e8d3 common-licenses: Adding/updating to current
[YOCTO #2230]

1.1+ had some incorrect license text. This corrects that text and
adds licenses that didn't exist in 1.1+.

(From OE-Core rev: 43bd89eb195f56afef12e52ed58a2f0cad9c73db)

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:47 +01:00
Joshua Lock 535cfa538b icon-naming-utils-native: add SRC_URI checksums
[YOCTO #1866] reported errors with fetching icon-naming-utils. This turned out
to be an issue with upstream which was impaired by the recipe not containing
checksums.

Without a checksum failure we were trying to decompress the error page we
received from upstream.

(From OE-Core rev: 0af0591e25b35beb9dd10f9d5de8bc2e63f7731e)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:47 +01:00
Joshua Lock ac63b3f8ef zlib: install pc file
Joshua Immanuel reported, and provided a patch to fix, that our custom
autotooling for zlib does not install the pc file.

Fixes [YOCTO #1983]

Patch-from: Joshua Immanuel <josh@hipro.co.in>
(From OE-Core rev: 37fbe2e1a706af634f400213b9fb4c6f0670c15e)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:46 +01:00
Scott Garman 4039b5b97c package_rpm.bbclass: ensure base-passwd and shadow get installed first
When generating images, we need to make sure that base-passwd and
shadow get installed before other packages, which might need to create
custom user accounts.

Thanks to Richard Purdie for the initial version of this fix.

This fixes [YOCTO #2127]

(From OE-Core rev: 3d2d3cb379608301b17ce57787d324c2f06bf4f9)

(From OE-Core rev: f35902844c5c1de06c9a1b2111abf0d8b5687a9b)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:46 +01:00
Richard Purdie 67334bfb26 sstate.bbclass: Remove possibility of file corruption and make package writing atomic
There is currently a race window when creating sstate packages since we don't
atomically write the files to SSTATE_DIR. This change ensures we do so by writing
to a temporary file and then doing an atomic move.

(From OE-Core rev: 52bf113e786a57123a9da98f64442afbc2f1471e)

(From OE-Core rev: d527f68bdf167b4a3dcc035968da59677abb70bb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:46 +01:00
Richard Purdie 36e13dd42f sstate.bbclass: Add support for sstate preinst functions
(From OE-Core rev: f2b0a71b3100a0d2ceb80300d7f3823a31eb907a)

(From OE-Core rev: 8ca7387ff2dd788221a16021ec98b4aee946a187)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:46 +01:00
Richard Purdie de485f4973 sstate: Add SSTATE_SCAN_FILES
We process all files in the native/cross cases for finding and
fixing relocation issues. In the target case we've only processed
.la and binconfig files. Since there are other files which are
in need of this processing, this change allows recipes to specify
files that may be outside the normal set. This means hardcoded
paths that need to be fixmepathed to work correctly are handled
and addresses some sstate relocation bugs that have been seen.

Based on a patch from Saul Wold <sgw@linux.intel.com>

(From OE-Core rev: 6ffdcd9120b572fa41659029c3bda7bf00ebcb77)

(From OE-Core rev: c6148b8dde3e0fddc4135b48fd6d01e2de662919)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:45 +01:00
Darren Hart 56310cbc4c syslinux: Avoid using linux.ext2_fs.h if possible
Fixes [YOCTO 2236]

With recent Linux kernel headers, such as 3.3 in Fedora 16, the linux/ext2_fs.h
header has been removed. This causes compile failures for syslinux-native.
Backport a fix to address this from syslinux-4.06-pre3.

(From OE-Core rev: d61c5fc67780b552fcf3d78ebcf9bd3888af4e0a)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Ross Burton <ross.burton@intel.com>
CC: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:45 +01:00
Scott Garman 68cd8deadc useradd.bbclass: retry useradd/groupadd commands to avoid lock race issues
A race condition can occur when adding users and groups to the
passwd and group files, causing errors like the following:

 ERROR: Function 'useradd_sysroot' failed
 Tried to access "/etc/group" but this was locked.

This fix will cause the useradd code to retry the useradd and
groupadd commands up to 10 times (with a 1s sleep in between
attempts) before failing.

This fixes [YOCTO #1794]

(From OE-Core rev: 68c589f1b5ee36f0aff151b728447ffdae14622c)

(From OE-Core rev: fb9f5feaa49b78d03d25d96254a5ce04079ce594)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:45 +01:00
Zhai Edwin b2a0243f05 shadow-sysroot: Fix for multilib
Fix following error in multilib build:
"ERROR: Task do_package_setscene depends upon nonexistant task
poky/meta/recipes-extended/shadow/shadow-sysroot_4.1.4.3.bb:do_populate_sysroot_setscene"

>From richard.purdie@linuxfoundation.org

(From OE-Core rev: 5de2c22fb42c12783abc090a81f10db9eb39732f)

(From OE-Core rev: 8a8b1a49e3c7f96d76f6457a1f9a14e1eb4d5302)

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:45 +01:00
Otavio Salvador a99b7d39dc useradd.bbclass: override USERADDSETSCENEDEPS to empty when building cross packages
(From OE-Core rev: 5650eb44ea28c87f2f87ea3c5a557b9f08d58775)

(From OE-Core rev: fa0f0052b49b7809b9b55df6049a0dfedbc94560)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:44 +01:00
Otavio Salvador 755508c423 useradd.bbclass: skip processing on virtclass-cross extended packages
(From OE-Core rev: 4308acbbd43e6b8b37123d95df6675233007dae4)

(From OE-Core rev: 4a338c552d989d37a26eb6cc0c1da95a6928af9f)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:44 +01:00
Richard Purdie adbf38414e useradd.bbclass: Fix missing quote
(From OE-Core rev: d7b13cd42ab8d5f44f97e119b73ec2e363677d26)

(From OE-Core rev: 6e21a379542ef5428d6005782f1ad4a8c764eb47)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:44 +01:00
Richard Purdie c3be61e204 useradd: Ensure dependencies are only added for target recipes, not native or nativesdk
(From OE-Core rev: 63d006b2d3fc2223c74f81b91f70f5c841108c80)

(From OE-Core rev: d6c43fdc815347a0adfee590da56f8b332540da6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:44 +01:00
Richard Purdie 490753f440 useradd.bbclass: Add explict setscene dependencies to ensure correct ordering of setscene tasks
(From OE-Core rev: ffc7bbcf0011de3f1f6e8d95f1de0b8f7164fa51)

(From OE-Core rev: a9aae582a6068a946cf177ce33e54cb0aee6c6e5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:43 +01:00
Richard Purdie f3fc5e1e3f useradd.bbclass: Ensure pseudo can load in the pseudo unloaded case
In the do_populate_sysroot_setscene case, pseudo has been unloaded and we need
to reload it. This code change ensures all the pseudo options are specified
so pseudo loads correctly.

It also improves some of the comments so all the different contexts are listed.

(From OE-Core rev: 76345cd61c9523ce6755ef8e923dec37800b7a98)

(From OE-Core rev: 6f25ede827ee469464ca2db72bf05c75fa7c11f3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:43 +01:00
Richard Purdie e2c5e5a513 useradd.bbclass: Execute user addition code before do_package_setscene, not after do_populate_sysroot_setscene
The user addition needs to happen before the do_package files are extracted
by do_package_setscene since those are the ones we need to preserve the file
ownership information for. This patch ensures this happens.

(From OE-Core rev: 34282c1b996ef008384af456735692d66ddabc13)

(From OE-Core rev: b571766ffc7ec5aa78035557c25a0e8b244c17c8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:43 +01:00
Richard Purdie c5a9efca96 useradd: Ensure -native recipes don't depend on target recipes
Without this change, dbus-native can end up depending upon base-passwd
for example. This change mirrors the existing nativesdk code.

Based on a patch from Henning Heinold <heinold@inf.fu-berlin.de>
but with some additions from me.

(From OE-Core rev: eba81d1c606ec29ffb793c1cb3cfed9562d552bc)

(From OE-Core rev: b325378930655beeec03bbc5ce6ccf2b29f408fd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 21:11:43 +01:00
Holger Hans Peter Freyther 5508643b52 wget: Be more specific about the version of GPL 2012-05-31 14:46:57 +08:00
Holger Hans Peter Freyther 910852c052 linux-sysmocom: Be more specific about the license of linux 2012-05-31 14:46:57 +08:00
Dexuan Cui 842d3ece07 socat: add the latest stable version 1.7.2.0
socat is useful for the self-hosted-image work.

The original recipe is from OE:
http://git.openembedded.org/openembedded/tree/recipes/socat/
and I upgraded it to 1.7.2.0.

Thank Koen Kooi <koen@dominion.thruhere.net> for suggesting
how to assign the LICENSE field with a proper value.

(From OE-Core rev: b1771ff0ad39250678bd53b0ae7543c9365572f5)

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-31 14:46:57 +08:00
Holger Hans Peter Freyther 7aaa4cc880 watchdog: Start the watchdog script in rcS.d as early as possible
This needs to be started after udev, after loading modules.
2012-05-31 14:46:57 +08:00
Holger Hans Peter Freyther 6d69dba610 watchdog: Install a init script and add config file to conffiles 2012-05-31 14:46:57 +08:00
Holger Hans Peter Freyther aed232262e watchdog: Add machine specific watchdog file 2012-05-31 14:46:57 +08:00
Holger Hans Peter Freyther 6dcaf7d614 osmo-bts: Upgrade to a version that reloads the firmware on every start 2012-05-31 14:46:57 +08:00
Harald Welte 77f660aa0d update to sysmobts-v2 API/firmware version v2.1 2012-05-31 14:46:57 +08:00
Holger Hans Peter Freyther 39d7350b90 sysmobts-v2: Allow to override the flash parameters
RevB and RevC feature different kind of nand flash. RevB is still
pre-production hardware so for the few units allow to set the right
flash parameters in the local.conf.
2012-05-31 14:46:57 +08:00
Harald Welte 967184aef7 sysmobts-v2 has the same NAND flash as -v1, so use same UBI parameters 2012-05-31 14:46:57 +08:00
Holger Hans Peter Freyther bdbd14a8d5 u-boot: Fix the u-boot git version in our public git repository 2012-05-31 14:46:57 +08:00
Harald Welte b9d489c543 add the sysmobts-remot program to the "task-sysmocom-bts"
This is primarily used for development, but as it is such a small tool, it
makes sense to always include it in the build.
2012-05-31 14:46:56 +08:00
Holger Hans Peter Freyther 2a378aa333 firmware: The package depends on the machine, set the right arch 2012-05-31 14:46:56 +08:00
Holger Hans Peter Freyther f1ce2c13e5 image: Make sure that everything from the machine rdepends is built
Make sure that everything the machine needs to install is built.
2012-05-31 14:46:56 +08:00
Holger Hans Peter Freyther 999cf4843e image: Depend on wget to have password authentication for the feeds
wget implements HTTP authentication, this means one can use opkg to
access password protected feeds for upgrades.
2012-05-31 14:46:56 +08:00
Holger Hans Peter Freyther b863e59aa6 wget: Add wget from meta-oe
Having wget available will allow to use it for online updates with opkg.
2012-05-31 14:46:56 +08:00
Holger Hans Peter Freyther 73bcda3f97 bts: Build a jffs2 image as well, make sure the firmware is built 2012-05-31 14:46:56 +08:00
Holger Hans Peter Freyther dd6f9356b1 meta-sysmocom-bsp: Create bsp for the sysmocom hardware
This layer will power our hardware. This includes the sysmoBSC, sysmoBTS v1
and the sysmoBTS v2.
2012-05-31 14:46:42 +08:00
Holger Hans Peter Freyther 1e224b39ae libdbi-drivers: Remove redundant LICENSE assignment 2012-05-30 19:23:22 +08:00
Holger Hans Peter Freyther 39b09a8849 dahdi: Be more specific about the version of GPL. 2012-05-30 19:23:06 +08:00
Holger Hans Peter Freyther 8caa70df0a ortp: Be more specific about the version of the LGPL 2012-05-30 19:23:01 +08:00
Holger Hans Peter Freyther 5a11d46c4e libdbi: Be more precise about the license of libdbi and libdbi-drivers 2012-05-30 19:17:49 +08:00
Holger Hans Peter Freyther d24c97d308 osmocom: Fix the license of the libraries
GPL is too unspecific, point to the right versions
2012-05-30 17:51:30 +08:00
Saul Wold 15905aec48 grub: Add SRC_URI Checksums for sanity
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-06 09:53:38 +01:00
Saul Wold 2b92d9f6d3 image.bbclass: add check for live and convert to ext3
The live image type depends on ext3 which has it's own
dependencies, while the live type has none, this is a
backport change to fix [YOCTO #2246]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-06 09:53:27 +01:00
Holger Hans Peter Freyther 96a864f527 libosmocore: Upgrade to get GSM_LCHAN_PDTCH 2012-04-28 22:38:54 +08:00
Richard Purdie bfa48c3c09 dosfstools: Add patch to disable fat32 autoselection and behave as 2.10
It appears msdos image population and fat32 images are incompatible.
This reverts to the 2.10 behaviour of defaulting to fat16 instead of
using fat32 for large images, allowing image generation to work
correctly. This is a workaround and a proper fix is really needed.

(From OE-Core rev: c2de8d41236cf1293db9e6c69d69e8d14f55ffd1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-14 23:12:08 +01:00
Otavio Salvador ef6062981b dosfstools: update native to 2.11
This unify recipes for target and native builds and also drops the the
already merged patches.

(From OE-Core rev: 3a401ddce55e185c8ccfdc43c1440fd77daff9ae)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-14 23:12:04 +01:00
Scott Garman f57eca6f28 dosfstools: add Upstream-Status to patches
(From OE-Core rev: 735a3e5d3399e29e4d6fa82dabbdd1687eaa29e9)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-14 23:12:00 +01:00
Saul Wold 885ebdae10 dosfstools: Add SRC_URI Checksum
(From OE-Core rev: a19bfc10e60ddc7e9317654ca7565d39acbc3987)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-14 23:11:56 +01:00
Darren Hart 33561a5417 bootimg: Do not force FAT32 on all images, it violates the FAT specification
Fixes [YOCTO #1940]

do_bootimg was performing the FAT overhead calculations assuming FAT32 and then
forcing the use of FAT32 with "-F 32" to mkdosfs. The FAT specification is clear
on cluster count being the determining factor for FAT size (even if the fs
string is set to FAT32, go figure). Syslinux follows this spec, and rightly so,
resulting in a failure on core-image-minimal:

	syslinux: zero FAT sectors (FAT12/16)

Drop the "-F 32" from mkdosfs to allow it to select the appropriate FAT size
based on cluster count. Leave the FAT overhead calculation in FAT32. This will
result in a little extra padding for really small images, but not enough extra
to justify recalculating for FAT12 and FAT16.

Tested with a core-image-minimal build for atom-pc. do_bootimg completed
successfully, and the resulting image was FAT16.

(From OE-Core rev: 634137704dd1a205e377a1131ef708f1c981f6b2)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported to edison by Darren Hart.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-14 23:11:51 +01:00
Darren Hart bb31c819be bootimg: Fix a math thinko in the block count calculation
Fixes [YOCTO #1852] ... again.

The conversion from sectors to blocks was multiplying by 2 instead
of dividing by 2. Blocks are 1024 bytes, sectors are 512 bytes. The
result was images being much larger than intended.

Reported-by: Tom Zanussi <tom.zanussi@intel.com>
(From OE-Core rev: b35384fa3ca96b31c63d764322215abced2066e4)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported to edison by Darren Hart.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-14 23:11:43 +01:00
Darren Hart d1c5de9ccb bootimg: Account for FAT filesystem overhead in image size
Fixes [YOCTO #1852]

The bootimg class wasn't accounting for non-trivial amount of space
required by the directory entries and FATs for the FAT filesystem.

This patch attempts to make an accurate prediction of FAT overhead and
adjusts the image size accordingly. It assumes no more than 16 directory
entries per directory (which fit in a single sector). It also assumes
8.3 filenames. With the ceiling functions rounding up to full sectors
and tracks, these assumptions seem reasonable.

In order to ensure the calculations are accurate, this patch forces the
FAT size to 32, rather than allowing mkdosfs to automatically select 12,
16, or 32 depending on the image being built.

Tested by setting BOOTIMG_EXTRA_SPACE=0 and building core-image-minimal
and core-image-sato for fri2-noemgd from meta-intel.

(From OE-Core rev: 68aa18609c10a3ae2f738930c933fa2a95ce8959)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported to edison by Darren Hart.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-14 23:11:38 +01:00
Darren Hart 4274ebdd00 bootimg: Use mcopy to construct the hddimg
Fixes [YOCTO 2138]

The initial directory support (-d) added to mkdosfs has proven to be incomplete
and non-compliant with FAT. Rather than continue to maintain this feature and
work around the various issues, we can use mcopy to construct the image.

bootimg.bbclass already depends on mtools-native (although it may not have
needed to previously). No new dependencies are introduced. The image created
passes dosfsck cleanly. Remove the call to dosfsck.

mcopy reported an error with the image we were creating:
Total number of sectors (107574) not a multiple of sectors per track (32)!

Add some logic to ensure the total sector count is an integral number of sectors
per track, including forcing the logical sector size to 512 in the mkdosfs
command.

The du -bks arguments are contradictory, -b is equivalent to "--apparent-size
--block-size=1" and -k is --block-size=1K. If reordered, -kbs will report the
disk usage in bytes insteadk of 1k blocks. Eliminate the ambiguity by using:
du --apparent-size -ks

(From OE-Core rev: 92d2ea1a306354c6565a1b05b51b5719e481840f)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Nitin A. Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported to poky edison by Darren Hart.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-14 23:10:49 +01:00
Holger Hans Peter Freyther e005f8d60e openbsc: Fix the name of the MGCP MGW start script
The binary was renamed in the master branch, catch up.
2012-04-14 19:39:29 +08:00
Holger Hans Peter Freyther fab01cc657 osmocom: Upgrade libosmocore and openbsc to newer versions
Build newer versions of libosmocore and openbsc.
2012-04-13 03:21:01 +08:00
Holger Hans Peter Freyther 9d939cbe6c ortp: Move back to the savannah infrastructure
mirror.its.uidaho.edu is not reachable anymore and savannah appears
to be working again.
2012-04-07 21:57:42 +08:00
Holger Hans Peter Freyther aeca0842f3 osmocom-tcpdump: Correct the provides name in the start script 2012-04-06 21:00:44 +08:00
Elizabeth Flanagan 0fbd6a1615 poky.conf: Bumping SKD_VERSION
SDK_VERSION needs a bump for 1.1.1 release

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
2012-03-14 15:49:33 -07:00
Scott Rifenbark bda8a084f5 documentation: Updated copyright dates and release dates.
All six manuals updated.

(From yocto-docs rev: 753e3eb80b1fa6148e12f9eb93d23f4613b6be05)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-14 22:34:57 +00:00
Beth Flanagan 939ec1ca1e distro.conf: Bump for edison 1.1.1 release build
In preparation for edison 1.1.1, we need to bump DISTRO
and DISTRO_VERSION

Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com>
2012-03-05 14:28:36 -08:00
Holger Hans Peter Freyther e08238ed3d osmocom-tcpdump: Add a tcpdump wrapper that logs to finite space
tcpdump can create a new log file every couple of bytes, it can also
be asked to limit the number of logfiles and wraps the counter back to
zero, and at least tcpdump 4.1 can also compress the log file with an
external script. Create a start script around this feature to log to
a given directory but not use more space than allowed to. The script
was created by Jan Luebbe and then modified.
2012-03-05 02:47:43 +08:00
Richard Purdie 69b307523c gnu-config: Only apply path transformations in the non-native/non-nativesdk case
The BUILD_ARCH != TARGET_ARCH check isn't a safe one to detect native builds
and doesn't cover the nativesdk case. This converts the recipe to use PN
instead which is more accurate and ensures the correct entries making it
into the correct packages.

(From OE-Core rev: 4a601314604e8428d9dace95c32a71a57eacaaf5)

(From OE-Core rev: 4066c7a3940df2740ad40b21e3ad517a9af20690)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-04 05:39:04 -08:00
Joshua Lock 6482c0e20d m4-native: explicitly set an empty BBCLASSEXTEND
The BBCLASSEXTEND from the included target results in an
m4-native-nativesdk which causes problems when running a
universe fetch.

(From OE-Core rev: 8bd88113ec7b962b570cdc90efa9f8b405730677)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-04 05:38:48 -08:00
Saul Wold ac9c62c907 eds-tools: Convert from BZR to GIT Repo
(From OE-Core rev: b83e4e1aeed115a2b495e54b0122ccf76b4d2eed)

(From OE-Core rev: b6b0fe6747453b57fe8cab666727a650639c3a6e)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-04 05:38:36 -08:00
Saul Wold 806c23ef2e libgpg-error: add BBCLASSEXTEND native for libgcrypts and gnutls-native
(From OE-Core rev: 3094a844f1ceb77153ac1a733623e6aca770b64b)

(From OE-Core rev: df48313f74e36c190cc2c25b6bdd98544acd2a28)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-04 05:38:22 -08:00
Saul Wold 4c496a970f libgcrypt: add BBCLASSEXTEND native for gnutls-native
(From OE-Core rev: 796b06e7bd4c336a5d256d54d1d16a1a9058144c)

(From OE-Core rev: d4803a9e6e661fe50da03ac04ab024cbe84a5541)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-04 05:38:09 -08:00
Richard Purdie fa6eb32a5a binutils-cross-canadian: Clear BBCLASSEXTEND as a native version of this recipe makes no sense
(From OE-Core rev: 5980cd6af7b5260558cb234288a426c091b5de2a)

(From OE-Core rev: 3611bbe4eb7b851c4d2275e9507785d734651777)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-04 05:37:44 -08:00
Joshua Lock eaec7e9624 sudo: backport patch to address CVE 2012-0809
This is a format string vulnerability "that can be used to crash
sudo or potentially allow an unauthorized user to elevate privileges."

(From OE-Core rev: 286cdd5db60b4f668e75cd9e05efb97acb08b7a6)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-01 15:59:58 +00:00
Wenzong Fan e6ea83fece task-sdk-host-nativesdk: add autotools nativesdk to meta-toolchain
Add automake-nativesdk and autoconf-nativesdk to meta-toolchain for
fixing the configure issue:
    WARNING: unrecognized options: --with-libtool-sysroot

This will allow user to run 'autoreconf' under their projects and
process the libtool m4 macros correctly.

[YOCTO #1603]

(From OE-Core rev: d1aabea25aa7ac46a7693acb52ccfe465c63f9bf)

(From OE-Core rev: 660f7ea484d503a49fc8bdf870398ae346304b05)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 14:56:28 +00:00
Nitin A Kamble 613e985811 autoconf: fix nativesdk rdepends
Fixes this build error:

| error: Failed dependencies:
| 	m4 is needed by autoconf-nativesdk-2.68-r4.x86_64
| 	gnu-config is needed by autoconf-nativesdk-2.68-r4.x86_64
NOTE: package meta-toolchain-1.0-r6: task do_populate_sdk: Failed
ERROR: Task 8 (.../meta/recipes-core/meta/meta-toolchain.bb,
do_populate_sdk) failed with exit code '1'

(From OE-Core rev: df8d88e864fb6bdecf5c82b25c0252c3d54157ad)

(From OE-Core rev: )

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 14:56:08 +00:00
Wenzong Fan b900d54f57 autoconf: Extend to provide nativesdk recipe
As the same reason with automake, extend autoconf to provide
nativesdk recipe too.

This patch was only used for autoconf that running on target:
    * path_prog_fixes.patch: replace '@PERL@' with '@bindir@/env perl'

It's unavailable for autoconf-native and autoconf-nativesdk, so
exclude it for those two recipes.

(From OE-Core rev: a16cf1b67f6559b182e6bb31abc1371162b04428)

(From OE-Core rev: 0b30e122e40472f5f1609cd9a513e6c4d198ac35)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 14:55:58 +00:00
Wenzong Fan 83e5279d62 automake: Extend to provide nativesdk recipe
We will provide autotools nativesdk in meta-tookchain for reconfigure
any autotools supported projects, as a part of the plan we should extend
their recipes first.

(From OE-Core rev: 2074285e84267f9f929ed6424f35cc4b2a00c335)

(From OE-Core rev: 4450aa5f0f757a3694db6123f6afe57a833ae986)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 14:55:49 +00:00
Wenzong Fan b36cde2308 m4: Extend to provide nativesdk recipe
We need to provide autoconf-natviesdk in meta-toolchain, the
m4-nativesdk is required by it.

Both extend the m4 recipes for GPLv2 and GPLv3.

(From OE-Core rev: 3e0a0db3559ee9b15a99a95dd3b0c343dca4b2ec)

(From OE-Core rev: 139f0171432eddf67039dde3bfad402cba3cc1a6)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 14:55:41 +00:00
Wenzong Fan c1a2249c96 gnu-config: Extend to provide nativesdk recipe
We need to provide autoconf-natviesdk in meta-toolchain, the
gnu-config-nativesdk is required by it.

(From OE-Core rev: 5e134b60773fa948c586dae777a6e75dce29d27d)

(From OE-Core rev: 378b9b5a9c8cda30c13bb1681fa9f0b02ef95655)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 14:55:32 +00:00
Joshua Lock e3afb1ebc8 linux-tools: don't build perf when GPLv3 in INCOMPATIBLE_LICENSE
As binutils is required by perf to build and is GPLv3 licensed adding
GPLv3 to INCOMPATIBLE_LICENSE will cause linux-yocto to be skipped.

Long term we should look at moving perf to a separate recipe but as a
short term solution this patch will ensure that when GPLv3 is in
INCOMPATIBLE_LICENSE perf is not built and it's dependencies are not
added to build.

Fixes [YOCTO #1879]

(From OE-Core rev: ce61f9031b54067bffa304dab90c31278631dcdf)

(From OE-Core rev: 8c1a2fa)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24 17:39:59 +00:00
Saul Wold 686345f1d0 ed: Fix EXTRA_OECONF to ensure right compiler is found
(From OE-Core rev: b23ab297906d7241d737f7c5e81c674deca45e32)

(From OE-Core rev: f46d9423499c2474f935728df8906d8d7346dad7)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24 17:21:58 +00:00
Saul Wold 7b15a9372c ed: remove unsupported option
(From OE-Core rev: 65fa6a9039043a59a236d28aacce3c424a734158)

(From OE-Core rev: 05349e9323df0094904b6f4aa159e79124301d6e)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24 17:21:47 +00:00
Saul Wold b52792d84d ed: Add SRC_URI Checksums for GPLv2
(From OE-Core rev: c30c89c8dc449cf7642565f2e35c7b1a922fcc33)

(From OE-Core rev: 7ad2af875e1d1c2d17d66c9e59d6bb85471ad2eb)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23 17:16:57 +00:00
Nitin A Kamble a684aa1df4 site/ix86-common: fix an error
Fixed this line
ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_int=1}

as this line
ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}

This issue was causing guile recipe to compile-fail for x86 target.

(From OE-Core rev: d71df3cc2ff2504d61078c578c0e73bbf53b6651)

(From OE-Core rev: 69ac1ad415634e125d9c366efc91353624225ad2)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23 17:16:47 +00:00
Holger Hans Peter Freyther 904300e21a openggsn_git: Upgrade to the latest git revision
This version includes a libgtp.pc that is required to compile the
osmo-sgsn.
2012-02-16 03:44:32 +08:00
Matthew McClintock 69a3fba2aa distutils.bbclass: override LDSHARED so we use the linker for this build and not the one used in sstate-cache
Without this fix, when packages are being built using distutils and
the python packages were deployed from sstate-cache is it possible
that the LD command will contain an invalid sysroot override.

We can fix this by always exported LDSHARED, which is the env var
that distutil looks for to override creating shared libraries.

(From OE-Core rev: 3f6b859a29ba7f570b9dae3b5bb7ab4bd7b8cee4)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-10 17:10:17 +00:00
Jessica Zhang c6ec5a0d9e Fix the issue that adt-installer tar ball is not regenerated if sstate is on, and other minor bug fixes
(From OE-Core rev: 61da952fdc2996c27c56234c36116a69a23a378d)

Signed-off-by: Jessica Zhang <jessica.zhang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Conflicts:

	meta/recipes-devtools/installer/adt-installer_1.0.bb
2012-02-10 17:10:08 +00:00
Lianhao Lu de68393270 adt-installer: install autoconf(/automake)-nativesdk
[YOCTO #1909]
Install autoconf-nativesdk and automake-nativesdk to host.

(From OE-Core rev: 0b3842f5c3c1587d25e70bc8223e2b144b9043cb)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-10 17:10:03 +00:00
Richard Purdie 12e5797e51 fetch2/git: Add workaround for clone using alternates problem
To quote my report of this to the git mailing list:
"""

I have a problem with git clone commands using alternates failing by
mixing up different repositories. I have a situation where I could end
up with both:

/srv/mirrors/repo
/srv/mirrors/repo.git

as bare clones.

I then try cloning "repo" with alternates with the command:

$ git clone -s -n /srv/mirrors/repo /tmp/foo
Cloning into /tmp/foo...
done.

$ cat /tmp/foo/.git/objects/info/alternates
/srv/mirrors/repo.git/objects

Note how I'm now referencing repo.git, not repo. This doesn't work as
expected giving some very bizarre results when actually using the
repository.

I appreciate this is a rather bizarre corner case but its one that is
breaking the build system I work with. Ideally people would use a
consistent URL for the same repository but we have an example where they
haven't and this really shouldn't break like this.

Looking at the code, the cause seems to be

clone.c:get_repo_path():
        static char *suffix[] = { "/.git", ".git", "" };

since its looking in order for:
 repo/.git (fails)
 repo.git (suceeds, incorrect)
 repo (never looked at)

I'm not sure what would break if that order were to change, swapping the
last two options.

I can "force" the issue by running:

git clone -s -n /srv/mirrors/repo/ /tmp/foo

but this results in the slightly odd looking:

$ cat /tmp/foo/.git/objects/info/alternates

/srv/mirrors/repo//objects

which does at least work.
"""

This patch adds the trailing slash to ensure the correct repository is
referenced at the expense of some ugliness in the alternates file.

(Bitbake rev: d978e7b35550e3785c7c567ffe4c40a3c3947450)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-03 17:42:14 +00:00
Bruce Ashfield 6c65263f8d linux-yocto: bump kver to v3.0.18
Updating the kernel SRCREVs to pickup the stable 3.0.18 release.

(From OE-Core rev: b1a4d1a912af39dc3be7433a1e2ed4c48d5ffb93)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:49:49 +00:00
Joshua Lock 32f0a45c33 multilib.conf: add missing entry for shadow-sysroot
(From OE-Core rev: 31aff4c3db9ce985313ff9b4fc7fbe8015973749)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:49:48 +00:00
Jean-François Dagenais 726f3bce5a buildstats: tolerate absence of /proc/diskstats
In OpenVZ containers (and probably lx containers as well),
the diskstats entry is not even present. Use the "NoLogicalDrive"
introduced by Elizabeth Flanagan in such case.

This allows the bitbaking to occure within such containers.

(From OE-Core rev: 16e09b850dcb44cb1afe411439e40a4bae7e8002)

(From OE-Core rev: 84bd443d82d8022027180b6ef1f7b7cfc7d06420)

Signed-off-by: Jean-François Dagenais <jeff.dagenais@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:49:48 +00:00
Saul Wold 75f253d7d2 openssl-0.9.8: Update to 0.9.8s
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4108

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4109

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4576

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4577

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4619

[YOCTO #1904]

(From OE-Core rev: 980ba5e77438c3a22c295f56ffb71f1d290db50a)

(From OE-Core rev: 3e93af369d70d20a53bd7849a62b177b910e6a36)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:49:48 +00:00
Wolfgang Denk a5c04850e6 clutter-1.6: make build for armv4t
GCC will define __ARM_ARCH_4T__ when building with "-march=armv4t" so
we can check this to turn off the use of 'clz' instructions, which
otherwise would cause compile errors like "selected processor does
not support ARM mode `clz r3,r0'".

(From OE-Core rev: 6859e3fc34269620146d26eeecc9b93c3a9d7055)

Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:51 +00:00
Joshua Lock cef4500611 linux-tools: add binutils to perf DEPENDS
We have witnessed non-deterministic failures of perf for some platforms
whilst looking for bfd.h, a header provided by binutils.

(From OE-Core rev: ab56f27d96cbd2c79ca16d12333687ca9720934c)

(From OE-Core rev: eb014a992e0f3e6ddb4eee8e1287d28ac2f09e00)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:51 +00:00
Saul Wold df2da07184 intltool: remove XML::Parser check
Add Patch to disable the XML::Parser check in the target
intltool.m4, this check will find the host (not native)
XML::Parser if it's installed possibly causing Host
contamination, but will also fail configuration if XML::Parser
is not installed on the host.

Since we know that XML::Parser is installed on the image, we don't
really need this check, so comment it out.

From RP in mail thread:
> If the recipe needs perl for
> some other reason than intltool, it needs perlnative but it if only
> needs perl for intltool, we shouldn't need the dependency. The .m4 macro
> checks are well intended but don't fit the way we use perl. I really
> don't want to end up in a position where intltool automatically means we
> have to add perlnative as a dependency and we've previously seen many
> problems related to that.

(From OE-Core rev: 264fb6c5a4875cd8969a24a9f0301ed916ab827b)

(From OE-Core rev: 085c76298891dc0b0e2207ef929569672c9cb254)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:51 +00:00
Matthew McClintock 77912d65c7 rpm_5.4.0.bb: Build rpm without xz
This fixes the following issue:

Log data follows:
| NOTE: Creating RPM package for perf-dbg
| NOTE: Creating RPM package for perf
| NOTE: Creating EMPTY RPM Package for kernel
| NOTE: Creating EMPTY RPM Package for kernel-3.0.9-00348-gec4b357
| NOTE: Creating RPM package for kernel-image-3.0.9-00348-gec4b357
| NOTE: Creating RPM package for kernel-dev
| NOTE: Creating RPM package for kernel-vmlinux
| NOTE: Not creating empty RPM package for kernel-misc
| NOTE: Creating RPM package for kernel-devicetree
| NOTE: Creating RPM package for kernel-module-libcrc32c
| NOTE: Creating RPM package for kernel-module-crc-itu-t
| NOTE: Creating RPM package for kernel-module-sctp
| NOTE: Creating RPM package for kernel-module-pcbc
| NOTE: Creating RPM package for kernel-module-crc32c
| NOTE: Creating RPM package for kernel-module-binfmt-misc
| NOTE: Creating RPM package for kernel-module-nfsd
| NOTE: Creating RPM package for kernel-module-exportfs
| NOTE: Creating RPM package for kernel-module-msdos
| NOTE: Creating RPM package for kernel-module-nls-utf8
| NOTE: Creating RPM package for kernel-module-udf
| NOTE: Creating RPM package for kernel-module-isofs
| NOTE: Creating RPM package for kernel-module-usbhid
| NOTE: Creating RPM package for kernel-module-scsi-wait-scan
| NOTE: Creating EMPTY RPM Package for kernel-modules
| /local/home/mattsm/git/fsl-local-sdk/build_p4080ds_release/tmp/sysroots/x86_64-linux/usr/bin/rpmbuild.real: error while loading shared libraries: liblzma.so.5: cannot open shared object file: No such file or directory
| ERROR: Function 'BUILDSPEC' failed (see /local/home/mattsm/git/fsl-local-sdk/build_p4080ds_release/tmp/work/p4080ds-fsl-linux/linux-qoriq-sdk-3.0.6-r2/temp/log.do_package_write_rpm.18943 for further information)

(From OE-Core rev: 1f55b31bdc8cf1da04ef29f4e44c1be6c0286ee2)

(From OE-Core rev: 3b0239ab2c36d7227ec4e81d2aaf93c273cdc292)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:50 +00:00
Saul Wold 878425f147 coreutils: ensure --color works so DEPEND on libcap
[YOCTO #1860]

(From OE-Core rev: 6abf6054ac5a464cfa6f1040bb166765558a1eb8)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:50 +00:00
Richard Purdie fa9ad15e41 which: Disable iberty since its not listed in DEPENDS
(From OE-Core rev: 4d6420d0aa1d6e8aecc8ec0526144f9c4396a822)

(From OE-Core rev: 778330071bcab83baff8ec8f22367f5dd0a71d35)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:50 +00:00
Nitin A Kamble 961f75d11b site/x86_64-linux: add cvs config variables
configure of cvs packages was failing on the meta-toolchain for a x86_64 target.

Configure error reported:
checking whether printf supports %p... configure: error: cannot run test program while cross compiling

This fixes [YOCTO #1781]

(From OE-Core rev: 061818adbea1af9e98fe0fdf81b21f1e7f210c00)

(From OE-Core rev: 5e0e0cf5b9d380120187d368683e9f95c1b8f6d1)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:50 +00:00
Matthew McClintock 60c5ef3508 Nothing uses USERNAME, remove it - can cause sstate-cache conflicts
USER is the correct variable to use, also this can affect sstate
cache as well.

(From OE-Core rev: 898bf0294d01172b0990d218ecc5fecdba962711)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:50 +00:00
Matthew McClintock e5e7a913c2 Remove EGLIBPARALLELISM from deps for EXTRA_OEMAKE
Without this simply changing the number of threads via
PARALLEL_MAKE can invalidate sstate-cache

(From OE-Core rev: b2411e12f9ea32012af20ecee1e09d95db129b75)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:50 +00:00
Richard Purdie 165e39a0bb bitbake.conf Exclude MACHINE from MACHINEOVERRIDE variable dependencies
(From OE-Core rev: 362512b83775ad7020e5870a594f0e7ca9ef83ba)

(From OE-Core rev: 3ef7e82a8b0121e2b7200179176e39ef4315971d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:49 +00:00
Khem Raj 09d5966e46 gcc-4.6: Fix gcc ICE on qt4-x11-free/armv7-a
Backport fix for PR 47551 fixes the ICE seen on armv7-a/qt4-x11-free
Bump up SRCREV past gcc 4.6.2 release

(From OE-Core rev: dd2fdf9f5a3923c37e4ea2e46e347bb0657c2f5b)

(From OE-Core rev: 320f6b71e502d65421a01a2f280c9e2c8f046619)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:49 +00:00
Richard Purdie 0bd433ebf5 opkg: Fix installation order in feeds with mutiple providers of packages
If two packages were available of differing priority, this would confuse
opkg and it was ignoring the dependency in the new dependency ordering
code. This changes it not to ignore these cases by setting the badly
named 'quiet' parameter accordingly.

(From OE-Core rev: c38693f78c968ab5f4bb557c20d1c8c55393ed6b)

(From OE-Core rev: 4c75318b75c4776cc469cc2c6511596bc7befbb4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:49 +00:00
Richard Purdie c2e003ecd5 populate_*.bbclass: Correct INSTALL variable name after recent multilib changes
(From OE-Core rev: 379c77d1516fe8fdbd1cd7063f709b5266872b03)

(From OE-Core rev: a300e9e45f4570f0aa47fb3fabcee95433ffad99)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:49 +00:00
Richard Purdie 9f51e226dc populate_*.bbclass: Drop pointless fakeroot attribute (fakeroot is at the task level)
(From OE-Core rev: 2cac20439d4eb0b3a21ce37e2fa670941e6356c4)

(From OE-Core rev: f070a2bf7e689345ea6d9386f7298bf5d36d576f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:48 +00:00
Richard Purdie 681499ebfe scripts/runqemu-ifup: Ensure netmask is set correctly
Without this the command will add a route for the subnet 192.168.7.0 which
means multiple qemu instances can't operate correctly since all but the last
one will be masked out.

(From OE-Core rev: 9e00d6b343120496ec0dd72240c7b04e0a8b7eaa)

(From OE-Core rev: f5bcd56dcca7daad6aa6b4371d4e331d8ffd11eb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:48 +00:00
Richard Purdie 5d96094939 opkg: Drop the offlineroot_varname patch
This break things for on target opkg usage since $D must remain
unset there.

(From OE-Core rev: 746ae269a475857ae57095b1fd164fe195b3d051)

(From OE-Core rev: aa632292cc55b997a5b808b6c4a70ce33a3b9e7e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:48 +00:00
Richard Purdie 10d9e0805e opkg: Add logic to detect and creak circular dependencies
This addresses some of the concerns about the previous opkg changes
allowing it to break out of circular dependency loops with just a notice
in the logs rather than effectively going OOM.

(From OE-Core rev: 5a2b67b8faad3dd5417ba89d8e82ca564753ccc9)

(From OE-Core rev: 29f77f865434cc956e6bbccaee81ff458492ec46)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:48 +00:00
Richard Purdie c1c6613ddd opkg: Update svn 625 -> 633 and fix preinst issues
There is a major issue with opkg images at the moment as preinst
functions are not being executed before their dependencies are installed
and this is leading to corruption of images containing avahi/dbus in
particular.

There are various changes in upstream opkg in the last 8 revisions which
make changes in this area but sadly these aren't enough to get things
working for us. I've updated to the latest svn revision with this patch
since it makes sense to pull in those changes first and then supplement
them with the attached patches.

There is a full description of the patches in the patch headers but in
summary they:

a) Ensure preinst functions execute with their dependencies installed.
   This is a pretty invasive change as it changes the package install
   ordering in general.
b) Ensure opkg sets $D, not $PKG_ROOT which we don't use
c) Change opkg to allow execution of postinstall functions which fail
   resulting in execution on the target device as rootfs_ipk.bbclass
   currently does manually.

The remaining changes interface this with the rest of the OE build
infrastructure, adding in the option to tell opkg to run the preinst and
postinst functions, ensure the correct environment is present for the
postinst scripts and removing the now unneeded rootfs_ipk class code
which opkg now does itself.

[YOCTO #1711]

(From OE-Core rev: 2feba313c991170747381c7cf821a45c2cd04632)

(From OE-Core rev: b7e2eff8c18bc59605fb711ac4540985c71f155a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:48 +00:00
Richard Purdie 5db4eaac2d update-alternatives: Various fixes
dpkg-native's update-alternatives is broken for offline work so
don't install it.

Also list update-alternatives in the multiprovider whitelist to
avoid unwanted multiple provider warnings when multiple package
backends are enabled.

(From OE-Core rev: 300336fc4a310ed16a14ad041744708d54aae189)

(From OE-Core rev: c90b1faa34e908c7f63e1a64027873858e6d7e8a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:47 +00:00
Richard Purdie f99f36f637 package_rpm: Set _tmppath to avoid races over tmp files
Occasionally we keep seeing "unable to open temp file" messages during
do_package_write_rpm tasks. This appears to happen when multiple
processes are writing rpm files and is likely due to using the
shared system temp directory. This patch changes the tmp path
to the package work directory meaning conflicts should become
a non-issue.

(From OE-Core rev: b2ef543284c8c8d0d3badb2e1bcadad1106982d2)

(From OE-Core rev: 018442ed2cd251f85212dfa1d03c0b24a0750bfa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:47 +00:00
Jiajun Xu 7705d9a8cc sanitytest: remove rpm/zypper tests if PACKAGE_CLASSES does not set package_rpm
If PACKAGE_CLASSES does not set package_rpm as the first item, the root filesystem
will not be generated based on rpm. We need remove rpm/zypper tests against
non-rpm filesystem.

[YOCTO #1757]

(From OE-Core rev: 43adb8dcf4461b68a7ce0ba9d8acdb2012a70416)

(From OE-Core rev: f541517be97e27951157e1dd10256e132c31ab1f)

Signed-off-by: Jiajun Xu <jiajun.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:47 +00:00
Richard Purdie bcec98bf1c package.bbclass: Ensure paths to rpmmarcos and rpmpopt are set
If rpm-native was built in an alternative location, it may not relocate correctly
unless the rpmpopt and macros paths are explicitly specified.

This fixes errors seen on the Yocto autobuilder where pkgconfig
"provides" entries could disappear leading to image dependency failures.

(From OE-Core rev: fb01bd81197057e62106aac966f9ebc4c5054f97)

(From OE-Core rev: 15f50ab3ee454dc3510801d61bb09bf37d78d1af)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:47 +00:00
Matthew McClintock 0d9809c4ec populate_sdk.bbclass: remap packages when generating sdk tarball
This fixes the issue below:

| Generating solve db for /local/home/mattsm/git/poky/build_p4080ds_release/tmp/deploy/rpm/all...
|    total:               1      0.000000 MB      0.093784 secs
|    fingerprint:         9      0.000012 MB      0.000252 secs
|    install:             3      0.000000 MB      0.039092 secs
|    dbadd:               3      0.000000 MB      0.034837 secs
|    dbget:              12      0.000000 MB      0.000062 secs
|    dbput:               3      0.009532 MB      0.002731 secs
|    readhdr:            31      0.019160 MB      0.000084 secs
|    hdrload:            15      0.027924 MB      0.000116 secs
|    hdrget:            494      0.000000 MB      0.000691 secs
| Processing task-core-standalone-sdk-target...
| Processing glib-2.0...
| Unable to find package glib-2.0 (glib-2.0)!
| ERROR: Function 'do_populate_sdk' failed (see /local/home/mattsm/git/poky/build_p4080ds_release/tmp/work/ppce500mc-fsl-linux/fsl-toolchain-1.0-r6/temp/log.do_populate_sdk.16975 for further information)

If you have:

TOOLCHAIN_TARGET_TASK += "glib-2.0"

The package name was not getting remapped correctly for the do_populate_sdk
case.

(From OE-Core rev: 0b803ac3627c238aa7d19a23b7621f55779f2557)

(From OE-Core rev: e1a07a5fcba93b3ab127c7c6588cab5799a5df45)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:46 +00:00
Saul Wold dcf64630f8 bitbake.conf: remove texinfo-native from ASSUME_PROVIDED
We need to build texinfo-native to get and install the makedoc tool

[YOCTO #1664]

(From OE-Core rev: 8899f4840787ef043d952f8ea2ce5d78e5cc41ab)

(From OE-Core rev: 8e802c0ed491967cd254dce1555a960382a79247)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:46 +00:00
Saul Wold fa610f7f20 texinfo: fix compile failure due target makedoc binary being used
Need to have the texinfo-native build and install a host sysroot makedoc
binary and then patch the target build to use this binary. This requires
that we don't ASSUME_PROVIDED texinfo-native any longer since we need to
install this makedoc tool which is not part of the normal distrubtion.

[YOCTO #1664]

(From OE-Core rev: 9fa98de54a73465f06484ba863eccf1e07cc1e2a)

(From OE-Core rev: 007bbb23808cc5b036829915e3dfa04f590a05d8)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:46 +00:00
Paul Eggleton d97ad36d90 qemu: for native, do not fail if kvm is unavailable
When building qemu-native, if the linux kvm header is unavailable (as
it is on CentOS 5.x 32-bit) then do not pass the --enable-kvm switch to
the configure script, thus avoiding failed do_configure.

(From OE-Core rev: 8c21c71f005b601f58925e9912f2cf44127e291d)

(From OE-Core rev: 44d9e208c97ec1e3c5ba0a8dc6c10cef12dc270d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:46 +00:00
Paul Eggleton de7377a170 scripts/bitbake: add a version >= 2.6 check
Unfortunately we now have code in BitBake which is parsed before the
current version check and is incompatible with Python < 2.6. Rather than
fixing this and being eternally vigilant for >= 2.6 feature usage, just
add a version check to the wrapper script.

(From OE-Core rev: 9b8a48efa3b80fea34efa51de44d10ff2b1e3193)

(From OE-Core rev: c3ba7e8f7aca8b49739b3b92aec723c5f3375bc0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:45 +00:00
Paul Eggleton c471ec56b4 scripts/runqemu: show an error if /dev/net/tun is unusable
If /dev/net/tun is either not present or is not writable by the
user, then show an appropriate error message. (QEMU needs access to this
device in order to enable networking; it may be missing if it is not
enabled or loaded into the kernel, and some distributions such as CentOS
5.x set restrictive permissions upon it.)

(From OE-Core rev: a00b94900d437828f25debce1c30ffcc0bbf29e9)

(From OE-Core rev: b66fa6238a8f9c0972a60932941997517826ff03)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:45 +00:00
Mei Lei 9d55534cc7 rpm: Flush old logs by change the DB_CONFIG
Fixes [YOCTO #1174]

Rpm logs will grow indefinitely, so change the config to flush those old logs.

(From OE-Core rev: e2c4dff079722f256ddcab9630b5b3f8f6421cc9)

(From OE-Core rev: f235c7a320c401fea70a578186c5cf80dd597fcd)

Signed-off-by: Mei Lei <lei.mei@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:45 +00:00
Richard Purdie 54f4e9b66c package.bbclass: Ensure we tell rpmdeps where to find its magic file
Without this, if rpmddeps came from a sstate package which was relocated
it might not find its magic file and if that happens, requires/provides
in packages could get corrupted. This leads to failures at rootfs time
during builds with messages like:

libdbus-1.so.3 is needed by libdbus-glib-1-2-0.92-r1.armv5te

since the provides would be missing in the dbus package.

(From OE-Core rev: abe2a948905a997314c61a8fcd35e2b42a3f4408)

(From OE-Core rev: 5ee145ebbb32824e3870b6dd689ce2b3f9bf3f17)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:45 +00:00
Zhai Edwin 3e783002b3 matchbox-wm: Fix variable type in _NET_WORKAREA setting
According to XChangeProperty doc, array of "long" should be used when format is
32. Wrong _NET_WORKAREA parameter caused blank screen in matchbox-desktop on 64
bit platform.

[YOCTO #1689] got fixed.

(From OE-Core rev: 381c7857a5b303bf9eadd7fffc39d17a2b8e31f2)

(From OE-Core rev: 869601da9aa43d77564c37d291d9072b9896d3e6)

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:44 +00:00
Martin Jansa 935678cbe1 bitbake.conf: add default PRINC 0 to be able to increment it
(From OE-Core rev: 656793c706d84460f397b10ceb23ebb721ed3960)

(From OE-Core rev: 32f0ad32d901ae5a97d912d8d36d4d9a2b502919)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:44 +00:00
Matthew McClintock ee75b5020b openjade-native_1.3.2.bb: remove CONFIGUREOPTS as vardep for do_configure
This variable was being expanded immediately and pulling in
paths to the variable dependecies which causes it's sstate-cache
to never be reused

(From OE-Core rev: ddb8d3de34f809b9c72eb3a2223a74f75eff7911)

(From OE-Core rev: 8f616810b868a30fc01550c017f9fc14220ae7d8)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:44 +00:00
Richard Purdie 5f21a24580 dpkg-native: Fix perl path
The path to the native perl was incorrect leading to rootfs failures. This
patch corrects that problem.

(From OE-Core rev: 044324465bd54d53ae768f3c1e7468ae0e0c6200)

(From OE-Core rev: 8fa40eb1c2a32782b8a74bee70fa81b2c3e5cbaf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:44 +00:00
Richard Purdie 100002e4c6 bitbake.conf: We only care about the absolute value of baselib
The value of baselib can be constructed in several different ways
and from a sstate perspective we don't care how it was made up,
we only care what the final value is. This uses the new functionality
in bitbake to ensure we only include the value of baselib and not
any intermediate dependencies.

[YOCTO #1583]

(From OE-Core rev: c38567894ebc31ac977f2bc89a076d0380bddcf8)

(From OE-Core rev: 8b70cfe7a1768b8bf1e5b7e390276518e16f14af)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:44 +00:00
Richard Purdie 71824019fb eglibc-initial: Ensure symlinks point to the correct location when built from sstate cache
If the sstate files are installed into a sysroot from the sstate cache,
the directory to the main sysroot can change and the symlinks aren't
adjusted to account for this. This is a problem specific to the toolchain
bootstrap process. This patch adds up a function to recreate the
symlinks, hence ensuring they always point at the correct location.

(From OE-Core rev: ad0baa7d2f33a865011e0c6afe29f22aa1beea32)

(From OE-Core rev: bc8a384c49c60feab9d01f8277e92ac0603c8f93)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:43 +00:00
Matthew McClintock 3400b3d2df patch.bbclass: Add PATCHRESOLVE to excluded vars for generating sstate-cache
The method of resolving the patch should not effect the sstate-cache
signature.

(From OE-Core rev: b64cbe0b511de8d8943ce34cbb4901239d9f0cb0)

(From OE-Core rev: 896bd7d1442dcd3f080dc741a72f50ab95d7c38f)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:43 +00:00
Richard Purdie 745d83f968 sstate.bbclass: Ensure we expand stamp-extra-info
Without this change we can end up looking for <stamp>.${MACHINE}
instead of the expected expanded value.

(From OE-Core rev: 9f743b5033177216fe0e1d3e43ba831f356df08e)

(From OE-Core rev: de9f47b09d5434642ba925182ae21a8e77e7e429)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:43 +00:00
Richard Purdie 340a680de2 sstate: No need to spew out a debug message per file, summarise instead
(From OE-Core rev: c7b02c6e80819e30a0818282ab8d960243a2d0e8)

(From OE-Core rev: 6df929c8b58daa19423e5994bbf8bb68c912707f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:43 +00:00
Matthew McClintock 3048bd79b3 sudo_1.8.1p2.bb: Pull patch from upstream to fix parallel build issue
(From OE-Core rev: 255588da1834b45325cf6677906aef2687a3b5f6)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:42 +00:00
Michael Brown ef37926f31 gcc-4.6: fix toolchain build for SH4
(From OE-Core rev: da7bf75bcdd5759a0f551dcb7a0326aa2f40921c)

(From OE-Core rev: 3c9fd383965f883129cf35d0e307d3bbbd5d4908)

Signed-off-by: Michael Brown <Michael_E_Brown@dell.com>

Port patch from base openembedded. Since 4.6 already has fixes for config.gcc,
the fix only requires a one line change to gcc-cross4.inc.

The patch was imported from the OpenEmbedded git server
(git://git.openembedded.org/openembedded) as of commit id
3aa8afe97e9cf1340feb9c4442a6ed88b7e32c96.

gcc-4.5: Fix toolchain builds for SH4/SH3

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:42 +00:00
Richard Purdie 4c30bcfbfe libconvert-asn1-perl/libtimedate-perl: Convert to use allarch
Both these recipes generate architecture independent packages.
They can safely use the allarch class to ensure they really
are indepentent from the target compiler and so forth and
hence ensure sstate packages with good dependencies.

[YOCTO #1075]

(From OE-Core rev: 2856d3f6aca0c20acd40f7f8970ec8590e4889a8)

(From OE-Core rev: 676a5c44fb621ae428f8ac1fc466469914cbc864)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:42 +00:00
Phil Blundell 709ad80662 libnss-mdns: avoid race condition in postinst
Writing to "/tmp/nsswitch.conf" leads to a race condition if two
copies of the postinst are running simultaneously.  Fix this by
modifying /etc/nsswitch.conf in place using sed -i.  Also make the
same change to the prerm for consistency although the race will not
occur here in practice.

(From OE-Core rev: 689884653938b98899fb3ba791221fdbe2f40e7f)

(From OE-Core rev: 2a2741c12196c34c5e6127488a8eeec7118b2952)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:42 +00:00
Martin Jansa 08a834a08a alsa-lib: use PKGSUFFIX for every package to resolve multiple runtime providers from target and nativesdk
(From OE-Core rev: 60738953f6fee24de447cd0f9cf81cce6f8966a5)

(From OE-Core rev: 4c2a9e410c46fbf52f3d64767baf06c7146d001e)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:41 +00:00
Martin Jansa 6c3dd24e59 webkit-gtk: force arm mode to work around binutils segfault
* this is just work around, would be better to fix in toolchain

(From OE-Core rev: 2df59dad90f31aa48113ad8afe1af084b71a6a2c)

(From OE-Core rev: 3648cf8f02601ac57787f81cb199677434970b34)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:41 +00:00
Martin Jansa 66d6c031b0 aspell: force ARM mode
* this is just work around for ICE, better fix would be to fix gcc
| ./common/fstream.hpp:23:9: note: the mangling of 'va_list' has changed in GCC 4.4
| modules/speller/default/typo_editdist.cpp: In function 'short int aspeller::typo_edit_distance(acommon::ParmString, acommon::ParmString, const aspeller::TypoEditDistanceInfo&)':
| modules/speller/default/typo_editdist.cpp:77:3: internal compiler error: in gen_thumb_movhi_clobber, at config/arm/arm.md:5937
| Please submit a full bug report,
| with preprocessed source if appropriate.
| See <http://gcc.gnu.org/bugs.html> for instructions.
| make[1]: *** [modules/speller/default/typo_editdist.lo] Error 1
| make[1]: *** Waiting for unfinished jobs....
| make[1]: Leaving directory `/OE/shr-core/tmp-eglibc/work/armv4t-oe-linux-gnueabi/aspell-0.60.6.1-r0/aspell-0.60.6.1'

(From OE-Core rev: eff532ea13a270c0e4ffaf4ab059403d612a3197)

(From OE-Core rev: 9fa76ebe080ec729af429cf2a77b4aba814c2b61)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:41 +00:00
Martin Jansa 957882caef pulseaudio-0.9.23: force ARM mode
* this is just work around, should be tested again after upgrade to
  pulseaudio-1.1
* otherwise build for armv4t (om-gta02) fails with this:
| /bin/sh ../arm-oe-linux-gnueabi-libtool  --tag=CC   --mode=compile
arm-oe-linux-gnueabi-gcc  -march=armv4t -mthumb -mthumb-interwork
-mtune=arm920t --sysroot=/OE/shr-core/tmp/sysroots/om-gta02 -std=gnu99
-DHAVE_CONFIG_H -I. -I..    -I../src -I../src -I../src/modules
-I../src/modules -I../src/modules/rtp -I../src/modules/rtp
-I../src/modules/gconf -I../src/modules/gconf -I../src/modules/bluetooth
-I../src/modules/bluetooth -I../src/modules/oss -I../src/modules/oss
-I../src/modules/alsa -I../src/modules/alsa -I../src/modules/raop
-I../src/modules/raop -I../src/modules/x11 -I../src/modules/x11
-I../src/modules/jack -I../src/modules/jack -I../src/modules/echo-cancel
-I../src/modules/echo-cancel -pthread -D_POSIX_PTHREAD_SEMANTICS
-DPA_BUILDDIR=\"/OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/pulseaudio-0.9.23-r6/pulseaudio-0.9.23/src\"
-DPA_DLSEARCHPATH=\"/usr/lib/pulse-0.9.23/modules\"
-DPA_DEFAULT_CONFIG_DIR=\"/etc/pulse\"
-DPA_BINARY=\"/usr/bin/pulseaudio\"
-DPA_SYSTEM_RUNTIME_PATH=\"/var/run/pulse\"
-DPA_SYSTEM_CONFIG_PATH=\"/var/lib/pulse\"
-DPA_SYSTEM_STATE_PATH=\"/var/lib/pulse\" -DAO_REQUIRE_CAS
-DPULSE_LOCALEDIR=\"/usr/share/locale\"
-DPA_MACHINE_ID=\"/var/lib/dbus/machine-id\"
-DPA_ALSA_PATHS_DIR=\"/usr/share/pulseaudio/alsa-mixer/paths\"
-DPA_ALSA_PROFILE_SETS_DIR=\"/usr/share/pulseaudio/alsa-mixer/profile-sets\"
-O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wextra -pipe
-Wno-long-long -Winline -Wvla -Wno-overlength-strings
-Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op
-Wsign-compare -Wformat-security -Wmissing-include-dirs
-Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self
-Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes
-Wstrict-prototypes -Wredundant-decls -Wmissing-declarations
-Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align
-Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math
-Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option -c -o
libbluetooth_sbc_la-sbc.lo `test -f 'modules/bluetooth/sbc.c' || echo
'./'`modules/bluetooth/sbc.ci

| arm-oe-linux-gnueabi-libtool: compile:  arm-oe-linux-gnueabi-gcc
-march=armv4t -mthumb -mthumb-interwork -mtune=arm920t
--sysroot=/OE/shr-core/tmp/sysroots/om-gta02 -std=gnu99 -DHAVE_CONFIG_H
-I. -I.. -I../src -I../src -I../src/modules -I../src/modules
-I../src/modules/rtp -I../src/modules/rtp -I../src/modules/gconf
-I../src/modules/gconf -I../src/modules/bluetooth
-I../src/modules/bluetooth -I../src/modules/oss -I../src/modules/oss
-I../src/modules/alsa -I../src/modules/alsa -I../src/modules/raop
-I../src/modules/raop -I../src/modules/x11 -I../src/modules/x11
-I../src/modules/jack -I../src/modules/jack -I../src/modules/echo-cancel
-I../src/modules/echo-cancel -pthread -D_POSIX_PTHREAD_SEMANTICS
-DPA_BUILDDIR=\"/OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/pulseaudio-0.9.23-r6/pulseaudio-0.9.23/src\"
-DPA_DLSEARCHPATH=\"/usr/lib/pulse-0.9.23/modules\"
-DPA_DEFAULT_CONFIG_DIR=\"/etc/pulse\"
-DPA_BINARY=\"/usr/bin/pulseaudio\"
-DPA_SYSTEM_RUNTIME_PATH=\"/var/run/pulse\"
-DPA_SYSTEM_CONFIG_PATH=\"/var/lib/pulse\"
-DPA_SYSTEM_STATE_PATH=\"/var/lib/pulse\" -DAO_REQUIRE_CAS
-DPULSE_LOCALEDIR=\"/usr/share/locale\"
-DPA_MACHINE_ID=\"/var/lib/dbus/machine-id\"
-DPA_ALSA_PATHS_DIR=\"/usr/share/pulseaudio/alsa-mixer/paths\"
-DPA_ALSA_PROFILE_SETS_DIR=\"/usr/share/pulseaudio/alsa-mixer/profile-sets\"
-O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wextra -pipe
-Wno-long-long -Winline -Wvla -Wno-overlength-strings
-Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op
-Wsign-compare -Wformat-security -Wmissing-include-dirs
-Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self
-Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes
-Wstrict-prototypes -Wredundant-decls -Wmissing-declarations
-Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align
-Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math
-Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option -c

modules/bluetooth/sbc.c  -fPIC -DPIC -o .libs/libbluetooth_sbc_la-sbc.oi
| modules/bluetooth/sbc.c: In function 'sbc_synthesize_four':
| modules/bluetooth/sbc.c:553:18: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:553:18: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:553:18: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:553:18: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:553:18: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:553:18: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:553:18: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:553:18: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:565:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c: In function 'sbc_synthesize_eight':
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:595:29: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
| modules/bluetooth/sbc.c:611:40: warning: shadowed declaration is here [-Wshadow]
| {standard input}: Assembler messages:
| {standard input}:6997: Error: selected processor does not support Thumb mode `mla r3,r0,ip,r3'
| {standard input}:7012: Error: selected processor does not support Thumb mode `mla r3,r1,ip,r3'
| {standard input}:7026: Error: selected processor does not support Thumb mode `mla r3,ip,r0,r3'
| {standard input}:7215: Error: selected processor does not support Thumb mode `mla r3,r7,r0,r3'
| {standard input}:7230: Error: selected processor does not support Thumb mode `mla r3,r7,r0,r3'
| {standard input}:7241: Error: selected processor does not support Thumb mode `mla r3,r0,r7,r3'
| {standard input}:7256: Error: selected processor does not support Thumb mode `mla r3,r0,r7,r3'
| {standard input}:7267: Error: selected processor does not support Thumb mode `mla r3,r7,r0,r3'
| {standard input}:7287: Error: selected processor does not support Thumb mode `mla r3,r7,r6,r3'
| {standard input}:7301: Error: selected processor does not support Thumb mode `mla r3,r6,r5,r3'
| {standard input}:7319: Error: selected processor does not support Thumb mode `mla r3,r0,r5,r3'
| {standard input}:7327: Error: selected processor does not support Thumb mode `mla r3,r1,r0,r3'
| {standard input}:7594: Error: selected processor does not support Thumb mode `mla r3,r5,r6,r3'
| {standard input}:7604: Error: selected processor does not support Thumb mode `mla r3,r5,r6,r3'
| {standard input}:7614: Error: selected processor does not support Thumb mode `mla r3,r5,r6,r3'
| {standard input}:7624: Error: selected processor does not support Thumb mode `mla r3,r5,r6,r3'
| {standard input}:7634: Error: selected processor does not support Thumb mode `mla r3,r5,r6,r3'
| {standard input}:7647: Error: selected processor does not support Thumb mode `mla r3,r2,r5,r3'
| {standard input}:7657: Error: selected processor does not support Thumb mode `mla r3,r2,r5,r3'
| {standard input}:7815: Error: selected processor does not support Thumb mode `mla r3,r9,r7,r3'
| {standard input}:7837: Error: selected processor does not support Thumb mode `mla r3,r9,r0,r3'
| {standard input}:7853: Error: selected processor does not support Thumb mode `mla r3,r9,r0,r3'
| {standard input}:7875: Error: selected processor does not support Thumb mode `mla r3,r9,r7,r3'
| {standard input}:7891: Error: selected processor does not support Thumb mode `mla r3,r9,r7,r3'
| {standard input}:7908: Error: selected processor does not support Thumb mode `mla r3,r0,r6,r3'
| {standard input}:7931: Error: selected processor does not support Thumb mode `mla r3,r6,r5,r3'
| {standard input}:7952: Error: selected processor does not support Thumb mode `mla r3,r0,r5,r3'
| {standard input}:7960: Error: selected processor does not support Thumb mode `mla r3,r2,r0,r3'
| make[4]: *** [libbluetooth_sbc_la-sbc.lo] Error 1
| make[4]: Leaving directory `/OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/pulseaudio-0.9.23-r6/pulseaudio-0.9.23/src'
| make[3]: *** [all-recursive] Error 1
| make[3]: Leaving directory `/OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/pulseaudio-0.9.23-r6/pulseaudio-0.9.23/src'
| make[2]: *** [all] Error 2
| make[2]: Leaving directory `/OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/pulseaudio-0.9.23-r6/pulseaudio-0.9.23/src'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory `/OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/pulseaudio-0.9.23-r6/pulseaudio-0.9.23'
| make: *** [all] Error 2
| + die 'oe_runmake failed'
| + bbfatal 'oe_runmake failed'
| + echo 'ERROR: oe_runmake failed'
| ERROR: oe_runmake failed
| + exit 1
| ERROR: Function 'do_compile' failed (see /OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/pulseaudio-0.9.23-r6/temp/log.do_compile.3404 for further information)

(From OE-Core rev: 31a20d50124344dc708ade282677b2c7dda171b0)

(From OE-Core rev: 4eaf22dc67c3de9025bae3f24837f569aba91fff)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:41 +00:00
Khem Raj 8781450256 pulseaudio: inherit perlnative
manpage generatition uses xmltoman utility
which inturn uses xml-parser. So we add
libxml-parser-perl-native to DEPENDS and also
inherit perlnative so it does not use the one
from build host

(From OE-Core rev: 51f6a683ec1d740adf09d808671c7098dc3f83e2)

(From OE-Core rev: 1c5cdc8ee9edeafe86ef0fd955ee067ab67c7aa9)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:41 +00:00
Martin Jansa 9d23f215a0 libatomics-ops: force ARM mode
* otherwise ie spitz (armv5te) build fails with:
| make[3]: Entering directory `/OE/shr-core/tmp/work/armv5te-oe-linux-gnueabi/libatomics-ops-1.2-r5/libatomic_ops-1.2/src'
| arm-oe-linux-gnueabi-gcc  -march=armv5te  -mthumb -mthumb-interwork  -mtune=xscale --sysroot=/OE/shr-core/tmp/sysroots/spitz -DHAVE_CONFIG_H -I.    -fPIC -O
2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -c atomic_ops.c
| arm-oe-linux-gnueabi-gcc  -march=armv5te  -mthumb -mthumb-interwork  -mtune=xscale --sysroot=/OE/shr-core/tmp/sysroots/spitz -DHAVE_CONFIG_H -I.    -fPIC -O
2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -c atomic_ops_stack.c
| arm-oe-linux-gnueabi-gcc  -march=armv5te  -mthumb -mthumb-interwork  -mtune=xscale --sysroot=/OE/shr-core/tmp/sysroots/spitz -DHAVE_CONFIG_H -I.    -fPIC -O
2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -c atomic_ops_malloc.c
| atomic_ops_malloc.c: In function 'msb':
| atomic_ops_malloc.c:223:2: warning: right shift count >= width of type [enabled by default]
| rm -f libatomic_ops_gpl.a
| ar cru libatomic_ops_gpl.a atomic_ops_stack.o atomic_ops_malloc.o
| arm-oe-linux-gnueabi-ranlib libatomic_ops_gpl.a
| {standard input}: Assembler messages:
| {standard input}:286: Error: selected processor does not support Thumb mode `swp r1,r2,[r3]'
| {standard input}:329: Error: selected processor does not support Thumb mode `swp r0,r1,[r3]'

* this is just work around, proper fix proposed by Henning Heinold
  hm we should think of reworking this recipe now. Because since gcc 4.5
  pulseaudio for arm can use the gcc internal atomicstuff and in oe-core
  and meta-oe we have 4.5 or 4.6 only. The lib is
  only needed for mips and it is still the old release, on cvs
  is a much better version, which supports thumb too, if
  remember correctly.

(From OE-Core rev: 2d34fc0ce21fe06ff97208c8ffb65a718b444de9)

(From OE-Core rev: 6b403ff01863cf3788b696a2b45e56cfaca56512)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:40 +00:00
Richard Purdie 2c1a0b7d32 dpkg/update-alternatives: Fix dpkg version of update-alternatives to be usable
The version of dpkg the updates-alternatives-dpkg recipe pointed
at no longer used a perl script but a compiled binary. This meant
the "all" architecture field was invalid, as as the sed operation
during do_patch. All things considered the separate recipe was
pretty pointless.

This patch moves update-alternatives back to being built as part
of the dpkg recipe. It also moves various functionalty to the .inc
file which it belongs and fixes building and packaging of the dpkg
perl modules.

(From OE-Core rev: fad496c759066d53bebf9b8cebc63e6478c91d19)

(From OE-Core rev: 467af9ae45ce54d6e50041d5134af889ac7cf4d2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:40 +00:00
Richard Purdie 9e52c53a5d base-passwd: Move update-passwd into a separate package
update-passwd is the only user of the passwd/group.master files
and was never used by OE since it wasn't run.

This patch packages this separately and adds an appropriate postinst
to make the package useful so people can include it as they wish.

(From OE-Core rev: 77ab0f09546c5f6217a8e2f1bc30cf3d4306e3fa)

(From OE-Core rev: c26d37b65e0ad69a36e799c56f3c4426ea18f17e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:40 +00:00
Richard Purdie f812a2c912 base-passwd: Fix the broken preinst/postinstall
The preinst accesses file which may not yet have been unpacked.
The postinst is too late for the creation of these files
for at least the opkg backend.

This patch therefore encodes the file contents into the preinst,
resolving the various issues once and for all.

(From OE-Core rev: fc708d88f97e40a5bf929e4e02ed805fb3684ffe)

(From OE-Core rev: 0f4156c0735e28812c3f8ab27075d3de5360badb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:40 +00:00
Richard Purdie d3c848094f opkg: Ensure we use the uname/gname fields when extracting tarballs
When extracting packages onto the target system in particular, we
really want to ensure the name fields in the tarball are used over
and above the numerical uid/gid values. This patch adds this
functionality to opkg and ensures package upgrades work correctly
permission wise.

(From OE-Core rev: f2316ff39670ed99382411e15ac035550360fbdd)

(From OE-Core rev: 56800b9906cf228331083256664407947f831185)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:39 +00:00
Richard Purdie 37d694ae80 rootfs_ipk.bbclass: Ensure bad recommendations persist in the status file
Currently bad recommendations are added to the status file with status
"ok". After a single opkg command, whilst it will ignore the recommendation,
the status changes to "installed" even if the recommended package was not
installed. Whilst this is likely a glitch in opkg's logic, the correct
way to persist the information in the status file is to set the status
to "hold" as deinstall packages with that status remain. With this change
the bad recommendations persist accross multiple opkg runs and the system
behaves as expected.

[YOCTO #1758]

(From OE-Core rev: 215ff6b2e9676c8c7dd8acfd696151bcd0f1490f)

(From OE-Core rev: 525743f5513feff67fb8fd2e4c7a1a05ae22ddc9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:39 +00:00
Otavio Salvador e391e1a200 xinit: rdepends on util-linux-mcookie to avoid brining whole util-linux
(From OE-Core rev: a8ed4fcd79f6283c1d45f347dce894d784183900)

(From OE-Core rev: 7fc9855421222eb671e414ef7bc190f53521e914)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:39 +00:00
Otavio Salvador 199f985754 util-linux: split mcookie into a package
(From OE-Core rev: 3e5b9ddaf3f9492e34967146c42369bcd76ddf03)

(From OE-Core rev: 66ac20ea171a5f823b4810975570885c8138d930)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:39 +00:00
Paul Eggleton 395ffa8930 util-linux: split out mkfs into its own package
For those external tools such as Webmin that call mkfs to do formatting
operations, it is useful to have it in its own package to avoid dragging
in the rest of util-linux.

(From OE-Core rev: cceee30de96b2389209fc2c9c474ebbd863ff64a)

(From OE-Core rev: d5841bc9559d9de4ca1a063ecf40571688d0d147)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>

[Merged with head]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:38 +00:00
Matthew McClintock 90920546e4 Add new util-linux-chkdupexe package to avoid making perl a dependecy for all of util-linux
(From OE-Core rev: 57def2a05f4cff77f014c6dfb93c2dcc1b9db61b)

(From OE-Core rev: 115f49b2b4b13884be7a4fffc4261cbcb884d428)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:38 +00:00
Koen Kooi 1d9ec42166 util-linux 2.19.1: split blkid out into its own subpackage
Recent udev versions require blkid from u-l, not from e2fsprogs. In general all the non fsck related binaries from e2fsprogs are deprecated.

(From OE-Core rev: eb048308ae80d779e904951b032dba5b780898e5)

(From OE-Core rev: d9afc91bd5bce889dfbcba13b6b59ea07f288cc7)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:38 +00:00
Koen Kooi 57481984c9 util-linux: split fsck* into its own subpackage
This will allow systemd to run /sbin/fsck without dragging in all of util-linux

(From OE-Core rev: 4c95779fe1297b06adc705de30dca4e3570084ae)

(From OE-Core rev: 8b3beaddb5d44efcaa88ea173081c6e0558908ad)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:38 +00:00
Mark Hatle 05051d864d sudo: Avoid post install scripts
The post install script was removed, and the install_append updated
to ensure the permissions are set correctly.

(From OE-Core rev: 463e44ae159da2e03369f9ac14843b479de2e43d)

(From OE-Core rev: 52dac3a309f3f1d6a4ee7269b16ca381fd0cdd38)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:38 +00:00
Mark Hatle 48ee7e9b3a shadow: Generate the shadow files at rootfs construction
With the recent changes to the shadow-native package support "--root",
we can now convert the passwd/group files to their shadow forms while
doing the rootfs install, instead of waiting to run on the target.

(From OE-Core rev: 662431ace246e9bb35ad8d0ddd0510193f93517d)

(From OE-Core rev: 03c366bb36145f7bc1679307e578bb2cf44e3737)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:37 +00:00
Mark Hatle 1278cee687 wpa-supplicant: Avoid blocking the post install script at cross rootfs time.
We only want to reload dbus, if we're install on the target -- not on the host.

(From OE-Core rev: 1ce23fe7d7c33c196af3ba25b4e97496718328d1)

(From OE-Core rev: e9dc54d5c31ef50fa2f929d552e2f61533426dcc)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:37 +00:00
Mark Hatle b5195d2739 rootfs_rpm.bbclass: Turn off script debugging
Disable script debugging, as the log files become huge and take a
long time to process during the log check step.  This results in a
performance improvement.

(From OE-Core rev: a7e70227bac72c4f7d3419f94f6915da4c7e3f43)

(From OE-Core rev: 9b6ecd1fd2f6870ace033362e3bb86fd98935bc9)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:37 +00:00
Mark Hatle 7561770d43 rootfs_rpm.bbclass: Enable pre and post install scripts
[YOCTO #1755]

We change the want the RPM rootfs install works to install pre and post install
scripts.  The new method uses a script helper that is invoked by RPM outside
of the normal chroot.

The wrapper is dynamically generated prior to the install starting.  It will
check the return code of the script.  If the script fails, it will store a copy
to be executed on the first system boot.  This is similar to the previous
mechanism.

In addition, a line of debug was added to the scripts as written by package_rpm
to list which package and which script for later debugging, if necessary.

(From OE-Core rev: 3e7120d6a9fd5e46214673d0a6e1085a7314ff42)

(From OE-Core rev: 5d74a2bbe036cf586b76aef0d9907ecb3d4a5f1d)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:43:01 +00:00
Paul Menzel 03fbfe7cf1 xinit: Fix `startx` looking for `mcookie` in sysroot
`startx` run on a system based on the demo systemd image [1] and `opkg`-installed packages fails with the following error.

	/usr/bin/startx: line 139: /OE/tentacle/build/tmp-angstrom_2010_x/sysroots/x68_64-linux/usr/bin/mcookie: No such file or directory

Applying commit 443bcc07 [1] from OE-classic

        Author: Tom Rini <tom_rini@mentor.com>
        Date:   Thu Apr 7 10:36:43 2011 -0700

            xinit: Fix mcookie / util-linux-ng dependency

            xinit just needs to know the runtime path of mcookie so we need to
            RDEPEND on util-linux-ng and pass the runtime path in via EXTRA_OECONF

            (From OE-Core rev: 1053a6a8e15851ef139d8aa4683849fc2fc277e1)

(From OE-Core rev: a32d9dbc25fce5e8566681f0c7f606eedaaf3933)

Signed-off-by: Tom Rini <tom_rini@mentor.com>

fixes this issue. Commit 7f6cec6f [2]

        Author: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
        Date:   Sun Feb 21 18:11:30 2010 +0100

            xinit: add dependency on util-linux-ng

        […]

tried to address the same problem but apparently did not help, because Tom still had problems.

[1] http://www.angstrom-distribution.org/demo/beagleboard/Angstrom-systemd-image-eglibc-ipk-v2011.11-core-beagleboard.rootfs.tar.bz2
[2] http://git.openembedded.org/openembedded/commit/443bcc0785bc004e471b3750a34d12d2fd2e5dad
[3] http://git.openembedded.org/openembedded/commit/7f6cec6f0adb6203a6dbaf8a43c67c2c4f8bf84e

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:16 +00:00
Darren Hart 9faa58ecdc ncurses: refactor configure to avoid configuring widec when disabled
The ENABLE_WIDEC variable can be used to disable ncurses wide character support
when your C library doesn't support it. Currently, the do_configure step
configures for both narrow and wide characters regardless and only checks
ENABLE_WIDEC during compilation. This leads to QA failures with host
contamination during configure if the C library doesn't support wide characters.

Refactor do_configure with a new ncurses_configure helper function and only
configure for wide character support if ENABLE_WIDEC is true.

Ensure that configure errors are propogated back through to do_configure.

Tested with ENABLE_WIDEC as true and false via an ncurses bbappend on i586,
including basic error injection.

V2: INC_PR bump

(From OE-Core rev: 8b995deb046469c1c713fa053510d2fe94454133)

(From OE-Core rev: 802cd855f1860ef0fbbbbf87b0af7c5dcdc35975)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:16 +00:00
Saul Wold cc19812fb4 udev-extraconf: blacklist /dev/md
Do not mount /dev/md by default via udev, this resolved a problem
with the sanity test failing due to seeing the error while attempting
to mount /dev/md0

(From OE-Core rev: 07a2825c6f4ad3e5e3970cd1a89233bd795c68cf)

(From OE-Core rev: 8ea8e41ad7863f57a851f00154e133cd0e550ef8)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:16 +00:00
Richard Purdie 110d499544 useradd: Add missing DEPEND on shadow
Without this rootfs generation fails as an RDEPENDS is added
but the package might not have bneen built.

(From OE-Core rev: bfe70c6446e6686f826f01040ba74c7d7d28bf42)

(From OE-Core rev: 30a1f1d3ec763b4929b052ab3388499dfb40b1fa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:16 +00:00
Scott Garman 7fe64f43f4 avahi: remove USERADDPN
USERADDPN is no longer used; remove it.

(From OE-Core rev: ed7e7a8e4d00cd45c74dc233c8b574d3978755d8)

(From OE-Core rev: 2a52444dd464f5dff43424ab18feae43435061ae)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:16 +00:00
Scott Garman 47007075d4 useradd-example.bb: update example documentation comments
Clarify that only packages listed in USERADD_PACKAGES will
include the user/group creation code.

(From OE-Core rev: 70aaac37968bf2b35d6a536c3f3f69fe3620255c)

(From OE-Core rev: 3d0649253cc99b658a2f6576b1d38661d65f3977)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:15 +00:00
Scott Garman 9dc2193d31 useradd.bbclass: do not modify -nativesdk packages
Exclude the addition of user/group code and RDEPENDS changes for
-nativesdk packages.

(From OE-Core rev: 2f057dd905ccb497890ce73ac4e4c256edcf0351)

(From OE-Core rev: 9acbe80fea3dbd5405030c95d8b6d411689c4911)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:15 +00:00
Scott Garman 403d5e0b7d useradd.bbclass: only modify packages in USERADD_PACKAGES
Previously we injected the user/group preinstall script into all
output packages. This fixes that so that only packages listed in
USERADD_PACKAGES get modified.

It also removes the USERADDPN variable, which is no longer needed.

(From OE-Core rev: 2f73466eb5018040a123ccb0e2af8c519525f958)

(From OE-Core rev: 424b6447ebce761c9027ffdaf68ecbcd6f28e4ec)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:15 +00:00
Paul Eggleton 5d9dfed5c4 busybox: add grep to temporary links during uninstall
In the busybox package prerm we set up some temporary links and modify
PATH so that certain utilities are provided for the purpose of running
update-alternatives; if grep is not among these then you get errors when
removing busybox, so add a temporary link for grep as well.

(From OE-Core rev: 013eca09c863862cc6b7ee3bc22923bf8fb42956)

(From OE-Core rev: a425305249cdd89ab481310b31ae04970c6ae3be)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:15 +00:00
Paul Eggleton 9924a6c72d classes/package_rpm: disable uninstall scripts for upgrades
Our current assumption (based on the behaviour of opkg) when writing
recipes is that prerm and postrm do not get called during an upgrade.
When using rpm however, these are mapped to the rpm "preun" and "postun"
events which occur after postinst for upgrades, and when these contain
removal type operations (such as update-alternatives --remove) this
causes problems.

This patch wraps each preun and postun script for rpm in a check that
determines whether or not the script is being called during an upgrade,
and skips the entire script if it is, which mimics the behaviour of opkg
under the same conditions.

Fixes [YOCTO #1760]

(From OE-Core rev: 1d3f37dc9a43ba6d6beb7b4530c077f239032b99)

(From OE-Core rev: 6e66ecd201760fe418a9884e3605b88a68208776)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:14 +00:00
Tom Zanussi ccf6077d4e python: skip setup.py 'import check' when cross-compiling
build_extension() in setup.py, as part of the build process, does an
'import check' on the built extension.  The import check in turn
dlopen()'s the shared library associated with the extension, which
isn't something that makes sense if that library was cross-compiled
for a different architecture.

This was noticed with an x86_64 target that was compiled with avx
support, because it caused 'illegal instruction' exceptions:

| /bin/sh: line 1: 14575 Illegal instruction ... -E ./setup.py -q build

For other target architectures, it doesn't necessarily cause illegal
instruction exceptions, but still fails.  For example, on arm, the
failure pathway causes this warning:

*** WARNING: renaming "cmath" since importing it failed: .../cmath.so:
    wrong ELF class: ELFCLASS32

This patch to setup.py and the associated recipe changes allow the
whole 'import check' logic to be skipped when cross-compiling.

(From OE-Core rev: 25fae81538a92e15eab3fc169ebce44505f67839)

(From OE-Core rev: d83e4ac25cca788d2b102c2072ccb367c0cab284)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:14 +00:00
Tom Zanussi 38978dc0b8 libzypp: fix mishandling of hyphenated arches
Several hyphen-to-underscore translations were missing, causing
compiler errors trying to build arches with hyphens in their names.
This adds the missing translations.

(From OE-Core rev: 5be9785f344ec4d7580f7ec68e29dba9fceb0a0a)

(From OE-Core rev: 69f45c6e9f28aae2ba84aea87a6ed096800ed685)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:14 +00:00
Tom Zanussi 9152ef8b1d gmp_5.0.2: Set CC_FOR_BUILD to BUILD_CC
CC_FOR_BUILD was compiling the test programs using the target's
compile options and executing those on the host, causing errors such
as:

/bin/sh: line 1: 15032 Illegal instruction     ./gen-bases table 64 0 > mpn/mp_bases.c
/bin/sh: line 1: 15033 Illegal instruction     ./gen-bases header 64 0 > mp_bases.h

Export CC_FOR_BUILD using BUILD_CC to fix the problem.

(From OE-Core rev: 68cca5ca15cbdd53748ec130fb6f20cbb3fb5072)

(From OE-Core rev: 6ce3482c0f50b95d1d60d3c9250a9ab38fca76fe)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:14 +00:00
Otavio Salvador 4e4521b5bf files/device_table-minimal.txt: add /dev/kmsg
(From OE-Core rev: 1a340471694204937981513dee4cc24bc2dc6f7e)

(From OE-Core rev: 535f7e52b02b6434fca5265eba8d366f483ce33c)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:13 +00:00
Otavio Salvador 501211d4d5 libcap: fix sstate for native package
The 'lib' option needs to be given on target and native builds
otherwise it installs the binaries at ${libdir}64 when host is 64bit.

(From OE-Core rev: f768ef66c107410d4e81a69543d41910bbc6a26e)

(From OE-Core rev: 76be81b5b0f56536dd36e800bc3f597aeea6d8ef)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:13 +00:00
Eric Bénard 155aad308c useradd.bbclass: handle nativesdk case
* without this patch, building dbus-nativesdk leads to a missing
dependency on 'base-passwd-nativesdk'
This was added by commit 46e6c3fa8034b12d178d605f3f5d7efe69671a13
* this patch handle the nativesdk case in the class useradd
* close bug 1702 http://bugzilla.pokylinux.org/show_bug.cgi?id=1702
* v2 from Scott Garman with Richard Purdie's tricks

(From OE-Core rev: 140a3507fb5c14cd9bcebe4304f491aa1c5c47a2)

(From OE-Core rev: 79d5ce46b4d73e5ed39c509ce872e99e6bcb94ee)

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:13 +00:00
Dongxiao Xu 11e383d24c multilib: Drop MULTILIB_IMAGE_INSTALL
There should just be a single IMAGE_INSTALL variable. If the package
backends need this split into different multilib components they should
be responsible for doing this, not the user.

This commit removes the MULTILIB_IMAGE_INSTALL variable.

[YOCTO #1564]

(From OE-Core rev: 7736862a74c92fe1afe42e170822be13117575c2)

(From OE-Core rev: 4889865934d590bf18d9f8f8ec3b63ce992cd4c5)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:13 +00:00
Joshua Lock aff0c68b0f contacts: fix packaging of icons
(From OE-Core rev: 1f4028337d5e288e239f44ef34e1d707b785273e)

(From OE-Core rev: 8bc45d72d3211df9ca846c775524176308027aea)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:12 +00:00
Joshua Lock 3b75e27536 gypsy: fix packaging
(From OE-Core rev: 3c272ce9df811281029d028e96ab6bc644645592)

(From OE-Core rev: 28c22b7d7cdbea39fca5867f14c22f75f7749183)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:12 +00:00
Joshua Lock 5f3b7a7616 libcanberra: add libvorbis to DEPENDS
(From OE-Core rev: 531151fdeba3779ba6f0976fc08aa8da483600f7)

(From OE-Core rev: 05f10a527099d22eb87614013e01c420bdafaf16)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:12 +00:00
Eric Bénard fb8d219960 dbus: fix install for virtclass-nativesdk
* 46e6c3fa8034b12d178d605f3f5d7efe69671a13 changed do_install
which now fails for nativesdk (chown messagebus leads to no
such user)
* tested by building meta-toolchain-qte and running the generated
sdk

(From OE-Core rev: 5818a885df489f4bc9579d17c6b0efa7777f5ccc)

(From OE-Core rev: 7984cc2fec3179da2e1f8f3bbffca9e7e21a3788)

Signed-off-by: Eric Bénard <eric@eukrea.com>
Acked-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:12 +00:00
Scott Garman ae88920dec useradd.bbclass: fix how RDEPENDS is setup
Fix bug where only packages named PN included base-passwd in
RDEPENDS.

This fixes [YOCTO #1727]

(From OE-Core rev: 2c55d51afd71d708a54afc8377e10c4f80f810e3)

(From OE-Core rev: 213d31f24d911a10132ddcd75f50363a80c4dc2e)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:11 +00:00
Martin Jansa 57c6f14828 libnl-2.0: add PE/PR bump for upgradable patch for meta-openembedded users
(From OE-Core rev: 2260b18590416940eec26aaf3d68e510ceff8d31)

(From OE-Core rev: 3aa933cf91cf788246f13966471a9be6e0bc1931)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:11 +00:00
Martin Jansa bd9a5e1b88 libnl-2.0: split to more packages, as meta-openembedded does
(From OE-Core rev: 8720e063c7b43c278b3bb406b45390ed03f8ac96)

(From OE-Core rev: 0f495eca8737a71ade6e1b5ca0fcbddf3b22181a)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:11 +00:00
Martin Jansa 8614fcf709 libnl-2.0: add patch from meta-openembedded to fix pkg-config file
(From OE-Core rev: 72227178bc74d6e2e24f8df6176c3d45b640e860)

(From OE-Core rev: 64aab9609e23cdaa662cf544a31de5e879958e31)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:11 +00:00
Martin Jansa 2202d845ab libnl-2.0: move fix-pktloc_syntax_h-race.patch to libnl-2.0 subdirectory and merge with fix-makefile.patch
(From OE-Core rev: a4882cd6f98c5b3df80ba96536d94d9f556f77a2)

(From OE-Core rev: 69701f7eaec6405fe2208d2412aebaf2db5ce606)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:11 +00:00
Koen Kooi a55d8c6aa4 image_types bbclass: use 4k bytes per inode so we don't run out of space immediately
genext2fs only creates the minimum number of inodes, after this patch it will scale with the rootfs size

(From OE-Core rev: c31cb0bdc5a61d2d9f21a2cea34c3d8ac3b47cb9)

(From OE-Core rev: 41d1091e6b821404eeb73a7c363537c2835558d3)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:10 +00:00
Martin Jansa b6312e2d51 libcense.bbclass: fix OpenSSL mapping
[YOCTO #1712]

(From OE-Core rev: 56799ebcb5c55a7fc75458fc2be2e69a67e8fd21)

(From OE-Core rev: efb4527ff527d3e465df2a21fdfda110542b70b5)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

Fixed YOCTO bug format and location

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:10 +00:00
Dmitry Cherukhin 5a41a612c9 tslib: fix the bug with loading libts-1.0.so
Touchpad did not work in the qtdemoE if the library libts-1.0.so was not loaded
manually using the LD_PRELOAD variable. This problem was fixed in the tslib mainline
https://github.com/kergoth/tslib after the 1.0 release. We just import the patch.

(From OE-Core rev: 0ba6d91dc527908740890c896b834e7216b0d2fb)

(From OE-Core rev: cf9fbfcb65c09d70613eb6ab87e0b9121cfcc34c)

Signed-off-by: Dmitry Cherukhin <dima_ch@emcraft.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:10 +00:00
Kumar Gala aaea770f1f udev-164: Update init script to do an explicit add action
With udev 152 or greater the default action for 'udevadm trigger' was
modified to be 'change' instead of 'add.

To ensure initial coldplug events at boot are seen be scripts the are
expecting them as 'add' events we invoke udevadm with an explicit
'--action=add'.

(From OE-Core rev: eacafd21999ab37b60af29dc3e626c441716ef66)

(From OE-Core rev: c90e1c91efc721eb6910cd3244b7671b63a341b6)

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:10 +00:00
Elizabeth Flanagan 6e4607f23a buildstats: Fix for buildstats on tmpfs
tmpfs/encryptfs/(and most likely, but not confirmed)ramfs TMPDIRs
cause diskstats to choke. No device entry ends up in /proc/diskstats
for these fs types, which ends up causing the failure.

The short term solution is to exclude these fs types from diskstat
collection. Longer term we will want to see if we can collect
meaningful diskio for each of these, and other, use cases, but for
this cleans up Bug 1700.

[YOCTO #1700]

(From OE-Core rev: 2b14046c12855b6f484ba5bd6bc0a8022de6873e)

(From OE-Core rev: e0d26e0e1dfb9d35d71f20488c16f3cea3da862e)

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>

Corrected YOCTO bug location and format

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:10 +00:00
Richard Purdie 5a192f85d9 bash: Ensure we fully reautoconf the recipes so site data is used
This ensures bug 487 (missing job control functionality) really gets fixed.

[YOCTO #487]

(From OE-Core rev: 08b78066bd5a9ff2819a42eb4263ee0a78cddb97)

(From OE-Core rev: cf9d3140a9dae5bdc6145ae04a729f4775ae66a2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:10 +00:00
Koen Kooi 9ce56ec4ca rootfs_ipk bbclass: special-case base-passwd preinst to run first
Preinst are run alphabetically which breaks when e.g. avahi-daemon needs /etc/passwd present.

(From OE-Core rev: d6793165feb26c51b5f19ad1e6d1a4099878e879)

(From OE-Core rev: 0485c362ac6ee0a3e310de078d7a202b961fed11)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:09 +00:00
Koen Kooi e47cfd447c avahi: fix useradd race condition
Avahi doesn't work at boot because of:

+ sh /OE/../rootfs/var/lib/opkg/info/avahi-daemon.preinst
Running useradd commands...
grep: /OE/../rootfs/etc/passwd: No such file or directory

That is due to:

Package: avahi-daemon
Version: 0.6.30-r9.0
 [..]
Depends: libavahi-core7 (>= 0.6.30), libdaemon0 (>= 0.14), libcap2 (>= 2.22), libavahi-common3 (>= 0.6.30), libdbus-1-3 (>= 1.4.12), sysvinit-pidof, libc6 (>= 2.12), libexpat1 (>= 2.0.1)

After this patch:

 Package: avahi-daemon
 Version: 0.6.30-r10.0
 [..]
 Depends: libavahi-core7 (>= 0.6.30), libdaemon0 (>= 0.14), libcap2 (>= 2.22), libavahi-common3 (>= 0.6.30), libdbus-1-3 (>= 1.4.12), sysvinit-pidof, libc6 (>= 2.12), shadow, libexpat1 (>= 2.0.1), base-passwd

This also changes ${PN}-daemon to avahi-daemon to be consistent with the PACKAGES/FILES lines below

(From OE-Core rev: f01fbc17b5d9bf9a227d64fe858014376cd19432)

(From OE-Core rev: 9d0b21f0723fda0e0d287788eb79d3a70b12f949)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:09 +00:00
Saul Wold fc2433de1d dbus: ensure that the useradd shell is set to /bin/false
(From OE-Core rev: 899efe6bf17a31d842ff2f65704d4858892496d4)

(From OE-Core rev: 7d6ba259603ebcb1c08c1ac7b77f8b482e77b6d5)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:09 +00:00
Saul Wold 8cf7c76ce1 connman: Use useradd to add the xuser for DBus
Connmand needs to start as the xuser as defined in the dbus
configuration and needs to share this with rootless X. Since
it's possible for connmand to run on a sytem without rootless
X we still need to create the user here.

Useradd will fail gracefully if the user already exists.

Fixes: [YOCTO #1699]

(From OE-Core rev: 8139ac9284031e00d6b268210b04b57670d9268a)

(From OE-Core rev: 835ab34adb6acf562e37db99a1dd24f7b8bd95ec)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Conflicts:

	meta/recipes-connectivity/connman/connman_0.75.bb
2012-01-30 16:38:09 +00:00
Saul Wold 5d8269d28a xserver-nodm-init: Use useradd to add the xuser for rootless X
This also address an issue with dbus and connman, since connmand
needs to start as the xuser in the rootless X situation.

Fixes: [YOCTO #1699]

(From OE-Core rev: 6823a32035de5d0bcd82a3b41a6ad536aaddbc58)

(From OE-Core rev: 26573a84583793f64979100c2b89a95146d38dd1)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:08 +00:00
Saul Wold 9f542cf856 avahi: use useradd to create avahi user for avahi-daemon
DBus was failing to start correct since the avahi user was
not setup.

Keep the dbus reload since this could still be installed
as a package an would require a dbus restart.

Fixes: [YOCTO #1699]

(From OE-Core rev: f0bfecc8a0af1c4c76a37a9c88f334ab6ae7e7ef)

(From OE-Core rev: 925c7cd5c3ff44a4d0f2c71d0029998bfd00db48)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:08 +00:00
Holger Hans Peter Freyther 398a0159a6 udev: Fix the packaging of libgudev
Make the libgudev so go to the libgudev package, this is already
fixed in meta-oe.

(From OE-Core rev: 43ac43d7c7245e9aa2bfc8572c2620074d1e2a25)

(From OE-Core rev: 3890186dda8db3978f18c05099a6f327c122cc1d)

Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:08 +00:00
Richard Purdie 8ce627f9b1 dbus: Ensure localstatedir is added to the package
(From OE-Core rev: dc0d004fd23f686591281eb1d700327ea15d1c54)

(From OE-Core rev: 3de19d01402aa7fdee28df2e1066987c14c17a78)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:08 +00:00
Richard Purdie a7e5ad1268 package.bbclass: Fix various problems
Before this change:

a) Ownership and permissions of files copied from packages to
   package-split could get lost during the copy process. This change
   ensures they are preserved.
b) Ownership and permissions of directories could also get lost.
   Most of the complexity in this patch is addressing this problem
   ensuring newly created directories match the source ones being
   copied.
c) There was no warning about directories being created but not
   shipped by any package.

This patch fixes all of the above issues.

(From OE-Core rev: 6021e309e69d823e1467648aee12a32182945569)

(From OE-Core rev: 5f9228b32c243ae499398763ce7c90b776dc9d24)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:08 +00:00
Richard Purdie 8223a46ca0 dbus: Use $D not ${D} in the postinstall
We need to do this as we don't want bitbake to expand the variable
but use the shell variable instead.

(From OE-Core rev: 509a8a9ea428debf3ff2115fcff0aa89d0239ced)

(From OE-Core rev: dcf118e9dfd15f7cf535c9918a6fcad9f9121ff4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:07 +00:00
Richard Purdie 1890a0f3b2 gnome-doc-utils: Add missing glib-2.0 dependency
(From OE-Core rev: c367a2d2f4b817211b6bd200e49b49355cd67fe2)

(From OE-Core rev: f4555a27bcc2174d30c1ea4ab7785325766b7c4e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:07 +00:00
Joshua Lock 2dbcd4154c lib/oe/terminal: add support for XFCE's terminal emulator
That's Terminal on Fedora and xfce4-terminal on Ubuntu/Debian... This
could get interesting!

(From OE-Core rev: 162b70a36388ac44fc1b39e172cd53579707bff3)

(From OE-Core rev: 149cc418dbcbe014225c86d16b5ef696496e3a39)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:07 +00:00
Saul Wold 0524f419cf libproxy: fix QA Packaging issues
(From OE-Core rev: d756b85565820f0caef17af4c4aee2bf29ea6794)

(From OE-Core rev: 58231521f9f20fb5606efc84f779612834225b7d)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:07 +00:00
Saul Wold a90c197e94 libatomics-ops: fix QA Packaging issues
(From OE-Core rev: dfddbffc48e86cb0a6d07da6727782e3b17535e1)

(From OE-Core rev: 33fe21a3d446f562fde9730e3755ae99fd50e1ae)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:06 +00:00
Saul Wold 21458bd419 mdadm: fix QA Packaging issues
(From OE-Core rev: b3840f88f004c9ef371a075f1800052c66c91759)

(From OE-Core rev: 5da0710659d671e7e9494feb546fbad950b0c644)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:06 +00:00
Saul Wold 7e96247751 man: fix QA Packaging issues
(From OE-Core rev: 2f597288c141c910b945e63e8b31436984ad536b)

(From OE-Core rev: cb3cdb9da4866539ac84df811076c4ddad89e47a)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:06 +00:00
Saul Wold 07e2aa9b80 at: fix QA Packaging issues
(From OE-Core rev: f3487717ae3b7f9256a3e3cc78be331e424ec457)

(From OE-Core rev: e9b469fb19c69dffc0aedf777dc58d41f6e1815e)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:06 +00:00
Saul Wold 5c37b7ea47 dbus-glib: fix QA Packaging issues
(From OE-Core rev: 1f55db4936b43e2fd3e50f99815b547e3c5e8010)

(From OE-Core rev: b84c1d5854052af3351f853f42c6a0e4b9918dd8)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:05 +00:00
Joshua Lock 79081f46ec libxslt: Fix packaging of xsltConf.sh
xsltConf.sh is installed to libdir not bindir, fix pacakging.

(From OE-Core rev: 27b438df0b937180263346cbf68f1641abcdb068)

(From OE-Core rev: 82ff9739d7b95775636d1b9ac7aa4fb5576eccd9)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:05 +00:00
Matthew McClintock 4f9e333b05 Add readline as dependecy for gdb-cross-canadian
Got errors that we were unable to find -lreadline, this fixed the
issue

(From OE-Core rev: ddc9a58b8553599d2328ac1c4449b41681ae45d1)

(From OE-Core rev: c50f8d83749d755e58fcd159b8e4dab33fbd9036)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:05 +00:00
Julian Pidancet dc09c258f0 Give coreutils a chance to build the df utility
The coreutils configure script is unable determine how to get free
space from the Operating System when cross-compiling.
This changes caches the result of the "statfs2_bsize" test for the
coreutils configure script.
Both glibc and uclibc defines statfs as a two-argument function
and uses a struct statfs containing a f_bsize field. That's why
the fu_cv_sys_stat_statfs2_bsize variable has to be defined for
both libcs.

(From OE-Core rev: fa1eb21933a880aa20e4ca87574753b1ec272c3b)

(From OE-Core rev: 5be987aeb5e34bb1277f86a7f294607a6d935a19)

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:05 +00:00
Khem Raj 5de0f305f9 pulseaudio: inherit perlnative
manpage generatition uses xmltoman utility
which inturn uses xml-parser. So we add
libxml-parser-perl-native to DEPENDS and also
inherit perlnative so it does not use the one
from build host

(From OE-Core rev: 51f6a683ec1d740adf09d808671c7098dc3f83e2)

(From OE-Core rev: c2ccc9a294cab3f41cab35eee64f8a464ac8ad9f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:05 +00:00
Khem Raj 52dc5edde3 gcc-4.6: Backport fix for PR32219
This fix is needed for gold to work. Otherwise
connman fails to build since it used hidden weak
symbols.

See

http://gcc.gnu.org/bugzilla/PR32219
http://www.cygwin.com/ml/binutils/2008-02/msg00239.html

The fix proposed to gcc had reviews which were not addressed hence the
patch is not yet
applied to gcc upstream.

connman can also have workaround by changing the visibility of these
symbols to be default
 __attribute__ ((weak, visibility("hidden")))

to

 __attribute__ ((weak, visibility("default")))

in include/plugin.h

(From OE-Core rev: 3cb2b003db7371b3a47d02c08352a262e1e419b4)

(From OE-Core rev: 9a160921a16c9c37e07e4b5cb30e37348ecd205b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:04 +00:00
Otavio Salvador 9d086cd151 dbus: use useradd class to allow use in read-only filesystems
Move creation of required user/groups to useradd class thus allowing
use with read-only filesystems and booting the initial boot.

(From OE-Core rev: 46e6c3fa8034b12d178d605f3f5d7efe69671a13)

(From OE-Core rev: a115b657ed3df1c9b26b016151881a6c9c26ac2b)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:04 +00:00
Otavio Salvador 2edde1021f base-passwd: move initial criation of group and passwd to preinst
To allow use and manipulation of users and groups at rootfs building
time, the '/etc/passwd' and '/etc/group' needs to be available as soon
as possible.

(From OE-Core rev: 0395eba96d6f37f323f5b76564809a44d7ceb103)

(From OE-Core rev: 73452afe344b66c6dd8e4e120e61ac9fce8652e3)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:04 +00:00
Otavio Salvador afc60481c7 useradd.bbclass: check if a group already exists manually
The use of groupadd -f makes much more difficult to figure when a
group is not add. This was the case of the class not working for our
usage and this being caused by the lack of '/etc/group' file but
unnoticed as groupadd wasn't failing according.

(From OE-Core rev: 82933a1ff921fd0836f03e6f379fd8536cdc0a30)

(From OE-Core rev: e3e8f15176107fa26248e878af548835692d3068)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:04 +00:00
Khem Raj eb94ba9052 gcc-configure-sdk: Point sysroot to correct location
(From OE-Core rev: c9883733fed9267b1a936c08500a4caf8dc52d3d)

(From OE-Core rev: 1cffc4c39f897ae1db30825364ff809ce40f512b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:03 +00:00
Khem Raj 6fa445d50e binutils-cross-canadian: Point sysroot to correct location
(From OE-Core rev: b8dad4ab77f5516bc6929e2ed094fdc62a5a52db)

(From OE-Core rev: 065b65f8835304a0ba7fe751a132b684a41b08ae)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:03 +00:00
Anders Darander 795843df09 module.bbclass: add lock to prevent error bulding ext modules
When external modules are built, files in $STAGING_KERNEL_DIR/scripts/basic will/can get
rebuilt.
This raises a potential race condition. Prevent this by adding a lock around the
do_make_scripts() function. Further, make sure that the kernel has been installed
to the sysroot, prior to executing this new task.

(From OE-Core rev: 8681b82e8b466929205edde7ba479f3ac1a6143e)

(From OE-Core rev: 694e3016e25dff3f573291830d79982c8b8793a2)

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:03 +00:00
Khem Raj 8a20492e8a gcc-4.6: Backport PR46934 fix
We have been hitting this issue on ARM/thumb and
have a workaround in place to compile samba
http://git.openembedded.org/openembedded/commit/recipes/samba/samba_3.2.15.bb?id=4ba7aa07c0dcd28f94515ff9927e2a04403fcf15
This backport should fix the gcc bug

(From OE-Core rev: 75f7269a7a1da2494768d4be63c44b12c5cfeeeb)

(From OE-Core rev: 446767c4c471b8ec932698a23af5a815d326a0be)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Conflicts:

	meta/recipes-devtools/gcc/gcc-4.6.inc
2012-01-30 16:38:03 +00:00
Khem Raj 70ff3b6d98 gcc-4.6: Upgrade SRCREV to latest FSF 4.6 branch
(From OE-Core rev: b1af6951e14d645fe861f289011c91ab6f1b6865)

(From OE-Core rev: f6ba855e3d8b33591c14048cac68264e93a821e8)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:02 +00:00
Lauri Hintsala ba79e6f631 poky: fix broken ubifs link in deploy folder
Fix broken rootfs image link when ubifs is used.

Function runimagecmd is using image name "${IMAGE_NAME}.rootfs.${type}".
Let's use the same name in IMAGE_CMD_ubifs.

(From OE-Core rev: 766f6165471691f651584ebda004e1abb4ea9eb6)

(From OE-Core rev: 6c4276ee968bed7a5b3e74637183414a428facb8)

Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:02 +00:00
Martin Jansa 071d5de3f3 fontconfig: fix fix-pkgconfig.patch
* missing $ is causing problems ie when building webkit-efl
* see http://lists.linuxtogo.org/pipermail/openembedded-core/2011-June/003798.html
  for details

(From OE-Core rev: e31dd9b65f3b03f79cabab25eca157532de3bd9c)

(From OE-Core rev: 5deaf85c0c07105173e6791a7aafd03aa5b2e204)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:02 +00:00
Xiaofeng Yan 1fa324c533 lsb: Change link of ${baselib} to lib64 for 64bits system
Correct two faults:

1 Binaries of lsb test suite need ld-linux.so* in /lib64.
for example:
Target$ ./lsbcmdchk
-sh: ./lsbcmdchk: No such file or directory
Target$ strings lsbcmdchk | grep "ld-"
/lib64/ld-lsb-x86-64.so.3

"lsbcmdchk" from lsb test suite is a binary program.
A new modification to lsb_1.4.bb caused that binaries from lsb test suite can't run
because binaries of lsb test suite need ld-linux.so* in /lib64.
But the link is changed due to adding multilib. I changed this link again.

2 correct mandir
Waring will appear when running task task do_populate_sysroot

NOTE: package lsb-1.4-r2: task do_populate_sysroot: Succeeded
WARNING: For recipe lsb, the following files were installed but not shipped in any package:
WARNING:   /{datadir}/man/man1/lsb_release.1.gz

I changed mandir=${D}/man to mandir=${D}/${datadir}/man

(From OE-Core rev: f2dada2079b5f98e13d4888609368ba111967a60)

(From OE-Core rev: 9961c1e73e8f8ae426d7ac8c9ba35b05669cbffe)

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:02 +00:00
Saul Wold 958c7f773f sysprof: remove duplicated patch
Apparently this pactch was duplicated by backported
patch, and needed to be applied more broaded than to
just ppc.

(From OE-Core rev: 182e4768b651e58de5b42f9fb55ae9816b57233b)

(From OE-Core rev: 62700be77386ba3388dc65b599cce9dfe5b802f6)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:02 +00:00
Saul Wold 141240c409 libomxil: Fix QA Package Errors
(From OE-Core rev: ef786ef9abcd919c651c14004a1cb0a0dcad1bff)

(From OE-Core rev: 83cad4ce6b1e942c3c45d316cbec95db4e04bebf)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:02 +00:00
Samuel Stirtzel 89e945be6a data.py: fixed message domain errors
The dynamic message domain was introduced by Richard Purdie with the following patch:
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=a6c48298b17e6a5844b3638b422fe226e3b67b89

(From OE-Core rev: 55a8382e460430dc5ff10755d235d637531d2ae7)

(From OE-Core rev: d08db11fcae91deca10d250430a6f77de47f9080)

Signed-off-by: Samuel Stirtzel <s.stirtzel@googlemail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:01 +00:00
Samuel Stirtzel 7d30c2df87 patch.py: fixed message domain errors
The dynamic message domain was introduced by Richard Purdie with the following patch:
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=a6c48298b17e6a5844b3638b422fe226e3b67b89

(From OE-Core rev: 2383e06c8ed7c15aa148b9dbe40445e7095b6f57)

(From OE-Core rev: d104367903478613123c64df8d2a5188775d1f9d)

Signed-off-by: Samuel Stirtzel <s.stirtzel@googlemail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:01 +00:00
Wenzong Fan 90a4f95d3d qt4-x11-free: Fix broken regexes in qt4-x11-free's recipe.
[YOCTO #1671]

qt4-x11-free's recipe includes a sed script to sanitize it's .prl files,
which are used by qmake to generate a list of libs and includes in the
Makefiles it generates. It however, fails to take into account the possibility
of trailing slashes, and thus leaves them in, and breaks gcc's syntax.
Update these regexes to account for them.

(From OE-Core rev: 8d580ed449c09a64483519d66e14a2e3b071806a)

(From OE-Core rev: 9f655fbf0f818e25fdbf247334881da07a29e815)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:01 +00:00
Tom Rini 53db004d24 libnl2: Fix a race on route/pktloc_syntax.h
At issue is that route/pktloc.c (not generated) depends on
route/pktloc_syntax.h (generated).

(From OE-Core rev: 7bec22c70598a5180f754bbbe2dfdd3db2843a64)

(From OE-Core rev: b992c9e631bfb4888a20a13b7ebf3b5acf59edb5)

Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:01 +00:00
Christopher Larson f7d5b31d6c autotools: fix multi-word arguments for EXTRA_OECONF
This is needed to better support things like the following (with a
multi-word BUILD_CC):

    EXTRA_OECONF += '"ac_cv_prog_CC_FOR_BUILD=${BUILD_CC}"'

(From OE-Core rev: 38a394e7ffedccfabda085c97add8944718943c2)

(From OE-Core rev: 5c26de72b97a670a263428ef3a1846385683feeb)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:00 +00:00
Richard Purdie 35d3782099 flac: Add missing gettext dependency (requires iconv)
(From OE-Core rev: fd310c2d64dd2df62bf3a10e5dbad25492013ae2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:00 +00:00
Matthew McClintock 1080ef1105 Fix sysprof for powerpc64
__ppc64__ is not defined on powerpc64, rather __powerpc64__ is, this
uses a patch that is already upstream to fix builds for powerpc64

(From OE-Core rev: 4732222c46652951e66aae377631f4a361179d8f)

(From OE-Core rev: d4cc180e60da43f66618d130009ac5d4930b9228)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:00 +00:00
Matthew McClintock 7bd151a4f3 Fix mdadm for powerpc64
This takes an upstream fix for compiling on powerpc64

(From OE-Core rev: 1325f506972555d4c218c15090bfa3f63fb13473)

(From OE-Core rev: c6da1a4eb9ba6885b49b0240030dff9b234ab1ca)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:00 +00:00
Martin Jansa e1f53370ed zlib: fix inverted LFS logic
(From OE-Core rev: 6dd3f5c2f300c9cb5b6dbe2afe67323fc6f44c3e)

(From OE-Core rev: bf7b5c6f6b8d27e64fcb169ec9a4c4ecf2047e58)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:59 +00:00
Martin Jansa e708d0ab68 libglade: add gdk-pixbuf dependency
(From OE-Core rev: eb709fceacab3ec33f38694d6238b96cb0474848)

(From OE-Core rev: c0382636ee2cfc0ea74464904d94eb1178512700)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:59 +00:00
Julian Pidancet e6e867558b Use useradd and update-rc.d classes in the OpenSSH recipe
The current sshd postinst and postrm scripts in the OpenSSH make the
package dependant of the adduser/addgroup scripts which may not be
available on all systems.

This patch replaces the sshd postinst and postrm scripts with proper
usage of the useradd and update-rc.d classes.

This patch had been modified from the previous proposed version to
use useradd long options for more clarity.

(From OE-Core rev: 6b7f399d595ef58e759dab211f4ece155119a680)

(From OE-Core rev: 058116f528bff27ca5a0e56bbf8070e94f934f32)

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:59 +00:00
Julian Pidancet ab81049f37 Fix the --root option in shadow-native programs
The add_root_cmd_options.patch that we apply to shadow-native allow the
various programs from the shadow utility package to chroot() so they can
be used to modify etc/passwd and etc/group if they are located in a
sysroot.

Some of the shadow programs (gpasswd, useradd and usermod) need to parse
the command line in two passes. But we can't use getopt_long() twice
because getopt_long() reorders the command line arguments, and
consequently corrupts the option parsing during the second pass.

This patch fixes this issue by replacing the first pass by a very simple
manual walk of the command line to handle the --root argument.

This change is a patch of another patch, I apologize if it is
difficult to read. But IMHO it wouldn't make sense to put the patch for
this issue in another separated file.

The --root options in groupadd and useradd are needed to make the
useradd class work, and this issue was preventing to use useradd and
groupadd long options while using the class.

(From OE-Core rev: 6e9e19b18597103d8fe09f258cfd9904bb5f1c27)

(From OE-Core rev: 533d99f28fab73503ed3ebaee63aaaeb23ad2a1c)

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:59 +00:00
Jason Wessel 0b2f036a81 Allow user mode NFS server to run without rpcbind / portmap
and nfsroot mount without the need to talk to an RPC info
server as long as the port numbers for mountd and nfsd
are known in advance.

This patch updates the qemu startup scripts and the
user mode NFS server to have the ability to start
without the need to use rpcbind or portmap services.

(From OE-Core rev: 3b1346c607c41a2d592c48594457c32153cb2314)

(From OE-Core rev: 13899c6cd44a618276e1b8d236187eddcb98bc2c)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:58 +00:00
Richard Purdie 6ed9f0763b pkgconfig: Fix logic that was accidently leaving legacy pkg-config functionality enabled
(From OE-Core rev: aa816b0aaf39dc6f822114df0bd6d4dd62fce0b8)

(From OE-Core rev: d46496b814b9a75523b337202d53c2c6c198566b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:58 +00:00
Saul Wold 1e225af16e acl/attr: don't make symlink if base_libdir = libdir
(From OE-Core rev: 46cd3527217821a7e9a8223dc45a43294b6c5e8d)

(From OE-Core rev: c2d14090d6400f4d8cb140947ccb9b68f2086835)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:58 +00:00
Richard Purdie 385365f689 native.bbclass: Ensure native recipes have a deterministic baselib value
Changes to baselib by specific machine configuration were resulting
in sstate cache invalidation, particularly in multilib configurations.

This patch ensures this doesn't happen and native sstate cache files
are reusable.

(From OE-Core rev: d0915fb0a2cc80ad45b3fd526d3b29a91d99572c)

(From OE-Core rev: 4fe88a2a3c7cec3ad9ea13d39d71d317405c910a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:58 +00:00
Richard Purdie dec4fb1bee sstate.bbclass: Ensure machine specific stamps are only wiped for the current task
sstate was being a little too ethusiastic about removing stamp files and
was removing stamp files for other machines when it shouldn't have been.

This patch teaches sstate about machine specific stamp extensions and
allows it to only remove the current task's stampfiles.

Based on a patch from Phil Blundell <philb@gnu.org> with some tweaks
from me.

(From OE-Core rev: 5e9488495401399d39fcb5012b86c313b6caca73)

(From OE-Core rev: e8efeedbc2ec1587b1c4d938c25cacd4e8611053)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:58 +00:00
Kumar Gala ef1a8f21e0 scripts/oe-buildenv-internal: Add SOCKS5_{USER, PASSWD} to BB_ENV_EXTRAWHITE
If a SOCKS5 gateway is needed for a proxy access like git it might also
require authentication to the proxy via a password and username.  Adding
SOCKS5_USER & SOCKS5_PASSWD to BB_ENV_EXTRAWHITE allow for automation
of the authentication request to occur when something like a git fetch
is going through the proxy.

This patch requires the bitbake patch to add extra exportvars so
these variables get passed from Env -> bitbake -> fetcher

(From OE-Core rev: 9206ea0f7cd39d2ba6ff4b41cbeb17409d3ae5f1)

(From OE-Core rev: e0438a7ce3523c25d36d564ca85753f0931544e6)

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:57 +00:00
Richard Purdie 0c1b16db4c mtools: Disable parallel make install, its broken
(From OE-Core rev: 6f64114f5825bf6f6ab8eaaf4bed24586e05ee57)

(From OE-Core rev: b7d7af9d54fee435df88ad5d81eb32ed27cf59c7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:57 +00:00
Tom Zanussi 02c530f442 kexec-tools: fix architecture mismatch QA error
Building sato-sdk for an x86_64 target throws this QA error:

| ERROR: QA Issue: Architecture did not match (62 to 3) on /work/x86_64-poky-li\
nux/kexec-tools-2.0.2-r1/packages-split/kexec-tools/usr/lib/kexec-tools/kexec_t\
est

kexec_test uses 32-bit code for testing - add an INSANE_SKIP exception for it.

(From OE-Core rev: 0dbf91969bb16f4761f58426ff5b458139c4e235)

(From OE-Core rev: 4f4088ee53950f934b736488dbd265e27df9b033)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:57 +00:00
Dmitry Eremin-Solenikov df2fddf9cb qt4: packaging fixup
Improve packaging:
* Add phrasebook packages to DYNAMIC_PACKAGES
* Correct phrasebook packages generation
* Include more files into -dbg packages
* Package fontdir and fonts README.

(From OE-Core rev: 4e3c29dd90f583cafe7a7fc863efb3720096d67b)

(From OE-Core rev: 8fbad61dc62bdd439a55bcca09601bed28fcd3af)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:57 +00:00
Martin Jansa 6f0c0167c6 hal-info: drop PACKAGE_ARCH all
RP: It would be better if we could find a way to patch out the compiler
checks in this package...
JaMa: drop PACKAGE_ARCH for now (nobody likes hal nowadays)

(From OE-Core rev: 870191c1c46e36f92c5d90a3eb049154b0597133)

(From OE-Core rev: 1f66c882937d11762916023f4233b63cc6645edc)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:56 +00:00
Richard Purdie 47c5f1c3bc Improve handling of 'all' architecture recipes and their interaction with sstate
* Jansa: rebased on current master, added nocompiler patch also to
  font-alias, dropped allarch from linux-firmware, gnome-icon-theme, hal-info as
  those are checking compiler (ie in intltool check) and better to build
  them as default arch instead of rebuilding after every machine
  change.
* this is also part of [BUGID# 1075]

(From OE-Core rev: 85d8362e0c443f11fe8d3fd0fba55d1bd4983613)

(From OE-Core rev: bfb58bf95f1796deebc9759da6d22949d62e7070)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:56 +00:00
Otavio Salvador 29a5cc693c qt4: Fix translation support
The translation support was disable in build. The
fix-translation.patch was imported from OpenEmbedded to fix a linking
issue in phonon translation support.

(From OE-Core rev: 8d5a5d78f9e83c64ebddcecd7c4fd89cc1264163)

(From OE-Core rev: 23d72a8066233c592503fda4460c309adc27706a)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:56 +00:00
Denis Carikli c3a1b97511 qt4(embedded and x11): Disable neon for armv6-vfp
Without the -no-neon flag, neon is "autodetected"
by looking if the compiler is capable of compiling
a neon test, and succeed, and neon is then enabled
during the compilation.

(From OE-Core rev: 026b59180fe3fbeb43cfd143f053ef33f482ef0c)

(From OE-Core rev: e53987e52a362e9a66c0007bfe1ff17a1d5ba2da)

Signed-off-by: Denis Carikli <denis@eukrea.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:56 +00:00
Eric Bénard f1369ae9fe qt4: fix generated sdk
- qt4-tools-nativesdk : actually the qmake binary which gets installed
comes from the native recipe. This patch fix this problem by launching
configure twice : once to compile qmake using the right toolchain for
nativesdk, and a second time using the native qmake to compile all the
other tools for the nativesdk. Then we install the right qmake.

- mkspec : the link actually created in qt4-tools-nativesdk's
do_install point to nowhere so remove it and generate the link in
meta-toolchain-qte as it's the only place where we have all the variable
to create it.

- toolchain_create_sdk_env_script_append : we need to add OE_QMAKE_CFLAGS,
OE_QMAKE_CXXFLAGS and OE_QMAKE_LDFLAGS else the sdk won't find these
variables that are inserted by qmake in the Makefiles.

- with this patch, oe-core generates a working meta-toolchain-qte which
can compile a small example and is properly recognized by qtcreator (this
brings oe-core's meta-toolchain-qte to oe-dev's functional state).

(From OE-Core rev: 5f6fb92b939147d2d6aa7790a378d4b7cce3ada5)

(From OE-Core rev: d86d55aea57966e1aaffe913c745a648c21f6c24)

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:55 +00:00
Matthew McClintock 8620d997d4 Fix lttng-ust for powerpc64
(From OE-Core rev: a75683a815343a481b3612c35e1ab79071343187)

(From OE-Core rev: 6af6e862a3f000ada27c8d7f3440821187494421)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:55 +00:00
Matthew McClintock 7d06a71c02 Update gitignore to ignore all meta-* directories
meta-XYZ directories have been manually added in the past, instead
always ignore them unless they are explicitly added

(From OE-Core rev: 3c6e85c653ce176fd2cb5a570e63c8e5da5a4e48)

(From OE-Core rev: ad5f076bee5f43c035499aa0b873ccf683e4e79e)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:55 +00:00
Richard Purdie 7c5028614b base.bbclass: Drop unneeded dependency
patch depends on unpack
configure depends on patch

We simply don't need a configure dependency on unpack. This simplifies
the dependencies of every recipe slightly and should make bitbake
slightly faster at resovling dependency graphs.

It also makes the .dot dependency graphs slightly more readable by
removing noise.

(From OE-Core rev: c54c1280fc0d06a53e23339c3913ec88eead13d9)

(From OE-Core rev: a5b205090d3244cd578d611fd45f2e2f4818b284)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:55 +00:00
Matthew McClintock 6844fac9d5 Fix flac build on e500mc cores
This core does not have altivec, so we disable it in the build,
also reestablish the config option to enable/disable building
with altivec

If SPE is not detected we always build with altivec which is wrong. This
will check to make sure altivec is enabled and pass build options
through accordingly

(From OE-Core rev: 96241de59fdf548ae0f80cc9e4668f9ba11924ef)

(From OE-Core rev: a7237f2be949aef19eedad5a4f34b91641f1660f)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:54 +00:00
Saul Wold 41b5ca8582 python: fix sqlite RPATH issue
(From OE-Core rev: 9f9612d15acc6ee3b71f52bdb3f1ec4cb56b1a17)

(From OE-Core rev: 98acff46d777a5a0931a80a33e9c9d148a0f69a6)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:54 +00:00
Matthew McClintock 7a1504dfe8 Add proper deps for nfs-utils, util-linux, and strace
These packages need these deps for the RPM generation stage:

 error: Failed dependencies:
| 	/usr/bin/python is needed by nfs-utils-1.2.3-r2.ppce5500
| 	/usr/bin/perl is needed by util-linux-2.19.1-r4.ppce5500
| 	/usr/bin/perl is needed by strace-4.5.20-r2.ppce5500

(From OE-Core rev: 9c9ea24b115a9bb87df1323b5f185ce426262aec)

(From OE-Core rev: 42acc3337ef40b3ef693000c27e6efdb79e39351)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:54 +00:00
Matthew McClintock 062623f6ef Fix sysklogd build on e500v2 cores
(From OE-Core rev: 5035097bb369dc1740b817734b92bcfa40d95d22)

(From OE-Core rev: 235ec938cdb01918df659a52711da63d3ff7441f)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:54 +00:00
Matthew McClintock 62ad5b81cb Add udev patch to compile against newer kernels
This patch is needed to compile against newer kernels which have
changed their API

(From OE-Core rev: 60b04097c7aeca2c4d529b2f23343a507fa68ea6)

(From OE-Core rev: 64ab24d5338120e7d1a1feba966269a885306a63)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:54 +00:00
Matthew McClintock ada8ebb116 Fix HAL on newer kernels without header file
(From OE-Core rev: 3d421ecaef966b47bec49aa2feb3ccc9833d041f)

(From OE-Core rev: 4a6599a01a6dd2b856656d93e82f1411b7d352ed)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:53 +00:00
Matthew McClintock f1f2cbbc0d Fix ghostscript on powerpc64
This adds pregenerated files for powerpc64

(From OE-Core rev: 30b91a530e7dbabc4cef24525691aa2c34ecf47b)

(From OE-Core rev: 4bef884ae1fe52916849045e4e3dca6396ee7fb3)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:53 +00:00
Matthew McClintock c434795edf Add autoconf cache for screen on powerpc64
Screen can not run tests for the target and depends on the aotuconf
cache for information about the target system

(From OE-Core rev: 946cd8df49a8873ff93ef5ec1e3cc745a21e2a8f)

(From OE-Core rev: 3c004856e460656e16739d6b68f5189ecf0746a7)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:53 +00:00
Matthew McClintock 25330d9f38 Fixup kexec-tools compatible host for powerpc
kexec does infact work and build on powerpc, enable the compatible
host for these machines

(From OE-Core rev: 1ccc1ec56bc50cee121c03ae8bb8ccacd32b8560)

(From OE-Core rev: c7afacf05deb8ca77818aa33ee13ec3a8c5d983f)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:53 +00:00
Richard Purdie c1c5eb6866 util-linux: Ensure perl scripts reference the correct perl
Without this change the perl path from the build system is used.

(From OE-Core rev: 18ad3a84dacc0d6c107b56874bb23d2a3c0a429f)

(From OE-Core rev: a20e75a83cd5998d7ed6ea7c0c4ea7039c22160a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:52 +00:00
Richard Purdie 51e089403a mc: Ensure perl scripts reference the correct perl
Without this change the perl path from the build system is used.

(From OE-Core rev: feff6030091d519a0738e2a5db47654dcd13ef13)

(From OE-Core rev: 077a85c4fa376b5e7ee826589bbd4fe6776a326f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:52 +00:00
Richard Purdie 058ef489a0 openssl: Ensure perl scripts reference the correct perl
Without this change the perl path from the build system is used.

(From OE-Core rev: 1ed8fb66c51ce584c13e592176a69a61bae01f2e)

(From OE-Core rev: bc7da81942aa5676010d513407a2731bd385a165)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:52 +00:00
Khem Raj 3eb7e626d0 gcc-4.6: Update to tip of FSF gcc-4_6-branch
(From OE-Core rev: ed7deecb9503420fbf8071445e077c32beda8dc4)

(From OE-Core rev: 90e3aee700b8fff6d94f84850dfc00091b3777c9)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:52 +00:00
Andrew Gabbasov 386e75b7f0 apmd: use ${HOST_SYS}-libtool
libtool-cross uses ${HOST_SYS}- prefix while building and installing.
In some cases that may be different from ${TARGET_PREFIX}, that is currently
used in apmd recipe. It's better to have them consistent.

(From OE-Core rev: 5f1fac618fa099f6fc78cbc98f18d1c0ab792abf)

(From OE-Core rev: eda6005d2dfcf163f12e3c5cc447ea3ad495a0bb)

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:51 +00:00
Andrew Gabbasov f72a801d51 apr: use ${HOST_SYS}-libtool
libtool-cross uses ${HOST_SYS}- prefix while building and installing.
In some cases that may be different from ${TARGET_PREFIX}, that is currently
used in apr recipe. It's better to have them consistent.

(From OE-Core rev: 61cedb87446a27ddaaa880a5f3296399def441df)

(From OE-Core rev: 170d1fe5158eeb316009b2920b009da2c2dedae2)

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:51 +00:00
Andrew Gabbasov 4ffc32566a libpam: add flex-native to DEPENDS
flex-native is required for building libpam. Although this dependency
is now fulfilled indirectly through bison recipe, having an explicit one
would be preferable.

(From OE-Core rev: 14018608277fe62e2a662711ff6177c93e9bc153)

(From OE-Core rev: 3a8ca44cbd31411934b6c873f75f1fb49167f93c)

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:51 +00:00
Paul Eggleton 3f692305dc scripts/oe-setup-rpmrepo: use setup_tmpdir from runqemu
Update the internal copy of setup_tmpdir in the oe-setup-rpmrepo script
to be the same as the one in the runqemu script.

(From OE-Core rev: 4a23c4dd5ab31d9642e5e49569d5c7ab77e97adf)

(From OE-Core rev: 2174746ca6f480eb6387d91f9b3faf2581e816d3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:51 +00:00
Paul Eggleton 4ff17dc89d scripts: use OE_TMPDIR instead of TMPDIR external variable
On OpenSUSE within an X session, TMPDIR is set to the system temporary
directory (/tmp) which is incorrect for these scripts. Thus, change
runqemu and oe-setup-rpmrepo to use OE_TMPDIR from the external
environment rather than TMPDIR.

Fixes [YOCTO #1530]

(From OE-Core rev: 4e24c10952c7a52af7f2447595fd484692d35534)

(From OE-Core rev: 354497bf3e3bf68374875caa97d9b4fdcad74789)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:50 +00:00
Saul Wold 1a506c5dfd rpm: fix QA Warning on installed but not shipped staticdev filesw
(From OE-Core rev: 62ce8f96626e061e03ca49896716bbb133721ee0)

(From OE-Core rev: 59f80f70c5ff6c62143b7bad5a67d5508b388d29)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:50 +00:00
Simon Busch 84865e45ea meta: qt4: fix postprocessing of pkg-config files
When building qt4-embedded the generated and cleaned pkg-config files for qt are wrong.
The Cflags variable contains something like ${includedir}/qtopia/QtCore where
${includedir} is already /usr/include/qtopia/QtCore.

This patch reverts the fix up of the Cflags variable implemented in do_install.

(From OE-Core rev: b40b9c024be5e1ec81a31961158b3e6b529acfe0)

(From OE-Core rev: 960318ebd271ad5330a0863047927ab827b5e107)

Signed-off-by: Simon Busch <morphis@gravedo.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:50 +00:00
Richard Purdie ae97dbe1db pseudo: Fix QA warnings
This fixes two QA warnings:

a) Debug files being contained in the main package (by adding
   an appropriate FILES expression)
b) Stop hardcoding the RPATH in the nativesdk case since our
   path is on the loaders default search path

(From OE-Core rev: 1577975202437f8f89ef24a5e4d3f6c6c8a88c5c)

(From OE-Core rev: 0c345e7aa83196e55cd554a958690e4cc261ef16)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:50 +00:00
Richard Purdie edb2641243 sqlite3: Fix nativesdk packaging/QA warnings
When building sqlite3-nativesdk, there was a warning about debug files in the
main package. This was due to the order of items in PACKAGES with -dbg after
the main package which breaks an assumption native.bbclass makes. Changing
the order fixes the packaging problem with no change to the normal target
packaging.

(From OE-Core rev: 4f5fdc4dc14d287d301069024ddec9cb65d68f7f)

(From OE-Core rev: 8f2ff09f0da21e83ddfb8049bf7ddece94eb6893)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:50 +00:00
Richard Purdie c8635bab0b grub: Fix insane/QA architecture warning
There is QA warning about this package for an architecture mismatch but
this is inappropriate in this case since the bootloader needs 32 and 64
bit code. We therefore flag the QA check to be skipped.

(From OE-Core rev: 43723e19eb5a6119c7546dc812428e792999a928)

(From OE-Core rev: f31c0b804b04cd1ae9ea7251164fd1345697c72b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:50 +00:00
Richard Purdie cd50451812 gcc: Fix two QA issues
a) There is a QA warning from a .so being present in a main package.
   In the case of the plugin library for gcc, this is allowed.
b) Remove the unwanted libiberty.a file with the strange path. We
   don't need/want this and this removes an unpackaged file warning.

(From OE-Core rev: ca36a3edf9cede9fa0d73ba1a9538ab467cb5e3c)

(From OE-Core rev: 974677d32e0af74fab58d1b12b8d786b67323c5a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Dmitry Eremin-Solenikov 877979c8b5 libffi: really populate -dev package
As per gcc PR 11147, libffi installs headers into a target dependent
place (/usr/lib/....). Include a rule to include those files into
libffi-dev package.

Reference: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11147

(From OE-Core rev: 684a4b517d13884c315688967fadd5e6a4845b71)

(From OE-Core rev: 5cb756227b12e0d537430a527c51033572fb627e)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Dmitry Eremin-Solenikov f69eca96d1 gconf-dbus: packaging fixup
Behave more like plain gconf: include a dtd and .la files into -dev
package.

(From OE-Core rev: 9e962c1b4c8e5a3352f5e2b7dc162aeac1335b3a)

(From OE-Core rev: 53951cffc4253850b9b0d6e24f932a9106dfafef)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
lumag c0a8c9b985 gcc: include libgcov.a into libgcc-dev package
First, this lib is usefull for coverage analysis-enabled building.
Second, this fixes the warning about unpackaged files in libgcc recipe.

(From OE-Core rev: 2a807a98d8be3f486e703321773db32657c71d9e)

(From OE-Core rev: 651e6ee7d1ba729ed0bb5e9ede5975582d9941bf)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Dmitry Eremin-Solenikov 09ab224a2f gcc: fix possible problems with nscd compilation during eglibc-nativesdk build
Long time ago a066e7ca90a28d5681c5fa895a29e999ed7c88b was committed to
address possible problems with compilation of nscd during
eglibc-nativesdk build. Problems were related to the way gcc searches
for headers to check if it should enable it's own stack smash protection
bits or it can relay on eglibc for it.

However after 934d38530c9a67562e53d4034aee5531f0f26750 things got
broken, as for gcc-crosssdk-intermediate packages:
1) EXTRA_OECONF is ignored
2) headers are installed in a different location than expected by that
patch.

This results in eglibc-nativesdk build broken on some systems (e.g. mine
Debian x86_64 squeeze). Fix that by providing with-headers options to
crosssdk-intermediate gcc configuration.

(From OE-Core rev: 63494d638b7a9b88a5b7d7a02d2afcb3aa0fa064)

(From OE-Core rev: b4a686061f27f663321674fb42aa93dbd20c5b3a)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Dmitry Eremin-Solenikov 0e9001afd5 icecc-create-env-native: provide the script right in the tree
There is no point in downloading a tarball with no clear upstream (other than
icecc itself) and then patching it. Rather put new script in the source tree.

(From OE-Core rev: 409fa8ca4d37ad407faaa2a8935e9d2bb89776c9)

(From OE-Core rev: e68d1d5117be9631db644b70308e7360a9d76a3a)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Dmitry Eremin-Solenikov d63678cdfa bitbake.conf: change ccache path to use MULTIMACH_HOST_SYS
Currently if I build packages for several targets (e.g. for armv5te tosa
and for armv7a beagleboard) oe will use single ccache dir for both of
those targets: build/ccache/arm-oe-linux-gnueabi. However those targets
use different opcodes, different features and binaries created for one
of those targets wont't run on the lower one. So use MULTIMACH_HOST_SYS
for ccache dir, so that it uses something like
build/ccache/armv5te-oe-linux-gnueabi dir.

(From OE-Core rev: 982373006a98cf2303514badd1cfb692108408c0)

(From OE-Core rev: 9d460e31b6b45b30b39587503d655aa2a418cbc3)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Khem Raj 1af2581f0b gnome-doc-utils: Prepend PKG_CONFIG_SYSROOT_DIR to the path returned from PKG_CONFIG
If we build say gnome based image on a build system which does not have
gnome e.g. kubuntu then packages like gedit do not build since it uses
gnome files from host system which are non existent on kubuntu

(From OE-Core rev: 7b18b3c96634e40abf690a7ec72562389b0e6c23)

(From OE-Core rev: a413f3adcfb8245550067c1c2a3197817e631ffe)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Richard Purdie 9dcb176dc8 autotools.bbclass: Set the dynamic linker search path for libtool correctly
libtool obtains the search path from /etc/ld.so.conf and hardcodes /usr/lib
and /lib. This results in host contamination and variable sets of RPATH
values ending up in binaries.

By exporting the correct values for all autotools recipes we avoid this.

(From OE-Core rev: 93e595d5c89ebacdb8d1e6fcfe6f58fe2d30de28)

(From OE-Core rev: 5e41e0973a9be890ac310e1bbf465fcd08b0add5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Zhai Edwin 64ba74deff matchbox: Upgrade SRCREV to reflect recent accpeted patches by upstream
(From OE-Core rev: 33a1a05ef988c69f8ff8e38c6723922082e5d1aa)

(From OE-Core rev: 1194935707f4acd9029b36769bc0320ba0a90163)

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Mark Hatle ff047d3a77 cups: Fix recipe to use the correct cups directories
${libdir} is not used, instead they use a common ${exec_prefix}/lib
directory structure for helpers, filters, renderers, etc.

(From OE-Core rev: 24ae432b1a3906956381d83c1984687e45c5a1d1)

(From OE-Core rev: 72da8109de9c2b1e237655706cdf4de447d38393)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:49 +00:00
Khem Raj b137421cfc eglibc-2.12: Fix build on powerpc/603e
We pass --with-cpu to eglibc now. Which breaks
the configure for cpus that it does not support
We add support for ppc603e which gets 2.12
building for qemuppc.

(From OE-Core rev: 465a988e2370ec377875b599045f2a7bad913ac6)

(From OE-Core rev: f6dbd42382d980d90f3e64a94178a0050af537cf)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Conflicts:

	meta/recipes-core/eglibc/eglibc_2.12.bb
2012-01-30 16:37:48 +00:00
Dmitry Eremin-Solenikov 3a8590f105 gcc: include plugin-related headers into packaged SDK
Include headers necessary to compile gcc plugins into cross-canadian gcc
packages.

(From OE-Core rev: d12aa92b3dac1109d510e7b6f74055d1ab927817)

(From OE-Core rev: 51c96c98fca5a4a51cb38a6442ab9b4a03938721)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:48 +00:00
Dmitry Eremin-Solenikov 3571525ab8 e2fsprogs: include devtools scripts
Some scripts are necessary to develop programs with libcom_err and
libss. Include those into e2fsprogs-dev package.

(From OE-Core rev: 46332c2313abb273f6fc889fac4daa91cf43faa3)

(From OE-Core rev: f1f22acd15591e5394254441c4364899875a0fbc)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:48 +00:00
Dmitry Eremin-Solenikov 204762c531 glib-2.0: include glib-gettextize stuff
glib-utils already includes glib-gettextize program. Include some files
necessary for glib-gettextize to work.

(From OE-Core rev: c98356e9c46cd28b7ca8e84fe0ea56dc6d812a8d)

(From OE-Core rev: 0f0d5c7d980400bb45e78b7f178844c5a6dbf630)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:48 +00:00
Daniel Lazzari 394d340ab1 alsa-lib: Don't use versioned symbols on uclibc builds as it causes strange hangs
alsa-lib: Don't use versioned symbols on uclibc builds as it causes strange hangs. Taken from oe-classic.

(From OE-Core rev: b354eb957ce08ac7814ce46c13ca3a8449b4063a)

(From OE-Core rev: 16852546234a252103337414fe536a3b97443539)

Signed-off-by: Daniel Lazzari Jr <dlazzari@leapfrog.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:48 +00:00
Bruce Ashfield 4bf5435d95 linux-yocto: v3.0.10 + rt27
Updating the BSP base to the kernel.org v3.0.10 baseline and importing
the latest stable rt27 release.

(From OE-Core rev: e8aa8fe6e299104d4eb6da16134272a1dc7e929b)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:47 +00:00
Bruce Ashfield 05dba88379 linux-yocto: change SRC_URI to 3.0 maintenance kernel
The 3.0 yocto kernel is updated for both new feature development
and for maintenance purposes. The maintenance kernel repository
takes updates once they have been applied to the development
repository and have been deemed safe/suitable for point releases.

(From OE-Core rev: 0b6eedfe26fca031e84543cab92b20e121364fb7)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:47 +00:00
Paul Eggleton 1ab5a6851d README.hardware: declare support for BeagleBoard xM rev B
The BeagleBoard xM revision B has been tested (by me, if nobody else.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-01-30 16:30:14 +00:00
Paul Eggleton 781866f64e README.hardware: update atom-pc instructions
The -live and -directdisk images have been superseded in the Yocto
Project 1.1 release, so update the instructions for atom-pc relating to
this change. Also fix a couple of other minor atom-pc related
capitalisation.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-01-30 16:29:43 +00:00
Joshua Lock 702c428804 poky: set linux-yocto-rt preferred version for qemu machines
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2012-01-30 16:19:24 +00:00
Xiaofeng Yan 5882121a94 local.conf.sample.extended: Fix bug 1674
[YOCTO #1674]
local.conf.sample.extended: An image based on gtk+-directfb don't need x11 for DEFAULT_FEATURES

Remove "x11" from DEFAULT_FEATURES and add "directfb" to it because someone could don't need x11 in their project, perhaps
gtk over directfb will meet his reqirement.

(From OE-Core rev: 5def790bdecd2726692b40a57bc12c8bdfea9179)

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:19:15 +00:00
Joshua Lock 6c2f754a0a machine/atom-pc: enable sound
Add alsa to the MACHINE_FEATURES - looks like this was an oversight.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:19:06 +00:00
Joshua Lock acd0bedbce ui/crumbs/hobprefs: trigger a reparse after changing IMAGE_FSTYPES
As reported on the mailing list[1] when changing IMAGE_FSTYPES through the
hob preferences a reparse is required before the changes will be picked up
by the system. This patch sets the reload_required property of the class to
true when the image types have been modified to ensure the reparse is
triggered.

1. https://lists.yoctoproject.org/pipermail/yocto/2011-December/006002.html

(Bitbake rev: 6c0babf08909307ab69a66ed06e77e8818b2a8c5)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Joshua Lock 90f8d53800 ui/crumbs/runningbuild: handle InvalidTask events
The knotty UI just ignores these and so should RunningBuild, if these events
aren't handled the UI appears to hang.

Fixes [YOCTO #1665]

(Bitbake rev: 540ba78075bd525776aa23bf38bee66350c66534)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Matthew McClintock 23c6b49566 siggen.py: If both sigs have a variable in it's whitelist then don't say it's changed
Some BB_HASHBASE_WHITELIST variables are in the lists of variable
dependencies for signatures. Ignore those differences in lists
since this difference does not matter

(Bitbake rev: 71b53a3f0766ca464560a1f6a449f9424fbdf7ae)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Robert Yang f204d16012 bitbake: Update and fix bitbake-runtask
Since bitbake switched back to the fork instead of the exec model,
it no longer used bitbake-runtask and the code has suffered some bitrot.
bitbake-runtask is a useful tool for excuting the task without
the scheduler of bitbake, so that the external tool can invoke it
easily. It also provides a useful example of how to invoke exec_task()
with low overhead without a lot of the bitbake threading/UI overhead.

Significant changes:

* This patch changes the argument order so that the commonly used
  and mandatory arguments come first.

* The taskhash file and dryrun options are now optional

* It now uses the bitbake logging mechanisms to provide processed
  logging output to the console.

* The process handling to do with stdout/stderr redirection
  are removed since they're no longer required.

[YOCTO #1229]

RP: Logging updates to the patch based on Roberts original patch
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Richard Purdie 3796541746 bitbake/siggen.py: Don't backtrace if the taskhash data isn't present
This allows the code to safely fall back to dumping the basehash data
if the taskhash data isn't present for some reason. We could effecitvely
obsolete the runtime option and use this approach instead exclusively.

(Bitbake rev: 5ace320ccc01f4e326f90b7ba060dcbff3380dca)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Richard Purdie 0e676f74c5 build.py: Be determistic about a function's cwd
There is a subtle but nasty problem that a function's cwd can vary
depending on whether ${B} (often ${S}) exists before the funciton is
called or not. Most functions in the system can cope with this but
its bad practise and I've just witnessed build failures resulting
from this during image generation from bootimg.bbclass. I also
suspect this could explain some odd fetcher behaviour witnessed in
the past.

This change ensures we always call funcitons with a specific build
directory making things deterministic.

(Bitbake rev: ef0888f83fa4408eb768257d7e03700202faad18)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Richard Purdie 26666187e3 cooker.py: Allow the -e option to work with virtual classes and -b
Using bitbake -e -b virtual:xxxx:/path/to/the.bb would result in
zero matches since the virtual:xxxx piece wasn't being processed.

This adds in the necessary functionality to handle it correctly.

[YOCTO #1793]

(Bitbake rev: bd5a727c8447bcb747c1d2463b7de2ab6d21a7de)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Matthew McClintock c270f92b08 Nothing uses USERNAME, remove it - can cause sstate-cache conflicts
USER is the correct variable to use, also this can affect sstate
cache as well.

(Bitbake rev: d7f9edda65dae2e046871afa275c5a51dff48fc4)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Christopher Larson 1670051a79 codeparser: silence non-literal warnings for vardeps
If the vardeps flag is not None, we now silence the warnings about
non-literal usage for that variable.

(Bitbake rev: e724b9f417d1baf898f5afc6376c73c1a2ad8db9)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Christopher Larson c61f04c34e codeparser: drop expand tracking
There are two usual cases involving bb.data.expand:

- Calling it with a string literal -- "bb.data.expand('${FOO}/${BAZ}/bleh', d)".
- Calling it on getVar results (legacy) -- "bb.data.expand(bb.data.getVar('FOO', d), d)"

Nothing in any of the usual layers uses it in any other way, and I'm
having trouble coming up with any real use cases beyond this. The first
of the above cases is already tracked, via the expandWithRefs called
on the python code string. The second didn't emit a warning anyway,
since the getVar was already handled.

Given this, I see no reason for us to maintain explicit expansion
tracking. Further, we weren't using its results anyway (the var_expands
member).

(Bitbake rev: 405dfe69e6a608826e599ebf2f83ef8cf5083b96)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Christopher Larson 2b26745c70 codeparser: accept a name for better messages
- If a name is passed to the parser, prepend the messages with "while
  parsing <name>:". This gives a bit more context.
- Tweak the warning messages slightly (they had to be altered anyway to
  inject the variable being parsed).

Before:
  DEBUG: Warning: in call to 'bb.data.getVar': argument ''%s' % var' is \
         not a literal

After:
  DEBUG: while parsing emit_pkgdata, in call of bb.data.getVar, argument \
         ''%s' % var' is not a string literal

(Bitbake rev: 1060193ae4d54e667735dbff5d1d2be49a3f95c9)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Christopher Larson 28ca6cc34b codeparser: simplify how we compare the called node names
With the previous method, using the compare_name methods, we split the
requested match name by '.', reversed it, then compared them piecemeal
during the node traversal. The new method walks the nodes and hands back
the name of what's being called, and then we check that. This also
consolidates the two different implementations of traversal of the
attribute/name nodes (one in compare_name, one for the execs).

(Bitbake rev: 84e535b5165c7e936c5b1486bdf4626ed3649f5f)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Christopher Larson ada59bde67 codeparser: merge the nested python parsing classes
The split is even less necessary now that we use ast.walk rather than an
actual NodeVisitor subclass.

(Bitbake rev: d6c44fac184abae8395bfa7078f06675218aa534)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Richard Purdie 9a68fb1364 data/siggen: Add vardepvalue mechanism to allow the variable dependency code to be forced to specific values
We have a problem if we want to inject specific information into the variable
dependency code. There are cases for example where we want a dependency
on the value of X but it doesn't matter how X was constructed or what
dependencies it might have had, we only care about the absolute value.
With the current code, its near enough impossible to do this.

This patch adds such a mechanism so the user can trigger this with code like:

baselib[vardepvalue] = "${baselib}"

It also refactors some of the code so we do variable lookups once
instead of doing this in two different functions.

[YOCTO #1583]

(Bitbake rev: 6c879b44ccf42dc73fe4467076e114700d7ba81b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Richard Purdie f87c92143e fetch2: Improve uri_replace to handle paths with no trailing '/'
Currently if you specify a mirror like:

file://.* http://linux.freescale.net/yocto/sstate-cache

it won't work as you expect whilst:

file://.* http://linux.freescale.net/yocto/sstate-cache/

will since it has the trailing slash.

This patch handles both cases correctly. It also adds some debug to
the uri_replace function since its near impossible to debug it without
some kind of output.

[YOCTO #1578]

(Bitbake rev: a0246bf09c93bb657eaf6ba61d090b247ed33640)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Richard Purdie f38e44bbb2 runqueue.py: Fix debug message to reference the correct task
(Bitbake rev: 035c673c463ca450245acf824e7b7e8f889bdc89)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Richard Purdie 4d7f50382e fetch2/local: Don't default to files in DL_DIR for file:// urls
Defaulting to any file in DL_DIR as the first match for a file:// url
doesn't make much sense and can lead to unexpected results.

This patch changes the logic so this is the last fallback location
instead. Whether it should be using DL_DIR at all for this is a
good question but something for another patch.

[YOCTO #1710]

(Bitbake rev: 5597a68fac0954c682b67471722c2643e2415f99)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Matthew McClintock 6803d97bdb siggen.py: sort task hash depedencies with basepath
Without this patch the tash hash dependencies can be in a order
that is dependent upon directory/filesystem layout. With this
change the data is sorted the same regardless.

Without this the dependent hashes could be in different orders
on different systems and consequently final md5 hash would differ
as well even though nothing else changed.

(Bitbake rev: 9a2029899c946ce9aa8adbc85f2cfe7a85b92182)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Matthew McClintock 81ed10442b bitbake: print out symmetric difference when comparing sigs
This is useful for really longs lists to pinpoint what has
actually changed

(Bitbake rev: f1eb6d3dcc10c42bb09383a87bde3afa69bc6ed9)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Richard Purdie 1a46002fad runqueue.py: Ensure we fully process the covered list
The existing looping code can mask an existing "found = True"
by forcing it to False each time. This can lead to dependency
lists not being fully searched and results in dependency errors.

An exmaple of this was the autobuilder building linux-yocto from
sstate but then rebuilding some of the recipe's tasks for no
apparent reason. Separating the logic into two variables solves this
problem since any "found = True" value is now always preserved.

(Bitbake rev: 61017fc5d30b7a13308d038872ec92efc1a84cef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Richard Purdie 2747b2003e runqueue.py: Ensure setscene tasks don't break dependency order
If A depends upon B which depends upon C and the setscene for B
succeeds but C is going to get rebuilt, we should wait for C to
try and build A but currently we don't.

This is due to the timing of when we run the task_skip() as this
triggers other tasks to become buildable. This patch moves the timing
of that call to a more appropriate place allowing dependencies to
behave as expected.

(Bitbake rev: b7114d8e5d9b0720339bd5d24d243c0f2a7c1f3b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Richard Purdie 375297ea28 bitbake/runqueue.py: Sort the list of skipped tasks as it makes searching the list easier when debugging
(From Poky rev: 5de8a495fba657e1febc616bbc737a8136cc88f9)

(Bitbake rev: 110f6cccbcc5907e15262c05d5c47da101e1a47d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Richard Purdie c2662a5095 bitbake/runqueue.py: Fix incorrect task number reference in debug message
(From Poky rev: 45887bbd5479041be05b914668f14de6ec9b9831)

(Bitbake rev: dc4439ca8c7db7ceee78bd0552f65ceddcff17a7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Richard Purdie da56e3df88 parse_py: Use absolute paths for FILE
Its possible for relative paths to creep into FILE. These confuse the
build system no end as its not clear where they might be releative to.

This patch ensures we always use resolved absolute paths for FILE
so that things behave in a deterministic way.

(Bitbake rev: 658d7daa70e46c2b20973b90ee53f0bbadc8bf5d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Richard Purdie 388dbe4928 siggen.py: Include list of variables in hashes
Ensure that the list of dependencies is included in the hash
as well as their contents

Prior to this, adding or removing dependencies with values
of "None" would not change the hash, despite diffsigs reporting
this difference.

(Bitbake rev: 727ca945177ce9bd44515cf611e3e95a09466d98)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Richard Purdie dbcce81f66 siggen.py: Fix diffsigs output for filename comparisions
When comparing sig files, if the recipe locations had changed, the
dependent tasks list would show as changed even if the actual hash
had not changed. This updates the code to only compare the base part
of the pathnames.

It also tweaks some of the output to add newlines to aid comparing
two lists of variables as it makes the location of the difference
clearer.

(Bitbake rev: 165a22ddcc647b945707fb5c483146bb336d5f66)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Christopher Larson 46ac868403 codeparser: make var_expands actually hold useful information
Previously, it was calling var_expands.update() rather than add(), with
a string argument, resulting in adding each character of that string to
the var_expands set, rather than the string itself.

(Bitbake rev: 8e4e75383e43d6da2c16ec5286186a0d0569b0f8)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Paul Eggleton 6e1105e1e8 lib/bb/runqueue: avoid marking runtime dependencies as covered
The code which populates setscene_covered list was adding a task to the
covered list if all of the tasks that depend upon it were also covered;
however, this means that tasks that would have installed "runtime"
dependencies were being marked as covered also, e.g. gmp-native and
mpfr-native are needed by gcc-cross at runtime since they are shared
libraries that gcc links to, but their do_populate_sysroot tasks were
being marked as covered, resulting in failures later on if gcc-cross was
available from sstate but mpfr-native and gmp-native weren't.

Since we currently have no real way to handle runtime dependencies for
native packages, add a workaround which avoids marking tasks as covered
if one or more of their revdeps are from a different recipe.

Fixes [YOCTO #1536].

(Bitbake rev: e492eb4dc9016cd0bed194377c6f2b85cf0ad113)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Richard Purdie 4494f59a26 utils.py: Fix lockfile retry handling
The lockfile retry parameter is expected to return immediately after
attempting to take the lock. There was a bug in the logic which this
patch fixed to ensure it does that.

(Bitbake rev: f421ef819f00ac659504d9af41bcc8323422ff8c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Joshua Lock 13590b23c6 hob: fix backtrace when dismissing open dialog
Clearly a logic/indentation error - we should only try and load the recipe
should the file-chooser return OK.

Fixes [YOCTO #1668]

(Bitbake rev: db59297aa1861614ffaea4295b9b054baa8a12b9)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Matthew McClintock 2c3861ee68 fetch2: Export additional variables to the fetchers
git could need these environment variables when working behind
a proxy

(Bitbake rev: dca46cc2e1c75b6add2c4801e2994a4812745f5b)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Matthew McClintock 9cf7aabecf fetch2/git: Make git fetch run with -f so rebased branches don't fail
git fetches can fail (or at least return failed) when trying to
fetch and prune rebased branches. This patch simply adds a -f
to the git fetch command so these failure are ignore

Generally, if some SHA was rebased away it's not coming back so
there is no point in not doing this force

(Bitbake rev: a7b75e4db52445b30ec0fc0053dcf454f5f7d2db)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:11 +00:00
Scott Rifenbark 81d1a4aadf documentation/Makefile: new 'edison' variable for YP dev manual.
I discovered that the figures used in this manual differ depending
on the branch.  There are two figures that are different.  Thus,
the TARFILES variable in the makefile needed to be conditionalized.
If it is not, then the process that makes the tarball throws errors
because it cannot find the two figures from the other branch.

To fix this I introduced the 'BRANCH' variable.  It is to be used
only when you make or publish the YP Development Manual.  And, you
only use it to specify 'edison'.  If you are building from the 'master'
branch you don't need to use it.

Comments in the file have been updated to explain usage.

(From yocto-docs rev: 0341b19f75176fd4133fd66cb5536b765edf0294)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:03 +00:00
Scott Rifenbark 6578845f69 documentation/Makefile: fixes for missing tarfiles
I had added some edison-specific figures and they needed to
be included in the TARFILE variable for the YP development manual.
The fix now makes the TARFILE variable all-inclusive for all
.PNG files regardless of branch.  Consequently, there can be
some missing files when the manual is made but the errors are okay.
I documented the exceptions above the variable.

(From yocto-docs rev: be731afde47dfc85da6ba88f93910899ec259e87)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:03 +00:00
Scott Rifenbark b5a4e78df5 documentation/dev-manual/dev-manual-kernel-appendix.xml: edits to example
Poor flow for the config_smp example.  Upon reading this example
it did not stand well on its own.  I added some text, albeit
redundant but necessary I felt, so that the example would stand on
its own.

(From yocto-docs rev: 1677a873e9bd1124a5ff0234edc1ee05938c19b0)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:02 +00:00
Scott Rifenbark 68b55c1e85 documentation/dev-manual/dev-manual-kernel-appendix.xml: Fixed repo name
I left "work" off the name of the copy of the clone repo
for the kernel example.

(From yocto-docs rev: 26f3dd9c82beb3c8d6e50c2132756bdb4b29b56d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:02 +00:00
Scott Rifenbark 4234beb034 documentation/dev-manual/dev-manual-kernel-appendix.xml: branch info added
The example now uses an edison branch of the poky-extras repo.
Now that that is necessary, there needs to be explanation in the
example on setting that branch up after creating the local
repository.

(From yocto-docs rev: 70599a07a6efb0ae2da04baa43b5bb99c9ec4e5d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:02 +00:00
Scott Rifenbark ddb5143d9d documentation/dev-manual/dev-manual-model.xml: updated figure
Because the names of the bare clone and copy of the bare
clone kernel repos changed in the example this figure needed
to be altered.

(From yocto-docs rev: e49ec4256bd9fe9f1193b70f8a5ab864c069c863)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:02 +00:00
Scott Rifenbark 25dcd673f5 documenation/dev-manual/figures: Figures altered.
Changing the name of the bare clone and copy of the bare
clone for the appendix A (kernel) example affected this
figure of the file structure.  I updated the figure, which
is now specific to 1.1.x and added it.  I also had to remove
the figure that will now be specific to (master) work.

(From yocto-docs rev: 048af1a6945991c66abef72de05c136e8071a9e5)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:02 +00:00
Scott Rifenbark 1ad7977742 documentation/dev-manual: Changes to repo names and kernel example.
To make the kernel example more easily understood, Joshua Lock
suggested that the names used for the bare clone of the kernel
git repo and the copy of the bare clone be more different.  So
I have changed the example such that the bare clone repo is
named linux-yocto-3.0-1.1.x.git and the copy of the bare clone
(or working repo) is named my-linux-yocto-3.0-1.1.x-work.

Note that this also implies the use of the linux-yocto_3.0-1.1.x
kernel and not the linux-yocto_3.0 kernel.

All the changes made here should take care of the example.  I
did have to introduce a new figure that showed the kernel
repos based on the new names used in the example.  Also, I had
to delete the other from this branch.  The examples are now
diverging according to (master) work and 1.1.x work.

Reported-by: Joshua Lock <joshua.lock@intel.com>
(From yocto-docs rev: f4fdef6078fccfc2c72b6e0ad1dfae1f1ecb2aa6)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:01 +00:00
Scott Rifenbark fe40f117c1 documentation/poky-ref-manual/faq.xml: Fixed links to python
The links to the 32-bit and 64-bit Python tarballs in
miscsupport were broken.  I fixed them.

(From yocto-docs rev: 6dd820fe8e3d22329a4d6e4edcbba72bf70841c4)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:01 +00:00
Scott Rifenbark 0550d8c73e documentation/dev-manual/dev-manual-newbie.xml: updated download link
Found a link that was still yoctoproject.org/downloads.  I changed
to downloads.yoctoproject.org.

(From yocto-docs rev: 26c87f543c95efcd7e5a546b3cd0d0756a238fa5)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:01 +00:00
Scott Rifenbark bc821a2ab5 documentation/adt-manual/adt-command.xml: Corrected wording for setup
Bad wording fixed to describe the changes to PATH when the setup
script is run.

(From yocto-docs rev: 95c6049995e8b51a46ba7fba57fcc240b6baeaaf)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:01 +00:00
Scott Rifenbark aa72ed0b23 documentation/adt-manual/adt-eclipse.xml: Fixed yoctotools reference
The menu for the YoctoTools in Eclipse moved from underneath
"Windows" to the top level.  I fixed the reference to reflect
that change in the GUI.

(From yocto-docs rev: 89830569107200f89d78e0b32b98429a947abe36)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:01 +00:00
Scott Rifenbark e0a2bbd2a4 documentation/adt-manual/adt-eclipse.xml: Fixed menu reference
I changed the wording in an example to use "menu" instead of
the incorrect "navigator pane".

(From yocto-docs rev: d2ce174e8e427c279d90197eb896e1f4df183196)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:00 +00:00
Scott Rifenbark 1a2454fcba documentation/adt-manual/adt-eclipse.xml: Added more info for example.
I added a bit more information to the third step of the
example that reconfigures a project.

(From yocto-docs rev: d30a83e4f62015cbaba9e2532b7e69d1908dfb50)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:00 +00:00
Scott Rifenbark 92675a93ba documentation/adt-manual/adt-eclipse.xml: Removed redundant link
I removed a redundant link to the QS manual.

(From yocto-docs rev: 20c898194511bd943ca2a93b1a4caad0466fccd9)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:00 +00:00
Scott Rifenbark 1bafc89431 documentation/adt-manual/adt-eclipse.xml: Updates to plug-in install
I worked through these methods and discovered a bit more on how
they actually work and when the user would use a given method.
The updates reflect this new knowledge.

(From yocto-docs rev: 346652df7a3423b82a10d41aa2d7dcddb803ad6f)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:06:00 +00:00
Scott Rifenbark dc785b64c1 documentation/adt-manual/adt-package.xml: Fixed reference to manual.
Removed redundant link for referencing a section of a different
manual.

(From yocto-docs rev: 44f4df93ead5c8d48dd536355770919871bdc283)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:59 +00:00
Scott Rifenbark 257dbe8d39 documentation/adt-manual/adt-prepare.xml: Updates for 1.1.1
These changes reflect working through the chapter using the
1.1.1 release.  Several areas needed tweaking.

(From yocto-docs rev: 566b8a492e502e88a1404f833db140a6408da592)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:59 +00:00
Scott Rifenbark c81c4cb0c7 documentation/poky-ref-manual/ref-variables.xml: PDF formatting fixed.
In the PDF version of the reference guide there were several glossary
variables that did not format correctly.  The issue is that the two-
column list had instances where the variable name overruns the
variable description.  I added an extra line return for these cases.

(From yocto-docs rev: f3ff26568b371807986e4ba77fe41cba6875efcc)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:59 +00:00
Scott Rifenbark da3edbd85b documentation/adt-manual/adt-prepare.xml: added unpacking text
I added text to show how to unpack the generated ADT Installer
tarball.

(From yocto-docs rev: b0cf4554d3dde3a018f8f7901162474cb423ea12)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:59 +00:00
Scott Rifenbark 44aa4f320a documentation/adt-manual/adt-prepare.xml: update link to get ADT inst tarball
(From yocto-docs rev: b034cda6c18fc350636554b5ff8a4a89f503308d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:58 +00:00
Scott Rifenbark 38dbccd997 documentation/adt-manual/adt-intro.xml: Fixed broken perf link
(From yocto-docs rev: 13ddf9ab19f55e5f204ffa78180d89c47d51155f)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:58 +00:00
Scott Rifenbark 6c27a7b50e documentation/adt-manual/adt-prepare.xml: Updated 6.0 to 6.0.1
Changes for the 1.1.1 release.

(From yocto-docs rev: 42ffeb43ea315b14e8b4668d3ab5ff8a16f1e7ac)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:58 +00:00
Scott Rifenbark 7ef3bc97b7 documentation/dev-manual/figures/kernel-example-repos.png: update figure
The figure that shows the kernel repos needed the git push
command fixed.  There was no ":" character in it.

(From yocto-docs rev: 69874766764788f08dc448b9835d41b6c67fcd8a)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:58 +00:00
Scott Rifenbark 807b96f882 documentation/bsp-guide/bsp.xml: updated crownbay file structure
The file hiearchy was stale for the meta-crownbay examples in
recipes-graphics.  I updated in two places.

(From yocto-docs rev: a16bf8ae56efb907a50fbe4c16be0adfeec5c275)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:57 +00:00
Scott Rifenbark 2add98ffc8 documentation/bsp-guide/bsp.xml: Updated linux-yocto_3.0.bbappend example
This example had gone stale.  I cloned the meta-intel repo and
copied the edison branch version of the file into the manual.

(From yocto-docs rev: 963c53157f147c556cc4317f68fafeb0650268cc)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:57 +00:00
Scott Rifenbark ed7fe93178 documentation/dev-manual/dev-manual-kernel-appendix.xml: menuconfig update
The example that shows menuconfig and where the .config file is
was updated to show the use of linux-yocto-3.0 kernel.

(From yocto-docs rev: a9f7a73842b428242da95f3dfe6a7b31c123ebc2)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:57 +00:00
Scott Rifenbark 397081ef41 documentation/dev-manual: Updates to index of releases
Had to update the figure again and I updated the surrounding
text.

(From yocto-docs rev: d3a0cb2b24dabdf4a022a7426aeb2b80b40ae544)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:57 +00:00
Scott Rifenbark 570eeea297 documentation/dev-manual/figures/index-downloads.png: updated picture
Updated the picture that shows the index of releases.  they renamed
this from index of downloads.

(From yocto-docs rev: 098648434311bbe6de68fbbf89486ee1f9c0e4ec)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:56 +00:00
Scott Rifenbark b9232eb2b4 documentation/dev-manual/dev-manual-kernel-appendix.xml: cleared up note
There is note instructing the user to delete unused .bbappend files
or comment out the COMPATIBLE_MACHINE statements in those unused
files before running the build in the example.  the note was not
clear about the COMPATIBLE_MACHINE statement in the .bbappend file
that is actually being used.  I edited the text to be clear about
that.

(From yocto-docs rev: 44277b9c5d8a77958a4220fa790bc13e9ce697b3)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:56 +00:00
Scott Rifenbark 405578286d documentation/dev-manual/dev-manual-bsp-appendix.xml: hddimg size updated
The 'dd' example needed updating for the output that shows the
size of the image.

(From yocto-docs rev: f7cee3f3b9ccf2760de182b3d545e8d53ef83786)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:56 +00:00
Scott Rifenbark 1c937b6359 documentation/dev-manual/dev-manual-start.xml: updated to clone output
Updated the console output created when you create the bare clone
and the copy of the bare clone.

(From yocto-docs rev: 73130ec4a785417c5b8a91c0b577ac3681562b77)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:56 +00:00
Scott Rifenbark 567200dcf2 documentation/dev-manual/dev-manual-start.xml: poky-extra output updated
I updated the console output returned when you set up the
poky-extras repo.

(From yocto-docs rev: f4a6bea21df8dc6df1c30288a6ea93218e7d614d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:56 +00:00
Scott Rifenbark b4f5708c05 documentation/dev-manual/dev-manual-kernel-appendix.xml: General Edits
Better wording for the "Local Yocto Project Files Git Repository"
bulleted item.

(From yocto-docs rev: 03dea8208ba641efdfc9d1fa1d9afddc8c659cbf)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:55 +00:00
Scott Rifenbark b8cb28fc2f documentation/dev-manual/dev-manual-bsp-appendix.xml: dd example updated
After building the BSP example the dd example command is being updated
with new image.

(From yocto-docs rev: ed9dc2a1af1c1160d03b0b12f06c91028120f177)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:55 +00:00
Tom Zanussi 495d37ab0b documentation/dev-manual/dev-manual-bsp-appendix.xml: BSP example scrub
As Reported by Robert P. J. Day.

Robert was working through this BSP example in the development manual
and ran into some problems and some confusion in areas.  This launched
a long "help-desk" session with Tom Zanussi.  In addressing Robert's
issues, Tom decided to make a run through of the example as it was
written.  For the most part the example was sound but needed some
technical tweaks as well as some expansion of the text to make things
clearer.  Tom submitted the patch that addressed these concerns.

Scott Rifenbark reviewed the patch and further modified some of the
writing to make it consistent with the existing writing in the manual.

(From yocto-docs rev: b95b9077bce1de55da4c0fc6208e2f2dac10c1e5)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:55 +00:00
Scott Rifenbark 9d60cb9450 documentation/dev-manual/dev-manual-bsp-appendix.xml: recipes-bsp example
For some reason the example for the "Changing recipes-bsp" section
mysteriously had the wrong first command in the example to prepare
this stuff.  The example was removing something in the recipes-graphics
area.  Don't ask me how it got there.  I checked through the commits
in the Edison branch and can't find the change.  It could have happened
during 1.1.1 scrub.

Anyway, I have fixed the 'rm' command to be appropriate for the
example, which works with recipes-bsp.

(From yocto-docs rev: a53d46b5f0dbbdfac902abc5844085bee3aeb6d9)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:55 +00:00
Scott Rifenbark 5592e80877 documentation/dev-manual/dev-manual-start.xml: update meta-intel output
Verifying the 1.1.1 release and creating the local repo of meta-intel.
The console output is significantly different.  I have updated the
returned console output.

(From yocto-docs rev: 653e1214861e98501d37543403c5324c4d153112)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:54 +00:00
Scott Rifenbark 979ecf3eea documentation/dev-manual/dev-manual-model.xml: Updated machine link
Found a couple more occurrences of old links to the machines
area of the downloads.  Fixed them.

(From yocto-docs rev: 276352d49612bf77ed9e828c54bc1bc008345839)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:54 +00:00
Scott Rifenbark 770f5bb229 documentation/dev-manual/dev-manual-model.xml: Updated machine link
Changed a couple of links for the yocto-1.1.1/machines area.  These
links were old and pointing to yoctoproject.org/downloads.  They
are now changed to http://downloads.yoctoproject.org/releases..

(From yocto-docs rev: cee9d5eb0b095ba647411abaf12f591e216e461f)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:54 +00:00
Scott Rifenbark 44211ed500 documentation/dev-manual/dev-manual-model.xml: Fixed external link
Found a link that had a spacing problem and should not have
been linking to the manual in general.  Fixed the spacing problem
and removed the links to the book in general.

(From yocto-docs rev: 0894e05dfa59b08f5c4e29a5aafbc2e5487f442c)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:54 +00:00
Scott Rifenbark ac715efc14 documentation/dev-manual/dev-manual-newbie.xml: Fixed broken link to Git
Found another broken link to the Git documentation.  They must have changed
this stuff up.  So I set the link to point to the appropriate area in
the Git Community Book.  Talks about distributed workflows.

(From yocto-docs rev: b668c8c65fdc51e0100e9ddd1c54e4926579bbe2)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:54 +00:00
Scott Rifenbark b256ae8f80 documentation/dev-manual/dev-manual-newbie.xml: fixed broken link
there was a link to some Git documentation referencing workflows that
apparently had gone stale.  I replaced the reference with a link to
the Git Community Book.

(From yocto-docs rev: 3a21f7454ec04e082d58646eecc1cffe3caa046c)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:53 +00:00
Scott Rifenbark fa969ffb59 documentation/dev-manual/figures/git-workflow.png: Updated figure flow
The Git Workflow was missing a pull line from the second (bottom) contrib
box into the project's master Git repository.  I added the line.

(From yocto-docs rev: 3988e0197a7e3a6cde647f01da9ae41fd9465c75)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:53 +00:00
Scott Rifenbark e67311606e documentation/dev-manual/dev-manual-start.xml: top-level dir fixed
Changed the top-level directory created from unpacking the
edison-6.0.1 tarball from 'poky-1.1.1' to
'poky-edison-6.0.1'.

(From yocto-docs rev: 7af332806f1f4952f8e7672243d077e4ecde7fc5)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:53 +00:00
Scott Rifenbark b17aecd70a documentation/dev-manual: Fixed 6.0 to 6.0.1 for 1.1.1 release.
Needed to change the "6.0" occurences to "6.0.1" in the examples.

(From yocto-docs rev: d6b40b3b0e98eba7f3221e79cb9612f8f10bffaf)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:53 +00:00
Scott Rifenbark 1cb265f575 documentation/yocto-project-qs/yocto-project-qs.xml: update to pre-built
The pre-built section had a couple errors I discovered while trying
to verify the 1.1.1 release.  One is a wording problem putting the
last set of commands into context.  the other is that i needed
i586 as the expanded environment file in /opt/poky.

(From yocto-docs rev: d173f82e3e368b54889d6c1aa9bd51340e7e42be)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:53 +00:00
Scott Rifenbark 31b7cac818 documentation/yocto-project-qs/yocto-project-qs.xml: 6.0 fixes for 6.0.1
Updates to 6.0 to make them 6.0.1 for the 1.1.1 release.

(From yocto-docs rev: 19c8fb554c620d78edc7a0330e76e31a2a374ad2)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:52 +00:00
Scott Rifenbark 05738313c3 documentation/yocto-project-qs: Updates for 1.1.1 Release
Decision made to treat every release like a major release.
This caused a scrub through the manual for the string "1.1"
and "6.0" and changed to "1.1.1" and "6.0.1".

(From yocto-docs rev: 3bd37946985b5a38860a61887d0bac4930c7cde1)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:52 +00:00
Scott Rifenbark 25cf1a65ec documentation/poky-ref-manual: Updates for 1.1.1 Release
Decision made to treat every release like a major release.
This caused a scrub through the manual for the string "1.1"
and "6.0" and changed to "1.1.1" and "6.0.1".  Also the
release date changed to 17 February.

(From yocto-docs rev: 893d347409543cc690ab40b06384d4a0b1519ac0)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:52 +00:00
Scott Rifenbark 442730168e documentation/kernel-manual: Updates for 1.1.1 Release
Decision made to treat every release like a major release.
This caused a scrub through the manual for the string "1.1"
and "6.0" and changed to "1.1.1" and "6.0.1".  Also the
release date changed to 17 February.

(From yocto-docs rev: 23938e6066b214aaba2e84fe4521504ad7f89b58)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:52 +00:00
Scott Rifenbark 2ca5c8c03e documentation/bsp-guide: Updates for 1.1.1 Release
Decision made to treat every release like a major release.
This caused a scrub through the manual for the string "1.1"
and "6.0" and changed to "1.1.1" and "6.0.1".  Also the
release date changed to 17 February.
(From yocto-docs rev: 8438b152ba13dab079b3918fecc418be5ddc19c0)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:51 +00:00
Scott Rifenbark fa056279ea documentation/bsp-guide: Updated History table for 1.1.1 release.
(From yocto-docs rev: 0973325ae77fe6bdbf2fa6833005df2f7b0b554e)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:51 +00:00
Scott Rifenbark 7ec098bedc documentation/adt-manual: Updates for 1.1.1 Release
Decision made to treat every release like a major release.
This caused a scrub through the manual for the string "1.1"
and "6.0" and changed to "1.1.1" and "6.0.1".  Also the
release date changed to 17 February.

(From yocto-docs rev: d603f89d42442dee6287381e7a0bfb7ddcdc2353)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:51 +00:00
Scott Rifenbark 68d048abfd documentation/adt-manual: Scrub for 1.1 occurrences
Several changes made to turn "1.1" into "1.1.1" for the Edison
point release.  There could be a couple more.  I am waiting on
clarification from Beth and Jessica.

(From yocto-docs rev: 7a27eba984c4baf7dc22a61a18f9c902acc6f9d6)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:51 +00:00
Scott Rifenbark d5848aa719 documentation: cross-manual links hard-coded for 1.1.1 release.
All the links to any YP manual for the 1.1.1 release now use
"http://www.yoctoproject.org/docs/1.1.1/....".

(From yocto-docs rev: 178d16e8693550341a4d307e36af934ce0bfe4c3)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:50 +00:00
Scott Rifenbark 9edf601d2d documentation: Updates to Manual History Table for 1.1.1
All history table entries added for the five YP manuals.
At this commit the date was not known so a place holder date
of 12 January 2012 is in there.  I needed to commit this
separately so that I could move onto other changes for the
docs.

(From yocto-docs rev: 4983a6d66d659aa7a0cc5d4953716a55f24fb03b)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:50 +00:00
Scott Rifenbark 155d0deae8 documentation/poky-ref-manual/technical-details.xml: edits per Richard Purdie
Richard reviewed the new sections and had a couple comments.  There
was one technical error and he also wanted YP worked out when it was
being used in the context of the code that was doing the work here.
So I replaced with more generic terms or specifically called out
BitBake as the responsible software.

(From yocto-docs rev: 89641ffa35d7978961790d750ce84073dc8520c1)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:50 +00:00
Scott Rifenbark 85408dfd36 documentation/poky-ref-manual/ref-bitbake.xml: Updated BitBake Running a Task
I added more information about how BitBake actually runs a task.
The information has to do with how tightly BB controls the execution
environment of the build tasks to prevent contamination from the
build machine from leaking into the task execution environment.
This tight control actually causes some unexpected behavior during
builds.  For example, when a user exports and BB_ENV_EXTRAWHITE
an environment item such as CCACHE_DIR, the effects of the environment
item never make it to the BB task execution environment.  They only
make it to the data store.  The user actually has to take some extra
steps to export that environment item into the task execution environment.
The added information I put into the "Running a Task" section describes
these extra steps.

Fixes [YOCTO #689]
Reported-by: Wolfgang Denk <wd@denx.de>
(From yocto-docs rev: f75a9d384c0d5ccaefe7ac2195917531b153cf5e)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:50 +00:00
Scott Rifenbark 43fb63af31 documenation/poky-ref-manual/technical-details.xml: Shared State
I updated the tips and tricks section to include two sub-sections.
The first if the debugging stuff from Richard's email.  The
second section is how to invalidate a section of the sstate
cache on a per-class basis.

Fixes [YOCTO #1500]

(From yocto-docs rev: e2cc31c112fc55c3f793f3c416311a1d317ceb37)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:49 +00:00
Scott Rifenbark 8add7fccde documentation/poky-ref-manual/technical-details.xml: more on YOCTO #1500
More work on this bug for sstate.  This commit represents the third
pass through the new chapter four (Technical Details) that is
dedicated to YP components and sstate at the moment.  The material
is unreviewed by Richard as of yet.

(From yocto-docs rev: ecaba811d3125e2ed1fc09df718d51e3eb30147f)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:49 +00:00
Scott Rifenbark 01f5e6778c documenation/poky-ref-manual/technical-details.xml: Some general edits.
(From yocto-docs rev: c1684acf9249a6ace631a98f25aa256a542cee62)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:49 +00:00
Scott Rifenbark 1ff81200ac documentation/poky-ref-manual/extendpoky.xml: Fixed typo
Changed "versions" to "Versions" in the title.

(From yocto-docs rev: ce327ae04216e63315bcc735ba9b410582fe74b5)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:49 +00:00
Scott Rifenbark d2f1ca8cba documentation/poky-ref-manual/extendpoky.xml: intro changed and order changed
Beefed up the introductory paragraph and I re-ordered the "Making and
Maintaining Changes" section towards the end of the chapter.

(From yocto-docs rev: a58c0e73d720ffb7a4931fbc196ea3831992b514)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:49 +00:00
Scott Rifenbark caab52f6cc documentation/poky-ref-manual/usingpoky.xml: updated intro paragraph
Beefed up the introductory paragraph a bit.

(From yocto-docs rev: 99e0b95d4827dcc309ab0f212801fc86758a297d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:48 +00:00
Scott Rifenbark b4eb195b34 documentation/poky-ref-manual/introduction.xml: Added reference
Added a reference to the YP development manual in the introductory
paragraph.

(From yocto-docs rev: 977eb862e27e0f2165a2d38cdaff06271726e9fc)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:48 +00:00
Scott Rifenbark 3dbabb693d documentation/poky-ref-manual/introduction.xml: added new chapter
The list that describes the organization of the book needed the
"Technical Details" chapter added.

(From yocto-docs rev: bdaeb303e92f145fa6499e95ee88c629dd1c6486)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:48 +00:00
Scott Rifenbark 5dd34a717e documentation/poky-ref-manual: New chapter introduced
Long-term strategy for the YP Reference Manual is that it contains
reference material and not "how-to-information".  A step in this
direction is to isolate any discussions on components and other
areas of YP that need talked about.  So to start with, I have created
a new chapter for now named "Technical Details" that so far has
a discussion of some components and shared state.  This is a
step in the direction of making this manual a reference manual and
not a "how to" manual.

Changes included removing redundant material from the 'usingpoky.xml'
chapter and also adding the new chapter 'technical-details' into the
'poky-ref-manual.xml' file used for the make.

(From yocto-docs rev: a01477f787768230bc25da2d094326922be23dd4)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:48 +00:00
Scott Rifenbark e7cfb3b469 documentation/poky-ref-manual/usingpoky.xml: Removed comments
Removed some comments that were buried in the file that were
notes for working on the sstate section.

(From yocto-docs rev: bd03315031bbb1b682dcd2253f85fc184822a28e)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:47 +00:00
Scott Rifenbark c2494d3014 documentation/poky-ref-manual/usingpoky.xml: partial for YOCTO #1500
First draft of a re-write to the "Running a Build" section to try
and satisfy YOCTO #1500.  I segmented the section into three areas
rather than a single area.  This allowed me to create a sub-section
for the sstate stuff where it could be addressed on its own.  I sent
the draft out to Richard and Mark H. and got feedback from RP that
is going to cause further changes.  Thus, I am committing this partial
change.

(From yocto-docs rev: f040ed6979e988968863016103aa3ad4e7365159)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:05:47 +00:00
Scott Rifenbark 9d87cd9952 documentation/poky-ref-manual/introduction.xml: Fixed broken link
Robert identified this broken link to the stable Yocto Releases.

As Reported by: Robert P. J. Day
(From yocto-docs rev: acbcfe054ce345156346b3963b41e73f20b679cc)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:01:23 +00:00
Scott Rifenbark 1851a96b47 documentation/yocto-project-qs/yocto-project-qs.xml: Updated packages section
Split the instructions for getting the packages needed for Yocto
into sections that specifically support Ubuntu, Fedora, and openSUSE.
Also, added a couple packages to openSUSE.  I did not implement a
suggested change to include a note indicating future support of
the dash shell since it probably is not good policy to document plans
as they change.

Reported-by: Darren Hart
(From yocto-docs rev: 215af24bd6f697e4a3650f4669e12c6e191e2dab)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:00:05 +00:00
Scott Rifenbark efd2d7ee05 documentation/yocto-project-qs/yocto-project-qs.xml: Fixed broken link
Deleted the "www" from the URL to get the edison tarball.  This fixed
the link.

Reported-by: William Mills
(From yocto-docs rev: aa19ff9bfb465b6a6623cda1c7a080a0c3924995)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 15:59:07 +00:00
Scott Rifenbark b16bc3d277 documentation/poky-ref-manual/ref-classes.xml: insane.bbclass updated
Added explanation about this class being configurable for
generating warnings or errors through use of the WARN_QA and
ERROR_QA variables.  Also provided a list of tests that can
be tested for.

Fixes [YOCTO #1773]

Reported-by: Mark Hatle <mark.hatle@windriver.com>
(From yocto-docs rev: 2b15aa9076ec120d078bfcd570001a49e81df038)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 15:56:51 +00:00
Holger Hans Peter Freyther a56c10d89a lcr: Clean out the default config files 2012-01-23 02:32:32 +08:00
Holger Hans Peter Freyther 75abc06f34 lcr: Remove not installed files from the CONFFILES 2012-01-23 02:25:15 +08:00
Holger Hans Peter Freyther 23dbc00a4e openbsc: Upgrade git version to track 0.10.1+ 2012-01-16 16:38:41 +08:00
Holger Hans Peter Freyther 73bcd9a75c libosmocore: Upgrade git to after the 0.4.1 release
In this git version LAPDm is fixed in a way that it is working
for the osmo-bts again.
2012-01-16 16:38:41 +08:00
Holger Hans Peter Freyther 6e64338f29 libosmo-abis: Add recipe for upstream version 0.1.1 2012-01-16 16:38:41 +08:00
Holger Hans Peter Freyther 8f3955af20 lcr: Upgrade to post 1.10 and build from my personal branch
Update to 1.10 to work with newer osmo-nitb, including the version
handshake that was introduced.
2012-01-16 16:38:41 +08:00
Holger Hans Peter Freyther e77df798a7 asterisk: Band aid for a crash on RTP RTCP message
This might be a general TLS issue with Asterisk on ARM. I have not
looked into why this is happening. Create a band-aid.

Crash:
(gdb) bt
it crashed when formating/printing the &addr in the rtcp recv method
...

RTCP:
Packet generated from Ekiga 3.2.7 (Debian Unstable).

Cause:
Not very clear, maybe something with TLS handling of asterisk
2012-01-16 16:38:41 +08:00
Holger Hans Peter Freyther 9566715405 asterisk: Upgrade from version 1.8.7.0 to 1.8.8.1
Move along the stable track.
2012-01-16 16:38:37 +08:00
Holger Hans Peter Freyther c2d998c9b4 mISDN: Upgrade the mISDNuser library to post 2.0.5 2012-01-16 16:06:09 +08:00
Holger Hans Peter Freyther 8946d523ed libosmocore: Update the git recipe to include latest LAPD fix 2012-01-11 20:44:34 +08:00
Holger Hans Peter Freyther 183d75b24d libosmocore: Add version 0.4.1 of libosmocore, force re-build 2011-12-11 23:12:26 +01:00
Holger Hans Peter Freyther dca725b368 osmocom: Introduce META_TELEPHONY_OSMO_INC to easily bump version
For libosmocore updates we need a nice way to rebuild all libraries
using it. This can be done using the META_TELEPHONY_OSMO_INC variable.
2011-12-11 22:08:19 +01:00
Holger Hans Peter Freyther f58538edcd asterisk: Remove the CONFFILES that are not provided here 2011-12-11 21:38:31 +01:00
Holger Hans Peter Freyther 9d9e971a87 task: Add a task to build everything in this layer
Add a task to build test everything that is in this layer.
2011-12-11 17:36:35 +01:00
Holger Hans Peter Freyther f75ebc3f4b meta-toolchain-osmo: Include without direct addresssing
Use the BBPATH to find the recipe instead of assuming where this
layer has been placed.
2011-12-11 15:20:51 +01:00
Holger Hans Peter Freyther 447e9fa77d conf: Introduce the conf/layer.conf to make it work as a layer 2011-12-11 15:19:18 +01:00
Scott Rifenbark adcf8bf7b5 documentation/adt-manual/adt-prepare.xml: Fixed bad URL for edison tarball
The URL for the edision tarball was old and had been locked down in
the manual too early.  It changed and now this fixes it.

(From yocto-docs rev: 8790b84e3a2d04e557f048e30085813a1e8fb003)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-25 15:26:48 +00:00
Scott Rifenbark fda17235fd documentation/dev-manual/dev-manual-newbie.xml: Updates to Bugzilla use
I updated the Bug Tracking section to include rudimentary use of
Bugzilla for entering a new bug.

Fixes [YOCTO #237]

(From yocto-docs rev: 425965d7562f990c1f46901220caf4d79313336a)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-25 15:26:37 +00:00
Holger Hans Peter Freyther 8083eb0be3 openggsn: Remove the ggsn.conf in CONFFILES as the file is not here 2011-11-14 20:41:20 +08:00
Holger Hans Peter Freyther 1d9cbe012b libosmocore: Build the latest git version of libosmocore 2011-11-11 22:15:00 +08:00
Holger Hans Peter Freyther 0b0ef8aae6 lcr: Introduce 1.10 of LCR with a custom start script for it. 2011-11-11 21:41:31 +08:00
Holger Hans Peter Freyther 6fe3d67299 misdn: Build the userspace library
Apply a local patch to increase the the buffer size, on different
platforms the kernel structs have holes that this calculation did
not account for.
2011-11-11 21:37:15 +08:00
Holger Hans Peter Freyther b49f5121bb libgsm: Introduce libgsm-1.0.13 recipe for LCR/mISDN 2011-11-11 21:36:15 +08:00
Holger Hans Peter Freyther f52b4a6ba8 asterisk: Introduce asterisk recipe for 1.8.7.0 2011-11-11 21:34:38 +08:00
Holger Hans Peter Freyther ba3023edbc ggsn: Remove the empty config file this should come from the machine integration
The integrator should install a config as he can decide on the IP
addresses and policy to be used.
2011-11-11 21:34:38 +08:00
Holger Hans Peter Freyther 60ee4cd504 Add existing sysmocom recipes 2011-11-11 21:26:06 +08:00
Scott Rifenbark c5bdef5617 documentation/adt-manual/adt-prepare.xml: Fixed broken link
Michael Tomer from Koko Fitclub reported that the link to the
ADT Installer tarball was broken.  Fixed the link.

As Reported by: Michael Tomer <michael.tomer@kokofitclub.com>
(From yocto-docs rev: 0a78be08b9fd2223737c50f3d0d83d14f3099834)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-08 21:49:45 +00:00
Scott Rifenbark 77640e96dd documentation/yocto-project-qs/yocto-project-qs.xml: Robert P. J. Day Review
As Reported By:  Robert P. J. Day.

Community member Robert P. J. Day scrubbed the Quick Start manual for Release
1.1.  He found several areas that were incorrect.  Many items were documented
pre-release and changed during the actual realeas.  Naming conventions for
images and such had to be changed.  Robert also found and suggested several
wording changes that resulted in clearer text.

I was not able to patch all the changes using the 'patch' command.  I need to
work out some process issues still in order to apply patches directly to the
yocto-docs repository.  Meanwhile, I hand-inserted the changes.  Also, some
text changes were modified slightly by me to conform to the books style, etc.

Kudos to Robert for such a detailed look at the YP Quick Start.

(From yocto-docs rev: 50145cde42b6203412dbba227cde300d5b10111b)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-08 21:49:29 +00:00
Scott Rifenbark 98d9b82759 documentation/yocto-project-qs/yocto-project-qs.xml: dyslexic statement fixed.
I somehow had that having a host with multiple cores and threads could
be used to increase the build time.  It obviously should have been
"decrease".  Kudos to Bill Fishburn for finding this goof.

(From yocto-docs rev: 8ca44aab26d4a48745dbd0cbaffa0fe9b28d7063)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-31 22:38:17 +00:00
Scott Rifenbark 1aac5c310f documentation/yocto-project-qs/yocto-project-qs.xml: fix tarball URL
Community member Robert P.J. Day pointed out that the URL used to
reference the Edison tarball in the manual was incorrect.  It was
pointing to the old Poky area and not the Yocto-1.1 area.  I have
updated the example 'wget' command with the correct URL.

(From yocto-docs rev: 402500c03a625dd7e2561775926e3a983daa0ab6)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-31 22:38:09 +00:00
Scott Rifenbark 1924f52cc8 documentation/adt-manual/adt-eclipse.xml: Added missing section for plug-in
Discovered a missing section for installation of the Eclipse Yocto Plug-in.
This information is critical to the release.  Jessica discovered the problem.
New section added that describes how to install the plug-in as a standard
"New Software" installation from within the Eclipse IDE.

(From yocto-docs rev: d4976ec56d39813a72519387897023f65a5884f6)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-14 00:33:59 +01:00
Scott Rifenbark 6535ba6077 documentation/adt-manual/adt-eclipse.xml: fixed indigo typos
(From yocto-docs rev: cd2fe81bf9fe9fe4cc463861b62278654e7fff78)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-14 00:33:56 +01:00
Scott Rifenbark eae4945a9d documentation: Cleaned out bad links and replaced with good
The re-structuring of the web server that holds the documents created
some bad links.  I thought I had gotten them all but apparently not.
this is a drawback of not being able to test things until after stuff
is done.  In any case, I grepped through everything and this takes
care of it.

(From yocto-docs rev: cdbc3b3b7f6d6ff01024b977f966459cf414ad5c)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-14 00:33:56 +01:00
Scott Rifenbark 5ec43fdbb8 documentation/dev-manual: Fixed five broken links and removed note
The restructuring of the web site where we store manuals broke some
links that were cut-and-pasted in from older work.  These slipped by
me so not changing them would direct the user to a 1.0 version of
the externally referenced manual rather than the 1.1 version.

I also got rid of a visible "WRITER'S NOTE" in the document that
was left behind.

(From yocto-docs rev: 1508826312a2fe35e5d693821a4c7737baafcb2e)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-14 00:33:56 +01:00
Richard Purdie 5ed59ae0f2 local.conf.sample: Disable interactive patch resolution for now since doesn't work well
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-07 00:00:21 +01:00
Scott Rifenbark e02d553b45 documentation/dev-manual/dev-manual-kernel-appendix.xml: config example
I had to add some changes to the way we invoke qemu to show multiple
processor support.  I needed the qemuparam "-smp 2".  There are
other minor edits as well.

(From yocto-docs rev: 508863634ce537b0936f8e44f87b90bef678c122)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-06 18:51:26 +01:00
Scott Rifenbark 720446629b documentation/yocto-project-qs/yocto-project-qs.xml: release name and misc.
I somehow had either dreamed the word "einstein" into the release
for 1.1 and had it in there as part of the tarball name, etc.
I have replaced this obviously with "edison."

Other edits involved making the references to outside documents
more consistent.

(From yocto-docs rev: 2407b7dd89712c489d515e97d44e3c7dc0b64d20)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-06 18:51:21 +01:00
Scott Rifenbark db9d36f196 documentation/dev-manual/figures/kernel-example-repos.png: updated figure
Changed the pathnames for kernel 3.0 from 2.37

(From yocto-docs rev: 220ce5fbb3663940b5940445190d30d98f58a438)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-06 18:51:19 +01:00
Scott Rifenbark 4cca048ab8 documentation/dev-manual/dev-manual-kernel-appendix.xml: edits to the example
Some minor edits for the kernel example.

(From yocto-docs rev: 01e9f01662efad746fbfc34820b6efeb34affecd)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-06 18:51:15 +01:00
Scott Rifenbark 51b3d9dd53 documentation: Fixed links for yocto-1.1
After greping through the documentation directory, I addressed
all the <ulink> statements that used to have yocto-1.0 in the URL.
They are now yocto-1.1.

(From yocto-docs rev: 97d160263c5905fdeaf4ec285bc5359918790581)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-06 18:51:12 +01:00
Bruce Ashfield bc885cd8d3 linux-yocto: update live boot configuration
Updating the meta SRCREV to import a series of changes to synchronize
live booting between multiple targets:

  d05450e meta/fri2: enable booting from iso
  3da7d2a meta/fishriver: enable booting from iso
  52e1c49 meta/emenlow: enable booting from iso
  87918ae meta/crownbay: enable booting from iso

(From OE-Core rev: 7100c50c8697a3eec446b9189bf49ecbea9b7264)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-05 19:40:20 +01:00
Scott Rifenbark c657668a07 documentation/dev-manual/figures/wip.png: new figure added.
(From yocto-docs rev: f373d2b9f3530e31dc84b9333cfef93cdfd2c5e2)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 23:13:27 +01:00
Scott Rifenbark 02e3d4dc70 documentation/dev-manual/dev-manual-start.xml: console updates and tar update
I re-ran the exmaples to set up various Git repos and updated the output.

Also fixed a bad tarball name from edison-1.1 to edison-6.0

(From yocto-docs rev: 6538d588fa35986ff301a22d327af73c337ec43c)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 23:13:27 +01:00
Scott Rifenbark 57746012d0 documentation/dev-manual/dev-manual-kernel-appendix.xml: general updates
I made a pass through the book to clean up all areas in preparation to
running the examples again.  Most changes were punctuation, manual
section reference formats, and wordings.

(From yocto-docs rev: 0d054f79c82ddc204938dea187312d1a80d0a2e1)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 23:13:27 +01:00
Scott Rifenbark 8a48ec4297 documenation/Makefile: Added a "WIP" figure dev manual for future work.
(From yocto-docs rev: 90964c51b1cd848a7bb0ddce5dcfd0a0f8c86223)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 23:13:27 +01:00
Scott Rifenbark 61637a5241 documentation/dev-manual/dev-manual-bsp-appendix.xml: changes to references
More changes to the internal section references.  Using <link> rather than
<xref> to get rid of the section number in the reference.

(From yocto-docs rev: 4351fd4898c517e25235611893b1cd059cbcc2f8)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 23:13:27 +01:00
Scott Rifenbark 8a475908b5 documenation/dev-manual/dev-manual-bsp-appendix.xml: fixed reference form
I am using a certain form to reference other sections in the current
or other manual.  I updated the references to follow this form.

(From yocto-docs rev: 2ba41ac2f355dbe66af19e356f9246b7485585b5)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 23:13:27 +01:00
Scott Rifenbark b7d2cf0525 documentation/dev-manual/dev-manual-bsp-appendix.xml: fixed typo.
(From yocto-docs rev: a66bb0402dd3f1499278277486e482b573a97777)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 23:13:27 +01:00
Khem Raj 4d7fbeda35 runqemu-export-rootfs: Add HOW-TO for ubuntu 11.10 for rpcbind problem
The existing instruction to tackle
RPC: Authentication error; why = Client credential too weak
Are not applicable to ubuntu 11.10 especially

Therefore add the magic needed for ubuntu 11.10

(From OE-Core rev: faae191e8c1920745e0ea9abf7b8b26eb4561096)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 23:11:39 +01:00
Scott Rifenbark baf536c62c documentation/adt-manual: changes for Jessica's review.
I made several changes based on feedback from Jessica Zhang.

1. Removed "SDKVERSION" as a way of identifying the directory in
   which a toolchain tarball is installed.  I replaced with "1.1"

2. Cleaned up the bitbake command verbage to consistently use
   'bitbake' command.

3. Cleaned up an erroneous reference to the toolchain environment
   setup scripts.  I was referring the user to the oe-init-build-env
   area.

4. Changed wording to indicate that the toolchain tarball is generated
   after running bitbake rather than installing the toolchain.

5. Replaced the gmae tarball file used in an example to be the
   regular taball.

(From yocto-docs rev: f7c3e4f4a666121a29825099d451eab1accb0616)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:41 +01:00
Scott Rifenbark 0c48a6805e documentation/dev-manual/dev-manual-start.xml: Updates for 1.1 repos names
I changed the bernard examples used when creating Git repos to reflect
the edison release.

(From yocto-docs rev: d345cb08905e7f5e21b1649af5e876317cc68931)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:41 +01:00
Scott Rifenbark 1ea2c63bf5 documentation/dev-manual/dev-manual-bsp-appendix.xml: scrubbed example
I changed several small things in the example as I worked through it
once again.  The commit IDs changed for using the atom-pc kernel.
Also the command to build the sato image can no longer use 'live'.

(From yocto-docs rev: faff1e7f21b5059dfe708c6a3d83116c7349fe55)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:41 +01:00
Scott Rifenbark f33f49a348 documentation/adt-manual/adt-eclipse.xml: edits to zip section
No need to use the long command to restart Eclipse.  It will have
been restarted as part of the procedure.  I updated the last paragraph
to simply point the user off to the next section.

(From yocto-docs rev: bca280e74f81a0401c520c8a59e9e07e16f28b8b)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:41 +01:00
Scott Rifenbark cc6819ede7 documentation/adt-manual/adt-eclipse.xml: updates to zip method of plugin install.
These changes are for installing the YP Eclipse plug-in using a built out
ZIP file.

(From yocto-docs rev: ea50f63d448b4ff6026a9334440058511782461d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:41 +01:00
Scott Rifenbark 2a68be025b documentation/poky-ref-manual/extendpoky.xml: multilib edits
Feedback from Richard Purdie inserted.  I made an edit pass for
style to Richard's re-write.

(From yocto-docs rev: e5bb08e966614c610e6357642b3b2d1522332f7f)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark f05471dcf8 documentation/adt-manual/adt-eclipse.xml: edits to the config steps
I made some slight edits to configuring the Eclipse IDE and the
procedure to install the plug-in from the zip file.  This is not
complete yet.

(From yocto-docs rev: 96de3d21946d64e6b877f067912da8677c3d373a)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark 5fe2c53493 documentation/kernel-manual/kernel-how-to.xml: Updated build strategy
This section used the term "tree construction" somewhat out of context.
The section really focuses on what the build process and the user does
prior to compilation.  I changed wording to indicate the tree is
validated to be sure that the SRC_URI point to the right stuff and
that the BSP build branch exists.

(From yocto-docs rev: e6332d5045b21354b53bbbe1203f9d52d4d97964)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark 6b2ae5fd17 documentation/adt-manual/adt-prepare.xml: updates to getting images.
Made a few corrections to the section describing how to build
the tcf-agent into non-sdk images.

(From yocto-docs rev: e78dc3b3d3dd443506e78651cf9673358577c21d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark 4eeeded4a7 documentation/adt-manual/adt-prepare.xml: Updated for building tcf-agent
The YP only ships one pre-built image that has the tcf-agent built
into it - core-image-sato-sdk.  There are a couple methods that exist
to create images that do not normally have this agent so that they
will have it.  I updated the "Getting the Images" section to
contain those steps.  Lianhao and Jessica Zhang were the technical
resources for these changes.  These changes are the first draft.

(From yocto-docs rev: 85432e4892c3fe924bf90961f89e8edfd9693e84)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark 931db10bd0 documentation/poky-ref-manual/extendpoky.xml: Multilib section added
I created a section on how to prepare for and use the multilib
feature.  The information is leveraged off the "Multilib" wiki page
at http://wiki.yoctoproject.org/wiki/Multilib.  This is the first
draft of the changes.  I expect corrections.

(From yocto-docs rev: 8cf41c90f772018f4f144d63df911912cc298d70)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark 522268be49 documentation/adt-manual/adt-prepare.xml: changed link
Updated a link that was an autobuilder link to be
http://www.yoctoproject.org/downloads/yocto-1.1/machines.

(From yocto-docs rev: 91a4056a285b53f8c73494e8af88d9a98d6d61e0)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark 8e17bffa42 documentation: Updated title pages.
Updated the title pages for the ADT, BSP, Dev, and Ref manuals to
contain the Oct 6 release date for the books.  Also, changed the
author field for the BSP guide to include Tom Zanussi as well
as Richard Purdie.

(From yocto-docs rev: 301da0a5b305e4b332397bb67f6a6a77751991d2)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark cc004358f1 documentation/poky-ref-manual/ref-variables.xml: updated KERNEL_FEATURES
(From yocto-docs rev: 37a9cea71139ceda1d2a7da639f5555414ef497b)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark 0e623482d5 documentation/kernel-manual: Added some references to other areas of YP docs.
(From yocto-docs rev: 20754cb376e65b7262b754afad839e0c2b82d7f7)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:40 +01:00
Scott Rifenbark ec31ee62d5 documentation/kernel-manual: Scrub for 1.1
I went through and made sure examples are relevant, wording is correct,
large blocks of unused text was removed, and some references included
to other YP documents.

(From yocto-docs rev: 2231082530dd9cecc234f5f024c4e246afb2968d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:39 +01:00
Scott Rifenbark a59ca8316b documentation/poky-ref-manual/ref-variables.xml: updates to KERNEL_FEATURES.
(From yocto-docs rev: ec1e2d71c576fe1c12031371de89a71770cebb1d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:39 +01:00
Scott Rifenbark 4423b5b024 documentation/poky-ref-manual/ref-variables.xml: Added KERNEL_FEATURES
Added this variable description in the glossary.

(From yocto-docs rev: 12a9e5b4dfc399ff2037355aa1062f907a62e76d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:39 +01:00
Scott Rifenbark b47f39dbc3 documentation/poky-ref-manual/faq.xml: Removed wording that focues on GNOME
Per Paul Eggleton he suggested that the wording we had about YP focusing
on the GNOME Mobile environment was misleading now.  It was in there in the
original version of the FAQ but with time has become outdated.  I simply
removed the "GNOME" part and left the part that mentions about YP
being a stable
environment and well-suited for the embedded mobile environment.

(From yocto-docs rev: cc7103eda3fd77d89cecfffa23f0f798aa512132)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:39 +01:00
Scott Rifenbark 9d72b706fa documentation/bsp-guide/bsp.xml: Added recipes-core section
In the example I use for the BSP structure I use the Crown Bay
BSP.  I neglected to include any explanation of the recipes-core
directory.  I have added some description around this area.

(From yocto-docs rev: ba56c86e5a4aa3fbf23b12d26ffe35a3b6193a78)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:39 +01:00
Scott Rifenbark 5d4888723b documentation/yocto-project-qs/yocto-project-qs.xml: Supported Distros updated
I updated the section on the supported distribution section by including
a link to the wiki page that shows what distros we have tested and
their status.

(From yocto-docs rev: e66a18a13dc02af6a0846dd1ecf14aeafcbe5d61)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:39 +01:00
Scott Rifenbark 49e3171850 documentation/adt-manual/adt-eclipse.xml: Added zip method for plug-in install
I added a new subsection to the section that talks about how to install
the YP eclipse plug-in.  According the Jessica, we should document
this method for installing the plug-in.

(From yocto-docs rev: dea5b1dacc16c08d61356e95bece2aec581dd16d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:39 +01:00
Scott Rifenbark 66ddb69916 documentation/poky-ref-manual/ref-variables.xml: Variables updated
This is the second pass for re-documenting RDEPENDS, RRECOMMENDS,
MACHINE_ESSENTIALS_EXTRA_RDEPENDS, MACHINE_ESSENTIALS_EXTRA_RRECOMMENDS,
MACHINE_EXTRA_RDEPENDS, and MACHINE_EXTRA_RRECOMMENDS.  These
variables are in dire need of better explanations and examples.

(From yocto-docs rev: cc60bd4c50c7b19209dae06307aec26e962cf476)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:39 +01:00
Scott Rifenbark de1dcde413 documentation/poky-ref-manual: Updates to several variables.
I did complete rewrites of RDEPENDS, RRECOMMENDS,
MACHINE_ESSENTIAL_EXTRA_RDEPENDS, MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS,
MACHINE_EXTRA_RDEPENDS, and MACHINE_EXTRA_RRECOMMENDS.  These are
sent out for review but these changes represent the first attempt
to clear up confusion on how the six variables are used and relate
to each other.

(From yocto-docs rev: 1d93707fb9383d51322e96eb521e96fcac8bcc47)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:39 +01:00
Scott Rifenbark 9f36b1fe16 documentation/poky-ref-manual/ref-variables.xml: update RDEPENDS and RRECOMMENDS
Provided better descriptions of these variables and some examples on
how to use them.

(From yocto-docs rev: 3a5cce8c9ba02f90b3554a6f800f69c2e8e77911)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark 38c7a8a069 documentation/poky-ref-manual/ref-variables.xml: update PREFERRED_VERSION
Added a more robust description and provided a couple of usage
examples.

(From yocto-docs rev: b8b842b57cc003f1351a551041fe4b3de2fcbfd6)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark 23bac7cb0e documentation/poky-ref-manual/ref-variables.xml: update PREFERRED_PROVIDER
I added sterner wording on usage and provided an example.

(From yocto-docs rev: 32e07fafadb602b93c9f7b8a78e5baf4c7e1ab5e)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark 0021456aad documentation/poky-ref-manual/ref-variables.xml: update TCLIBC and POKYLIBC
Changed the description of POKYLIBC to note the variable is not supported
and provided a link to TCLIBC.  I added the entry for TCLIBC, which
was missing.

(From yocto-docs rev: d76a1ddb79577a3e121df3d590fb601b5e5fbb98)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark a568995f40 documentation/poky-ref-manual/ref-variables.xml: updates TCMODE and POKYMODE
Noted that POKYMODE is no longer supported and provided link to TCMODE.
Added richer description to TCMODE.

(From yocto-docs rev: a7a326c2c8f4c5f29f3a9723a6895a7113a78357)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark f82ac840aa documentation/poky-ref-manual/ref-variables.xml: edits to FILESYSTEM_PERMS_TABLES.
Some minor re-wordings to give some context on how to use these special
files and the variable to point to them.

(From yocto-docs rev: 4482b42f4a224bada7a0fa5fe4821a753ba55d80)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark cd2c80dedc documentation/dev-manual/dev-manual-newbie.xml: added information for licenses
I added the directory where the list of know licenses are in the YP
files structure (meta/files/common-licenses).

(From yocto-docs rev: 6a8db1a5ac653dbc8730e61293221c0b0890888d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark ed93525e65 documentation/poky-ref-manual/ref-variables.xml: updated RDEPENDS
Per Paul Eggleton's suggestion I updated the description of this
variable.  Some minor wording changes as well as covering two
automatic handling features.

(From yocto-docs rev: 15be3502ca20f657051e02d698b459328328fb14)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark 4025831e90 documentation: scrubbed out 'glibc' and replaced with 'eglibc'
Several manuals and areas were still referring to 'glibc' as the
GNU version of the Unix statndrd C library.  We do not support this
any longer and now use 'eglibc' to build with.  Notable changes were
in the required packages area of the QS manual.  I also added a
bit in the reference guide saying how this release does not use
'glibc' to build with but rather 'eglibc'.

(From yocto-docs rev: c2c58914996d747c510706d78ecfd8f41c5e694d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark 94c381f71b documentation/poky-ref-manual/extendpoky.xml: New section on static library
I added a new section to the "Adding a Package" section.  This section
describes how to define the *.a files for when you create a library
that has static linking.  Response to a comment from Paul Eggleton.

(From yocto-docs rev: 64499006ecd1e6b7573f1955a2f6e2f1a9564ce8)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:38 +01:00
Scott Rifenbark 588e21b339 documentation/poky-ref-manual/ref-variables.xml: added FILESYSTEM_PERMS_TABLES
New glossary variable entry added.

(From yocto-docs rev: f9a214fa7714b9ca4741ac0c56d40e2d8a390292)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 14:01:37 +01:00
Richard Purdie 3429095e86 package_rpm: Ensure multilib code is only called in the multilib case
This fixes some error messages in the do_rootfs logs of non-multilib
builds.

(From OE-Core rev: fb554596e031cf92b62a19cabdd10e8e23ab4453)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:31 +01:00
Richard Purdie feb11f1079 populate_sdk_rpm: Add missing /bin/sh from rpm ignore list for the SDK
The target SDK packages don't need to fulfil a shell dependency
so add /bin/sh to the list of packages we don't need to resolve.

(From OE-Core rev: 9283255da08f45a368fa9355dbafd3840dfd5056)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:31 +01:00
Richard Purdie fbec475275 Remove help2man dependency
The help2man script is pretty useless to us. It requires to run the target
binary to extract help information which is not possible for any of our
cross compiled target binaries.

We're not interested in man pages for -cross/-native tools.

It therefore makes no sense to have this as a core build dependency.

This patch removes the dependeny and replaces it with a script
returning false. This will trigger autotool's missing utility
to use the copy of the man page included with the sources which
is what would already happen when we tried to run cross compiled
binaries anyway.

(From OE-Core rev: c6e0f23363f24ae9f02cd753621ce45470285b16)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:31 +01:00
Dongxiao Xu 317fc4fbd0 multilib: add MLPREFIX to deploy folder
Add MLPREFIX to multilib deploy forlder to avoid the confliction between
multilib and normal package deploy directory.

(From OE-Core rev: b5e8cad5a782015f2216325203847c287c778cac)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:31 +01:00
Dongxiao Xu 909dd5b306 tune-i586: fix hardcoded TUNE_PKGARCH
Use TUNE_FEATURES to determine the setting to TUNE_PKGARCH, which fixes
the wrong setting of PACKAGE_ARCH in multilib case.

(From OE-Core rev: d8051ce1af7a5a4b72c1f772ed35eff24a4beb6b)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:31 +01:00
Jessica Zhang 24623d149d Fixed a typo for setting up OECORE_ACLOCAL_OPTS for adt-installer case
(From OE-Core rev: 0e042e3650c3e940ff17465d6bd835e22d85f1f6)

Signed-off-by: Jessica Zhang <jessica.zhang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:30 +01:00
Dongxiao Xu 5687f68f3e libc-package.bbclass: add MLPREFIX when set values to PACKAGES
There are some places that PACKAGES are dynamically set. To support
multilib, we need to add MLPREFIX before the package name in those
settings.

(From OE-Core rev: 98d356a9f788291c849be7b51fcd8ad07a8a066e)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:30 +01:00
Dongxiao Xu f282b7a027 package_rpm: combine normal and multilib solution manifest together
When RPM does the real install, if the first manifest file is empty, the
installation will stop without handling the second manifest file.

Merge the two manifest files together to fix this issue.

(From OE-Core rev: 20e6f166858751c6305cd8a52f87cdf78c1a8126)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:30 +01:00
Dongxiao Xu 32b1c9150f multilib: remove the multilib handling to allarch
currently we have allarch type of recipes, which may still have
architecture dependency, like x11-common. So we need to drop the
handling to allarch in multilib case.

Also remove the PV postfix in python-pygobject DEPENDS, since multilib
code will treat a native package multilib capable.

[YOCTO #1497]
[YOCTO #1498]

(From OE-Core rev: d9dc64a251bc66f16a0c5d12aa872152d43c4776)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:30 +01:00
Dongxiao Xu 7a541d69dd multilib.bbclass: map RDEPENDS and LINGUAS_INSTALL for image recipes
RDEPENDS of image type recipe needs to be mapped to make sure that the
packages included in the image should be multilib version.

Also add LINGUAS_INSTALL into MULTILIB_PACKAGE_INSTALL list.

[YOCTO #1496]
[YOCTO #1527]

(From OE-Core rev: ad52cf921b2e08f2a99f494b229d5b7099b33990)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:29 +01:00
Joshua Lock aa1cb68ce2 ghostscript: disable check for time.h
ghostscript has it's own hacky check for time.h which hard-codes paths, this
means in the native case it fails on systems such as Ubuntu 11.10 where the
location of time.h has changed. Further it means the target build has had a
host-intrusion issue.

This patch disables the check for time.h, future releases of ghostscript
use standard autotools checks for time.h's location.

(From OE-Core rev: 59746f706fd71b58268745309dfa54b87ccdb967)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:29 +01:00
Saul Wold dc1f3a3bd0 zypper & sat-solver: needs RDEPENDS on rpm-lib
(From OE-Core rev: f8fe4ef09d6ab037928850bbb953e2b0a2da49e9)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:29 +01:00
Saul Wold 5fbb040355 rpm: ensure that magic file is relocatable
rpm-native was reading from /usr/share/misc/magic which is wrong
it needs to be set to read from the sysroot.  This also adds wrappers
to the rpm-build tools to ensure they know were to find the macros that
point to the right directories.

Fixes [YOCTO #1532]

(From OE-Core rev: 7ea42eadf8aec734202b70ba2427230e63749d94)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:59:29 +01:00
Bruce Ashfield 9886c510f9 linux-yocto/meta: eg20t and live boot config changes
Merging the following configuration changes:

 67a46a6 meta/common-pc-64: enable live booting for common-pc-64
 1010905 meta/common-pc: enable live booting for common-pc
 b3c5fa7 meta/atom-pc: enable live booting for atom-pc
 41c090e meta: update boot live config and move it to cfg/
 d51b0e7 eg20t: update config options

The first 4 make the live-boot configuration shared and then reuse
them for the boards that currently are live bootable. The eg20t
is a cleanup of obselete kernel options and is part of the cleanup
of options for the 3.0 kernel.

[YOCTO: #940]
[YOCTO: #686]

(From OE-Core rev: 4482970401a048433d5a862bfed4936259dcfcf5)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:57:52 +01:00
Paul Eggleton 49de6096b1 beagleboard-audio: fix RDEPENDS on alsa-utils-amixer
Use RDEPENDS_${PN} instead of RDEPENDS.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-04 13:48:33 +01:00
Paul Eggleton 7eb193fc49 bitbake/lib/bb/msg.py: fix setting debug and verbosity levels
The debug and verbosity levels (as set by the -D and -v command line
options respectively)  were not being passed through within msg.py since
bitbake revision 45aad2f9647df14bcfa5e755b57e1ddab377939a due to
incorrect variable names.

Fixes [YOCTO #1513].

(Bitbake rev: c6e88b7c0e61f9586a275df53f48b90687c5f92f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-26 19:35:58 +01:00
Joshua Lock 4aa6a8e9a6 hob: store recipe path at load time
This fixes the internal dirtiness tracking such that if the Save menu item
is selected after loading a recipe the existing file is updated rather than
the user being prompted for the path to create a recipe at.

(Bitbake rev: 00fc1d7249b5e217cc7c36ac71b63ddad1c5b769)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-26 19:35:47 +01:00
Joshua Lock a1f3aff110 hob: fix building with current selections after reparse
After the reparse we were setting the model to reflect the values before
the reparse was triggered but clearing the internal variables used to test
whether these values are set, leading to the UI erroneously reporting that
selections had not been made.

(Bitbake rev: 656eafe0f2c9ec7730d33e15705b8c720f787c49)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-26 19:35:36 +01:00
Joshua Lock bb351c2f41 ui/crumbs/hobeventhandler: fix variable name typo
(Bitbake rev: f7d0560307707fe10bf80820f1e6ae300864f915)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-26 19:35:23 +01:00
Joshua Lock bed552f8d0 ui/crumbs/hobeventhandler: move remaining getVariable calls to init
Instead of calling getVariable commands each time the BBPATH and BBFILES
entries need testing cache the results as a member variable at object
instantiation.

Fixes [YOCTO #1521]

(Bitbake rev: 109e1597671dfb7222672e268190aabc727960ca)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-26 19:35:11 +01:00
Scott Rifenbark 41c564fe60 documentation/poky-ref-manual/ref-classes.xml: documented useradd.bbclass
New section per Paul Eggleton's request.

(From yocto-docs rev: ffedb53e5c706cffb83978f1704a606d29233e36)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:25 +01:00
Scott Rifenbark cae817e833 documentation/poky-ref-manual/ref-variables.xml: added BAD_RECOMMENDATIONS
New variable for images that use the ipkg packaging system.  These
are packages you don't want to install even when the recipe calls
for it.

(From yocto-docs rev: 78d53b5da4bbd6889a34be8a1c795a5658cb6b1e)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:25 +01:00
Scott Rifenbark 7bb8b8f438 documentation/poky-ref-manual/ref-classes.xml: fixed insane.bbclass added others
I fixed the insane.bbclass description to say that it checks for common
problemos that occur during runtime and not build time.  Also got rid of the
"ever-increasing" statement as that is not true according to Paul Eggleton.

Added many new .bbclass files to the commented out section of the
undocumented classes as well as removed a bunch.

(From yocto-docs rev: c341951185d5af6576718f8ada057afcca923e6e)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:24 +01:00
Scott Rifenbark c32652716d documenation/poky-ref-manual/ref-variables.xml: debug-tweaks qualified
I noted that the developer should remove this option from
EXTRA_IMAGE_FEATURES before they create a production image.

(From yocto-docs rev: 8de6c789d1a1ed5e721c16f53bb27de18ae88238)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:24 +01:00
Scott Rifenbark 748fd4543b documentation/adt-manual/adt-command.xml: Note about running configure
YOCTO #1504: Added a note indicating what to do if the configure
script complains about --with-libtool-sysroot option.

(From yocto-docs rev: 575f4057ddfc2774a62bf349fd05d62b79dd278b)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:24 +01:00
Scott Rifenbark 56f7ed979c documentation/dev-manual/dev-manual-model.xml: edit pass
These changes are the second edit pass for the new section.
There are some minor changes.

(From yocto-docs rev: 6c81617a2782d2f02d4900a68dd4e8c6eeb70fa1)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:24 +01:00
Scott Rifenbark 3a15c9f8d0 documentation/dev-manual/figures/app-dev-flow.png: Updated app flow image
(From yocto-docs rev: 5c0c04ccc2d1fdac89dc1394805e4b8c4cc2c082)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:23 +01:00
Scott Rifenbark fc7ceaead0 documentation/dev-manual: Added TM to first Eclipse in chapters.
(From yocto-docs rev: 0f8b655da637ebf7708bdfff1473707c9ea3b8ef)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:23 +01:00
Scott Rifenbark a626a5c208 documentation/dev-manual/dev-manual-model.xml: Edits and start of app section.
General edits up through the BSP and Kernel overview sections.  I also put
in place holder text and began on the application development over
section.

(From yocto-docs rev: 9c1b681ff253b469bffc355f0a938643997d85d4)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:23 +01:00
Scott Rifenbark cb333ad6f3 documentation/dev-manual/dev-manual-kernel-appendix.xml: added line break
There is an example whose output exceeds the PDF manual version's
page width.  I had to artificially break the line up.

(From yocto-docs rev: d8a5714a2f8193c1efc8a7080b8f6e0744da610a)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:23 +01:00
Scott Rifenbark 5b58674c6b documentation/dev-manual: model changes and updated figure
Edits to the dev-manual-model.xml chapter for general improvements.
Also had to update the figure that shows the kernel development flow.

(From yocto-docs rev: 2aacccb03d167eac74a1b45c39a9edac160efc7f)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:23 +01:00
Scott Rifenbark 1017d2aec8 documentation/dev-manual/dev-manual-newbie.xml: note for maintainer
Added a note indicating where you can find the maintainer for yocto
code.  Suggestion by Robert Berger.

(From yocto-docs rev: 8e55cc4c460582964b0267b4f43c14e7100f17fe)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:22 +01:00
Scott Rifenbark 9786db045f documentation/dev-manual/dev-manual-kernel-appendix.xml: Robert Berger feedback.
somehow I lost three or four changes that are credited to Robert
Berger (Community Member).  I have re-introduced them here.

(From yocto-docs rev: a23564ada0e072bea63739aeb1eb5c66d595e728)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:22 +01:00
Scott Rifenbark 158b84844e documentation/dev-manual/dev-manual-newbie.xml: addes link to commit page
I provided a link to the OpenEmbedded wiki page created by Mark Hatle
that provides good guidelines on how to create well-formed commit
messages.

(From yocto-docs rev: ea7b0100a7b45c369cb67daa0705dcc5acef40c8)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:22 +01:00
Scott Rifenbark 421c22d32c documentation/dev-manual/dev-manual-newbie.xml: edits and enhancements.
General pass-through for consistency in referencing sections.
Also, added Darren Hart's review comments for the "Submitting a
Change" section.  I added more about the mailing lists and how to
submit a proper commit message.

(From yocto-docs rev: d9c8f5db8c862b1be724915cc43da6d12b88b97d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:21 +01:00
Scott Rifenbark 90ccadecc3 documentation/poky-ref-manual/resources.xml: Updates to mailing lists.
I updated the mailing lists to be more specific and to be formatted
differently.

(From yocto-docs rev: 50b5cf2d331b120cfa9de0ba77ea1da1240d42e4)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:21 +01:00
Scott Rifenbark 07638448b0 documentation/dev-manual/dev-manual-start.xml: formats and re-wordings.
Applied consistent section referencing formats.  Also cleaned up some
terminolgy for the YP Git repo.

(From yocto-docs rev: fa3cbb835b61158357d3f6fb9ebe017b9ba405cf)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:21 +01:00
Scott Rifenbark f343aa4cc6 documentation/dev-manual/dev-manual-intro.xml: minor edits.
Some indentations applied.  Also, a few minor changes to some
wordings.

(From yocto-docs rev: a166f41a5bbf3590d8a2fabbee267bdd190f19dd)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:21 +01:00
Scott Rifenbark 5cd07954ea documentation/dev-manual/dev-manual-intro.xml: re-wrote the intro paragraphs.
(From yocto-docs rev: 5091b7c62c61b4c9ea14fb7a77cc4600437a9dbb)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:21 +01:00
Scott Rifenbark e0338b844f documentation/yocto-project-qs/yocto-project-qs.xml: Fixed text for filesystem
I needed to reference the image differently for the pre-built section.

(From yocto-docs rev: 10568a0a8c4160af995089e481ccc2772e81d805)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:20 +01:00
Scott Rifenbark cde57ddf84 documentation/yocto-project-qs/yocto-project-qs.xml: General edits
This was a final scrub of the manual.  I updated all examples and links
to be current for what I think will be the 1.1 release.  I also added
some cross-referencing into the YP dev manual that now exist.

(From yocto-docs rev: 4c10b0e04856817a1d03aee7a9ed6e4d5d73a3ac)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:20 +01:00
Scott Rifenbark bee5046908 documentation/adt-manual/adt-eclipse.xml: various minor clean ups.
(From yocto-docs rev: 6caabfaed1ec440511727e163b9c3bb7afe966ae)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:20 +01:00
Scott Rifenbark 4e6b4c09a5 documentation/adt-manual/adt-prepare.xml: fixed broken cross-link.
(From yocto-docs rev: 90f6bd0aff8346df24d691e0c9424a0a99af2095)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:20 +01:00
Scott Rifenbark 89496194ba documentation/adt-manual/adt-prepare.xml: applied Jessica Zhang revisions
These changes reflect corrections resulting from Jessica Zhang's review
of the sections.

(From yocto-docs rev: c3fed39bc3909c38424e7e72c40471dcb0053c8d)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:19 +01:00
Scott Rifenbark 19f9b25947 documentation/adt-manual/adt-prepare.xml: Title correction
(From yocto-docs rev: 536665ac8b28426f2869ceffca3ea2f6f4d1eef4)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:19 +01:00
Scott Rifenbark f97e445fc6 documentation/adt-manual/adt-prepare.xml: toolchain enhancements
After working through this stuff I was still confused as to how to
guide the user toward proper toolchain installation and on what they
needed to do for collecting their kernel and filesystem images.
These changes included some information on when and how to extract
the rootfs when the user is booting to NFS.  Plus some other
general items like the significance of meta-toolchain-sdk as
compared to meta-toolchain.

(From yocto-docs rev: 2cc88b5193888a074ffd87cb253b9cfe08146877)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:19 +01:00
Scott Rifenbark 2766a88a3b documentation/adt-manual/adt-prepare.xml: removed terms
I had definitions for "The Yocto Project Files" and "The Yocto
Project Build Tree" in this chapter.  They were misplaced.  I have
deleted them and moved them to the development manual.

(From yocto-docs rev: 9238e75abc4578043fd625b3796b86d42204e16f)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:19 +01:00
Scott Rifenbark b57c529115 documentation/dev-manual/dev-manual-newbie.xml: new terms
I moved the terms "Yocto Project Files" and "Yocto Project Build
Tree" into this development manual.  They were previous defined
in the ADT manual.  It makes more sense to have them where with other
terms.

(From yocto-docs rev: 2133110fd280db8cfbe998e6b46cdee0b260e777)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:18 +01:00
Scott Rifenbark 319f4ee481 documentation/adt-manual/adt-eclipse.xml: Fixed the section formatting.
I made changes to the section titles so they have quotes around them
for easier reading in the PDF manual.

(From yocto-docs rev: 5bea470682c3d834f30ab0d2fcba148ea33d653f)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:18 +01:00
Scott Rifenbark 2cf26ef150 documentation/adt-manual/adt-eclipse.xml: writer note and re-wording
I added a development writer note and I noted that running a project
as an eclipse application pops a new instance of Eclipse.

(From yocto-docs rev: 6408ff7f4d59a0e535e560c7c0c63a3f373c640b)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:18 +01:00
Scott Rifenbark 2c1b5b1054 documentation/adt-manual/adt-prepare.xml: writer notes and section format
I added a couple of writer notes for development purposes.  I also
formated the section title references so they have quotes around them
for easier reading in the PDF verison.

(From yocto-docs rev: 37adb580cf6c1369da43fc4ef7aaa4cc1cee0e5c)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:18 +01:00
Scott Rifenbark b8be92c34d documentation/adt-manual/adt-eclipse.xml: minor edits
fixed some section naming conventions and minor wordings.

(From yocto-docs rev: 768d386c135c57ed3573e08bac72cad47fa101ce)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:17 +01:00
Scott Rifenbark 6b4133b08f documentation/poky-ref-manual/resources.xml: re-wrote Contributions
The information in the "Contributions" section has been migrated to
a "Submitting a Change" section in the YP Development Manual.
I re-wrote this section here to simply make a general statement
about how you can submit a change and then provided a reference
link to the appropriate section in the dev manual.

(From yocto-docs rev: 038caebb2815a8f09d35e99d5a2a0be76b05cacf)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:17 +01:00
Scott Rifenbark 96d43c2410 documentation/dev-manual/dev-manual-newbie.xml: re-write change submit
The section on submitting a change was very sparse and incomplete.
I have significantly upgraded this section to provide more details.

(From yocto-docs rev: af43bb1e4902c45afb5ac4b0f099877acd7a81a2)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:57:17 +01:00
Richard Purdie cde2aa61cf neon: Add libproxy to DEPENDS to ensure determinstic builds
(From OE-Core rev: ed2a606909b9490ac57a3ad3db7a15e83a8664f9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:56:35 +01:00
Richard Purdie 1d18aeafa6 libsndfile1: Disable external codec librbaries since we don't list in DEPENDS
(From OE-Core rev: 34a14ce3ea78be299175e1a803f92519aa02355b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:56:24 +01:00
Richard Purdie b8a67d3000 cairo: Disable bfd symbol loopup since we don't list it in DEPENDS
(From OE-Core rev: ac8b7e275a8789b6605ef84a3b128aea2518b596)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:56:15 +01:00
Richard Purdie c3c8084855 gtk+: Explicitly disable xinerama since we don't have it as a DEPENDS
(From OE-Core rev: dbc25ca76d482f30186562fc51f5b3bdf48c0a7b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:56:06 +01:00
Richard Purdie cd0ef4d7c1 gnome-desktop: Ensure we're deterministic about startup-notification dependency
Without this change we may or may not include startup-notification support.

We therefore explictly include it in the dependency list.

(From OE-Core rev: 8ad24306d8bc9c2fd73f4b814eb1a64c04707da5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 17:56:00 +01:00
Saul Wold c9e35a126a attr/acl: add SSTATEPOSTINSTFUNC
Added a native sstate post install function to fix the links
created between /lib and /usr/lib for the library files. These
links could point to an invalid build area when using shared state.

(From OE-Core rev: 8ab7b681cdb43c6c21c187b8cd01faa39727824a)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-25 15:28:27 +01:00
Richard Purdie 4456226e45 populate_sdk_rpm: add pkgconfig(pkg-config) to the list
(From OE-Core rev: 368b150416688654e35229a63b87177b52e83d02)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-23 19:57:13 +01:00
Saul Wold bf8f071c5b populate_sdk_rpm: add items to the INSTALL_PROVIDESNAME_RPM list
This fixes a problem when building meta-toolchain-gmae, by adding items that
will be provided by the host system, such as /bin/bash, /usr/bin/env and
libGL.so

(From OE-Core rev: 01361f9d25b0a0027bbbe713b93051a4663b14fc)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
RP: libGL.so() -> libGL.so
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-23 01:08:17 +01:00
Elizabeth Flanagan 3b1e8a214e poky.conf: flipping DISTRO_VERSION and DISTRO_NAME
In preparation for the final edison buildout, flipping DISTRO*

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
2011-09-22 16:28:12 -07:00
Darren Hart 1015dfce8d intltool: add libxml-parser-perl-native dependency to -native version
Fixes [YOCTO #1514]

Without a native dependency on libxml-parser-perl-native,
shared-mime-info-native can fail its do_configure task.

checking for XML::Parser... configure: error: XML::Parser perl module is
required for intltool

Testing: Successfully built shared-mime-info and shared-mime-info-native for
qemuppc.

(From OE-Core rev: 51b1df89828e677232e125181209b26d3c5ec928)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Joshua Lock <josh@linux.intel.com>
CC: Richard Purdie <richard.purdie@linuxfoundation.org>
CC: Koen Kooi <koen@dominion.thruhere.net>
CC: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22 22:28:10 +01:00
Richard Purdie a0b1c14587 multilib.bbclass: Partially fix multlib image targets
This patch partially fixes problems when building multilib extended
images such as libXX-core-image-minimal. Its not a perfect/complete
solution but works much better than any previous code did.

[YOCTO #1496] (partial)
[YOCTO #1497] (partial)
[YOCTO #1498] (partial)

(From OE-Core rev: 00c38774ef0232cc2be924ed8e59220e7c452096)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22 22:28:10 +01:00
Dexuan Cui 66934fc311 qemu-config: use pkg_postinst to generate the proper shutdown.desktop
[YOCTO #1507]

We need to remove the file qemuarm/shutdown.desktop, or else, on qemuarm,
due to the PACKAGE_ARCH overriding from all to qemuarm in base.bbclass,
the generated deb file will be stored at
tmp/deploy/deb/qemuarm/qemu-config_1.0-r21_allarch.deb rather than
tmp/deploy/deb/all/qemu-config_1.0-r21_all.deb, and the package qemu-config
won't be installable -- task-base finally rdepends on qemu-config, so we get
the do_rootfs failure:

The following packages have unmet dependencies:
|   task-base-extended: Depends: task-base but it is not going to be installed
| E: Broken packages

There is also a generic shutdown.desktop, we can keep it and use a proper
pkg_postinst to cope with the case of qemuarm.

(From OE-Core rev: 751212d5effdceab91d95705e647cf07e6820940)

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22 22:28:10 +01:00
Richard Purdie 80de0f946b diffstat: Add missing file from previous commit
(From OE-Core rev: 6f4e6d6d41f874844b186b9e5b63a1b851becb52)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22 22:28:10 +01:00
Richard Purdie 5e65389335 diffstat: Fix a build failure when using libdir=/usr/lib64
(From OE-Core rev: 9a846d83a39339de6d7cc0da050a50d7f4e093c7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22 22:28:10 +01:00
Zhai Edwin d513e5f92c qemugl: Use local variable rather than "push" to save register
New gcc uses "%esp" rather than "%ebp" to index local variable in stack, and
push between save-to/restore-from stack decrease "%esp", which leads wrong
index. Saving registers via local variables to make gcc aware of this and avoid
stack disorder.

[YOCTO #1442] got fixed

(From OE-Core rev: afc9edc27e77e80fdd24b4c8c538f91672940e75)

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22 22:28:09 +01:00
Saul Wold e9f8b99215 gnome-desktop: Fix python path in scripts to use target path
(From OE-Core rev: 22fd67f854f70f79ea94af11c61ef63939d54ac2)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22 22:28:09 +01:00
7738 changed files with 420516 additions and 552545 deletions

27
.gitignore vendored
View File

@ -1,27 +1,20 @@
*.pyc
*.pyo
/*.patch
/build*/
pyshtables.py
build*/conf/local.conf
build*/conf/bblayers.conf
build*/downloads
build*/tmp/
build*/sstate-cache
build*/pyshtables.py
pstage/
scripts/oe-git-proxy-socks
sources/
meta-*/
!meta-*
!meta-skeleton
!meta-selftest
hob-image-*.bb
!meta-demoapps
*.swp
*.orig
*.rej
*~
!meta-poky
!meta-yocto
!meta-yocto-bsp
!meta-yocto-imported
documentation/user-manual/user-manual.html
documentation/user-manual/user-manual.pdf
documentation/user-manual/user-manual.tgz
pull-*/
bitbake/lib/toaster/contrib/tts/backlog.txt
bitbake/lib/toaster/contrib/tts/log/*
bitbake/lib/toaster/contrib/tts/.cache/*

View File

@ -1,2 +0,0 @@
# Template settings
TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf}

16
LICENSE
View File

@ -1,14 +1,14 @@
Different components of OpenEmbedded are under different licenses (a mix
of MIT and GPLv2). Please see:
Different components of Poky are under different licenses (a mix of
MIT and GPLv2). Please see:
meta/COPYING.GPLv2 (GPLv2)
bitbake/COPYING (GPLv2)
meta/COPYING.MIT (MIT)
meta-selftest/COPYING.MIT (MIT)
meta-skeleton/COPYING.MIT (MIT)
meta-extras/COPYING.MIT (MIT)
All metadata is MIT licensed unless otherwise stated. Source code
included in tree for individual recipes is under the LICENSE stated in
the associated recipe (.bb file) unless otherwise stated.
which cover the components in those subdirectories. This means all
metadata is MIT licensed unless otherwise stated. Source code included
in tree for individual recipes is under the LICENSE stated in the .bb
file for those software projects unless otherwise stated.
License information for any other files is either explicitly stated
or defaults to GPL version 2.

37
README
View File

@ -18,41 +18,8 @@ e.g. for the hardware support. Poky is in turn a component of the Yocto Project.
The Yocto Project has extensive documentation about the system including a
reference manual which can be found at:
http://yoctoproject.org/documentation
http://yoctoproject.org/community/documentation
OpenEmbedded-Core is a layer containing the core metadata for current versions
of OpenEmbedded. It is distro-less (can build a functional image with
DISTRO = "nodistro") and contains only emulated machine support.
For information about OpenEmbedded, see the OpenEmbedded website:
For information about OpenEmbedded see their website:
http://www.openembedded.org/
Where to Send Patches
=====================
As Poky is an integration repository (built using a tool called combo-layer),
patches against the various components should be sent to their respective
upstreams:
bitbake:
Git repository: http://git.openembedded.org/bitbake/
Mailing list: bitbake-devel@lists.openembedded.org
documentation:
Git repository: http://git.yoctoproject.org/cgit/cgit.cgi/yocto-docs/
Mailing list: yocto@yoctoproject.org
meta-poky, meta-yocto-bsp:
Git repository: http://git.yoctoproject.org/cgit/cgit.cgi/meta-yocto(-bsp)
Mailing list: poky@yoctoproject.org
Everything else should be sent to the OpenEmbedded Core mailing list. If in
doubt, check the oe-core git repository for the content you intend to modify.
Before sending, be sure the patches apply cleanly to the current oe-core git
repository.
Git repository: http://git.openembedded.org/openembedded-core/
Mailing list: openembedded-core@lists.openembedded.org
Note: The scripts directory should be treated with extra care as it is a mix of
oe-core and poky-specific files.

View File

@ -1,34 +1,28 @@
Poky Hardware README
====================
This file gives details about using Poky with the reference machines
supported out of the box. A full list of supported reference target machines
can be found by looking in the following directories:
meta/conf/machine/
meta-yocto-bsp/conf/machine/
If you are in doubt about using Poky/OpenEmbedded with your hardware, consult
the documentation for your board/device.
This file gives details about using Poky with different hardware reference
boards and consumer devices. A full list of target machines can be found by
looking in the meta/conf/machine/ directory. If in doubt about using Poky with
your hardware, consult the documentation for your board/device.
Support for additional devices is normally added by creating BSP layers - for
more information please see the Yocto Board Support Package (BSP) Developer's
Guide - documentation source is in documentation/bspguide or download the PDF
from:
http://yoctoproject.org/documentation
http://yoctoproject.org/community/documentation
Support for physical reference hardware has now been split out into a
meta-yocto-bsp layer which can be removed separately from other layers if not
needed.
Support for machines other than QEMU may be moved out to separate BSP layers in
future versions.
QEMU Emulation Targets
======================
To simplify development, the build system supports building images to
work with the QEMU emulator in system emulation mode. Several architectures
are currently supported:
To simplify development Poky supports building images to work with the QEMU
emulator in system emulation mode. Several architectures are currently
supported:
* ARM (qemuarm)
* x86 (qemux86)
@ -36,40 +30,32 @@ are currently supported:
* PowerPC (qemuppc)
* MIPS (qemumips)
Use of the QEMU images is covered in the Yocto Project Reference Manual.
The appropriate MACHINE variable value corresponding to the target is given
in brackets.
Use of the QEMU images is covered in the Poky Reference Manual. The Poky
MACHINE setting corresponding to the target is given in brackets.
Hardware Reference Boards
=========================
The following boards are supported by the meta-yocto-bsp layer:
The following boards are supported by Poky's core layer:
* Texas Instruments Beaglebone (beaglebone)
* Texas Instruments Beagleboard (beagleboard)
* Freescale MPC8315E-RDB (mpc8315e-rdb)
* Ubiquiti Networks RouterStation Pro (routerstationpro)
For more information see the board's section below. The appropriate MACHINE
variable value corresponding to the board is given in brackets.
For more information see the board's section below. The Poky MACHINE setting
corresponding to the board is given in brackets.
Reference Board Maintenance
===========================
Send pull requests, patches, comments or questions about meta-yocto-bsps to poky@yoctoproject.org
Maintainers: Kevin Hao <kexin.hao@windriver.com>
Bruce Ashfield <bruce.ashfield@windriver.com>
Consumer Devices
================
The following consumer devices are supported by the meta-yocto-bsp layer:
The following consumer devices are supported by Poky's core layer:
* Intel x86 based PCs and devices (genericx86)
* Ubiquiti Networks EdgeRouter Lite (edgerouter)
* Intel Atom based PCs and devices (atom-pc)
For more information see the device's section below. The appropriate MACHINE
variable value corresponding to the device is given in brackets.
For more information see the device's section below. The Poky MACHINE setting
corresponding to the device is given in brackets.
@ -77,29 +63,22 @@ variable value corresponding to the device is given in brackets.
===============================
Intel x86 based PCs and devices (genericx86*)
=============================================
Intel Atom based PCs and devices (atom-pc)
==========================================
The genericx86 and genericx86-64 MACHINE are tested on the following platforms:
The atom-pc MACHINE is tested on the following platforms:
Intel Xeon/Core i-Series:
+ Intel NUC5 Series - ix-52xx Series SOC (Broadwell)
+ Intel NUC6 Series - ix-62xx Series SOC (Skylake)
+ Intel Shumway Xeon Server
o Asus EeePC 901
o Acer Aspire One
o Toshiba NB305
o Intel Embedded Development Board 1-N450 (Black Sand)
Intel Atom platforms:
+ MinnowBoard MAX - E3825 SOC (Bay Trail)
+ MinnowBoard MAX - Turbot (ADI Engineering) - E3826 SOC (Bay Trail)
- These boards can be either 32bot or 64bit modes depending on firmware
- See minnowboard.org for details
+ Intel Braswell SOC
and is likely to work on many unlisted Atom/Core/Xeon based devices. The MACHINE
type supports ethernet, wifi, sound, and Intel/vesa graphics by default in
addition to common PC input devices, busses, and so on.
and is likely to work on many unlisted Atom based devices. The MACHINE type
supports ethernet, wifi, sound, and i915 graphics by default in addition to
common PC input devices, busses, and so on.
Depending on the device, it can boot from a traditional hard-disk, a USB device,
or over the network. Writing generated images to physical media is
or over the network. Writing poky generated images to physical media is
straightforward with a caveat for USB devices. The following examples assume the
target boot device is /dev/sdb, be sure to verify this and use the correct
device as the following commands are run as root and are not reversable.
@ -107,7 +86,7 @@ device as the following commands are run as root and are not reversable.
USB Device:
1. Build a live image. This image type consists of a simple filesystem
without a partition table, which is suitable for USB keys, and with the
default setup for the genericx86 machine, this image type is built
default setup for the atom-pc machine, this image type is built
automatically for any image you build. For example:
$ bitbake core-image-minimal
@ -115,11 +94,10 @@ USB Device:
2. Use the "dd" utility to write the image to the raw block device. For
example:
# dd if=core-image-minimal-genericx86.hddimg of=/dev/sdb
# dd if=core-image-minimal-atom-pc.hddimg of=/dev/sdb
If the device fails to boot with "Boot error" displayed, or apparently
stops just after the SYSLINUX version banner, it is likely the BIOS cannot
understand the physical layout of the disk (or rather it expects a
If the device fails to boot with "Boot error" displayed, it is likely the BIOS
cannot understand the physical layout of the disk (or rather it expects a
particular layout and cannot handle anything else). There are two possible
solutions to this problem:
@ -127,50 +105,123 @@ USB Device:
device, but the idea is to force BIOS to read the Cylinder/Head/Sector
geometry from the device.
2. Use a ".wic" image with an EFI partition
2. Without such an option, the BIOS generally boots the device in USB-ZIP
mode.
a) With a default grub-efi bootloader:
# dd if=core-image-minimal-genericx86-64.wic of=/dev/sdb
a. Configure the USB device for USB-ZIP mode:
# mkdiskimage -4 /dev/sdb 0 63 62
b) Use systemd-boot instead
- Build an image with EFI_PROVIDER="systemd-boot" then use the above
dd command to write the image to a USB stick.
Where 63 and 62 are the head and sector count as reported by fdisk.
Remove and reinsert the device to allow the kernel to detect the new
partition layout.
b. Copy the contents of the poky image to the USB-ZIP mode device:
# mount -o loop core-image-minimal-atom-pc.hddimg /tmp/image
# mount /dev/sdb4 /tmp/usbkey
# cp -rf /tmp/image/* /tmp/usbkey
c. Install the syslinux boot loader:
# syslinux /dev/sdb4
Install the boot device in the target board and configure the BIOS to boot
from it.
For more details on the USB-ZIP scenario, see the syslinux documentation:
http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob_plain;f=doc/usbkey.txt;hb=HEAD
Texas Instruments Beaglebone (beaglebone)
=========================================
Texas Instruments Beagleboard (beagleboard)
===========================================
The Beaglebone is an ARM Cortex-A8 development board with USB, Ethernet, 2D/3D
accelerated graphics, audio, serial, JTAG, and SD/MMC. The Black adds a faster
CPU, more RAM, eMMC flash and a micro HDMI port. The beaglebone MACHINE is
tested on the following platforms:
The Beagleboard is an ARM Cortex-A8 development board with USB, DVI-D, S-Video,
2D/3D accelerated graphics, audio, serial, JTAG, and SD/MMC. The xM adds a
faster CPU, more RAM, an ethernet port, more USB ports, microSD, and removes
the NAND flash. The beagleboard MACHINE is tested on the following platforms:
o Beaglebone Black A6
o Beaglebone A6 (the original "White" model)
o Beagleboard C4
o Beagleboard xM rev A & B
The Beaglebone Black has eMMC, while the White does not. Pressing the USER/BOOT
button when powering on will temporarily change the boot order. But for the sake
of simplicity, these instructions assume you have erased the eMMC on the Black,
so its boot behavior matches that of the White and boots off of SD card. To do
this, issue the following commands from the u-boot prompt:
The Beagleboard C4 has NAND, while the xM does not. For the sake of simplicity,
these instructions assume you have erased the NAND on the C4 so its boot
behavior matches that of the xM. To do this, issue the following commands from
the u-boot prompt (note that the unlock may be unecessary depending on the
version of u-boot installed on your board and only one of the erase commands
will succeed):
# mmc dev 1
# mmc erase 0 512
# nand unlock
# nand erase
# nand erase.chip
To further tailor these instructions for your board, please refer to the
documentation at http://www.beagleboard.org/bone and http://www.beagleboard.org/black
documentation at http://www.beagleboard.org.
From a Linux system with access to the image files perform the following steps:
From a Linux system with access to the image files perform the following steps
as root, replacing mmcblk0* with the SD card device on your machine (such as sdc
if used via a usb card reader):
1. Build an image. For example:
1. Partition and format an SD card:
# fdisk -lu /dev/mmcblk0
Disk /dev/mmcblk0: 3951 MB, 3951034368 bytes
255 heads, 63 sectors/track, 480 cylinders, total 7716864 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 63 144584 72261 c Win95 FAT32 (LBA)
/dev/mmcblk0p2 144585 465884 160650 83 Linux
$ bitbake core-image-minimal
# mkfs.vfat -F 16 -n "boot" /dev/mmcblk0p1
# mke2fs -j -L "root" /dev/mmcblk0p2
2. Use the "dd" utility to write the image to the SD card. For example:
The following assumes the SD card partition 1 and 2 are mounted at
/media/boot and /media/root respectively. Removing the card and reinserting
it will do just that on most modern Linux desktop environments.
The files referenced below are made available after the build in
build/tmp/deploy/images.
# dd core-image-minimal-beaglebone.wic of=/dev/sdb
2. Install the boot loaders
# cp MLO-beagleboard /media/boot/MLO
# cp u-boot-beagleboard.bin /media/boot/u-boot.bin
3. Install the root filesystem
# tar x -C /media/root -f core-image-$IMAGE_TYPE-beagleboard.tar.bz2
# tar x -C /media/root -f modules-$KERNEL_VERSION-beagleboard.tgz
4. Install the kernel uImage
# cp uImage-beagleboard.bin /media/boot/uImage
5. Prepare a u-boot script to simplify the boot process
The Beagleboard can be made to boot at this point from the u-boot command
shell. To automate this process, generate a user.scr script as follows.
Install uboot-mkimage (from uboot-mkimage on Ubuntu or uboot-tools on Fedora).
Prepare a script config:
# (cat << EOF
setenv bootcmd 'mmc init; fatload mmc 0:1 0x80300000 uImage; bootm 0x80300000'
setenv bootargs 'console=tty0 console=ttyO2,115200n8 root=/dev/mmcblk0p2 rootwait rootfstype=ext3 ro'
boot
EOF
) > serial-boot.cmd
# mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Core Minimal" -d ./serial-boot.cmd ./boot.scr
# cp boot.scr /media/boot
6. Unmount the SD partitions, insert the SD card into the Beagleboard, and
boot the Beagleboard
Note: As of the 2.6.37 linux-yocto kernel recipe, the Beagleboard uses the
OMAP_SERIAL device (ttyO2). If you are using an older kernel, such as the
2.6.34 linux-yocto-stable, be sure to replace ttyO2 with ttyS2 above. You
should also override the machine SERIAL_CONSOLE in your local.conf in
order to setup the getty on the serial line:
SERIAL_CONSOLE_beagleboard = "115200 ttyS2"
3. Insert the SD card into the Beaglebone and boot the board.
Freescale MPC8315E-RDB (mpc8315e-rdb)
=====================================
@ -190,8 +241,8 @@ Setup instructions
You will need the following:
* NFS root setup on your workstation
* TFTP server installed on your workstation
* Straight-thru 9-conductor serial cable (DB9, M/F) connected from your
PC to UART1
* Null modem cable connected from your workstation to the first serial port
on the board
* Ethernet connected to the first ethernet port on the board
--- Preparation ---
@ -203,82 +254,13 @@ linux/arch/powerpc/boot/dts/mpc8315erdb.dts within the kernel source). If
you have left them at the factory default then you shouldn't need to do
anything here.
Note: To boot from USB disk you need u-boot that supports 'ext2load usb'
command. You need to setup TFTP server, load u-boot from there and
flash it to NOR flash.
Beware! Flashing bootloader is potentially dangerous operation that can
brick your device if done incorrectly. Please, make sure you understand
what below commands mean before executing them.
Load the new u-boot.bin from TFTP server to memory address 200000
=> tftp 200000 u-boot.bin
Disable flash protection
=> protect off all
Erase the old u-boot from fe000000 to fe06ffff in NOR flash.
The size is 0x70000 (458752 bytes)
=> erase fe000000 fe06ffff
Copy the new u-boot from address 200000 to fe000000
the size is 0x70000. It has to be greater or equal to u-boot.bin size
=> cp.b 200000 fe000000 70000
Enable flash protection again
=> protect on all
Reset the board
=> reset
--- Booting from USB disk ---
1. Flash partitioned image to the USB disk
# dd if=core-image-minimal-mpc8315e-rdb.wic of=/dev/sdb
2. Plug USB disk into the MPC8315 board
3. Connect the board's first serial port to your workstation and then start up
your favourite serial terminal so that you will be able to interact with
the serial console. If you don't have a favourite, picocom is suggested:
$ picocom /dev/ttyUSB0 -b 115200
4. Power up or reset the board and press a key on the terminal when prompted
to get to the U-Boot command line
5. Optional. Load the u-boot.bin from the USB disk:
=> usb start
=> ext2load usb 0:1 200000 u-boot.bin
and flash it to NOR flash as described above.
6. Set fdtaddr and loadaddr. This is not necessary if you set them before.
=> setenv fdtaddr a00000
=> setenv loadaddr 1000000
7. Load the kernel and dtb from first partition of the USB disk:
=> usb start
=> ext2load usb 0:1 $loadaddr uImage
=> ext2load usb 0:1 $fdtaddr dtb
8. Set bootargs and boot up the device
=> setenv bootargs root=/dev/sdb2 rw rootwait console=ttyS0,115200
=> bootm $loadaddr - $fdtaddr
--- Booting from NFS root ---
Load the kernel and dtb (device tree blob), and boot the system as follows:
1. Get the kernel (uImage-mpc8315e-rdb.bin) and dtb (uImage-mpc8315e-rdb.dtb)
files from the tmp/deploy directory, and make them available on your TFTP
server.
files from the Poky build tmp/deploy directory, and make them available on
your TFTP server.
2. Connect the board's first serial port to your workstation and then start up
your favourite serial terminal so that you will be able to interact with
@ -297,133 +279,169 @@ Load the kernel and dtb (device tree blob), and boot the system as follows:
5. Download the kernel and dtb, and boot:
=> tftp 1000000 uImage-mpc8315e-rdb.bin
=> tftp 2000000 uImage-mpc8315e-rdb.dtb
=> bootm 1000000 - 2000000
--- Booting from JFFS2 root ---
1. First boot the board with NFS root.
2. Erase the MTD partition which will be used as root:
$ flash_eraseall /dev/mtd3
3. Copy the JFFS2 image to the MTD partition:
$ flashcp core-image-minimal-mpc8315e-rdb.jffs2 /dev/mtd3
4. Then reboot the board and set up the environment in U-Boot:
=> setenv bootargs root=/dev/mtdblock3 rootfstype=jffs2 console=ttyS0,115200
=> tftp 800000 uImage-mpc8315e-rdb.bin
=> tftp 780000 uImage-mpc8315e-rdb.dtb
=> bootm 800000 - 780000
Ubiquiti Networks EdgeRouter Lite (edgerouter)
==============================================
Ubiquiti Networks RouterStation Pro (routerstationpro)
======================================================
The EdgeRouter Lite is part of the EdgeMax series. It is a MIPS64 router
(based on the Cavium Octeon processor) with 512MB of RAM, which uses an
internal USB pendrive for storage.
The RouterStation Pro is an Atheros AR7161 MIPS-based board. Geared towards
networking applications, it has all of the usual features as well as three
type IIIA mini-PCI slots and an on-board 3-port 10/100/1000 Ethernet switch,
in addition to the 10/100/1000 Ethernet WAN port which supports
Power-over-Ethernet.
Setup instructions
------------------
You will need the following:
* RJ45 -> serial ("rollover") cable connected from your PC to the CONSOLE
port on the device
* Ethernet connected to the first ethernet port on the board
* A serial cable - female to female (or female to male + gender changer)
NOTE: cable must be straight through, *not* a null modem cable.
* USB flash drive or hard disk that is able to be powered from the
board's USB port.
* tftp server installed on your workstation
If using NFS as part of the setup process, you will also need:
* NFS root setup on your workstation
* TFTP server installed on your workstation (if fetching the kernel from
TFTP, see below).
NOTE: in the following instructions it is assumed that /dev/sdb corresponds
to the USB disk when it is plugged into your workstation. If this is not the
case in your setup then please be careful to substitute the correct device
name in all commands where appropriate.
--- Preparation ---
Build an image (e.g. core-image-minimal) using "edgerouter" as the MACHINE.
In the following instruction it is based on core-image-minimal. Another target
may be similiar with it.
1) Build an image (e.g. core-image-minimal) using "routerstationpro" as the
MACHINE
--- Booting from NFS root / kernel via TFTP ---
2) Partition the USB drive so that primary partition 1 is type Linux (83).
Minimum size depends on your root image size - core-image-minimal probably
only needs 8-16MB, other images will need more.
Load the kernel, and boot the system as follows:
# fdisk /dev/sdb
Command (m for help): p
1. Get the kernel (vmlinux) file from the tmp/deploy/images/edgerouter
directory, and make them available on your TFTP server.
Disk /dev/sdb: 4011 MB, 4011491328 bytes
124 heads, 62 sectors/track, 1019 cylinders, total 7834944 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009e87d
2. Connect the board's first serial port to your workstation and then start up
your favourite serial terminal so that you will be able to interact with
the serial console. If you don't have a favourite, picocom is suggested:
Device Boot Start End Blocks Id System
/dev/sdb1 62 1952751 976345 83 Linux
$ picocom /dev/ttyS0 -b 115200
3) Format partition 1 on the USB as ext3
3. Power up or reset the board and press a key on the terminal when prompted
to get to the U-Boot command line
# mke2fs -j /dev/sdb1
4. Set up the environment in U-Boot:
4) Mount partition 1 and then extract the contents of
tmp/deploy/images/core-image-XXXX.tar.bz2 into it (preserving permissions).
=> setenv ipaddr <board ip>
=> setenv serverip <tftp server ip>
# mount /dev/sdb1 /media/sdb1
# cd /media/sdb1
# tar -xvjpf tmp/deploy/images/core-image-XXXX.tar.bz2
5. Download the kernel and boot:
5) Unmount the USB drive and then plug it into the board's USB port
=> tftp tftp $loadaddr vmlinux
=> bootoctlinux $loadaddr coremask=0x3 root=/dev/nfs rw nfsroot=<nfsroot ip>:<rootfs path> ip=<board ip>:<server ip>:<gateway ip>:<netmask>:edgerouter:eth0:off mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)
6) Connect the board's serial port to your workstation and then start up
your favourite serial terminal so that you will be able to interact with
the serial console. If you don't have a favourite, picocom is suggested:
--- Booting from USB disk ---
$ picocom /dev/ttyUSB0 -b 115200
To boot from the USB disk, you either need to remove it from the edgerouter
box and populate it from another computer, or use a previously booted NFS
image and populate from the edgerouter itself.
7) Connect the network into eth0 (the one that is NOT the 3 port switch). If
you are using power-over-ethernet then the board will power up at this point.
Type 1: Use partitioned image
-----------------------------
8) Start up the board, watch the serial console. Hit Ctrl+C to abort the
autostart if the board is configured that way (it is by default). The
bootloader's fconfig command can be used to disable autostart and configure
the IP settings if you need to change them (default IP is 192.168.1.20).
Steps:
9) Make the kernel (tmp/deploy/images/vmlinux-routerstationpro.bin) available
on the tftp server.
1. Remove the USB disk from the edgerouter and insert it into a computer
that has access to your build artifacts.
10) If you are going to write the kernel to flash (optional - see "Booting a
kernel directly" below for the alternative), remove the current kernel and
rootfs flash partitions. You can list the partitions using the following
bootloader command:
2. Flash the image.
RedBoot> fis list
# dd if=core-image-minimal-edgerouter.wic of=/dev/sdb
You can delete the existing kernel and rootfs with these commands:
3. Insert USB disk into the edgerouter and boot it.
RedBoot> fis delete kernel
RedBoot> fis delete rootfs
Type 2: NFS
-----------
--- Booting a kernel directly ---
Note: If you place the kernel on the ext3 partition, you must re-create the
ext3 filesystem, since the factory u-boot can only handle 128 byte inodes and
cannot read the partition otherwise.
1) Load the kernel using the following bootloader command:
These boot instructions assume that you have recreated the ext3 filesystem with
128 byte inodes, you have an updated uboot or you are running and image capable
of making the filesystem on the board itself.
RedBoot> load -m tftp -h <ip of tftp server> vmlinux-routerstationpro.bin
You should see a message on it being successfully loaded.
1. Boot from NFS root
2) Execute the kernel:
2. Mount the USB disk partition 2 and then extract the contents of
tmp/deploy/core-image-XXXX.tar.bz2 into it.
RedBoot> exec -c "console=ttyS0,115200 root=/dev/sda1 rw rootdelay=2 board=UBNT-RSPRO"
Before starting, copy core-image-minimal-xxx.tar.bz2 and vmlinux into
rootfs path on your workstation.
Note that specifying the command line with -c is important as linux-yocto does
not provide a default command line.
and then,
# mount /dev/sda2 /media/sda2
# tar -xvjpf core-image-minimal-XXX.tar.bz2 -C /media/sda2
# cp vmlinux /media/sda2/boot/vmlinux
# umount /media/sda2
# reboot
--- Writing a kernel to flash ---
3. Reboot the board and press a key on the terminal when prompted to get to the U-Boot
command line:
1) Go to your tftp server and gzip the kernel you want in flash. It should
halve the size.
# reboot
2) Load the kernel using the following bootloader command:
4. Load the kernel and boot:
RedBoot> load -r -b 0x80600000 -m tftp -h <ip of tftp server> vmlinux-routerstationpro.bin.gz
This should output something similar to the following:
Raw file loaded 0x80600000-0x8087c537, assumed entry at 0x80600000
Calculate the length by subtracting the first number from the second number
and then rounding the result up to the nearest 0x1000.
3) Using the length calculated above, create a flash partition for the kernel:
RedBoot> fis create -b 0x80600000 -l 0x240000 kernel
(change 0x240000 to your rounded length -- change "kernel" to whatever
you want to name your kernel)
--- Booting a kernel from flash ---
To boot the flashed kernel perform the following steps.
1) At the bootloader prompt, load the kernel:
RedBoot> fis load -d -e kernel
(Change the name "kernel" above if you chose something different earlier)
(-e means 'elf', -d 'decompress')
2) Execute the kernel using the exec command as above.
--- Automating the boot process ---
After writing the kernel to flash and testing the load and exec commands
manually, you can automate the boot process with a boot script.
1) RedBoot> fconfig
(Answer the questions not specified here as they pertain to your environment)
2) Run script at boot: true
Boot script:
.. fis load -d -e kernel
.. exec
Enter script, terminate with empty line
>> fis load -d -e kernel
>> exec -c "console=ttyS0,115200 root=/dev/sda1 rw rootdelay=2 board=UBNT-RSPRO"
>>
3) Answer the remaining questions and write the changes to flash:
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xbfff0000-0xc0000000: .
... Program from 0x87ff0000-0x88000000 at 0xbfff0000: .
4) Power cycle the board.
=> ext2load usb 0:2 $loadaddr boot/vmlinux
=> bootoctlinux $loadaddr coremask=0x3 root=/dev/sda2 rw rootwait mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)

View File

@ -1,19 +0,0 @@
BitBake is licensed under the GNU General Public License version 2.0. See COPYING for further details.
The following external components are distributed with this software:
* The Toaster Simple UI application is based upon the Django project template, the files of which are covered by the BSD license and are copyright (c) Django Software
Foundation and individual contributors.
* Twitter Bootstrap (including Glyphicons), redistributed under the MIT license
* jQuery is redistributed under the MIT license.
* Twitter typeahead.js redistributed under the MIT license. Note that the JS source has one small modification, so the full unminified file is currently included to make it obvious where this is.
* jsrender is redistributed under the MIT license.
* QUnit is redistributed under the MIT license.
* Font Awesome fonts redistributed under the SIL Open Font License 1.1
* simplediff is distributed under the zlib license.

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
@ -23,34 +23,222 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import sys
import sys, logging
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),
'lib'))
import optparse
import warnings
from traceback import format_exception
try:
import bb
except RuntimeError as exc:
sys.exit(str(exc))
from bb import event
import bb.msg
from bb import cooker
from bb import ui
from bb import server
from bb import cookerdata
from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException
__version__ = "1.13.3"
logger = logging.getLogger("BitBake")
if sys.getfilesystemencoding() != "utf-8":
sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.")
__version__ = "1.34.0"
class BBConfiguration(object):
"""
Manages build options and configurations for one run
"""
def __init__(self, options):
for key, val in options.__dict__.items():
setattr(self, key, val)
self.pkgs_to_build = []
def get_ui(config):
if config.ui:
interface = config.ui
else:
interface = 'knotty'
try:
# Dynamically load the UI based on the ui name. Although we
# suggest a fixed set this allows you to have flexibility in which
# ones are available.
module = __import__("bb.ui", fromlist = [interface])
return getattr(module, interface).main
except AttributeError:
sys.exit("FATAL: Invalid user interface '%s' specified.\n"
"Valid interfaces: depexp, goggle, ncurses, knotty [default]." % interface)
# Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others"""
warnlog = logging.getLogger("BitBake.Warnings")
_warnings_showwarning = warnings.showwarning
def _showwarning(message, category, filename, lineno, file=None, line=None):
if file is not None:
if _warnings_showwarning is not None:
_warnings_showwarning(message, category, filename, lineno, file, line)
else:
s = warnings.formatwarning(message, category, filename, lineno)
warnlog.warn(s)
warnings.showwarning = _showwarning
warnings.filterwarnings("ignore")
warnings.filterwarnings("default", module="(<string>$|(oe|bb)\.)")
warnings.filterwarnings("ignore", category=PendingDeprecationWarning)
warnings.filterwarnings("ignore", category=ImportWarning)
warnings.filterwarnings("ignore", category=DeprecationWarning, module="<string>$")
warnings.filterwarnings("ignore", message="With-statements now directly support multiple context managers")
def main():
parser = optparse.OptionParser(
version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__),
usage = """%prog [options] [package ...]
Executes the specified task (default is 'build') for a given set of BitBake files.
It expects that BBFILES is defined, which is a space separated list of files to
be executed. BBFILES does support wildcards.
Default BBFILES are the .bb files in the current directory.""")
parser.add_option("-b", "--buildfile", help = "execute the task against this .bb file, rather than a package from BBFILES. Does not handle any dependencies.",
action = "store", dest = "buildfile", default = None)
parser.add_option("-k", "--continue", help = "continue as much as possible after an error. While the target that failed, and those that depend on it, cannot be remade, the other dependencies of these targets can be processed all the same.",
action = "store_false", dest = "abort", default = True)
parser.add_option("-a", "--tryaltconfigs", help = "continue with builds by trying to use alternative providers where possible.",
action = "store_true", dest = "tryaltconfigs", default = False)
parser.add_option("-f", "--force", help = "force run of specified cmd, regardless of stamp status",
action = "store_true", dest = "force", default = False)
parser.add_option("-c", "--cmd", help = "Specify task to execute. Note that this only executes the specified task for the providee and the packages it depends on, i.e. 'compile' does not implicitly call stage for the dependencies (IOW: use only if you know what you are doing). Depending on the base.bbclass a listtasks tasks is defined and will show available tasks",
action = "store", dest = "cmd")
parser.add_option("-r", "--read", help = "read the specified file before bitbake.conf",
action = "append", dest = "prefile", default = [])
parser.add_option("-R", "--postread", help = "read the specified file after bitbake.conf",
action = "append", dest = "postfile", default = [])
parser.add_option("-v", "--verbose", help = "output more chit-chat to the terminal",
action = "store_true", dest = "verbose", default = False)
parser.add_option("-D", "--debug", help = "Increase the debug level. You can specify this more than once.",
action = "count", dest="debug", default = 0)
parser.add_option("-n", "--dry-run", help = "don't execute, just go through the motions",
action = "store_true", dest = "dry_run", default = False)
parser.add_option("-S", "--dump-signatures", help = "don't execute, just dump out the signature construction information",
action = "store_true", dest = "dump_signatures", default = False)
parser.add_option("-p", "--parse-only", help = "quit after parsing the BB files (developers only)",
action = "store_true", dest = "parse_only", default = False)
parser.add_option("-s", "--show-versions", help = "show current and preferred versions of all packages",
action = "store_true", dest = "show_versions", default = False)
parser.add_option("-e", "--environment", help = "show the global or per-package environment (this is what used to be bbread)",
action = "store_true", dest = "show_environment", default = False)
parser.add_option("-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax",
action = "store_true", dest = "dot_graph", default = False)
parser.add_option("-I", "--ignore-deps", help = """Assume these dependencies don't exist and are already provided (equivalent to ASSUME_PROVIDED). Useful to make dependency graphs more appealing""",
action = "append", dest = "extra_assume_provided", default = [])
parser.add_option("-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
action = "append", dest = "debug_domains", default = [])
parser.add_option("-P", "--profile", help = "profile the command and print a report",
action = "store_true", dest = "profile", default = False)
parser.add_option("-u", "--ui", help = "userinterface to use",
action = "store", dest = "ui")
parser.add_option("-t", "--servertype", help = "Choose which server to use, none, process or xmlrpc",
action = "store", dest = "servertype")
parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
action = "store_true", dest = "revisions_changed", default = False)
options, args = parser.parse_args(sys.argv)
configuration = BBConfiguration(options)
configuration.pkgs_to_build.extend(args[1:])
ui_main = get_ui(configuration)
# Server type can be xmlrpc, process or none currently, if nothing is specified,
# the default server is process
if configuration.servertype:
server_type = configuration.servertype
else:
server_type = 'process'
try:
module = __import__("bb.server", fromlist = [server_type])
server = getattr(module, server_type)
except AttributeError:
sys.exit("FATAL: Invalid server type '%s' specified.\n"
"Valid interfaces: xmlrpc, process [default], none." % servertype)
# Save a logfile for cooker into the current working directory. When the
# server is daemonized this logfile will be truncated.
cooker_logfile = os.path.join(os.getcwd(), "cooker.log")
bb.msg.init_msgconfig(configuration.verbose, configuration.debug,
configuration.debug_domains)
# Ensure logging messages get sent to the UI as events
handler = bb.event.LogHandler()
logger.addHandler(handler)
# Before we start modifying the environment we should take a pristine
# copy for possible later use
initialenv = os.environ.copy()
# Clear away any spurious environment variables. But don't wipe the
# environment totally. This is necessary to ensure the correct operation
# of the UIs (e.g. for DISPLAY, etc.)
bb.utils.clean_environment()
server = server.BitBakeServer()
server.initServer()
idle = server.getServerIdleCB()
cooker = bb.cooker.BBCooker(configuration, idle, initialenv)
cooker.parseCommandLine()
server.addcooker(cooker)
server.saveConnectionDetails()
server.detach(cooker_logfile)
# Should no longer need to ever reference cooker
del cooker
logger.removeHandler(handler)
# Setup a connection to the server (cooker)
server_connection = server.establishConnection()
try:
return server.launchUI(ui_main, server_connection.connection, server_connection.events)
finally:
bb.event.ui_queue = []
server_connection.terminate()
return 1
if __name__ == "__main__":
if __version__ != bb.__version__:
sys.exit("Bitbake core version and program version mismatch!")
try:
sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
cookerdata.CookerConfiguration()))
except BBMainException as err:
sys.exit(err)
except bb.BBHandledException:
sys.exit(1)
ret = main()
except Exception:
ret = 1
import traceback
traceback.print_exc()
sys.exit(1)
traceback.print_exc(5)
sys.exit(ret)

View File

@ -1,162 +1,12 @@
#!/usr/bin/env python3
# bitbake-diffsigs
# BitBake task signature data comparison utility
#
# Copyright (C) 2012-2013, 2017 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#!/usr/bin/env python
import os
import sys
import warnings
import fnmatch
import argparse
import logging
import pickle
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
import bb.tinfoil
import bb.siggen
import bb.msg
logger = bb.msg.logger_create('bitbake-diffsigs')
def find_compare_task(bbhandler, pn, taskname, sig1=None, sig2=None, color=False):
""" Find the most recent signature files for the specified PN/task and compare them """
if not hasattr(bb.siggen, 'find_siginfo'):
logger.error('Metadata does not support finding signature data files')
sys.exit(1)
if not taskname.startswith('do_'):
taskname = 'do_%s' % taskname
if sig1 and sig2:
sigfiles = bb.siggen.find_siginfo(pn, taskname, [sig1, sig2], bbhandler.config_data)
if len(sigfiles) == 0:
logger.error('No sigdata files found matching %s %s matching either %s or %s' % (pn, taskname, sig1, sig2))
sys.exit(1)
elif not sig1 in sigfiles:
logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig1))
sys.exit(1)
elif not sig2 in sigfiles:
logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig2))
sys.exit(1)
latestfiles = [sigfiles[sig1], sigfiles[sig2]]
else:
filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-3:]
if not latestfiles:
logger.error('No sigdata files found matching %s %s' % (pn, taskname))
sys.exit(1)
elif len(latestfiles) < 2:
logger.error('Only one matching sigdata file found for the specified task (%s %s)' % (pn, taskname))
sys.exit(1)
# Define recursion callback
def recursecb(key, hash1, hash2):
hashes = [hash1, hash2]
hashfiles = bb.siggen.find_siginfo(key, None, hashes, bbhandler.config_data)
recout = []
if len(hashfiles) == 0:
recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2))
elif not hash1 in hashfiles:
recout.append("Unable to find matching sigdata for %s with hash %s" % (key, hash1))
elif not hash2 in hashfiles:
recout.append("Unable to find matching sigdata for %s with hash %s" % (key, hash2))
else:
out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb, color=color)
for change in out2:
for line in change.splitlines():
recout.append(' ' + line)
return recout
# Recurse into signature comparison
logger.debug("Signature file (previous): %s" % latestfiles[-2])
logger.debug("Signature file (latest): %s" % latestfiles[-1])
output = bb.siggen.compare_sigfiles(latestfiles[-2], latestfiles[-1], recursecb, color=color)
if output:
print('\n'.join(output))
sys.exit(0)
parser = argparse.ArgumentParser(
description="Compares siginfo/sigdata files written out by BitBake")
parser.add_argument('-d', '--debug',
help='Enable debug output',
action='store_true')
parser.add_argument('--color',
help='Colorize output (where %(metavar)s is %(choices)s)',
choices=['auto', 'always', 'never'], default='auto', metavar='color')
parser.add_argument("-t", "--task",
help="find the signature data files for last two runs of the specified task and compare them",
action="store", dest="taskargs", nargs=2, metavar=('recipename', 'taskname'))
parser.add_argument("-s", "--signature",
help="With -t/--task, specify the signatures to look for instead of taking the last two",
action="store", dest="sigargs", nargs=2, metavar=('fromsig', 'tosig'))
parser.add_argument("sigdatafile1",
help="First signature file to compare (or signature file to dump, if second not specified). Not used when using -t/--task.",
action="store", nargs='?')
parser.add_argument("sigdatafile2",
help="Second signature file to compare",
action="store", nargs='?')
options = parser.parse_args()
if options.debug:
logger.setLevel(logging.DEBUG)
color = (options.color == 'always' or (options.color == 'auto' and sys.stdout.isatty()))
if options.taskargs:
with bb.tinfoil.Tinfoil() as tinfoil:
tinfoil.prepare(config_only=True)
if options.sigargs:
find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1], options.sigargs[0], options.sigargs[1], color=color)
else:
find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1], color=color)
if len(sys.argv) > 2:
bb.siggen.compare_sigfiles(sys.argv[1], sys.argv[2])
else:
if options.sigargs:
logger.error('-s/--signature can only be used together with -t/--task')
sys.exit(1)
try:
if options.sigdatafile1 and options.sigdatafile2:
output = bb.siggen.compare_sigfiles(options.sigdatafile1, options.sigdatafile2, color=color)
elif options.sigdatafile1:
output = bb.siggen.dump_sigfile(options.sigdatafile1)
else:
logger.error('Must specify signature file(s) or -t/--task')
parser.print_help()
sys.exit(1)
except IOError as e:
logger.error(str(e))
sys.exit(1)
except (pickle.UnpicklingError, EOFError):
logger.error('Invalid signature data - ensure you are specifying sigdata/siginfo files')
sys.exit(1)
if output:
print('\n'.join(output))
bb.siggen.dump_sigfile(sys.argv[1])

View File

@ -1,94 +0,0 @@
#!/usr/bin/env python3
# bitbake-dumpsig
# BitBake task signature dump utility
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import sys
import warnings
import optparse
import logging
import pickle
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
import bb.tinfoil
import bb.siggen
import bb.msg
logger = bb.msg.logger_create('bitbake-dumpsig')
def find_siginfo_task(bbhandler, pn, taskname):
""" Find the most recent signature file for the specified PN/task """
if not hasattr(bb.siggen, 'find_siginfo'):
logger.error('Metadata does not support finding signature data files')
sys.exit(1)
if not taskname.startswith('do_'):
taskname = 'do_%s' % taskname
filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-1:]
if not latestfiles:
logger.error('No sigdata files found matching %s %s' % (pn, taskname))
sys.exit(1)
return latestfiles[0]
parser = optparse.OptionParser(
description = "Dumps siginfo/sigdata files written out by BitBake",
usage = """
%prog -t recipename taskname
%prog sigdatafile""")
parser.add_option("-D", "--debug",
help = "enable debug",
action = "store_true", dest="debug", default = False)
parser.add_option("-t", "--task",
help = "find the signature data file for the specified task",
action="store", dest="taskargs", nargs=2, metavar='recipename taskname')
options, args = parser.parse_args(sys.argv)
if options.debug:
logger.setLevel(logging.DEBUG)
if options.taskargs:
tinfoil = bb.tinfoil.Tinfoil()
tinfoil.prepare(config_only = True)
file = find_siginfo_task(tinfoil, options.taskargs[0], options.taskargs[1])
logger.debug("Signature file: %s" % file)
elif len(args) == 1:
parser.print_help()
sys.exit(0)
else:
file = args[1]
try:
output = bb.siggen.dump_sigfile(file)
except IOError as e:
logger.error(str(e))
sys.exit(1)
except (pickle.UnpicklingError, EOFError):
logger.error('Invalid signature data - ensure you are specifying a sigdata/siginfo file')
sys.exit(1)
if output:
print('\n'.join(output))

View File

@ -1,109 +1,299 @@
#!/usr/bin/env python3
#!/usr/bin/env python
# This script has subcommands which operate against your bitbake layers, either
# displaying useful information, or acting against them.
# See the help output for details on available commands.
# Copyright (C) 2011 Mentor Graphics Corporation
# Copyright (C) 2011-2015 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import cmd
import logging
import os
import sys
import argparse
import signal
bindir = os.path.dirname(__file__)
topdir = os.path.dirname(bindir)
sys.path[0:0] = [os.path.join(topdir, 'lib')]
import bb.tinfoil
import bb.msg
logger = bb.msg.logger_create('bitbake-layers', sys.stdout)
def main():
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
parser = argparse.ArgumentParser(
description="BitBake layers utility",
epilog="Use %(prog)s <subcommand> --help to get help on a specific command",
add_help=False)
parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR')
global_args, unparsed_args = parser.parse_known_args()
# Help is added here rather than via add_help=True, as we don't want it to
# be handled by parse_known_args()
parser.add_argument('-h', '--help', action='help', default=argparse.SUPPRESS,
help='show this help message and exit')
subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
subparsers.required = True
if global_args.debug:
logger.setLevel(logging.DEBUG)
elif global_args.quiet:
logger.setLevel(logging.ERROR)
# Need to re-run logger_create with color argument
# (will be the same logger since it has the same name)
bb.msg.logger_create('bitbake-layers', output=sys.stdout, color=global_args.color)
plugins = []
tinfoil = bb.tinfoil.Tinfoil(tracking=True)
tinfoil.logger.setLevel(logger.getEffectiveLevel())
try:
tinfoil.prepare(True)
for path in ([topdir] +
tinfoil.config_data.getVar('BBPATH').split(':')):
pluginpath = os.path.join(path, 'lib', 'bblayers')
bb.utils.load_plugins(logger, plugins, pluginpath)
registered = False
for plugin in plugins:
if hasattr(plugin, 'register_commands'):
registered = True
plugin.register_commands(subparsers)
if hasattr(plugin, 'tinfoil_init'):
plugin.tinfoil_init(tinfoil)
if not registered:
logger.error("No commands registered - missing plugins?")
sys.exit(1)
args = parser.parse_args(unparsed_args, namespace=global_args)
if getattr(args, 'parserecipes', False):
tinfoil.config_data.disableTracking()
tinfoil.parseRecipes()
tinfoil.config_data.enableTracking()
return args.func(args)
finally:
tinfoil.shutdown()
import bb.cache
import bb.cooker
import bb.providers
import bb.utils
from bb.cooker import state
if __name__ == "__main__":
try:
ret = main()
except bb.BBHandledException:
ret = 1
except Exception:
ret = 1
import traceback
traceback.print_exc()
sys.exit(ret)
logger = logging.getLogger('BitBake')
def main(args):
# Set up logging
console = logging.StreamHandler(sys.stdout)
format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
bb.msg.addDefaultlogFilter(console)
console.setFormatter(format)
logger.addHandler(console)
initialenv = os.environ.copy()
bb.utils.clean_environment()
cmds = Commands(initialenv)
if args:
cmds.onecmd(' '.join(args))
else:
cmds.do_help('')
return cmds.returncode
class Commands(cmd.Cmd):
def __init__(self, initialenv):
cmd.Cmd.__init__(self)
self.returncode = 0
self.config = Config(parse_only=True)
self.cooker = bb.cooker.BBCooker(self.config,
self.register_idle_function,
initialenv)
self.config_data = self.cooker.configuration.data
bb.providers.logger.setLevel(logging.ERROR)
self.cooker_data = None
def register_idle_function(self, function, data):
pass
def prepare_cooker(self):
sys.stderr.write("Parsing recipes..")
logger.setLevel(logging.WARNING)
try:
while self.cooker.state in (state.initial, state.parsing):
self.cooker.updateCache()
except KeyboardInterrupt:
self.cooker.shutdown()
self.cooker.updateCache()
sys.exit(2)
logger.setLevel(logging.INFO)
sys.stderr.write("done.\n")
self.cooker_data = self.cooker.status
self.cooker_data.appends = self.cooker.appendlist
def check_prepare_cooker(self):
if not self.cooker_data:
self.prepare_cooker()
def default(self, line):
"""Handle unrecognised commands"""
sys.stderr.write("Unrecognised command or option\n")
self.do_help('')
def do_help(self, topic):
"""display general help or help on a specified command"""
if topic:
sys.stdout.write('%s: ' % topic)
cmd.Cmd.do_help(self,topic)
else:
sys.stdout.write("usage: bitbake-layers <command> [arguments]\n\n")
sys.stdout.write("Available commands:\n")
procnames = self.get_names()
for procname in procnames:
if procname[:3] == 'do_':
sys.stdout.write(" %s\n" % procname[3:])
doc = getattr(self, procname).__doc__
if doc:
sys.stdout.write(" %s\n" % doc.splitlines()[0])
def do_show_layers(self, args):
"""show current configured layers"""
self.check_prepare_cooker()
logger.plain('')
logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority"))
logger.plain('=' * 74)
layerdirs = str(self.config_data.getVar('BBLAYERS', True)).split()
for layerdir in layerdirs:
layername = '?'
layerpri = 0
for layer, _, regex, pri in self.cooker.status.bbfile_config_priorities:
if regex.match(os.path.join(layerdir, 'test')):
layername = layer
layerpri = pri
break
logger.plain("%s %s %d" % (layername.ljust(20), layerdir.ljust(40), layerpri))
def do_show_overlayed(self, args):
"""list overlayed recipes (where there is a recipe in another layer that has a higher layer priority)
usage: show_overlayed
Highest priority recipes are listed with the recipes they overlay as subitems.
"""
self.check_prepare_cooker()
if self.cooker.overlayed:
logger.plain('Overlayed recipes:')
for f in self.cooker.overlayed.iterkeys():
logger.plain('%s' % f)
for of in self.cooker.overlayed[f]:
logger.plain(' %s' % of)
else:
logger.plain('No overlayed recipes found')
def do_flatten(self, args):
"""flattens layer configuration into a separate output directory.
usage: flatten <outputdir>
Takes the current layer configuration and builds a "flattened" directory
containing the contents of all layers, with any overlayed recipes removed
and bbappends appended to the corresponding recipes. Note that some manual
cleanup may still be necessary afterwards, in particular:
* where non-recipe files (such as patches) are overwritten (the flatten
command will show a warning for these)
* where anything beyond the normal layer setup has been added to
layer.conf (only the lowest priority layer's layer.conf is used)
* overridden/appended items from bbappends will need to be tidied up
"""
arglist = args.split()
if len(arglist) != 1:
logger.error('Please specify an output directory')
self.do_help('flatten')
return
if os.path.exists(arglist[0]) and os.listdir(arglist[0]):
logger.error('Directory %s exists and is non-empty, please clear it out first' % arglist[0])
return
self.check_prepare_cooker()
layers = (self.config_data.getVar('BBLAYERS', True) or "").split()
for layer in layers:
overlayed = []
for f in self.cooker.overlayed.iterkeys():
for of in self.cooker.overlayed[f]:
if of.startswith(layer):
overlayed.append(of)
logger.plain('Copying files from %s...' % layer )
for root, dirs, files in os.walk(layer):
for f1 in files:
f1full = os.sep.join([root, f1])
if f1full in overlayed:
logger.plain(' Skipping overlayed file %s' % f1full )
else:
ext = os.path.splitext(f1)[1]
if ext != '.bbappend':
fdest = f1full[len(layer):]
fdest = os.path.normpath(os.sep.join([arglist[0],fdest]))
bb.utils.mkdirhier(os.path.dirname(fdest))
if os.path.exists(fdest):
if f1 == 'layer.conf' and root.endswith('/conf'):
logger.plain(' Skipping layer config file %s' % f1full )
continue
else:
logger.warn('Overwriting file %s', fdest)
bb.utils.copyfile(f1full, fdest)
if ext == '.bb':
if f1 in self.cooker_data.appends:
appends = self.cooker_data.appends[f1]
if appends:
logger.plain(' Applying appends to %s' % fdest )
for appendname in appends:
self.apply_append(appendname, fdest)
def get_append_layer(self, appendname):
for layer, _, regex, _ in self.cooker.status.bbfile_config_priorities:
if regex.match(appendname):
return layer
return "?"
def apply_append(self, appendname, recipename):
appendfile = open(appendname, 'r')
recipefile = open(recipename, 'a')
recipefile.write('\n')
recipefile.write('##### bbappended from %s #####\n' % self.get_append_layer(appendname))
recipefile.writelines(appendfile.readlines())
def do_show_appends(self, args):
"""list bbappend files and recipe files they apply to
usage: show_appends
Recipes are listed with the bbappends that apply to them as subitems.
"""
self.check_prepare_cooker()
if not self.cooker_data.appends:
logger.plain('No append files found')
return
logger.plain('State of append files:')
pnlist = list(self.cooker_data.pkg_pn.keys())
pnlist.sort()
for pn in pnlist:
self.show_appends_for_pn(pn)
self.show_appends_for_skipped()
def show_appends_for_pn(self, pn):
filenames = self.cooker_data.pkg_pn[pn]
best = bb.providers.findBestProvider(pn,
self.cooker.configuration.data,
self.cooker_data,
self.cooker_data.pkg_pn)
best_filename = os.path.basename(best[3])
self.show_appends_output(filenames, best_filename)
def show_appends_for_skipped(self):
filenames = [os.path.basename(f)
for f in self.cooker.skiplist.iterkeys()]
self.show_appends_output(filenames, None, " (skipped)")
def show_appends_output(self, filenames, best_filename, name_suffix = ''):
appended, missing = self.get_appends_for_files(filenames)
if appended:
for basename, appends in appended:
logger.plain('%s%s:', basename, name_suffix)
for append in appends:
logger.plain(' %s', append)
if best_filename:
if best_filename in missing:
logger.warn('%s: missing append for preferred version',
best_filename)
self.returncode |= 1
def get_appends_for_files(self, filenames):
appended, notappended = [], []
for filename in filenames:
_, cls = bb.cache.Cache.virtualfn2realfn(filename)
if cls:
continue
basename = os.path.basename(filename)
appends = self.cooker_data.appends.get(basename)
if appends:
appended.append((basename, list(appends)))
else:
notappended.append(basename)
return appended, notappended
class Config(object):
def __init__(self, **options):
self.pkgs_to_build = []
self.debug_domains = []
self.extra_assume_provided = []
self.prefile = []
self.postfile = []
self.debug = 0
self.__dict__.update(options)
def __getattr__(self, attribute):
try:
return super(Config, self).__getattribute__(attribute)
except AttributeError:
return None
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]) or 0)

30
bitbake/bin/bitbake-prserv Executable file → Normal file
View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
import os
import sys,logging
import optparse
@ -10,39 +10,37 @@ import prserv.serv
__version__="1.0.0"
PRHOST_DEFAULT='0.0.0.0'
PRHOST_DEFAULT=''
PRPORT_DEFAULT=8585
def main():
parser = optparse.OptionParser(
version="Bitbake PR Service Core version %s, %%prog version %s" % (prserv.__version__, __version__),
usage = "%prog < --start | --stop > [options]")
usage = "%prog [options]")
parser.add_option("-f", "--file", help="database filename(default: prserv.sqlite3)", action="store",
dest="dbfile", type="string", default="prserv.sqlite3")
parser.add_option("-l", "--log", help="log filename(default: prserv.log)", action="store",
parser.add_option("-f", "--file", help="database filename(default prserv.db)", action="store",
dest="dbfile", type="string", default="prserv.db")
parser.add_option("-l", "--log", help="log filename(default prserv.log)", action="store",
dest="logfile", type="string", default="prserv.log")
parser.add_option("--loglevel", help="logging level, i.e. CRITICAL, ERROR, WARNING, INFO, DEBUG",
action = "store", type="string", dest="loglevel", default = "INFO")
action = "store", type="string", dest="loglevel", default = "WARNING")
parser.add_option("--start", help="start daemon",
action="store_true", dest="start")
action="store_true", dest="start", default="True")
parser.add_option("--stop", help="stop daemon",
action="store_true", dest="stop")
action="store_false", dest="start")
parser.add_option("--host", help="ip address to bind", action="store",
dest="host", type="string", default=PRHOST_DEFAULT)
parser.add_option("--port", help="port number(default: 8585)", action="store",
parser.add_option("--port", help="port number(default 8585)", action="store",
dest="port", type="int", default=PRPORT_DEFAULT)
options, args = parser.parse_args(sys.argv)
prserv.init_logger(os.path.abspath(options.logfile),options.loglevel)
if options.start:
ret=prserv.serv.start_daemon(options.dbfile, options.host, options.port,os.path.abspath(options.logfile))
elif options.stop:
ret=prserv.serv.stop_daemon(options.host, options.port)
prserv.serv.start_daemon(options)
else:
ret=parser.print_help()
return ret
prserv.serv.stop_daemon()
if __name__ == "__main__":
try:
@ -50,6 +48,6 @@ if __name__ == "__main__":
except Exception:
ret = 1
import traceback
traceback.print_exc()
traceback.print_exc(5)
sys.exit(ret)

119
bitbake/bin/bitbake-runtask Executable file
View File

@ -0,0 +1,119 @@
#!/usr/bin/env python
import os
import sys
import warnings
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
from bb import fetch2
import logging
logger = logging.getLogger("BitBake")
try:
import cPickle as pickle
except ImportError:
import pickle
bb.msg.note(1, bb.msg.domain.Cache, "Importing cPickle failed. Falling back to a very slow implementation.")
class BBConfiguration(object):
"""
Manages build options and configurations for one run
"""
def __init__(self, **options):
self.data = {}
self.file = []
self.cmd = None
self.dump_signatures = True
self.prefile = []
self.postfile = []
self.parse_only = True
def __getattr__(self, attribute):
try:
return super(BBConfiguration, self).__getattribute__(attribute)
except AttributeError:
return None
_warnings_showwarning = warnings.showwarning
def _showwarning(message, category, filename, lineno, file=None, line=None):
"""Display python warning messages using bb.msg"""
if file is not None:
if _warnings_showwarning is not None:
_warnings_showwarning(message, category, filename, lineno, file, line)
else:
s = warnings.formatwarning(message, category, filename, lineno)
s = s.split("\n")[0]
bb.msg.warn(None, s)
warnings.showwarning = _showwarning
warnings.simplefilter("ignore", DeprecationWarning)
import bb.event
import bb.cooker
buildfile = sys.argv[1]
taskname = sys.argv[2]
if len(sys.argv) >= 4:
dryrun = sys.argv[3]
else:
dryrun = False
if len(sys.argv) >= 5:
hashfile = sys.argv[4]
p = pickle.Unpickler(file(hashfile, "rb"))
hashdata = p.load()
else:
hashdata = None
handler = bb.event.LogHandler()
logger.addHandler(handler)
#An example to make debug log messages show up
#bb.msg.init_msgconfig(True, 3, [])
console = logging.StreamHandler(sys.stdout)
format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
bb.msg.addDefaultlogFilter(console)
console.setFormatter(format)
def worker_fire(event, d):
if isinstance(event, logging.LogRecord):
console.handle(event)
bb.event.worker_fire = worker_fire
bb.event.worker_pid = os.getpid()
initialenv = os.environ.copy()
config = BBConfiguration()
def register_idle_function(self, function, data):
pass
cooker = bb.cooker.BBCooker(config, register_idle_function, initialenv)
config_data = cooker.configuration.data
cooker.status = config_data
cooker.handleCollections(bb.data.getVar("BBFILE_COLLECTIONS", config_data, 1))
fn, cls = bb.cache.Cache.virtualfn2realfn(buildfile)
buildfile = cooker.matchFile(fn)
fn = bb.cache.Cache.realfn2virtual(buildfile, cls)
cooker.buildSetVars()
# Load data into the cache for fn and parse the loaded cache data
the_data = bb.cache.Cache.loadDataFull(fn, cooker.get_file_appends(fn), cooker.configuration.data)
if taskname.endswith("_setscene"):
the_data.setVarFlag(taskname, "quieterrors", "1")
if hashdata:
bb.parse.siggen.set_taskdata(hashdata["hashes"], hashdata["deps"])
for h in hashdata["hashes"]:
bb.data.setVar("BBHASH_%s" % h, hashdata["hashes"][h], the_data)
for h in hashdata["deps"]:
bb.data.setVar("BBHASHDEPS_%s" % h, hashdata["deps"][h], the_data)
ret = 0
if dryrun != "True":
ret = bb.build.exec_task(fn, taskname, the_data)
sys.exit(ret)

View File

@ -1,72 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2012 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import sys, logging
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'lib'))
import unittest
try:
import bb
except RuntimeError as exc:
sys.exit(str(exc))
tests = ["bb.tests.codeparser",
"bb.tests.cow",
"bb.tests.data",
"bb.tests.fetch",
"bb.tests.parse",
"bb.tests.utils"]
for t in tests:
t = '.'.join(t.split('.')[:3])
__import__(t)
# Set-up logging
class StdoutStreamHandler(logging.StreamHandler):
"""Special handler so that unittest is able to capture stdout"""
def __init__(self):
# Override __init__() because we don't want to set self.stream here
logging.Handler.__init__(self)
@property
def stream(self):
# We want to dynamically write wherever sys.stdout is pointing to
return sys.stdout
handler = StdoutStreamHandler()
bb.logger.addHandler(handler)
bb.logger.setLevel(logging.DEBUG)
ENV_HELP = """\
Environment variables:
BB_SKIP_NETTESTS set to 'yes' in order to skip tests using network
connection
BB_TMPDIR_NOCLEAN set to 'yes' to preserve test tmp directories
"""
class main(unittest.main):
def _print_help(self, *args, **kwargs):
super(main, self)._print_help(*args, **kwargs)
print(ENV_HELP)
if __name__ == '__main__':
main(defaultTest=tests, buffer=True)

View File

@ -1,502 +0,0 @@
#!/usr/bin/env python3
import os
import sys
import warnings
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
from bb import fetch2
import logging
import bb
import select
import errno
import signal
import pickle
import traceback
import queue
from multiprocessing import Lock
from threading import Thread
if sys.getfilesystemencoding() != "utf-8":
sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.")
# Users shouldn't be running this code directly
if len(sys.argv) != 2 or not sys.argv[1].startswith("decafbad"):
print("bitbake-worker is meant for internal execution by bitbake itself, please don't use it standalone.")
sys.exit(1)
profiling = False
if sys.argv[1].startswith("decafbadbad"):
profiling = True
try:
import cProfile as profile
except:
import profile
# Unbuffer stdout to avoid log truncation in the event
# of an unorderly exit as well as to provide timely
# updates to log files for use with tail
try:
if sys.stdout.name == '<stdout>':
import fcntl
fl = fcntl.fcntl(sys.stdout.fileno(), fcntl.F_GETFL)
fl |= os.O_SYNC
fcntl.fcntl(sys.stdout.fileno(), fcntl.F_SETFL, fl)
#sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
except:
pass
logger = logging.getLogger("BitBake")
worker_pipe = sys.stdout.fileno()
bb.utils.nonblockingfd(worker_pipe)
# Need to guard against multiprocessing being used in child processes
# and multiple processes trying to write to the parent at the same time
worker_pipe_lock = None
handler = bb.event.LogHandler()
logger.addHandler(handler)
if 0:
# Code to write out a log file of all events passing through the worker
logfilename = "/tmp/workerlogfile"
format_str = "%(levelname)s: %(message)s"
conlogformat = bb.msg.BBLogFormatter(format_str)
consolelog = logging.FileHandler(logfilename)
bb.msg.addDefaultlogFilter(consolelog)
consolelog.setFormatter(conlogformat)
logger.addHandler(consolelog)
worker_queue = queue.Queue()
def worker_fire(event, d):
data = b"<event>" + pickle.dumps(event) + b"</event>"
worker_fire_prepickled(data)
def worker_fire_prepickled(event):
global worker_queue
worker_queue.put(event)
#
# We can end up with write contention with the cooker, it can be trying to send commands
# and we can be trying to send event data back. Therefore use a separate thread for writing
# back data to cooker.
#
worker_thread_exit = False
def worker_flush(worker_queue):
worker_queue_int = b""
global worker_pipe, worker_thread_exit
while True:
try:
worker_queue_int = worker_queue_int + worker_queue.get(True, 1)
except queue.Empty:
pass
while (worker_queue_int or not worker_queue.empty()):
try:
(_, ready, _) = select.select([], [worker_pipe], [], 1)
if not worker_queue.empty():
worker_queue_int = worker_queue_int + worker_queue.get()
written = os.write(worker_pipe, worker_queue_int)
worker_queue_int = worker_queue_int[written:]
except (IOError, OSError) as e:
if e.errno != errno.EAGAIN and e.errno != errno.EPIPE:
raise
if worker_thread_exit and worker_queue.empty() and not worker_queue_int:
return
worker_thread = Thread(target=worker_flush, args=(worker_queue,))
worker_thread.start()
def worker_child_fire(event, d):
global worker_pipe
global worker_pipe_lock
data = b"<event>" + pickle.dumps(event) + b"</event>"
try:
worker_pipe_lock.acquire()
worker_pipe.write(data)
worker_pipe_lock.release()
except IOError:
sigterm_handler(None, None)
raise
bb.event.worker_fire = worker_fire
lf = None
#lf = open("/tmp/workercommandlog", "w+")
def workerlog_write(msg):
if lf:
lf.write(msg)
lf.flush()
def sigterm_handler(signum, frame):
signal.signal(signal.SIGTERM, signal.SIG_DFL)
os.killpg(0, signal.SIGTERM)
sys.exit()
def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, appends, taskdepdata, extraconfigdata, quieterrors=False, dry_run_exec=False):
# We need to setup the environment BEFORE the fork, since
# a fork() or exec*() activates PSEUDO...
envbackup = {}
fakeenv = {}
umask = None
taskdep = workerdata["taskdeps"][fn]
if 'umask' in taskdep and taskname in taskdep['umask']:
# umask might come in as a number or text string..
try:
umask = int(taskdep['umask'][taskname],8)
except TypeError:
umask = taskdep['umask'][taskname]
dry_run = cfg.dry_run or dry_run_exec
# We can't use the fakeroot environment in a dry run as it possibly hasn't been built
if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not dry_run:
envvars = (workerdata["fakerootenv"][fn] or "").split()
for key, value in (var.split('=') for var in envvars):
envbackup[key] = os.environ.get(key)
os.environ[key] = value
fakeenv[key] = value
fakedirs = (workerdata["fakerootdirs"][fn] or "").split()
for p in fakedirs:
bb.utils.mkdirhier(p)
logger.debug(2, 'Running %s:%s under fakeroot, fakedirs: %s' %
(fn, taskname, ', '.join(fakedirs)))
else:
envvars = (workerdata["fakerootnoenv"][fn] or "").split()
for key, value in (var.split('=') for var in envvars):
envbackup[key] = os.environ.get(key)
os.environ[key] = value
fakeenv[key] = value
sys.stdout.flush()
sys.stderr.flush()
try:
pipein, pipeout = os.pipe()
pipein = os.fdopen(pipein, 'rb', 4096)
pipeout = os.fdopen(pipeout, 'wb', 0)
pid = os.fork()
except OSError as e:
logger.critical("fork failed: %d (%s)" % (e.errno, e.strerror))
sys.exit(1)
if pid == 0:
def child():
global worker_pipe
global worker_pipe_lock
pipein.close()
signal.signal(signal.SIGTERM, sigterm_handler)
# Let SIGHUP exit as SIGTERM
signal.signal(signal.SIGHUP, sigterm_handler)
bb.utils.signal_on_parent_exit("SIGTERM")
# Save out the PID so that the event can include it the
# events
bb.event.worker_pid = os.getpid()
bb.event.worker_fire = worker_child_fire
worker_pipe = pipeout
worker_pipe_lock = Lock()
# Make the child the process group leader and ensure no
# child process will be controlled by the current terminal
# This ensures signals sent to the controlling terminal like Ctrl+C
# don't stop the child processes.
os.setsid()
# No stdin
newsi = os.open(os.devnull, os.O_RDWR)
os.dup2(newsi, sys.stdin.fileno())
if umask:
os.umask(umask)
try:
bb_cache = bb.cache.NoCache(databuilder)
(realfn, virtual, mc) = bb.cache.virtualfn2realfn(fn)
the_data = databuilder.mcdata[mc]
the_data.setVar("BB_WORKERCONTEXT", "1")
the_data.setVar("BB_TASKDEPDATA", taskdepdata)
if cfg.limited_deps:
the_data.setVar("BB_LIMITEDDEPS", "1")
the_data.setVar("BUILDNAME", workerdata["buildname"])
the_data.setVar("DATE", workerdata["date"])
the_data.setVar("TIME", workerdata["time"])
for varname, value in extraconfigdata.items():
the_data.setVar(varname, value)
bb.parse.siggen.set_taskdata(workerdata["sigdata"])
ret = 0
the_data = bb_cache.loadDataFull(fn, appends)
the_data.setVar('BB_TASKHASH', workerdata["runq_hash"][task])
bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN"), taskname.replace("do_", "")))
# exported_vars() returns a generator which *cannot* be passed to os.environ.update()
# successfully. We also need to unset anything from the environment which shouldn't be there
exports = bb.data.exported_vars(the_data)
bb.utils.empty_environment()
for e, v in exports:
os.environ[e] = v
for e in fakeenv:
os.environ[e] = fakeenv[e]
the_data.setVar(e, fakeenv[e])
the_data.setVarFlag(e, 'export', "1")
task_exports = the_data.getVarFlag(taskname, 'exports')
if task_exports:
for e in task_exports.split():
the_data.setVarFlag(e, 'export', '1')
v = the_data.getVar(e)
if v is not None:
os.environ[e] = v
if quieterrors:
the_data.setVarFlag(taskname, "quieterrors", "1")
except Exception:
if not quieterrors:
logger.critical(traceback.format_exc())
os._exit(1)
try:
if dry_run:
return 0
return bb.build.exec_task(fn, taskname, the_data, cfg.profile)
except:
os._exit(1)
if not profiling:
os._exit(child())
else:
profname = "profile-%s.log" % (fn.replace("/", "-") + "-" + taskname)
prof = profile.Profile()
try:
ret = profile.Profile.runcall(prof, child)
finally:
prof.dump_stats(profname)
bb.utils.process_profilelog(profname)
os._exit(ret)
else:
for key, value in iter(envbackup.items()):
if value is None:
del os.environ[key]
else:
os.environ[key] = value
return pid, pipein, pipeout
class runQueueWorkerPipe():
"""
Abstraction for a pipe between a worker thread and the worker server
"""
def __init__(self, pipein, pipeout):
self.input = pipein
if pipeout:
pipeout.close()
bb.utils.nonblockingfd(self.input)
self.queue = b""
def read(self):
start = len(self.queue)
try:
self.queue = self.queue + (self.input.read(102400) or b"")
except (OSError, IOError) as e:
if e.errno != errno.EAGAIN:
raise
end = len(self.queue)
index = self.queue.find(b"</event>")
while index != -1:
worker_fire_prepickled(self.queue[:index+8])
self.queue = self.queue[index+8:]
index = self.queue.find(b"</event>")
return (end > start)
def close(self):
while self.read():
continue
if len(self.queue) > 0:
print("Warning, worker child left partial message: %s" % self.queue)
self.input.close()
normalexit = False
class BitbakeWorker(object):
def __init__(self, din):
self.input = din
bb.utils.nonblockingfd(self.input)
self.queue = b""
self.cookercfg = None
self.databuilder = None
self.data = None
self.extraconfigdata = None
self.build_pids = {}
self.build_pipes = {}
signal.signal(signal.SIGTERM, self.sigterm_exception)
# Let SIGHUP exit as SIGTERM
signal.signal(signal.SIGHUP, self.sigterm_exception)
if "beef" in sys.argv[1]:
bb.utils.set_process_name("Worker (Fakeroot)")
else:
bb.utils.set_process_name("Worker")
def sigterm_exception(self, signum, stackframe):
if signum == signal.SIGTERM:
bb.warn("Worker received SIGTERM, shutting down...")
elif signum == signal.SIGHUP:
bb.warn("Worker received SIGHUP, shutting down...")
self.handle_finishnow(None)
signal.signal(signal.SIGTERM, signal.SIG_DFL)
os.kill(os.getpid(), signal.SIGTERM)
def serve(self):
while True:
(ready, _, _) = select.select([self.input] + [i.input for i in self.build_pipes.values()], [] , [], 1)
if self.input in ready:
try:
r = self.input.read()
if len(r) == 0:
# EOF on pipe, server must have terminated
self.sigterm_exception(signal.SIGTERM, None)
self.queue = self.queue + r
except (OSError, IOError):
pass
if len(self.queue):
self.handle_item(b"cookerconfig", self.handle_cookercfg)
self.handle_item(b"extraconfigdata", self.handle_extraconfigdata)
self.handle_item(b"workerdata", self.handle_workerdata)
self.handle_item(b"runtask", self.handle_runtask)
self.handle_item(b"finishnow", self.handle_finishnow)
self.handle_item(b"ping", self.handle_ping)
self.handle_item(b"quit", self.handle_quit)
for pipe in self.build_pipes:
if self.build_pipes[pipe].input in ready:
self.build_pipes[pipe].read()
if len(self.build_pids):
while self.process_waitpid():
continue
def handle_item(self, item, func):
if self.queue.startswith(b"<" + item + b">"):
index = self.queue.find(b"</" + item + b">")
while index != -1:
func(self.queue[(len(item) + 2):index])
self.queue = self.queue[(index + len(item) + 3):]
index = self.queue.find(b"</" + item + b">")
def handle_cookercfg(self, data):
self.cookercfg = pickle.loads(data)
self.databuilder = bb.cookerdata.CookerDataBuilder(self.cookercfg, worker=True)
self.databuilder.parseBaseConfiguration()
self.data = self.databuilder.data
def handle_extraconfigdata(self, data):
self.extraconfigdata = pickle.loads(data)
def handle_workerdata(self, data):
self.workerdata = pickle.loads(data)
bb.msg.loggerDefaultDebugLevel = self.workerdata["logdefaultdebug"]
bb.msg.loggerDefaultVerbose = self.workerdata["logdefaultverbose"]
bb.msg.loggerVerboseLogs = self.workerdata["logdefaultverboselogs"]
bb.msg.loggerDefaultDomains = self.workerdata["logdefaultdomain"]
for mc in self.databuilder.mcdata:
self.databuilder.mcdata[mc].setVar("PRSERV_HOST", self.workerdata["prhost"])
def handle_ping(self, _):
workerlog_write("Handling ping\n")
logger.warning("Pong from bitbake-worker!")
def handle_quit(self, data):
workerlog_write("Handling quit\n")
global normalexit
normalexit = True
sys.exit(0)
def handle_runtask(self, data):
fn, task, taskname, quieterrors, appends, taskdepdata, dry_run_exec = pickle.loads(data)
workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname))
pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, fn, task, taskname, appends, taskdepdata, self.extraconfigdata, quieterrors, dry_run_exec)
self.build_pids[pid] = task
self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout)
def process_waitpid(self):
"""
Return none is there are no processes awaiting result collection, otherwise
collect the process exit codes and close the information pipe.
"""
try:
pid, status = os.waitpid(-1, os.WNOHANG)
if pid == 0 or os.WIFSTOPPED(status):
return False
except OSError:
return False
workerlog_write("Exit code of %s for pid %s\n" % (status, pid))
if os.WIFEXITED(status):
status = os.WEXITSTATUS(status)
elif os.WIFSIGNALED(status):
# Per shell conventions for $?, when a process exits due to
# a signal, we return an exit code of 128 + SIGNUM
status = 128 + os.WTERMSIG(status)
task = self.build_pids[pid]
del self.build_pids[pid]
self.build_pipes[pid].close()
del self.build_pipes[pid]
worker_fire_prepickled(b"<exitcode>" + pickle.dumps((task, status)) + b"</exitcode>")
return True
def handle_finishnow(self, _):
if self.build_pids:
logger.info("Sending SIGTERM to remaining %s tasks", len(self.build_pids))
for k, v in iter(self.build_pids.items()):
try:
os.kill(-k, signal.SIGTERM)
os.waitpid(-1, 0)
except:
pass
for pipe in self.build_pipes:
self.build_pipes[pipe].read()
try:
worker = BitbakeWorker(os.fdopen(sys.stdin.fileno(), 'rb'))
if not profiling:
worker.serve()
else:
profname = "profile-worker.log"
prof = profile.Profile()
try:
profile.Profile.runcall(prof, worker.serve)
finally:
prof.dump_stats(profname)
bb.utils.process_profilelog(profname)
except BaseException as e:
if not normalexit:
import traceback
sys.stderr.write(traceback.format_exc())
sys.stderr.write(str(e))
worker_thread_exit = True
worker_thread.join()
workerlog_write("exitting")
sys.exit(0)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
@ -462,7 +462,7 @@ def main():
state_group = 2
for key in bb.data.keys(documentation):
data = documentation.getVarFlag(key, "doc", False)
data = bb.data.getVarFlag(key, "doc", documentation)
if not data:
continue

View File

@ -1,281 +0,0 @@
#!/bin/echo ERROR: This script needs to be sourced. Please run as .
# toaster - shell script to start Toaster
# Copyright (C) 2013-2015 Intel Corp.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
HELP="
Usage: source toaster start|stop [webport=<address:port>] [noweb]
Optional arguments:
[noweb] Setup the environment for building with toaster but don't start the development server
[webport] Set the development server (default: localhost:8000)
"
databaseCheck()
{
retval=0
# you can always add a superuser later via
# ../bitbake/lib/toaster/manage.py createsuperuser --username=<ME>
$MANAGE migrate --noinput || retval=1
if [ $retval -eq 1 ]; then
echo "Failed migrations, aborting system start" 1>&2
return $retval
fi
# Make sure that checksettings can pick up any value for TEMPLATECONF
export TEMPLATECONF
$MANAGE checksettings --traceback || retval=1
if [ $retval -eq 1 ]; then
printf "\nError while checking settings; aborting\n"
return $retval
fi
return $retval
}
webserverKillAll()
{
local pidfile
for pidfile in ${BUILDDIR}/.toastermain.pid ${BUILDDIR}/.runbuilds.pid; do
if [ -f ${pidfile} ]; then
pid=`cat ${pidfile}`
while kill -0 $pid 2>/dev/null; do
kill -SIGTERM -$pid 2>/dev/null
sleep 1
done
rm ${pidfile}
fi
done
}
webserverStartAll()
{
# do not start if toastermain points to a valid process
if ! cat "${BUILDDIR}/.toastermain.pid" 2>/dev/null | xargs -I{} kill -0 {} ; then
retval=1
rm "${BUILDDIR}/.toastermain.pid"
fi
retval=0
# check the database
databaseCheck || return 1
echo "Starting webserver..."
$MANAGE runserver "$ADDR_PORT" \
</dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \
& echo $! >${BUILDDIR}/.toastermain.pid
sleep 1
if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then
retval=1
rm "${BUILDDIR}/.toastermain.pid"
else
echo "Toaster development webserver started at http://$ADDR_PORT"
echo -e "\nYou can now run 'bitbake <target>' on the command line and monitor your build in Toaster.\nYou can also use a Toaster project to configure and run a build.\n"
fi
return $retval
}
INSTOPSYSTEM=0
# define the stop command
stop_system()
{
# prevent reentry
if [ $INSTOPSYSTEM -eq 1 ]; then return; fi
INSTOPSYSTEM=1
webserverKillAll
# unset exported variables
unset TOASTER_DIR
unset BITBAKE_UI
unset BBBASEDIR
trap - SIGHUP
#trap - SIGCHLD
INSTOPSYSTEM=0
}
verify_prereq() {
# Verify Django version
reqfile=$(python3 -c "import os; print(os.path.realpath('$BBBASEDIR/toaster-requirements.txt'))")
exp='s/Django\([><=]\+\)\([^,]\+\),\([><=]\+\)\(.\+\)/'
exp=$exp'import sys,django;version=django.get_version().split(".");'
exp=$exp'sys.exit(not (version \1 "\2".split(".") and version \3 "\4".split(".")))/p'
if ! sed -n "$exp" $reqfile | python3 - ; then
req=`grep ^Django $reqfile`
echo "This program needs $req"
echo "Please install with pip3 install -r $reqfile"
return 2
fi
return 0
}
# read command line parameters
if [ -n "$BASH_SOURCE" ] ; then
TOASTER=${BASH_SOURCE}
elif [ -n "$ZSH_NAME" ] ; then
TOASTER=${(%):-%x}
else
TOASTER=$0
fi
export BBBASEDIR=`dirname $TOASTER`/..
MANAGE="python3 $BBBASEDIR/lib/toaster/manage.py"
OE_ROOT=`dirname $TOASTER`/../..
# this is the configuraton file we are using for toaster
# we are using the same logic that oe-setup-builddir uses
# (based on TEMPLATECONF and .templateconf) to determine
# which toasterconf.json to use.
# note: There are a number of relative path assumptions
# in the local layers that currently make using an arbitrary
# toasterconf.json difficult.
. $OE_ROOT/.templateconf
if [ -n "$TEMPLATECONF" ]; then
if [ ! -d "$TEMPLATECONF" ]; then
# Allow TEMPLATECONF=meta-xyz/conf as a shortcut
if [ -d "$OE_ROOT/$TEMPLATECONF" ]; then
TEMPLATECONF="$OE_ROOT/$TEMPLATECONF"
fi
fi
fi
unset OE_ROOT
WEBSERVER=1
ADDR_PORT="localhost:8000"
unset CMD
for param in $*; do
case $param in
noweb )
WEBSERVER=0
;;
start )
CMD=$param
;;
stop )
CMD=$param
;;
webport=*)
ADDR_PORT="${param#*=}"
# Split the addr:port string
ADDR=`echo $ADDR_PORT | cut -f 1 -d ':'`
PORT=`echo $ADDR_PORT | cut -f 2 -d ':'`
# If only a port has been speified then set address to localhost.
if [ $ADDR = $PORT ] ; then
ADDR_PORT="localhost:$PORT"
fi
;;
--help)
echo "$HELP"
return 0
;;
*)
echo "$HELP"
return 1
;;
esac
done
if [ `basename \"$0\"` = `basename \"${TOASTER}\"` ]; then
echo "Error: This script needs to be sourced. Please run as . $TOASTER"
return 1
fi
verify_prereq || return 1
# We make sure we're running in the current shell and in a good environment
if [ -z "$BUILDDIR" ] || ! which bitbake >/dev/null 2>&1 ; then
echo "Error: Build environment is not setup or bitbake is not in path." 1>&2
return 2
fi
# this defines the dir toaster will use for
# 1) clones of layers (in _toaster_clones )
# 2) the build dir (in build)
# 3) the sqlite db if that is being used.
# 4) pid's we need to clean up on exit/shutdown
export TOASTER_DIR=`dirname $BUILDDIR`
export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE TOASTER_DIR"
# Determine the action. If specified by arguments, fine, if not, toggle it
if [ "$CMD" = "start" ] ; then
if [ -n "$BBSERVER" ]; then
echo " Toaster is already running. Exiting..."
return 1
fi
elif [ "$CMD" = "" ]; then
echo "No command specified"
echo "$HELP"
return 1
fi
echo "The system will $CMD."
# Execute the commands
case $CMD in
start )
# check if addr:port is not in use
if [ "$CMD" == 'start' ]; then
if [ $WEBSERVER -gt 0 ]; then
$MANAGE checksocket "$ADDR_PORT" || return 1
fi
fi
# Create configuration file
conf=${BUILDDIR}/conf/local.conf
line='INHERIT+="toaster buildhistory"'
grep -q "$line" $conf || echo $line >> $conf
if [ $WEBSERVER -eq 0 ] ; then
# Do not update the database for "noweb" unless
# it does not yet exist
if [ ! -f "$TOASTER_DIR/toaster.sqlite" ] ; then
if ! databaseCheck; then
echo "Failed ${CMD}."
return 4
fi
fi
fi
if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
echo "Failed ${CMD}."
return 4
fi
export BITBAKE_UI='toasterui'
$MANAGE runbuilds \
</dev/null >>${BUILDDIR}/toaster_runbuilds.log 2>&1 \
& echo $! >${BUILDDIR}/.runbuilds.pid
# set fail safe stop system on terminal exit
trap stop_system SIGHUP
echo "Successful ${CMD}."
return 0
;;
stop )
stop_system
echo "Successful ${CMD}."
;;
esac

View File

@ -1,126 +0,0 @@
#!/usr/bin/env python3
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2014 Alex Damian
#
# This file re-uses code spread throughout other Bitbake source files.
# As such, all other copyrights belong to their own right holders.
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
This command takes a filename as a single parameter. The filename is read
as a build eventlog, and the ToasterUI is used to process events in the file
and log data in the database
"""
import os
import sys
import json
import pickle
import codecs
from collections import namedtuple
# mangle syspath to allow easy import of modules
from os.path import join, dirname, abspath
sys.path.insert(0, join(dirname(dirname(abspath(__file__))), 'lib'))
import bb.cooker
from bb.ui import toasterui
class EventPlayer:
"""Emulate a connection to a bitbake server."""
def __init__(self, eventfile, variables):
self.eventfile = eventfile
self.variables = variables
self.eventmask = []
def waitEvent(self, _timeout):
"""Read event from the file."""
line = self.eventfile.readline().strip()
if not line:
return
try:
event_str = json.loads(line)['vars'].encode('utf-8')
event = pickle.loads(codecs.decode(event_str, 'base64'))
event_name = "%s.%s" % (event.__module__, event.__class__.__name__)
if event_name not in self.eventmask:
return
return event
except ValueError as err:
print("Failed loading ", line)
raise err
def runCommand(self, command_line):
"""Emulate running a command on the server."""
name = command_line[0]
if name == "getVariable":
var_name = command_line[1]
variable = self.variables.get(var_name)
if variable:
return variable['v'], None
return None, "Missing variable %s" % var_name
elif name == "getAllKeysWithFlags":
dump = {}
flaglist = command_line[1]
for key, val in self.variables.items():
try:
if not key.startswith("__"):
dump[key] = {
'v': val['v'],
'history' : val['history'],
}
for flag in flaglist:
dump[key][flag] = val[flag]
except Exception as err:
print(err)
return (dump, None)
elif name == 'setEventMask':
self.eventmask = command_line[-1]
return True, None
else:
raise Exception("Command %s not implemented" % command_line[0])
def getEventHandle(self):
"""
This method is called by toasterui.
The return value is passed to self.runCommand but not used there.
"""
pass
def main(argv):
with open(argv[-1]) as eventfile:
# load variables from the first line
variables = json.loads(eventfile.readline().strip())['allvariables']
params = namedtuple('ConfigParams', ['observe_only'])(True)
player = EventPlayer(eventfile, variables)
return toasterui.main(player, player, params)
# run toaster ui on our mock bitbake class
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: %s <event file>" % os.path.basename(sys.argv[0]))
sys.exit(1)
sys.exit(main(sys.argv))

View File

@ -1,68 +0,0 @@
#!/usr/bin/env python3
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2012 Wind River Systems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# This is used for dumping the bb_cache.dat, the output format is:
# recipe_path PN PV PACKAGES
#
import os
import sys
import warnings
# For importing bb.cache
sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), '../lib'))
from bb.cache import CoreRecipeInfo
import pickle as pickle
def main(argv=None):
"""
Get the mapping for the target recipe.
"""
if len(argv) != 1:
print("Error, need one argument!", file=sys.stderr)
return 2
cachefile = argv[0]
with open(cachefile, "rb") as cachefile:
pickled = pickle.Unpickler(cachefile)
while cachefile:
try:
key = pickled.load()
val = pickled.load()
except Exception:
break
if isinstance(val, CoreRecipeInfo) and (not val.skipped):
pn = val.pn
# Filter out the native recipes.
if key.startswith('virtual:native:') or pn.endswith("-native"):
continue
# 1.0 is the default version for a no PV recipe.
if "pv" in val.__dict__:
pv = val.pv
else:
pv = "1.0"
print("%s %s %s %s" % (key, pn, pv, ' '.join(val.packages)))
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))

View File

@ -10,11 +10,11 @@ if &compatible || version < 600
finish
endif
" .bb, .bbappend and .bbclass
au BufNewFile,BufRead *.{bb,bbappend,bbclass} set filetype=bitbake
" .bb and .bbclass
au BufNewFile,BufRead *.b{b,bclass} set filetype=bitbake
" .inc
au BufNewFile,BufRead *.inc set filetype=bitbake
au BufNewFile,BufRead *.inc set filetype=bitbake
" .conf
au BufNewFile,BufRead *.conf

View File

@ -1,2 +1 @@
set sts=4 sw=4 et
set cms=#%s

View File

@ -15,15 +15,15 @@ if &compatible || v:version < 600
endif
fun! <SID>GetUserName()
let l:user_name = system("git config --get user.name")
let l:user_name = system("git-config --get user.name")
if v:shell_error
return "Unknown User"
return "Unknow User"
else
return substitute(l:user_name, "\n", "", "")
endfun
fun! <SID>GetUserEmail()
let l:user_email = system("git config --get user.email")
let l:user_email = system("git-config --get user.email")
if v:shell_error
return "unknow@user.org"
else
@ -53,6 +53,7 @@ fun! NewBBTemplate()
put ='LICENSE = \"\"'
put ='SECTION = \"\"'
put ='DEPENDS = \"\"'
put ='PR = \"r0\"'
put =''
put ='SRC_URI = \"\"'

View File

@ -44,22 +44,22 @@ syn match bbArrayBrackets "[\[\]]" contained
" BitBake strings
syn match bbContinue "\\$"
syn region bbString matchgroup=bbQuote start=+"+ skip=+\\$+ end=+"+ contained contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
syn region bbString matchgroup=bbQuote start=+'+ skip=+\\$+ end=+'+ contained contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
syn region bbString matchgroup=bbQuote start=+"+ skip=+\\$+ excludenl end=+"+ contained keepend contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
syn region bbString matchgroup=bbQuote start=+'+ skip=+\\$+ excludenl end=+'+ contained keepend contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
" Vars definition
syn match bbExport "^export" nextgroup=bbIdentifier skipwhite
syn keyword bbExportFlag export contained nextgroup=bbIdentifier skipwhite
syn match bbIdentifier "[a-zA-Z0-9\-_\.\/\+]\+" display contained
syn match bbVarDeref "${[a-zA-Z0-9\-_\.\/\+]\+}" contained
syn match bbVarEq "\(:=\|+=\|=+\|\.=\|=\.\|?=\|??=\|=\)" contained nextgroup=bbVarValue
syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.\/\+]\+\(_[${}a-zA-Z0-9\-_\.\/\+]\+\)\?\)\s*\(:=\|+=\|=+\|\.=\|=\.\|?=\|??=\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq
syn match bbVarEq "\(:=\|+=\|=+\|\.=\|=\.\|?=\|=\)" contained nextgroup=bbVarValue
syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.\/\+]\+\(_[${}a-zA-Z0-9\-_\.\/\+]\+\)\?\)\s*\(:=\|+=\|=+\|\.=\|=\.\|?=\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq
syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref,bbVarPyValue
syn region bbVarPyValue start=+${@+ skip=+\\$+ end=+}+ contained contains=@python
syn region bbVarPyValue start=+${@+ skip=+\\$+ excludenl end=+}+ contained contains=@python
" Vars metadata flags
syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag
syn region bbVarFlagFlag matchgroup=bbArrayBrackets start="\[" end="\]\s*\(=\|+=\|=+\|?=\)\@=" contained contains=bbIdentifier nextgroup=bbVarEq
syn region bbVarFlagFlag matchgroup=bbArrayBrackets start="\[" end="\]\s*\(=\)\@=" keepend excludenl contained contains=bbIdentifier nextgroup=bbVarEq
" Includes and requires
syn keyword bbInclude inherit include require contained
@ -83,16 +83,13 @@ if exists("b:current_syntax")
unlet b:current_syntax
endif
syn keyword bbShFakeRootFlag fakeroot contained
syn match bbShFuncDef "^\(fakeroot\s*\)\?\([0-9A-Za-z_${}-]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbShFuncRegion skipwhite
syn region bbShFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@shell
" Python value inside shell functions
syn region shDeref start=+${@+ skip=+\\$+ excludenl end=+}+ contained contains=@python
syn match bbShFuncDef "^\(fakeroot\s*\)\?\([0-9A-Za-z_-]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbDelimiter nextgroup=bbShFuncRegion skipwhite
syn region bbShFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@shell
" BitBake python metadata
syn keyword bbPyFlag python contained
syn match bbPyFuncDef "^\(python\s\+\)\([0-9A-Za-z_${}-]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPyFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbPyFuncRegion skipwhite
syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@python
syn match bbPyFuncDef "^\(python\s\+\)\([0-9A-Za-z_-]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPyFlag,bbFunction,bbDelimiter nextgroup=bbPyFuncRegion skipwhite
syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" keepend contained contains=@python
" BitBake 'def'd python functions
syn keyword bbPyDef def contained

View File

@ -1,91 +0,0 @@
# This is a single Makefile to handle all generated BitBake documents.
# The Makefile needs to live in the documentation directory and all figures used
# in any manuals must be .PNG files and live in the individual book's figures
# directory.
#
# The Makefile has these targets:
#
# pdf: generates a PDF version of a manual.
# html: generates an HTML version of a manual.
# tarball: creates a tarball for the doc files.
# validate: validates
# clean: removes files
#
# The Makefile generates an HTML version of every document. The
# variable DOC indicates the folder name for a given manual.
#
# To build a manual, you must invoke 'make' with the DOC argument.
#
# Examples:
#
# make DOC=bitbake-user-manual
# make pdf DOC=bitbake-user-manual
#
# The first example generates the HTML version of the User Manual.
# The second example generates the PDF version of the User Manual.
#
ifeq ($(DOC),bitbake-user-manual)
XSLTOPTS = --stringparam html.stylesheet bitbake-user-manual-style.css \
--stringparam chapter.autolabel 1 \
--stringparam section.autolabel 1 \
--stringparam section.label.includes.component.label 1 \
--xinclude
ALLPREQ = html tarball
TARFILES = bitbake-user-manual-style.css bitbake-user-manual.html figures/bitbake-title.png
MANUALS = $(DOC)/$(DOC).html
FIGURES = figures
STYLESHEET = $(DOC)/*.css
endif
##
# These URI should be rewritten by your distribution's xml catalog to
# match your localy installed XSL stylesheets.
XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/current
XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl
all: $(ALLPREQ)
pdf:
ifeq ($(DOC),bitbake-user-manual)
@echo " "
@echo "********** Building."$(DOC)
@echo " "
cd $(DOC); ../tools/docbook-to-pdf $(DOC).xml ../template; cd ..
endif
html:
ifeq ($(DOC),bitbake-user-manual)
# See http://www.sagehill.net/docbookxsl/HtmlOutput.html
@echo " "
@echo "******** Building "$(DOC)
@echo " "
cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
endif
tarball: html
@echo " "
@echo "******** Creating Tarball of document files"
@echo " "
cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd ..
validate:
cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd ..
publish:
@if test -f $(DOC)/$(DOC).html; \
then \
echo " "; \
echo "******** Publishing "$(DOC)".html"; \
echo " "; \
scp -r $(MANUALS) $(STYLESHEET) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
cd $(DOC); scp -r $(FIGURES) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
else \
echo " "; \
echo $(DOC)".html missing. Generate the file first then try again."; \
echo " "; \
fi
clean:
rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz;

View File

@ -1,39 +0,0 @@
Documentation
=============
This is the directory that contains the BitBake documentation.
Manual Organization
===================
Folders exist for individual manuals as follows:
* bitbake-user-manual - The BitBake User Manual
Each folder is self-contained regarding content and figures.
If you want to find HTML versions of the BitBake manuals on the web,
go to http://www.openembedded.org/wiki/Documentation.
Makefile
========
The Makefile processes manual directories to create HTML, PDF,
tarballs, etc. Details on how the Makefile work are documented
inside the Makefile. See that file for more information.
To build a manual, you run the make command and pass it the name
of the folder containing the manual's contents.
For example, the following command run from the documentation directory
creates an HTML and a PDF version of the BitBake User Manual.
The DOC variable specifies the manual you are making:
$ make DOC=bitbake-user-manual
template
========
Contains various templates, fonts, and some old PNG files.
tools
=====
Contains a tool to convert the DocBook files to PDF format.

View File

@ -1,29 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
<!--
<xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
<xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
-->
<xsl:include href="../template/permalinks.xsl"/>
<xsl:include href="../template/section.title.xsl"/>
<xsl:include href="../template/component.title.xsl"/>
<xsl:include href="../template/division.title.xsl"/>
<xsl:include href="../template/formal.object.heading.xsl"/>
<xsl:include href="../template/gloss-permalinks.xsl"/>
<xsl:param name="html.stylesheet" select="'user-manual-style.css'" />
<xsl:param name="chapter.autolabel" select="1" />
<xsl:param name="section.autolabel" select="1" />
<xsl:param name="section.label.includes.component.label" select="1" />
<xsl:param name="appendix.autolabel">A</xsl:param>
<!-- <xsl:param name="generate.toc" select="'article nop'"></xsl:param> -->
</xsl:stylesheet>

View File

@ -1,932 +0,0 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<chapter id="bitbake-user-manual-execution">
<title>Execution</title>
<para>
The primary purpose for running BitBake is to produce some kind
of output such as a single installable package, a kernel, a software
development kit, or even a full, board-specific bootable Linux image,
complete with bootloader, kernel, and root filesystem.
Of course, you can execute the <filename>bitbake</filename>
command with options that cause it to execute single tasks,
compile single recipe files, capture or clear data, or simply
return information about the execution environment.
</para>
<para>
This chapter describes BitBake's execution process from start
to finish when you use it to create an image.
The execution process is launched using the following command
form:
<literallayout class='monospaced'>
$ bitbake <replaceable>target</replaceable>
</literallayout>
For information on the BitBake command and its options,
see
"<link linkend='bitbake-user-manual-command'>The BitBake Command</link>"
section.
<note>
<para>
Prior to executing BitBake, you should take advantage of available
parallel thread execution on your build host by setting the
<link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link>
variable in your project's <filename>local.conf</filename>
configuration file.
</para>
<para>
A common method to determine this value for your build host is to run
the following:
<literallayout class='monospaced'>
$ grep processor /proc/cpuinfo
</literallayout>
This command returns the number of processors, which takes into
account hyper-threading.
Thus, a quad-core build host with hyper-threading most likely
shows eight processors, which is the value you would then assign to
<filename>BB_NUMBER_THREADS</filename>.
</para>
<para>
A possibly simpler solution is that some Linux distributions
(e.g. Debian and Ubuntu) provide the <filename>ncpus</filename> command.
</para>
</note>
</para>
<section id='parsing-the-base-configuration-metadata'>
<title>Parsing the Base Configuration Metadata</title>
<para>
The first thing BitBake does is parse base configuration
metadata.
Base configuration metadata consists of your project's
<filename>bblayers.conf</filename> file to determine what
layers BitBake needs to recognize, all necessary
<filename>layer.conf</filename> files (one from each layer),
and <filename>bitbake.conf</filename>.
The data itself is of various types:
<itemizedlist>
<listitem><para><emphasis>Recipes:</emphasis>
Details about particular pieces of software.
</para></listitem>
<listitem><para><emphasis>Class Data:</emphasis>
An abstraction of common build information
(e.g. how to build a Linux kernel).
</para></listitem>
<listitem><para><emphasis>Configuration Data:</emphasis>
Machine-specific settings, policy decisions,
and so forth.
Configuration data acts as the glue to bind everything
together.</para></listitem>
</itemizedlist>
</para>
<para>
The <filename>layer.conf</filename> files are used to
construct key variables such as
<link linkend='var-BBPATH'><filename>BBPATH</filename></link>
and
<link linkend='var-BBFILES'><filename>BBFILES</filename></link>.
<filename>BBPATH</filename> is used to search for
configuration and class files under the
<filename>conf</filename> and <filename>classes</filename>
directories, respectively.
<filename>BBFILES</filename> is used to locate both recipe
and recipe append files
(<filename>.bb</filename> and <filename>.bbappend</filename>).
If there is no <filename>bblayers.conf</filename> file,
it is assumed the user has set the <filename>BBPATH</filename>
and <filename>BBFILES</filename> directly in the environment.
</para>
<para>
Next, the <filename>bitbake.conf</filename> file is located
using the <filename>BBPATH</filename> variable that was
just constructed.
The <filename>bitbake.conf</filename> file may also include other
configuration files using the
<filename>include</filename> or
<filename>require</filename> directives.
</para>
<para>
Prior to parsing configuration files, Bitbake looks
at certain variables, including:
<itemizedlist>
<listitem><para>
<link linkend='var-BB_ENV_WHITELIST'><filename>BB_ENV_WHITELIST</filename></link>
</para></listitem>
<listitem><para>
<link linkend='var-BB_ENV_EXTRAWHITE'><filename>BB_ENV_EXTRAWHITE</filename></link>
</para></listitem>
<listitem><para>
<link linkend='var-BB_PRESERVE_ENV'><filename>BB_PRESERVE_ENV</filename></link>
</para></listitem>
<listitem><para>
<link linkend='var-BB_ORIGENV'><filename>BB_ORIGENV</filename></link>
</para></listitem>
<listitem><para>
<link linkend='var-BITBAKE_UI'><filename>BITBAKE_UI</filename></link>
</para></listitem>
</itemizedlist>
The first four variables in this list relate to how BitBake treats shell
environment variables during task execution.
By default, BitBake cleans the environment variables and provides tight
control over the shell execution environment.
However, through the use of these first four variables, you can
apply your control regarding the
environment variables allowed to be used by BitBake in the shell
during execution of tasks.
See the
"<link linkend='passing-information-into-the-build-task-environment'>Passing Information Into the Build Task Environment</link>"
section and the information about these variables in the
variable glossary for more information on how they work and
on how to use them.
</para>
<para>
The base configuration metadata is global
and therefore affects all recipes and tasks that are executed.
</para>
<para>
BitBake first searches the current working directory for an
optional <filename>conf/bblayers.conf</filename> configuration file.
This file is expected to contain a
<link linkend='var-BBLAYERS'><filename>BBLAYERS</filename></link>
variable that is a space-delimited list of 'layer' directories.
Recall that if BitBake cannot find a <filename>bblayers.conf</filename>
file, then it is assumed the user has set the <filename>BBPATH</filename>
and <filename>BBFILES</filename> variables directly in the environment.
</para>
<para>
For each directory (layer) in this list, a <filename>conf/layer.conf</filename>
file is located and parsed with the
<link linkend='var-LAYERDIR'><filename>LAYERDIR</filename></link>
variable being set to the directory where the layer was found.
The idea is these files automatically set up
<link linkend='var-BBPATH'><filename>BBPATH</filename></link>
and other variables correctly for a given build directory.
</para>
<para>
BitBake then expects to find the <filename>conf/bitbake.conf</filename>
file somewhere in the user-specified <filename>BBPATH</filename>.
That configuration file generally has include directives to pull
in any other metadata such as files specific to the architecture,
the machine, the local environment, and so forth.
</para>
<para>
Only variable definitions and include directives are allowed
in BitBake <filename>.conf</filename> files.
Some variables directly influence BitBake's behavior.
These variables might have been set from the environment
depending on the environment variables previously
mentioned or set in the configuration files.
The
"<link linkend='ref-variables-glos'>Variables Glossary</link>"
chapter presents a full list of variables.
</para>
<para>
After parsing configuration files, BitBake uses its rudimentary
inheritance mechanism, which is through class files, to inherit
some standard classes.
BitBake parses a class when the inherit directive responsible
for getting that class is encountered.
</para>
<para>
The <filename>base.bbclass</filename> file is always included.
Other classes that are specified in the configuration using the
<link linkend='var-INHERIT'><filename>INHERIT</filename></link>
variable are also included.
BitBake searches for class files in a
<filename>classes</filename> subdirectory under
the paths in <filename>BBPATH</filename> in the same way as
configuration files.
</para>
<para>
A good way to get an idea of the configuration files and
the class files used in your execution environment is to
run the following BitBake command:
<literallayout class='monospaced'>
$ bitbake -e > mybb.log
</literallayout>
Examining the top of the <filename>mybb.log</filename>
shows you the many configuration files and class files
used in your execution environment.
</para>
<note>
<para>
You need to be aware of how BitBake parses curly braces.
If a recipe uses a closing curly brace within the function and
the character has no leading spaces, BitBake produces a parsing
error.
If you use a pair of curly braces in a shell function, the
closing curly brace must not be located at the start of the line
without leading spaces.
</para>
<para>
Here is an example that causes BitBake to produce a parsing
error:
<literallayout class='monospaced'>
fakeroot create_shar() {
cat &lt;&lt; "EOF" &gt; ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
usage()
{
echo "test"
###### The following "}" at the start of the line causes a parsing error ######
}
EOF
}
</literallayout>
Writing the recipe this way avoids the error:
<literallayout class='monospaced'>
fakeroot create_shar() {
cat &lt;&lt; "EOF" &gt; ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
usage()
{
echo "test"
######The following "}" with a leading space at the start of the line avoids the error ######
}
EOF
}
</literallayout>
</para>
</note>
</section>
<section id='locating-and-parsing-recipes'>
<title>Locating and Parsing Recipes</title>
<para>
During the configuration phase, BitBake will have set
<link linkend='var-BBFILES'><filename>BBFILES</filename></link>.
BitBake now uses it to construct a list of recipes to parse,
along with any append files (<filename>.bbappend</filename>)
to apply.
<filename>BBFILES</filename> is a space-separated list of
available files and supports wildcards.
An example would be:
<literallayout class='monospaced'>
BBFILES = "/path/to/bbfiles/*.bb /path/to/appends/*.bbappend"
</literallayout>
BitBake parses each recipe and append file located
with <filename>BBFILES</filename> and stores the values of
various variables into the datastore.
<note>
Append files are applied in the order they are encountered in
<filename>BBFILES</filename>.
</note>
For each file, a fresh copy of the base configuration is
made, then the recipe is parsed line by line.
Any inherit statements cause BitBake to find and
then parse class files (<filename>.bbclass</filename>)
using
<link linkend='var-BBPATH'><filename>BBPATH</filename></link>
as the search path.
Finally, BitBake parses in order any append files found in
<filename>BBFILES</filename>.
</para>
<para>
One common convention is to use the recipe filename to define
pieces of metadata.
For example, in <filename>bitbake.conf</filename> the recipe
name and version are used to set the variables
<link linkend='var-PN'><filename>PN</filename></link> and
<link linkend='var-PV'><filename>PV</filename></link>:
<literallayout class='monospaced'>
PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
</literallayout>
In this example, a recipe called "something_1.2.3.bb" would set
<filename>PN</filename> to "something" and
<filename>PV</filename> to "1.2.3".
</para>
<para>
By the time parsing is complete for a recipe, BitBake
has a list of tasks that the recipe defines and a set of
data consisting of keys and values as well as
dependency information about the tasks.
</para>
<para>
BitBake does not need all of this information.
It only needs a small subset of the information to make
decisions about the recipe.
Consequently, BitBake caches the values in which it is
interested and does not store the rest of the information.
Experience has shown it is faster to re-parse the metadata than to
try and write it out to the disk and then reload it.
</para>
<para>
Where possible, subsequent BitBake commands reuse this cache of
recipe information.
The validity of this cache is determined by first computing a
checksum of the base configuration data (see
<link linkend='var-BB_HASHCONFIG_WHITELIST'><filename>BB_HASHCONFIG_WHITELIST</filename></link>)
and then checking if the checksum matches.
If that checksum matches what is in the cache and the recipe
and class files have not changed, Bitbake is able to use
the cache.
BitBake then reloads the cached information about the recipe
instead of reparsing it from scratch.
</para>
<para>
Recipe file collections exist to allow the user to
have multiple repositories of
<filename>.bb</filename> files that contain the same
exact package.
For example, one could easily use them to make one's
own local copy of an upstream repository, but with
custom modifications that one does not want upstream.
Here is an example:
<literallayout class='monospaced'>
BBFILES = "/stuff/openembedded/*/*.bb /stuff/openembedded.modified/*/*.bb"
BBFILE_COLLECTIONS = "upstream local"
BBFILE_PATTERN_upstream = "^/stuff/openembedded/"
BBFILE_PATTERN_local = "^/stuff/openembedded.modified/"
BBFILE_PRIORITY_upstream = "5"
BBFILE_PRIORITY_local = "10"
</literallayout>
<note>
The layers mechanism is now the preferred method of collecting
code.
While the collections code remains, its main use is to set layer
priorities and to deal with overlap (conflicts) between layers.
</note>
</para>
</section>
<section id='bb-bitbake-providers'>
<title>Providers</title>
<para>
Assuming BitBake has been instructed to execute a target
and that all the recipe files have been parsed, BitBake
starts to figure out how to build the target.
BitBake looks through the <filename>PROVIDES</filename> list
for each of the recipes.
A <filename>PROVIDES</filename> list is the list of names by which
the recipe can be known.
Each recipe's <filename>PROVIDES</filename> list is created
implicitly through the recipe's
<link linkend='var-PN'><filename>PN</filename></link> variable
and explicitly through the recipe's
<link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>
variable, which is optional.
</para>
<para>
When a recipe uses <filename>PROVIDES</filename>, that recipe's
functionality can be found under an alternative name or names other
than the implicit <filename>PN</filename> name.
As an example, suppose a recipe named <filename>keyboard_1.0.bb</filename>
contained the following:
<literallayout class='monospaced'>
PROVIDES += "fullkeyboard"
</literallayout>
The <filename>PROVIDES</filename> list for this recipe becomes
"keyboard", which is implicit, and "fullkeyboard", which is explicit.
Consequently, the functionality found in
<filename>keyboard_1.0.bb</filename> can be found under two
different names.
</para>
</section>
<section id='bb-bitbake-preferences'>
<title>Preferences</title>
<para>
The <filename>PROVIDES</filename> list is only part of the solution
for figuring out a target's recipes.
Because targets might have multiple providers, BitBake needs
to prioritize providers by determining provider preferences.
</para>
<para>
A common example in which a target has multiple providers
is "virtual/kernel", which is on the
<filename>PROVIDES</filename> list for each kernel recipe.
Each machine often selects the best kernel provider by using a
line similar to the following in the machine configuration file:
<literallayout class='monospaced'>
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
</literallayout>
The default
<link linkend='var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></link>
is the provider with the same name as the target.
Bitbake iterates through each target it needs to build and
resolves them and their dependencies using this process.
</para>
<para>
Understanding how providers are chosen is made complicated by the fact
that multiple versions might exist for a given provider.
BitBake defaults to the highest version of a provider.
Version comparisons are made using the same method as Debian.
You can use the
<link linkend='var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></link>
variable to specify a particular version.
You can influence the order by using the
<link linkend='var-DEFAULT_PREFERENCE'><filename>DEFAULT_PREFERENCE</filename></link>
variable.
</para>
<para>
By default, files have a preference of "0".
Setting <filename>DEFAULT_PREFERENCE</filename> to "-1" makes the
recipe unlikely to be used unless it is explicitly referenced.
Setting <filename>DEFAULT_PREFERENCE</filename> to "1" makes it
likely the recipe is used.
<filename>PREFERRED_VERSION</filename> overrides any
<filename>DEFAULT_PREFERENCE</filename> setting.
<filename>DEFAULT_PREFERENCE</filename> is often used to mark newer
and more experimental recipe versions until they have undergone
sufficient testing to be considered stable.
</para>
<para>
When there are multiple “versions” of a given recipe,
BitBake defaults to selecting the most recent
version, unless otherwise specified.
If the recipe in question has a
<link linkend='var-DEFAULT_PREFERENCE'><filename>DEFAULT_PREFERENCE</filename></link>
set lower than the other recipes (default is 0), then
it will not be selected.
This allows the person or persons maintaining
the repository of recipe files to specify
their preference for the default selected version.
Additionally, the user can specify their preferred version.
</para>
<para>
If the first recipe is named <filename>a_1.1.bb</filename>, then the
<link linkend='var-PN'><filename>PN</filename></link> variable
will be set to “a”, and the
<link linkend='var-PV'><filename>PV</filename></link>
variable will be set to 1.1.
</para>
<para>
Thus, if a recipe named <filename>a_1.2.bb</filename> exists, BitBake
will choose 1.2 by default.
However, if you define the following variable in a
<filename>.conf</filename> file that BitBake parses, you
can change that preference:
<literallayout class='monospaced'>
PREFERRED_VERSION_a = "1.1"
</literallayout>
</para>
<note>
<para>
It is common for a recipe to provide two versions -- a stable,
numbered (and preferred) version, and a version that is
automatically checked out from a source code repository that
is considered more "bleeding edge" but can be selected only
explicitly.
</para>
<para>
For example, in the OpenEmbedded codebase, there is a standard,
versioned recipe file for BusyBox,
<filename>busybox_1.22.1.bb</filename>,
but there is also a Git-based version,
<filename>busybox_git.bb</filename>, which explicitly contains the line
<literallayout class='monospaced'>
DEFAULT_PREFERENCE = "-1"
</literallayout>
to ensure that the numbered, stable version is always preferred
unless the developer selects otherwise.
</para>
</note>
</section>
<section id='bb-bitbake-dependencies'>
<title>Dependencies</title>
<para>
Each target BitBake builds consists of multiple tasks such as
<filename>fetch</filename>, <filename>unpack</filename>,
<filename>patch</filename>, <filename>configure</filename>,
and <filename>compile</filename>.
For best performance on multi-core systems, BitBake considers each
task as an independent
entity with its own set of dependencies.
</para>
<para>
Dependencies are defined through several variables.
You can find information about variables BitBake uses in
the <link linkend='ref-variables-glos'>Variables Glossary</link>
near the end of this manual.
At a basic level, it is sufficient to know that BitBake uses the
<link linkend='var-DEPENDS'><filename>DEPENDS</filename></link> and
<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link> variables when
calculating dependencies.
</para>
<para>
For more information on how BitBake handles dependencies, see the
"<link linkend='dependencies'>Dependencies</link>" section.
</para>
</section>
<section id='ref-bitbake-tasklist'>
<title>The Task List</title>
<para>
Based on the generated list of providers and the dependency information,
BitBake can now calculate exactly what tasks it needs to run and in what
order it needs to run them.
The
"<link linkend='executing-tasks'>Executing Tasks</link>" section has more
information on how BitBake chooses which task to execute next.
</para>
<para>
The build now starts with BitBake forking off threads up to the limit set in the
<link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link>
variable.
BitBake continues to fork threads as long as there are tasks ready to run,
those tasks have all their dependencies met, and the thread threshold has not been
exceeded.
</para>
<para>
It is worth noting that you can greatly speed up the build time by properly setting
the <filename>BB_NUMBER_THREADS</filename> variable.
</para>
<para>
As each task completes, a timestamp is written to the directory specified by the
<link linkend='var-STAMP'><filename>STAMP</filename></link> variable.
On subsequent runs, BitBake looks in the build directory within
<filename>tmp/stamps</filename> and does not rerun
tasks that are already completed unless a timestamp is found to be invalid.
Currently, invalid timestamps are only considered on a per
recipe file basis.
So, for example, if the configure stamp has a timestamp greater than the
compile timestamp for a given target, then the compile task would rerun.
Running the compile task again, however, has no effect on other providers
that depend on that target.
</para>
<para>
The exact format of the stamps is partly configurable.
In modern versions of BitBake, a hash is appended to the
stamp so that if the configuration changes, the stamp becomes
invalid and the task is automatically rerun.
This hash, or signature used, is governed by the signature policy
that is configured (see the
"<link linkend='checksums'>Checksums (Signatures)</link>"
section for information).
It is also possible to append extra metadata to the stamp using
the <filename>[stamp-extra-info]</filename> task flag.
For example, OpenEmbedded uses this flag to make some tasks machine-specific.
</para>
<note>
Some tasks are marked as "nostamp" tasks.
No timestamp file is created when these tasks are run.
Consequently, "nostamp" tasks are always rerun.
</note>
<para>
For more information on tasks, see the
"<link linkend='tasks'>Tasks</link>" section.
</para>
</section>
<section id='executing-tasks'>
<title>Executing Tasks</title>
<para>
Tasks can be either a shell task or a Python task.
For shell tasks, BitBake writes a shell script to
<filename>${</filename><link linkend='var-T'><filename>T</filename></link><filename>}/run.do_taskname.pid</filename>
and then executes the script.
The generated shell script contains all the exported variables,
and the shell functions with all variables expanded.
Output from the shell script goes to the file
<filename>${T}/log.do_taskname.pid</filename>.
Looking at the expanded shell functions in the run file and
the output in the log files is a useful debugging technique.
</para>
<para>
For Python tasks, BitBake executes the task internally and logs
information to the controlling terminal.
Future versions of BitBake will write the functions to files
similar to the way shell tasks are handled.
Logging will be handled in a way similar to shell tasks as well.
</para>
<para>
The order in which BitBake runs the tasks is controlled by its
task scheduler.
It is possible to configure the scheduler and define custom
implementations for specific use cases.
For more information, see these variables that control the
behavior:
<itemizedlist>
<listitem><para>
<link linkend='var-BB_SCHEDULER'><filename>BB_SCHEDULER</filename></link>
</para></listitem>
<listitem><para>
<link linkend='var-BB_SCHEDULERS'><filename>BB_SCHEDULERS</filename></link>
</para></listitem>
</itemizedlist>
It is possible to have functions run before and after a task's main
function.
This is done using the <filename>[prefuncs]</filename>
and <filename>[postfuncs]</filename> flags of the task
that lists the functions to run.
</para>
</section>
<section id='checksums'>
<title>Checksums (Signatures)</title>
<para>
A checksum is a unique signature of a task's inputs.
The signature of a task can be used to determine if a task
needs to be run.
Because it is a change in a task's inputs that triggers running
the task, BitBake needs to detect all the inputs to a given task.
For shell tasks, this turns out to be fairly easy because
BitBake generates a "run" shell script for each task and
it is possible to create a checksum that gives you a good idea of when
the task's data changes.
</para>
<para>
To complicate the problem, some things should not be included in
the checksum.
First, there is the actual specific build path of a given task -
the working directory.
It does not matter if the working directory changes because it should not
affect the output for target packages.
The simplistic approach for excluding the working directory is to set
it to some fixed value and create the checksum for the "run" script.
BitBake goes one step better and uses the
<link linkend='var-BB_HASHBASE_WHITELIST'><filename>BB_HASHBASE_WHITELIST</filename></link>
variable to define a list of variables that should never be included
when generating the signatures.
</para>
<para>
Another problem results from the "run" scripts containing functions that
might or might not get called.
The incremental build solution contains code that figures out dependencies
between shell functions.
This code is used to prune the "run" scripts down to the minimum set,
thereby alleviating this problem and making the "run" scripts much more
readable as a bonus.
</para>
<para>
So far we have solutions for shell scripts.
What about Python tasks?
The same approach applies even though these tasks are more difficult.
The process needs to figure out what variables a Python function accesses
and what functions it calls.
Again, the incremental build solution contains code that first figures out
the variable and function dependencies, and then creates a checksum for the data
used as the input to the task.
</para>
<para>
Like the working directory case, situations exist where dependencies
should be ignored.
For these cases, you can instruct the build process to ignore a dependency
by using a line like the following:
<literallayout class='monospaced'>
PACKAGE_ARCHS[vardepsexclude] = "MACHINE"
</literallayout>
This example ensures that the <filename>PACKAGE_ARCHS</filename> variable does not
depend on the value of <filename>MACHINE</filename>, even if it does reference it.
</para>
<para>
Equally, there are cases where we need to add dependencies BitBake
is not able to find.
You can accomplish this by using a line like the following:
<literallayout class='monospaced'>
PACKAGE_ARCHS[vardeps] = "MACHINE"
</literallayout>
This example explicitly adds the <filename>MACHINE</filename> variable as a
dependency for <filename>PACKAGE_ARCHS</filename>.
</para>
<para>
Consider a case with in-line Python, for example, where BitBake is not
able to figure out dependencies.
When running in debug mode (i.e. using <filename>-DDD</filename>), BitBake
produces output when it discovers something for which it cannot figure out
dependencies.
</para>
<para>
Thus far, this section has limited discussion to the direct inputs into a task.
Information based on direct inputs is referred to as the "basehash" in the
code.
However, there is still the question of a task's indirect inputs - the
things that were already built and present in the build directory.
The checksum (or signature) for a particular task needs to add the hashes
of all the tasks on which the particular task depends.
Choosing which dependencies to add is a policy decision.
However, the effect is to generate a master checksum that combines the basehash
and the hashes of the task's dependencies.
</para>
<para>
At the code level, there are a variety of ways both the basehash and the
dependent task hashes can be influenced.
Within the BitBake configuration file, we can give BitBake some extra information
to help it construct the basehash.
The following statement effectively results in a list of global variable
dependency excludes - variables never included in any checksum.
This example uses variables from OpenEmbedded to help illustrate
the concept:
<literallayout class='monospaced'>
BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \
SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE LICENSE_PATH SDKPKGSUFFIX"
</literallayout>
The previous example excludes the work directory, which is part of
<filename>TMPDIR</filename>.
</para>
<para>
The rules for deciding which hashes of dependent tasks to include through
dependency chains are more complex and are generally accomplished with a
Python function.
The code in <filename>meta/lib/oe/sstatesig.py</filename> shows two examples
of this and also illustrates how you can insert your own policy into the system
if so desired.
This file defines the two basic signature generators OpenEmbedded Core
uses: "OEBasic" and "OEBasicHash".
By default, there is a dummy "noop" signature handler enabled in BitBake.
This means that behavior is unchanged from previous versions.
<filename>OE-Core</filename> uses the "OEBasicHash" signature handler by default
through this setting in the <filename>bitbake.conf</filename> file:
<literallayout class='monospaced'>
BB_SIGNATURE_HANDLER ?= "OEBasicHash"
</literallayout>
The "OEBasicHash" <filename>BB_SIGNATURE_HANDLER</filename> is the same as the
"OEBasic" version but adds the task hash to the stamp files.
This results in any metadata change that changes the task hash, automatically
causing the task to be run again.
This removes the need to bump
<link linkend='var-PR'><filename>PR</filename></link>
values, and changes to metadata automatically ripple across the build.
</para>
<para>
It is also worth noting that the end result of these signature generators is to
make some dependency and hash information available to the build.
This information includes:
<itemizedlist>
<listitem><para><filename>BB_BASEHASH_task-</filename><replaceable>taskname</replaceable>:
The base hashes for each task in the recipe.
</para></listitem>
<listitem><para><filename>BB_BASEHASH_</filename><replaceable>filename</replaceable><filename>:</filename><replaceable>taskname</replaceable>:
The base hashes for each dependent task.
</para></listitem>
<listitem><para><filename>BBHASHDEPS_</filename><replaceable>filename</replaceable><filename>:</filename><replaceable>taskname</replaceable>:
The task dependencies for each task.
</para></listitem>
<listitem><para><filename>BB_TASKHASH</filename>:
The hash of the currently running task.
</para></listitem>
</itemizedlist>
</para>
<para>
It is worth noting that BitBake's "-S" option lets you
debug Bitbake's processing of signatures.
The options passed to -S allow different debugging modes
to be used, either using BitBake's own debug functions
or possibly those defined in the metadata/signature handler
itself.
The simplest parameter to pass is "none", which causes a
set of signature information to be written out into
<filename>STAMPS_DIR</filename>
corresponding to the targets specified.
The other currently available parameter is "printdiff",
which causes BitBake to try to establish the closest
signature match it can (e.g. in the sstate cache) and then
run <filename>bitbake-diffsigs</filename> over the matches
to determine the stamps and delta where these two
stamp trees diverge.
<note>
It is likely that future versions of BitBake will
provide other signature handlers triggered through
additional "-S" parameters.
</note>
</para>
<para>
You can find more information on checksum metadata in the
"<link linkend='task-checksums-and-setscene'>Task Checksums and Setscene</link>"
section.
</para>
</section>
<section id='setscene'>
<title>Setscene</title>
<para>
The setscene process enables BitBake to handle "pre-built" artifacts.
The ability to handle and reuse these artifacts allows BitBake
the luxury of not having to build something from scratch every time.
Instead, BitBake can use, when possible, existing build artifacts.
</para>
<para>
BitBake needs to have reliable data indicating whether or not an
artifact is compatible.
Signatures, described in the previous section, provide an ideal
way of representing whether an artifact is compatible.
If a signature is the same, an object can be reused.
</para>
<para>
If an object can be reused, the problem then becomes how to
replace a given task or set of tasks with the pre-built artifact.
BitBake solves the problem with the "setscene" process.
</para>
<para>
When BitBake is asked to build a given target, before building anything,
it first asks whether cached information is available for any of the
targets it's building, or any of the intermediate targets.
If cached information is available, BitBake uses this information instead of
running the main tasks.
</para>
<para>
BitBake first calls the function defined by the
<link linkend='var-BB_HASHCHECK_FUNCTION'><filename>BB_HASHCHECK_FUNCTION</filename></link>
variable with a list of tasks and corresponding
hashes it wants to build.
This function is designed to be fast and returns a list
of the tasks for which it believes in can obtain artifacts.
</para>
<para>
Next, for each of the tasks that were returned as possibilities,
BitBake executes a setscene version of the task that the possible
artifact covers.
Setscene versions of a task have the string "_setscene" appended to the
task name.
So, for example, the task with the name <filename>xxx</filename> has
a setscene task named <filename>xxx_setscene</filename>.
The setscene version of the task executes and provides the necessary
artifacts returning either success or failure.
</para>
<para>
As previously mentioned, an artifact can cover more than one task.
For example, it is pointless to obtain a compiler if you
already have the compiled binary.
To handle this, BitBake calls the
<link linkend='var-BB_SETSCENE_DEPVALID'><filename>BB_SETSCENE_DEPVALID</filename></link>
function for each successful setscene task to know whether or not it needs
to obtain the dependencies of that task.
</para>
<para>
Finally, after all the setscene tasks have executed, BitBake calls the
function listed in
<link linkend='var-BB_SETSCENE_VERIFY_FUNCTION2'><filename>BB_SETSCENE_VERIFY_FUNCTION2</filename></link>
with the list of tasks BitBake thinks has been "covered".
The metadata can then ensure that this list is correct and can
inform BitBake that it wants specific tasks to be run regardless
of the setscene result.
</para>
<para>
You can find more information on setscene metadata in the
"<link linkend='task-checksums-and-setscene'>Task Checksums and Setscene</link>"
section.
</para>
</section>
</chapter>

View File

@ -1,829 +0,0 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<chapter>
<title>File Download Support</title>
<para>
BitBake's fetch module is a standalone piece of library code
that deals with the intricacies of downloading source code
and files from remote systems.
Fetching source code is one of the cornerstones of building software.
As such, this module forms an important part of BitBake.
</para>
<para>
The current fetch module is called "fetch2" and refers to the
fact that it is the second major version of the API.
The original version is obsolete and has been removed from the codebase.
Thus, in all cases, "fetch" refers to "fetch2" in this
manual.
</para>
<section id='the-download-fetch'>
<title>The Download (Fetch)</title>
<para>
BitBake takes several steps when fetching source code or files.
The fetcher codebase deals with two distinct processes in order:
obtaining the files from somewhere (cached or otherwise)
and then unpacking those files into a specific location and
perhaps in a specific way.
Getting and unpacking the files is often optionally followed
by patching.
Patching, however, is not covered by this module.
</para>
<para>
The code to execute the first part of this process, a fetch,
looks something like the following:
<literallayout class='monospaced'>
src_uri = (d.getVar('SRC_URI') or "").split()
fetcher = bb.fetch2.Fetch(src_uri, d)
fetcher.download()
</literallayout>
This code sets up an instance of the fetch class.
The instance uses a space-separated list of URLs from the
<link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
variable and then calls the <filename>download</filename>
method to download the files.
</para>
<para>
The instantiation of the fetch class is usually followed by:
<literallayout class='monospaced'>
rootdir = l.getVar('WORKDIR')
fetcher.unpack(rootdir)
</literallayout>
This code unpacks the downloaded files to the
specified by <filename>WORKDIR</filename>.
<note>
For convenience, the naming in these examples matches
the variables used by OpenEmbedded.
If you want to see the above code in action, examine
the OpenEmbedded class file <filename>base.bbclass</filename>.
</note>
The <filename>SRC_URI</filename> and <filename>WORKDIR</filename>
variables are not hardcoded into the fetcher, since those fetcher
methods can be (and are) called with different variable names.
In OpenEmbedded for example, the shared state (sstate) code uses
the fetch module to fetch the sstate files.
</para>
<para>
When the <filename>download()</filename> method is called,
BitBake tries to resolve the URLs by looking for source files
in a specific search order:
<itemizedlist>
<listitem><para><emphasis>Pre-mirror Sites:</emphasis>
BitBake first uses pre-mirrors to try and find source files.
These locations are defined using the
<link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
variable.
</para></listitem>
<listitem><para><emphasis>Source URI:</emphasis>
If pre-mirrors fail, BitBake uses the original URL (e.g from
<filename>SRC_URI</filename>).
</para></listitem>
<listitem><para><emphasis>Mirror Sites:</emphasis>
If fetch failures occur, BitBake next uses mirror locations as
defined by the
<link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>
variable.
</para></listitem>
</itemizedlist>
</para>
<para>
For each URL passed to the fetcher, the fetcher
calls the submodule that handles that particular URL type.
This behavior can be the source of some confusion when you
are providing URLs for the <filename>SRC_URI</filename>
variable.
Consider the following two URLs:
<literallayout class='monospaced'>
http://git.yoctoproject.org/git/poky;protocol=git
git://git.yoctoproject.org/git/poky;protocol=http
</literallayout>
In the former case, the URL is passed to the
<filename>wget</filename> fetcher, which does not
understand "git".
Therefore, the latter case is the correct form since the
Git fetcher does know how to use HTTP as a transport.
</para>
<para>
Here are some examples that show commonly used mirror
definitions:
<literallayout class='monospaced'>
PREMIRRORS ?= "\
bzr://.*/.* http://somemirror.org/sources/ \n \
cvs://.*/.* http://somemirror.org/sources/ \n \
git://.*/.* http://somemirror.org/sources/ \n \
hg://.*/.* http://somemirror.org/sources/ \n \
osc://.*/.* http://somemirror.org/sources/ \n \
p4://.*/.* http://somemirror.org/sources/ \n \
svn://.*/.* http://somemirror.org/sources/ \n"
MIRRORS =+ "\
ftp://.*/.* http://somemirror.org/sources/ \n \
http://.*/.* http://somemirror.org/sources/ \n \
https://.*/.* http://somemirror.org/sources/ \n"
</literallayout>
It is useful to note that BitBake supports
cross-URLs.
It is possible to mirror a Git repository on an HTTP
server as a tarball.
This is what the <filename>git://</filename> mapping in
the previous example does.
</para>
<para>
Since network accesses are slow, Bitbake maintains a
cache of files downloaded from the network.
Any source files that are not local (i.e.
downloaded from the Internet) are placed into the download
directory, which is specified by the
<link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
variable.
</para>
<para>
File integrity is of key importance for reproducing builds.
For non-local archive downloads, the fetcher code can verify
SHA-256 and MD5 checksums to ensure the archives have been
downloaded correctly.
You can specify these checksums by using the
<filename>SRC_URI</filename> variable with the appropriate
varflags as follows:
<literallayout class='monospaced'>
SRC_URI[md5sum] = "<replaceable>value</replaceable>"
SRC_URI[sha256sum] = "<replaceable>value</replaceable>"
</literallayout>
You can also specify the checksums as parameters on the
<filename>SRC_URI</filename> as shown below:
<literallayout class='monospaced'>
SRC_URI = "http://example.com/foobar.tar.bz2;md5sum=4a8e0f237e961fd7785d19d07fdb994d"
</literallayout>
If multiple URIs exist, you can specify the checksums either
directly as in the previous example, or you can name the URLs.
The following syntax shows how you name the URIs:
<literallayout class='monospaced'>
SRC_URI = "http://example.com/foobar.tar.bz2;name=foo"
SRC_URI[foo.md5sum] = 4a8e0f237e961fd7785d19d07fdb994d
</literallayout>
After a file has been downloaded and has had its checksum checked,
a ".done" stamp is placed in <filename>DL_DIR</filename>.
BitBake uses this stamp during subsequent builds to avoid
downloading or comparing a checksum for the file again.
<note>
It is assumed that local storage is safe from data corruption.
If this were not the case, there would be bigger issues to worry about.
</note>
</para>
<para>
If
<link linkend='var-BB_STRICT_CHECKSUM'><filename>BB_STRICT_CHECKSUM</filename></link>
is set, any download without a checksum triggers an
error message.
The
<link linkend='var-BB_NO_NETWORK'><filename>BB_NO_NETWORK</filename></link>
variable can be used to make any attempted network access a fatal
error, which is useful for checking that mirrors are complete
as well as other things.
</para>
</section>
<section id='bb-the-unpack'>
<title>The Unpack</title>
<para>
The unpack process usually immediately follows the download.
For all URLs except Git URLs, BitBake uses the common
<filename>unpack</filename> method.
</para>
<para>
A number of parameters exist that you can specify within the
URL to govern the behavior of the unpack stage:
<itemizedlist>
<listitem><para><emphasis>unpack:</emphasis>
Controls whether the URL components are unpacked.
If set to "1", which is the default, the components
are unpacked.
If set to "0", the unpack stage leaves the file alone.
This parameter is useful when you want an archive to be
copied in and not be unpacked.
</para></listitem>
<listitem><para><emphasis>dos:</emphasis>
Applies to <filename>.zip</filename> and
<filename>.jar</filename> files and specifies whether to
use DOS line ending conversion on text files.
</para></listitem>
<listitem><para><emphasis>basepath:</emphasis>
Instructs the unpack stage to strip the specified
directories from the source path when unpacking.
</para></listitem>
<listitem><para><emphasis>subdir:</emphasis>
Unpacks the specific URL to the specified subdirectory
within the root directory.
</para></listitem>
</itemizedlist>
The unpack call automatically decompresses and extracts files
with ".Z", ".z", ".gz", ".xz", ".zip", ".jar", ".ipk", ".rpm".
".srpm", ".deb" and ".bz2" extensions as well as various combinations
of tarball extensions.
</para>
<para>
As mentioned, the Git fetcher has its own unpack method that
is optimized to work with Git trees.
Basically, this method works by cloning the tree into the final
directory.
The process is completed using references so that there is
only one central copy of the Git metadata needed.
</para>
</section>
<section id='bb-fetchers'>
<title>Fetchers</title>
<para>
As mentioned earlier, the URL prefix determines which
fetcher submodule BitBake uses.
Each submodule can support different URL parameters,
which are described in the following sections.
</para>
<section id='local-file-fetcher'>
<title>Local file fetcher (<filename>file://</filename>)</title>
<para>
This submodule handles URLs that begin with
<filename>file://</filename>.
The filename you specify within the URL can be
either an absolute or relative path to a file.
If the filename is relative, the contents of the
<link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>
variable is used in the same way
<filename>PATH</filename> is used to find executables.
If the file cannot be found, it is assumed that it is available in
<link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
by the time the <filename>download()</filename> method is called.
</para>
<para>
If you specify a directory, the entire directory is
unpacked.
</para>
<para>
Here are a couple of example URLs, the first relative and
the second absolute:
<literallayout class='monospaced'>
SRC_URI = "file://relativefile.patch"
SRC_URI = "file:///Users/ich/very_important_software"
</literallayout>
</para>
</section>
<section id='http-ftp-fetcher'>
<title>HTTP/FTP wget fetcher (<filename>http://</filename>, <filename>ftp://</filename>, <filename>https://</filename>)</title>
<para>
This fetcher obtains files from web and FTP servers.
Internally, the fetcher uses the wget utility.
</para>
<para>
The executable and parameters used are specified by the
<filename>FETCHCMD_wget</filename> variable, which defaults
to sensible values.
The fetcher supports a parameter "downloadfilename" that
allows the name of the downloaded file to be specified.
Specifying the name of the downloaded file is useful
for avoiding collisions in
<link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
when dealing with multiple files that have the same name.
</para>
<para>
Some example URLs are as follows:
<literallayout class='monospaced'>
SRC_URI = "http://oe.handhelds.org/not_there.aac"
SRC_URI = "ftp://oe.handhelds.org/not_there_as_well.aac"
SRC_URI = "ftp://you@oe.handhelds.org/home/you/secret.plan"
</literallayout>
</para>
<note>
Because URL parameters are delimited by semi-colons, this can
introduce ambiguity when parsing URLs that also contain semi-colons,
for example:
<literallayout class='monospaced'>
SRC_URI = "http://abc123.org/git/?p=gcc/gcc.git;a=snapshot;h=a5dd47"
</literallayout>
Such URLs should should be modified by replacing semi-colons with '&amp;' characters:
<literallayout class='monospaced'>
SRC_URI = "http://abc123.org/git/?p=gcc/gcc.git&amp;a=snapshot&amp;h=a5dd47"
</literallayout>
In most cases this should work. Treating semi-colons and '&amp;' in queries
identically is recommended by the World Wide Web Consortium (W3C).
Note that due to the nature of the URL, you may have to specify the name
of the downloaded file as well:
<literallayout class='monospaced'>
SRC_URI = "http://abc123.org/git/?p=gcc/gcc.git&amp;a=snapshot&amp;h=a5dd47;downloadfilename=myfile.bz2"
</literallayout>
</note>
</section>
<section id='cvs-fetcher'>
<title>CVS fetcher (<filename>(cvs://</filename>)</title>
<para>
This submodule handles checking out files from the
CVS version control system.
You can configure it using a number of different variables:
<itemizedlist>
<listitem><para><emphasis><filename>FETCHCMD_cvs</filename>:</emphasis>
The name of the executable to use when running
the <filename>cvs</filename> command.
This name is usually "cvs".
</para></listitem>
<listitem><para><emphasis><filename>SRCDATE</filename>:</emphasis>
The date to use when fetching the CVS source code.
A special value of "now" causes the checkout to
be updated on every build.
</para></listitem>
<listitem><para><emphasis><link linkend='var-CVSDIR'><filename>CVSDIR</filename></link>:</emphasis>
Specifies where a temporary checkout is saved.
The location is often <filename>DL_DIR/cvs</filename>.
</para></listitem>
<listitem><para><emphasis><filename>CVS_PROXY_HOST</filename>:</emphasis>
The name to use as a "proxy=" parameter to the
<filename>cvs</filename> command.
</para></listitem>
<listitem><para><emphasis><filename>CVS_PROXY_PORT</filename>:</emphasis>
The port number to use as a "proxyport=" parameter to
the <filename>cvs</filename> command.
</para></listitem>
</itemizedlist>
As well as the standard username and password URL syntax,
you can also configure the fetcher with various URL parameters:
</para>
<para>
The supported parameters are as follows:
<itemizedlist>
<listitem><para><emphasis>"method":</emphasis>
The protocol over which to communicate with the CVS
server.
By default, this protocol is "pserver".
If "method" is set to "ext", BitBake examines the
"rsh" parameter and sets <filename>CVS_RSH</filename>.
You can use "dir" for local directories.
</para></listitem>
<listitem><para><emphasis>"module":</emphasis>
Specifies the module to check out.
You must supply this parameter.
</para></listitem>
<listitem><para><emphasis>"tag":</emphasis>
Describes which CVS TAG should be used for
the checkout.
By default, the TAG is empty.
</para></listitem>
<listitem><para><emphasis>"date":</emphasis>
Specifies a date.
If no "date" is specified, the
<link linkend='var-SRCDATE'><filename>SRCDATE</filename></link>
of the configuration is used to checkout a specific date.
The special value of "now" causes the checkout to be
updated on every build.
</para></listitem>
<listitem><para><emphasis>"localdir":</emphasis>
Used to rename the module.
Effectively, you are renaming the output directory
to which the module is unpacked.
You are forcing the module into a special
directory relative to
<link linkend='var-CVSDIR'><filename>CVSDIR</filename></link>.
</para></listitem>
<listitem><para><emphasis>"rsh"</emphasis>
Used in conjunction with the "method" parameter.
</para></listitem>
<listitem><para><emphasis>"scmdata":</emphasis>
Causes the CVS metadata to be maintained in the tarball
the fetcher creates when set to "keep".
The tarball is expanded into the work directory.
By default, the CVS metadata is removed.
</para></listitem>
<listitem><para><emphasis>"fullpath":</emphasis>
Controls whether the resulting checkout is at the
module level, which is the default, or is at deeper
paths.
</para></listitem>
<listitem><para><emphasis>"norecurse":</emphasis>
Causes the fetcher to only checkout the specified
directory with no recurse into any subdirectories.
</para></listitem>
<listitem><para><emphasis>"port":</emphasis>
The port to which the CVS server connects.
</para></listitem>
</itemizedlist>
Some example URLs are as follows:
<literallayout class='monospaced'>
SRC_URI = "cvs://CVSROOT;module=mymodule;tag=some-version;method=ext"
SRC_URI = "cvs://CVSROOT;module=mymodule;date=20060126;localdir=usethat"
</literallayout>
</para>
</section>
<section id='svn-fetcher'>
<title>Subversion (SVN) Fetcher (<filename>svn://</filename>)</title>
<para>
This fetcher submodule fetches code from the
Subversion source control system.
The executable used is specified by
<filename>FETCHCMD_svn</filename>, which defaults
to "svn".
The fetcher's temporary working directory is set by
<link linkend='var-SVNDIR'><filename>SVNDIR</filename></link>,
which is usually <filename>DL_DIR/svn</filename>.
</para>
<para>
The supported parameters are as follows:
<itemizedlist>
<listitem><para><emphasis>"module":</emphasis>
The name of the svn module to checkout.
You must provide this parameter.
You can think of this parameter as the top-level
directory of the repository data you want.
</para></listitem>
<listitem><para><emphasis>"path_spec":</emphasis>
A specific directory in which to checkout the
specified svn module.
</para></listitem>
<listitem><para><emphasis>"protocol":</emphasis>
The protocol to use, which defaults to "svn".
If "protocol" is set to "svn+ssh", the "ssh"
parameter is also used.
</para></listitem>
<listitem><para><emphasis>"rev":</emphasis>
The revision of the source code to checkout.
</para></listitem>
<listitem><para><emphasis>"scmdata":</emphasis>
Causes the “.svn” directories to be available during
compile-time when set to "keep".
By default, these directories are removed.
</para></listitem>
<listitem><para><emphasis>"ssh":</emphasis>
An optional parameter used when "protocol" is set
to "svn+ssh".
You can use this parameter to specify the ssh
program used by svn.
</para></listitem>
<listitem><para><emphasis>"transportuser":</emphasis>
When required, sets the username for the transport.
By default, this parameter is empty.
The transport username is different than the username
used in the main URL, which is passed to the subversion
command.
</para></listitem>
</itemizedlist>
Following are three examples using svn:
<literallayout class='monospaced'>
SRC_URI = "svn://myrepos/proj1;module=vip;protocol=http;rev=667"
SRC_URI = "svn://myrepos/proj1;module=opie;protocol=svn+ssh"
SRC_URI = "svn://myrepos/proj1;module=trunk;protocol=http;path_spec=${MY_DIR}/proj1"
</literallayout>
</para>
</section>
<section id='git-fetcher'>
<title>Git Fetcher (<filename>git://</filename>)</title>
<para>
This fetcher submodule fetches code from the Git
source control system.
The fetcher works by creating a bare clone of the
remote into
<link linkend='var-GITDIR'><filename>GITDIR</filename></link>,
which is usually <filename>DL_DIR/git2</filename>.
This bare clone is then cloned into the work directory during the
unpack stage when a specific tree is checked out.
This is done using alternates and by reference to
minimize the amount of duplicate data on the disk and
make the unpack process fast.
The executable used can be set with
<filename>FETCHCMD_git</filename>.
</para>
<para>
This fetcher supports the following parameters:
<itemizedlist>
<listitem><para><emphasis>"protocol":</emphasis>
The protocol used to fetch the files.
The default is "git" when a hostname is set.
If a hostname is not set, the Git protocol is "file".
You can also use "http", "https", "ssh" and "rsync".
</para></listitem>
<listitem><para><emphasis>"nocheckout":</emphasis>
Tells the fetcher to not checkout source code when
unpacking when set to "1".
Set this option for the URL where there is a custom
routine to checkout code.
The default is "0".
</para></listitem>
<listitem><para><emphasis>"rebaseable":</emphasis>
Indicates that the upstream Git repository can be rebased.
You should set this parameter to "1" if
revisions can become detached from branches.
In this case, the source mirror tarball is done per
revision, which has a loss of efficiency.
Rebasing the upstream Git repository could cause the
current revision to disappear from the upstream repository.
This option reminds the fetcher to preserve the local cache
carefully for future use.
The default value for this parameter is "0".
</para></listitem>
<listitem><para><emphasis>"nobranch":</emphasis>
Tells the fetcher to not check the SHA validation
for the branch when set to "1".
The default is "0".
Set this option for the recipe that refers to
the commit that is valid for a tag instead of
the branch.
</para></listitem>
<listitem><para><emphasis>"bareclone":</emphasis>
Tells the fetcher to clone a bare clone into the
destination directory without checking out a working tree.
Only the raw Git metadata is provided.
This parameter implies the "nocheckout" parameter as well.
</para></listitem>
<listitem><para><emphasis>"branch":</emphasis>
The branch(es) of the Git tree to clone.
If unset, this is assumed to be "master".
The number of branch parameters much match the number of
name parameters.
</para></listitem>
<listitem><para><emphasis>"rev":</emphasis>
The revision to use for the checkout.
The default is "master".
</para></listitem>
<listitem><para><emphasis>"tag":</emphasis>
Specifies a tag to use for the checkout.
To correctly resolve tags, BitBake must access the
network.
For that reason, tags are often not used.
As far as Git is concerned, the "tag" parameter behaves
effectively the same as the "rev" parameter.
</para></listitem>
<listitem><para><emphasis>"subpath":</emphasis>
Limits the checkout to a specific subpath of the tree.
By default, the whole tree is checked out.
</para></listitem>
<listitem><para><emphasis>"destsuffix":</emphasis>
The name of the path in which to place the checkout.
By default, the path is <filename>git/</filename>.
</para></listitem>
<listitem><para><emphasis>"usehead":</emphasis>
Enables local <filename>git://</filename> URLs to use the
current branch HEAD as the revision for use with
<filename>AUTOREV</filename>.
The "usehead" parameter implies no branch and only works
when the transfer protocol is
<filename>file://</filename>.
</para></listitem>
</itemizedlist>
Here are some example URLs:
<literallayout class='monospaced'>
SRC_URI = "git://git.oe.handhelds.org/git/vip.git;tag=version-1"
SRC_URI = "git://git.oe.handhelds.org/git/vip.git;protocol=http"
</literallayout>
</para>
</section>
<section id='gitsm-fetcher'>
<title>Git Submodule Fetcher (<filename>gitsm://</filename>)</title>
<para>
This fetcher submodule inherits from the
<link linkend='git-fetcher'>Git fetcher</link> and extends
that fetcher's behavior by fetching a repository's submodules.
<link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
is passed to the Git fetcher as described in the
"<link linkend='git-fetcher'>Git Fetcher (<filename>git://</filename>)</link>"
section.
<note>
<title>Notes and Warnings</title>
<para>
You must clean a recipe when switching between
'<filename>git://</filename>' and
'<filename>gitsm://</filename>' URLs.
</para>
<para>
The Git Submodules fetcher is not a complete fetcher
implementation.
The fetcher has known issues where it does not use the
normal source mirroring infrastructure properly.
</para>
</note>
</para>
</section>
<section id='clearcase-fetcher'>
<title>ClearCase Fetcher (<filename>ccrc://</filename>)</title>
<para>
This fetcher submodule fetches code from a
<ulink url='http://en.wikipedia.org/wiki/Rational_ClearCase'>ClearCase</ulink>
repository.
</para>
<para>
To use this fetcher, make sure your recipe has proper
<link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>,
<link linkend='var-SRCREV'><filename>SRCREV</filename></link>, and
<link linkend='var-PV'><filename>PV</filename></link> settings.
Here is an example:
<literallayout class='monospaced'>
SRC_URI = "ccrc://cc.example.org/ccrc;vob=/example_vob;module=/example_module"
SRCREV = "EXAMPLE_CLEARCASE_TAG"
PV = "${@d.getVar("SRCREV", False).replace("/", "+")}"
</literallayout>
The fetcher uses the <filename>rcleartool</filename> or
<filename>cleartool</filename> remote client, depending on
which one is available.
</para>
<para>
Following are options for the <filename>SRC_URI</filename>
statement:
<itemizedlist>
<listitem><para><emphasis><filename>vob</filename></emphasis>:
The name, which must include the
prepending "/" character, of the ClearCase VOB.
This option is required.
</para></listitem>
<listitem><para><emphasis><filename>module</filename></emphasis>:
The module, which must include the
prepending "/" character, in the selected VOB.
<note>
The <filename>module</filename> and <filename>vob</filename>
options are combined to create the <filename>load</filename> rule in
the view config spec.
As an example, consider the <filename>vob</filename> and
<filename>module</filename> values from the
<filename>SRC_URI</filename> statement at the start of this section.
Combining those values results in the following:
<literallayout class='monospaced'>
load /example_vob/example_module
</literallayout>
</note>
</para></listitem>
<listitem><para><emphasis><filename>proto</filename></emphasis>:
The protocol, which can be either <filename>http</filename> or
<filename>https</filename>.
</para></listitem>
</itemizedlist>
</para>
<para>
By default, the fetcher creates a configuration specification.
If you want this specification written to an area other than the default,
use the <filename>CCASE_CUSTOM_CONFIG_SPEC</filename> variable
in your recipe to define where the specification is written.
<note>
the <filename>SRCREV</filename> loses its functionality if you
specify this variable.
However, <filename>SRCREV</filename> is still used to label the
archive after a fetch even though it does not define what is
fetched.
</note>
</para>
<para>
Here are a couple of other behaviors worth mentioning:
<itemizedlist>
<listitem><para>
When using <filename>cleartool</filename>, the login of
<filename>cleartool</filename> is handled by the system.
The login require no special steps.
</para></listitem>
<listitem><para>
In order to use <filename>rcleartool</filename> with authenticated
users, an "rcleartool login" is necessary before using the fetcher.
</para></listitem>
</itemizedlist>
</para>
</section>
<section id='perforce-fetcher'>
<title>Perforce Fetcher (<filename>p4://</filename>)</title>
<para>
This fetcher submodule fetches code from the
<ulink url='https://www.perforce.com/'>Perforce</ulink>
source control system.
The executable used is specified by
<filename>FETCHCMD_p4</filename>, which defaults
to "p4".
The fetcher's temporary working directory is set by
<link linkend='var-P4DIR'><filename>P4DIR</filename></link>,
which defaults to "DL_DIR/p4".
</para>
<para>
To use this fetcher, make sure your recipe has proper
<link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>,
<link linkend='var-SRCREV'><filename>SRCREV</filename></link>, and
<link linkend='var-PV'><filename>PV</filename></link> values.
The p4 executable is able to use the config file defined by your
system's <filename>P4CONFIG</filename> environment variable in
order to define the Perforce server URL and port, username, and
password if you do not wish to keep those values in a recipe
itself.
If you choose not to use <filename>P4CONFIG</filename>,
or to explicitly set variables that <filename>P4CONFIG</filename>
can contain, you can specify the <filename>P4PORT</filename> value,
which is the server's URL and port number, and you can
specify a username and password directly in your recipe within
<filename>SRC_URI</filename>.
</para>
<para>
Here is an example that relies on <filename>P4CONFIG</filename>
to specify the server URL and port, username, and password, and
fetches the Head Revision:
<literallayout class='monospaced'>
SRC_URI = "p4://example-depot/main/source/..."
SRCREV = "${AUTOREV}"
PV = "p4-${SRCPV}"
S = "${WORKDIR}/p4"
</literallayout>
</para>
<para>
Here is an example that specifies the server URL and port,
username, and password, and fetches a Revision based on a Label:
<literallayout class='monospaced'>
P4PORT = "tcp:p4server.example.net:1666"
SRC_URI = "p4://user:passwd@example-depot/main/source/..."
SRCREV = "release-1.0"
PV = "p4-${SRCPV}"
S = "${WORKDIR}/p4"
</literallayout>
<note>
You should always set <filename>S</filename>
to <filename>"${WORKDIR}/p4"</filename> in your recipe.
</note>
</para>
</section>
<section id='other-fetchers'>
<title>Other Fetchers</title>
<para>
Fetch submodules also exist for the following:
<itemizedlist>
<listitem><para>
Bazaar (<filename>bzr://</filename>)
</para></listitem>
<listitem><para>
Trees using Git Annex (<filename>gitannex://</filename>)
</para></listitem>
<listitem><para>
Secure FTP (<filename>sftp://</filename>)
</para></listitem>
<listitem><para>
Secure Shell (<filename>ssh://</filename>)
</para></listitem>
<listitem><para>
Repo (<filename>repo://</filename>)
</para></listitem>
<listitem><para>
OSC (<filename>osc://</filename>)
</para></listitem>
<listitem><para>
Mercurial (<filename>hg://</filename>)
</para></listitem>
</itemizedlist>
No documentation currently exists for these lesser used
fetcher submodules.
However, you might find the code helpful and readable.
</para>
</section>
</section>
<section id='auto-revisions'>
<title>Auto Revisions</title>
<para>
We need to document <filename>AUTOREV</filename> and
<filename>SRCREV_FORMAT</filename> here.
</para>
</section>
</chapter>

View File

@ -1,505 +0,0 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<appendix id='hello-world-example'>
<title>Hello World Example</title>
<section id='bitbake-hello-world'>
<title>BitBake Hello World</title>
<para>
The simplest example commonly used to demonstrate any new
programming language or tool is the
"<ulink url="http://en.wikipedia.org/wiki/Hello_world_program">Hello World</ulink>"
example.
This appendix demonstrates, in tutorial form, Hello
World within the context of BitBake.
The tutorial describes how to create a new project
and the applicable metadata files necessary to allow
BitBake to build it.
</para>
</section>
<section id='example-obtaining-bitbake'>
<title>Obtaining BitBake</title>
<para>
See the
"<link linkend='obtaining-bitbake'>Obtaining BitBake</link>"
section for information on how to obtain BitBake.
Once you have the source code on your machine, the BitBake directory
appears as follows:
<literallayout class='monospaced'>
$ ls -al
total 100
drwxrwxr-x. 9 wmat wmat 4096 Jan 31 13:44 .
drwxrwxr-x. 3 wmat wmat 4096 Feb 4 10:45 ..
-rw-rw-r--. 1 wmat wmat 365 Nov 26 04:55 AUTHORS
drwxrwxr-x. 2 wmat wmat 4096 Nov 26 04:55 bin
drwxrwxr-x. 4 wmat wmat 4096 Jan 31 13:44 build
-rw-rw-r--. 1 wmat wmat 16501 Nov 26 04:55 ChangeLog
drwxrwxr-x. 2 wmat wmat 4096 Nov 26 04:55 classes
drwxrwxr-x. 2 wmat wmat 4096 Nov 26 04:55 conf
drwxrwxr-x. 3 wmat wmat 4096 Nov 26 04:55 contrib
-rw-rw-r--. 1 wmat wmat 17987 Nov 26 04:55 COPYING
drwxrwxr-x. 3 wmat wmat 4096 Nov 26 04:55 doc
-rw-rw-r--. 1 wmat wmat 69 Nov 26 04:55 .gitignore
-rw-rw-r--. 1 wmat wmat 849 Nov 26 04:55 HEADER
drwxrwxr-x. 5 wmat wmat 4096 Jan 31 13:44 lib
-rw-rw-r--. 1 wmat wmat 195 Nov 26 04:55 MANIFEST.in
-rw-rw-r--. 1 wmat wmat 2887 Nov 26 04:55 TODO
</literallayout>
</para>
<para>
At this point, you should have BitBake cloned to
a directory that matches the previous listing except for
dates and user names.
</para>
</section>
<section id='setting-up-the-bitbake-environment'>
<title>Setting Up the BitBake Environment</title>
<para>
First, you need to be sure that you can run BitBake.
Set your working directory to where your local BitBake
files are and run the following command:
<literallayout class='monospaced'>
$ ./bin/bitbake --version
BitBake Build Tool Core version 1.23.0, bitbake version 1.23.0
</literallayout>
The console output tells you what version you are running.
</para>
<para>
The recommended method to run BitBake is from a directory of your
choice.
To be able to run BitBake from any directory, you need to add the
executable binary to your binary to your shell's environment
<filename>PATH</filename> variable.
First, look at your current <filename>PATH</filename> variable
by entering the following:
<literallayout class='monospaced'>
$ echo $PATH
</literallayout>
Next, add the directory location for the BitBake binary to the
<filename>PATH</filename>.
Here is an example that adds the
<filename>/home/scott-lenovo/bitbake/bin</filename> directory
to the front of the <filename>PATH</filename> variable:
<literallayout class='monospaced'>
$ export PATH=/home/scott-lenovo/bitbake/bin:$PATH
</literallayout>
You should now be able to enter the <filename>bitbake</filename>
command from the command line while working from any directory.
</para>
</section>
<section id='the-hello-world-example'>
<title>The Hello World Example</title>
<para>
The overall goal of this exercise is to build a
complete "Hello World" example utilizing task and layer
concepts.
Because this is how modern projects such as OpenEmbedded and
the Yocto Project utilize BitBake, the example
provides an excellent starting point for understanding
BitBake.
</para>
<para>
To help you understand how to use BitBake to build targets,
the example starts with nothing but the <filename>bitbake</filename>
command, which causes BitBake to fail and report problems.
The example progresses by adding pieces to the build to
eventually conclude with a working, minimal "Hello World"
example.
</para>
<para>
While every attempt is made to explain what is happening during
the example, the descriptions cannot cover everything.
You can find further information throughout this manual.
Also, you can actively participate in the
<ulink url='http://lists.openembedded.org/mailman/listinfo/bitbake-devel'></ulink>
discussion mailing list about the BitBake build tool.
</para>
<note>
This example was inspired by and drew heavily from these sources:
<itemizedlist>
<listitem><para>
<ulink url="http://www.mail-archive.com/yocto@yoctoproject.org/msg09379.html">Mailing List post - The BitBake equivalent of "Hello, World!"</ulink>
</para></listitem>
<listitem><para>
<ulink url="https://web.archive.org/web/20150325165911/http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/">Hambedded Linux blog post - From Bitbake Hello World to an Image</ulink>
</para></listitem>
</itemizedlist>
</note>
<para>
As stated earlier, the goal of this example
is to eventually compile "Hello World".
However, it is unknown what BitBake needs and what you have
to provide in order to achieve that goal.
Recall that BitBake utilizes three types of metadata files:
<link linkend='configuration-files'>Configuration Files</link>,
<link linkend='classes'>Classes</link>, and
<link linkend='recipes'>Recipes</link>.
But where do they go?
How does BitBake find them?
BitBake's error messaging helps you answer these types of questions
and helps you better understand exactly what is going on.
</para>
<para>
Following is the complete "Hello World" example.
</para>
<orderedlist>
<listitem><para><emphasis>Create a Project Directory:</emphasis>
First, set up a directory for the "Hello World" project.
Here is how you can do so in your home directory:
<literallayout class='monospaced'>
$ mkdir ~/hello
$ cd ~/hello
</literallayout>
This is the directory that BitBake will use to do all of
its work.
You can use this directory to keep all the metafiles needed
by BitBake.
Having a project directory is a good way to isolate your
project.
</para></listitem>
<listitem><para><emphasis>Run Bitbake:</emphasis>
At this point, you have nothing but a project directory.
Run the <filename>bitbake</filename> command and see what
it does:
<literallayout class='monospaced'>
$ bitbake
The BBPATH variable is not set and bitbake did not
find a conf/bblayers.conf file in the expected location.
Maybe you accidentally invoked bitbake from the wrong directory?
DEBUG: Removed the following variables from the environment:
GNOME_DESKTOP_SESSION_ID, XDG_CURRENT_DESKTOP,
GNOME_KEYRING_CONTROL, DISPLAY, SSH_AGENT_PID, LANG, no_proxy,
XDG_SESSION_PATH, XAUTHORITY, SESSION_MANAGER, SHLVL,
MANDATORY_PATH, COMPIZ_CONFIG_PROFILE, WINDOWID, EDITOR,
GPG_AGENT_INFO, SSH_AUTH_SOCK, GDMSESSION, GNOME_KEYRING_PID,
XDG_SEAT_PATH, XDG_CONFIG_DIRS, LESSOPEN, DBUS_SESSION_BUS_ADDRESS,
_, XDG_SESSION_COOKIE, DESKTOP_SESSION, LESSCLOSE, DEFAULTS_PATH,
UBUNTU_MENUPROXY, OLDPWD, XDG_DATA_DIRS, COLORTERM, LS_COLORS
</literallayout>
The majority of this output is specific to environment variables
that are not directly relevant to BitBake.
However, the very first message regarding the
<filename>BBPATH</filename> variable and the
<filename>conf/bblayers.conf</filename> file
is relevant.</para>
<para>
When you run BitBake, it begins looking for metadata files.
The
<link linkend='var-BBPATH'><filename>BBPATH</filename></link>
variable is what tells BitBake where to look for those files.
<filename>BBPATH</filename> is not set and you need to set it.
Without <filename>BBPATH</filename>, Bitbake cannot
find any configuration files (<filename>.conf</filename>)
or recipe files (<filename>.bb</filename>) at all.
BitBake also cannot find the <filename>bitbake.conf</filename>
file.
</para></listitem>
<listitem><para><emphasis>Setting <filename>BBPATH</filename>:</emphasis>
For this example, you can set <filename>BBPATH</filename>
in the same manner that you set <filename>PATH</filename>
earlier in the appendix.
You should realize, though, that it is much more flexible to set the
<filename>BBPATH</filename> variable up in a configuration
file for each project.</para>
<para>From your shell, enter the following commands to set and
export the <filename>BBPATH</filename> variable:
<literallayout class='monospaced'>
$ BBPATH="<replaceable>projectdirectory</replaceable>"
$ export BBPATH
</literallayout>
Use your actual project directory in the command.
BitBake uses that directory to find the metadata it needs for
your project.
<note>
When specifying your project directory, do not use the
tilde ("~") character as BitBake does not expand that character
as the shell would.
</note>
</para></listitem>
<listitem><para><emphasis>Run Bitbake:</emphasis>
Now that you have <filename>BBPATH</filename> defined, run
the <filename>bitbake</filename> command again:
<literallayout class='monospaced'>
$ bitbake
ERROR: Traceback (most recent call last):
File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
return func(fn, *args)
File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 173, in parse_config_file
return bb.parse.handle(fn, data, include)
File "/home/scott-lenovo/bitbake/lib/bb/parse/__init__.py", line 99, in handle
return h['handle'](fn, data, include)
File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 120, in handle
abs_fn = resolve_file(fn, data)
File "/home/scott-lenovo/bitbake/lib/bb/parse/__init__.py", line 117, in resolve_file
raise IOError("file %s not found in %s" % (fn, bbpath))
IOError: file conf/bitbake.conf not found in /home/scott-lenovo/hello
ERROR: Unable to parse conf/bitbake.conf: file conf/bitbake.conf not found in /home/scott-lenovo/hello
</literallayout>
This sample output shows that BitBake could not find the
<filename>conf/bitbake.conf</filename> file in the project
directory.
This file is the first thing BitBake must find in order
to build a target.
And, since the project directory for this example is
empty, you need to provide a <filename>conf/bitbake.conf</filename>
file.
</para></listitem>
<listitem><para><emphasis>Creating <filename>conf/bitbake.conf</filename>:</emphasis>
The <filename>conf/bitbake.conf</filename> includes a number of
configuration variables BitBake uses for metadata and recipe
files.
For this example, you need to create the file in your project directory
and define some key BitBake variables.
For more information on the <filename>bitbake.conf</filename>,
see
<ulink url='https://web.archive.org/web/20150325165911/http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#an-overview-of-bitbakeconf'></ulink>
</para>
<para>Use the following commands to create the <filename>conf</filename>
directory in the project directory:
<literallayout class='monospaced'>
$ mkdir conf
</literallayout>
From within the <filename>conf</filename> directory, use
some editor to create the <filename>bitbake.conf</filename>
so that it contains the following:
<literallayout class='monospaced'>
TMPDIR = "${<link linkend='var-TOPDIR'>TOPDIR</link>}/tmp"
<link linkend='var-CACHE'>CACHE</link> = "${TMPDIR}/cache"
<link linkend='var-STAMP'>STAMP</link> = "${TMPDIR}/stamps"
<link linkend='var-T'>T</link> = "${TMPDIR}/work"
<link linkend='var-B'>B</link> = "${TMPDIR}"
</literallayout>
The <filename>TMPDIR</filename> variable establishes a directory
that BitBake uses for build output and intermediate files (other
than the cached information used by the
<link linkend='setscene'>Setscene</link> process.
Here, the <filename>TMPDIR</filename> directory is set to
<filename>hello/tmp</filename>.
<note><title>Tip</title>
You can always safely delete the <filename>tmp</filename>
directory in order to rebuild a BitBake target.
The build process creates the directory for you
when you run BitBake.
</note></para>
<para>For information about each of the other variables defined in this
example, click on the links to take you to the definitions in
the glossary.
</para></listitem>
<listitem><para><emphasis>Run Bitbake:</emphasis>
After making sure that the <filename>conf/bitbake.conf</filename>
file exists, you can run the <filename>bitbake</filename>
command again:
<literallayout class='monospaced'>
$ bitbake
ERROR: Traceback (most recent call last):
File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
return func(fn, *args)
File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 177, in _inherit
bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 92, in inherit
include(fn, file, lineno, d, "inherit")
File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 100, in include
raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
ERROR: Unable to parse base: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
</literallayout>
In the sample output, BitBake could not find the
<filename>classes/base.bbclass</filename> file.
You need to create that file next.
</para></listitem>
<listitem><para><emphasis>Creating <filename>classes/base.bbclass</filename>:</emphasis>
BitBake uses class files to provide common code and functionality.
The minimally required class for BitBake is the
<filename>classes/base.bbclass</filename> file.
The <filename>base</filename> class is implicitly inherited by
every recipe.
BitBake looks for the class in the <filename>classes</filename>
directory of the project (i.e <filename>hello/classes</filename>
in this example).
</para>
<para>Create the <filename>classes</filename> directory as follows:
<literallayout class='monospaced'>
$ cd $HOME/hello
$ mkdir classes
</literallayout>
Move to the <filename>classes</filename> directory and then
create the <filename>base.bbclass</filename> file by inserting
this single line:
<literallayout class='monospaced'>
addtask build
</literallayout>
The minimal task that BitBake runs is the
<filename>do_build</filename> task.
This is all the example needs in order to build the project.
Of course, the <filename>base.bbclass</filename> can have much
more depending on which build environments BitBake is
supporting.
For more information on the <filename>base.bbclass</filename> file,
you can look at
<ulink url='https://web.archive.org/web/20150325165911/http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#tasks'></ulink>.
</para></listitem>
<listitem><para><emphasis>Run Bitbake:</emphasis>
After making sure that the <filename>classes/base.bbclass</filename>
file exists, you can run the <filename>bitbake</filename>
command again:
<literallayout class='monospaced'>
$ bitbake
Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.
</literallayout>
BitBake is finally reporting no errors.
However, you can see that it really does not have anything
to do.
You need to create a recipe that gives BitBake something to do.
</para></listitem>
<listitem><para><emphasis>Creating a Layer:</emphasis>
While it is not really necessary for such a small example,
it is good practice to create a layer in which to keep your
code separate from the general metadata used by BitBake.
Thus, this example creates and uses a layer called "mylayer".
<note>
You can find additional information on adding a layer at
<ulink url='https://web.archive.org/web/20150325165911/http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#adding-an-example-layer'></ulink>.
</note>
</para>
<para>Minimally, you need a recipe file and a layer configuration
file in your layer.
The configuration file needs to be in the <filename>conf</filename>
directory inside the layer.
Use these commands to set up the layer and the <filename>conf</filename>
directory:
<literallayout class='monospaced'>
$ cd $HOME
$ mkdir mylayer
$ cd mylayer
$ mkdir conf
</literallayout>
Move to the <filename>conf</filename> directory and create a
<filename>layer.conf</filename> file that has the following:
<literallayout class='monospaced'>
BBPATH .= ":${<link linkend='var-LAYERDIR'>LAYERDIR</link>}"
<link linkend='var-BBFILES'>BBFILES</link> += "${LAYERDIR}/*.bb"
<link linkend='var-BBFILE_COLLECTIONS'>BBFILE_COLLECTIONS</link> += "mylayer"
<link linkend='var-BBFILE_PATTERN'>BBFILE_PATTERN_mylayer</link> := "^${LAYERDIR_RE}/"
</literallayout>
For information on these variables, click the links
to go to the definitions in the glossary.</para>
<para>You need to create the recipe file next.
Inside your layer at the top-level, use an editor and create
a recipe file named <filename>printhello.bb</filename> that
has the following:
<literallayout class='monospaced'>
<link linkend='var-DESCRIPTION'>DESCRIPTION</link> = "Prints Hello World"
<link linkend='var-PN'>PN</link> = 'printhello'
<link linkend='var-PV'>PV</link> = '1'
python do_build() {
bb.plain("********************");
bb.plain("* *");
bb.plain("* Hello, World! *");
bb.plain("* *");
bb.plain("********************");
}
</literallayout>
The recipe file simply provides a description of the
recipe, the name, version, and the <filename>do_build</filename>
task, which prints out "Hello World" to the console.
For more information on these variables, follow the links
to the glossary.
</para></listitem>
<listitem><para><emphasis>Run Bitbake With a Target:</emphasis>
Now that a BitBake target exists, run the command and provide
that target:
<literallayout class='monospaced'>
$ cd $HOME/hello
$ bitbake printhello
ERROR: no recipe files to build, check your BBPATH and BBFILES?
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
</literallayout>
We have created the layer with the recipe and the layer
configuration file but it still seems that BitBake cannot
find the recipe.
BitBake needs a <filename>conf/bblayers.conf</filename> that
lists the layers for the project.
Without this file, BitBake cannot find the recipe.
</para></listitem>
<listitem><para><emphasis>Creating <filename>conf/bblayers.conf</filename>:</emphasis>
BitBake uses the <filename>conf/bblayers.conf</filename> file
to locate layers needed for the project.
This file must reside in the <filename>conf</filename> directory
of the project (i.e. <filename>hello/conf</filename> for this
example).</para>
<para>Set your working directory to the <filename>hello/conf</filename>
directory and then create the <filename>bblayers.conf</filename>
file so that it contains the following:
<literallayout class='monospaced'>
BBLAYERS ?= " \
/home/&lt;you&gt;/mylayer \
"
</literallayout>
You need to provide your own information for
<filename>you</filename> in the file.
</para></listitem>
<listitem><para><emphasis>Run Bitbake With a Target:</emphasis>
Now that you have supplied the <filename>bblayers.conf</filename>
file, run the <filename>bitbake</filename> command and provide
the target:
<literallayout class='monospaced'>
$ bitbake printhello
Parsing recipes: 100% |##################################################################################|
Time: 00:00:00
Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: Preparing RunQueue
NOTE: Executing RunQueue Tasks
********************
* *
* Hello, World! *
* *
********************
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
</literallayout>
BitBake finds the <filename>printhello</filename> recipe and
successfully runs the task.
<note>
After the first execution, re-running
<filename>bitbake printhello</filename> again will not
result in a BitBake run that prints the same console
output.
The reason for this is that the first time the
<filename>printhello.bb</filename> recipe's
<filename>do_build</filename> task executes
successfully, BitBake writes a stamp file for the task.
Thus, the next time you attempt to run the task
using that same <filename>bitbake</filename> command,
BitBake notices the stamp and therefore determines
that the task does not need to be re-run.
If you delete the <filename>tmp</filename> directory
or run <filename>bitbake -c clean printhello</filename>
and then re-run the build, the "Hello, World!" message will
be printed again.
</note>
</para></listitem>
</orderedlist>
</section>
</appendix>

View File

@ -1,721 +0,0 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<chapter id="bitbake-user-manual-intro">
<title>Overview</title>
<para>
Welcome to the BitBake User Manual.
This manual provides information on the BitBake tool.
The information attempts to be as independent as possible regarding
systems that use BitBake, such as OpenEmbedded and the
Yocto Project.
In some cases, scenarios or examples within the context of
a build system are used in the manual to help with understanding.
For these cases, the manual clearly states the context.
</para>
<section id="intro">
<title>Introduction</title>
<para>
Fundamentally, BitBake is a generic task execution
engine that allows shell and Python tasks to be run
efficiently and in parallel while working within
complex inter-task dependency constraints.
One of BitBake's main users, OpenEmbedded, takes this core
and builds embedded Linux software stacks using
a task-oriented approach.
</para>
<para>
Conceptually, BitBake is similar to GNU Make in
some regards but has significant differences:
<itemizedlist>
<listitem><para>
BitBake executes tasks according to provided
metadata that builds up the tasks.
Metadata is stored in recipe (<filename>.bb</filename>)
and related recipe "append" (<filename>.bbappend</filename>)
files, configuration (<filename>.conf</filename>) and
underlying include (<filename>.inc</filename>) files, and
in class (<filename>.bbclass</filename>) files.
The metadata provides
BitBake with instructions on what tasks to run and
the dependencies between those tasks.
</para></listitem>
<listitem><para>
BitBake includes a fetcher library for obtaining source
code from various places such as local files, source control
systems, or websites.
</para></listitem>
<listitem><para>
The instructions for each unit to be built (e.g. a piece
of software) are known as "recipe" files and
contain all the information about the unit
(dependencies, source file locations, checksums, description
and so on).
</para></listitem>
<listitem><para>
BitBake includes a client/server abstraction and can
be used from a command line or used as a service over
XML-RPC and has several different user interfaces.
</para></listitem>
</itemizedlist>
</para>
</section>
<section id="history-and-goals">
<title>History and Goals</title>
<para>
BitBake was originally a part of the OpenEmbedded project.
It was inspired by the Portage package management system
used by the Gentoo Linux distribution.
On December 7, 2004, OpenEmbedded project team member
Chris Larson split the project into two distinct pieces:
<itemizedlist>
<listitem><para>BitBake, a generic task executor</para></listitem>
<listitem><para>OpenEmbedded, a metadata set utilized by
BitBake</para></listitem>
</itemizedlist>
Today, BitBake is the primary basis of the
<ulink url="http://www.openembedded.org/">OpenEmbedded</ulink>
project, which is being used to build and maintain Linux
distributions such as the
<ulink url='http://www.angstrom-distribution.org/'>Angstrom Distribution</ulink>,
and which is also being used as the build tool for Linux projects
such as the
<ulink url='http://www.yoctoproject.org'>Yocto Project</ulink>.
</para>
<para>
Prior to BitBake, no other build tool adequately met the needs of
an aspiring embedded Linux distribution.
All of the build systems used by traditional desktop Linux
distributions lacked important functionality, and none of the
ad hoc Buildroot-based systems, prevalent in the
embedded space, were scalable or maintainable.
</para>
<para>
Some important original goals for BitBake were:
<itemizedlist>
<listitem><para>
Handle cross-compilation.
</para></listitem>
<listitem><para>
Handle inter-package dependencies (build time on
target architecture, build time on native
architecture, and runtime).
</para></listitem>
<listitem><para>
Support running any number of tasks within a given
package, including, but not limited to, fetching
upstream sources, unpacking them, patching them,
configuring them, and so forth.
</para></listitem>
<listitem><para>
Be Linux distribution agnostic for both build and
target systems.
</para></listitem>
<listitem><para>
Be architecture agnostic.
</para></listitem>
<listitem><para>
Support multiple build and target operating systems
(e.g. Cygwin, the BSDs, and so forth).
</para></listitem>
<listitem><para>
Be self contained, rather than tightly
integrated into the build machine's root
filesystem.
</para></listitem>
<listitem><para>
Handle conditional metadata on the target architecture,
operating system, distribution, and machine.
</para></listitem>
<listitem><para>
Be easy to use the tools to supply local metadata and packages
against which to operate.
</para></listitem>
<listitem><para>
Be easy to use BitBake to collaborate between multiple
projects for their builds.
</para></listitem>
<listitem><para>
Provide an inheritance mechanism to share
common metadata between many packages.
</para></listitem>
</itemizedlist>
Over time it became apparent that some further requirements
were necessary:
<itemizedlist>
<listitem><para>
Handle variants of a base recipe (e.g. native, sdk,
and multilib).
</para></listitem>
<listitem><para>
Split metadata into layers and allow layers
to enhance or override other layers.
</para></listitem>
<listitem><para>
Allow representation of a given set of input variables
to a task as a checksum.
Based on that checksum, allow acceleration of builds
with prebuilt components.
</para></listitem>
</itemizedlist>
BitBake satisfies all the original requirements and many more
with extensions being made to the basic functionality to
reflect the additional requirements.
Flexibility and power have always been the priorities.
BitBake is highly extensible and supports embedded Python code and
execution of any arbitrary tasks.
</para>
</section>
<section id="Concepts">
<title>Concepts</title>
<para>
BitBake is a program written in the Python language.
At the highest level, BitBake interprets metadata, decides
what tasks are required to run, and executes those tasks.
Similar to GNU Make, BitBake controls how software is
built.
GNU Make achieves its control through "makefiles", while
BitBake uses "recipes".
</para>
<para>
BitBake extends the capabilities of a simple
tool like GNU Make by allowing for the definition of much more
complex tasks, such as assembling entire embedded Linux
distributions.
</para>
<para>
The remainder of this section introduces several concepts
that should be understood in order to better leverage
the power of BitBake.
</para>
<section id='recipes'>
<title>Recipes</title>
<para>
BitBake Recipes, which are denoted by the file extension
<filename>.bb</filename>, are the most basic metadata files.
These recipe files provide BitBake with the following:
<itemizedlist>
<listitem><para>Descriptive information about the
package (author, homepage, license, and so on)</para></listitem>
<listitem><para>The version of the recipe</para></listitem>
<listitem><para>Existing dependencies (both build
and runtime dependencies)</para></listitem>
<listitem><para>Where the source code resides and
how to fetch it</para></listitem>
<listitem><para>Whether the source code requires
any patches, where to find them, and how to apply
them</para></listitem>
<listitem><para>How to configure and compile the
source code</para></listitem>
<listitem><para>Where on the target machine to install the
package or packages created</para></listitem>
</itemizedlist>
</para>
<para>
Within the context of BitBake, or any project utilizing BitBake
as its build system, files with the <filename>.bb</filename>
extension are referred to as recipes.
<note>
The term "package" is also commonly used to describe recipes.
However, since the same word is used to describe packaged
output from a project, it is best to maintain a single
descriptive term - "recipes".
Put another way, a single "recipe" file is quite capable
of generating a number of related but separately installable
"packages".
In fact, that ability is fairly common.
</note>
</para>
</section>
<section id='configuration-files'>
<title>Configuration Files</title>
<para>
Configuration files, which are denoted by the
<filename>.conf</filename> extension, define
various configuration variables that govern the project's build
process.
These files fall into several areas that define
machine configuration options, distribution configuration
options, compiler tuning options, general common
configuration options, and user configuration options.
The main configuration file is the sample
<filename>bitbake.conf</filename> file, which is
located within the BitBake source tree
<filename>conf</filename> directory.
</para>
</section>
<section id='classes'>
<title>Classes</title>
<para>
Class files, which are denoted by the
<filename>.bbclass</filename> extension, contain
information that is useful to share between metadata files.
The BitBake source tree currently comes with one class metadata file
called <filename>base.bbclass</filename>.
You can find this file in the
<filename>classes</filename> directory.
The <filename>base.bbclass</filename> class files is special since it
is always included automatically for all recipes
and classes.
This class contains definitions for standard basic tasks such
as fetching, unpacking, configuring (empty by default),
compiling (runs any Makefile present), installing (empty by
default) and packaging (empty by default).
These tasks are often overridden or extended by other classes
added during the project development process.
</para>
</section>
<section id='layers'>
<title>Layers</title>
<para>
Layers allow you to isolate different types of
customizations from each other.
While you might find it tempting to keep everything in one layer
when working on a single project, the more modular you organize
your metadata, the easier it is to cope with future changes.
</para>
<para>
To illustrate how you can use layers to keep things modular,
consider customizations you might make to support a specific target machine.
These types of customizations typically reside in a special layer,
rather than a general layer, called a Board Support Package (BSP)
Layer.
Furthermore, the machine customizations should be isolated from
recipes and metadata that support a new GUI environment, for
example.
This situation gives you a couple of layers: one for the machine
configurations and one for the GUI environment.
It is important to understand, however, that the BSP layer can still
make machine-specific additions to recipes within
the GUI environment layer without polluting the GUI layer itself
with those machine-specific changes.
You can accomplish this through a recipe that is a BitBake append
(<filename>.bbappend</filename>) file.
</para>
</section>
<section id='append-bbappend-files'>
<title>Append Files</title>
<para>
Append files, which are files that have the
<filename>.bbappend</filename> file extension, extend or
override information in an existing recipe file.
</para>
<para>
BitBake expects every append file to have a corresponding recipe file.
Furthermore, the append file and corresponding recipe file
must use the same root filename.
The filenames can differ only in the file type suffix used
(e.g. <filename>formfactor_0.0.bb</filename> and
<filename>formfactor_0.0.bbappend</filename>).
</para>
<para>
Information in append files extends or
overrides the information in the underlying,
similarly-named recipe files.
</para>
<para>
When you name an append file, you can use the
wildcard character (%) to allow for matching recipe names.
For example, suppose you have an append file named
as follows:
<literallayout class='monospaced'>
busybox_1.21.%.bbappend
</literallayout>
That append file would match any <filename>busybox_1.21.x.bb</filename>
version of the recipe.
So, the append file would match the following recipe names:
<literallayout class='monospaced'>
busybox_1.21.1.bb
busybox_1.21.2.bb
busybox_1.21.3.bb
</literallayout>
If the <filename>busybox</filename> recipe was updated to
<filename>busybox_1.3.0.bb</filename>, the append name would not
match.
However, if you named the append file
<filename>busybox_1.%.bbappend</filename>, then you would have a match.
</para>
<para>
In the most general case, you could name the append file something as
simple as <filename>busybox_%.bbappend</filename> to be entirely
version independent.
</para>
</section>
</section>
<section id='obtaining-bitbake'>
<title>Obtaining BitBake</title>
<para>
You can obtain BitBake several different ways:
<itemizedlist>
<listitem><para><emphasis>Cloning BitBake:</emphasis>
Using Git to clone the BitBake source code repository
is the recommended method for obtaining BitBake.
Cloning the repository makes it easy to get bug fixes
and have access to stable branches and the master
branch.
Once you have cloned BitBake, you should use
the latest stable
branch for development since the master branch is for
BitBake development and might contain less stable changes.
</para>
<para>You usually need a version of BitBake
that matches the metadata you are using.
The metadata is generally backwards compatible but
not forward compatible.</para>
<para>Here is an example that clones the BitBake repository:
<literallayout class='monospaced'>
$ git clone git://git.openembedded.org/bitbake
</literallayout>
This command clones the BitBake Git repository into a
directory called <filename>bitbake</filename>.
Alternatively, you can
designate a directory after the
<filename>git clone</filename> command
if you want to call the new directory something
other than <filename>bitbake</filename>.
Here is an example that names the directory
<filename>bbdev</filename>:
<literallayout class='monospaced'>
$ git clone git://git.openembedded.org/bitbake bbdev
</literallayout></para></listitem>
<listitem><para><emphasis>Installation using your Distribution
Package Management System:</emphasis>
This method is not
recommended because the BitBake version that is
provided by your distribution, in most cases,
is several
releases behind a snapshot of the BitBake repository.
</para></listitem>
<listitem><para><emphasis>Taking a snapshot of BitBake:</emphasis>
Downloading a snapshot of BitBake from the
source code repository gives you access to a known
branch or release of BitBake.
<note>
Cloning the Git repository, as described earlier,
is the preferred method for getting BitBake.
Cloning the repository makes it easier to update as
patches are added to the stable branches.
</note></para>
<para>The following example downloads a snapshot of
BitBake version 1.17.0:
<literallayout class='monospaced'>
$ wget http://git.openembedded.org/bitbake/snapshot/bitbake-1.17.0.tar.gz
$ tar zxpvf bitbake-1.17.0.tar.gz
</literallayout>
After extraction of the tarball using the tar utility,
you have a directory entitled
<filename>bitbake-1.17.0</filename>.
</para></listitem>
<listitem><para><emphasis>Using the BitBake that Comes With Your
Build Checkout:</emphasis>
A final possibility for getting a copy of BitBake is that it
already comes with your checkout of a larger Bitbake-based build
system, such as Poky or Yocto Project.
Rather than manually checking out individual layers and
gluing them together yourself, you can check
out an entire build system.
The checkout will already include a version of BitBake that
has been thoroughly tested for compatibility with the other
components.
For information on how to check out a particular BitBake-based
build system, consult that build system's supporting documentation.
</para></listitem>
</itemizedlist>
</para>
</section>
<section id="bitbake-user-manual-command">
<title>The BitBake Command</title>
<para>
The <filename>bitbake</filename> command is the primary interface
to the BitBake tool.
This section presents the BitBake command syntax and provides
several execution examples.
</para>
<section id='usage-and-syntax'>
<title>Usage and syntax</title>
<para>
Following is the usage and syntax for BitBake:
<literallayout class='monospaced'>
$ bitbake -h
Usage: bitbake [options] [recipename/target recipe:do_task ...]
Executes the specified task (default is 'build') for a given set of target recipes (.bb files).
It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which
will provide the layer, BBFILES and other configuration information.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-b BUILDFILE, --buildfile=BUILDFILE
Execute tasks from a specific .bb recipe directly.
WARNING: Does not handle any dependencies from other
recipes.
-k, --continue Continue as much as possible after an error. While the
target that failed and anything depending on it cannot
be built, as much as possible will be built before
stopping.
-a, --tryaltconfigs Continue with builds by trying to use alternative
providers where possible.
-f, --force Force the specified targets/task to run (invalidating
any existing stamp file).
-c CMD, --cmd=CMD Specify the task to execute. The exact options
available depend on the metadata. Some examples might
be 'compile' or 'populate_sysroot' or 'listtasks' may
give a list of the tasks available.
-C INVALIDATE_STAMP, --clear-stamp=INVALIDATE_STAMP
Invalidate the stamp for the specified task such as
'compile' and then run the default task for the
specified target(s).
-r PREFILE, --read=PREFILE
Read the specified file before bitbake.conf.
-R POSTFILE, --postread=POSTFILE
Read the specified file after bitbake.conf.
-v, --verbose Enable tracing of shell tasks (with 'set -x').
Also print bb.note(...) messages to stdout (in
addition to writing them to ${T}/log.do_&lt;task&gt;).
-D, --debug Increase the debug level. You can specify this
more than once. -D sets the debug level to 1,
where only bb.debug(1, ...) messages are printed
to stdout; -DD sets the debug level to 2, where
both bb.debug(1, ...) and bb.debug(2, ...)
messages are printed; etc. Without -D, no debug
messages are printed. Note that -D only affects
output to stdout. All debug messages are written
to ${T}/log.do_taskname, regardless of the debug
level.
-n, --dry-run Don't execute, just go through the motions.
-S SIGNATURE_HANDLER, --dump-signatures=SIGNATURE_HANDLER
Dump out the signature construction information, with
no task execution. The SIGNATURE_HANDLER parameter is
passed to the handler. Two common values are none and
printdiff but the handler may define more/less. none
means only dump the signature, printdiff means compare
the dumped signature with the cached one.
-p, --parse-only Quit after parsing the BB recipes.
-s, --show-versions Show current and preferred versions of all recipes.
-e, --environment Show the global or per-recipe environment complete
with information about where variables were
set/changed.
-g, --graphviz Save dependency tree information for the specified
targets in the dot syntax.
-I EXTRA_ASSUME_PROVIDED, --ignore-deps=EXTRA_ASSUME_PROVIDED
Assume these dependencies don't exist and are already
provided (equivalent to ASSUME_PROVIDED). Useful to
make dependency graphs more appealing
-l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS
Show debug logging for the specified logging domains
-P, --profile Profile the command and save reports.
-u UI, --ui=UI The user interface to use (taskexp, knotty or
ncurses - default knotty).
-t SERVERTYPE, --servertype=SERVERTYPE
Choose which server type to use (process or xmlrpc -
default process).
--token=XMLRPCTOKEN Specify the connection token to be used when
connecting to a remote server.
--revisions-changed Set the exit code depending on whether upstream
floating revisions have changed or not.
--server-only Run bitbake without a UI, only starting a server
(cooker) process.
-B BIND, --bind=BIND The name/address for the bitbake server to bind to.
--no-setscene Do not run any setscene tasks. sstate will be ignored
and everything needed, built.
--setscene-only Only run setscene tasks, don't run any real tasks.
--remote-server=REMOTE_SERVER
Connect to the specified server.
-m, --kill-server Terminate the remote server.
--observe-only Connect to a server as an observing-only client.
--status-only Check the status of the remote bitbake server.
-w WRITEEVENTLOG, --write-log=WRITEEVENTLOG
Writes the event log of the build to a bitbake event
json file. Use '' (empty string) to assign the name
automatically.
</literallayout>
</para>
</section>
<section id='bitbake-examples'>
<title>Examples</title>
<para>
This section presents some examples showing how to use BitBake.
</para>
<section id='example-executing-a-task-against-a-single-recipe'>
<title>Executing a Task Against a Single Recipe</title>
<para>
Executing tasks for a single recipe file is relatively simple.
You specify the file in question, and BitBake parses
it and executes the specified task.
If you do not specify a task, BitBake executes the default
task, which is "build”.
BitBake obeys inter-task dependencies when doing
so.
</para>
<para>
The following command runs the build task, which is
the default task, on the <filename>foo_1.0.bb</filename>
recipe file:
<literallayout class='monospaced'>
$ bitbake -b foo_1.0.bb
</literallayout>
The following command runs the clean task on the
<filename>foo.bb</filename> recipe file:
<literallayout class='monospaced'>
$ bitbake -b foo.bb -c clean
</literallayout>
<note>
The "-b" option explicitly does not handle recipe
dependencies.
Other than for debugging purposes, it is instead
recommended that you use the syntax presented in the
next section.
</note>
</para>
</section>
<section id='executing-tasks-against-a-set-of-recipe-files'>
<title>Executing Tasks Against a Set of Recipe Files</title>
<para>
There are a number of additional complexities introduced
when one wants to manage multiple <filename>.bb</filename>
files.
Clearly there needs to be a way to tell BitBake what
files are available and, of those, which you
want to execute.
There also needs to be a way for each recipe
to express its dependencies, both for build-time and
runtime.
There must be a way for you to express recipe preferences
when multiple recipes provide the same functionality, or when
there are multiple versions of a recipe.
</para>
<para>
The <filename>bitbake</filename> command, when not using
"--buildfile" or "-b" only accepts a "PROVIDES".
You cannot provide anything else.
By default, a recipe file generally "PROVIDES" its
"packagename" as shown in the following example:
<literallayout class='monospaced'>
$ bitbake foo
</literallayout>
This next example "PROVIDES" the package name and also uses
the "-c" option to tell BitBake to just execute the
<filename>do_clean</filename> task:
<literallayout class='monospaced'>
$ bitbake -c clean foo
</literallayout>
</para>
</section>
<section id='executing-a-list-of-task-and-recipe-combinations'>
<title>Executing a List of Task and Recipe Combinations</title>
<para>
The BitBake command line supports specifying different
tasks for individual targets when you specify multiple
targets.
For example, suppose you had two targets (or recipes)
<filename>myfirstrecipe</filename> and
<filename>mysecondrecipe</filename> and you needed
BitBake to run <filename>taskA</filename> for the first
recipe and <filename>taskB</filename> for the second
recipe:
<literallayout class='monospaced'>
$ bitbake myfirstrecipe:do_taskA mysecondrecipe:do_taskB
</literallayout>
</para>
</section>
<section id='generating-dependency-graphs'>
<title>Generating Dependency Graphs</title>
<para>
BitBake is able to generate dependency graphs using
the <filename>dot</filename> syntax.
You can convert these graphs into images using the
<filename>dot</filename> tool from
<ulink url='http://www.graphviz.org'>Graphviz</ulink>.
</para>
<para>
When you generate a dependency graph, BitBake writes three files
to the current working directory:
<itemizedlist>
<listitem><para>
<emphasis><filename>recipe-depends.dot</filename>:</emphasis>
Shows dependencies between recipes (i.e. a collapsed version of
<filename>task-depends.dot</filename>).
</para></listitem>
<listitem><para>
<emphasis><filename>task-depends.dot</filename>:</emphasis>
Shows dependencies between tasks.
These dependencies match BitBake's internal task execution list.
</para></listitem>
<listitem><para>
<emphasis><filename>pn-buildlist</filename>:</emphasis>
Shows a simple list of targets that are to be built.
</para></listitem>
</itemizedlist>
</para>
<para>
To stop depending on common depends, use the "-I" depend
option and BitBake omits them from the graph.
Leaving this information out can produce more readable graphs.
This way, you can remove from the graph
<filename>DEPENDS</filename> from inherited classes
such as <filename>base.bbclass</filename>.
</para>
<para>
Here are two examples that create dependency graphs.
The second example omits depends common in OpenEmbedded from
the graph:
<literallayout class='monospaced'>
$ bitbake -g foo
$ bitbake -g -I virtual/kernel -I eglibc foo
</literallayout>
</para>
</section>
</section>
</section>
</chapter>

View File

@ -1,984 +0,0 @@
/*
Generic XHTML / DocBook XHTML CSS Stylesheet.
Browser wrangling and typographic design by
Oyvind Kolas / pippin@gimp.org
Customised for Poky by
Matthew Allum / mallum@o-hand.com
Thanks to:
Liam R. E. Quin
William Skaggs
Jakub Steiner
Structure
---------
The stylesheet is divided into the following sections:
Positioning
Margins, paddings, width, font-size, clearing.
Decorations
Borders, style
Colors
Colors
Graphics
Graphical backgrounds
Nasty IE tweaks
Workarounds needed to make it work in internet explorer,
currently makes the stylesheet non validating, but up until
this point it is validating.
Mozilla extensions
Transparency for footer
Rounded corners on boxes
*/
/*************** /
/ Positioning /
/ ***************/
body {
font-family: Verdana, Sans, sans-serif;
min-width: 640px;
width: 80%;
margin: 0em auto;
padding: 2em 5em 5em 5em;
color: #333;
}
h1,h2,h3,h4,h5,h6,h7 {
font-family: Arial, Sans;
color: #00557D;
clear: both;
}
h1 {
font-size: 2em;
text-align: left;
padding: 0em 0em 0em 0em;
margin: 2em 0em 0em 0em;
}
h2.subtitle {
margin: 0.10em 0em 3.0em 0em;
padding: 0em 0em 0em 0em;
font-size: 1.8em;
padding-left: 20%;
font-weight: normal;
font-style: italic;
}
h2 {
margin: 2em 0em 0.66em 0em;
padding: 0.5em 0em 0em 0em;
font-size: 1.5em;
font-weight: bold;
}
h3.subtitle {
margin: 0em 0em 1em 0em;
padding: 0em 0em 0em 0em;
font-size: 142.14%;
text-align: right;
}
h3 {
margin: 1em 0em 0.5em 0em;
padding: 1em 0em 0em 0em;
font-size: 140%;
font-weight: bold;
}
h4 {
margin: 1em 0em 0.5em 0em;
padding: 1em 0em 0em 0em;
font-size: 120%;
font-weight: bold;
}
h5 {
margin: 1em 0em 0.5em 0em;
padding: 1em 0em 0em 0em;
font-size: 110%;
font-weight: bold;
}
h6 {
margin: 1em 0em 0em 0em;
padding: 1em 0em 0em 0em;
font-size: 110%;
font-weight: bold;
}
.authorgroup {
background-color: transparent;
background-repeat: no-repeat;
padding-top: 256px;
background-image: url("figures/bitbake-title.png");
background-position: left top;
margin-top: -256px;
padding-right: 50px;
margin-left: 0px;
text-align: right;
width: 740px;
}
h3.author {
margin: 0em 0me 0em 0em;
padding: 0em 0em 0em 0em;
font-weight: normal;
font-size: 100%;
color: #333;
clear: both;
}
.author tt.email {
font-size: 66%;
}
.titlepage hr {
width: 0em;
clear: both;
}
.revhistory {
padding-top: 2em;
clear: both;
}
.toc,
.list-of-tables,
.list-of-examples,
.list-of-figures {
padding: 1.33em 0em 2.5em 0em;
color: #00557D;
}
.toc p,
.list-of-tables p,
.list-of-figures p,
.list-of-examples p {
padding: 0em 0em 0em 0em;
padding: 0em 0em 0.3em;
margin: 1.5em 0em 0em 0em;
}
.toc p b,
.list-of-tables p b,
.list-of-figures p b,
.list-of-examples p b{
font-size: 100.0%;
font-weight: bold;
}
.toc dl,
.list-of-tables dl,
.list-of-figures dl,
.list-of-examples dl {
margin: 0em 0em 0.5em 0em;
padding: 0em 0em 0em 0em;
}
.toc dt {
margin: 0em 0em 0em 0em;
padding: 0em 0em 0em 0em;
}
.toc dd {
margin: 0em 0em 0em 2.6em;
padding: 0em 0em 0em 0em;
}
div.glossary dl,
div.variablelist dl {
}
.glossary dl dt,
.variablelist dl dt,
.variablelist dl dt span.term {
font-weight: normal;
width: 20em;
text-align: right;
}
.variablelist dl dt {
margin-top: 0.5em;
}
.glossary dl dd,
.variablelist dl dd {
margin-top: -1em;
margin-left: 25.5em;
}
.glossary dd p,
.variablelist dd p {
margin-top: 0em;
margin-bottom: 1em;
}
div.calloutlist table td {
padding: 0em 0em 0em 0em;
margin: 0em 0em 0em 0em;
}
div.calloutlist table td p {
margin-top: 0em;
margin-bottom: 1em;
}
div p.copyright {
text-align: left;
}
div.legalnotice p.legalnotice-title {
margin-bottom: 0em;
}
p {
line-height: 1.5em;
margin-top: 0em;
}
dl {
padding-top: 0em;
}
hr {
border: solid 1px;
}
.mediaobject,
.mediaobjectco {
text-align: center;
}
img {
border: none;
}
ul {
padding: 0em 0em 0em 1.5em;
}
ul li {
padding: 0em 0em 0em 0em;
}
ul li p {
text-align: left;
}
table {
width :100%;
}
th {
padding: 0.25em;
text-align: left;
font-weight: normal;
vertical-align: top;
}
td {
padding: 0.25em;
vertical-align: top;
}
p a[id] {
margin: 0px;
padding: 0px;
display: inline;
background-image: none;
}
a {
text-decoration: underline;
color: #444;
}
pre {
overflow: auto;
}
a:hover {
text-decoration: underline;
/*font-weight: bold;*/
}
/* This style defines how the permalink character
appears by itself and when hovered over with
the mouse. */
[alt='Permalink'] { color: #eee; }
[alt='Permalink']:hover { color: black; }
div.informalfigure,
div.informalexample,
div.informaltable,
div.figure,
div.table,
div.example {
margin: 1em 0em;
padding: 1em;
page-break-inside: avoid;
}
div.informalfigure p.title b,
div.informalexample p.title b,
div.informaltable p.title b,
div.figure p.title b,
div.example p.title b,
div.table p.title b{
padding-top: 0em;
margin-top: 0em;
font-size: 100%;
font-weight: normal;
}
.mediaobject .caption,
.mediaobject .caption p {
text-align: center;
font-size: 80%;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
.epigraph {
padding-left: 55%;
margin-bottom: 1em;
}
.epigraph p {
text-align: left;
}
.epigraph .quote {
font-style: italic;
}
.epigraph .attribution {
font-style: normal;
text-align: right;
}
span.application {
font-style: italic;
}
.programlisting {
font-family: monospace;
font-size: 80%;
white-space: pre;
margin: 1.33em 0em;
padding: 1.33em;
}
.tip,
.warning,
.caution,
.note {
margin-top: 1em;
margin-bottom: 1em;
}
/* force full width of table within div */
.tip table,
.warning table,
.caution table,
.note table {
border: none;
width: 100%;
}
.tip table th,
.warning table th,
.caution table th,
.note table th {
padding: 0.8em 0.0em 0.0em 0.0em;
margin : 0em 0em 0em 0em;
}
.tip p,
.warning p,
.caution p,
.note p {
margin-top: 0.5em;
margin-bottom: 0.5em;
padding-right: 1em;
text-align: left;
}
.acronym {
text-transform: uppercase;
}
b.keycap,
.keycap {
padding: 0.09em 0.3em;
margin: 0em;
}
.itemizedlist li {
clear: none;
}
.filename {
font-size: medium;
font-family: Courier, monospace;
}
div.navheader, div.heading{
position: absolute;
left: 0em;
top: 0em;
width: 100%;
background-color: #cdf;
width: 100%;
}
div.navfooter, div.footing{
position: fixed;
left: 0em;
bottom: 0em;
background-color: #eee;
width: 100%;
}
div.navheader td,
div.navfooter td {
font-size: 66%;
}
div.navheader table th {
/*font-family: Georgia, Times, serif;*/
/*font-size: x-large;*/
font-size: 80%;
}
div.navheader table {
border-left: 0em;
border-right: 0em;
border-top: 0em;
width: 100%;
}
div.navfooter table {
border-left: 0em;
border-right: 0em;
border-bottom: 0em;
width: 100%;
}
div.navheader table td a,
div.navfooter table td a {
color: #777;
text-decoration: none;
}
/* normal text in the footer */
div.navfooter table td {
color: black;
}
div.navheader table td a:visited,
div.navfooter table td a:visited {
color: #444;
}
/* links in header and footer */
div.navheader table td a:hover,
div.navfooter table td a:hover {
text-decoration: underline;
background-color: transparent;
color: #33a;
}
div.navheader hr,
div.navfooter hr {
display: none;
}
.qandaset tr.question td p {
margin: 0em 0em 1em 0em;
padding: 0em 0em 0em 0em;
}
.qandaset tr.answer td p {
margin: 0em 0em 1em 0em;
padding: 0em 0em 0em 0em;
}
.answer td {
padding-bottom: 1.5em;
}
.emphasis {
font-weight: bold;
}
/************* /
/ decorations /
/ *************/
.titlepage {
}
.part .title {
}
.subtitle {
border: none;
}
/*
h1 {
border: none;
}
h2 {
border-top: solid 0.2em;
border-bottom: solid 0.06em;
}
h3 {
border-top: 0em;
border-bottom: solid 0.06em;
}
h4 {
border: 0em;
border-bottom: solid 0.06em;
}
h5 {
border: 0em;
}
*/
.programlisting {
border: solid 1px;
}
div.figure,
div.table,
div.informalfigure,
div.informaltable,
div.informalexample,
div.example {
border: 1px solid;
}
.tip,
.warning,
.caution,
.note {
border: 1px solid;
}
.tip table th,
.warning table th,
.caution table th,
.note table th {
border-bottom: 1px solid;
}
.question td {
border-top: 1px solid black;
}
.answer {
}
b.keycap,
.keycap {
border: 1px solid;
}
div.navheader, div.heading{
border-bottom: 1px solid;
}
div.navfooter, div.footing{
border-top: 1px solid;
}
/********* /
/ colors /
/ *********/
body {
color: #333;
background: white;
}
a {
background: transparent;
}
a:hover {
background-color: #dedede;
}
h1,
h2,
h3,
h4,
h5,
h6,
h7,
h8 {
background-color: transparent;
}
hr {
border-color: #aaa;
}
.tip, .warning, .caution, .note {
border-color: #fff;
}
.tip table th,
.warning table th,
.caution table th,
.note table th {
border-bottom-color: #fff;
}
.warning {
background-color: #f0f0f2;
}
.caution {
background-color: #f0f0f2;
}
.tip {
background-color: #f0f0f2;
}
.note {
background-color: #f0f0f2;
}
.glossary dl dt,
.variablelist dl dt,
.variablelist dl dt span.term {
color: #044;
}
div.figure,
div.table,
div.example,
div.informalfigure,
div.informaltable,
div.informalexample {
border-color: #aaa;
}
pre.programlisting {
color: black;
background-color: #fff;
border-color: #aaa;
border-width: 2px;
}
.guimenu,
.guilabel,
.guimenuitem {
background-color: #eee;
}
b.keycap,
.keycap {
background-color: #eee;
border-color: #999;
}
div.navheader {
border-color: black;
}
div.navfooter {
border-color: black;
}
/*********** /
/ graphics /
/ ***********/
/*
body {
background-image: url("images/body_bg.jpg");
background-attachment: fixed;
}
.navheader,
.note,
.tip {
background-image: url("images/note_bg.jpg");
background-attachment: fixed;
}
.warning,
.caution {
background-image: url("images/warning_bg.jpg");
background-attachment: fixed;
}
.figure,
.informalfigure,
.example,
.informalexample,
.table,
.informaltable {
background-image: url("images/figure_bg.jpg");
background-attachment: fixed;
}
*/
h1,
h2,
h3,
h4,
h5,
h6,
h7{
}
/*
Example of how to stick an image as part of the title.
div.article .titlepage .title
{
background-image: url("figures/white-on-black.png");
background-position: center;
background-repeat: repeat-x;
}
*/
div.preface .titlepage .title,
div.colophon .title,
div.chapter .titlepage .title,
div.article .titlepage .title
{
}
div.section div.section .titlepage .title,
div.sect2 .titlepage .title {
background: none;
}
h1.title {
background-color: transparent;
background-repeat: no-repeat;
height: 256px;
text-indent: -9000px;
overflow:hidden;
}
h2.subtitle {
background-color: transparent;
text-indent: -9000px;
overflow:hidden;
width: 0px;
display: none;
}
/*************************************** /
/ pippin.gimp.org specific alterations /
/ ***************************************/
/*
div.heading, div.navheader {
color: #777;
font-size: 80%;
padding: 0;
margin: 0;
text-align: left;
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 50px;
background: url('/gfx/heading_bg.png') transparent;
background-repeat: repeat-x;
background-attachment: fixed;
border: none;
}
div.heading a {
color: #444;
}
div.footing, div.navfooter {
border: none;
color: #ddd;
font-size: 80%;
text-align:right;
width: 100%;
padding-top: 10px;
position: absolute;
bottom: 0px;
left: 0px;
background: url('/gfx/footing_bg.png') transparent;
}
*/
/****************** /
/ nasty ie tweaks /
/ ******************/
/*
div.heading, div.navheader {
width:expression(document.body.clientWidth + "px");
}
div.footing, div.navfooter {
width:expression(document.body.clientWidth + "px");
margin-left:expression("-5em");
}
body {
padding:expression("4em 5em 0em 5em");
}
*/
/**************************************** /
/ mozilla vendor specific css extensions /
/ ****************************************/
/*
div.navfooter, div.footing{
-moz-opacity: 0.8em;
}
div.figure,
div.table,
div.informalfigure,
div.informaltable,
div.informalexample,
div.example,
.tip,
.warning,
.caution,
.note {
-moz-border-radius: 0.5em;
}
b.keycap,
.keycap {
-moz-border-radius: 0.3em;
}
*/
table tr td table tr td {
display: none;
}
hr {
display: none;
}
table {
border: 0em;
}
.photo {
float: right;
margin-left: 1.5em;
margin-bottom: 1.5em;
margin-top: 0em;
max-width: 17em;
border: 1px solid gray;
padding: 3px;
background: white;
}
.seperator {
padding-top: 2em;
clear: both;
}
#validators {
margin-top: 5em;
text-align: right;
color: #777;
}
@media print {
body {
font-size: 8pt;
}
.noprint {
display: none;
}
}
.tip,
.note {
background: #f0f0f2;
color: #333;
padding: 20px;
margin: 20px;
}
.tip h3,
.note h3 {
padding: 0em;
margin: 0em;
font-size: 2em;
font-weight: bold;
color: #333;
}
.tip a,
.note a {
color: #333;
text-decoration: underline;
}
.footnote {
font-size: small;
color: #333;
}
/* Changes the announcement text */
.tip h3,
.warning h3,
.caution h3,
.note h3 {
font-size:large;
color: #00557D;
}

View File

@ -1,88 +0,0 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book id='bitbake-user-manual' lang='en'
xmlns:xi="http://www.w3.org/2003/XInclude"
xmlns="http://docbook.org/ns/docbook"
>
<bookinfo>
<mediaobject>
<imageobject>
<imagedata fileref='figures/bitbake-title.png'
format='SVG'
align='left' scalefit='1' width='100%'/>
</imageobject>
</mediaobject>
<title>
BitBake User Manual
</title>
<authorgroup>
<author>
<firstname>Richard Purdie, Chris Larson, and </firstname> <surname>Phil Blundell</surname>
<affiliation>
<orgname>BitBake Community</orgname>
</affiliation>
<email>bitbake-devel@lists.openembedded.org</email>
</author>
</authorgroup>
<!--
# Add in some revision history if we want it here.
<revhistory>
<revision>
<revnumber>x.x</revnumber>
<date>dd month year</date>
<revremark>Some relevent comment</revremark>
</revision>
<revision>
<revnumber>x.x</revnumber>
<date>dd month year</date>
<revremark>Some relevent comment</revremark>
</revision>
<revision>
<revnumber>x.x</revnumber>
<date>dd month year</date>
<revremark>Some relevent comment</revremark>
</revision>
<revision>
<revnumber>x.x</revnumber>
<date>dd month year</date>
<revremark>Some relevent comment</revremark>
</revision>
</revhistory>
-->
<copyright>
<year>2004-2016</year>
<holder>Richard Purdie</holder>
<holder>Chris Larson</holder>
<holder>and Phil Blundell</holder>
</copyright>
<legalnotice>
<para>
This work is licensed under the Creative Commons Attribution License.
To view a copy of this license, visit
<ulink url="http://creativecommons.org/licenses/by/2.5/">http://creativecommons.org/licenses/by/2.5/</ulink>
or send a letter to Creative Commons, 444 Castro Street,
Suite 900, Mountain View, California 94041, USA.
</para>
</legalnotice>
</bookinfo>
<xi:include href="bitbake-user-manual-intro.xml"/>
<xi:include href="bitbake-user-manual-execution.xml"/>
<xi:include href="bitbake-user-manual-metadata.xml"/>
<xi:include href="bitbake-user-manual-fetching.xml"/>
<xi:include href="bitbake-user-manual-ref-variables.xml"/>
<xi:include href="bitbake-user-manual-hello.xml"/>
</book>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -89,7 +89,7 @@ quit after parsing the BB files (developers only)
show current and preferred versions of all packages
.TP
.B \-e, \-\-environment
show the global or per-recipe environment (this is what used to be bbread)
show the global or per-package environment (this is what used to be bbread)
.TP
.B \-g, \-\-graphviz
emit the dependency trees of the specified packages in the dot syntax
@ -104,30 +104,6 @@ Show debug logging for the specified logging domains
.B \-P, \-\-profile
profile the command and print a report
.TP
.B \-uUI, \-\-ui=UI
User interface to use. Currently, knotty, taskexp or ncurses can be specified as UI.
.TP
.B \-tSERVERTYPE, \-\-servertype=SERVERTYPE
Choose which server to use, none, process or xmlrpc.
.TP
.B \-\-revisions-changed
Set the exit code depending on whether upstream floating revisions have changed or not.
.TP
.B \-\-server-only
Run bitbake without UI, the frontend can connect with bitbake server itself.
.TP
.B \-BBIND, \-\-bind=BIND
The name/address for the bitbake server to bind to.
.TP
.B \-\-no\-setscene
Do not run any setscene tasks, forces builds.
.SH ENVIRONMENT VARIABLES
bitbake uses the following environment variables to control its
operation:
.TP
.B BITBAKE_UI
The bitbake user interface; overridden by the \fB-u\fP commandline option.
.SH AUTHORS
BitBake was written by

View File

@ -0,0 +1,56 @@
topdir = .
manual = $(topdir)/usermanual.xml
# types = pdf txt rtf ps xhtml html man tex texi dvi
# types = pdf txt
types = $(xmltotypes) $(htmltypes)
xmltotypes = pdf txt
htmltypes = html xhtml
htmlxsl = $(if $(filter $@,$(foreach type,$(htmltypes),$(type)-nochunks)),http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl,http://docbook.sourceforge.net/release/xsl/current/$@/chunk.xsl)
htmlcssfile = docbook.css
htmlcss = $(topdir)/html.css
# htmlcssfile =
# htmlcss =
cleanfiles = $(foreach i,$(types),$(topdir)/$(i))
ifdef DEBUG
define command
$(1)
endef
else
define command
@echo $(2) $(3) $(4)
@$(1) >/dev/null
endef
endif
all: $(types)
lint: $(manual) FORCE
$(call command,xmllint --xinclude --postvalid --noout $(manual),XMLLINT $(manual))
$(types) $(foreach type,$(htmltypes),$(type)-nochunks): lint FORCE
$(foreach type,$(htmltypes),$(type)-nochunks): $(if $(htmlcss),$(htmlcss)) $(manual)
@mkdir -p $@
ifdef htmlcss
$(call command,install -m 0644 $(htmlcss) $@/$(htmlcssfile),CP $(htmlcss) $@/$(htmlcssfile))
endif
$(call command,xsltproc --stringparam base.dir $@/ $(if $(htmlcssfile),--stringparam html.stylesheet $(htmlcssfile)) $(htmlxsl) $(manual) > $@/index.$(patsubst %-nochunks,%,$@),XSLTPROC $@ $(manual))
$(htmltypes): $(if $(htmlcss),$(htmlcss)) $(manual)
@mkdir -p $@
ifdef htmlcss
$(call command,install -m 0644 $(htmlcss) $@/$(htmlcssfile),CP $(htmlcss) $@/$(htmlcssfile))
endif
$(call command,xsltproc --stringparam base.dir $@/ $(if $(htmlcssfile),--stringparam html.stylesheet $(htmlcssfile)) $(htmlxsl) $(manual),XSLTPROC $@ $(manual))
$(xmltotypes): $(manual)
$(call command,xmlto --with-dblatex --extensions -o $(topdir)/$@ $@ $(manual),XMLTO $@ $(manual))
clean:
rm -rf $(cleanfiles)
$(foreach i,$(types) $(foreach type,$(htmltypes),$(type)-nochunks),clean-$(i)):
rm -rf $(patsubst clean-%,%,$@)
FORCE:

View File

@ -0,0 +1,611 @@
<?xml version="1.0"?>
<!--
ex:ts=4:sw=4:sts=4:et
-*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book>
<bookinfo>
<title>BitBake User Manual</title>
<authorgroup>
<corpauthor>BitBake Team</corpauthor>
</authorgroup>
<copyright>
<year>2004, 2005, 2006, 2011</year>
<holder>Chris Larson</holder>
<holder>Phil Blundell</holder>
<holder>Richard Purdie</holder>
</copyright>
<legalnotice>
<para>This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit <ulink url="http://creativecommons.org/licenses/by/2.5/">http://creativecommons.org/licenses/by/2.5/</ulink> or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.</para>
</legalnotice>
</bookinfo>
<chapter>
<title>Introduction</title>
<section>
<title>Overview</title>
<para>BitBake is, at its simplest, a tool for executing
tasks and managing metadata. As such, its similarities to GNU make and other
build tools are readily apparent. It was inspired by Portage, the package management system used by the Gentoo Linux distribution. BitBake is the basis of the <ulink url="http://www.openembedded.org/">OpenEmbedded</ulink> project, which is being used to build and maintain a number of embedded Linux distributions/projects such as Angstrom and the Yocto project.</para>
</section>
<section>
<title>Background and goals</title>
<para>Prior to BitBake, no other build tool adequately met
the needs of an aspiring embedded Linux distribution. All of the
buildsystems used by traditional desktop Linux distributions lacked
important functionality, and none of the ad-hoc
<emphasis>buildroot</emphasis> systems, prevalent in the
embedded space, were scalable or maintainable.</para>
<para>Some important original goals for BitBake were:
<itemizedlist>
<listitem><para>Handle crosscompilation.</para></listitem>
<listitem><para>Handle interpackage dependencies (build time on target architecture, build time on native architecture, and runtime).</para></listitem>
<listitem><para>Support running any number of tasks within a given package, including, but not limited to, fetching upstream sources, unpacking them, patching them, configuring them, et cetera.</para></listitem>
<listitem><para>Must be Linux distribution agnostic (both build and target).</para></listitem>
<listitem><para>Must be architecture agnostic</para></listitem>
<listitem><para>Must support multiple build and target operating systems (including Cygwin, the BSDs, etc).</para></listitem>
<listitem><para>Must be able to be self contained, rather than tightly integrated into the build machine's root filesystem.</para></listitem>
<listitem><para>There must be a way to handle conditional metadata (on target architecture, operating system, distribution, machine).</para></listitem>
<listitem><para>It must be easy for the person using the tools to supply their own local metadata and packages to operate against.</para></listitem>
<listitem><para>Must make it easy to collaborate
between multiple projects using BitBake for their
builds.</para></listitem>
<listitem><para>Should provide an inheritance mechanism to
share common metadata between many packages.</para></listitem>
</itemizedlist>
</para>
<para>Over time it has become apparent that some further requirements were necessary:
<itemizedlist>
<listitem><para>Handle variants of a base recipe (native, sdk, multilib).</para></listitem>
<listitem><para>Able to split metadata into layers and allow layers to override each other.</para></listitem>
<listitem><para>Allow representation of a given set of input variables to a task as a checksum.</para></listitem>
<listitem><para>based on that checksum, allow acceleration of builds with prebuilt components.</para></listitem>
</itemizedlist>
</para>
<para>BitBake satisfies all the original requirements and many more with extensions being made to the basic functionality to reflect the additionl requirements. Flexibility and power have always been the priorities. It is highly extensible, supporting embedded Python code and execution of any arbitrary tasks.</para>
</section>
</chapter>
<chapter>
<title>Metadata</title>
<section>
<title>Description</title>
<itemizedlist>
<para>BitBake metadata can be classified into 3 major areas:</para>
<listitem>
<para>Configuration Files</para>
</listitem>
<listitem>
<para>.bb Files</para>
</listitem>
<listitem>
<para>Classes</para>
</listitem>
</itemizedlist>
<para>What follows are a large number of examples of BitBake metadata. Any syntax which isn't supported in any of the aforementioned areas will be documented as such.</para>
<section>
<title>Basic variable setting</title>
<para><screen><varname>VARIABLE</varname> = "value"</screen></para>
<para>In this example, <varname>VARIABLE</varname> is <literal>value</literal>.</para>
</section>
<section>
<title>Variable expansion</title>
<para>BitBake supports variables referencing one another's contents using a syntax which is similar to shell scripting</para>
<para><screen><varname>A</varname> = "aval"
<varname>B</varname> = "pre${A}post"</screen></para>
<para>This results in <varname>A</varname> containing <literal>aval</literal> and <varname>B</varname> containing <literal>preavalpost</literal>.</para>
</section>
<section>
<title>Setting a default value (?=)</title>
<para><screen><varname>A</varname> ?= "aval"</screen></para>
<para>If <varname>A</varname> is set before the above is called, it will retain its previous value. If <varname>A</varname> is unset prior to the above call, <varname>A</varname> will be set to <literal>aval</literal>. Note that this assignment is immediate, so if there are multiple ?= assignments to a single variable, the first of those will be used.</para>
</section>
<section>
<title>Setting a weak default value (??=)</title>
<para><screen><varname>A</varname> ??= "somevalue"
<varname>A</varname> ??= "someothervalue"</screen></para>
<para>If <varname>A</varname> is set before the above, it will retain that value. If <varname>A</varname> is unset prior to the above, <varname>A</varname> will be set to <literal>someothervalue</literal>. This is a lazy/weak assignment in that the assignment does not occur until the end of the parsing process, so that the last, rather than the first, ??= assignment to a given variable will be used. Any other setting of A using = or ?= will however override the value set with ??=</para>
</section>
<section>
<title>Immediate variable expansion (:=)</title>
<para>:= results in a variable's contents being expanded immediately, rather than when the variable is actually used.</para>
<para><screen><varname>T</varname> = "123"
<varname>A</varname> := "${B} ${A} test ${T}"
<varname>T</varname> = "456"
<varname>B</varname> = "${T} bval"
<varname>C</varname> = "cval"
<varname>C</varname> := "${C}append"</screen></para>
<para>In that example, <varname>A</varname> would contain <literal> test 123</literal>, <varname>B</varname> would contain <literal>456 bval</literal>, and <varname>C</varname> would be <literal>cvalappend</literal>.</para>
</section>
<section>
<title>Appending (+=) and prepending (=+)</title>
<para><screen><varname>B</varname> = "bval"
<varname>B</varname> += "additionaldata"
<varname>C</varname> = "cval"
<varname>C</varname> =+ "test"</screen></para>
<para>In this example, <varname>B</varname> is now <literal>bval additionaldata</literal> and <varname>C</varname> is <literal>test cval</literal>.</para>
</section>
<section>
<title>Appending (.=) and prepending (=.) without spaces</title>
<para><screen><varname>B</varname> = "bval"
<varname>B</varname> .= "additionaldata"
<varname>C</varname> = "cval"
<varname>C</varname> =. "test"</screen></para>
<para>In this example, <varname>B</varname> is now <literal>bvaladditionaldata</literal> and <varname>C</varname> is <literal>testcval</literal>. In contrast to the above appending and prepending operators, no additional space
will be introduced.</para>
</section>
<section>
<title>Conditional metadata set</title>
<para>OVERRIDES is a <quote>:</quote> separated variable containing each item you want to satisfy conditions. So, if you have a variable which is conditional on <quote>arm</quote>, and <quote>arm</quote> is in OVERRIDES, then the <quote>arm</quote> specific version of the variable is used rather than the non-conditional version. Example:</para>
<para><screen><varname>OVERRIDES</varname> = "architecture:os:machine"
<varname>TEST</varname> = "defaultvalue"
<varname>TEST_os</varname> = "osspecificvalue"
<varname>TEST_condnotinoverrides</varname> = "othercondvalue"</screen></para>
<para>In this example, <varname>TEST</varname> would be <literal>osspecificvalue</literal>, due to the condition <quote>os</quote> being in <varname>OVERRIDES</varname>.</para>
</section>
<section>
<title>Conditional appending</title>
<para>BitBake also supports appending and prepending to variables based on whether something is in OVERRIDES. Example:</para>
<para><screen><varname>DEPENDS</varname> = "glibc ncurses"
<varname>OVERRIDES</varname> = "machine:local"
<varname>DEPENDS_append_machine</varname> = " libmad"</screen></para>
<para>In this example, <varname>DEPENDS</varname> is set to <literal>glibc ncurses libmad</literal>.</para>
</section>
<section>
<title>Inclusion</title>
<para>Next, there is the <literal>include</literal> directive, which causes BitBake to parse whatever file you specify, and insert it at that location, which is not unlike <command>make</command>. However, if the path specified on the <literal>include</literal> line is a relative path, BitBake will locate the first one it can find within <envar>BBPATH</envar>.</para>
</section>
<section>
<title>Requiring inclusion</title>
<para>In contrast to the <literal>include</literal> directive, <literal>require</literal> will
raise an ParseError if the file to be included cannot be found. Otherwise it will behave just like the <literal>
include</literal> directive.</para>
</section>
<section>
<title>Python variable expansion</title>
<para><screen><varname>DATE</varname> = "${@time.strftime('%Y%m%d',time.gmtime())}"</screen></para>
<para>This would result in the <varname>DATE</varname> variable containing today's date.</para>
</section>
<section>
<title>Defining executable metadata</title>
<para><emphasis>NOTE:</emphasis> This is only supported in .bb and .bbclass files.</para>
<para><screen>do_mytask () {
echo "Hello, world!"
}</screen></para>
<para>This is essentially identical to setting a variable, except that this variable happens to be executable shell code.</para>
<para><screen>python do_printdate () {
import time
print time.strftime('%Y%m%d', time.gmtime())
}</screen></para>
<para>This is the similar to the previous, but flags it as Python so that BitBake knows it is Python code.</para>
</section>
<section>
<title>Defining Python functions into the global Python namespace</title>
<para><emphasis>NOTE:</emphasis> This is only supported in .bb and .bbclass files.</para>
<para><screen>def get_depends(bb, d):
if bb.data.getVar('SOMECONDITION', d, True):
return "dependencywithcond"
else:
return "dependency"
<varname>SOMECONDITION</varname> = "1"
<varname>DEPENDS</varname> = "${@get_depends(bb, d)}"</screen></para>
<para>This would result in <varname>DEPENDS</varname> containing <literal>dependencywithcond</literal>.</para>
</section>
<section>
<title>Variable flags</title>
<para>Variables can have associated flags which provide a way of tagging extra information onto a variable. Several flags are used internally by BitBake but they can be used externally too if needed. The standard operations mentioned above also work on flags.</para>
<para><screen><varname>VARIABLE</varname>[<varname>SOMEFLAG</varname>] = "value"</screen></para>
<para>In this example, <varname>VARIABLE</varname> has a flag, <varname>SOMEFLAG</varname> which is set to <literal>value</literal>.</para>
</section>
<section>
<title>Inheritance</title>
<para><emphasis>NOTE:</emphasis> This is only supported in .bb and .bbclass files.</para>
<para>The <literal>inherit</literal> directive is a means of specifying what classes of functionality your .bb requires. It is a rudimentary form of inheritance. For example, you can easily abstract out the tasks involved in building a package that uses autoconf and automake, and put that into a bbclass for your packages to make use of. A given bbclass is located by searching for classes/filename.oeclass in <envar>BBPATH</envar>, where filename is what you inherited.</para>
</section>
<section>
<title>Tasks</title>
<para><emphasis>NOTE:</emphasis> This is only supported in .bb and .bbclass files.</para>
<para>In BitBake, each step that needs to be run for a given .bb is known as a task. There is a command <literal>addtask</literal> to add new tasks (must be a defined Python executable metadata and must start with <quote>do_</quote>) and describe intertask dependencies.</para>
<para><screen>python do_printdate () {
import time
print time.strftime('%Y%m%d', time.gmtime())
}
addtask printdate before do_build</screen></para>
<para>This defines the necessary Python function and adds it as a task which is now a dependency of do_build, the default task. If anyone executes the do_build task, that will result in do_printdate being run first.</para>
</section>
<section>
<title>Task Flags</title>
<para>Tasks support a number of flags which control various functionality of the task. These are as follows:</para>
<para>'dirs' - directories which should be created before the task runs</para>
<para>'cleandirs' - directories which should created before the task runs but should be empty</para>
<para>'noexec' - marks the tasks as being empty and no execution required. These are used as dependency placeholders or used when added tasks need to be subsequently disabled.</para>
<para>'nostamp' - don't generate a stamp file for a task. This means the task is always rexecuted.</para>
<para>'fakeroot' - this task needs to be run in a fakeroot environment, obtained by adding the variables in FAKEROOTENV to the environment.</para>
<para>'umask' - the umask to run the task under.</para>
<para> For the 'deptask', 'rdeptask', 'recdeptask' and 'recrdeptask' flags please see the dependencies section.</para>
</section>
<section>
<title>Events</title>
<para><emphasis>NOTE:</emphasis> This is only supported in .bb and .bbclass files.</para>
<para>BitBake allows installation of event handlers. Events are triggered at certain points during operation, such as the beginning of operation against a given .bb, the start of a given task, task failure, task success, et cetera. The intent is to make it easy to do things like email notification on build failure.</para>
<para><screen>addhandler myclass_eventhandler
python myclass_eventhandler() {
from bb.event import getName
from bb import data
print("The name of the Event is %s" % getName(e))
print("The file we run for is %s" % data.getVar('FILE', e.data, True))
}
</screen></para><para>
This event handler gets called every time an event is triggered. A global variable <varname>e</varname> is defined. <varname>e</varname>.data contains an instance of bb.data. With the getName(<varname>e</varname>)
method one can get the name of the triggered event.</para><para>The above event handler prints the name
of the event and the content of the <varname>FILE</varname> variable.</para>
</section>
<section>
<title>Variants</title>
<para>Two BitBake features exist to facilitate the creation of multiple buildable incarnations from a single recipe file.</para>
<para>The first is <varname>BBCLASSEXTEND</varname>. This variable is a space separated list of classes used to "extend" the recipe for each variant. As an example, setting <screen>BBCLASSEXTEND = "native"</screen> results in a second incarnation of the current recipe being available. This second incarantion will have the "native" class inherited.</para>
<para>The second feature is <varname>BBVERSIONS</varname>. This variable allows a single recipe to build multiple versions of a project from a single recipe file, and allows you to specify conditional metadata (using the <varname>OVERRIDES</varname> mechanism) for a single version, or an optionally named range of versions:</para>
<para><screen>BBVERSIONS = "1.0 2.0 git"
SRC_URI_git = "git://someurl/somepath.git"</screen></para>
<para><screen>BBVERSIONS = "1.0.[0-6]:1.0.0+ \
1.0.[7-9]:1.0.7+"
SRC_URI_append_1.0.7+ = "file://some_patch_which_the_new_versions_need.patch;patch=1"</screen></para>
<para>Note that the name of the range will default to the original version of the recipe, so given OE, a recipe file of foo_1.0.0+.bb will default the name of its versions to 1.0.0+. This is useful, as the range name is not only placed into overrides; it's also made available for the metadata to use in the form of the <varname>BPV</varname> variable, for use in file:// search paths (<varname>FILESPATH</varname>).</para>
</section>
</section>
<section>
<title>Variable interaction: Worked Examples</title>
<para>Despite the documentation of the different forms of variable definition above, it can be hard to work out what happens when variable operators are combined. This section documents some common questions people have regarding the way variables interact.</para>
<section>
<title>Override and append ordering</title>
<para>There is often confusion about which order overrides and the various append operators take effect.</para>
<para><screen><varname>OVERRIDES</varname> = "foo"
<varname>A_foo_append</varname> = "X"</screen></para>
<para>In this case, X is unconditionally appended to the variable <varname>A_foo</varname>. Since foo is an override, A_foo would then replace <varname>A</varname>.</para>
<para><screen><varname>OVERRIDES</varname> = "foo"
<varname>A</varname> = "X"
<varname>A_append_foo</varname> = "Y"</screen></para>
<para>In this case, only when foo is in OVERRIDES, Y is appended to the variable <varname>A</varname> so the value of <varname>A</varname> would become XY (NB: no spaces are appended).</para>
<para><screen><varname>OVERRIDES</varname> = "foo"
<varname>A_foo_append</varname> = "X"
<varname>A_foo_append</varname> += "Y"</screen></para>
<para>This behaves as per the first case above, but the value of <varname>A</varname> would be "X Y" instead of just "X".</para>
<para><screen><varname>A</varname> = "1"
<varname>A_append</varname> = "2"
<varname>A_append</varname> = "3"
<varname>A</varname> += "4"
<varname>A</varname> .= "5"</screen></para>
<para>Would ultimately result in <varname>A</varname> taking the value "1 4523" since the _append operator executes at the same time as the expansion of other overrides.</para>
</section>
<section>
<title>Key Expansion</title>
<para>Key expansion happens at the data store finalisation time just before overrides are expanded.</para>
<para><screen><varname>A${B}</varname> = "X"
<varname>B</varname> = "2"
<varname>A2</varname> = "Y"</screen></para>
<para>So in this case <varname>A2</varname> would take the value of "X".</para>
</section>
</section>
<section>
<title>Dependency handling</title>
<para>BitBake 1.7.x onwards works with the metadata at the task level since this is optimal when dealing with multiple threads of execution. A robust method of specifing task dependencies is therefore needed. </para>
<section>
<title>Dependencies internal to the .bb file</title>
<para>Where the dependencies are internal to a given .bb file, the dependencies are handled by the previously detailed addtask directive.</para>
</section>
<section>
<title>DEPENDS</title>
<para>DEPENDS lists build time dependencies. The 'deptask' flag for tasks is used to signify the task of each item listed in DEPENDS which must have completed before that task can be executed.</para>
<para><screen>do_configure[deptask] = "do_populate_staging"</screen></para>
<para>means the do_populate_staging task of each item in DEPENDS must have completed before do_configure can execute.</para>
</section>
<section>
<title>RDEPENDS</title>
<para>RDEPENDS lists runtime dependencies. The 'rdeptask' flag for tasks is used to signify the task of each item listed in RDEPENDS which must have completed before that task can be executed.</para>
<para><screen>do_package_write[rdeptask] = "do_package"</screen></para>
<para>means the do_package task of each item in RDEPENDS must have completed before do_package_write can execute.</para>
</section>
<section>
<title>Recursive DEPENDS</title>
<para>These are specified with the 'recdeptask' flag and is used signify the task(s) of each DEPENDS which must have completed before that task can be executed. It applies recursively so the DEPENDS of each item in the original DEPENDS must be met and so on.</para>
</section>
<section>
<title>Recursive RDEPENDS</title>
<para>These are specified with the 'recrdeptask' flag and is used signify the task(s) of each RDEPENDS which must have completed before that task can be executed. It applies recursively so the RDEPENDS of each item in the original RDEPENDS must be met and so on. It also runs all DEPENDS first.</para>
</section>
<section>
<title>Inter task</title>
<para>The 'depends' flag for tasks is a more generic form of which allows an interdependency on specific tasks rather than specifying the data in DEPENDS or RDEPENDS.</para>
<para><screen>do_patch[depends] = "quilt-native:do_populate_staging"</screen></para>
<para>means the do_populate_staging task of the target quilt-native must have completed before the do_patch can execute.</para>
</section>
</section>
<section>
<title>Parsing</title>
<section>
<title>Configuration files</title>
<para>The first kind of metadata in BitBake is configuration metadata. This metadata is global, and therefore affects <emphasis>all</emphasis> packages and tasks which are executed.</para>
<para>BitBake will first search the current working directory for an optional "conf/bblayers.conf" configuration file. This file is expected to contain a BBLAYERS variable which is a space delimited list of 'layer' directories. For each directory in this list, a "conf/layer.conf" file will be searched for and parsed with the LAYERDIR variable being set to the directory where the layer was found. The idea is these files will setup BBPATH and other variables correctly for a given build directory automatically for the user.</para>
<para>BitBake will then expect to find 'conf/bitbake.conf' somewhere in the user specified <envar>BBPATH</envar>. That configuration file generally has include directives to pull in any other metadata (generally files specific to architecture, machine, <emphasis>local</emphasis> and so on).</para>
<para>Only variable definitions and include directives are allowed in .conf files.</para>
</section>
<section>
<title>Classes</title>
<para>BitBake classes are our rudimentary inheritance mechanism. As briefly mentioned in the metadata introduction, they're parsed when an <literal>inherit</literal> directive is encountered, and they are located in classes/ relative to the directories in <envar>BBPATH</envar>.</para>
</section>
<section>
<title>.bb files</title>
<para>A BitBake (.bb) file is a logical unit of tasks to be executed. Normally this is a package to be built. Inter-.bb dependencies are obeyed. The files themselves are located via the <varname>BBFILES</varname> variable, which is set to a space separated list of .bb files, and does handle wildcards.</para>
</section>
</section>
</chapter>
<chapter>
<title>File download support</title>
<section>
<title>Overview</title>
<para>BitBake provides support to download files this procedure is called fetching and it handled by the fetch and fetch2 modules. At this point the original fetch code is considered to be replaced by fetch2 and this manual only related to the fetch2 codebase.</para>
<para>The SRC_URI is normally used to tell BitBake which files to fetch. The next sections will describe the available fetchers and their options. Each fetcher honors a set of variables and per URI parameters separated by a <quote>;</quote> consisting of a key and a value. The semantics of the variables and parameters are defined by the fetcher. BitBake tries to have consistent semantics between the different fetchers.
</para>
<para>The overall fetch process is that first, fetches are attempted from PREMIRRORS. If those don't work, the original SRC_URI is attempted and if that fails, BitBake will fall back to MIRRORS. Cross urls are supported, so its possible to mirror a git repository on an http server as a tarball for example. Some example commonly used mirror definitions are:</para>
<para><screen><varname>PREMIRRORS</varname> ?= "\
bzr://.*/.* http://somemirror.org/sources/ \n \
cvs://.*/.* http://somemirror.org/sources/ \n \
git://.*/.* http://somemirror.org/sources/ \n \
hg://.*/.* http://somemirror.org/sources/ \n \
osc://.*/.* http://somemirror.org/sources/ \n \
p4://.*/.* http://somemirror.org/sources/ \n \
svk://.*/.* http://somemirror.org/sources/ \n \
svn://.*/.* http://somemirror.org/sources/ \n"
<varname>MIRRORS</varname> =+ "\
ftp://.*/.* http://somemirror.org/sources/ \n \
http://.*/.* http://somemirror.org/sources/ \n \
https://.*/.* http://somemirror.org/sources/ \n"</screen></para>
<para>Non-local downloaded output is placed into the directory specified by the <varname>DL_DIR</varname>. For non local downloads the code can check checksums for the download to ensure the file has been downloaded correctly. These are specified in the form <varname>SRC_URI[md5sum]</varname> for the md5 checksum and <varname>SRC_URI[sha256sum]</varname> for the sha256 checksum. If <varname>BB_STRICT_CHECKSUM</varname> is set, any download without a checksum will trigger an error message. In cases where multiple files are listed in SRC_URI, the name parameter is used assign names to the urls and these are then specified in the checksums in the form SRC_URI[name.sha256sum].</para>
</section>
<section>
<title>Local file fetcher</title>
<para>The URN for the local file fetcher is <emphasis>file</emphasis>. The filename can be either absolute or relative. If the filename is relative, <varname>FILESPATH</varname> and failing that <varname>FILESDIR</varname> will be used to find the appropriate relative file. The metadata usually extend these variables to include variations of the values in <varname>OVERRIDES</varname>. Single files and complete directories can be specified.
<screen><varname>SRC_URI</varname>= "file://relativefile.patch"
<varname>SRC_URI</varname>= "file://relativefile.patch;this=ignored"
<varname>SRC_URI</varname>= "file:///Users/ich/very_important_software"
</screen>
</para>
</section>
<section>
<title>CVS fetcher</title>
<para>The URN for the CVS fetcher is <emphasis>cvs</emphasis>. This fetcher honors the variables <varname>CVSDIR</varname>, <varname>SRCDATE</varname>, <varname>FETCHCOMMAND_cvs</varname>, <varname>UPDATECOMMAND_cvs</varname>. <varname>DL_DIR</varname> specifies where a temporary checkout is saved. <varname>SRCDATE</varname> specifies which date to use when doing the fetching (the special value of "now" will cause the checkout to be updated on every build). <varname>FETCHCOMMAND</varname> and <varname>UPDATECOMMAND</varname> specify which executables to use for the CVS checkout or update.
</para>
<para>The supported parameters are <varname>module</varname>, <varname>tag</varname>, <varname>date</varname>, <varname>method</varname>, <varname>localdir</varname>, <varname>rsh</varname> and <varname>scmdata</varname>. The <varname>module</varname> specifies which module to check out, the <varname>tag</varname> describes which CVS TAG should be used for the checkout. By default the TAG is empty. A <varname>date</varname> can be specified to override the SRCDATE of the configuration to checkout a specific date. The special value of "now" will cause the checkout to be updated on every build.<varname>method</varname> is by default <emphasis>pserver</emphasis>. If <emphasis>ext</emphasis> is used the <varname>rsh</varname> parameter will be evaluated and <varname>CVS_RSH</varname> will be set. Finally, <varname>localdir</varname> is used to checkout into a special directory relative to <varname>CVSDIR</varname>.
<screen><varname>SRC_URI</varname> = "cvs://CVSROOT;module=mymodule;tag=some-version;method=ext"
<varname>SRC_URI</varname> = "cvs://CVSROOT;module=mymodule;date=20060126;localdir=usethat"
</screen>
</para>
</section>
<section>
<title>HTTP/FTP fetcher</title>
<para>The URNs for the HTTP/FTP fetcher are <emphasis>http</emphasis>, <emphasis>https</emphasis> and <emphasis>ftp</emphasis>. This fetcher honors the variables <varname>FETCHCOMMAND_wget</varname>. <varname>FETCHCOMMAND</varname> contains the command used for fetching. <quote>${URI}</quote> and <quote>${FILES}</quote> will be replaced by the URI and basename of the file to be fetched.
</para>
<para><screen><varname>SRC_URI</varname> = "http://oe.handhelds.org/not_there.aac"
<varname>SRC_URI</varname> = "ftp://oe.handhelds.org/not_there_as_well.aac"
<varname>SRC_URI</varname> = "ftp://you@oe.handheld.sorg/home/you/secret.plan"
</screen></para>
</section>
<section>
<title>SVN fetcher</title>
<para>The URN for the SVN fetcher is <emphasis>svn</emphasis>.
</para>
<para>This fetcher honors the variables <varname>FETCHCOMMAND_svn</varname>, <varname>SVNDIR</varname>, <varname>SRCREV</varname>. <varname>FETCHCOMMAND</varname> contains the subversion command. <varname>SRCREV</varname> specifies which revision to use when doing the fetching.
</para>
<para>The supported parameters are <varname>proto</varname>, <varname>rev</varname> and <varname>scmdata</varname>. <varname>proto</varname> is the Subversion protocol, <varname>rev</varname> is the Subversion revision. If <varname>scmdata</varname> is set to <quote>keep</quote>, the <quote>.svn</quote> directories will be available during compile-time.
</para>
<para><screen><varname>SRC_URI</varname> = "svn://svn.oe.handhelds.org/svn;module=vip;proto=http;rev=667"
<varname>SRC_URI</varname> = "svn://svn.oe.handhelds.org/svn/;module=opie;proto=svn+ssh;date=20060126"
</screen></para>
</section>
<section>
<title>GIT fetcher</title>
<para>The URN for the GIT Fetcher is <emphasis>git</emphasis>.
</para>
<para>The variable <varname>GITDIR</varname> will be used as the base directory where the git tree is cloned to.
</para>
<para>The parameters are <emphasis>tag</emphasis>, <emphasis>protocol</emphasis> and <emphasis>scmdata</emphasis>. <emphasis>tag</emphasis> is a Git tag, the default is <quote>master</quote>. <emphasis>protocol</emphasis> is the Git protocol to use and defaults to <quote>git</quote> if a hostname is set, otherwise its <quote>file</quote>. If <emphasis>scmdata</emphasis> is set to <quote>keep</quote>, the <quote>.git</quote> directory will be available during compile-time.
</para>
<para><screen><varname>SRC_URI</varname> = "git://git.oe.handhelds.org/git/vip.git;tag=version-1"
<varname>SRC_URI</varname> = "git://git.oe.handhelds.org/git/vip.git;protocol=http"
</screen></para>
</section>
</chapter>
<chapter>
<title>The BitBake command</title>
<section>
<title>Introduction</title>
<para>bitbake is the primary command in the system. It facilitates executing tasks in a single .bb file, or executing a given task on a set of multiple .bb files, accounting for interdependencies amongst them.</para>
</section>
<section>
<title>Usage and syntax</title>
<para>
<screen><prompt>$ </prompt>bitbake --help
usage: bitbake [options] [package ...]
Executes the specified task (default is 'build') for a given set of BitBake files.
It expects that BBFILES is defined, which is a space separated list of files to
be executed. BBFILES does support wildcards.
Default BBFILES are the .bb files in the current directory.
options:
--version show program's version number and exit
-h, --help show this help message and exit
-b BUILDFILE, --buildfile=BUILDFILE
execute the task against this .bb file, rather than a
package from BBFILES.
-k, --continue continue as much as possible after an error. While the
target that failed, and those that depend on it,
cannot be remade, the other dependencies of these
targets can be processed all the same.
-f, --force force run of specified cmd, regardless of stamp status
-i, --interactive drop into the interactive mode also called the BitBake
shell.
-c CMD, --cmd=CMD Specify task to execute. Note that this only executes
the specified task for the providee and the packages
it depends on, i.e. 'compile' does not implicitly call
stage for the dependencies (IOW: use only if you know
what you are doing). Depending on the base.bbclass a
listtasks task is defined and will show available
tasks
-r FILE, --read=FILE read the specified file before bitbake.conf
-v, --verbose output more chit-chat to the terminal
-D, --debug Increase the debug level. You can specify this more
than once.
-n, --dry-run don't execute, just go through the motions
-p, --parse-only quit after parsing the BB files (developers only)
-s, --show-versions show current and preferred versions of all packages
-e, --environment show the global or per-package environment (this is
what used to be bbread)
-g, --graphviz emit the dependency trees of the specified packages in
the dot syntax
-I IGNORED_DOT_DEPS, --ignore-deps=IGNORED_DOT_DEPS
Stop processing at the given list of dependencies when
generating dependency graphs. This can help to make
the graph more appealing
-l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS
Show debug logging for the specified logging domains
-P, --profile profile the command and print a report
</screen>
</para>
<para>
<example>
<title>Executing a task against a single .bb</title>
<para>Executing tasks for a single file is relatively simple. You specify the file in question, and BitBake parses it and executes the specified task (or <quote>build</quote> by default). It obeys intertask dependencies when doing so.</para>
<para><quote>clean</quote> task:</para>
<para><screen><prompt>$ </prompt>bitbake -b blah_1.0.bb -c clean</screen></para>
<para><quote>build</quote> task:</para>
<para><screen><prompt>$ </prompt>bitbake -b blah_1.0.bb</screen></para>
</example>
</para>
<para>
<example>
<title>Executing tasks against a set of .bb files</title>
<para>There are a number of additional complexities introduced when one wants to manage multiple .bb files. Clearly there needs to be a way to tell BitBake what files are available, and of those, which we want to execute at this time. There also needs to be a way for each .bb to express its dependencies, both for build time and runtime. There must be a way for the user to express their preferences when multiple .bb's provide the same functionality, or when there are multiple versions of a .bb.</para>
<para>The next section, Metadata, outlines how to specify such things.</para>
<para>Note that the bitbake command, when not using --buildfile, accepts a <varname>PROVIDER</varname>, not a filename or anything else. By default, a .bb generally PROVIDES its packagename, packagename-version, and packagename-version-revision.</para>
<screen><prompt>$ </prompt>bitbake blah</screen>
<screen><prompt>$ </prompt>bitbake blah-1.0</screen>
<screen><prompt>$ </prompt>bitbake blah-1.0-r0</screen>
<screen><prompt>$ </prompt>bitbake -c clean blah</screen>
<screen><prompt>$ </prompt>bitbake virtual/whatever</screen>
<screen><prompt>$ </prompt>bitbake -c clean virtual/whatever</screen>
</example>
<example>
<title>Generating dependency graphs</title>
<para>BitBake is able to generate dependency graphs using the dot syntax. These graphs can be converted
to images using the <application>dot</application> application from <ulink url="http://www.graphviz.org">Graphviz</ulink>.
Two files will be written into the current working directory, <emphasis>depends.dot</emphasis> containing dependency information at the package level and <emphasis>task-depends.dot</emphasis> containing a breakdown of the dependencies at the task level. To stop depending on common depends, one can use the <prompt>-I depend</prompt> to omit these from the graph. This can lead to more readable graphs. This way, <varname>DEPENDS</varname> from inherited classes such as base.bbclass can be removed from the graph.</para>
<screen><prompt>$ </prompt>bitbake -g blah</screen>
<screen><prompt>$ </prompt>bitbake -g -I virtual/whatever -I bloom blah</screen>
</example>
</para>
</section>
<section>
<title>Special variables</title>
<para>Certain variables affect BitBake operation:</para>
<section>
<title><varname>BB_NUMBER_THREADS</varname></title>
<para> The number of threads BitBake should run at once (default: 1).</para>
</section>
</section>
<section>
<title>Metadata</title>
<para>As you may have seen in the usage information, or in the information about .bb files, the <varname>BBFILES</varname> variable is how the BitBake tool locates its files. This variable is a space separated list of files that are available, and supports wildcards.
<example>
<title>Setting BBFILES</title>
<programlisting><varname>BBFILES</varname> = "/path/to/bbfiles/*.bb"</programlisting>
</example></para>
<para>With regard to dependencies, it expects the .bb to define a <varname>DEPENDS</varname> variable, which contains a space separated list of <quote>package names</quote>, which themselves are the <varname>PN</varname> variable. The <varname>PN</varname> variable is, in general, set to a component of the .bb filename by default.</para>
<example>
<title>Depending on another .bb</title>
<para>a.bb:
<screen>PN = "package-a"
DEPENDS += "package-b"</screen>
</para>
<para>b.bb:
<screen>PN = "package-b"</screen>
</para>
</example>
<example>
<title>Using PROVIDES</title>
<para>This example shows the usage of the <varname>PROVIDES</varname> variable, which allows a given .bb to specify what functionality it provides.</para>
<para>package1.bb:
<screen>PROVIDES += "virtual/package"</screen>
</para>
<para>package2.bb:
<screen>DEPENDS += "virtual/package"</screen>
</para>
<para>package3.bb:
<screen>PROVIDES += "virtual/package"</screen>
</para>
<para>As you can see, we have two different .bb's that provide the same functionality (virtual/package). Clearly, there needs to be a way for the person running BitBake to control which of those providers gets used. There is, indeed, such a way.</para>
<para>The following would go into a .conf file, to select package1:
<screen>PREFERRED_PROVIDER_virtual/package = "package1"</screen>
</para>
</example>
<example>
<title>Specifying version preference</title>
<para>When there are multiple <quote>versions</quote> of a given package, BitBake defaults to selecting the most recent version, unless otherwise specified. If the .bb in question has a <varname>DEFAULT_PREFERENCE</varname> set lower than the other .bb's (default is 0), then it will not be selected. This allows the person or persons maintaining the repository of .bb files to specify their preference for the default selected version. In addition, the user can specify their preferred version.</para>
<para>If the first .bb is named <filename>a_1.1.bb</filename>, then the <varname>PN</varname> variable will be set to <quote>a</quote>, and the <varname>PV</varname> variable will be set to 1.1.</para>
<para>If we then have an <filename>a_1.2.bb</filename>, BitBake will choose 1.2 by default. However, if we define the following variable in a .conf that BitBake parses, we can change that.
<screen>PREFERRED_VERSION_a = "1.1"</screen>
</para>
</example>
<example>
<title>Using <quote>bbfile collections</quote></title>
<para>bbfile collections exist to allow the user to have multiple repositories of bbfiles that contain the same exact package. For example, one could easily use them to make one's own local copy of an upstream repository, but with custom modifications that one does not want upstream. Usage:</para>
<screen>BBFILES = "/stuff/openembedded/*/*.bb /stuff/openembedded.modified/*/*.bb"
BBFILE_COLLECTIONS = "upstream local"
BBFILE_PATTERN_upstream = "^/stuff/openembedded/"
BBFILE_PATTERN_local = "^/stuff/openembedded.modified/"
BBFILE_PRIORITY_upstream = "5"
BBFILE_PRIORITY_local = "10"</screen>
</example>
</section>
</chapter>
</book>

View File

@ -1,59 +0,0 @@
<!ENTITY DISTRO "1.4">
<!ENTITY DISTRO_NAME "tbd">
<!ENTITY YOCTO_DOC_VERSION "1.4">
<!ENTITY POKYVERSION "8.0">
<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME;-&POKYVERSION;">
<!ENTITY COPYRIGHT_YEAR "2010-2013">
<!ENTITY YOCTO_DL_URL "http://downloads.yoctoproject.org">
<!ENTITY YOCTO_HOME_URL "http://www.yoctoproject.org">
<!ENTITY YOCTO_LISTS_URL "http://lists.yoctoproject.org">
<!ENTITY YOCTO_BUGZILLA_URL "http://bugzilla.yoctoproject.org">
<!ENTITY YOCTO_WIKI_URL "https://wiki.yoctoproject.org">
<!ENTITY YOCTO_AB_URL "http://autobuilder.yoctoproject.org">
<!ENTITY YOCTO_GIT_URL "http://git.yoctoproject.org">
<!ENTITY YOCTO_ADTREPO_URL "http://adtrepo.yoctoproject.org">
<!ENTITY OE_HOME_URL "http://www.openembedded.org">
<!ENTITY OE_LISTS_URL "http://lists.linuxtogo.org/cgi-bin/mailman">
<!ENTITY OE_DOCS_URL "http://docs.openembedded.org">
<!ENTITY OH_HOME_URL "http://o-hand.com">
<!ENTITY BITBAKE_HOME_URL "http://developer.berlios.de/projects/bitbake/">
<!ENTITY ECLIPSE_MAIN_URL "http://www.eclipse.org/downloads">
<!ENTITY ECLIPSE_DL_URL "http://download.eclipse.org">
<!ENTITY ECLIPSE_DL_PLUGIN_URL "&YOCTO_DL_URL;/releases/eclipse-plugin/&DISTRO;">
<!ENTITY ECLIPSE_UPDATES_URL "&ECLIPSE_DL_URL;/tm/updates/3.3">
<!ENTITY ECLIPSE_INDIGO_URL "&ECLIPSE_DL_URL;/releases/indigo">
<!ENTITY ECLIPSE_JUNO_URL "&ECLIPSE_DL_URL;/releases/juno">
<!ENTITY ECLIPSE_INDIGO_CDT_URL "&ECLIPSE_DL_URL;tools/cdt/releases/indigo">
<!ENTITY YOCTO_DOCS_URL "&YOCTO_HOME_URL;/docs">
<!ENTITY YOCTO_SOURCES_URL "&YOCTO_HOME_URL;/sources/">
<!ENTITY YOCTO_AB_PORT_URL "&YOCTO_AB_URL;:8010">
<!ENTITY YOCTO_AB_NIGHTLY_URL "&YOCTO_AB_URL;/nightly/">
<!ENTITY YOCTO_POKY_URL "&YOCTO_DL_URL;/releases/poky/">
<!ENTITY YOCTO_RELEASE_DL_URL "&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;">
<!ENTITY YOCTO_TOOLCHAIN_DL_URL "&YOCTO_RELEASE_DL_URL;/toolchain/">
<!ENTITY YOCTO_ECLIPSE_DL_URL "&YOCTO_RELEASE_DL_URL;/eclipse-plugin/indigo;">
<!ENTITY YOCTO_ADTINSTALLER_DL_URL "&YOCTO_RELEASE_DL_URL;/adt_installer">
<!ENTITY YOCTO_POKY_DL_URL "&YOCTO_RELEASE_DL_URL;/&YOCTO_POKY;.tar.bz2">
<!ENTITY YOCTO_MACHINES_DL_URL "&YOCTO_RELEASE_DL_URL;/machines">
<!ENTITY YOCTO_QEMU_DL_URL "&YOCTO_MACHINES_DL_URL;/qemu">
<!ENTITY YOCTO_PYTHON-i686_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-i686.tar.bz2">
<!ENTITY YOCTO_PYTHON-x86_64_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-x86_64.tar.bz2">
<!ENTITY YOCTO_DOCS_QS_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/yocto-project-qs/yocto-project-qs.html">
<!ENTITY YOCTO_DOCS_ADT_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/adt-manual/adt-manual.html">
<!ENTITY YOCTO_DOCS_REF_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/ref-manual/ref-manual.html">
<!ENTITY YOCTO_DOCS_BSP_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bsp-guide/bsp-guide.html">
<!ENTITY YOCTO_DOCS_DEV_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/dev-manual/dev-manual.html">
<!ENTITY YOCTO_DOCS_KERNEL_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-manual/kernel-manual.html">
<!ENTITY YOCTO_ADTPATH_DIR "/opt/poky/&DISTRO;">
<!ENTITY YOCTO_POKY_TARBALL "&YOCTO_POKY;.tar.bz2">
<!ENTITY OE_INIT_PATH "&YOCTO_POKY;/oe-init-build-env">
<!ENTITY OE_INIT_FILE "oe-init-build-env">
<!ENTITY UBUNTU_HOST_PACKAGES_ESSENTIAL "gawk wget git-core diffstat unzip texinfo \
build-essential chrpath">
<!ENTITY FEDORA_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \
diffutils diffstat git cpp gcc gcc-c++ eglibc-devel texinfo chrpath \
ccache">
<!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
diffstat texinfo python-curses">
<!ENTITY CENTOS_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath">

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1,39 +0,0 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="d">
<xsl:template name="component.title">
<xsl:param name="node" select="."/>
<xsl:variable name="level">
<xsl:choose>
<xsl:when test="ancestor::d:section">
<xsl:value-of select="count(ancestor::d:section)+1"/>
</xsl:when>
<xsl:when test="ancestor::d:sect5">6</xsl:when>
<xsl:when test="ancestor::d:sect4">5</xsl:when>
<xsl:when test="ancestor::d:sect3">4</xsl:when>
<xsl:when test="ancestor::d:sect2">3</xsl:when>
<xsl:when test="ancestor::d:sect1">2</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="h{$level+1}" namespace="http://www.w3.org/1999/xhtml">
<xsl:attribute name="class">title</xsl:attribute>
<xsl:if test="$generate.id.attributes = 0">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:apply-templates select="$node" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
<xsl:call-template name="permalink">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,64 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" />
<!-- check project-plan.sh for how this is generated, needed to tweak
the cover page
-->
<xsl:include href="/tmp/titlepage.xsl"/>
<!-- To force a page break in document, i.e per section add a
<?hard-pagebreak?> tag.
-->
<xsl:template match="processing-instruction('hard-pagebreak')">
<fo:block break-before='page' />
</xsl:template>
<!--Fix for defualt indent getting TOC all wierd..
See http://sources.redhat.com/ml/docbook-apps/2005-q1/msg00455.html
FIXME: must be a better fix
-->
<xsl:param name="body.start.indent" select="'0'"/>
<!--<xsl:param name="title.margin.left" select="'0'"/>-->
<!-- stop long-ish header titles getting wrapped -->
<xsl:param name="header.column.widths">1 10 1</xsl:param>
<!-- customise headers and footers a little -->
<xsl:template name="head.sep.rule">
<xsl:if test="$header.rule != 0">
<xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute>
<xsl:attribute name="border-bottom-style">solid</xsl:attribute>
<xsl:attribute name="border-bottom-color">#cccccc</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template name="foot.sep.rule">
<xsl:if test="$footer.rule != 0">
<xsl:attribute name="border-top-width">0.5pt</xsl:attribute>
<xsl:attribute name="border-top-style">solid</xsl:attribute>
<xsl:attribute name="border-top-color">#cccccc</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:attribute-set name="header.content.properties">
<xsl:attribute name="color">#cccccc</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="footer.content.properties">
<xsl:attribute name="color">#cccccc</xsl:attribute>
</xsl:attribute-set>
<!-- general settings -->
<xsl:param name="fop1.extensions" select="1"></xsl:param>
<xsl:param name="paper.type" select="'A4'"></xsl:param>
<xsl:param name="section.autolabel" select="1"></xsl:param>
<xsl:param name="body.font.family" select="'verasans'"></xsl:param>
<xsl:param name="title.font.family" select="'verasans'"></xsl:param>
<xsl:param name="monospace.font.family" select="'veramono'"></xsl:param>
</xsl:stylesheet>

View File

@ -1,25 +0,0 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="d">
<xsl:template name="division.title">
<xsl:param name="node" select="."/>
<h1>
<xsl:attribute name="class">title</xsl:attribute>
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates select="$node" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
<xsl:call-template name="permalink">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</h1>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@ -1,58 +0,0 @@
<fop version="1.0">
<!-- Strict user configuration -->
<strict-configuration>true</strict-configuration>
<!-- Strict FO validation -->
<strict-validation>true</strict-validation>
<!--
Set the baseDir so common/openedhand.svg references in plans still
work ok. Note, relative file references to current dir should still work.
-->
<base>../template</base>
<font-base>../template</font-base>
<!-- Source resolution in dpi (dots/pixels per inch) for determining the
size of pixels in SVG and bitmap images, default: 72dpi -->
<!-- <source-resolution>72</source-resolution> -->
<!-- Target resolution in dpi (dots/pixels per inch) for specifying the
target resolution for generated bitmaps, default: 72dpi -->
<!-- <target-resolution>72</target-resolution> -->
<!-- default page-height and page-width, in case
value is specified as auto -->
<default-page-settings height="11in" width="8.26in"/>
<!-- <use-cache>false</use-cache> -->
<renderers>
<renderer mime="application/pdf">
<fonts>
<font metrics-file="VeraMono.xml"
kerning="yes"
embed-url="VeraMono.ttf">
<font-triplet name="veramono" style="normal" weight="normal"/>
</font>
<font metrics-file="VeraMoBd.xml"
kerning="yes"
embed-url="VeraMoBd.ttf">
<font-triplet name="veramono" style="normal" weight="bold"/>
</font>
<font metrics-file="Vera.xml"
kerning="yes"
embed-url="Vera.ttf">
<font-triplet name="verasans" style="normal" weight="normal"/>
<font-triplet name="verasans" style="normal" weight="bold"/>
<font-triplet name="verasans" style="italic" weight="normal"/>
<font-triplet name="verasans" style="italic" weight="bold"/>
</font>
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>

View File

@ -1,21 +0,0 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="d">
<xsl:template name="formal.object.heading">
<xsl:param name="object" select="."/>
<xsl:param name="title">
<xsl:apply-templates select="$object" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</xsl:param>
<p class="title">
<b><xsl:copy-of select="$title"/></b>
<xsl:call-template name="permalink">
<xsl:with-param name="node" select="$object"/>
</xsl:call-template>
</p>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,14 +0,0 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:template match="glossentry/glossterm">
<xsl:apply-imports/>
<xsl:if test="$generate.permalink != 0">
<xsl:call-template name="permalink">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="generate.permalink" select="1"/>
<xsl:param name="permalink.text"></xsl:param>
<xsl:template name="permalink">
<xsl:param name="node"/>
<xsl:if test="$generate.permalink != '0'">
<span class="permalink">
<a alt="Permalink" title="Permalink">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$node"/>
</xsl:call-template>
</xsl:attribute>
<xsl:copy-of select="$permalink.text"/>
</a>
</span>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,55 +0,0 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook"
xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="d">
<xsl:template name="section.title">
<xsl:variable name="section"
select="(ancestor::section |
ancestor::simplesect|
ancestor::sect1|
ancestor::sect2|
ancestor::sect3|
ancestor::sect4|
ancestor::sect5)[last()]"/>
<xsl:variable name="renderas">
<xsl:choose>
<xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
<xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
<xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
<xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
<xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
<xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="level">
<xsl:choose>
<xsl:when test="$renderas != ''">
<xsl:value-of select="$renderas"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="section.level">
<xsl:with-param name="node" select="$section"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="section.heading">
<xsl:with-param name="section" select="$section"/>
<xsl:with-param name="level" select="$level"/>
<xsl:with-param name="title">
<xsl:apply-templates select="$section" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
<xsl:if test="$level &gt; 0">
<xsl:call-template name="permalink">
<xsl:with-param name="node" select="$section"/>
</xsl:call-template>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@ -1,51 +0,0 @@
#!/bin/sh
if [ -z "$1" -o -z "$2" ]; then
echo "usage: [-v] $0 <docbook file> <templatedir>"
echo
echo "*NOTE* you need xsltproc, fop and nwalsh docbook stylesheets"
echo " installed for this to work!"
echo
exit 0
fi
FO=`echo $1 | sed s/.xml/.fo/` || exit 1
PDF=`echo $1 | sed s/.xml/.pdf/` || exit 1
TEMPLATEDIR=$2
##
# These URI should be rewritten by your distribution's xml catalog to
# match your localy installed XSL stylesheets.
XSL_BASE_URI="http://docbook.sourceforge.net/release/xsl/current"
# Creates a temporary XSL stylesheet based on titlepage.xsl
xsltproc -o /tmp/titlepage.xsl \
--xinclude \
$XSL_BASE_URI/template/titlepage.xsl \
$TEMPLATEDIR/titlepage.templates.xml || exit 1
# Creates the file needed for FOP
xsltproc --xinclude \
--stringparam hyphenate false \
--stringparam formal.title.placement "figure after" \
--stringparam ulink.show 1 \
--stringparam body.font.master 9 \
--stringparam title.font.master 11 \
--stringparam draft.watermark.image "$TEMPLATEDIR/draft.png" \
--stringparam chapter.autolabel 1 \
--stringparam appendix.autolabel A \
--stringparam section.autolabel 1 \
--stringparam section.label.includes.component.label 1 \
--output $FO \
$TEMPLATEDIR/db-pdf.xsl \
$1 || exit 1
# Invokes the Java version of FOP. Uses the additional configuration file common/fop-config.xml
fop -c $TEMPLATEDIR/fop-config.xml -fo $FO -pdf $PDF || exit 1
rm -f $FO
rm -f /tmp/titlepage.xsl
echo
echo " #### Success! $PDF ready. ####"
echo

View File

@ -23,17 +23,19 @@
# Assign a file to __warn__ to get warnings about slow operations.
#
from __future__ import print_function
import copy
import types
ImmutableTypes = (
types.NoneType,
bool,
complex,
float,
int,
long,
tuple,
frozenset,
str
basestring
)
MUTABLE = "__mutable__"
@ -59,7 +61,7 @@ class COWDictMeta(COWMeta):
__call__ = cow
def __setitem__(cls, key, value):
if value is not None and not isinstance(value, ImmutableTypes):
if not isinstance(value, ImmutableTypes):
if not isinstance(value, COWMeta):
cls.__hasmutable__ = True
key += MUTABLE
@ -114,7 +116,7 @@ class COWDictMeta(COWMeta):
cls.__setitem__(key, cls.__marker__)
def __revertitem__(cls, key):
if key not in cls.__dict__:
if not cls.__dict__.has_key(key):
key += MUTABLE
delattr(cls, key)
@ -181,7 +183,7 @@ class COWSetMeta(COWDictMeta):
COWDictMeta.__delitem__(cls, repr(hash(value)))
def __in__(cls, value):
return repr(hash(value)) in COWDictMeta
return COWDictMeta.has_key(repr(hash(value)))
def iterkeys(cls):
raise TypeError("sets don't have keys")
@ -190,10 +192,12 @@ class COWSetMeta(COWDictMeta):
raise TypeError("sets don't have 'items'")
# These are the actual classes you use!
class COWDictBase(object, metaclass = COWDictMeta):
class COWDictBase(object):
__metaclass__ = COWDictMeta
__count__ = 0
class COWSetBase(object, metaclass = COWSetMeta):
class COWSetBase(object):
__metaclass__ = COWSetMeta
__count__ = 0
if __name__ == "__main__":
@ -283,7 +287,7 @@ if __name__ == "__main__":
except KeyError:
print("Yay! deleted key raises error")
if 'b' in b:
if b.has_key('b'):
print("Boo!")
else:
print("Yay - has_key with delete works!")

View File

@ -21,23 +21,11 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
__version__ = "1.34.0"
__version__ = "1.13.3"
import sys
if sys.version_info < (3, 4, 0):
raise RuntimeError("Sorry, python 3.4.0 or later is required for this version of bitbake")
class BBHandledException(Exception):
"""
The big dilemma for generic bitbake code is what information to give the user
when an exception occurs. Any exception inheriting this base exception class
has already provided information to the user via some 'fired' message type such as
an explicitly fired event using bb.fire, or a bb.error message. If bitbake
encounters an exception derived from this class, no backtrace or other information
will be given to the user, its assumed the earlier event provided the relevant information.
"""
pass
if sys.version_info < (2, 6, 0):
raise RuntimeError("Sorry, python 2.6.0 or later is required for this version of bitbake")
import os
import logging
@ -70,42 +58,47 @@ logger = logging.getLogger("BitBake")
logger.addHandler(NullHandler())
logger.setLevel(logging.DEBUG - 2)
mainlogger = logging.getLogger("BitBake.Main")
# This has to be imported after the setLoggerClass, as the import of bb.msg
# can result in construction of the various loggers.
import bb.msg
from bb import fetch2 as fetch
sys.modules['bb.fetch'] = sys.modules['bb.fetch2']
if "BBDEBUG" in os.environ:
level = int(os.environ["BBDEBUG"])
if level:
bb.msg.set_debug_level(level)
if True or os.environ.get("BBFETCH2"):
from bb import fetch2 as fetch
sys.modules['bb.fetch'] = sys.modules['bb.fetch2']
# Messaging convenience functions
def plain(*args):
mainlogger.plain(''.join(args))
logger.plain(''.join(args))
def debug(lvl, *args):
if isinstance(lvl, str):
mainlogger.warning("Passed invalid debug level '%s' to bb.debug", lvl)
if isinstance(lvl, basestring):
logger.warn("Passed invalid debug level '%s' to bb.debug", lvl)
args = (lvl,) + args
lvl = 1
mainlogger.debug(lvl, ''.join(args))
logger.debug(lvl, ''.join(args))
def note(*args):
mainlogger.info(''.join(args))
logger.info(''.join(args))
def warn(*args):
mainlogger.warning(''.join(args))
logger.warn(''.join(args))
def error(*args, **kwargs):
mainlogger.error(''.join(args), extra=kwargs)
def error(*args):
logger.error(''.join(args))
def fatal(*args):
logger.critical(''.join(args))
sys.exit(1)
def fatal(*args, **kwargs):
mainlogger.critical(''.join(args), extra=kwargs)
raise BBHandledException()
def deprecated(func, name=None, advice=""):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
as deprecated. It will result in a warning being emmitted
when the function is used."""
import warnings
@ -142,3 +135,6 @@ def deprecate_import(current, modulename, fromlist, renames = None):
setattr(sys.modules[current], newname, newobj)
deprecate_import(__name__, "bb.fetch", ("MalformedUrl", "encodeurl", "decodeurl"))
deprecate_import(__name__, "bb.utils", ("mkdirhier", "movefile", "copyfile", "which"))
deprecate_import(__name__, "bb.utils", ["vercmp_string"], ["vercmp"])

View File

@ -23,19 +23,16 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import sys
import logging
import shlex
import glob
import time
import stat
import bb
import bb.msg
import bb.process
import bb.progress
from contextlib import nested
from bb import data, event, utils
bblogger = logging.getLogger('BitBake')
@ -43,44 +40,26 @@ logger = logging.getLogger('BitBake.Build')
NULL = open(os.devnull, 'r+')
__mtime_cache = {}
def cached_mtime_noerror(f):
if f not in __mtime_cache:
try:
__mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
except OSError:
return 0
return __mtime_cache[f]
def reset_cache():
global __mtime_cache
__mtime_cache = {}
# When we execute a Python function, we'd like certain things
# in all namespaces, hence we add them to __builtins__.
# When we execute a python function we'd like certain things
# in all namespaces, hence we add them to __builtins__
# If we do not do this and use the exec globals, they will
# not be available to subfunctions.
if hasattr(__builtins__, '__setitem__'):
builtins = __builtins__
else:
builtins = __builtins__.__dict__
builtins['bb'] = bb
builtins['os'] = os
__builtins__['bb'] = bb
__builtins__['os'] = os
class FuncFailed(Exception):
def __init__(self, name = None, logfile = None):
self.logfile = logfile
self.name = name
if name:
self.msg = 'Function failed: %s' % name
self.msg = "Function '%s' failed" % name
else:
self.msg = "Function failed"
def __str__(self):
if self.logfile and os.path.exists(self.logfile):
msg = ("%s (log file is located at %s)" %
msg = ("%s (see %s for further information)" %
(self.msg, self.logfile))
else:
msg = self.msg
@ -89,16 +68,11 @@ class FuncFailed(Exception):
class TaskBase(event.Event):
"""Base class for task events"""
def __init__(self, t, logfile, d):
def __init__(self, t, d ):
self._task = t
self._package = d.getVar("PF")
self._mc = d.getVar("BB_CURRENT_MC")
self.taskfile = d.getVar("FILE")
self.taskname = self._task
self.logfile = logfile
self.time = time.time()
self._package = bb.data.getVar("PF", d, 1)
event.Event.__init__(self)
self._message = "recipe %s: task %s: %s" % (d.getVar("PF"), t, self.getDisplayName())
self._message = "package %s: task %s: %s" % (bb.data.getVar("PF", d, 1), t, bb.event.getName(self)[4:])
def getTask(self):
return self._task
@ -106,16 +80,10 @@ class TaskBase(event.Event):
def setTask(self, task):
self._task = task
def getDisplayName(self):
return bb.event.getName(self)[4:]
task = property(getTask, setTask, None, "task property")
class TaskStarted(TaskBase):
"""Task execution started"""
def __init__(self, t, logfile, taskflags, d):
super(TaskStarted, self).__init__(t, logfile, d)
self.taskflags = taskflags
class TaskSucceeded(TaskBase):
"""Task execution completed"""
@ -123,41 +91,16 @@ class TaskSucceeded(TaskBase):
class TaskFailed(TaskBase):
"""Task execution failed"""
def __init__(self, task, logfile, metadata, errprinted = False):
self.errprinted = errprinted
super(TaskFailed, self).__init__(task, logfile, metadata)
class TaskFailedSilent(TaskBase):
"""Task execution failed (silently)"""
def getDisplayName(self):
# Don't need to tell the user it was silent
return "Failed"
def __init__(self, task, logfile, metadata):
self.logfile = logfile
super(TaskFailed, self).__init__(task, metadata)
class TaskInvalid(TaskBase):
def __init__(self, task, metadata):
super(TaskInvalid, self).__init__(task, None, metadata)
super(TaskInvalid, self).__init__(task, metadata)
self._message = "No such task '%s'" % task
class TaskProgress(event.Event):
"""
Task made some progress that could be reported to the user, usually in
the form of a progress bar or similar.
NOTE: this class does not inherit from TaskBase since it doesn't need
to - it's fired within the task context itself, so we don't have any of
the context information that you do in the case of the other events.
The event PID can be used to determine which task it came from.
The progress value is normally 0-100, but can also be negative
indicating that progress has been made but we aren't able to determine
how much.
The rate is optional, this is simply an extra string to display to the
user if specified.
"""
def __init__(self, progress, rate=None):
self.progress = progress
self.rate = rate
event.Event.__init__(self)
class LogTee(object):
def __init__(self, logger, outfile):
@ -178,166 +121,95 @@ class LogTee(object):
def __repr__(self):
return '<LogTee {0}>'.format(self.name)
def flush(self):
self.outfile.flush()
#
# pythonexception allows the python exceptions generated to be raised
# as the real exceptions (not FuncFailed) and without a backtrace at the
# origin of the failure.
#
def exec_func(func, d, dirs = None, pythonexception=False):
"""Execute a BB 'function'"""
try:
oldcwd = os.getcwd()
except:
oldcwd = None
def exec_func(func, d, dirs = None):
"""Execute an BB 'function'"""
flags = d.getVarFlags(func)
cleandirs = flags.get('cleandirs') if flags else None
body = data.getVar(func, d)
if not body:
if body is None:
logger.warn("Function %s doesn't exist", func)
return
flags = data.getVarFlags(func, d)
cleandirs = flags.get('cleandirs')
if cleandirs:
for cdir in d.expand(cleandirs).split():
for cdir in data.expand(cleandirs, d).split():
bb.utils.remove(cdir, True)
bb.utils.mkdirhier(cdir)
if flags and dirs is None:
if dirs is None:
dirs = flags.get('dirs')
if dirs:
dirs = d.expand(dirs).split()
dirs = data.expand(dirs, d).split()
if dirs:
for adir in dirs:
bb.utils.mkdirhier(adir)
adir = dirs[-1]
else:
adir = None
body = d.getVar(func, False)
if not body:
if body is None:
logger.warning("Function %s doesn't exist", func)
return
adir = data.getVar('B', d, 1)
bb.utils.mkdirhier(adir)
ispython = flags.get('python')
if flags.get('fakeroot') and not flags.get('task'):
bb.fatal("Function %s specifies fakeroot but isn't a task?!" % func)
lockflag = flags.get('lockfiles')
if lockflag:
lockfiles = [f for f in d.expand(lockflag).split()]
lockfiles = [data.expand(f, d) for f in lockflag.split()]
else:
lockfiles = None
tempdir = d.getVar('T')
# or func allows items to be executed outside of the normal
# task set, such as buildhistory
task = d.getVar('BB_RUNTASK') or func
if task == func:
taskfunc = task
else:
taskfunc = "%s.%s" % (task, func)
runfmt = d.getVar('BB_RUNFMT') or "run.{func}.{pid}"
runfn = runfmt.format(taskfunc=taskfunc, task=task, func=func, pid=os.getpid())
runfile = os.path.join(tempdir, runfn)
bb.utils.mkdirhier(os.path.dirname(runfile))
# Setup the courtesy link to the runfn, only for tasks
# we create the link 'just' before the run script is created
# if we create it after, and if the run script fails, then the
# link won't be created as an exception would be fired.
if task == func:
runlink = os.path.join(tempdir, 'run.{0}'.format(task))
if runlink:
bb.utils.remove(runlink)
try:
os.symlink(runfn, runlink)
except OSError:
pass
tempdir = data.getVar('T', d, 1)
bb.utils.mkdirhier(tempdir)
runfile = os.path.join(tempdir, 'run.{0}.{1}'.format(func, os.getpid()))
with bb.utils.fileslocked(lockfiles):
if ispython:
exec_func_python(func, d, runfile, cwd=adir, pythonexception=pythonexception)
exec_func_python(func, d, runfile, cwd=adir)
else:
exec_func_shell(func, d, runfile, cwd=adir)
try:
curcwd = os.getcwd()
except:
curcwd = None
if oldcwd and curcwd != oldcwd:
try:
bb.warn("Task %s changed cwd to %s" % (func, curcwd))
os.chdir(oldcwd)
except:
pass
_functionfmt = """
def {function}(d):
{body}
{function}(d)
"""
logformatter = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
def exec_func_python(func, d, runfile, cwd=None, pythonexception=False):
def exec_func_python(func, d, runfile, cwd=None):
"""Execute a python BB 'function'"""
code = _functionfmt.format(function=func)
bbfile = d.getVar('FILE', True)
code = _functionfmt.format(function=func, body=d.getVar(func, True))
bb.utils.mkdirhier(os.path.dirname(runfile))
with open(runfile, 'w') as script:
bb.data.emit_func_python(func, script, d)
script.write(code)
if cwd:
try:
olddir = os.getcwd()
except OSError as e:
bb.warn("%s: Cannot get cwd: %s" % (func, e))
except OSError:
olddir = None
os.chdir(cwd)
bb.debug(2, "Executing python function %s" % func)
try:
text = "def %s(d):\n%s" % (func, d.getVar(func, False))
fn = d.getVarFlag(func, "filename", False)
lineno = int(d.getVarFlag(func, "lineno", False))
bb.methodpool.insert_method(func, text, fn, lineno - 1)
comp = utils.better_compile(code, func, "exec_python_func() autogenerated")
utils.better_exec(comp, {"d": d}, code, "exec_python_func() autogenerated", pythonexception=pythonexception)
except (bb.parse.SkipRecipe, bb.build.FuncFailed):
raise
comp = utils.better_compile(code, func, bbfile)
utils.better_exec(comp, {"d": d}, code, bbfile)
except:
if pythonexception:
if sys.exc_info()[0] in (bb.parse.SkipPackage, bb.build.FuncFailed):
raise
raise FuncFailed(func, None)
finally:
bb.debug(2, "Python function %s finished" % func)
if cwd and olddir:
try:
os.chdir(olddir)
except OSError as e:
bb.warn("%s: Cannot restore cwd %s: %s" % (func, olddir, e))
except OSError:
pass
def shell_trap_code():
return '''#!/bin/sh\n
# Emit a useful diagnostic if something fails:
bb_exit_handler() {
ret=$?
case $ret in
0) ;;
*) case $BASH_VERSION in
"") echo "WARNING: exit code $ret from a shell command.";;
*) echo "WARNING: ${BASH_SOURCE[0]}:${BASH_LINENO[0]} exit $ret from '$BASH_COMMAND'";;
esac
exit $ret
esac
}
trap 'bb_exit_handler' 0
set -e
'''
def exec_func_shell(func, d, runfile, cwd=None):
def exec_func_shell(function, d, runfile, cwd=None):
"""Execute a shell function from the metadata
Note on directory behavior. The 'dirs' varflag should contain a list
@ -349,115 +221,37 @@ def exec_func_shell(func, d, runfile, cwd=None):
d.delVarFlag('PWD', 'export')
with open(runfile, 'w') as script:
script.write(shell_trap_code())
bb.data.emit_func(func, script, d)
if bb.msg.loggerVerboseLogs:
script.write('#!/bin/sh -e\n')
if bb.msg.loggerDefaultVerbose:
script.write("set -x\n")
data.emit_func(function, script, d)
if cwd:
script.write("cd '%s'\n" % cwd)
script.write("%s\n" % func)
script.write('''
# cleanup
ret=$?
trap '' 0
exit $ret
''')
script.write("cd %s\n" % cwd)
script.write("%s\n" % function)
os.chmod(runfile, 0o775)
os.chmod(runfile, 0775)
cmd = runfile
if d.getVarFlag(func, 'fakeroot', False):
fakerootcmd = d.getVar('FAKEROOT')
if fakerootcmd:
cmd = [fakerootcmd, runfile]
if bb.msg.loggerDefaultVerbose:
logfile = LogTee(logger, sys.stdout)
else:
logfile = sys.stdout
progress = d.getVarFlag(func, 'progress')
if progress:
if progress == 'percent':
# Use default regex
logfile = bb.progress.BasicProgressHandler(d, outfile=logfile)
elif progress.startswith('percent:'):
# Use specified regex
logfile = bb.progress.BasicProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile)
elif progress.startswith('outof:'):
# Use specified regex
logfile = bb.progress.OutOfProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile)
else:
bb.warn('%s: invalid task progress varflag value "%s", ignoring' % (func, progress))
fifobuffer = bytearray()
def readfifo(data):
nonlocal fifobuffer
fifobuffer.extend(data)
while fifobuffer:
message, token, nextmsg = fifobuffer.partition(b"\00")
if token:
splitval = message.split(b' ', 1)
cmd = splitval[0].decode("utf-8")
if len(splitval) > 1:
value = splitval[1].decode("utf-8")
else:
value = ''
if cmd == 'bbplain':
bb.plain(value)
elif cmd == 'bbnote':
bb.note(value)
elif cmd == 'bbwarn':
bb.warn(value)
elif cmd == 'bberror':
bb.error(value)
elif cmd == 'bbfatal':
# The caller will call exit themselves, so bb.error() is
# what we want here rather than bb.fatal()
bb.error(value)
elif cmd == 'bbfatal_log':
bb.error(value, forcelog=True)
elif cmd == 'bbdebug':
splitval = value.split(' ', 1)
level = int(splitval[0])
value = splitval[1]
bb.debug(level, value)
else:
bb.warn("Unrecognised command '%s' on FIFO" % cmd)
fifobuffer = nextmsg
else:
break
tempdir = d.getVar('T')
fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid())
if os.path.exists(fifopath):
os.unlink(fifopath)
os.mkfifo(fifopath)
with open(fifopath, 'r+b', buffering=0) as fifo:
try:
bb.debug(2, "Executing shell function %s" % func)
try:
with open(os.devnull, 'r+') as stdin:
bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
except bb.process.CmdError:
logfn = d.getVar('BB_LOGFILE')
raise FuncFailed(func, logfn)
finally:
os.unlink(fifopath)
bb.debug(2, "Shell function %s finished" % func)
try:
bb.process.run(cmd, shell=False, stdin=NULL, log=logfile)
except bb.process.CmdError:
logfn = d.getVar('BB_LOGFILE', True)
raise FuncFailed(function, logfn)
def _task_data(fn, task, d):
localdata = bb.data.createCopy(d)
localdata = data.createCopy(d)
localdata.setVar('BB_FILENAME', fn)
localdata.setVar('BB_CURRENTTASK', task[3:])
localdata.setVar('OVERRIDES', 'task-%s:%s' %
(task[3:].replace('_', '-'), d.getVar('OVERRIDES', False)))
(task[3:], d.getVar('OVERRIDES', False)))
localdata.finalize()
bb.data.expandKeys(localdata)
data.expandKeys(localdata)
return localdata
def _exec_task(fn, task, d, quieterr):
@ -466,7 +260,7 @@ def _exec_task(fn, task, d, quieterr):
Execution of a task involves a bit more setup than executing a function,
running it with its own local metadata, and with some useful variables set.
"""
if not d.getVarFlag(task, 'task', False):
if not data.getVarFlag(task, 'task', d):
event.fire(TaskInvalid(task, d), d)
logger.error("No such task: %s" % task)
return 1
@ -474,69 +268,28 @@ def _exec_task(fn, task, d, quieterr):
logger.debug(1, "Executing task %s", task)
localdata = _task_data(fn, task, d)
tempdir = localdata.getVar('T')
tempdir = localdata.getVar('T', True)
if not tempdir:
bb.fatal("T variable not set, unable to build")
# Change nice level if we're asked to
nice = localdata.getVar("BB_TASK_NICE_LEVEL")
if nice:
curnice = os.nice(0)
nice = int(nice) - curnice
newnice = os.nice(nice)
logger.debug(1, "Renice to %s " % newnice)
ionice = localdata.getVar("BB_TASK_IONICE_LEVEL")
if ionice:
try:
cls, prio = ionice.split(".", 1)
bb.utils.ioprio_set(os.getpid(), int(cls), int(prio))
except:
bb.warn("Invalid ionice level %s" % ionice)
bb.utils.mkdirhier(tempdir)
# Determine the logfile to generate
logfmt = localdata.getVar('BB_LOGFMT') or 'log.{task}.{pid}'
logbase = logfmt.format(task=task, pid=os.getpid())
# Document the order of the tasks...
logorder = os.path.join(tempdir, 'log.task_order')
try:
with open(logorder, 'a') as logorderfile:
logorderfile.write('{0} ({1}): {2}\n'.format(task, os.getpid(), logbase))
except OSError:
logger.exception("Opening log file '%s'", logorder)
pass
# Setup the courtesy link to the logfn
loglink = os.path.join(tempdir, 'log.{0}'.format(task))
logfn = os.path.join(tempdir, logbase)
logfn = os.path.join(tempdir, 'log.{0}.{1}'.format(task, os.getpid()))
if loglink:
bb.utils.remove(loglink)
try:
os.symlink(logbase, loglink)
os.symlink(logfn, loglink)
except OSError:
pass
prefuncs = localdata.getVarFlag(task, 'prefuncs', expand=True)
postfuncs = localdata.getVarFlag(task, 'postfuncs', expand=True)
class ErrorCheckHandler(logging.Handler):
def __init__(self):
self.triggered = False
logging.Handler.__init__(self, logging.ERROR)
def emit(self, record):
if getattr(record, 'forcelog', False):
self.triggered = False
else:
self.triggered = True
# Handle logfiles
si = open('/dev/null', 'r')
si = file('/dev/null', 'r')
try:
bb.utils.mkdirhier(os.path.dirname(logfn))
logfile = open(logfn, 'w')
logfile = file(logfn, 'w')
except OSError:
logger.exception("Opening log file '%s'", logfn)
pass
@ -551,48 +304,27 @@ def _exec_task(fn, task, d, quieterr):
os.dup2(logfile.fileno(), oso[1])
os.dup2(logfile.fileno(), ose[1])
# Ensure Python logging goes to the logfile
# Ensure python logging goes to the logfile
handler = logging.StreamHandler(logfile)
handler.setFormatter(logformatter)
# Always enable full debug output into task logfiles
handler.setLevel(logging.DEBUG - 2)
bblogger.addHandler(handler)
errchk = ErrorCheckHandler()
bblogger.addHandler(errchk)
localdata.setVar('BB_LOGFILE', logfn)
localdata.setVar('BB_RUNTASK', task)
localdata.setVar('BB_TASK_LOGGER', bblogger)
flags = localdata.getVarFlags(task)
event.fire(TaskStarted(task, localdata), localdata)
try:
try:
event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
except (bb.BBHandledException, SystemExit):
return 1
except FuncFailed as exc:
for func in (prefuncs or '').split():
exec_func(func, localdata)
exec_func(task, localdata)
for func in (postfuncs or '').split():
exec_func(func, localdata)
except FuncFailed as exc:
if not quieterr:
logger.error(str(exc))
return 1
try:
for func in (prefuncs or '').split():
exec_func(func, localdata)
exec_func(task, localdata)
for func in (postfuncs or '').split():
exec_func(func, localdata)
except FuncFailed as exc:
if quieterr:
event.fire(TaskFailedSilent(task, logfn, localdata), localdata)
else:
errprinted = errchk.triggered
logger.error(str(exc))
event.fire(TaskFailed(task, logfn, localdata, errprinted), localdata)
return 1
except bb.BBHandledException:
event.fire(TaskFailed(task, logfn, localdata, True), localdata)
return 1
event.fire(TaskFailed(task, logfn, localdata), localdata)
return 1
finally:
sys.stdout.flush()
sys.stderr.flush()
@ -615,44 +347,30 @@ def _exec_task(fn, task, d, quieterr):
logger.debug(2, "Zero size logfn %s, removing", logfn)
bb.utils.remove(logfn)
bb.utils.remove(loglink)
event.fire(TaskSucceeded(task, logfn, localdata), localdata)
event.fire(TaskSucceeded(task, localdata), localdata)
if not localdata.getVarFlag(task, 'nostamp', False) and not localdata.getVarFlag(task, 'selfstamp', False):
if not localdata.getVarFlag(task, 'nostamp') and not localdata.getVarFlag(task, 'selfstamp'):
make_stamp(task, localdata)
return 0
def exec_task(fn, task, d, profile = False):
try:
def exec_task(fn, task, d):
try:
quieterr = False
if d.getVarFlag(task, "quieterrors", False) is not None:
if d.getVarFlag(task, "quieterrors") is not None:
quieterr = True
if profile:
profname = "profile-%s.log" % (d.getVar("PN") + "-" + task)
try:
import cProfile as profile
except:
import profile
prof = profile.Profile()
ret = profile.Profile.runcall(prof, _exec_task, fn, task, d, quieterr)
prof.dump_stats(profname)
bb.utils.process_profilelog(profname)
return ret
else:
return _exec_task(fn, task, d, quieterr)
return _exec_task(fn, task, d, quieterr)
except Exception:
from traceback import format_exc
if not quieterr:
logger.error("Build of %s failed" % (task))
logger.error(format_exc())
failedevent = TaskFailed(task, None, d, True)
failedevent = TaskFailed(task, None, d)
event.fire(failedevent, d)
return 1
def stamp_internal(taskname, d, file_name, baseonly=False, noextra=False):
def stamp_internal(taskname, d, file_name):
"""
Internal stamp helper function
Makes sure the stamp directory exists
@ -666,85 +384,40 @@ def stamp_internal(taskname, d, file_name, baseonly=False, noextra=False):
taskflagname = taskname.replace("_setscene", "")
if file_name:
stamp = d.stamp[file_name]
stamp = d.stamp_base[file_name].get(taskflagname) or d.stamp[file_name]
extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
else:
stamp = d.getVar('STAMP')
file_name = d.getVar('BB_FILENAME')
extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info') or ""
if baseonly:
return stamp
if noextra:
extrainfo = ""
stamp = d.getVarFlag(taskflagname, 'stamp-base', True) or d.getVar('STAMP', True)
file_name = d.getVar('BB_FILENAME', True)
extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or ""
if not stamp:
return
stamp = bb.parse.siggen.stampfile(stamp, file_name, taskname, extrainfo)
stampdir = os.path.dirname(stamp)
if cached_mtime_noerror(stampdir) == 0:
bb.utils.mkdirhier(stampdir)
bb.utils.mkdirhier(os.path.dirname(stamp))
return stamp
def stamp_cleanmask_internal(taskname, d, file_name):
"""
Internal stamp helper function to generate stamp cleaning mask
Returns the stamp path+filename
In the bitbake core, d can be a CacheData and file_name will be set.
When called in task context, d will be a data store, file_name will not be set
"""
taskflagname = taskname
if taskname.endswith("_setscene") and taskname != "do_setscene":
taskflagname = taskname.replace("_setscene", "")
if file_name:
stamp = d.stampclean[file_name]
extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
else:
stamp = d.getVar('STAMPCLEAN')
file_name = d.getVar('BB_FILENAME')
extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info') or ""
if not stamp:
return []
cleanmask = bb.parse.siggen.stampcleanmask(stamp, file_name, taskname, extrainfo)
return [cleanmask, cleanmask.replace(taskflagname, taskflagname + "_setscene")]
def make_stamp(task, d, file_name = None):
"""
Creates/updates a stamp for a given task
(d can be a data dict or dataCache)
"""
cleanmask = stamp_cleanmask_internal(task, d, file_name)
for mask in cleanmask:
for name in glob.glob(mask):
# Preserve sigdata files in the stamps directory
if "sigdata" in name or "sigbasedata" in name:
continue
# Preserve taint files in the stamps directory
if name.endswith('.taint'):
continue
os.unlink(name)
stamp = stamp_internal(task, d, file_name)
# Remove the file and recreate to force timestamp
# change on broken NFS filesystems
if stamp:
bb.utils.remove(stamp)
open(stamp, "w").close()
f = open(stamp, "w")
f.close()
# If we're in task context, write out a signature file for each task
# as it completes
if not task.endswith("_setscene") and task != "do_setscene" and not file_name:
stampbase = stamp_internal(task, d, None, True)
file_name = d.getVar('BB_FILENAME')
bb.parse.siggen.dump_sigtask(file_name, task, stampbase, True)
file_name = d.getVar('BB_FILENAME', True)
bb.parse.siggen.dump_sigtask(file_name, task, d.getVar('STAMP', True), True)
def del_stamp(task, d, file_name = None):
"""
@ -754,33 +427,15 @@ def del_stamp(task, d, file_name = None):
stamp = stamp_internal(task, d, file_name)
bb.utils.remove(stamp)
def write_taint(task, d, file_name = None):
"""
Creates a "taint" file which will force the specified task and its
dependents to be re-run the next time by influencing the value of its
taskhash.
(d can be a data dict or dataCache)
"""
import uuid
if file_name:
taintfn = d.stamp[file_name] + '.' + task + '.taint'
else:
taintfn = d.getVar('STAMP') + '.' + task + '.taint'
bb.utils.mkdirhier(os.path.dirname(taintfn))
# The specific content of the taint file is not really important,
# we just need it to be random, so a random UUID is used
with open(taintfn, 'w') as taintf:
taintf.write(str(uuid.uuid4()))
def stampfile(taskname, d, file_name = None, noextra=False):
def stampfile(taskname, d, file_name = None):
"""
Return the stamp for a given task
(d can be a data dict or dataCache)
"""
return stamp_internal(taskname, d, file_name, noextra=noextra)
return stamp_internal(taskname, d, file_name)
def add_tasks(tasklist, d):
task_deps = d.getVar('_task_deps', False)
task_deps = data.getVar('_task_deps', d)
if not task_deps:
task_deps = {}
if not 'tasks' in task_deps:
@ -789,119 +444,38 @@ def add_tasks(tasklist, d):
task_deps['parents'] = {}
for task in tasklist:
task = d.expand(task)
d.setVarFlag(task, 'task', 1)
task = data.expand(task, d)
data.setVarFlag(task, 'task', 1, d)
if not task in task_deps['tasks']:
task_deps['tasks'].append(task)
flags = d.getVarFlags(task)
flags = data.getVarFlags(task, d)
def getTask(name):
if not name in task_deps:
task_deps[name] = {}
if name in flags:
deptask = d.expand(flags[name])
deptask = data.expand(flags[name], d)
task_deps[name][task] = deptask
getTask('depends')
getTask('rdepends')
getTask('deptask')
getTask('rdeptask')
getTask('recrdeptask')
getTask('recideptask')
getTask('nostamp')
getTask('fakeroot')
getTask('noexec')
getTask('umask')
task_deps['parents'][task] = []
if 'deps' in flags:
for dep in flags['deps']:
dep = d.expand(dep)
task_deps['parents'][task].append(dep)
for dep in flags['deps']:
dep = data.expand(dep, d)
task_deps['parents'][task].append(dep)
# don't assume holding a reference
d.setVar('_task_deps', task_deps)
data.setVar('_task_deps', task_deps, d)
def addtask(task, before, after, d):
if task[:3] != "do_":
task = "do_" + task
def remove_task(task, kill, d):
"""Remove an BB 'task'.
d.setVarFlag(task, "task", 1)
bbtasks = d.getVar('__BBTASKS', False) or []
if task not in bbtasks:
bbtasks.append(task)
d.setVar('__BBTASKS', bbtasks)
If kill is 1, also remove tasks that depend on this task."""
existing = d.getVarFlag(task, "deps", False) or []
if after is not None:
# set up deps for function
for entry in after.split():
if entry not in existing:
existing.append(entry)
d.setVarFlag(task, "deps", existing)
if before is not None:
# set up things that depend on this func
for entry in before.split():
existing = d.getVarFlag(entry, "deps", False) or []
if task not in existing:
d.setVarFlag(entry, "deps", [task] + existing)
def deltask(task, d):
if task[:3] != "do_":
task = "do_" + task
bbtasks = d.getVar('__BBTASKS', False) or []
if task in bbtasks:
bbtasks.remove(task)
d.delVarFlag(task, 'task')
d.setVar('__BBTASKS', bbtasks)
d.delVarFlag(task, 'deps')
for bbtask in d.getVar('__BBTASKS', False) or []:
deps = d.getVarFlag(bbtask, 'deps', False) or []
if task in deps:
deps.remove(task)
d.setVarFlag(bbtask, 'deps', deps)
def preceedtask(task, with_recrdeptasks, d):
"""
Returns a set of tasks in the current recipe which were specified as
precondition by the task itself ("after") or which listed themselves
as precondition ("before"). Preceeding tasks specified via the
"recrdeptask" are included in the result only if requested. Beware
that this may lead to the task itself being listed.
"""
preceed = set()
preceed.update(d.getVarFlag(task, 'deps') or [])
if with_recrdeptasks:
recrdeptask = d.getVarFlag(task, 'recrdeptask')
if recrdeptask:
preceed.update(recrdeptask.split())
return preceed
def tasksbetween(task_start, task_end, d):
"""
Return the list of tasks between two tasks in the current recipe,
where task_start is to start at and task_end is the task to end at
(and task_end has a dependency chain back to task_start).
"""
outtasks = []
tasks = list(filter(lambda k: d.getVarFlag(k, "task"), d.keys()))
def follow_chain(task, endtask, chain=None):
if not chain:
chain = []
chain.append(task)
for othertask in tasks:
if othertask == task:
continue
if task == endtask:
for ctask in chain:
if ctask not in outtasks:
outtasks.append(ctask)
else:
deps = d.getVarFlag(othertask, 'deps', False)
if task in deps:
follow_chain(othertask, endtask, chain)
chain.pop()
follow_chain(task_start, task_end)
return outtasks
data.delVarFlag(task, 'task', d)

View File

@ -1,12 +1,11 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Cache implementation
# BitBake 'Event' implementation
#
# Caching of bitbake variables before task execution
# Copyright (C) 2006 Richard Purdie
# Copyright (C) 2012 Intel Corporation
# but small sections based on code from bin/bitbake:
# Copyright (C) 2003, 2004 Chris Larson
@ -28,19 +27,26 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import sys
import logging
import pickle
from collections import defaultdict
import bb.data
import bb.utils
logger = logging.getLogger("BitBake.Cache")
__cache_version__ = "151"
try:
import cPickle as pickle
except ImportError:
import pickle
logger.info("Importing cPickle failed. "
"Falling back to a very slow implementation.")
def getCacheFile(path, filename, data_hash):
return os.path.join(path, filename + "." + data_hash)
__cache_version__ = "142"
def getCacheFile(path, filename):
return os.path.join(path, filename)
# RecipeInfoCommon defines common data retrieving methods
# from meta data for caches. CoreRecipeInfo as well as other
@ -70,17 +76,13 @@ class RecipeInfoCommon(object):
for task in tasks)
@classmethod
def flaglist(cls, flag, varlist, metadata, squash=False):
out_dict = dict((var, metadata.getVarFlag(var, flag))
def flaglist(cls, flag, varlist, metadata):
return dict((var, metadata.getVarFlag(var, flag, True))
for var in varlist)
if squash:
return dict((k,v) for (k,v) in out_dict.items() if v)
else:
return out_dict
@classmethod
def getvar(cls, var, metadata, expand = True):
return metadata.getVar(var, expand) or ''
def getvar(cls, var, metadata):
return metadata.getVar(var, True) or ''
class CoreRecipeInfo(RecipeInfoCommon):
@ -93,7 +95,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
self.timestamp = bb.parse.cached_mtime(filename)
self.variants = self.listvar('__VARIANTS', metadata) + ['']
self.appends = self.listvar('__BBAPPEND', metadata)
self.nocache = self.getvar('BB_DONT_CACHE', metadata)
self.nocache = self.getvar('__BB_DONT_CACHE', metadata)
self.skipreason = self.getvar('__SKIPPED', metadata)
if self.skipreason:
@ -113,6 +115,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
self.basetaskhashes = self.taskvar('BB_BASEHASH', self.tasks, metadata)
self.hashfilename = self.getvar('BB_HASHFILENAME', metadata)
self.file_depends = metadata.getVar('__depends', False)
self.task_deps = metadata.getVar('_task_deps', False) or {'tasks': [], 'parents': {}}
self.skipped = False
@ -120,11 +123,11 @@ class CoreRecipeInfo(RecipeInfoCommon):
self.pv = self.getvar('PV', metadata)
self.pr = self.getvar('PR', metadata)
self.defaultpref = self.intvar('DEFAULT_PREFERENCE', metadata)
self.broken = self.getvar('BROKEN', metadata)
self.not_world = self.getvar('EXCLUDE_FROM_WORLD', metadata)
self.stamp = self.getvar('STAMP', metadata)
self.stampclean = self.getvar('STAMPCLEAN', metadata)
self.stamp_base = self.flaglist('stamp-base', self.tasks, metadata)
self.stamp_extrainfo = self.flaglist('stamp-extra-info', self.tasks, metadata)
self.file_checksums = self.flaglist('file-checksums', self.tasks, metadata, True)
self.packages_dynamic = self.listvar('PACKAGES_DYNAMIC', metadata)
self.depends = self.depvar('DEPENDS', metadata)
self.provides = self.depvar('PROVIDES', metadata)
@ -134,11 +137,12 @@ class CoreRecipeInfo(RecipeInfoCommon):
self.rprovides_pkg = self.pkgvar('RPROVIDES', self.packages, metadata)
self.rdepends_pkg = self.pkgvar('RDEPENDS', self.packages, metadata)
self.rrecommends_pkg = self.pkgvar('RRECOMMENDS', self.packages, metadata)
self.inherits = self.getvar('__inherit_cache', metadata, expand=False)
self.inherits = self.getvar('__inherit_cache', metadata)
self.summary = self.getvar('SUMMARY', metadata)
self.license = self.getvar('LICENSE', metadata)
self.section = self.getvar('SECTION', metadata)
self.fakerootenv = self.getvar('FAKEROOTENV', metadata)
self.fakerootdirs = self.getvar('FAKEROOTDIRS', metadata)
self.fakerootnoenv = self.getvar('FAKEROOTNOENV', metadata)
self.extradepsfunc = self.getvar('calculate_extra_depends', metadata)
@classmethod
def init_cacheData(cls, cachedata):
@ -150,9 +154,8 @@ class CoreRecipeInfo(RecipeInfoCommon):
cachedata.pkg_dp = {}
cachedata.stamp = {}
cachedata.stampclean = {}
cachedata.stamp_base = {}
cachedata.stamp_extrainfo = {}
cachedata.file_checksums = {}
cachedata.fn_provides = {}
cachedata.pn_provides = defaultdict(list)
cachedata.all_depends = []
@ -171,10 +174,11 @@ class CoreRecipeInfo(RecipeInfoCommon):
cachedata.basetaskhash = {}
cachedata.inherits = {}
cachedata.summary = {}
cachedata.license = {}
cachedata.section = {}
cachedata.fakerootenv = {}
cachedata.fakerootnoenv = {}
cachedata.fakerootdirs = {}
cachedata.extradepsfunc = {}
def add_cacheData(self, cachedata, fn):
cachedata.task_deps[fn] = self.task_deps
@ -183,9 +187,8 @@ class CoreRecipeInfo(RecipeInfoCommon):
cachedata.pkg_pepvpr[fn] = (self.pe, self.pv, self.pr)
cachedata.pkg_dp[fn] = self.defaultpref
cachedata.stamp[fn] = self.stamp
cachedata.stampclean[fn] = self.stampclean
cachedata.stamp_base[fn] = self.stamp_base
cachedata.stamp_extrainfo[fn] = self.stamp_extrainfo
cachedata.file_checksums[fn] = self.file_checksums
provides = [self.pn]
for provide in self.provides:
@ -210,22 +213,19 @@ class CoreRecipeInfo(RecipeInfoCommon):
rprovides += self.rprovides_pkg[package]
for rprovide in rprovides:
if fn not in cachedata.rproviders[rprovide]:
cachedata.rproviders[rprovide].append(fn)
cachedata.rproviders[rprovide].append(fn)
for package in self.packages_dynamic:
cachedata.packages_dynamic[package].append(fn)
# Build hash of runtime depends and recommends
# Build hash of runtime depends and rececommends
for package in self.packages + [self.pn]:
cachedata.rundeps[fn][package] = list(self.rdepends) + self.rdepends_pkg[package]
cachedata.runrecs[fn][package] = list(self.rrecommends) + self.rrecommends_pkg[package]
# Collect files we may need for possible world-dep
# calculations
if self.not_world:
logger.debug(1, "EXCLUDE FROM WORLD: %s", fn)
else:
if not self.broken and not self.not_world:
cachedata.possible_world.append(fn)
# create a collection of all targets for sanity checking
@ -234,157 +234,36 @@ class CoreRecipeInfo(RecipeInfoCommon):
cachedata.universe_target.append(self.pn)
cachedata.hashfn[fn] = self.hashfilename
for task, taskhash in self.basetaskhashes.items():
for task, taskhash in self.basetaskhashes.iteritems():
identifier = '%s.%s' % (fn, task)
cachedata.basetaskhash[identifier] = taskhash
cachedata.inherits[fn] = self.inherits
cachedata.summary[fn] = self.summary
cachedata.license[fn] = self.license
cachedata.section[fn] = self.section
cachedata.fakerootenv[fn] = self.fakerootenv
cachedata.fakerootnoenv[fn] = self.fakerootnoenv
cachedata.fakerootdirs[fn] = self.fakerootdirs
cachedata.extradepsfunc[fn] = self.extradepsfunc
def virtualfn2realfn(virtualfn):
"""
Convert a virtual file name to a real one + the associated subclass keyword
"""
mc = ""
if virtualfn.startswith('multiconfig:'):
elems = virtualfn.split(':')
mc = elems[1]
virtualfn = ":".join(elems[2:])
fn = virtualfn
cls = ""
if virtualfn.startswith('virtual:'):
elems = virtualfn.split(':')
cls = ":".join(elems[1:-1])
fn = elems[-1]
return (fn, cls, mc)
def realfn2virtual(realfn, cls, mc):
"""
Convert a real filename + the associated subclass keyword to a virtual filename
"""
if cls:
realfn = "virtual:" + cls + ":" + realfn
if mc:
realfn = "multiconfig:" + mc + ":" + realfn
return realfn
def variant2virtual(realfn, variant):
"""
Convert a real filename + the associated subclass keyword to a virtual filename
"""
if variant == "":
return realfn
if variant.startswith("multiconfig:"):
elems = variant.split(":")
if elems[2]:
return "multiconfig:" + elems[1] + ":virtual:" + ":".join(elems[2:]) + ":" + realfn
return "multiconfig:" + elems[1] + ":" + realfn
return "virtual:" + variant + ":" + realfn
def parse_recipe(bb_data, bbfile, appends, mc=''):
"""
Parse a recipe
"""
chdir_back = False
bb_data.setVar("__BBMULTICONFIG", mc)
# expand tmpdir to include this topdir
bb_data.setVar('TMPDIR', bb_data.getVar('TMPDIR') or "")
bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
oldpath = os.path.abspath(os.getcwd())
bb.parse.cached_mtime_noerror(bbfile_loc)
# The ConfHandler first looks if there is a TOPDIR and if not
# then it would call getcwd().
# Previously, we chdir()ed to bbfile_loc, called the handler
# and finally chdir()ed back, a couple of thousand times. We now
# just fill in TOPDIR to point to bbfile_loc if there is no TOPDIR yet.
if not bb_data.getVar('TOPDIR', False):
chdir_back = True
bb_data.setVar('TOPDIR', bbfile_loc)
try:
if appends:
bb_data.setVar('__BBAPPEND', " ".join(appends))
bb_data = bb.parse.handle(bbfile, bb_data)
if chdir_back:
os.chdir(oldpath)
return bb_data
except:
if chdir_back:
os.chdir(oldpath)
raise
class NoCache(object):
def __init__(self, databuilder):
self.databuilder = databuilder
self.data = databuilder.data
def loadDataFull(self, virtualfn, appends):
"""
Return a complete set of data for fn.
To do this, we need to parse the file.
"""
logger.debug(1, "Parsing %s (full)" % virtualfn)
(fn, virtual, mc) = virtualfn2realfn(virtualfn)
bb_data = self.load_bbfile(virtualfn, appends, virtonly=True)
return bb_data[virtual]
def load_bbfile(self, bbfile, appends, virtonly = False):
"""
Load and parse one .bb build file
Return the data and whether parsing resulted in the file being skipped
"""
if virtonly:
(bbfile, virtual, mc) = virtualfn2realfn(bbfile)
bb_data = self.databuilder.mcdata[mc].createCopy()
bb_data.setVar("__ONLYFINALISE", virtual or "default")
datastores = parse_recipe(bb_data, bbfile, appends, mc)
return datastores
bb_data = self.data.createCopy()
datastores = parse_recipe(bb_data, bbfile, appends)
for mc in self.databuilder.mcdata:
if not mc:
continue
bb_data = self.databuilder.mcdata[mc].createCopy()
newstores = parse_recipe(bb_data, bbfile, appends, mc)
for ns in newstores:
datastores["multiconfig:%s:%s" % (mc, ns)] = newstores[ns]
return datastores
class Cache(NoCache):
class Cache(object):
"""
BitBake Cache implementation
"""
def __init__(self, databuilder, data_hash, caches_array):
super().__init__(databuilder)
data = databuilder.data
def __init__(self, data, caches_array):
# Pass caches_array information into Cache Constructor
# It will be used later for deciding whether we
# It will be used in later for deciding whether we
# need extra cache file dump/load support
self.caches_array = caches_array
self.cachedir = data.getVar("CACHE")
self.cachedir = bb.data.getVar("CACHE", data, True)
self.clean = set()
self.checked = set()
self.depends_cache = {}
self.data = None
self.data_fn = None
self.cacheclean = True
self.data_hash = data_hash
if self.cachedir in [None, '']:
self.has_cache = False
@ -393,86 +272,89 @@ class Cache(NoCache):
return
self.has_cache = True
self.cachefile = getCacheFile(self.cachedir, "bb_cache.dat", self.data_hash)
self.cachefile = getCacheFile(self.cachedir, "bb_cache.dat")
logger.debug(1, "Using cache in '%s'", self.cachedir)
bb.utils.mkdirhier(self.cachedir)
# If any of configuration.data's dependencies are newer than the
# cache there isn't even any point in loading it...
newest_mtime = 0
deps = bb.data.getVar("__base_depends", data)
old_mtimes = [old_mtime for _, old_mtime in deps]
old_mtimes.append(newest_mtime)
newest_mtime = max(old_mtimes)
cache_ok = True
if self.caches_array:
for cache_class in self.caches_array:
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
cache_ok = cache_ok and os.path.exists(cachefile)
cache_class.init_cacheData(self)
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cachefile = getCacheFile(self.cachedir, cache_class.cachefile)
cache_ok = cache_ok and (bb.parse.cached_mtime_noerror(cachefile) >= newest_mtime)
cache_class.init_cacheData(self)
if cache_ok:
self.load_cachefile()
elif os.path.isfile(self.cachefile):
logger.info("Out of date cache found, rebuilding...")
def load_cachefile(self):
# Firstly, using core cache file information for
# valid checking
with open(self.cachefile, "rb") as cachefile:
pickled = pickle.Unpickler(cachefile)
try:
cache_ver = pickled.load()
bitbake_ver = pickled.load()
except Exception:
logger.info('Invalid cache, rebuilding...')
return
if cache_ver != __cache_version__:
logger.info('Cache version mismatch, rebuilding...')
return
elif bitbake_ver != bb.__version__:
logger.info('Bitbake version mismatch, rebuilding...')
return
cachesize = 0
previous_progress = 0
previous_percent = 0
# Calculate the correct cachesize of all those cache files
for cache_class in self.caches_array:
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
with open(cachefile, "rb") as cachefile:
cachesize += os.fstat(cachefile.fileno()).st_size
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cachefile = getCacheFile(self.cachedir, cache_class.cachefile)
with open(cachefile, "rb") as cachefile:
cachesize += os.fstat(cachefile.fileno()).st_size
bb.event.fire(bb.event.CacheLoadStarted(cachesize), self.data)
for cache_class in self.caches_array:
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
with open(cachefile, "rb") as cachefile:
pickled = pickle.Unpickler(cachefile)
# Check cache version information
try:
cache_ver = pickled.load()
bitbake_ver = pickled.load()
except Exception:
logger.info('Invalid cache, rebuilding...')
return
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cachefile = getCacheFile(self.cachedir, cache_class.cachefile)
with open(cachefile, "rb") as cachefile:
pickled = pickle.Unpickler(cachefile)
while cachefile:
try:
key = pickled.load()
value = pickled.load()
except Exception:
break
if self.depends_cache.has_key(key):
self.depends_cache[key].append(value)
else:
self.depends_cache[key] = [value]
# only fire events on even percentage boundaries
current_progress = cachefile.tell() + previous_progress
current_percent = 100 * current_progress / cachesize
if current_percent > previous_percent:
previous_percent = current_percent
bb.event.fire(bb.event.CacheLoadProgress(current_progress),
self.data)
if cache_ver != __cache_version__:
logger.info('Cache version mismatch, rebuilding...')
return
elif bitbake_ver != bb.__version__:
logger.info('Bitbake version mismatch, rebuilding...')
return
# Load the rest of the cache file
current_progress = 0
while cachefile:
try:
key = pickled.load()
value = pickled.load()
except Exception:
break
if not isinstance(key, str):
bb.warn("%s from extras cache is not a string?" % key)
break
if not isinstance(value, RecipeInfoCommon):
bb.warn("%s from extras cache is not a RecipeInfoCommon class?" % value)
break
if key in self.depends_cache:
self.depends_cache[key].append(value)
else:
self.depends_cache[key] = [value]
# only fire events on even percentage boundaries
current_progress = cachefile.tell() + previous_progress
if current_progress > cachesize:
# we might have calculated incorrect total size because a file
# might've been written out just after we checked its size
cachesize = current_progress
current_percent = 100 * current_progress / cachesize
if current_percent > previous_percent:
previous_percent = current_percent
bb.event.fire(bb.event.CacheLoadProgress(current_progress, cachesize),
self.data)
previous_progress += current_progress
previous_progress += current_progress
# Note: depends cache number is corresponding to the parsing file numbers.
# The same file has several caches, still regarded as one item in the cache
@ -480,33 +362,69 @@ class Cache(NoCache):
len(self.depends_cache)),
self.data)
def parse(self, filename, appends):
@staticmethod
def virtualfn2realfn(virtualfn):
"""
Convert a virtual file name to a real one + the associated subclass keyword
"""
fn = virtualfn
cls = ""
if virtualfn.startswith('virtual:'):
elems = virtualfn.split(':')
cls = ":".join(elems[1:-1])
fn = elems[-1]
return (fn, cls)
@staticmethod
def realfn2virtual(realfn, cls):
"""
Convert a real filename + the associated subclass keyword to a virtual filename
"""
if cls == "":
return realfn
return "virtual:" + cls + ":" + realfn
@classmethod
def loadDataFull(cls, virtualfn, appends, cfgData):
"""
Return a complete set of data for fn.
To do this, we need to parse the file.
"""
(fn, virtual) = cls.virtualfn2realfn(virtualfn)
logger.debug(1, "Parsing %s (full)", fn)
cfgData.setVar("__ONLYFINALISE", virtual or "default")
bb_data = cls.load_bbfile(fn, appends, cfgData)
return bb_data[virtual]
@classmethod
def parse(cls, filename, appends, configdata, caches_array):
"""Parse the specified filename, returning the recipe information"""
logger.debug(1, "Parsing %s", filename)
infos = []
datastores = self.load_bbfile(filename, appends)
depends = []
variants = []
# Process the "real" fn last so we can store variants list
for variant, data in sorted(datastores.items(),
datastores = cls.load_bbfile(filename, appends, configdata)
depends = set()
for variant, data in sorted(datastores.iteritems(),
key=lambda i: i[0],
reverse=True):
virtualfn = variant2virtual(filename, variant)
variants.append(variant)
depends = depends + (data.getVar("__depends", False) or [])
virtualfn = cls.realfn2virtual(filename, variant)
depends |= (data.getVar("__depends", False) or set())
if depends and not variant:
data.setVar("__depends", depends)
if virtualfn == filename:
data.setVar("__VARIANTS", " ".join(variants))
info_array = []
for cache_class in self.caches_array:
info = cache_class(filename, data)
info_array.append(info)
for cache_class in caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
info = cache_class(filename, data)
info_array.append(info)
infos.append((virtualfn, info_array))
return infos
def load(self, filename, appends):
def load(self, filename, appends, configdata):
"""Obtain the recipe information for the specified filename,
using cached values if available, otherwise parsing.
@ -520,20 +438,21 @@ class Cache(NoCache):
# info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo]
info_array = self.depends_cache[filename]
for variant in info_array[0].variants:
virtualfn = variant2virtual(filename, variant)
virtualfn = self.realfn2virtual(filename, variant)
infos.append((virtualfn, self.depends_cache[virtualfn]))
else:
logger.debug(1, "Parsing %s", filename)
return self.parse(filename, appends, configdata, self.caches_array)
return cached, infos
def loadData(self, fn, appends, cacheData):
def loadData(self, fn, appends, cfgData, cacheData):
"""Load the recipe info for the specified filename,
parsing and adding to the cache if necessary, and adding
the recipe information to the supplied CacheData instance."""
skipped, virtuals = 0, 0
cached, infos = self.load(fn, appends)
cached, infos = self.load(fn, appends, cfgData)
for virtualfn, info_array in infos:
if info_array[0].skipped:
logger.debug(1, "Skipping %s: %s", virtualfn, info_array[0].skipreason)
@ -608,52 +527,24 @@ class Cache(NoCache):
self.remove(fn)
return False
if hasattr(info_array[0], 'file_checksums'):
for _, fl in info_array[0].file_checksums.items():
fl = fl.strip()
while fl:
# A .split() would be simpler but means spaces or colons in filenames would break
a = fl.find(":True")
b = fl.find(":False")
if ((a < 0) and b) or ((b > 0) and (b < a)):
f = fl[:b+6]
fl = fl[b+7:]
elif ((b < 0) and a) or ((a > 0) and (a < b)):
f = fl[:a+5]
fl = fl[a+6:]
else:
break
fl = fl.strip()
if "*" in f:
continue
f, exist = f.split(":")
if (exist == "True" and not os.path.exists(f)) or (exist == "False" and os.path.exists(f)):
logger.debug(2, "Cache: %s's file checksum list file %s changed",
fn, f)
self.remove(fn)
return False
if appends != info_array[0].appends:
logger.debug(2, "Cache: appends for %s changed", fn)
logger.debug(2, "%s to %s" % (str(appends), str(info_array[0].appends)))
bb.note("%s to %s" % (str(appends), str(info_array[0].appends)))
self.remove(fn)
return False
invalid = False
for cls in info_array[0].variants:
virtualfn = variant2virtual(fn, cls)
virtualfn = self.realfn2virtual(fn, cls)
self.clean.add(virtualfn)
if virtualfn not in self.depends_cache:
logger.debug(2, "Cache: %s is not cached", virtualfn)
invalid = True
elif len(self.depends_cache[virtualfn]) != len(self.caches_array):
logger.debug(2, "Cache: Extra caches missing for %s?" % virtualfn)
invalid = True
# If any one of the variants is not present, mark as invalid for all
if invalid:
for cls in info_array[0].variants:
virtualfn = variant2virtual(fn, cls)
virtualfn = self.realfn2virtual(fn, cls)
if virtualfn in self.clean:
logger.debug(2, "Cache: Removing %s from cache", virtualfn)
self.clean.remove(virtualfn)
@ -690,19 +581,30 @@ class Cache(NoCache):
logger.debug(2, "Cache is clean, not saving.")
return
file_dict = {}
pickler_dict = {}
for cache_class in self.caches_array:
cache_class_name = cache_class.__name__
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
with open(cachefile, "wb") as f:
p = pickle.Pickler(f, pickle.HIGHEST_PROTOCOL)
p.dump(__cache_version__)
p.dump(bb.__version__)
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cache_class_name = cache_class.__name__
cachefile = getCacheFile(self.cachedir, cache_class.cachefile)
file_dict[cache_class_name] = open(cachefile, "wb")
pickler_dict[cache_class_name] = pickle.Pickler(file_dict[cache_class_name], pickle.HIGHEST_PROTOCOL)
pickler_dict['CoreRecipeInfo'].dump(__cache_version__)
pickler_dict['CoreRecipeInfo'].dump(bb.__version__)
for key, info_array in self.depends_cache.items():
for info in info_array:
if isinstance(info, RecipeInfoCommon) and info.__class__.__name__ == cache_class_name:
p.dump(key)
p.dump(info)
try:
for key, info_array in self.depends_cache.iteritems():
for info in info_array:
if isinstance(info, RecipeInfoCommon):
cache_class_name = info.__class__.__name__
pickler_dict[cache_class_name].dump(key)
pickler_dict[cache_class_name].dump(info)
finally:
for cache_class in self.caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cache_class_name = cache_class.__name__
file_dict[cache_class_name].close()
del self.depends_cache
@ -710,13 +612,10 @@ class Cache(NoCache):
def mtime(cachefile):
return bb.parse.cached_mtime_noerror(cachefile)
def add_info(self, filename, info_array, cacheData, parsed=None, watcher=None):
def add_info(self, filename, info_array, cacheData, parsed=None):
if isinstance(info_array[0], CoreRecipeInfo) and (not info_array[0].skipped):
cacheData.add_from_recipeinfo(filename, info_array)
if watcher:
watcher(info_array[0].file_depends)
if not self.has_cache:
return
@ -730,13 +629,50 @@ class Cache(NoCache):
Save data we need into the cache
"""
realfn = virtualfn2realfn(file_name)[0]
realfn = self.virtualfn2realfn(file_name)[0]
info_array = []
for cache_class in self.caches_array:
info_array.append(cache_class(realfn, data))
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
info_array.append(cache_class(realfn, data))
self.add_info(file_name, info_array, cacheData, parsed)
@staticmethod
def load_bbfile(bbfile, appends, config):
"""
Load and parse one .bb build file
Return the data and whether parsing resulted in the file being skipped
"""
chdir_back = False
from bb import data, parse
# expand tmpdir to include this topdir
data.setVar('TMPDIR', data.getVar('TMPDIR', config, 1) or "", config)
bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
oldpath = os.path.abspath(os.getcwd())
parse.cached_mtime_noerror(bbfile_loc)
bb_data = data.init_db(config)
# The ConfHandler first looks if there is a TOPDIR and if not
# then it would call getcwd().
# Previously, we chdir()ed to bbfile_loc, called the handler
# and finally chdir()ed back, a couple of thousand times. We now
# just fill in TOPDIR to point to bbfile_loc if there is no TOPDIR yet.
if not data.getVar('TOPDIR', bb_data):
chdir_back = True
data.setVar('TOPDIR', bbfile_loc, bb_data)
try:
if appends:
data.setVar('__BBAPPEND', " ".join(appends), bb_data)
bb_data = parse.handle(bbfile, bb_data)
if chdir_back:
os.chdir(oldpath)
return bb_data
except:
if chdir_back:
os.chdir(oldpath)
raise
def init(cooker):
"""
@ -750,12 +686,12 @@ def init(cooker):
* Its mtime
* The mtimes of all its dependencies
* Whether it caused a parse.SkipRecipe exception
* Whether it caused a parse.SkipPackage exception
Files causing parsing errors are evicted from the cache.
"""
return Cache(cooker.configuration.data, cooker.configuration.data_hash)
return Cache(cooker.configuration.data)
class CacheData(object):
@ -766,9 +702,8 @@ class CacheData(object):
def __init__(self, caches_array):
self.caches_array = caches_array
for cache_class in self.caches_array:
if not issubclass(cache_class, RecipeInfoCommon):
bb.error("Extra cache data class %s should subclass RecipeInfoCommon class" % cache_class)
cache_class.init_cacheData(self)
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cache_class.init_cacheData(self)
# Direct cache variables
self.task_queues = {}
@ -783,107 +718,4 @@ class CacheData(object):
for info in info_array:
info.add_cacheData(self, fn)
class MultiProcessCache(object):
"""
BitBake multi-process cache implementation
Used by the codeparser & file checksum caches
"""
def __init__(self):
self.cachefile = None
self.cachedata = self.create_cachedata()
self.cachedata_extras = self.create_cachedata()
def init_cache(self, d, cache_file_name=None):
cachedir = (d.getVar("PERSISTENT_DIR") or
d.getVar("CACHE"))
if cachedir in [None, '']:
return
bb.utils.mkdirhier(cachedir)
self.cachefile = os.path.join(cachedir,
cache_file_name or self.__class__.cache_file_name)
logger.debug(1, "Using cache in '%s'", self.cachefile)
glf = bb.utils.lockfile(self.cachefile + ".lock")
try:
with open(self.cachefile, "rb") as f:
p = pickle.Unpickler(f)
data, version = p.load()
except:
bb.utils.unlockfile(glf)
return
bb.utils.unlockfile(glf)
if version != self.__class__.CACHE_VERSION:
return
self.cachedata = data
def create_cachedata(self):
data = [{}]
return data
def save_extras(self):
if not self.cachefile:
return
glf = bb.utils.lockfile(self.cachefile + ".lock", shared=True)
i = os.getpid()
lf = None
while not lf:
lf = bb.utils.lockfile(self.cachefile + ".lock." + str(i), retry=False)
if not lf or os.path.exists(self.cachefile + "-" + str(i)):
if lf:
bb.utils.unlockfile(lf)
lf = None
i = i + 1
continue
with open(self.cachefile + "-" + str(i), "wb") as f:
p = pickle.Pickler(f, -1)
p.dump([self.cachedata_extras, self.__class__.CACHE_VERSION])
bb.utils.unlockfile(lf)
bb.utils.unlockfile(glf)
def merge_data(self, source, dest):
for j in range(0,len(dest)):
for h in source[j]:
if h not in dest[j]:
dest[j][h] = source[j][h]
def save_merge(self):
if not self.cachefile:
return
glf = bb.utils.lockfile(self.cachefile + ".lock")
data = self.cachedata
for f in [y for y in os.listdir(os.path.dirname(self.cachefile)) if y.startswith(os.path.basename(self.cachefile) + '-')]:
f = os.path.join(os.path.dirname(self.cachefile), f)
try:
with open(f, "rb") as fd:
p = pickle.Unpickler(fd)
extradata, version = p.load()
except (IOError, EOFError):
os.unlink(f)
continue
if version != self.__class__.CACHE_VERSION:
os.unlink(f)
continue
self.merge_data(extradata, data)
os.unlink(f)
with open(self.cachefile, "wb") as f:
p = pickle.Pickler(f, -1)
p.dump([data, self.__class__.CACHE_VERSION])
bb.utils.unlockfile(glf)

View File

@ -35,22 +35,11 @@ class HobRecipeInfo(RecipeInfoCommon):
# such as (bb_cache.dat, bb_extracache_hob.dat)
cachefile = "bb_extracache_" + classname +".dat"
# override this member with the list of extra cache fields
# that this class will provide
cachefields = ['summary', 'license', 'section',
'description', 'homepage', 'bugtracker',
'prevision', 'files_info']
def __init__(self, filename, metadata):
self.summary = self.getvar('SUMMARY', metadata)
self.license = self.getvar('LICENSE', metadata)
self.section = self.getvar('SECTION', metadata)
self.description = self.getvar('DESCRIPTION', metadata)
self.homepage = self.getvar('HOMEPAGE', metadata)
self.bugtracker = self.getvar('BUGTRACKER', metadata)
self.prevision = self.getvar('PR', metadata)
self.files_info = self.getvar('FILES_INFO', metadata)
@classmethod
def init_cacheData(cls, cachedata):
@ -58,18 +47,8 @@ class HobRecipeInfo(RecipeInfoCommon):
cachedata.summary = {}
cachedata.license = {}
cachedata.section = {}
cachedata.description = {}
cachedata.homepage = {}
cachedata.bugtracker = {}
cachedata.prevision = {}
cachedata.files_info = {}
def add_cacheData(self, cachedata, fn):
cachedata.summary[fn] = self.summary
cachedata.license[fn] = self.license
cachedata.section[fn] = self.section
cachedata.description[fn] = self.description
cachedata.homepage[fn] = self.homepage
cachedata.bugtracker[fn] = self.bugtracker
cachedata.prevision[fn] = self.prevision
cachedata.files_info[fn] = self.files_info

View File

@ -1,134 +0,0 @@
# Local file checksum cache implementation
#
# Copyright (C) 2012 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import glob
import operator
import os
import stat
import pickle
import bb.utils
import logging
from bb.cache import MultiProcessCache
logger = logging.getLogger("BitBake.Cache")
# mtime cache (non-persistent)
# based upon the assumption that files do not change during bitbake run
class FileMtimeCache(object):
cache = {}
def cached_mtime(self, f):
if f not in self.cache:
self.cache[f] = os.stat(f)[stat.ST_MTIME]
return self.cache[f]
def cached_mtime_noerror(self, f):
if f not in self.cache:
try:
self.cache[f] = os.stat(f)[stat.ST_MTIME]
except OSError:
return 0
return self.cache[f]
def update_mtime(self, f):
self.cache[f] = os.stat(f)[stat.ST_MTIME]
return self.cache[f]
def clear(self):
self.cache.clear()
# Checksum + mtime cache (persistent)
class FileChecksumCache(MultiProcessCache):
cache_file_name = "local_file_checksum_cache.dat"
CACHE_VERSION = 1
def __init__(self):
self.mtime_cache = FileMtimeCache()
MultiProcessCache.__init__(self)
def get_checksum(self, f):
entry = self.cachedata[0].get(f)
cmtime = self.mtime_cache.cached_mtime(f)
if entry:
(mtime, hashval) = entry
if cmtime == mtime:
return hashval
else:
bb.debug(2, "file %s changed mtime, recompute checksum" % f)
hashval = bb.utils.md5_file(f)
self.cachedata_extras[0][f] = (cmtime, hashval)
return hashval
def merge_data(self, source, dest):
for h in source[0]:
if h in dest:
(smtime, _) = source[0][h]
(dmtime, _) = dest[0][h]
if smtime > dmtime:
dest[0][h] = source[0][h]
else:
dest[0][h] = source[0][h]
def get_checksums(self, filelist, pn):
"""Get checksums for a list of files"""
def checksum_file(f):
try:
checksum = self.get_checksum(f)
except OSError as e:
bb.warn("Unable to get checksum for %s SRC_URI entry %s: %s" % (pn, os.path.basename(f), e))
return None
return checksum
def checksum_dir(pth):
# Handle directories recursively
dirchecksums = []
for root, dirs, files in os.walk(pth):
for name in files:
fullpth = os.path.join(root, name)
checksum = checksum_file(fullpth)
if checksum:
dirchecksums.append((fullpth, checksum))
return dirchecksums
checksums = []
for pth in filelist.split():
exist = pth.split(":")[1]
if exist == "False":
continue
pth = pth.split(":")[0]
if '*' in pth:
# Handle globs
for f in glob.glob(pth):
if os.path.isdir(f):
if not os.path.islink(f):
checksums.extend(checksum_dir(f))
else:
checksum = checksum_file(f)
if checksum:
checksums.append((f, checksum))
elif os.path.isdir(pth):
if not os.path.islink(pth):
checksums.extend(checksum_dir(pth))
else:
checksum = checksum_file(pth)
if checksum:
checksums.append((pth, checksum))
checksums.sort(key=operator.itemgetter(1))
return checksums

View File

@ -1,39 +1,21 @@
"""
BitBake code parser
Parses actual code (i.e. python and shell) for functions and in-line
expressions. Used mainly to determine dependencies on other functions
and variables within the BitBake metadata. Also provides a cache for
this information in order to speed up processing.
(Not to be confused with the code that parses the metadata itself,
see lib/bb/parse/ for that).
NOTE: if you change how the parsers gather information you will almost
certainly need to increment CodeParserCache.CACHE_VERSION below so that
any existing codeparser cache gets invalidated. Additionally you'll need
to increment __cache_version__ in cache.py in order to ensure that old
recipe caches don't trigger "Taskhash mismatch" errors.
"""
import ast
import sys
import codegen
import logging
import pickle
import bb.pysh as pysh
import os.path
import bb.utils, bb.data
import hashlib
from itertools import chain
from bb.pysh import pyshyacc, pyshlex, sherrors
from bb.cache import MultiProcessCache
from pysh import pyshyacc, pyshlex, sherrors
logger = logging.getLogger('BitBake.CodeParser')
PARSERCACHE_VERSION = 2
try:
import cPickle as pickle
except ImportError:
import pickle
logger.info('Importing cPickle failed. Falling back to a very slow implementation.')
def bbhash(s):
return hashlib.md5(s.encode("utf-8")).hexdigest()
def check_indent(codestr):
"""If the code is indented, add a top level piece of code to 'remove' the indentation"""
@ -46,155 +28,127 @@ def check_indent(codestr):
return codestr
if codestr[i-1] == "\t" or codestr[i-1] == " ":
if codestr[0] == "\n":
# Since we're adding a line, we need to remove one line of any empty padding
# to ensure line numbers are correct
codestr = codestr[1:]
return "if 1:\n" + codestr
return codestr
pythonparsecache = {}
shellparsecache = {}
# Basically pickle, in python 2.7.3 at least, does badly with data duplication
# upon pickling and unpickling. Combine this with duplicate objects and things
# are a mess.
#
# When the sets are originally created, python calls intern() on the set keys
# which significantly improves memory usage. Sadly the pickle/unpickle process
# doesn't call intern() on the keys and results in the same strings being duplicated
# in memory. This also means pickle will save the same string multiple times in
# the cache file.
#
# By having shell and python cacheline objects with setstate/getstate, we force
# the object creation through our own routine where we can call intern (via internSet).
#
# We also use hashable frozensets and ensure we use references to these so that
# duplicates can be removed, both in memory and in the resulting pickled data.
#
# By playing these games, the size of the cache file shrinks dramatically
# meaning faster load times and the reloaded cache files also consume much less
# memory. Smaller cache files, faster load times and lower memory usage is good.
#
# A custom getstate/setstate using tuples is actually worth 15% cachesize by
# avoiding duplication of the attribute names!
class SetCache(object):
def __init__(self):
self.setcache = {}
def internSet(self, items):
new = []
for i in items:
new.append(sys.intern(i))
s = frozenset(new)
h = hash(s)
if h in self.setcache:
return self.setcache[h]
self.setcache[h] = s
return s
codecache = SetCache()
class pythonCacheLine(object):
def __init__(self, refs, execs, contains):
self.refs = codecache.internSet(refs)
self.execs = codecache.internSet(execs)
self.contains = {}
for c in contains:
self.contains[c] = codecache.internSet(contains[c])
def __getstate__(self):
return (self.refs, self.execs, self.contains)
def __setstate__(self, state):
(refs, execs, contains) = state
self.__init__(refs, execs, contains)
def __hash__(self):
l = (hash(self.refs), hash(self.execs))
for c in sorted(self.contains.keys()):
l = l + (c, hash(self.contains[c]))
return hash(l)
def __repr__(self):
return " ".join([str(self.refs), str(self.execs), str(self.contains)])
class shellCacheLine(object):
def __init__(self, execs):
self.execs = codecache.internSet(execs)
def __getstate__(self):
return (self.execs)
def __setstate__(self, state):
(execs) = state
self.__init__(execs)
def __hash__(self):
return hash(self.execs)
def __repr__(self):
return str(self.execs)
class CodeParserCache(MultiProcessCache):
cache_file_name = "bb_codeparser.dat"
# NOTE: you must increment this if you change how the parsers gather information,
# so that an existing cache gets invalidated. Additionally you'll need
# to increment __cache_version__ in cache.py in order to ensure that old
# recipe caches don't trigger "Taskhash mismatch" errors.
CACHE_VERSION = 9
def __init__(self):
MultiProcessCache.__init__(self)
self.pythoncache = self.cachedata[0]
self.shellcache = self.cachedata[1]
self.pythoncacheextras = self.cachedata_extras[0]
self.shellcacheextras = self.cachedata_extras[1]
# To avoid duplication in the codeparser cache, keep
# a lookup of hashes of objects we already have
self.pythoncachelines = {}
self.shellcachelines = {}
def newPythonCacheLine(self, refs, execs, contains):
cacheline = pythonCacheLine(refs, execs, contains)
h = hash(cacheline)
if h in self.pythoncachelines:
return self.pythoncachelines[h]
self.pythoncachelines[h] = cacheline
return cacheline
def newShellCacheLine(self, execs):
cacheline = shellCacheLine(execs)
h = hash(cacheline)
if h in self.shellcachelines:
return self.shellcachelines[h]
self.shellcachelines[h] = cacheline
return cacheline
def init_cache(self, d):
# Check if we already have the caches
if self.pythoncache:
return
MultiProcessCache.init_cache(self, d)
# cachedata gets re-assigned in the parent
self.pythoncache = self.cachedata[0]
self.shellcache = self.cachedata[1]
def create_cachedata(self):
data = [{}, {}]
return data
codeparsercache = CodeParserCache()
def parser_cachefile(d):
cachedir = (bb.data.getVar("PERSISTENT_DIR", d, True) or
bb.data.getVar("CACHE", d, True))
if cachedir in [None, '']:
return None
bb.utils.mkdirhier(cachedir)
cachefile = os.path.join(cachedir, "bb_codeparser.dat")
logger.debug(1, "Using cache in '%s' for codeparser cache", cachefile)
return cachefile
def parser_cache_init(d):
codeparsercache.init_cache(d)
global pythonparsecache
global shellparsecache
def parser_cache_save():
codeparsercache.save_extras()
cachefile = parser_cachefile(d)
if not cachefile:
return
try:
p = pickle.Unpickler(file(cachefile, "rb"))
data, version = p.load()
except:
return
if version != PARSERCACHE_VERSION:
return
pythonparsecache = data[0]
shellparsecache = data[1]
def parser_cache_save(d):
cachefile = parser_cachefile(d)
if not cachefile:
return
glf = bb.utils.lockfile(cachefile + ".lock", shared=True)
i = os.getpid()
lf = None
while not lf:
shellcache = {}
pythoncache = {}
lf = bb.utils.lockfile(cachefile + ".lock." + str(i), retry=False)
if not lf or os.path.exists(cachefile + "-" + str(i)):
if lf:
bb.utils.unlockfile(lf)
lf = None
i = i + 1
continue
try:
p = pickle.Unpickler(file(cachefile, "rb"))
data, version = p.load()
except (IOError, EOFError, ValueError):
data, version = None, None
if version != PARSERCACHE_VERSION:
shellcache = shellparsecache
pythoncache = pythonparsecache
else:
for h in pythonparsecache:
if h not in data[0]:
pythoncache[h] = pythonparsecache[h]
for h in shellparsecache:
if h not in data[1]:
shellcache[h] = shellparsecache[h]
p = pickle.Pickler(file(cachefile + "-" + str(i), "wb"), -1)
p.dump([[pythoncache, shellcache], PARSERCACHE_VERSION])
bb.utils.unlockfile(lf)
bb.utils.unlockfile(glf)
def parser_cache_savemerge(d):
cachefile = parser_cachefile(d)
if not cachefile:
return
glf = bb.utils.lockfile(cachefile + ".lock")
try:
p = pickle.Unpickler(file(cachefile, "rb"))
data, version = p.load()
except (IOError, EOFError):
data, version = None, None
if version != PARSERCACHE_VERSION:
data = [{}, {}]
for f in [y for y in os.listdir(os.path.dirname(cachefile)) if y.startswith(os.path.basename(cachefile) + '-')]:
f = os.path.join(os.path.dirname(cachefile), f)
try:
p = pickle.Unpickler(file(f, "rb"))
extradata, version = p.load()
except (IOError, EOFError):
extradata, version = [{}, {}], None
if version != PARSERCACHE_VERSION:
continue
for h in extradata[0]:
if h not in data[0]:
data[0][h] = extradata[0][h]
for h in extradata[1]:
if h not in data[1]:
data[1][h] = extradata[1][h]
os.unlink(f)
p = pickle.Pickler(file(cachefile, "wb"), -1)
p.dump([data, PARSERCACHE_VERSION])
bb.utils.unlockfile(glf)
def parser_cache_savemerge():
codeparsercache.save_merge()
Logger = logging.getLoggerClass()
class BufferedLogger(Logger):
@ -209,15 +163,11 @@ class BufferedLogger(Logger):
def flush(self):
for record in self.buffer:
if self.target.isEnabledFor(record.levelno):
self.target.handle(record)
self.target.handle(record)
self.buffer = []
class PythonParser():
getvars = (".getVar", ".appendVar", ".prependVar")
getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag")
containsfuncs = ("bb.utils.contains", "base_contains")
containsanyfuncs = ("bb.utils.contains_any", "bb.utils.filter")
getvars = ("d.getVar", "bb.data.getVar", "data.getVar")
execfuncs = ("bb.build.exec_func", "bb.build.exec_task")
def warn(self, func, arg):
@ -236,37 +186,11 @@ class PythonParser():
def visit_Call(self, node):
name = self.called_node_name(node.func)
if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs or name in self.containsanyfuncs):
if name in self.getvars:
if isinstance(node.args[0], ast.Str):
varname = node.args[0].s
if name in self.containsfuncs and isinstance(node.args[1], ast.Str):
if varname not in self.contains:
self.contains[varname] = set()
self.contains[varname].add(node.args[1].s)
elif name in self.containsanyfuncs and isinstance(node.args[1], ast.Str):
if varname not in self.contains:
self.contains[varname] = set()
self.contains[varname].update(node.args[1].s.split())
elif name.endswith(self.getvarflags):
if isinstance(node.args[1], ast.Str):
self.references.add('%s[%s]' % (varname, node.args[1].s))
else:
self.warn(node.func, node.args[1])
else:
self.references.add(varname)
self.var_references.add(node.args[0].s)
else:
self.warn(node.func, node.args[0])
elif name and name.endswith(".expand"):
if isinstance(node.args[0], ast.Str):
value = node.args[0].s
d = bb.data.init()
parser = d.expandWithRefs(value, self.name)
self.references |= parser.references
self.execs |= parser.execs
for varname in parser.contains:
if varname not in self.contains:
self.contains[varname] = set()
self.contains[varname] |= parser.contains[varname]
elif name in self.execfuncs:
if isinstance(node.args[0], ast.Str):
self.var_execs.add(node.args[0].s)
@ -289,50 +213,36 @@ class PythonParser():
break
def __init__(self, name, log):
self.name = name
self.var_references = set()
self.var_execs = set()
self.contains = {}
self.execs = set()
self.references = set()
self.log = BufferedLogger('BitBake.Data.PythonParser', logging.DEBUG, log)
self.log = BufferedLogger('BitBake.Data.%s' % name, logging.DEBUG, log)
self.unhandled_message = "in call of %s, argument '%s' is not a string literal"
self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message)
def parse_python(self, node, lineno=0, filename="<string>"):
if not node or not node.strip():
def parse_python(self, node):
h = hash(str(node))
if h in pythonparsecache:
self.references = pythonparsecache[h]["refs"]
self.execs = pythonparsecache[h]["execs"]
return
h = bbhash(str(node))
if h in codeparsercache.pythoncache:
self.references = set(codeparsercache.pythoncache[h].refs)
self.execs = set(codeparsercache.pythoncache[h].execs)
self.contains = {}
for i in codeparsercache.pythoncache[h].contains:
self.contains[i] = set(codeparsercache.pythoncache[h].contains[i])
return
if h in codeparsercache.pythoncacheextras:
self.references = set(codeparsercache.pythoncacheextras[h].refs)
self.execs = set(codeparsercache.pythoncacheextras[h].execs)
self.contains = {}
for i in codeparsercache.pythoncacheextras[h].contains:
self.contains[i] = set(codeparsercache.pythoncacheextras[h].contains[i])
return
# We can't add to the linenumbers for compile, we can pad to the correct number of blank lines though
node = "\n" * int(lineno) + node
code = compile(check_indent(str(node)), filename, "exec",
code = compile(check_indent(str(node)), "<string>", "exec",
ast.PyCF_ONLY_AST)
for n in ast.walk(code):
if n.__class__.__name__ == "Call":
self.visit_Call(n)
self.execs.update(self.var_execs)
self.references.update(self.var_references)
self.references.update(self.var_execs)
codeparsercache.pythoncacheextras[h] = codeparsercache.newPythonCacheLine(self.references, self.execs, self.contains)
pythonparsecache[h] = {}
pythonparsecache[h]["refs"] = self.references
pythonparsecache[h]["execs"] = self.execs
class ShellParser():
def __init__(self, name, log):
@ -348,30 +258,25 @@ class ShellParser():
commands it executes.
"""
h = bbhash(str(value))
h = hash(str(value))
if h in codeparsercache.shellcache:
self.execs = set(codeparsercache.shellcache[h].execs)
if h in shellparsecache:
self.execs = shellparsecache[h]["execs"]
return self.execs
if h in codeparsercache.shellcacheextras:
self.execs = set(codeparsercache.shellcacheextras[h].execs)
return self.execs
self._parse_shell(value)
self.execs = set(cmd for cmd in self.allexecs if cmd not in self.funcdefs)
codeparsercache.shellcacheextras[h] = codeparsercache.newShellCacheLine(self.execs)
return self.execs
def _parse_shell(self, value):
try:
tokens, _ = pyshyacc.parse(value, eof=True, debug=False)
except pyshlex.NeedMore:
raise sherrors.ShellSyntaxError("Unexpected EOF")
self.process_tokens(tokens)
for token in tokens:
self.process_tokens(token)
self.execs = set(cmd for cmd in self.allexecs if cmd not in self.funcdefs)
shellparsecache[h] = {}
shellparsecache[h]["execs"] = self.execs
return self.execs
def process_tokens(self, tokens):
"""Process a supplied portion of the syntax tree as returned by
@ -417,24 +322,18 @@ class ShellParser():
"case_clause": case_clause,
}
def process_token_list(tokens):
for token in tokens:
if isinstance(token, list):
process_token_list(token)
continue
name, value = token
try:
more_tokens, words = token_handlers[name](value)
except KeyError:
raise NotImplementedError("Unsupported token type " + name)
for token in tokens:
name, value = token
try:
more_tokens, words = token_handlers[name](value)
except KeyError:
raise NotImplementedError("Unsupported token type " + name)
if more_tokens:
self.process_tokens(more_tokens)
if more_tokens:
self.process_tokens(more_tokens)
if words:
self.process_words(words)
process_token_list(tokens)
if words:
self.process_words(words)
def process_words(self, words):
"""Process a set of 'words' in pyshyacc parlance, which includes
@ -451,7 +350,7 @@ class ShellParser():
if part[0] in ('`', '$('):
command = pyshlex.wordtree_as_string(part[1:-1])
self._parse_shell(command)
self.parse_shell(command)
if word[0] in ("cmd_name", "cmd_word"):
if word in words:
@ -470,7 +369,7 @@ class ShellParser():
self.log.debug(1, self.unhandled_template % cmd)
elif cmd == "eval":
command = " ".join(word for _, word in words[1:])
self._parse_shell(command)
self.parse_shell(command)
else:
self.allexecs.add(cmd)
break

View File

@ -28,15 +28,13 @@ and must not trigger events, directly or indirectly.
Commands are queued in a CommandQueue
"""
from collections import OrderedDict, defaultdict
import bb.event
import bb.cooker
import bb.remotedata
import bb.data
async_cmds = {}
sync_cmds = {}
class DataStoreConnectionHandle(object):
def __init__(self, dsindex=0):
self.dsindex = dsindex
class CommandCompleted(bb.event.Event):
pass
@ -51,9 +49,6 @@ class CommandFailed(CommandExit):
self.error = message
CommandExit.__init__(self, 1)
class CommandError(Exception):
pass
class Command:
"""
A queue of asynchronous commands for bitbake
@ -62,50 +57,45 @@ class Command:
self.cooker = cooker
self.cmds_sync = CommandsSync()
self.cmds_async = CommandsAsync()
self.remotedatastores = bb.remotedata.RemoteDatastores(cooker)
# FIXME Add lock for this
self.currentAsyncCommand = None
def runCommand(self, commandline, ro_only = False):
command = commandline.pop(0)
if hasattr(CommandsSync, command):
# Can run synchronous commands straight away
command_method = getattr(self.cmds_sync, command)
if ro_only:
if not hasattr(command_method, 'readonly') or False == getattr(command_method, 'readonly'):
return None, "Not able to execute not readonly commands in readonly mode"
try:
if getattr(command_method, 'needconfig', False):
self.cooker.updateCacheSync()
result = command_method(self, commandline)
except CommandError as exc:
return None, exc.args[0]
except (Exception, SystemExit):
import traceback
return None, traceback.format_exc()
else:
return result, None
if self.currentAsyncCommand is not None:
return None, "Busy (%s in progress)" % self.currentAsyncCommand[0]
if command not in CommandsAsync.__dict__:
return None, "No such command"
self.currentAsyncCommand = (command, commandline)
self.cooker.configuration.server_register_idlecallback(self.cooker.runCommands, self.cooker)
return True, None
for attr in CommandsSync.__dict__:
command = attr[:].lower()
method = getattr(CommandsSync, attr)
sync_cmds[command] = (method)
for attr in CommandsAsync.__dict__:
command = attr[:].lower()
method = getattr(CommandsAsync, attr)
async_cmds[command] = (method)
def runCommand(self, commandline):
try:
command = commandline.pop(0)
if command in CommandsSync.__dict__:
# Can run synchronous commands straight away
return getattr(CommandsSync, command)(self.cmds_sync, self, commandline)
if self.currentAsyncCommand is not None:
return "Busy (%s in progress)" % self.currentAsyncCommand[0]
if command not in CommandsAsync.__dict__:
return "No such command"
self.currentAsyncCommand = (command, commandline)
self.cooker.server_registration_cb(self.cooker.runCommands, self.cooker)
return True
except:
import traceback
return traceback.format_exc()
def runAsyncCommand(self):
try:
if self.cooker.state in (bb.cooker.state.error, bb.cooker.state.shutdown, bb.cooker.state.forceshutdown):
# updateCache will trigger a shutdown of the parser
# and then raise BBHandledException triggering an exit
self.cooker.updateCache()
return False
if self.currentAsyncCommand is not None:
(command, options) = self.currentAsyncCommand
commandmethod = getattr(CommandsAsync, command)
needcache = getattr( commandmethod, "needcache" )
if needcache and self.cooker.state != bb.cooker.state.running:
if (needcache and self.cooker.state in
(bb.cooker.state.initial, bb.cooker.state.parsing)):
self.cooker.updateCache()
return True
else:
@ -118,34 +108,25 @@ class Command:
return False
except SystemExit as exc:
arg = exc.args[0]
if isinstance(arg, str):
if isinstance(arg, basestring):
self.finishAsyncCommand(arg)
else:
self.finishAsyncCommand("Exited with %s" % arg)
return False
except Exception as exc:
except Exception:
import traceback
if isinstance(exc, bb.BBHandledException):
self.finishAsyncCommand("")
else:
self.finishAsyncCommand(traceback.format_exc())
self.finishAsyncCommand(traceback.format_exc())
return False
def finishAsyncCommand(self, msg=None, code=None):
if msg or msg == "":
bb.event.fire(CommandFailed(msg), self.cooker.data)
if msg:
bb.event.fire(CommandFailed(msg), self.cooker.configuration.event_data)
elif code:
bb.event.fire(CommandExit(code), self.cooker.data)
bb.event.fire(CommandExit(code), self.cooker.configuration.event_data)
else:
bb.event.fire(CommandCompleted(), self.cooker.data)
bb.event.fire(CommandCompleted(), self.cooker.configuration.event_data)
self.currentAsyncCommand = None
self.cooker.finishcommand()
def split_mc_pn(pn):
if pn.startswith("multiconfig:"):
_, mc, pn = pn.split(":", 2)
return (mc, pn)
return ('', pn)
class CommandsSync:
"""
@ -158,425 +139,46 @@ class CommandsSync:
"""
Trigger cooker 'shutdown' mode
"""
command.cooker.shutdown(False)
command.cooker.shutdown()
def stateForceShutdown(self, command, params):
def stateStop(self, command, params):
"""
Stop the cooker
"""
command.cooker.shutdown(True)
command.cooker.stop()
def getAllKeysWithFlags(self, command, params):
def getCmdLineAction(self, command, params):
"""
Returns a dump of the global state. Call with
variable flags to be retrieved as params.
Get any command parsed from the commandline
"""
flaglist = params[0]
return command.cooker.getAllKeysWithFlags(flaglist)
getAllKeysWithFlags.readonly = True
return command.cooker.commandlineAction
def getVariable(self, command, params):
"""
Read the value of a variable from data
Read the value of a variable from configuration.data
"""
varname = params[0]
expand = True
if len(params) > 1:
expand = (params[1] == "True")
expand = params[1]
return command.cooker.data.getVar(varname, expand)
getVariable.readonly = True
return bb.data.getVar(varname, command.cooker.configuration.data, expand)
def setVariable(self, command, params):
"""
Set the value of variable in data
Set the value of variable in configuration.data
"""
varname = params[0]
value = str(params[1])
command.cooker.extraconfigdata[varname] = value
command.cooker.data.setVar(varname, value)
value = params[1]
bb.data.setVar(varname, value, command.cooker.configuration.data)
def getSetVariable(self, command, params):
def resetCooker(self, command, params):
"""
Read the value of a variable from data and set it into the datastore
which effectively expands and locks the value.
Reset the cooker to its initial state, thus forcing a reparse for
any async command that has the needcache property set to True
"""
varname = params[0]
result = self.getVariable(command, params)
command.cooker.data.setVar(varname, result)
return result
command.cooker.reset()
def setConfig(self, command, params):
"""
Set the value of variable in configuration
"""
varname = params[0]
value = str(params[1])
setattr(command.cooker.configuration, varname, value)
def enableDataTracking(self, command, params):
"""
Enable history tracking for variables
"""
command.cooker.enableDataTracking()
def disableDataTracking(self, command, params):
"""
Disable history tracking for variables
"""
command.cooker.disableDataTracking()
def setPrePostConfFiles(self, command, params):
prefiles = params[0].split()
postfiles = params[1].split()
command.cooker.configuration.prefile = prefiles
command.cooker.configuration.postfile = postfiles
setPrePostConfFiles.needconfig = False
def getCpuCount(self, command, params):
"""
Get the CPU count on the bitbake server
"""
return bb.utils.cpu_count()
getCpuCount.readonly = True
getCpuCount.needconfig = False
def matchFile(self, command, params):
fMatch = params[0]
return command.cooker.matchFile(fMatch)
matchFile.needconfig = False
def generateNewImage(self, command, params):
image = params[0]
base_image = params[1]
package_queue = params[2]
timestamp = params[3]
description = params[4]
return command.cooker.generateNewImage(image, base_image,
package_queue, timestamp, description)
def ensureDir(self, command, params):
directory = params[0]
bb.utils.mkdirhier(directory)
ensureDir.needconfig = False
def setVarFile(self, command, params):
"""
Save a variable in a file; used for saving in a configuration file
"""
var = params[0]
val = params[1]
default_file = params[2]
op = params[3]
command.cooker.modifyConfigurationVar(var, val, default_file, op)
setVarFile.needconfig = False
def removeVarFile(self, command, params):
"""
Remove a variable declaration from a file
"""
var = params[0]
command.cooker.removeConfigurationVar(var)
removeVarFile.needconfig = False
def createConfigFile(self, command, params):
"""
Create an extra configuration file
"""
name = params[0]
command.cooker.createConfigFile(name)
createConfigFile.needconfig = False
def setEventMask(self, command, params):
handlerNum = params[0]
llevel = params[1]
debug_domains = params[2]
mask = params[3]
return bb.event.set_UIHmask(handlerNum, llevel, debug_domains, mask)
setEventMask.needconfig = False
setEventMask.readonly = True
def setFeatures(self, command, params):
"""
Set the cooker features to include the passed list of features
"""
features = params[0]
command.cooker.setFeatures(features)
setFeatures.needconfig = False
# although we change the internal state of the cooker, this is transparent since
# we always take and leave the cooker in state.initial
setFeatures.readonly = True
def updateConfig(self, command, params):
options = params[0]
environment = params[1]
cmdline = params[2]
command.cooker.updateConfigOpts(options, environment, cmdline)
updateConfig.needconfig = False
def parseConfiguration(self, command, params):
"""Instruct bitbake to parse its configuration
NOTE: it is only necessary to call this if you aren't calling any normal action
(otherwise parsing is taken care of automatically)
"""
command.cooker.parseConfiguration()
parseConfiguration.needconfig = False
def getLayerPriorities(self, command, params):
ret = []
# regex objects cannot be marshalled by xmlrpc
for collection, pattern, regex, pri in command.cooker.bbfile_config_priorities:
ret.append((collection, pattern, regex.pattern, pri))
return ret
getLayerPriorities.readonly = True
def getRecipes(self, command, params):
try:
mc = params[0]
except IndexError:
mc = ''
return list(command.cooker.recipecaches[mc].pkg_pn.items())
getRecipes.readonly = True
def getRecipeDepends(self, command, params):
try:
mc = params[0]
except IndexError:
mc = ''
return list(command.cooker.recipecaches[mc].deps.items())
getRecipeDepends.readonly = True
def getRecipeVersions(self, command, params):
try:
mc = params[0]
except IndexError:
mc = ''
return command.cooker.recipecaches[mc].pkg_pepvpr
getRecipeVersions.readonly = True
def getRuntimeDepends(self, command, params):
ret = []
try:
mc = params[0]
except IndexError:
mc = ''
rundeps = command.cooker.recipecaches[mc].rundeps
for key, value in rundeps.items():
if isinstance(value, defaultdict):
value = dict(value)
ret.append((key, value))
return ret
getRuntimeDepends.readonly = True
def getRuntimeRecommends(self, command, params):
ret = []
try:
mc = params[0]
except IndexError:
mc = ''
runrecs = command.cooker.recipecaches[mc].runrecs
for key, value in runrecs.items():
if isinstance(value, defaultdict):
value = dict(value)
ret.append((key, value))
return ret
getRuntimeRecommends.readonly = True
def getRecipeInherits(self, command, params):
try:
mc = params[0]
except IndexError:
mc = ''
return command.cooker.recipecaches[mc].inherits
getRecipeInherits.readonly = True
def getBbFilePriority(self, command, params):
try:
mc = params[0]
except IndexError:
mc = ''
return command.cooker.recipecaches[mc].bbfile_priority
getBbFilePriority.readonly = True
def getDefaultPreference(self, command, params):
try:
mc = params[0]
except IndexError:
mc = ''
return command.cooker.recipecaches[mc].pkg_dp
getDefaultPreference.readonly = True
def getSkippedRecipes(self, command, params):
# Return list sorted by reverse priority order
import bb.cache
skipdict = OrderedDict(sorted(command.cooker.skiplist.items(),
key=lambda x: (-command.cooker.collection.calc_bbfile_priority(bb.cache.virtualfn2realfn(x[0])[0]), x[0])))
return list(skipdict.items())
getSkippedRecipes.readonly = True
def getOverlayedRecipes(self, command, params):
return list(command.cooker.collection.overlayed.items())
getOverlayedRecipes.readonly = True
def getFileAppends(self, command, params):
fn = params[0]
return command.cooker.collection.get_file_appends(fn)
getFileAppends.readonly = True
def getAllAppends(self, command, params):
return command.cooker.collection.bbappends
getAllAppends.readonly = True
def findProviders(self, command, params):
return command.cooker.findProviders()
findProviders.readonly = True
def findBestProvider(self, command, params):
(mc, pn) = split_mc_pn(params[0])
return command.cooker.findBestProvider(pn, mc)
findBestProvider.readonly = True
def allProviders(self, command, params):
try:
mc = params[0]
except IndexError:
mc = ''
return list(bb.providers.allProviders(command.cooker.recipecaches[mc]).items())
allProviders.readonly = True
def getRuntimeProviders(self, command, params):
rprovide = params[0]
try:
mc = params[1]
except IndexError:
mc = ''
all_p = bb.providers.getRuntimeProviders(command.cooker.recipecaches[mc], rprovide)
if all_p:
best = bb.providers.filterProvidersRunTime(all_p, rprovide,
command.cooker.data,
command.cooker.recipecaches[mc])[0][0]
else:
best = None
return all_p, best
getRuntimeProviders.readonly = True
def dataStoreConnectorFindVar(self, command, params):
dsindex = params[0]
name = params[1]
datastore = command.remotedatastores[dsindex]
value, overridedata = datastore._findVar(name)
if value:
content = value.get('_content', None)
if isinstance(content, bb.data_smart.DataSmart):
# Value is a datastore (e.g. BB_ORIGENV) - need to handle this carefully
idx = command.remotedatastores.check_store(content, True)
return {'_content': DataStoreConnectionHandle(idx),
'_connector_origtype': 'DataStoreConnectionHandle',
'_connector_overrides': overridedata}
elif isinstance(content, set):
return {'_content': list(content),
'_connector_origtype': 'set',
'_connector_overrides': overridedata}
else:
value['_connector_overrides'] = overridedata
else:
value = {}
value['_connector_overrides'] = overridedata
return value
dataStoreConnectorFindVar.readonly = True
def dataStoreConnectorGetKeys(self, command, params):
dsindex = params[0]
datastore = command.remotedatastores[dsindex]
return list(datastore.keys())
dataStoreConnectorGetKeys.readonly = True
def dataStoreConnectorGetVarHistory(self, command, params):
dsindex = params[0]
name = params[1]
datastore = command.remotedatastores[dsindex]
return datastore.varhistory.variable(name)
dataStoreConnectorGetVarHistory.readonly = True
def dataStoreConnectorExpandPythonRef(self, command, params):
config_data_dict = params[0]
varname = params[1]
expr = params[2]
config_data = command.remotedatastores.receive_datastore(config_data_dict)
varparse = bb.data_smart.VariableParse(varname, config_data)
return varparse.python_sub(expr)
def dataStoreConnectorRelease(self, command, params):
dsindex = params[0]
if dsindex <= 0:
raise CommandError('dataStoreConnectorRelease: invalid index %d' % dsindex)
command.remotedatastores.release(dsindex)
def dataStoreConnectorSetVarFlag(self, command, params):
dsindex = params[0]
name = params[1]
flag = params[2]
value = params[3]
datastore = command.remotedatastores[dsindex]
datastore.setVarFlag(name, flag, value)
def dataStoreConnectorDelVar(self, command, params):
dsindex = params[0]
name = params[1]
datastore = command.remotedatastores[dsindex]
if len(params) > 2:
flag = params[2]
datastore.delVarFlag(name, flag)
else:
datastore.delVar(name)
def dataStoreConnectorRenameVar(self, command, params):
dsindex = params[0]
name = params[1]
newname = params[2]
datastore = command.remotedatastores[dsindex]
datastore.renameVar(name, newname)
def parseRecipeFile(self, command, params):
"""
Parse the specified recipe file (with or without bbappends)
and return a datastore object representing the environment
for the recipe.
"""
fn = params[0]
appends = params[1]
appendlist = params[2]
if len(params) > 3:
config_data_dict = params[3]
config_data = command.remotedatastores.receive_datastore(config_data_dict)
else:
config_data = None
if appends:
if appendlist is not None:
appendfiles = appendlist
else:
appendfiles = command.cooker.collection.get_file_appends(fn)
else:
appendfiles = []
# We are calling bb.cache locally here rather than on the server,
# but that's OK because it doesn't actually need anything from
# the server barring the global datastore (which we have a remote
# version of)
if config_data:
# We have to use a different function here if we're passing in a datastore
# NOTE: we took a copy above, so we don't do it here again
envdata = bb.cache.parse_recipe(config_data, fn, appendfiles)['']
else:
# Use the standard path
parser = bb.cache.NoCache(command.cooker.databuilder)
envdata = parser.loadDataFull(fn, appendfiles)
idx = command.remotedatastores.store(envdata)
return DataStoreConnectionHandle(idx)
parseRecipeFile.readonly = True
class CommandsAsync:
"""
@ -591,12 +193,8 @@ class CommandsAsync:
"""
bfile = params[0]
task = params[1]
if len(params) > 2:
hidewarning = params[2]
else:
hidewarning = False
command.cooker.buildFile(bfile, task, hidewarning)
command.cooker.buildFile(bfile, task)
buildFile.needcache = False
def buildTargets(self, command, params):
@ -640,23 +238,15 @@ class CommandsAsync:
klass) rather than generating a tree for all packages.
"""
klass = params[0]
pkg_list = params[1]
if len(params) > 1:
pkg_list = params[1]
else:
pkg_list = []
command.cooker.generateTargetsTree(klass, pkg_list)
command.finishAsyncCommand()
generateTargetsTree.needcache = True
def findCoreBaseFiles(self, command, params):
"""
Find certain files in COREBASE directory. i.e. Layers
"""
subdir = params[0]
filename = params[1]
command.cooker.findCoreBaseFiles(subdir, filename)
command.finishAsyncCommand()
findCoreBaseFiles.needcache = False
def findConfigFiles(self, command, params):
"""
Find config files which provide appropriate values
@ -666,7 +256,7 @@ class CommandsAsync:
command.cooker.findConfigFiles(varname)
command.finishAsyncCommand()
findConfigFiles.needcache = False
findConfigFiles.needcache = True
def findFilesMatchingInDir(self, command, params):
"""
@ -678,7 +268,7 @@ class CommandsAsync:
command.cooker.findFilesMatchingInDir(pattern, directory)
command.finishAsyncCommand()
findFilesMatchingInDir.needcache = False
findFilesMatchingInDir.needcache = True
def findConfigFilePath(self, command, params):
"""
@ -728,39 +318,20 @@ class CommandsAsync:
command.finishAsyncCommand()
parseFiles.needcache = True
def reparseFiles(self, command, params):
"""
Reparse .bb files
"""
command.cooker.reparseFiles()
command.finishAsyncCommand()
reparseFiles.needcache = True
def compareRevisions(self, command, params):
"""
Parse the .bb files
"""
if bb.fetch.fetcher_compare_revisions(command.cooker.data):
if bb.fetch.fetcher_compare_revisions(command.cooker.configuration.data):
command.finishAsyncCommand(code=1)
else:
command.finishAsyncCommand()
compareRevisions.needcache = True
def triggerEvent(self, command, params):
"""
Trigger a certain event
"""
event = params[0]
bb.event.fire(eval(event), command.cooker.data)
command.currentAsyncCommand = None
triggerEvent.needcache = False
def resetCooker(self, command, params):
"""
Reset the cooker to its initial state, thus forcing a reparse for
any async command that has the needcache property set to True
"""
command.cooker.reset()
command.finishAsyncCommand()
resetCooker.needcache = False
def clientComplete(self, command, params):
"""
Do the right thing when the controlling client exits
"""
command.cooker.clientComplete()
command.finishAsyncCommand()
clientComplete.needcache = False

View File

@ -1,6 +1,28 @@
"""Code pulled from future python versions, here for compatibility"""
from collections import MutableMapping, KeysView, ValuesView, ItemsView, OrderedDict
from functools import total_ordering
def total_ordering(cls):
"""Class decorator that fills in missing ordering methods"""
convert = {
'__lt__': [('__gt__', lambda self, other: other < self),
('__le__', lambda self, other: not other < self),
('__ge__', lambda self, other: not self < other)],
'__le__': [('__ge__', lambda self, other: other <= self),
('__lt__', lambda self, other: not other <= self),
('__gt__', lambda self, other: not self <= other)],
'__gt__': [('__lt__', lambda self, other: other > self),
('__ge__', lambda self, other: not other > self),
('__le__', lambda self, other: not self > other)],
'__ge__': [('__le__', lambda self, other: other >= self),
('__gt__', lambda self, other: not other >= self),
('__lt__', lambda self, other: not self >= other)]
}
roots = set(dir(cls)) & set(convert)
if not roots:
raise ValueError('must define at least one ordering operation: < > <= >=')
root = max(roots) # prefer __lt__ to __le__ to __gt__ to __ge__
for opname, opfunc in convert[root]:
if opname not in roots:
opfunc.__name__ = opname
opfunc.__doc__ = getattr(int, opname).__doc__
setattr(cls, opname, opfunc)
return cls

File diff suppressed because it is too large Load Diff

View File

@ -1,381 +0,0 @@
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
# Copyright (C) 2005 Holger Hans Peter Freyther
# Copyright (C) 2005 ROAD GmbH
# Copyright (C) 2006 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import logging
import os
import re
import sys
from functools import wraps
import bb
from bb import data
import bb.parse
logger = logging.getLogger("BitBake")
parselog = logging.getLogger("BitBake.Parsing")
class ConfigParameters(object):
def __init__(self, argv=sys.argv):
self.options, targets = self.parseCommandLine(argv)
self.environment = self.parseEnvironment()
self.options.pkgs_to_build = targets or []
self.options.tracking = False
if hasattr(self.options, "show_environment") and self.options.show_environment:
self.options.tracking = True
for key, val in self.options.__dict__.items():
setattr(self, key, val)
def parseCommandLine(self, argv=sys.argv):
raise Exception("Caller must implement commandline option parsing")
def parseEnvironment(self):
return os.environ.copy()
def updateFromServer(self, server):
if not self.options.cmd:
defaulttask, error = server.runCommand(["getVariable", "BB_DEFAULT_TASK"])
if error:
raise Exception("Unable to get the value of BB_DEFAULT_TASK from the server: %s" % error)
self.options.cmd = defaulttask or "build"
_, error = server.runCommand(["setConfig", "cmd", self.options.cmd])
if error:
raise Exception("Unable to set configuration option 'cmd' on the server: %s" % error)
if not self.options.pkgs_to_build:
bbpkgs, error = server.runCommand(["getVariable", "BBTARGETS"])
if error:
raise Exception("Unable to get the value of BBTARGETS from the server: %s" % error)
if bbpkgs:
self.options.pkgs_to_build.extend(bbpkgs.split())
def updateToServer(self, server, environment):
options = {}
for o in ["abort", "tryaltconfigs", "force", "invalidate_stamp",
"verbose", "debug", "dry_run", "dump_signatures",
"debug_domains", "extra_assume_provided", "profile",
"prefile", "postfile"]:
options[o] = getattr(self.options, o)
ret, error = server.runCommand(["updateConfig", options, environment, sys.argv])
if error:
raise Exception("Unable to update the server configuration with local parameters: %s" % error)
def parseActions(self):
# Parse any commandline into actions
action = {'action':None, 'msg':None}
if self.options.show_environment:
if 'world' in self.options.pkgs_to_build:
action['msg'] = "'world' is not a valid target for --environment."
elif 'universe' in self.options.pkgs_to_build:
action['msg'] = "'universe' is not a valid target for --environment."
elif len(self.options.pkgs_to_build) > 1:
action['msg'] = "Only one target can be used with the --environment option."
elif self.options.buildfile and len(self.options.pkgs_to_build) > 0:
action['msg'] = "No target should be used with the --environment and --buildfile options."
elif len(self.options.pkgs_to_build) > 0:
action['action'] = ["showEnvironmentTarget", self.options.pkgs_to_build]
else:
action['action'] = ["showEnvironment", self.options.buildfile]
elif self.options.buildfile is not None:
action['action'] = ["buildFile", self.options.buildfile, self.options.cmd]
elif self.options.revisions_changed:
action['action'] = ["compareRevisions"]
elif self.options.show_versions:
action['action'] = ["showVersions"]
elif self.options.parse_only:
action['action'] = ["parseFiles"]
elif self.options.dot_graph:
if self.options.pkgs_to_build:
action['action'] = ["generateDotGraph", self.options.pkgs_to_build, self.options.cmd]
else:
action['msg'] = "Please specify a package name for dependency graph generation."
else:
if self.options.pkgs_to_build:
action['action'] = ["buildTargets", self.options.pkgs_to_build, self.options.cmd]
else:
#action['msg'] = "Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information."
action = None
self.options.initialaction = action
return action
class CookerConfiguration(object):
"""
Manages build options and configurations for one run
"""
def __init__(self):
self.debug_domains = []
self.extra_assume_provided = []
self.prefile = []
self.postfile = []
self.prefile_server = []
self.postfile_server = []
self.debug = 0
self.cmd = None
self.abort = True
self.force = False
self.profile = False
self.nosetscene = False
self.setsceneonly = False
self.invalidate_stamp = False
self.dump_signatures = []
self.dry_run = False
self.tracking = False
self.interface = []
self.writeeventlog = False
self.server_only = False
self.limited_deps = False
self.runall = None
self.env = {}
def setConfigParameters(self, parameters):
for key in self.__dict__.keys():
if key in parameters.options.__dict__:
setattr(self, key, parameters.options.__dict__[key])
self.env = parameters.environment.copy()
self.tracking = parameters.tracking
def setServerRegIdleCallback(self, srcb):
self.server_register_idlecallback = srcb
def __getstate__(self):
state = {}
for key in self.__dict__.keys():
if key == "server_register_idlecallback":
state[key] = None
else:
state[key] = getattr(self, key)
return state
def __setstate__(self,state):
for k in state:
setattr(self, k, state[k])
def catch_parse_error(func):
"""Exception handling bits for our parsing"""
@wraps(func)
def wrapped(fn, *args):
try:
return func(fn, *args)
except IOError as exc:
import traceback
parselog.critical(traceback.format_exc())
parselog.critical("Unable to parse %s: %s" % (fn, exc))
sys.exit(1)
except bb.data_smart.ExpansionError as exc:
import traceback
bbdir = os.path.dirname(__file__) + os.sep
exc_class, exc, tb = sys.exc_info()
for tb in iter(lambda: tb.tb_next, None):
# Skip frames in bitbake itself, we only want the metadata
fn, _, _, _ = traceback.extract_tb(tb, 1)[0]
if not fn.startswith(bbdir):
break
parselog.critical("Unable to parse %s" % fn, exc_info=(exc_class, exc, tb))
sys.exit(1)
except bb.parse.ParseError as exc:
parselog.critical(str(exc))
sys.exit(1)
return wrapped
@catch_parse_error
def parse_config_file(fn, data, include=True):
return bb.parse.handle(fn, data, include)
@catch_parse_error
def _inherit(bbclass, data):
bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
return data
def findConfigFile(configfile, data):
search = []
bbpath = data.getVar("BBPATH")
if bbpath:
for i in bbpath.split(":"):
search.append(os.path.join(i, "conf", configfile))
path = os.getcwd()
while path != "/":
search.append(os.path.join(path, "conf", configfile))
path, _ = os.path.split(path)
for i in search:
if os.path.exists(i):
return i
return None
class CookerDataBuilder(object):
def __init__(self, cookercfg, worker = False):
self.prefiles = cookercfg.prefile
self.postfiles = cookercfg.postfile
self.tracking = cookercfg.tracking
bb.utils.set_context(bb.utils.clean_context())
bb.event.set_class_handlers(bb.event.clean_class_handlers())
self.basedata = bb.data.init()
if self.tracking:
self.basedata.enableTracking()
# Keep a datastore of the initial environment variables and their
# values from when BitBake was launched to enable child processes
# to use environment variables which have been cleaned from the
# BitBake processes env
self.savedenv = bb.data.init()
for k in cookercfg.env:
self.savedenv.setVar(k, cookercfg.env[k])
filtered_keys = bb.utils.approved_variables()
bb.data.inheritFromOS(self.basedata, self.savedenv, filtered_keys)
self.basedata.setVar("BB_ORIGENV", self.savedenv)
if worker:
self.basedata.setVar("BB_WORKERCONTEXT", "1")
self.data = self.basedata
self.mcdata = {}
def parseBaseConfiguration(self):
try:
bb.parse.init_parser(self.basedata)
self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
if self.data.getVar("BB_WORKERCONTEXT", False) is None:
bb.fetch.fetcher_init(self.data)
bb.codeparser.parser_cache_init(self.data)
bb.event.fire(bb.event.ConfigParsed(), self.data)
reparse_cnt = 0
while self.data.getVar("BB_INVALIDCONF", False) is True:
if reparse_cnt > 20:
logger.error("Configuration has been re-parsed over 20 times, "
"breaking out of the loop...")
raise Exception("Too deep config re-parse loop. Check locations where "
"BB_INVALIDCONF is being set (ConfigParsed event handlers)")
self.data.setVar("BB_INVALIDCONF", False)
self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
reparse_cnt += 1
bb.event.fire(bb.event.ConfigParsed(), self.data)
bb.parse.init_parser(self.data)
self.data_hash = self.data.get_hash()
self.mcdata[''] = self.data
multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split()
for config in multiconfig:
mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config)
bb.event.fire(bb.event.ConfigParsed(), mcdata)
self.mcdata[config] = mcdata
except (SyntaxError, bb.BBHandledException):
raise bb.BBHandledException
except bb.data_smart.ExpansionError as e:
logger.error(str(e))
raise bb.BBHandledException
except Exception:
logger.exception("Error parsing configuration files")
raise bb.BBHandledException
def _findLayerConf(self, data):
return findConfigFile("bblayers.conf", data)
def parseConfigurationFiles(self, prefiles, postfiles, mc = "default"):
data = bb.data.createCopy(self.basedata)
data.setVar("BB_CURRENT_MC", mc)
# Parse files for loading *before* bitbake.conf and any includes
for f in prefiles:
data = parse_config_file(f, data)
layerconf = self._findLayerConf(data)
if layerconf:
parselog.debug(2, "Found bblayers.conf (%s)", layerconf)
# By definition bblayers.conf is in conf/ of TOPDIR.
# We may have been called with cwd somewhere else so reset TOPDIR
data.setVar("TOPDIR", os.path.dirname(os.path.dirname(layerconf)))
data = parse_config_file(layerconf, data)
layers = (data.getVar('BBLAYERS') or "").split()
data = bb.data.createCopy(data)
approved = bb.utils.approved_variables()
for layer in layers:
if not os.path.isdir(layer):
parselog.critical("Layer directory '%s' does not exist! "
"Please check BBLAYERS in %s" % (layer, layerconf))
sys.exit(1)
parselog.debug(2, "Adding layer %s", layer)
if 'HOME' in approved and '~' in layer:
layer = os.path.expanduser(layer)
if layer.endswith('/'):
layer = layer.rstrip('/')
data.setVar('LAYERDIR', layer)
data.setVar('LAYERDIR_RE', re.escape(layer))
data = parse_config_file(os.path.join(layer, "conf", "layer.conf"), data)
data.expandVarref('LAYERDIR')
data.expandVarref('LAYERDIR_RE')
data.delVar('LAYERDIR_RE')
data.delVar('LAYERDIR')
if not data.getVar("BBPATH"):
msg = "The BBPATH variable is not set"
if not layerconf:
msg += (" and bitbake did not find a conf/bblayers.conf file in"
" the expected location.\nMaybe you accidentally"
" invoked bitbake from the wrong directory?")
raise SystemExit(msg)
data = parse_config_file(os.path.join("conf", "bitbake.conf"), data)
# Parse files for loading *after* bitbake.conf and any includes
for p in postfiles:
data = parse_config_file(p, data)
# Handle any INHERITs and inherit the base class
bbclasses = ["base"] + (data.getVar('INHERIT') or "").split()
for bbclass in bbclasses:
data = _inherit(bbclass, data)
# Nomally we only register event handlers at the end of parsing .bb files
# We register any handlers we've found so far here...
for var in data.getVar('__BBHANDLERS', False) or []:
handlerfn = data.getVarFlag(var, "filename", False)
if not handlerfn:
parselog.critical("Undefined event handler function '%s'" % var)
sys.exit(1)
handlerln = int(data.getVarFlag(var, "lineno", False))
bb.event.register(var, data.getVar(var, False), (data.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln)
data.setVar('BBINCLUDED',bb.parse.get_file_depends(data))
return data

View File

@ -1,5 +1,5 @@
"""
Python Daemonizing helper
Python Deamonizing helper
Configurable daemon behaviors:
@ -12,11 +12,8 @@ A failed call to fork() now raises an exception.
References:
1) Advanced Programming in the Unix Environment: W. Richard Stevens
http://www.apuebook.com/apue3e.html
2) The Linux Programming Interface: Michael Kerrisk
http://man7.org/tlpi/index.html
3) Unix Programming Frequently Asked Questions:
http://www.faqs.org/faqs/unix-faq/programmer/faq/
2) Unix Programming Frequently Asked Questions:
http://www.erlenstar.demon.co.uk/unix/faq_toc.html
Modified to allow a function to be daemonized and return for
bitbake use by Richard Purdie
@ -28,7 +25,7 @@ __version__ = "0.2"
# Standard Python modules.
import os # Miscellaneous OS interfaces.
import sys # System-specific parameters and functions.
import sys # System-specific parameters and functions.
# Default daemon parameters.
# File mode creation mask of the daemon.
@ -131,7 +128,7 @@ def createDaemon(function, logfile):
# of methods to accomplish this task. Three are listed below.
#
# Try the system configuration variable, SC_OPEN_MAX, to obtain the maximum
# number of open file descriptors to close. If it doesn't exist, use
# number of open file descriptors to close. If it doesn't exists, use
# the default value (configurable).
#
# try:
@ -149,7 +146,7 @@ def createDaemon(function, logfile):
# OR
#
# Use the getrlimit method to retrieve the maximum file descriptor number
# that can be opened by this process. If there is no limit on the
# that can be opened by this process. If there is not limit on the
# resource, use the default value.
#
import resource # Resource usage information.
@ -178,8 +175,8 @@ def createDaemon(function, logfile):
# os.dup2(0, 2) # standard error (2)
si = open('/dev/null', 'r')
so = open(logfile, 'w')
si = file('/dev/null', 'r')
so = file(logfile, 'w')
se = so

View File

@ -6,7 +6,7 @@ BitBake 'Data' implementations
Functions for interacting with the data structure used by the
BitBake build tools.
The expandKeys and update_data are the most expensive
The expandData and update_data are the most expensive
operations. At night the cookie monster came by and
suggested 'give me cookies on setting the variables and
things will work out'. Taking this suggestion into account
@ -15,7 +15,7 @@ Analyse von Algorithmen' lecture and the cookie
monster seems to be right. We will track setVar more carefully
to have faster update_data and expandKeys operations.
This is a trade-off between speed and memory again but
This is a treade-off between speed and memory again but
the speed is more critical here.
"""
@ -35,7 +35,7 @@ the speed is more critical here.
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
import sys, os, re
if sys.argv[0][-5:] == "pydoc":
@ -59,7 +59,7 @@ def init():
def init_db(parent = None):
"""Return a new object representing the Bitbake data,
optionally based on an existing object"""
if parent is not None:
if parent:
return parent.createCopy()
else:
return _dict_type()
@ -78,6 +78,55 @@ def initVar(var, d):
"""Non-destructive var init for data structure"""
d.initVar(var)
def setVar(var, value, d):
"""Set a variable to a given value"""
d.setVar(var, value)
def getVar(var, d, exp = 0):
"""Gets the value of a variable"""
return d.getVar(var, exp)
def renameVar(key, newkey, d):
"""Renames a variable from key to newkey"""
d.renameVar(key, newkey)
def delVar(var, d):
"""Removes a variable from the data set"""
d.delVar(var)
def setVarFlag(var, flag, flagvalue, d):
"""Set a flag for a given variable to a given value"""
d.setVarFlag(var, flag, flagvalue)
def getVarFlag(var, flag, d):
"""Gets given flag from given var"""
return d.getVarFlag(var, flag)
def delVarFlag(var, flag, d):
"""Removes a given flag from the variable's flags"""
d.delVarFlag(var, flag)
def setVarFlags(var, flags, d):
"""Set the flags for a given variable
Note:
setVarFlags will not clear previous
flags. Think of this method as
addVarFlags
"""
d.setVarFlags(var, flags)
def getVarFlags(var, d):
"""Gets a variable's flags"""
return d.getVarFlags(var)
def delVarFlags(var, d):
"""Removes a variable's flags"""
d.delVarFlags(var)
def keys(d):
"""Return a list of keys in d"""
return d.keys()
@ -95,7 +144,7 @@ def expandKeys(alterdata, readdata = None):
readdata = alterdata
todolist = {}
for key in alterdata:
for key in keys(alterdata):
if not '${' in key:
continue
@ -106,14 +155,10 @@ def expandKeys(alterdata, readdata = None):
# These two for loops are split for performance to maximise the
# usefulness of the expand cache
for key in sorted(todolist):
for key in todolist:
ekey = todolist[key]
newval = alterdata.getVar(ekey, False)
if newval is not None:
val = alterdata.getVar(key, False)
if val is not None:
bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key, val, ekey, newval))
alterdata.renameVar(key, ekey)
renameVar(key, ekey, alterdata)
def inheritFromOS(d, savedenv, permitted):
"""Inherit variables from the initial environment."""
@ -121,60 +166,53 @@ def inheritFromOS(d, savedenv, permitted):
for s in savedenv.keys():
if s in permitted:
try:
d.setVar(s, savedenv.getVar(s), op = 'from env')
setVar(s, getVar(s, savedenv, True), d)
if s in exportlist:
d.setVarFlag(s, "export", True, op = 'auto env export')
setVarFlag(s, "export", True, d)
except TypeError:
pass
def emit_var(var, o=sys.__stdout__, d = init(), all=False):
"""Emit a variable to be sourced by a shell."""
func = d.getVarFlag(var, "func", False)
if d.getVarFlag(var, 'python', False) and func:
return False
if getVarFlag(var, "python", d):
return 0
export = d.getVarFlag(var, "export", False)
unexport = d.getVarFlag(var, "unexport", False)
export = getVarFlag(var, "export", d)
unexport = getVarFlag(var, "unexport", d)
func = getVarFlag(var, "func", d)
if not all and not export and not unexport and not func:
return False
return 0
try:
if all:
oval = d.getVar(var, False)
val = d.getVar(var)
oval = getVar(var, d, 0)
val = getVar(var, d, 1)
except (KeyboardInterrupt, bb.build.FuncFailed):
raise
except Exception as exc:
o.write('# expansion of %s threw %s: %s\n' % (var, exc.__class__.__name__, str(exc)))
return False
return 0
if all:
d.varhistory.emit(var, oval, val, o, d)
commentVal = re.sub('\n', '\n#', str(oval))
o.write('# %s=%s\n' % (var, commentVal))
if (var.find("-") != -1 or var.find(".") != -1 or var.find('{') != -1 or var.find('}') != -1 or var.find('+') != -1) and not all:
return False
return 0
varExpanded = d.expand(var)
varExpanded = expand(var, d)
if unexport:
o.write('unset %s\n' % varExpanded)
return False
return 0
if val is None:
return False
if not val:
return 0
val = str(val)
if varExpanded.startswith("BASH_FUNC_"):
varExpanded = varExpanded[10:-2]
val = val[3:] # Strip off "() "
o.write("%s() %s\n" % (varExpanded, val))
o.write("export -f %s\n" % (varExpanded))
return True
if func:
# NOTE: should probably check for unbalanced {} within the var
val = val.rstrip('\n')
o.write("%s() {\n%s\n}\n" % (varExpanded, val))
return 1
@ -183,35 +221,32 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
# if we're going to output this within doublequotes,
# to a shell, we need to escape the quotes in the var
alter = re.sub('"', '\\"', val)
alter = re.sub('"', '\\"', val.strip())
alter = re.sub('\n', ' \\\n', alter)
alter = re.sub('\\$', '\\\\$', alter)
o.write('%s="%s"\n' % (varExpanded, alter))
return False
return 0
def emit_env(o=sys.__stdout__, d = init(), all=False):
"""Emits all items in the data store in a format such that it can be sourced by a shell."""
isfunc = lambda key: bool(d.getVarFlag(key, "func", False))
isfunc = lambda key: bool(d.getVarFlag(key, "func"))
keys = sorted((key for key in d.keys() if not key.startswith("__")), key=isfunc)
grouped = groupby(keys, isfunc)
for isfunc, keys in grouped:
for key in sorted(keys):
for key in keys:
emit_var(key, o, d, all and not isfunc) and o.write('\n')
def exported_keys(d):
return (key for key in d.keys() if not key.startswith('__') and
d.getVarFlag(key, 'export', False) and
not d.getVarFlag(key, 'unexport', False))
d.getVarFlag(key, 'export') and
not d.getVarFlag(key, 'unexport'))
def exported_vars(d):
k = list(exported_keys(d))
for key in k:
for key in exported_keys(d):
try:
value = d.getVar(key)
except Exception as err:
bb.warn("%s: Unable to export ${%s}: %s" % (d.getVar("FILE"), key, err))
continue
value = d.getVar(key, True)
except Exception:
pass
if value is not None:
yield key, str(value)
@ -219,150 +254,57 @@ def exported_vars(d):
def emit_func(func, o=sys.__stdout__, d = init()):
"""Emits all items in the data store in a format such that it can be sourced by a shell."""
keys = (key for key in d.keys() if not key.startswith("__") and not d.getVarFlag(key, "func", False))
for key in sorted(keys):
emit_var(key, o, d, False)
keys = (key for key in d.keys() if not key.startswith("__") and not d.getVarFlag(key, "func"))
for key in keys:
emit_var(key, o, d, False) and o.write('\n')
o.write('\n')
emit_var(func, o, d, False) and o.write('\n')
newdeps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func))
newdeps |= set((d.getVarFlag(func, "vardeps") or "").split())
newdeps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func, True))
seen = set()
while newdeps:
deps = newdeps
seen |= deps
newdeps = set()
for dep in deps:
if d.getVarFlag(dep, "func", False) and not d.getVarFlag(dep, "python", False):
if bb.data.getVarFlag(dep, "func", d):
emit_var(dep, o, d, False) and o.write('\n')
newdeps |= bb.codeparser.ShellParser(dep, logger).parse_shell(d.getVar(dep))
newdeps |= set((d.getVarFlag(dep, "vardeps") or "").split())
newdeps -= seen
_functionfmt = """
def {function}(d):
{body}"""
def emit_func_python(func, o=sys.__stdout__, d = init()):
"""Emits all items in the data store in a format such that it can be sourced by a shell."""
def write_func(func, o, call = False):
body = d.getVar(func, False)
if not body.startswith("def"):
body = _functionfmt.format(function=func, body=body)
o.write(body.strip() + "\n\n")
if call:
o.write(func + "(d)" + "\n\n")
write_func(func, o, True)
pp = bb.codeparser.PythonParser(func, logger)
pp.parse_python(d.getVar(func, False))
newdeps = pp.execs
newdeps |= set((d.getVarFlag(func, "vardeps") or "").split())
seen = set()
while newdeps:
deps = newdeps
seen |= deps
newdeps = set()
for dep in deps:
if d.getVarFlag(dep, "func", False) and d.getVarFlag(dep, "python", False):
write_func(dep, o)
pp = bb.codeparser.PythonParser(dep, logger)
pp.parse_python(d.getVar(dep, False))
newdeps |= pp.execs
newdeps |= set((d.getVarFlag(dep, "vardeps") or "").split())
newdeps |= bb.codeparser.ShellParser(dep, logger).parse_shell(d.getVar(dep, True))
newdeps -= seen
def update_data(d):
"""Performs final steps upon the datastore, including application of overrides"""
d.finalize(parent = True)
d.finalize()
def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
def build_dependencies(key, keys, shelldeps, vardepvals, d):
deps = set()
vardeps = d.getVarFlag(key, "vardeps", True)
try:
if key[-1] == ']':
vf = key[:-1].split('[')
value = d.getVarFlag(vf[0], vf[1], False)
parser = d.expandWithRefs(value, key)
deps |= parser.references
deps = deps | (keys & parser.execs)
return deps, value
varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude", "exports", "postfuncs", "prefuncs", "lineno", "filename"]) or {}
vardeps = varflags.get("vardeps")
value = d.getVar(key, False)
def handle_contains(value, contains, d):
newvalue = ""
for k in sorted(contains):
l = (d.getVar(k) or "").split()
for item in sorted(contains[k]):
for word in item.split():
if not word in l:
newvalue += "\n%s{%s} = Unset" % (k, item)
break
else:
newvalue += "\n%s{%s} = Set" % (k, item)
if not newvalue:
return value
if not value:
return newvalue
return value + newvalue
if "vardepvalue" in varflags:
value = varflags.get("vardepvalue")
elif varflags.get("func"):
if varflags.get("python"):
if key in vardepvals:
value = d.getVarFlag(key, "vardepvalue", True)
elif d.getVarFlag(key, "func"):
if d.getVarFlag(key, "python"):
parsedvar = d.expandWithRefs(value, key)
parser = bb.codeparser.PythonParser(key, logger)
if value and "\t" in value:
logger.warning("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE")))
parser.parse_python(value, filename=varflags.get("filename"), lineno=varflags.get("lineno"))
parser.parse_python(parsedvar.value)
deps = deps | parser.references
deps = deps | (keys & parser.execs)
value = handle_contains(value, parser.contains, d)
else:
parsedvar = d.expandWithRefs(value, key)
parser = bb.codeparser.ShellParser(key, logger)
parser.parse_shell(parsedvar.value)
deps = deps | shelldeps
deps = deps | parsedvar.references
deps = deps | (keys & parser.execs) | (keys & parsedvar.execs)
value = handle_contains(value, parsedvar.contains, d)
if vardeps is None:
parser.log.flush()
if "prefuncs" in varflags:
deps = deps | set(varflags["prefuncs"].split())
if "postfuncs" in varflags:
deps = deps | set(varflags["postfuncs"].split())
if "exports" in varflags:
deps = deps | set(varflags["exports"].split())
deps = deps | parsedvar.references
deps = deps | (keys & parser.execs) | (keys & parsedvar.execs)
else:
parser = d.expandWithRefs(value, key)
deps |= parser.references
deps = deps | (keys & parser.execs)
value = handle_contains(value, parser.contains, d)
if "vardepvalueexclude" in varflags:
exclude = varflags.get("vardepvalueexclude")
for excl in exclude.split('|'):
if excl:
value = value.replace(excl, '')
# Add varflags, assuming an exclusion list is set
if varflagsexcl:
varfdeps = []
for f in varflags:
if f not in varflagsexcl:
varfdeps.append('%s[%s]' % (key, f))
if varfdeps:
deps |= set(varfdeps)
deps |= set((vardeps or "").split())
deps -= set(varflags.get("vardepsexclude", "").split())
except bb.parse.SkipRecipe:
raise
except Exception as e:
bb.warn("Exception during build_dependencies for %s" % key)
deps -= set((d.getVarFlag(key, "vardepsexclude", True) or "").split())
except:
bb.note("Error expanding variable %s" % key)
raise
return deps, value
#bb.note("Variable %s references %s and calls %s" % (key, str(deps), str(execs)))
@ -370,16 +312,16 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
def generate_dependencies(d):
keys = set(key for key in d if not key.startswith("__"))
shelldeps = set(key for key in d.getVar("__exportlist", False) if d.getVarFlag(key, "export", False) and not d.getVarFlag(key, "unexport", False))
varflagsexcl = d.getVar('BB_SIGNATURE_EXCLUDE_FLAGS')
keys = set(key for key in d.keys() if not key.startswith("__"))
shelldeps = set(key for key in keys if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport"))
vardepvals = set(key for key in keys if d.getVarFlag(key, "vardepvalue"))
deps = {}
values = {}
tasklist = d.getVar('__BBTASKS', False) or []
tasklist = bb.data.getVar('__BBTASKS', d) or []
for task in tasklist:
deps[task], values[task] = build_dependencies(task, keys, shelldeps, varflagsexcl, d)
deps[task], values[task] = build_dependencies(task, keys, shelldeps, vardepvals, d)
newdeps = deps[task]
seen = set()
while newdeps:
@ -388,16 +330,14 @@ def generate_dependencies(d):
newdeps = set()
for dep in nextdeps:
if dep not in deps:
deps[dep], values[dep] = build_dependencies(dep, keys, shelldeps, varflagsexcl, d)
deps[dep], values[dep] = build_dependencies(dep, keys, shelldeps, vardepvals, d)
newdeps |= deps[dep]
newdeps -= seen
#print "For %s: %s" % (task, str(deps[task]))
#print "For %s: %s" % (task, str(taskdeps[task]))
return tasklist, deps, values
def inherits_class(klass, d):
val = d.getVar('__inherit_cache', False) or []
needle = os.path.join('classes', '%s.bbclass' % klass)
for v in val:
if v.endswith(needle):
return True
val = getVar('__inherit_cache', d) or []
if os.path.join('classes', '%s.bbclass' % klass) in val:
return True
return False

File diff suppressed because it is too large Load Diff

View File

@ -24,21 +24,19 @@ BitBake build tools.
import os, sys
import warnings
import pickle
try:
import cPickle as pickle
except ImportError:
import pickle
import logging
import atexit
import traceback
import ast
import threading
import bb.utils
import bb.compat
import bb.exceptions
# This is the pid for which we should generate the event. This is set when
# the runqueue forks off.
worker_pid = 0
worker_fire = None
worker_pipe = None
logger = logging.getLogger('BitBake.Event')
@ -48,63 +46,26 @@ class Event(object):
def __init__(self):
self.pid = worker_pid
class HeartbeatEvent(Event):
"""Triggered at regular time intervals of 10 seconds. Other events can fire much more often
(runQueueTaskStarted when there are many short tasks) or not at all for long periods
of time (again runQueueTaskStarted, when there is just one long-running task), so this
event is more suitable for doing some task-independent work occassionally."""
def __init__(self, time):
Event.__init__(self)
self.time = time
NotHandled = 0
Handled = 1
Registered = 10
AlreadyRegistered = 14
def get_class_handlers():
return _handlers
def set_class_handlers(h):
global _handlers
_handlers = h
def clean_class_handlers():
return bb.compat.OrderedDict()
# Internal
_handlers = clean_class_handlers()
_handlers = {}
_ui_handlers = {}
_ui_logfilters = {}
_ui_handler_seq = 0
_event_handler_map = {}
_catchall_handlers = {}
_eventfilter = None
_uiready = False
_thread_lock = threading.Lock()
_thread_lock_enabled = False
if hasattr(__builtins__, '__setitem__'):
builtins = __builtins__
else:
builtins = __builtins__.__dict__
def enable_threadlock():
global _thread_lock_enabled
_thread_lock_enabled = True
def disable_threadlock():
global _thread_lock_enabled
_thread_lock_enabled = False
# For compatibility
bb.utils._context["NotHandled"] = NotHandled
bb.utils._context["Handled"] = Handled
def execute_handler(name, handler, event, d):
event.data = d
addedd = False
if 'd' not in builtins:
builtins['d'] = d
addedd = True
try:
ret = handler(event)
except (bb.parse.SkipRecipe, bb.BBHandledException):
except bb.parse.SkipPackage:
raise
except Exception:
etype, value, tb = sys.exc_info()
@ -117,21 +78,20 @@ def execute_handler(name, handler, event, d):
raise
finally:
del event.data
if addedd:
del builtins['d']
if ret is not None:
warnings.warn("Using Handled/NotHandled in event handlers is deprecated",
DeprecationWarning, stacklevel = 2)
def fire_class_handlers(event, d):
if isinstance(event, logging.LogRecord):
return
eid = str(event.__class__)[8:-2]
evt_hmap = _event_handler_map.get(eid, {})
for name, handler in list(_handlers.items()):
if name in _catchall_handlers or name in evt_hmap:
if _eventfilter:
if not _eventfilter(name, handler, event, d):
continue
for name, handler in _handlers.iteritems():
try:
execute_handler(name, handler, event, d)
except Exception:
continue
ui_queue = []
@atexit.register
@ -139,52 +99,25 @@ def print_ui_queue():
"""If we're exiting before a UI has been spawned, display any queued
LogRecords to the console."""
logger = logging.getLogger("BitBake")
if not _uiready:
if not _ui_handlers:
from bb.msg import BBLogFormatter
stdout = logging.StreamHandler(sys.stdout)
stderr = logging.StreamHandler(sys.stderr)
formatter = BBLogFormatter("%(levelname)s: %(message)s")
stdout.setFormatter(formatter)
stderr.setFormatter(formatter)
# First check to see if we have any proper messages
msgprint = False
for event in ui_queue[:]:
if isinstance(event, logging.LogRecord):
if event.levelno > logging.DEBUG:
if event.levelno >= logging.WARNING:
logger.addHandler(stderr)
else:
logger.addHandler(stdout)
logger.handle(event)
msgprint = True
if msgprint:
return
# Nope, so just print all of the messages we have (including debug messages)
logger.addHandler(stdout)
for event in ui_queue[:]:
console = logging.StreamHandler(sys.stdout)
console.setFormatter(BBLogFormatter("%(levelname)s: %(message)s"))
logger.handlers = [console]
for event in ui_queue:
if isinstance(event, logging.LogRecord):
logger.handle(event)
def fire_ui_handlers(event, d):
global _thread_lock
global _thread_lock_enabled
if not _uiready:
if not _ui_handlers:
# No UI handlers registered yet, queue up the messages
ui_queue.append(event)
return
if _thread_lock_enabled:
_thread_lock.acquire()
errors = []
for h in _ui_handlers:
#print "Sending event %s" % event
try:
if not _ui_logfilters[h].filter(event):
continue
# We use pickle here since it better handles object instances
# which xmlrpc's marshaller does not. Events *must* be serializable
# by pickle.
@ -197,9 +130,6 @@ def fire_ui_handlers(event, d):
for h in errors:
del _ui_handlers[h]
if _thread_lock_enabled:
_thread_lock.release()
def fire(event, d):
"""Fire off an Event"""
@ -209,16 +139,24 @@ def fire(event, d):
# don't have a datastore so the datastore context isn't a problem.
fire_class_handlers(event, d)
if worker_fire:
if worker_pid != 0:
worker_fire(event, d)
else:
fire_ui_handlers(event, d)
def worker_fire(event, d):
data = "<event>" + pickle.dumps(event) + "</event>"
worker_pipe.write(data)
def fire_from_worker(event, d):
if not event.startswith("<event>") or not event.endswith("</event>"):
print("Error, not an event %s" % event)
return
event = pickle.loads(event[7:-8])
fire_ui_handlers(event, d)
noop = lambda _: None
def register(name, handler, mask=None, filename=None, lineno=None):
def register(name, handler):
"""Register an Event handler"""
# already registered
@ -227,63 +165,31 @@ def register(name, handler, mask=None, filename=None, lineno=None):
if handler is not None:
# handle string containing python code
if isinstance(handler, str):
if isinstance(handler, basestring):
tmp = "def %s(e):\n%s" % (name, handler)
try:
code = bb.methodpool.compile_cache(tmp)
if not code:
if filename is None:
filename = "%s(e)" % name
code = compile(tmp, filename, "exec", ast.PyCF_ONLY_AST)
if lineno is not None:
ast.increment_lineno(code, lineno-1)
code = compile(code, filename, "exec")
bb.methodpool.compile_cache_add(tmp, code)
code = compile(tmp, "%s(e)" % name, "exec")
except SyntaxError:
logger.error("Unable to register event handler '%s':\n%s", name,
''.join(traceback.format_exc(limit=0)))
_handlers[name] = noop
return
env = {}
bb.utils.better_exec(code, env)
bb.utils.simple_exec(code, env)
func = bb.utils.better_eval(name, env)
_handlers[name] = func
else:
_handlers[name] = handler
if not mask or '*' in mask:
_catchall_handlers[name] = True
else:
for m in mask:
if _event_handler_map.get(m, None) is None:
_event_handler_map[m] = {}
_event_handler_map[m][name] = True
return Registered
def remove(name, handler):
"""Remove an Event handler"""
_handlers.pop(name)
def get_handlers():
return _handlers
def set_handlers(handlers):
global _handlers
_handlers = handlers
def set_eventfilter(func):
global _eventfilter
_eventfilter = func
def register_UIHhandler(handler, mainui=False):
if mainui:
global _uiready
_uiready = True
def register_UIHhandler(handler):
bb.event._ui_handler_seq = bb.event._ui_handler_seq + 1
_ui_handlers[_ui_handler_seq] = handler
level, debug_domains = bb.msg.constructLogOptions()
_ui_logfilters[_ui_handler_seq] = UIEventFilter(level, debug_domains)
return _ui_handler_seq
def unregister_UIHhandler(handlerNum):
@ -291,37 +197,6 @@ def unregister_UIHhandler(handlerNum):
del _ui_handlers[handlerNum]
return
# Class to allow filtering of events and specific filtering of LogRecords *before* we put them over the IPC
class UIEventFilter(object):
def __init__(self, level, debug_domains):
self.update(None, level, debug_domains)
def update(self, eventmask, level, debug_domains):
self.eventmask = eventmask
self.stdlevel = level
self.debug_domains = debug_domains
def filter(self, event):
if isinstance(event, logging.LogRecord):
if event.levelno >= self.stdlevel:
return True
if event.name in self.debug_domains and event.levelno >= self.debug_domains[event.name]:
return True
return False
eid = str(event.__class__)[8:-2]
if self.eventmask and eid not in self.eventmask:
return False
return True
def set_UIHmask(handlerNum, level, debug_domains, mask):
if not handlerNum in _ui_handlers:
return False
if '*' in mask:
_ui_logfilters[handlerNum].update(None, level, debug_domains)
else:
_ui_logfilters[handlerNum].update(mask, level, debug_domains)
return True
def getName(e):
"""Returns the name of a class or class instance"""
if getattr(e, "__name__", None) == None:
@ -329,27 +204,6 @@ def getName(e):
else:
return e.__name__
class OperationStarted(Event):
"""An operation has begun"""
def __init__(self, msg = "Operation Started"):
Event.__init__(self)
self.msg = msg
class OperationCompleted(Event):
"""An operation has completed"""
def __init__(self, total, msg = "Operation Completed"):
Event.__init__(self)
self.total = total
self.msg = msg
class OperationProgress(Event):
"""An operation is in progress"""
def __init__(self, current, total, msg = "Operation in Progress"):
Event.__init__(self)
self.current = current
self.total = total
self.msg = msg + ": %s/%s" % (current, total);
class ConfigParsed(Event):
"""Configuration Parsing Complete"""
@ -361,17 +215,6 @@ class RecipeEvent(Event):
class RecipePreFinalise(RecipeEvent):
""" Recipe Parsing Complete but not yet finialised"""
class RecipeTaskPreProcess(RecipeEvent):
"""
Recipe Tasks about to be finalised
The list of tasks should be final at this point and handlers
are only able to change interdependencies
"""
def __init__(self, fn, tasklist):
self.fn = fn
self.tasklist = tasklist
Event.__init__(self)
class RecipeParsed(RecipeEvent):
""" Recipe Parsing Complete """
@ -393,7 +236,7 @@ class StampUpdate(Event):
targets = property(getTargets)
class BuildBase(Event):
"""Base class for bitbake build events"""
"""Base class for bbmake run events"""
def __init__(self, n, p, failures = 0):
self._name = n
@ -431,64 +274,27 @@ class BuildBase(Event):
class BuildInit(BuildBase):
"""buildFile or buildTargets was invoked"""
def __init__(self, p=[]):
name = None
BuildBase.__init__(self, name, p)
class BuildStarted(BuildBase, OperationStarted):
"""Event when builds start"""
def __init__(self, n, p, failures = 0):
OperationStarted.__init__(self, "Building Started")
BuildBase.__init__(self, n, p, failures)
class BuildCompleted(BuildBase, OperationCompleted):
"""Event when builds have completed"""
def __init__(self, total, n, p, failures=0, interrupted=0):
if not failures:
OperationCompleted.__init__(self, total, "Building Succeeded")
else:
OperationCompleted.__init__(self, total, "Building Failed")
self._interrupted = interrupted
BuildBase.__init__(self, n, p, failures)
class BuildStarted(BuildBase):
"""bbmake build run started"""
class BuildCompleted(BuildBase):
"""bbmake build run completed"""
class DiskFull(Event):
"""Disk full case build aborted"""
def __init__(self, dev, type, freespace, mountpoint):
Event.__init__(self)
self._dev = dev
self._type = type
self._free = freespace
self._mountpoint = mountpoint
class DiskUsageSample:
def __init__(self, available_bytes, free_bytes, total_bytes):
# Number of bytes available to non-root processes.
self.available_bytes = available_bytes
# Number of bytes available to root processes.
self.free_bytes = free_bytes
# Total capacity of the volume.
self.total_bytes = total_bytes
class MonitorDiskEvent(Event):
"""If BB_DISKMON_DIRS is set, then this event gets triggered each time disk space is checked.
Provides information about devices that are getting monitored."""
def __init__(self, disk_usage):
Event.__init__(self)
# hash of device root path -> DiskUsageSample
self.disk_usage = disk_usage
class NoProvider(Event):
"""No Provider for an Event"""
def __init__(self, item, runtime=False, dependees=None, reasons=None, close_matches=None):
def __init__(self, item, runtime=False, dependees=None, reasons=[]):
Event.__init__(self)
self._item = item
self._runtime = runtime
self._dependees = dependees
self._reasons = reasons
self._close_matches = close_matches
def getItem(self):
return self._item
@ -523,16 +329,17 @@ class MultipleProviders(Event):
"""
return self._candidates
class ParseStarted(OperationStarted):
class ParseStarted(Event):
"""Recipe parsing for the runqueue has begun"""
def __init__(self, total):
OperationStarted.__init__(self, "Recipe parsing Started")
Event.__init__(self)
self.total = total
class ParseCompleted(OperationCompleted):
class ParseCompleted(Event):
"""Recipe parsing for the runqueue has completed"""
def __init__(self, cached, parsed, skipped, masked, virtuals, errors, total):
OperationCompleted.__init__(self, total, "Recipe parsing Completed")
Event.__init__(self)
self.cached = cached
self.parsed = parsed
self.skipped = skipped
@ -540,44 +347,33 @@ class ParseCompleted(OperationCompleted):
self.masked = masked
self.errors = errors
self.sofar = cached + parsed
class ParseProgress(OperationProgress):
"""Recipe parsing progress"""
def __init__(self, current, total):
OperationProgress.__init__(self, current, total, "Recipe parsing")
class CacheLoadStarted(OperationStarted):
"""Loading of the dependency cache has begun"""
def __init__(self, total):
OperationStarted.__init__(self, "Loading cache Started")
self.total = total
class CacheLoadProgress(OperationProgress):
"""Cache loading progress"""
def __init__(self, current, total):
OperationProgress.__init__(self, current, total, "Loading cache")
class ParseProgress(Event):
"""Recipe parsing progress"""
class CacheLoadCompleted(OperationCompleted):
def __init__(self, current):
self.current = current
class CacheLoadStarted(Event):
"""Loading of the dependency cache has begun"""
def __init__(self, total):
Event.__init__(self)
self.total = total
class CacheLoadProgress(Event):
"""Cache loading progress"""
def __init__(self, current):
Event.__init__(self)
self.current = current
class CacheLoadCompleted(Event):
"""Cache loading is complete"""
def __init__(self, total, num_entries):
OperationCompleted.__init__(self, total, "Loading cache Completed")
Event.__init__(self)
self.total = total
self.num_entries = num_entries
class TreeDataPreparationStarted(OperationStarted):
"""Tree data preparation started"""
def __init__(self):
OperationStarted.__init__(self, "Preparing tree data Started")
class TreeDataPreparationProgress(OperationProgress):
"""Tree data preparation is in progress"""
def __init__(self, current, total):
OperationProgress.__init__(self, current, total, "Preparing tree data")
class TreeDataPreparationCompleted(OperationCompleted):
"""Tree data preparation completed"""
def __init__(self, total):
OperationCompleted.__init__(self, total, "Preparing tree data Completed")
class DepTreeGenerated(Event):
"""
@ -596,16 +392,6 @@ class TargetsTreeGenerated(Event):
Event.__init__(self)
self._model = model
class ReachableStamps(Event):
"""
An event listing all stamps reachable after parsing
which the metadata may use to clean up stale data
"""
def __init__(self, stamps):
Event.__init__(self)
self.stamps = stamps
class FilesMatchingFound(Event):
"""
Event when a list of files matching the supplied pattern has
@ -616,14 +402,6 @@ class FilesMatchingFound(Event):
self._pattern = pattern
self._matches = matches
class CoreBaseFilesFound(Event):
"""
Event when a list of appropriate config files has been generated
"""
def __init__(self, paths):
Event.__init__(self)
self._paths = paths
class ConfigFilesFound(Event):
"""
Event when a list of appropriate config files has been generated
@ -666,15 +444,6 @@ class MsgFatal(MsgBase):
class MsgPlain(MsgBase):
"""General output"""
class LogExecTTY(Event):
"""Send event containing program to spawn on tty of the logger"""
def __init__(self, msg, prog, sleep_delay, retries):
Event.__init__(self)
self.msg = msg
self.prog = prog
self.sleep_delay = sleep_delay
self.retries = retries
class LogHandler(logging.Handler):
"""Dispatch logging messages as bitbake events"""
@ -683,104 +452,10 @@ class LogHandler(logging.Handler):
etype, value, tb = record.exc_info
if hasattr(tb, 'tb_next'):
tb = list(bb.exceptions.extract_traceback(tb, context=3))
# Need to turn the value into something the logging system can pickle
record.bb_exc_info = (etype, value, tb)
record.bb_exc_formatted = bb.exceptions.format_exception(etype, value, tb, limit=5)
value = str(value)
record.exc_info = None
fire(record, None)
def filter(self, record):
record.taskpid = worker_pid
return True
class RequestPackageInfo(Event):
"""
Event to request package information
"""
class PackageInfo(Event):
"""
Package information for GUI
"""
def __init__(self, pkginfolist):
Event.__init__(self)
self._pkginfolist = pkginfolist
class MetadataEvent(Event):
"""
Generic event that target for OE-Core classes
to report information during asynchrous execution
"""
def __init__(self, eventtype, eventdata):
Event.__init__(self)
self.type = eventtype
self._localdata = eventdata
class ProcessStarted(Event):
"""
Generic process started event (usually part of the initial startup)
where further progress events will be delivered
"""
def __init__(self, processname, total):
Event.__init__(self)
self.processname = processname
self.total = total
class ProcessProgress(Event):
"""
Generic process progress event (usually part of the initial startup)
"""
def __init__(self, processname, progress):
Event.__init__(self)
self.processname = processname
self.progress = progress
class ProcessFinished(Event):
"""
Generic process finished event (usually part of the initial startup)
"""
def __init__(self, processname):
Event.__init__(self)
self.processname = processname
class SanityCheck(Event):
"""
Event to run sanity checks, either raise errors or generate events as return status.
"""
def __init__(self, generateevents = True):
Event.__init__(self)
self.generateevents = generateevents
class SanityCheckPassed(Event):
"""
Event to indicate sanity check has passed
"""
class SanityCheckFailed(Event):
"""
Event to indicate sanity check has failed
"""
def __init__(self, msg, network_error=False):
Event.__init__(self)
self._msg = msg
self._network_error = network_error
class NetworkTest(Event):
"""
Event to run network connectivity tests, either raise errors or generate events as return status.
"""
def __init__(self, generateevents = True):
Event.__init__(self)
self.generateevents = generateevents
class NetworkTestPassed(Event):
"""
Event to indicate network test has passed
"""
class NetworkTestFailed(Event):
"""
Event to indicate network test has failed
"""

View File

@ -1,4 +1,4 @@
from __future__ import absolute_import
import inspect
import traceback
import bb.namedtuple_with_abc
@ -32,14 +32,7 @@ class TracebackEntry(namedtuple.abc):
def _get_frame_args(frame):
"""Get the formatted arguments and class (if available) for a frame"""
arginfo = inspect.getargvalues(frame)
try:
if not arginfo.args:
return '', None
# There have been reports from the field of python 2.6 which doesn't
# return a namedtuple here but simply a tuple so fallback gracefully if
# args isn't present.
except AttributeError:
if not arginfo.args:
return '', None
firstarg = arginfo.args[0]
@ -86,6 +79,6 @@ def format_exception(etype, value, tb, context=1, limit=None, formatter=None):
def to_string(exc):
if isinstance(exc, SystemExit):
if not isinstance(exc.code, str):
if not isinstance(exc.code, basestring):
return 'Exited with "%d"' % exc.code
return str(exc)

View File

@ -0,0 +1,832 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
from __future__ import absolute_import
from __future__ import print_function
import os, re
import logging
import bb
from bb import data
from bb import persist_data
from bb import utils
__version__ = "1"
logger = logging.getLogger("BitBake.Fetch")
class MalformedUrl(Exception):
"""Exception raised when encountering an invalid url"""
class FetchError(Exception):
"""Exception raised when a download fails"""
class NoMethodError(Exception):
"""Exception raised when there is no method to obtain a supplied url or set of urls"""
class MissingParameterError(Exception):
"""Exception raised when a fetch method is missing a critical parameter in the url"""
class ParameterError(Exception):
"""Exception raised when a url cannot be proccessed due to invalid parameters."""
class MD5SumError(Exception):
"""Exception raised when a MD5SUM of a file does not match the expected one"""
class InvalidSRCREV(Exception):
"""Exception raised when an invalid SRCREV is encountered"""
def decodeurl(url):
"""Decodes an URL into the tokens (scheme, network location, path,
user, password, parameters).
"""
m = re.compile('(?P<type>[^:]*)://((?P<user>.+)@)?(?P<location>[^;]+)(;(?P<parm>.*))?').match(url)
if not m:
raise MalformedUrl(url)
type = m.group('type')
location = m.group('location')
if not location:
raise MalformedUrl(url)
user = m.group('user')
parm = m.group('parm')
locidx = location.find('/')
if locidx != -1 and type.lower() != 'file':
host = location[:locidx]
path = location[locidx:]
else:
host = ""
path = location
if user:
m = re.compile('(?P<user>[^:]+)(:?(?P<pswd>.*))').match(user)
if m:
user = m.group('user')
pswd = m.group('pswd')
else:
user = ''
pswd = ''
p = {}
if parm:
for s in parm.split(';'):
s1, s2 = s.split('=')
p[s1] = s2
return (type, host, path, user, pswd, p)
def encodeurl(decoded):
"""Encodes a URL from tokens (scheme, network location, path,
user, password, parameters).
"""
(type, host, path, user, pswd, p) = decoded
if not type or not path:
raise MissingParameterError("Type or path url components missing when encoding %s" % decoded)
url = '%s://' % type
if user:
url += "%s" % user
if pswd:
url += ":%s" % pswd
url += "@"
if host:
url += "%s" % host
url += "%s" % path
if p:
for parm in p:
url += ";%s=%s" % (parm, p[parm])
return url
def uri_replace(uri, uri_find, uri_replace, d):
if not uri or not uri_find or not uri_replace:
logger.debug(1, "uri_replace: passed an undefined value, not replacing")
uri_decoded = list(decodeurl(uri))
uri_find_decoded = list(decodeurl(uri_find))
uri_replace_decoded = list(decodeurl(uri_replace))
result_decoded = ['', '', '', '', '', {}]
for i in uri_find_decoded:
loc = uri_find_decoded.index(i)
result_decoded[loc] = uri_decoded[loc]
if isinstance(i, basestring):
if (re.match(i, uri_decoded[loc])):
result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
if uri_find_decoded.index(i) == 2:
if d:
localfn = bb.fetch.localpath(uri, d)
if localfn:
result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(bb.fetch.localpath(uri, d)))
else:
return uri
return encodeurl(result_decoded)
methods = []
urldata_cache = {}
saved_headrevs = {}
def fetcher_init(d):
"""
Called to initialize the fetchers once the configuration data is known.
Calls before this must not hit the cache.
"""
# When to drop SCM head revisions controlled by user policy
srcrev_policy = bb.data.getVar('BB_SRCREV_POLICY', d, 1) or "clear"
if srcrev_policy == "cache":
logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
elif srcrev_policy == "clear":
logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
revs = persist_data.persist('BB_URI_HEADREVS', d)
try:
bb.fetch.saved_headrevs = revs.items()
except:
pass
revs.clear()
else:
raise FetchError("Invalid SRCREV cache policy of: %s" % srcrev_policy)
for m in methods:
if hasattr(m, "init"):
m.init(d)
def fetcher_compare_revisions(d):
"""
Compare the revisions in the persistant cache with current values and
return true/false on whether they've changed.
"""
data = persist_data.persist('BB_URI_HEADREVS', d).items()
data2 = bb.fetch.saved_headrevs
changed = False
for key in data:
if key not in data2 or data2[key] != data[key]:
logger.debug(1, "%s changed", key)
changed = True
return True
else:
logger.debug(2, "%s did not change", key)
return False
# Function call order is usually:
# 1. init
# 2. go
# 3. localpaths
# localpath can be called at any time
def init(urls, d, setup = True):
urldata = {}
fn = bb.data.getVar('FILE', d, 1)
if fn in urldata_cache:
urldata = urldata_cache[fn]
for url in urls:
if url not in urldata:
urldata[url] = FetchData(url, d)
if setup:
for url in urldata:
if not urldata[url].setup:
urldata[url].setup_localpath(d)
urldata_cache[fn] = urldata
return urldata
def mirror_from_string(data):
return [ i.split() for i in (data or "").replace('\\n','\n').split('\n') if i ]
def verify_checksum(u, ud, d):
"""
verify the MD5 and SHA256 checksum for downloaded src
return value:
- True: checksum matched
- False: checksum unmatched
if checksum is missing in recipes file, "BB_STRICT_CHECKSUM" decide the return value.
if BB_STRICT_CHECKSUM = "1" then return false as unmatched, otherwise return true as
matched
"""
if not ud.type in ["http", "https", "ftp", "ftps"]:
return
md5data = bb.utils.md5_file(ud.localpath)
sha256data = bb.utils.sha256_file(ud.localpath)
if (ud.md5_expected == None or ud.sha256_expected == None):
logger.warn('Missing SRC_URI checksum for %s, consider adding to the recipe:\n'
'SRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"',
ud.localpath, ud.md5_name, md5data,
ud.sha256_name, sha256data)
if bb.data.getVar("BB_STRICT_CHECKSUM", d, True) == "1":
raise FetchError("No checksum specified for %s." % u)
return
if (ud.md5_expected != md5data or ud.sha256_expected != sha256data):
logger.error('The checksums for "%s" did not match.\n'
' MD5: expected "%s", got "%s"\n'
' SHA256: expected "%s", got "%s"\n',
ud.localpath, ud.md5_expected, md5data,
ud.sha256_expected, sha256data)
raise FetchError("%s checksum mismatch." % u)
def go(d, urls = None):
"""
Fetch all urls
init must have previously been called
"""
if not urls:
urls = d.getVar("SRC_URI", 1).split()
urldata = init(urls, d, True)
for u in urls:
ud = urldata[u]
m = ud.method
localpath = ""
if not ud.localfile:
continue
lf = bb.utils.lockfile(ud.lockfile)
if m.try_premirror(u, ud, d):
# First try fetching uri, u, from PREMIRRORS
mirrors = mirror_from_string(bb.data.getVar('PREMIRRORS', d, True))
localpath = try_mirrors(d, u, mirrors, False, m.forcefetch(u, ud, d))
elif os.path.exists(ud.localfile):
localpath = ud.localfile
# Need to re-test forcefetch() which will return true if our copy is too old
if m.forcefetch(u, ud, d) or not localpath:
# Next try fetching from the original uri, u
try:
m.go(u, ud, d)
localpath = ud.localpath
except FetchError:
# Remove any incomplete file
bb.utils.remove(ud.localpath)
# Finally, try fetching uri, u, from MIRRORS
mirrors = mirror_from_string(bb.data.getVar('MIRRORS', d, True))
localpath = try_mirrors (d, u, mirrors)
if not localpath or not os.path.exists(localpath):
raise FetchError("Unable to fetch URL %s from any source." % u)
ud.localpath = localpath
if os.path.exists(ud.md5):
# Touch the md5 file to show active use of the download
try:
os.utime(ud.md5, None)
except:
# Errors aren't fatal here
pass
else:
# Only check the checksums if we've not seen this item before
verify_checksum(u, ud, d)
Fetch.write_md5sum(u, ud, d)
bb.utils.unlockfile(lf)
def checkstatus(d, urls = None):
"""
Check all urls exist upstream
init must have previously been called
"""
urldata = init([], d, True)
if not urls:
urls = urldata
for u in urls:
ud = urldata[u]
m = ud.method
logger.debug(1, "Testing URL %s", u)
# First try checking uri, u, from PREMIRRORS
mirrors = mirror_from_string(bb.data.getVar('PREMIRRORS', d, True))
ret = try_mirrors(d, u, mirrors, True)
if not ret:
# Next try checking from the original uri, u
try:
ret = m.checkstatus(u, ud, d)
except:
# Finally, try checking uri, u, from MIRRORS
mirrors = mirror_from_string(bb.data.getVar('MIRRORS', d, True))
ret = try_mirrors (d, u, mirrors, True)
if not ret:
raise FetchError("URL %s doesn't work" % u)
def localpaths(d):
"""
Return a list of the local filenames, assuming successful fetch
"""
local = []
urldata = init([], d, True)
for u in urldata:
ud = urldata[u]
local.append(ud.localpath)
return local
srcrev_internal_call = False
def get_autorev(d):
return get_srcrev(d)
def get_srcrev(d):
"""
Return the version string for the current package
(usually to be used as PV)
Most packages usually only have one SCM so we just pass on the call.
In the multi SCM case, we build a value based on SRCREV_FORMAT which must
have been set.
"""
#
# Ugly code alert. localpath in the fetchers will try to evaluate SRCREV which
# could translate into a call to here. If it does, we need to catch this
# and provide some way so it knows get_srcrev is active instead of being
# some number etc. hence the srcrev_internal_call tracking and the magic
# "SRCREVINACTION" return value.
#
# Neater solutions welcome!
#
if bb.fetch.srcrev_internal_call:
return "SRCREVINACTION"
scms = []
# Only call setup_localpath on URIs which supports_srcrev()
urldata = init(bb.data.getVar('SRC_URI', d, 1).split(), d, False)
for u in urldata:
ud = urldata[u]
if ud.method.supports_srcrev():
if not ud.setup:
ud.setup_localpath(d)
scms.append(u)
if len(scms) == 0:
logger.error("SRCREV was used yet no valid SCM was found in SRC_URI")
raise ParameterError
if bb.data.getVar('BB_SRCREV_POLICY', d, True) != "cache":
bb.data.setVar('__BB_DONT_CACHE', '1', d)
if len(scms) == 1:
return urldata[scms[0]].method.sortable_revision(scms[0], urldata[scms[0]], d)
#
# Mutiple SCMs are in SRC_URI so we resort to SRCREV_FORMAT
#
format = bb.data.getVar('SRCREV_FORMAT', d, 1)
if not format:
logger.error("The SRCREV_FORMAT variable must be set when multiple SCMs are used.")
raise ParameterError
for scm in scms:
if 'name' in urldata[scm].parm:
name = urldata[scm].parm["name"]
rev = urldata[scm].method.sortable_revision(scm, urldata[scm], d)
format = format.replace(name, rev)
return format
def localpath(url, d, cache = True):
"""
Called from the parser with cache=False since the cache isn't ready
at this point. Also called from classed in OE e.g. patch.bbclass
"""
ud = init([url], d)
if ud[url].method:
return ud[url].localpath
return url
def runfetchcmd(cmd, d, quiet = False):
"""
Run cmd returning the command output
Raise an error if interrupted or cmd fails
Optionally echo command output to stdout
"""
# Need to export PATH as binary could be in metadata paths
# rather than host provided
# Also include some other variables.
# FIXME: Should really include all export varaiables?
exportvars = ['PATH', 'GIT_PROXY_COMMAND', 'GIT_PROXY_HOST',
'GIT_PROXY_PORT', 'GIT_CONFIG', 'http_proxy', 'ftp_proxy',
'https_proxy', 'no_proxy', 'ALL_PROXY', 'all_proxy',
'KRB5CCNAME', 'SSH_AUTH_SOCK', 'SSH_AGENT_PID', 'HOME']
for var in exportvars:
val = data.getVar(var, d, True)
if val:
cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
logger.debug(1, "Running %s", cmd)
# redirect stderr to stdout
stdout_handle = os.popen(cmd + " 2>&1", "r")
output = ""
while True:
line = stdout_handle.readline()
if not line:
break
if not quiet:
print(line, end=' ')
output += line
status = stdout_handle.close() or 0
signal = status >> 8
exitstatus = status & 0xff
if signal:
raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (cmd, signal, output))
elif status != 0:
raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, status, output))
return output
def try_mirrors(d, uri, mirrors, check = False, force = False):
"""
Try to use a mirrored version of the sources.
This method will be automatically called before the fetchers go.
d Is a bb.data instance
uri is the original uri we're trying to download
mirrors is the list of mirrors we're going to try
"""
fpath = os.path.join(data.getVar("DL_DIR", d, 1), os.path.basename(uri))
if not check and os.access(fpath, os.R_OK) and not force:
logger.debug(1, "%s already exists, skipping checkout.", fpath)
return fpath
ld = d.createCopy()
for (find, replace) in mirrors:
newuri = uri_replace(uri, find, replace, ld)
if newuri != uri:
try:
ud = FetchData(newuri, ld)
except bb.fetch.NoMethodError:
logger.debug(1, "No method for %s", uri)
continue
ud.setup_localpath(ld)
try:
if check:
found = ud.method.checkstatus(newuri, ud, ld)
if found:
return found
else:
ud.method.go(newuri, ud, ld)
return ud.localpath
except (bb.fetch.MissingParameterError,
bb.fetch.FetchError,
bb.fetch.MD5SumError):
import sys
(type, value, traceback) = sys.exc_info()
logger.debug(2, "Mirror fetch failure: %s", value)
bb.utils.remove(ud.localpath)
continue
return None
class FetchData(object):
"""
A class which represents the fetcher state for a given URI.
"""
def __init__(self, url, d):
self.localfile = ""
(self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(data.expand(url, d))
self.date = Fetch.getSRCDate(self, d)
self.url = url
if not self.user and "user" in self.parm:
self.user = self.parm["user"]
if not self.pswd and "pswd" in self.parm:
self.pswd = self.parm["pswd"]
self.setup = False
if "name" in self.parm:
self.md5_name = "%s.md5sum" % self.parm["name"]
self.sha256_name = "%s.sha256sum" % self.parm["name"]
else:
self.md5_name = "md5sum"
self.sha256_name = "sha256sum"
self.md5_expected = bb.data.getVarFlag("SRC_URI", self.md5_name, d)
self.sha256_expected = bb.data.getVarFlag("SRC_URI", self.sha256_name, d)
for m in methods:
if m.supports(url, self, d):
self.method = m
return
raise NoMethodError("Missing implementation for url %s" % url)
def setup_localpath(self, d):
self.setup = True
if "localpath" in self.parm:
# if user sets localpath for file, use it instead.
self.localpath = self.parm["localpath"]
self.basename = os.path.basename(self.localpath)
else:
premirrors = bb.data.getVar('PREMIRRORS', d, True)
local = ""
if premirrors and self.url:
aurl = self.url.split(";")[0]
mirrors = mirror_from_string(premirrors)
for (find, replace) in mirrors:
if replace.startswith("file://"):
path = aurl.split("://")[1]
path = path.split(";")[0]
local = replace.split("://")[1] + os.path.basename(path)
if local == aurl or not os.path.exists(local) or os.path.isdir(local):
local = ""
self.localpath = local
if not local:
try:
bb.fetch.srcrev_internal_call = True
self.localpath = self.method.localpath(self.url, self, d)
finally:
bb.fetch.srcrev_internal_call = False
# We have to clear data's internal caches since the cached value of SRCREV is now wrong.
# Horrible...
bb.data.delVar("ISHOULDNEVEREXIST", d)
if self.localpath is not None:
# Note: These files should always be in DL_DIR whereas localpath may not be.
basepath = bb.data.expand("${DL_DIR}/%s" % os.path.basename(self.localpath), d)
self.md5 = basepath + '.md5'
self.lockfile = basepath + '.lock'
class Fetch(object):
"""Base class for 'fetch'ing data"""
def __init__(self, urls = []):
self.urls = []
def supports(self, url, urldata, d):
"""
Check to see if this fetch class supports a given url.
"""
return 0
def localpath(self, url, urldata, d):
"""
Return the local filename of a given url assuming a successful fetch.
Can also setup variables in urldata for use in go (saving code duplication
and duplicate code execution)
"""
return url
def _strip_leading_slashes(self, relpath):
"""
Remove leading slash as os.path.join can't cope
"""
while os.path.isabs(relpath):
relpath = relpath[1:]
return relpath
def setUrls(self, urls):
self.__urls = urls
def getUrls(self):
return self.__urls
urls = property(getUrls, setUrls, None, "Urls property")
def forcefetch(self, url, urldata, d):
"""
Force a fetch, even if localpath exists?
"""
return False
def supports_srcrev(self):
"""
The fetcher supports auto source revisions (SRCREV)
"""
return False
def go(self, url, urldata, d):
"""
Fetch urls
Assumes localpath was called first
"""
raise NoMethodError("Missing implementation for url")
def try_premirror(self, url, urldata, d):
"""
Should premirrors be used?
"""
if urldata.method.forcefetch(url, urldata, d):
return True
elif os.path.exists(urldata.md5) and os.path.exists(urldata.localfile):
return False
else:
return True
def checkstatus(self, url, urldata, d):
"""
Check the status of a URL
Assumes localpath was called first
"""
logger.info("URL %s could not be checked for status since no method exists.", url)
return True
def getSRCDate(urldata, d):
"""
Return the SRC Date for the component
d the bb.data module
"""
if "srcdate" in urldata.parm:
return urldata.parm['srcdate']
pn = data.getVar("PN", d, 1)
if pn:
return data.getVar("SRCDATE_%s" % pn, d, 1) or data.getVar("CVSDATE_%s" % pn, d, 1) or data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
getSRCDate = staticmethod(getSRCDate)
def srcrev_internal_helper(ud, d):
"""
Return:
a) a source revision if specified
b) True if auto srcrev is in action
c) False otherwise
"""
if 'rev' in ud.parm:
return ud.parm['rev']
if 'tag' in ud.parm:
return ud.parm['tag']
rev = None
if 'name' in ud.parm:
pn = data.getVar("PN", d, 1)
rev = data.getVar("SRCREV_%s_pn-%s" % (ud.parm['name'], pn), d, 1)
if not rev:
rev = data.getVar("SRCREV_pn-%s_%s" % (pn, ud.parm['name']), d, 1)
if not rev:
rev = data.getVar("SRCREV_%s" % (ud.parm['name']), d, 1)
if not rev:
rev = data.getVar("SRCREV", d, 1)
if rev == "INVALID":
raise InvalidSRCREV("Please set SRCREV to a valid value")
if not rev:
return False
if rev == "SRCREVINACTION":
return True
return rev
srcrev_internal_helper = staticmethod(srcrev_internal_helper)
def localcount_internal_helper(ud, d):
"""
Return:
a) a locked localcount if specified
b) None otherwise
"""
localcount = None
if 'name' in ud.parm:
pn = data.getVar("PN", d, 1)
localcount = data.getVar("LOCALCOUNT_" + ud.parm['name'], d, 1)
if not localcount:
localcount = data.getVar("LOCALCOUNT", d, 1)
return localcount
localcount_internal_helper = staticmethod(localcount_internal_helper)
def verify_md5sum(ud, got_sum):
"""
Verify the md5sum we wanted with the one we got
"""
wanted_sum = ud.parm.get('md5sum')
if not wanted_sum:
return True
return wanted_sum == got_sum
verify_md5sum = staticmethod(verify_md5sum)
def write_md5sum(url, ud, d):
md5data = bb.utils.md5_file(ud.localpath)
# verify the md5sum
if not Fetch.verify_md5sum(ud, md5data):
raise MD5SumError(url)
md5out = file(ud.md5, 'w')
md5out.write(md5data)
md5out.close()
write_md5sum = staticmethod(write_md5sum)
def latest_revision(self, url, ud, d):
"""
Look in the cache for the latest revision, if not present ask the SCM.
"""
if not hasattr(self, "_latest_revision"):
raise ParameterError
revs = persist_data.persist('BB_URI_HEADREVS', d)
key = self.generate_revision_key(url, ud, d)
try:
return revs[key]
except KeyError:
revs[key] = rev = self._latest_revision(url, ud, d)
return rev
def sortable_revision(self, url, ud, d):
"""
"""
if hasattr(self, "_sortable_revision"):
return self._sortable_revision(url, ud, d)
localcounts = persist_data.persist('BB_URI_LOCALCOUNT', d)
key = self.generate_revision_key(url, ud, d)
latest_rev = self._build_revision(url, ud, d)
last_rev = localcounts.get(key + '_rev')
uselocalcount = bb.data.getVar("BB_LOCALCOUNT_OVERRIDE", d, True) or False
count = None
if uselocalcount:
count = Fetch.localcount_internal_helper(ud, d)
if count is None:
count = localcounts.get(key + '_count')
if last_rev == latest_rev:
return str(count + "+" + latest_rev)
buildindex_provided = hasattr(self, "_sortable_buildindex")
if buildindex_provided:
count = self._sortable_buildindex(url, ud, d, latest_rev)
if count is None:
count = "0"
elif uselocalcount or buildindex_provided:
count = str(count)
else:
count = str(int(count) + 1)
localcounts[key + '_rev'] = latest_rev
localcounts[key + '_count'] = count
return str(count + "+" + latest_rev)
def generate_revision_key(self, url, ud, d):
key = self._revision_key(url, ud, d)
return "%s-%s" % (key, bb.data.getVar("PN", d, True) or "")
from . import cvs
from . import git
from . import local
from . import svn
from . import wget
from . import svk
from . import ssh
from . import perforce
from . import bzr
from . import hg
from . import osc
from . import repo
methods.append(local.Local())
methods.append(wget.Wget())
methods.append(svn.Svn())
methods.append(git.Git())
methods.append(cvs.Cvs())
methods.append(svk.Svk())
methods.append(ssh.SSH())
methods.append(perforce.Perforce())
methods.append(bzr.Bzr())
methods.append(hg.Hg())
methods.append(osc.Osc())
methods.append(repo.Repo())

148
bitbake/lib/bb/fetch/bzr.py Normal file
View File

@ -0,0 +1,148 @@
"""
BitBake 'Fetch' implementation for bzr.
"""
# Copyright (C) 2007 Ross Burton
# Copyright (C) 2007 Richard Purdie
#
# Classes for obtaining upstream sources for the
# BitBake build tools.
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import sys
import logging
import bb
from bb import data
from bb.fetch import Fetch, FetchError, runfetchcmd, logger
class Bzr(Fetch):
def supports(self, url, ud, d):
return ud.type in ['bzr']
def localpath (self, url, ud, d):
# Create paths to bzr checkouts
relpath = self._strip_leading_slashes(ud.path)
ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath)
revision = Fetch.srcrev_internal_helper(ud, d)
if revision is True:
ud.revision = self.latest_revision(url, ud, d)
elif revision:
ud.revision = revision
if not ud.revision:
ud.revision = self.latest_revision(url, ud, d)
ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def _buildbzrcommand(self, ud, d, command):
"""
Build up an bzr commandline based on ud
command is "fetch", "update", "revno"
"""
basecmd = data.expand('${FETCHCMD_bzr}', d)
proto = ud.parm.get('proto', 'http')
bzrroot = ud.host + ud.path
options = []
if command == "revno":
bzrcmd = "%s revno %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
else:
if ud.revision:
options.append("-r %s" % ud.revision)
if command == "fetch":
bzrcmd = "%s co %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
elif command == "update":
bzrcmd = "%s pull %s --overwrite" % (basecmd, " ".join(options))
else:
raise FetchError("Invalid bzr command %s" % command)
return bzrcmd
def go(self, loc, ud, d):
"""Fetch url"""
if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK):
bzrcmd = self._buildbzrcommand(ud, d, "update")
logger.debug(1, "BZR Update %s", loc)
os.chdir(os.path.join (ud.pkgdir, os.path.basename(ud.path)))
runfetchcmd(bzrcmd, d)
else:
bb.utils.remove(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir)), True)
bzrcmd = self._buildbzrcommand(ud, d, "fetch")
logger.debug(1, "BZR Checkout %s", loc)
bb.utils.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
logger.debug(1, "Running %s", bzrcmd)
runfetchcmd(bzrcmd, d)
os.chdir(ud.pkgdir)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude '.bzr' --exclude '.bzrtags'"
# tar them up to a defined filename
try:
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(ud.pkgdir)), d)
except:
t, v, tb = sys.exc_info()
try:
os.unlink(ud.localpath)
except OSError:
pass
raise t, v, tb
def supports_srcrev(self):
return True
def _revision_key(self, url, ud, d):
"""
Return a unique key for the url
"""
return "bzr:" + ud.pkgdir
def _latest_revision(self, url, ud, d):
"""
Return the latest upstream revision number
"""
logger.debug(2, "BZR fetcher hitting network for %s", url)
output = runfetchcmd(self._buildbzrcommand(ud, d, "revno"), d, True)
return output.strip()
def _sortable_revision(self, url, ud, d):
"""
Return a sortable revision number which in our case is the revision number
"""
return self._build_revision(url, ud, d)
def _build_revision(self, url, ud, d):
return ud.revision

172
bitbake/lib/bb/fetch/cvs.py Normal file
View File

@ -0,0 +1,172 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#Based on functions from the base bb module, Copyright 2003 Holger Schurig
#
import os
import logging
import bb
from bb import data
from bb.fetch import Fetch, FetchError, MissingParameterError, logger
class Cvs(Fetch):
"""
Class to fetch a module or modules from cvs repositories
"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with cvs.
"""
return ud.type in ['cvs']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("cvs method needs a 'module' parameter")
ud.module = ud.parm["module"]
ud.tag = ud.parm.get('tag', "")
# Override the default date in certain cases
if 'date' in ud.parm:
ud.date = ud.parm['date']
elif ud.tag:
ud.date = ""
norecurse = ''
if 'norecurse' in ud.parm:
norecurse = '_norecurse'
fullpath = ''
if 'fullpath' in ud.parm:
fullpath = '_fullpath'
ud.localfile = data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def forcefetch(self, url, ud, d):
if (ud.date == "now"):
return True
return False
def go(self, loc, ud, d):
method = ud.parm.get('method', 'pserver')
localdir = ud.parm.get('localdir', ud.module)
cvs_port = ud.parm.get('port', '')
cvs_rsh = None
if method == "ext":
if "rsh" in ud.parm:
cvs_rsh = ud.parm["rsh"]
if method == "dir":
cvsroot = ud.path
else:
cvsroot = ":" + method
cvsproxyhost = data.getVar('CVS_PROXY_HOST', d, True)
if cvsproxyhost:
cvsroot += ";proxy=" + cvsproxyhost
cvsproxyport = data.getVar('CVS_PROXY_PORT', d, True)
if cvsproxyport:
cvsroot += ";proxyport=" + cvsproxyport
cvsroot += ":" + ud.user
if ud.pswd:
cvsroot += ":" + ud.pswd
cvsroot += "@" + ud.host + ":" + cvs_port + ud.path
options = []
if 'norecurse' in ud.parm:
options.append("-l")
if ud.date:
# treat YYYYMMDDHHMM specially for CVS
if len(ud.date) == 12:
options.append("-D \"%s %s:%s UTC\"" % (ud.date[0:8], ud.date[8:10], ud.date[10:12]))
else:
options.append("-D \"%s UTC\"" % ud.date)
if ud.tag:
options.append("-r %s" % ud.tag)
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "cvs:%s" % data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
data.setVar('CVSROOT', cvsroot, localdata)
data.setVar('CVSCOOPTS', " ".join(options), localdata)
data.setVar('CVSMODULE', ud.module, localdata)
cvscmd = data.getVar('FETCHCOMMAND', localdata, 1)
cvsupdatecmd = data.getVar('UPDATECOMMAND', localdata, 1)
if cvs_rsh:
cvscmd = "CVS_RSH=\"%s\" %s" % (cvs_rsh, cvscmd)
cvsupdatecmd = "CVS_RSH=\"%s\" %s" % (cvs_rsh, cvsupdatecmd)
# create module directory
logger.debug(2, "Fetch: checking for module directory")
pkg = data.expand('${PN}', d)
pkgdir = os.path.join(data.expand('${CVSDIR}', localdata), pkg)
moddir = os.path.join(pkgdir, localdir)
if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
logger.info("Update " + loc)
# update sources there
os.chdir(moddir)
myret = os.system(cvsupdatecmd)
else:
logger.info("Fetch " + loc)
# check out sources there
bb.utils.mkdirhier(pkgdir)
os.chdir(pkgdir)
logger.debug(1, "Running %s", cvscmd)
myret = os.system(cvscmd)
if myret != 0 or not os.access(moddir, os.R_OK):
try:
os.rmdir(moddir)
except OSError:
pass
raise FetchError(ud.module)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude 'CVS'"
# tar them up to a defined filename
if 'fullpath' in ud.parm:
os.chdir(pkgdir)
myret = os.system("tar %s -czf %s %s" % (tar_flags, ud.localpath, localdir))
else:
os.chdir(moddir)
os.chdir('..')
myret = os.system("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(moddir)))
if myret != 0:
try:
os.unlink(ud.localpath)
except OSError:
pass
raise FetchError(ud.module)

339
bitbake/lib/bb/fetch/git.py Normal file
View File

@ -0,0 +1,339 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' git implementation
"""
#Copyright (C) 2005 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import bb
import bb.persist_data
from bb import data
from bb.fetch import Fetch
from bb.fetch import runfetchcmd
from bb.fetch import logger
class Git(Fetch):
"""Class to fetch a module or modules from git repositories"""
def init(self, d):
#
# Only enable _sortable revision if the key is set
#
if bb.data.getVar("BB_GIT_CLONE_FOR_SRCREV", d, True):
self._sortable_buildindex = self._sortable_buildindex_disabled
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with git.
"""
return ud.type in ['git']
def localpath(self, url, ud, d):
if 'protocol' in ud.parm:
ud.proto = ud.parm['protocol']
elif not ud.host:
ud.proto = 'file'
else:
ud.proto = "rsync"
ud.branch = ud.parm.get("branch", "master")
gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
ud.mirrortarball = 'git_%s.tar.gz' % (gitsrcname)
ud.clonedir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
tag = Fetch.srcrev_internal_helper(ud, d)
if tag is True:
ud.tag = self.latest_revision(url, ud, d)
elif tag:
ud.tag = tag
if not ud.tag or ud.tag == "master":
ud.tag = self.latest_revision(url, ud, d)
subdir = ud.parm.get("subpath", "")
if subdir != "":
if subdir.endswith("/"):
subdir = subdir[:-1]
subdirpath = os.path.join(ud.path, subdir);
else:
subdirpath = ud.path;
if 'fullclone' in ud.parm:
ud.localfile = ud.mirrortarball
else:
ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, subdirpath.replace('/', '.'), ud.tag), d)
ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
if 'noclone' in ud.parm:
ud.localfile = None
return None
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def forcefetch(self, url, ud, d):
if 'fullclone' in ud.parm:
return True
if 'noclone' in ud.parm:
return False
if os.path.exists(ud.localpath):
return False
if not self._contains_ref(ud.tag, d):
return True
return False
def try_premirror(self, u, ud, d):
if 'noclone' in ud.parm:
return False
if os.path.exists(ud.clonedir):
return False
if os.path.exists(ud.localpath):
return False
return True
def go(self, loc, ud, d):
"""Fetch url"""
if ud.user:
username = ud.user + '@'
else:
username = ""
repofile = os.path.join(data.getVar("DL_DIR", d, 1), ud.mirrortarball)
coname = '%s' % (ud.tag)
codir = os.path.join(ud.clonedir, coname)
# If we have no existing clone and no mirror tarball, try and obtain one
if not os.path.exists(ud.clonedir) and not os.path.exists(repofile):
try:
Fetch.try_mirrors(ud.mirrortarball)
except:
pass
# If the checkout doesn't exist and the mirror tarball does, extract it
if not os.path.exists(ud.clonedir) and os.path.exists(repofile):
bb.utils.mkdirhier(ud.clonedir)
os.chdir(ud.clonedir)
runfetchcmd("tar -xzf %s" % (repofile), d)
# If the repo still doesn't exist, fallback to cloning it
if not os.path.exists(ud.clonedir):
runfetchcmd("%s clone -n %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir), d)
os.chdir(ud.clonedir)
# Update the checkout if needed
if not self._contains_ref(ud.tag, d) or 'fullclone' in ud.parm:
# Remove all but the .git directory
runfetchcmd("rm * -Rf", d)
if 'fullclone' in ud.parm:
runfetchcmd("%s fetch --all" % (ud.basecmd), d)
else:
runfetchcmd("%s fetch %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.branch), d)
runfetchcmd("%s fetch --tags %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)
runfetchcmd("%s prune-packed" % ud.basecmd, d)
runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
# Generate a mirror tarball if needed
os.chdir(ud.clonedir)
mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True)
if mirror_tarballs != "0" or 'fullclone' in ud.parm:
logger.info("Creating tarball of git repository")
runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d)
if 'fullclone' in ud.parm:
return
if os.path.exists(codir):
bb.utils.prunedir(codir)
subdir = ud.parm.get("subpath", "")
if subdir != "":
if subdir.endswith("/"):
subdirbase = os.path.basename(subdir[:-1])
else:
subdirbase = os.path.basename(subdir)
else:
subdirbase = ""
if subdir != "":
readpathspec = ":%s" % (subdir)
codir = os.path.join(codir, "git")
coprefix = os.path.join(codir, subdirbase, "")
else:
readpathspec = ""
coprefix = os.path.join(codir, "git", "")
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
runfetchcmd("%s clone -n %s %s" % (ud.basecmd, ud.clonedir, coprefix), d)
os.chdir(coprefix)
runfetchcmd("%s checkout -q -f %s%s" % (ud.basecmd, ud.tag, readpathspec), d)
else:
bb.utils.mkdirhier(codir)
os.chdir(ud.clonedir)
runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), d)
runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, coprefix), d)
os.chdir(codir)
logger.info("Creating tarball of git checkout")
runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d)
os.chdir(ud.clonedir)
bb.utils.prunedir(codir)
def supports_srcrev(self):
return True
def _contains_ref(self, tag, d):
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
output = runfetchcmd("%s log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % (basecmd, tag), d, quiet=True)
return output.split()[0] != "0"
def _revision_key(self, url, ud, d, branch=False):
"""
Return a unique key for the url
"""
key = 'git:' + ud.host + ud.path.replace('/', '.')
if branch:
return key + ud.branch
else:
return key
def generate_revision_key(self, url, ud, d, branch=False):
key = self._revision_key(url, ud, d, branch)
return "%s-%s" % (key, bb.data.getVar("PN", d, True) or "")
def _latest_revision(self, url, ud, d):
"""
Compute the HEAD revision for the url
"""
if ud.user:
username = ud.user + '@'
else:
username = ""
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
cmd = "%s ls-remote %s://%s%s%s %s" % (basecmd, ud.proto, username, ud.host, ud.path, ud.branch)
output = runfetchcmd(cmd, d, True)
if not output:
raise bb.fetch.FetchError("Fetch command %s gave empty output\n" % (cmd))
return output.split()[0]
def latest_revision(self, url, ud, d):
"""
Look in the cache for the latest revision, if not present ask the SCM.
"""
revs = bb.persist_data.persist('BB_URI_HEADREVS', d)
key = self.generate_revision_key(url, ud, d, branch=True)
try:
return revs[key]
except KeyError:
# Compatibility with old key format, no branch included
oldkey = self.generate_revision_key(url, ud, d, branch=False)
try:
rev = revs[oldkey]
except KeyError:
rev = self._latest_revision(url, ud, d)
else:
del revs[oldkey]
revs[key] = rev
return rev
def sortable_revision(self, url, ud, d):
"""
"""
localcounts = bb.persist_data.persist('BB_URI_LOCALCOUNT', d)
key = self.generate_revision_key(url, ud, d, branch=True)
oldkey = self.generate_revision_key(url, ud, d, branch=False)
latest_rev = self._build_revision(url, ud, d)
last_rev = localcounts.get(key + '_rev')
if last_rev is None:
last_rev = localcounts.get(oldkey + '_rev')
if last_rev is not None:
del localcounts[oldkey + '_rev']
localcounts[key + '_rev'] = last_rev
uselocalcount = bb.data.getVar("BB_LOCALCOUNT_OVERRIDE", d, True) or False
count = None
if uselocalcount:
count = Fetch.localcount_internal_helper(ud, d)
if count is None:
count = localcounts.get(key + '_count')
if count is None:
count = localcounts.get(oldkey + '_count')
if count is not None:
del localcounts[oldkey + '_count']
localcounts[key + '_count'] = count
if last_rev == latest_rev:
return str(count + "+" + latest_rev)
buildindex_provided = hasattr(self, "_sortable_buildindex")
if buildindex_provided:
count = self._sortable_buildindex(url, ud, d, latest_rev)
if count is None:
count = "0"
elif uselocalcount or buildindex_provided:
count = str(count)
else:
count = str(int(count) + 1)
localcounts[key + '_rev'] = latest_rev
localcounts[key + '_count'] = count
return str(count + "+" + latest_rev)
def _build_revision(self, url, ud, d):
return ud.tag
def _sortable_buildindex_disabled(self, url, ud, d, rev):
"""
Return a suitable buildindex for the revision specified. This is done by counting revisions
using "git rev-list" which may or may not work in different circumstances.
"""
cwd = os.getcwd()
# Check if we have the rev already
if not os.path.exists(ud.clonedir):
print("no repo")
self.go(None, ud, d)
if not os.path.exists(ud.clonedir):
logger.error("GIT repository for %s doesn't exist in %s, cannot get sortable buildnumber, using old value", url, ud.clonedir)
return None
os.chdir(ud.clonedir)
if not self._contains_ref(rev, d):
self.go(None, ud, d)
output = runfetchcmd("%s rev-list %s -- 2> /dev/null | wc -l" % (ud.basecmd, rev), d, quiet=True)
os.chdir(cwd)
buildindex = "%s" % output.split()[0]
logger.debug(1, "GIT repository for %s in %s is returning %s revisions in rev-list before %s", url, ud.clonedir, buildindex, rev)
return buildindex

180
bitbake/lib/bb/fetch/hg.py Normal file
View File

@ -0,0 +1,180 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementation for mercurial DRCS (hg).
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2004 Marcin Juszkiewicz
# Copyright (C) 2007 Robert Schuster
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import sys
import logging
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
from bb.fetch import runfetchcmd
from bb.fetch import logger
class Hg(Fetch):
"""Class to fetch from mercurial repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with mercurial.
"""
return ud.type in ['hg']
def forcefetch(self, url, ud, d):
revTag = ud.parm.get('rev', 'tip')
return revTag == "tip"
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("hg method needs a 'module' parameter")
ud.module = ud.parm["module"]
# Create paths to mercurial checkouts
relpath = self._strip_leading_slashes(ud.path)
ud.pkgdir = os.path.join(data.expand('${HGDIR}', d), ud.host, relpath)
ud.moddir = os.path.join(ud.pkgdir, ud.module)
if 'rev' in ud.parm:
ud.revision = ud.parm['rev']
else:
tag = Fetch.srcrev_internal_helper(ud, d)
if tag is True:
ud.revision = self.latest_revision(url, ud, d)
elif tag:
ud.revision = tag
else:
ud.revision = self.latest_revision(url, ud, d)
ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def _buildhgcommand(self, ud, d, command):
"""
Build up an hg commandline based on ud
command is "fetch", "update", "info"
"""
basecmd = data.expand('${FETCHCMD_hg}', d)
proto = ud.parm.get('proto', 'http')
host = ud.host
if proto == "file":
host = "/"
ud.host = "localhost"
if not ud.user:
hgroot = host + ud.path
else:
hgroot = ud.user + "@" + host + ud.path
if command is "info":
return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module)
options = [];
if ud.revision:
options.append("-r %s" % ud.revision)
if command is "fetch":
cmd = "%s clone %s %s://%s/%s %s" % (basecmd, " ".join(options), proto, hgroot, ud.module, ud.module)
elif command is "pull":
# do not pass options list; limiting pull to rev causes the local
# repo not to contain it and immediately following "update" command
# will crash
cmd = "%s pull" % (basecmd)
elif command is "update":
cmd = "%s update -C %s" % (basecmd, " ".join(options))
else:
raise FetchError("Invalid hg command %s" % command)
return cmd
def go(self, loc, ud, d):
"""Fetch url"""
logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK):
updatecmd = self._buildhgcommand(ud, d, "pull")
logger.info("Update " + loc)
# update sources there
os.chdir(ud.moddir)
logger.debug(1, "Running %s", updatecmd)
runfetchcmd(updatecmd, d)
else:
fetchcmd = self._buildhgcommand(ud, d, "fetch")
logger.info("Fetch " + loc)
# check out sources there
bb.utils.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
logger.debug(1, "Running %s", fetchcmd)
runfetchcmd(fetchcmd, d)
# Even when we clone (fetch), we still need to update as hg's clone
# won't checkout the specified revision if its on a branch
updatecmd = self._buildhgcommand(ud, d, "update")
os.chdir(ud.moddir)
logger.debug(1, "Running %s", updatecmd)
runfetchcmd(updatecmd, d)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude '.hg' --exclude '.hgrags'"
os.chdir(ud.pkgdir)
try:
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, ud.module), d)
except:
t, v, tb = sys.exc_info()
try:
os.unlink(ud.localpath)
except OSError:
pass
raise t, v, tb
def supports_srcrev(self):
return True
def _latest_revision(self, url, ud, d):
"""
Compute tip revision for the url
"""
output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
return output.strip()
def _build_revision(self, url, ud, d):
return ud.revision
def _revision_key(self, url, ud, d):
"""
Return a unique key for the url
"""
return "hg:" + ud.moddir

View File

@ -0,0 +1,73 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import bb
import bb.utils
from bb import data
from bb.fetch import Fetch
class Local(Fetch):
def supports(self, url, urldata, d):
"""
Check to see if a given url represents a local fetch.
"""
return urldata.type in ['file']
def localpath(self, url, urldata, d):
"""
Return the local filename of a given url assuming a successful fetch.
"""
path = url.split("://")[1]
path = path.split(";")[0]
newpath = path
if path[0] != "/":
filespath = data.getVar('FILESPATH', d, 1)
if filespath:
newpath = bb.utils.which(filespath, path)
if not newpath:
filesdir = data.getVar('FILESDIR', d, 1)
if filesdir:
newpath = os.path.join(filesdir, path)
# We don't set localfile as for this fetcher the file is already local!
return newpath
def go(self, url, urldata, d):
"""Fetch urls (no-op for Local method)"""
# no need to fetch local files, we'll deal with them in place.
return 1
def checkstatus(self, url, urldata, d):
"""
Check the status of the url
"""
if urldata.localpath.find("*") != -1:
logger.info("URL %s looks like a glob and was therefore not checked.", url)
return True
if os.path.exists(urldata.localpath):
return True
return False

143
bitbake/lib/bb/fetch/osc.py Normal file
View File

@ -0,0 +1,143 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
Bitbake "Fetch" implementation for osc (Opensuse build service client).
Based on the svn "Fetch" implementation.
"""
import os
import sys
import logging
import bb
from bb import data
from bb import utils
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
from bb.fetch import runfetchcmd
class Osc(Fetch):
"""Class to fetch a module or modules from Opensuse build server
repositories."""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with osc.
"""
return ud.type in ['osc']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("osc method needs a 'module' parameter.")
ud.module = ud.parm["module"]
# Create paths to osc checkouts
relpath = self._strip_leading_slashes(ud.path)
ud.pkgdir = os.path.join(data.expand('${OSCDIR}', d), ud.host)
ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module)
if 'rev' in ud.parm:
ud.revision = ud.parm['rev']
else:
pv = data.getVar("PV", d, 0)
rev = Fetch.srcrev_internal_helper(ud, d)
if rev and rev != True:
ud.revision = rev
else:
ud.revision = ""
ud.localfile = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def _buildosccommand(self, ud, d, command):
"""
Build up an ocs commandline based on ud
command is "fetch", "update", "info"
"""
basecmd = data.expand('${FETCHCMD_osc}', d)
proto = ud.parm.get('proto', 'ocs')
options = []
config = "-c %s" % self.generate_config(ud, d)
if ud.revision:
options.append("-r %s" % ud.revision)
coroot = self._strip_leading_slashes(ud.path)
if command is "fetch":
osccmd = "%s %s co %s/%s %s" % (basecmd, config, coroot, ud.module, " ".join(options))
elif command is "update":
osccmd = "%s %s up %s" % (basecmd, config, " ".join(options))
else:
raise FetchError("Invalid osc command %s" % command)
return osccmd
def go(self, loc, ud, d):
"""
Fetch url
"""
logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(data.expand('${OSCDIR}', d), ud.path, ud.module), os.R_OK):
oscupdatecmd = self._buildosccommand(ud, d, "update")
logger.info("Update "+ loc)
# update sources there
os.chdir(ud.moddir)
logger.debug(1, "Running %s", oscupdatecmd)
runfetchcmd(oscupdatecmd, d)
else:
oscfetchcmd = self._buildosccommand(ud, d, "fetch")
logger.info("Fetch " + loc)
# check out sources there
bb.utils.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
logger.debug(1, "Running %s", oscfetchcmd)
runfetchcmd(oscfetchcmd, d)
os.chdir(os.path.join(ud.pkgdir + ud.path))
# tar them up to a defined filename
try:
runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d)
except:
t, v, tb = sys.exc_info()
try:
os.unlink(ud.localpath)
except OSError:
pass
raise t, v, tb
def supports_srcrev(self):
return False
def generate_config(self, ud, d):
"""
Generate a .oscrc to be used for this run.
"""
config_path = os.path.join(data.expand('${OSCDIR}', d), "oscrc")
bb.utils.remove(config_path)
f = open(config_path, 'w')
f.write("[general]\n")
f.write("apisrv = %s\n" % ud.host)
f.write("scheme = http\n")
f.write("su-wrapper = su -c\n")
f.write("build-root = %s\n" % data.expand('${WORKDIR}', d))
f.write("urllist = http://moblin-obs.jf.intel.com:8888/build/%(project)s/%(repository)s/%(buildarch)s/:full/%(name)s.rpm\n")
f.write("extra-pkgs = gzip\n")
f.write("\n")
f.write("[%s]\n" % ud.host)
f.write("user = %s\n" % ud.parm["user"])
f.write("pass = %s\n" % ud.parm["pswd"])
f.close()
return config_path

View File

@ -0,0 +1,206 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
from future_builtins import zip
import os
import logging
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import logger
class Perforce(Fetch):
def supports(self, url, ud, d):
return ud.type in ['p4']
def doparse(url, d):
parm = {}
path = url.split("://")[1]
delim = path.find("@");
if delim != -1:
(user, pswd, host, port) = path.split('@')[0].split(":")
path = path.split('@')[1]
else:
(host, port) = data.getVar('P4PORT', d).split(':')
user = ""
pswd = ""
if path.find(";") != -1:
keys=[]
values=[]
plist = path.split(';')
for item in plist:
if item.count('='):
(key, value) = item.split('=')
keys.append(key)
values.append(value)
parm = dict(zip(keys, values))
path = "//" + path.split(';')[0]
host += ":%s" % (port)
parm["cset"] = Perforce.getcset(d, path, host, user, pswd, parm)
return host, path, user, pswd, parm
doparse = staticmethod(doparse)
def getcset(d, depot, host, user, pswd, parm):
p4opt = ""
if "cset" in parm:
return parm["cset"];
if user:
p4opt += " -u %s" % (user)
if pswd:
p4opt += " -P %s" % (pswd)
if host:
p4opt += " -p %s" % (host)
p4date = data.getVar("P4DATE", d, 1)
if "revision" in parm:
depot += "#%s" % (parm["revision"])
elif "label" in parm:
depot += "@%s" % (parm["label"])
elif p4date:
depot += "@%s" % (p4date)
p4cmd = data.getVar('FETCHCOMMAND_p4', d, 1)
logger.debug(1, "Running %s%s changes -m 1 %s", p4cmd, p4opt, depot)
p4file = os.popen("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
cset = p4file.readline().strip()
logger.debug(1, "READ %s", cset)
if not cset:
return -1
return cset.split(' ')[1]
getcset = staticmethod(getcset)
def localpath(self, url, ud, d):
(host, path, user, pswd, parm) = Perforce.doparse(url, d)
# If a label is specified, we use that as our filename
if "label" in parm:
ud.localfile = "%s.tar.gz" % (parm["label"])
return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile)
base = path
which = path.find('/...')
if which != -1:
base = path[:which]
base = self._strip_leading_slashes(base)
cset = Perforce.getcset(d, path, host, user, pswd, parm)
ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d)
return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile)
def go(self, loc, ud, d):
"""
Fetch urls
"""
(host, depot, user, pswd, parm) = Perforce.doparse(loc, d)
if depot.find('/...') != -1:
path = depot[:depot.find('/...')]
else:
path = depot
module = parm.get('module', os.path.basename(path))
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "p4:%s" % data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
# Get the p4 command
p4opt = ""
if user:
p4opt += " -u %s" % (user)
if pswd:
p4opt += " -P %s" % (pswd)
if host:
p4opt += " -p %s" % (host)
p4cmd = data.getVar('FETCHCOMMAND', localdata, 1)
# create temp directory
logger.debug(2, "Fetch: creating temporary directory")
bb.utils.mkdirhier(data.expand('${WORKDIR}', localdata))
data.setVar('TMPBASE', data.expand('${WORKDIR}/oep4.XXXXXX', localdata), localdata)
tmppipe = os.popen(data.getVar('MKTEMPDIRCMD', localdata, 1) or "false")
tmpfile = tmppipe.readline().strip()
if not tmpfile:
logger.error("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.")
raise FetchError(module)
if "label" in parm:
depot = "%s@%s" % (depot, parm["label"])
else:
cset = Perforce.getcset(d, depot, host, user, pswd, parm)
depot = "%s@%s" % (depot, cset)
os.chdir(tmpfile)
logger.info("Fetch " + loc)
logger.info("%s%s files %s", p4cmd, p4opt, depot)
p4file = os.popen("%s%s files %s" % (p4cmd, p4opt, depot))
if not p4file:
logger.error("Fetch: unable to get the P4 files from %s", depot)
raise FetchError(module)
count = 0
for file in p4file:
list = file.split()
if list[2] == "delete":
continue
dest = list[0][len(path)+1:]
where = dest.find("#")
os.system("%s%s print -o %s/%s %s" % (p4cmd, p4opt, module, dest[:where], list[0]))
count = count + 1
if count == 0:
logger.error("Fetch: No files gathered from the P4 fetch")
raise FetchError(module)
myret = os.system("tar -czf %s %s" % (ud.localpath, module))
if myret != 0:
try:
os.unlink(ud.localpath)
except OSError:
pass
raise FetchError(module)
# cleanup
bb.utils.prunedir(tmpfile)

View File

@ -0,0 +1,98 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake "Fetch" repo (git) implementation
"""
# Copyright (C) 2009 Tom Rini <trini@embeddedalley.com>
#
# Based on git.py which is:
#Copyright (C) 2005 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import runfetchcmd
class Repo(Fetch):
"""Class to fetch a module or modules from repo (git) repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with repo.
"""
return ud.type in ["repo"]
def localpath(self, url, ud, d):
"""
We don"t care about the git rev of the manifests repository, but
we do care about the manifest to use. The default is "default".
We also care about the branch or tag to be used. The default is
"master".
"""
ud.proto = ud.parm.get('protocol', 'git')
ud.branch = ud.parm.get('branch', 'master')
ud.manifest = ud.parm.get('manifest', 'default.xml')
if not ud.manifest.endswith('.xml'):
ud.manifest += '.xml'
ud.localfile = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def go(self, loc, ud, d):
"""Fetch url"""
if os.access(os.path.join(data.getVar("DL_DIR", d, True), ud.localfile), os.R_OK):
logger.debug(1, "%s already exists (or was stashed). Skipping repo init / sync.", ud.localpath)
return
gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", "."))
repodir = data.getVar("REPODIR", d, True) or os.path.join(data.getVar("DL_DIR", d, True), "repo")
codir = os.path.join(repodir, gitsrcname, ud.manifest)
if ud.user:
username = ud.user + "@"
else:
username = ""
bb.utils.mkdirhier(os.path.join(codir, "repo"))
os.chdir(os.path.join(codir, "repo"))
if not os.path.exists(os.path.join(codir, "repo", ".repo")):
runfetchcmd("repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d)
runfetchcmd("repo sync", d)
os.chdir(codir)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude '.repo' --exclude '.git'"
# Create a cache
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.join(".", "*") ), d)
def supports_srcrev(self):
return False
def _build_revision(self, url, ud, d):
return ud.manifest
def _want_sortable_revision(self, url, ud, d):
return False

118
bitbake/lib/bb/fetch/ssh.py Normal file
View File

@ -0,0 +1,118 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
'''
BitBake 'Fetch' implementations
This implementation is for Secure Shell (SSH), and attempts to comply with the
IETF secsh internet draft:
http://tools.ietf.org/wg/secsh/draft-ietf-secsh-scp-sftp-ssh-uri/
Currently does not support the sftp parameters, as this uses scp
Also does not support the 'fingerprint' connection parameter.
'''
# Copyright (C) 2006 OpenedHand Ltd.
#
#
# Based in part on svk.py:
# Copyright (C) 2006 Holger Hans Peter Freyther
# Based on svn.py:
# Copyright (C) 2003, 2004 Chris Larson
# Based on functions from the base bb module:
# Copyright 2003 Holger Schurig
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, os
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
__pattern__ = re.compile(r'''
\s* # Skip leading whitespace
ssh:// # scheme
( # Optional username/password block
(?P<user>\S+) # username
(:(?P<pass>\S+))? # colon followed by the password (optional)
)?
(?P<cparam>(;[^;]+)*)? # connection parameters block (optional)
@
(?P<host>\S+?) # non-greedy match of the host
(:(?P<port>[0-9]+))? # colon followed by the port (optional)
/
(?P<path>[^;]+) # path on the remote system, may be absolute or relative,
# and may include the use of '~' to reference the remote home
# directory
(?P<sparam>(;[^;]+)*)? # parameters block (optional)
$
''', re.VERBOSE)
class SSH(Fetch):
'''Class to fetch a module or modules via Secure Shell'''
def supports(self, url, urldata, d):
return __pattern__.match(url) != None
def localpath(self, url, urldata, d):
m = __pattern__.match(url)
path = m.group('path')
host = m.group('host')
lpath = os.path.join(data.getVar('DL_DIR', d, True), host, os.path.basename(path))
return lpath
def go(self, url, urldata, d):
dldir = data.getVar('DL_DIR', d, 1)
m = __pattern__.match(url)
path = m.group('path')
host = m.group('host')
port = m.group('port')
user = m.group('user')
password = m.group('pass')
ldir = os.path.join(dldir, host)
lpath = os.path.join(ldir, os.path.basename(path))
if not os.path.exists(ldir):
os.makedirs(ldir)
if port:
port = '-P %s' % port
else:
port = ''
if user:
fr = user
if password:
fr += ':%s' % password
fr += '@%s' % host
else:
fr = host
fr += ':%s' % path
import commands
cmd = 'scp -B -r %s %s %s/' % (
port,
commands.mkarg(fr),
commands.mkarg(ldir)
)
(exitstatus, output) = commands.getstatusoutput(cmd)
if exitstatus != 0:
print(output)
raise FetchError('Unable to fetch %s' % url)

104
bitbake/lib/bb/fetch/svk.py Normal file
View File

@ -0,0 +1,104 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
This implementation is for svk. It is based on the svn implementation
"""
# Copyright (C) 2006 Holger Hans Peter Freyther
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import logging
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
from bb.fetch import logger
class Svk(Fetch):
"""Class to fetch a module or modules from svk repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with svk.
"""
return ud.type in ['svk']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("svk method needs a 'module' parameter")
else:
ud.module = ud.parm["module"]
ud.revision = ud.parm.get('rev', "")
ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def forcefetch(self, url, ud, d):
return ud.date == "now"
def go(self, loc, ud, d):
"""Fetch urls"""
svkroot = ud.host + ud.path
svkcmd = "svk co -r {%s} %s/%s" % (ud.date, svkroot, ud.module)
if ud.revision:
svkcmd = "svk co -r %s %s/%s" % (ud.revision, svkroot, ud.module)
# create temp directory
localdata = data.createCopy(d)
data.update_data(localdata)
logger.debug(2, "Fetch: creating temporary directory")
bb.utils.mkdirhier(data.expand('${WORKDIR}', localdata))
data.setVar('TMPBASE', data.expand('${WORKDIR}/oesvk.XXXXXX', localdata), localdata)
tmppipe = os.popen(data.getVar('MKTEMPDIRCMD', localdata, 1) or "false")
tmpfile = tmppipe.readline().strip()
if not tmpfile:
logger.error("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.")
raise FetchError(ud.module)
# check out sources there
os.chdir(tmpfile)
logger.info("Fetch " + loc)
logger.debug(1, "Running %s", svkcmd)
myret = os.system(svkcmd)
if myret != 0:
try:
os.rmdir(tmpfile)
except OSError:
pass
raise FetchError(ud.module)
os.chdir(os.path.join(tmpfile, os.path.dirname(ud.module)))
# tar them up to a defined filename
myret = os.system("tar -czf %s %s" % (ud.localpath, os.path.basename(ud.module)))
if myret != 0:
try:
os.unlink(ud.localpath)
except OSError:
pass
raise FetchError(ud.module)
# cleanup
bb.utils.prunedir(tmpfile)

204
bitbake/lib/bb/fetch/svn.py Normal file
View File

@ -0,0 +1,204 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementation for svn.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2004 Marcin Juszkiewicz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import sys
import logging
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import MissingParameterError
from bb.fetch import runfetchcmd
from bb.fetch import logger
class Svn(Fetch):
"""Class to fetch a module or modules from svn repositories"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with svn.
"""
return ud.type in ['svn']
def localpath(self, url, ud, d):
if not "module" in ud.parm:
raise MissingParameterError("svn method needs a 'module' parameter")
ud.module = ud.parm["module"]
# Create paths to svn checkouts
relpath = self._strip_leading_slashes(ud.path)
ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath)
ud.moddir = os.path.join(ud.pkgdir, ud.module)
if 'rev' in ud.parm:
ud.date = ""
ud.revision = ud.parm['rev']
elif 'date' in ud.date:
ud.date = ud.parm['date']
ud.revision = ""
else:
#
# ***Nasty hack***
# If DATE in unexpanded PV, use ud.date (which is set from SRCDATE)
# Should warn people to switch to SRCREV here
#
pv = data.getVar("PV", d, 0)
if "DATE" in pv:
ud.revision = ""
else:
rev = Fetch.srcrev_internal_helper(ud, d)
if rev is True:
ud.revision = self.latest_revision(url, ud, d)
ud.date = ""
elif rev:
ud.revision = rev
ud.date = ""
else:
ud.revision = ""
ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def _buildsvncommand(self, ud, d, command):
"""
Build up an svn commandline based on ud
command is "fetch", "update", "info"
"""
basecmd = data.expand('${FETCHCMD_svn}', d)
proto = ud.parm.get('proto', 'svn')
svn_rsh = None
if proto == "svn+ssh" and "rsh" in ud.parm:
svn_rsh = ud.parm["rsh"]
svnroot = ud.host + ud.path
# either use the revision, or SRCDATE in braces,
options = []
if ud.user:
options.append("--username %s" % ud.user)
if ud.pswd:
options.append("--password %s" % ud.pswd)
if command is "info":
svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module)
else:
suffix = ""
if ud.revision:
options.append("-r %s" % ud.revision)
suffix = "@%s" % (ud.revision)
elif ud.date:
options.append("-r {%s}" % ud.date)
if command is "fetch":
svncmd = "%s co %s %s://%s/%s%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module)
elif command is "update":
svncmd = "%s update %s" % (basecmd, " ".join(options))
else:
raise FetchError("Invalid svn command %s" % command)
if svn_rsh:
svncmd = "svn_RSH=\"%s\" %s" % (svn_rsh, svncmd)
return svncmd
def go(self, loc, ud, d):
"""Fetch url"""
logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(ud.moddir, '.svn'), os.R_OK):
svnupdatecmd = self._buildsvncommand(ud, d, "update")
logger.info("Update " + loc)
# update sources there
os.chdir(ud.moddir)
logger.debug(1, "Running %s", svnupdatecmd)
runfetchcmd(svnupdatecmd, d)
else:
svnfetchcmd = self._buildsvncommand(ud, d, "fetch")
logger.info("Fetch " + loc)
# check out sources there
bb.utils.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
logger.debug(1, "Running %s", svnfetchcmd)
runfetchcmd(svnfetchcmd, d)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude '.svn'"
os.chdir(ud.pkgdir)
# tar them up to a defined filename
try:
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, ud.module), d)
except:
t, v, tb = sys.exc_info()
try:
os.unlink(ud.localpath)
except OSError:
pass
raise t, v, tb
def supports_srcrev(self):
return True
def _revision_key(self, url, ud, d):
"""
Return a unique key for the url
"""
return "svn:" + ud.moddir
def _latest_revision(self, url, ud, d):
"""
Return the latest upstream revision number
"""
logger.debug(2, "SVN fetcher hitting network for %s", url)
output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "info"), d, True)
revision = None
for line in output.splitlines():
if "Last Changed Rev" in line:
revision = line.split(":")[1].strip()
return revision
def _sortable_revision(self, url, ud, d):
"""
Return a sortable revision number which in our case is the revision number
"""
return self._build_revision(url, ud, d)
def _build_revision(self, url, ud, d):
return ud.revision

View File

@ -0,0 +1,93 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import logging
import bb
import urllib
from bb import data
from bb.fetch import Fetch, FetchError, encodeurl, decodeurl, logger, runfetchcmd
class Wget(Fetch):
"""Class to fetch urls via 'wget'"""
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with wget.
"""
return ud.type in ['http', 'https', 'ftp']
def localpath(self, url, ud, d):
url = encodeurl([ud.type, ud.host, ud.path, ud.user, ud.pswd, {}])
ud.basename = os.path.basename(ud.path)
ud.localfile = data.expand(urllib.unquote(ud.basename), d)
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
def go(self, uri, ud, d, checkonly = False):
"""Fetch urls"""
def fetch_uri(uri, ud, d):
if checkonly:
fetchcmd = data.getVar("CHECKCOMMAND", d, 1)
elif os.path.exists(ud.localpath):
# file exists, but we didnt complete it.. trying again..
fetchcmd = data.getVar("RESUMECOMMAND", d, 1)
else:
fetchcmd = data.getVar("FETCHCOMMAND", d, 1)
uri = uri.split(";")[0]
uri_decoded = list(decodeurl(uri))
uri_type = uri_decoded[0]
uri_host = uri_decoded[1]
fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0])
fetchcmd = fetchcmd.replace("${FILE}", ud.basename)
logger.info("fetch " + uri)
logger.debug(2, "executing " + fetchcmd)
runfetchcmd(fetchcmd, d)
# Sanity check since wget can pretend it succeed when it didn't
# Also, this used to happen if sourceforge sent us to the mirror page
if not os.path.exists(ud.localpath) and not checkonly:
logger.debug(2, "The fetch command for %s returned success but %s doesn't exist?...", uri, ud.localpath)
return False
return True
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "wget:" + data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
if fetch_uri(uri, ud, localdata):
return True
raise FetchError(uri)
def checkstatus(self, uri, ud, d):
return self.go(uri, ud, d, True)

File diff suppressed because it is too large Load Diff

View File

@ -27,13 +27,14 @@ import os
import sys
import logging
import bb
from bb import data
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
from bb.fetch2 import runfetchcmd
from bb.fetch2 import logger
class Bzr(FetchMethod):
def supports(self, ud, d):
def supports(self, url, ud, d):
return ud.type in ['bzr']
def urldata_init(self, ud, d):
@ -42,14 +43,14 @@ class Bzr(FetchMethod):
"""
# Create paths to bzr checkouts
relpath = self._strip_leading_slashes(ud.path)
ud.pkgdir = os.path.join(d.expand('${BZRDIR}'), ud.host, relpath)
ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath)
ud.setup_revisions(d)
ud.setup_revisons(d)
if not ud.revision:
ud.revision = self.latest_revision(ud, d)
ud.revision = self.latest_revision(ud.url, ud, d)
ud.localfile = d.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision))
ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d)
def _buildbzrcommand(self, ud, d, command):
"""
@ -57,9 +58,9 @@ class Bzr(FetchMethod):
command is "fetch", "update", "revno"
"""
basecmd = d.expand('${FETCHCMD_bzr}')
basecmd = data.expand('${FETCHCMD_bzr}', d)
proto = ud.parm.get('protocol', 'http')
proto = ud.parm.get('proto', 'http')
bzrroot = ud.host + ud.path
@ -72,7 +73,7 @@ class Bzr(FetchMethod):
options.append("-r %s" % ud.revision)
if command == "fetch":
bzrcmd = "%s branch %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
bzrcmd = "%s co %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
elif command == "update":
bzrcmd = "%s pull %s --overwrite" % (basecmd, " ".join(options))
else:
@ -80,47 +81,50 @@ class Bzr(FetchMethod):
return bzrcmd
def download(self, ud, d):
def download(self, loc, ud, d):
"""Fetch url"""
if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK):
bzrcmd = self._buildbzrcommand(ud, d, "update")
logger.debug(1, "BZR Update %s", ud.url)
logger.debug(1, "BZR Update %s", loc)
bb.fetch2.check_network_access(d, bzrcmd, ud.url)
runfetchcmd(bzrcmd, d, workdir=os.path.join(ud.pkgdir, os.path.basename(ud.path)))
os.chdir(os.path.join (ud.pkgdir, os.path.basename(ud.path)))
runfetchcmd(bzrcmd, d)
else:
bb.utils.remove(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir)), True)
bzrcmd = self._buildbzrcommand(ud, d, "fetch")
bb.fetch2.check_network_access(d, bzrcmd, ud.url)
logger.debug(1, "BZR Checkout %s", ud.url)
logger.debug(1, "BZR Checkout %s", loc)
bb.utils.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
logger.debug(1, "Running %s", bzrcmd)
runfetchcmd(bzrcmd, d, workdir=ud.pkgdir)
runfetchcmd(bzrcmd, d)
os.chdir(ud.pkgdir)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude='.bzr' --exclude='.bzrtags'"
tar_flags = "--exclude '.bzr' --exclude '.bzrtags'"
# tar them up to a defined filename
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(ud.pkgdir)),
d, cleanup=[ud.localpath], workdir=ud.pkgdir)
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(ud.pkgdir)), d, cleanup = [ud.localpath])
def supports_srcrev(self):
return True
def _revision_key(self, ud, d, name):
def _revision_key(self, url, ud, d, name):
"""
Return a unique key for the url
"""
return "bzr:" + ud.pkgdir
def _latest_revision(self, ud, d, name):
def _latest_revision(self, url, ud, d, name):
"""
Return the latest upstream revision number
"""
logger.debug(2, "BZR fetcher hitting network for %s", ud.url)
logger.debug(2, "BZR fetcher hitting network for %s", url)
bb.fetch2.check_network_access(d, self._buildbzrcommand(ud, d, "revno"), ud.url)
@ -128,12 +132,12 @@ class Bzr(FetchMethod):
return output.strip()
def sortable_revision(self, ud, d, name):
def _sortable_revision(self, url, ud, d):
"""
Return a sortable revision number which in our case is the revision number
"""
return False, self._build_revision(ud, d)
return self._build_revision(url, ud, d)
def _build_revision(self, ud, d):
def _build_revision(self, url, ud, d):
return ud.revision

View File

@ -1,259 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' clearcase implementation
The clearcase fetcher is used to retrieve files from a ClearCase repository.
Usage in the recipe:
SRC_URI = "ccrc://cc.example.org/ccrc;vob=/example_vob;module=/example_module"
SRCREV = "EXAMPLE_CLEARCASE_TAG"
PV = "${@d.getVar("SRCREV", False).replace("/", "+")}"
The fetcher uses the rcleartool or cleartool remote client, depending on which one is available.
Supported SRC_URI options are:
- vob
(required) The name of the clearcase VOB (with prepending "/")
- module
The module in the selected VOB (with prepending "/")
The module and vob parameters are combined to create
the following load rule in the view config spec:
load <vob><module>
- proto
http or https
Related variables:
CCASE_CUSTOM_CONFIG_SPEC
Write a config spec to this variable in your recipe to use it instead
of the default config spec generated by this fetcher.
Please note that the SRCREV loses its functionality if you specify
this variable. SRCREV is still used to label the archive after a fetch,
but it doesn't define what's fetched.
User credentials:
cleartool:
The login of cleartool is handled by the system. No special steps needed.
rcleartool:
In order to use rcleartool with authenticated users an `rcleartool login` is
necessary before using the fetcher.
"""
# Copyright (C) 2014 Siemens AG
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
import os
import sys
import shutil
import bb
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
from bb.fetch2 import runfetchcmd
from bb.fetch2 import logger
class ClearCase(FetchMethod):
"""Class to fetch urls via 'clearcase'"""
def init(self, d):
pass
def supports(self, ud, d):
"""
Check to see if a given url can be fetched with Clearcase.
"""
return ud.type in ['ccrc']
def debug(self, msg):
logger.debug(1, "ClearCase: %s", msg)
def urldata_init(self, ud, d):
"""
init ClearCase specific variable within url data
"""
ud.proto = "https"
if 'protocol' in ud.parm:
ud.proto = ud.parm['protocol']
if not ud.proto in ('http', 'https'):
raise fetch2.ParameterError("Invalid protocol type", ud.url)
ud.vob = ''
if 'vob' in ud.parm:
ud.vob = ud.parm['vob']
else:
msg = ud.url+": vob must be defined so the fetcher knows what to get."
raise MissingParameterError('vob', msg)
if 'module' in ud.parm:
ud.module = ud.parm['module']
else:
ud.module = ""
ud.basecmd = d.getVar("FETCHCMD_ccrc") or "/usr/bin/env cleartool || rcleartool"
if d.getVar("SRCREV") == "INVALID":
raise FetchError("Set a valid SRCREV for the clearcase fetcher in your recipe, e.g. SRCREV = \"/main/LATEST\" or any other label of your choice.")
ud.label = d.getVar("SRCREV", False)
ud.customspec = d.getVar("CCASE_CUSTOM_CONFIG_SPEC")
ud.server = "%s://%s%s" % (ud.proto, ud.host, ud.path)
ud.identifier = "clearcase-%s%s-%s" % ( ud.vob.replace("/", ""),
ud.module.replace("/", "."),
ud.label.replace("/", "."))
ud.viewname = "%s-view%s" % (ud.identifier, d.getVar("DATETIME", d, True))
ud.csname = "%s-config-spec" % (ud.identifier)
ud.ccasedir = os.path.join(d.getVar("DL_DIR"), ud.type)
ud.viewdir = os.path.join(ud.ccasedir, ud.viewname)
ud.configspecfile = os.path.join(ud.ccasedir, ud.csname)
ud.localfile = "%s.tar.gz" % (ud.identifier)
self.debug("host = %s" % ud.host)
self.debug("path = %s" % ud.path)
self.debug("server = %s" % ud.server)
self.debug("proto = %s" % ud.proto)
self.debug("type = %s" % ud.type)
self.debug("vob = %s" % ud.vob)
self.debug("module = %s" % ud.module)
self.debug("basecmd = %s" % ud.basecmd)
self.debug("label = %s" % ud.label)
self.debug("ccasedir = %s" % ud.ccasedir)
self.debug("viewdir = %s" % ud.viewdir)
self.debug("viewname = %s" % ud.viewname)
self.debug("configspecfile = %s" % ud.configspecfile)
self.debug("localfile = %s" % ud.localfile)
ud.localfile = os.path.join(d.getVar("DL_DIR"), ud.localfile)
def _build_ccase_command(self, ud, command):
"""
Build up a commandline based on ud
command is: mkview, setcs, rmview
"""
options = []
if "rcleartool" in ud.basecmd:
options.append("-server %s" % ud.server)
basecmd = "%s %s" % (ud.basecmd, command)
if command is 'mkview':
if not "rcleartool" in ud.basecmd:
# Cleartool needs a -snapshot view
options.append("-snapshot")
options.append("-tag %s" % ud.viewname)
options.append(ud.viewdir)
elif command is 'rmview':
options.append("-force")
options.append("%s" % ud.viewdir)
elif command is 'setcs':
options.append("-overwrite")
options.append(ud.configspecfile)
else:
raise FetchError("Invalid ccase command %s" % command)
ccasecmd = "%s %s" % (basecmd, " ".join(options))
self.debug("ccasecmd = %s" % ccasecmd)
return ccasecmd
def _write_configspec(self, ud, d):
"""
Create config spec file (ud.configspecfile) for ccase view
"""
config_spec = ""
custom_config_spec = d.getVar("CCASE_CUSTOM_CONFIG_SPEC", d)
if custom_config_spec is not None:
for line in custom_config_spec.split("\\n"):
config_spec += line+"\n"
bb.warn("A custom config spec has been set, SRCREV is only relevant for the tarball name.")
else:
config_spec += "element * CHECKEDOUT\n"
config_spec += "element * %s\n" % ud.label
config_spec += "load %s%s\n" % (ud.vob, ud.module)
logger.info("Using config spec: \n%s" % config_spec)
with open(ud.configspecfile, 'w') as f:
f.write(config_spec)
def _remove_view(self, ud, d):
if os.path.exists(ud.viewdir):
cmd = self._build_ccase_command(ud, 'rmview');
logger.info("cleaning up [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname)
bb.fetch2.check_network_access(d, cmd, ud.url)
output = runfetchcmd(cmd, d, workdir=ud.ccasedir)
logger.info("rmview output: %s", output)
def need_update(self, ud, d):
if ("LATEST" in ud.label) or (ud.customspec and "LATEST" in ud.customspec):
ud.identifier += "-%s" % d.getVar("DATETIME",d, True)
return True
if os.path.exists(ud.localpath):
return False
return True
def supports_srcrev(self):
return True
def sortable_revision(self, ud, d, name):
return False, ud.identifier
def download(self, ud, d):
"""Fetch url"""
# Make a fresh view
bb.utils.mkdirhier(ud.ccasedir)
self._write_configspec(ud, d)
cmd = self._build_ccase_command(ud, 'mkview')
logger.info("creating view [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname)
bb.fetch2.check_network_access(d, cmd, ud.url)
try:
runfetchcmd(cmd, d)
except FetchError as e:
if "CRCLI2008E" in e.msg:
raise FetchError("%s\n%s\n" % (e.msg, "Call `rcleartool login` in your console to authenticate to the clearcase server before running bitbake."))
else:
raise e
# Set configspec: Setting the configspec effectively fetches the files as defined in the configspec
cmd = self._build_ccase_command(ud, 'setcs');
logger.info("fetching data [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname)
bb.fetch2.check_network_access(d, cmd, ud.url)
output = runfetchcmd(cmd, d, workdir=ud.viewdir)
logger.info("%s", output)
# Copy the configspec to the viewdir so we have it in our source tarball later
shutil.copyfile(ud.configspecfile, os.path.join(ud.viewdir, ud.csname))
# Clean clearcase meta-data before tar
runfetchcmd('tar -czf "%s" .' % (ud.localpath), d, cleanup = [ud.localpath])
# Clean up so we can create a new view next time
self.clean(ud, d);
def clean(self, ud, d):
self._remove_view(ud, d)
bb.utils.remove(ud.configspecfile)

View File

@ -29,6 +29,7 @@ BitBake build tools.
import os
import logging
import bb
from bb import data
from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger
from bb.fetch2 import runfetchcmd
@ -36,7 +37,7 @@ class Cvs(FetchMethod):
"""
Class to fetch a module or modules from cvs repositories
"""
def supports(self, ud, d):
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with cvs.
"""
@ -63,16 +64,16 @@ class Cvs(FetchMethod):
if 'fullpath' in ud.parm:
fullpath = '_fullpath'
ud.localfile = d.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath))
ud.localfile = data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d)
def need_update(self, ud, d):
def need_update(self, url, ud, d):
if (ud.date == "now"):
return True
if not os.path.exists(ud.localpath):
return True
return False
def download(self, ud, d):
def download(self, loc, ud, d):
method = ud.parm.get('method', 'pserver')
localdir = ud.parm.get('localdir', ud.module)
@ -87,10 +88,10 @@ class Cvs(FetchMethod):
cvsroot = ud.path
else:
cvsroot = ":" + method
cvsproxyhost = d.getVar('CVS_PROXY_HOST')
cvsproxyhost = data.getVar('CVS_PROXY_HOST', d, True)
if cvsproxyhost:
cvsroot += ";proxy=" + cvsproxyhost
cvsproxyport = d.getVar('CVS_PROXY_PORT')
cvsproxyport = data.getVar('CVS_PROXY_PORT', d, True)
if cvsproxyport:
cvsroot += ";proxyport=" + cvsproxyport
cvsroot += ":" + ud.user
@ -110,9 +111,15 @@ class Cvs(FetchMethod):
if ud.tag:
options.append("-r %s" % ud.tag)
cvsbasecmd = d.getVar("FETCHCMD_cvs")
cvscmd = cvsbasecmd + " '-d" + cvsroot + "' co " + " ".join(options) + " " + ud.module
cvsupdatecmd = cvsbasecmd + " '-d" + cvsroot + "' update -d -P " + " ".join(options)
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "cvs:%s" % data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
data.setVar('CVSROOT', cvsroot, localdata)
data.setVar('CVSCOOPTS', " ".join(options), localdata)
data.setVar('CVSMODULE', ud.module, localdata)
cvscmd = data.getVar('FETCHCOMMAND', localdata, True)
cvsupdatecmd = data.getVar('UPDATECOMMAND', localdata, True)
if cvs_rsh:
cvscmd = "CVS_RSH=\"%s\" %s" % (cvs_rsh, cvscmd)
@ -120,26 +127,25 @@ class Cvs(FetchMethod):
# create module directory
logger.debug(2, "Fetch: checking for module directory")
pkg = d.getVar('PN')
pkgdir = os.path.join(d.getVar('CVSDIR'), pkg)
pkg = data.expand('${PN}', d)
pkgdir = os.path.join(data.expand('${CVSDIR}', localdata), pkg)
moddir = os.path.join(pkgdir, localdir)
workdir = None
if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
logger.info("Update " + ud.url)
logger.info("Update " + loc)
bb.fetch2.check_network_access(d, cvsupdatecmd, ud.url)
# update sources there
workdir = moddir
os.chdir(moddir)
cmd = cvsupdatecmd
else:
logger.info("Fetch " + ud.url)
logger.info("Fetch " + loc)
# check out sources there
bb.utils.mkdirhier(pkgdir)
workdir = pkgdir
os.chdir(pkgdir)
logger.debug(1, "Running %s", cvscmd)
bb.fetch2.check_network_access(d, cvscmd, ud.url)
cmd = cvscmd
runfetchcmd(cmd, d, cleanup=[moddir], workdir=workdir)
runfetchcmd(cmd, d, cleanup = [moddir])
if not os.access(moddir, os.R_OK):
raise FetchError("Directory %s was not readable despite sucessful fetch?!" % moddir, ud.url)
@ -148,24 +154,27 @@ class Cvs(FetchMethod):
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude='CVS'"
tar_flags = "--exclude 'CVS'"
# tar them up to a defined filename
workdir = None
if 'fullpath' in ud.parm:
workdir = pkgdir
os.chdir(pkgdir)
cmd = "tar %s -czf %s %s" % (tar_flags, ud.localpath, localdir)
else:
workdir = os.path.dirname(os.path.realpath(moddir))
os.chdir(moddir)
os.chdir('..')
cmd = "tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(moddir))
runfetchcmd(cmd, d, cleanup=[ud.localpath], workdir=workdir)
runfetchcmd(cmd, d, cleanup = [ud.localpath])
def clean(self, ud, d):
""" Clean CVS Files and tarballs """
pkg = d.getVar('PN')
pkgdir = os.path.join(d.getVar("CVSDIR"), pkg)
pkg = data.expand('${PN}', d)
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "cvs:%s" % data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
pkgdir = os.path.join(data.expand('${CVSDIR}', localdata), pkg)
bb.utils.remove(pkgdir, True)
bb.utils.remove(ud.localpath)

View File

@ -11,8 +11,8 @@ Supported SRC_URI options are:
- branch
The git branch to retrieve from. The default is "master"
This option also supports multiple branch fetching, with branches
separated by commas. In multiple branches case, the name option
this option also support multiple branches fetching, branches
are seperated by comma. in multiple branches case, the name option
must have the same number of names to match the branches, which is
used to specify the SRC_REV for the branch
e.g:
@ -25,34 +25,19 @@ Supported SRC_URI options are:
- protocol
The method to use to access the repository. Common options are "git",
"http", "https", "file", "ssh" and "rsync". The default is "https".
"http", "file" and "rsync". The default is "git"
- rebaseable
rebaseable indicates that the upstream git repo may rebase in the future,
and current revision may disappear from upstream repo. This option will
remind fetcher to preserve local cache carefully for future use.
The default value is "0", set rebaseable=1 for rebaseable git repo.
reminder fetcher to preserve local cache carefully for future use.
The default value is "0", set rebaseable=1 for rebaseable git repo
- nocheckout
Don't checkout source code when unpacking. set this option for the recipe
who has its own routine to checkout code.
The default is "0", set nocheckout=1 if needed.
- bareclone
Create a bare clone of the source code and don't checkout the source code
when unpacking. Set this option for the recipe who has its own routine to
checkout code and tracking branch requirements.
The default is "0", set bareclone=1 if needed.
- nobranch
Don't check the SHA validation for branch. set this option for the recipe
referring to commit which is valid in tag instead of branch.
The default is "0", set nobranch=1 if needed.
- usehead
For local git:// urls to use the current branch HEAD as the revision for use with
AUTOREV. Implies nobranch.
"""
#Copyright (C) 2005 Richard Purdie
@ -70,71 +55,27 @@ Supported SRC_URI options are:
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import errno
import os
import re
import bb
import errno
import bb.progress
from bb import data
from bb.fetch2 import FetchMethod
from bb.fetch2 import runfetchcmd
from bb.fetch2 import logger
class GitProgressHandler(bb.progress.LineFilterProgressHandler):
"""Extract progress information from git output"""
def __init__(self, d):
self._buffer = ''
self._count = 0
super(GitProgressHandler, self).__init__(d)
# Send an initial progress event so the bar gets shown
self._fire_progress(-1)
def write(self, string):
self._buffer += string
stages = ['Counting objects', 'Compressing objects', 'Receiving objects', 'Resolving deltas']
stage_weights = [0.2, 0.05, 0.5, 0.25]
stagenum = 0
for i, stage in reversed(list(enumerate(stages))):
if stage in self._buffer:
stagenum = i
self._buffer = ''
break
self._status = stages[stagenum]
percs = re.findall(r'(\d+)%', string)
if percs:
progress = int(round((int(percs[-1]) * stage_weights[stagenum]) + (sum(stage_weights[:stagenum]) * 100)))
rates = re.findall(r'([\d.]+ [a-zA-Z]*/s+)', string)
if rates:
rate = rates[-1]
else:
rate = None
self.update(progress, rate)
else:
if stagenum == 0:
percs = re.findall(r': (\d+)', string)
if percs:
count = int(percs[-1])
if count > self._count:
self._count = count
self._fire_progress(-count)
super(GitProgressHandler, self).write(string)
class Git(FetchMethod):
"""Class to fetch a module or modules from git repositories"""
def init(self, d):
pass
def supports(self, ud, d):
#
# Only enable _sortable revision if the key is set
#
if bb.data.getVar("BB_GIT_CLONE_FOR_SRCREV", d, True):
self._sortable_buildindex = self._sortable_buildindex_disabled
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with git.
"""
return ud.type in ['git']
def supports_checksum(self, urldata):
return False
def urldata_init(self, ud, d):
"""
init git specific variable within url data
@ -145,7 +86,7 @@ class Git(FetchMethod):
elif not ud.host:
ud.proto = 'file'
else:
ud.proto = "https"
ud.proto = "git"
if not ud.proto in ('git', 'file', 'ssh', 'http', 'https', 'rsync'):
raise bb.fetch2.ParameterError("Invalid protocol type", ud.url)
@ -154,50 +95,27 @@ class Git(FetchMethod):
ud.rebaseable = ud.parm.get("rebaseable","0") == "1"
ud.nobranch = ud.parm.get("nobranch","0") == "1"
# usehead implies nobranch
ud.usehead = ud.parm.get("usehead","0") == "1"
if ud.usehead:
if ud.proto != "file":
raise bb.fetch2.ParameterError("The usehead option is only for use with local ('protocol=file') git repositories", ud.url)
ud.nobranch = 1
# bareclone implies nocheckout
ud.bareclone = ud.parm.get("bareclone","0") == "1"
if ud.bareclone:
ud.nocheckout = 1
ud.unresolvedrev = {}
branches = ud.parm.get("branch", "master").split(',')
if len(branches) != len(ud.names):
raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url)
ud.branches = {}
for pos, name in enumerate(ud.names):
branch = branches[pos]
for name in ud.names:
branch = branches[ud.names.index(name)]
ud.branches[name] = branch
ud.unresolvedrev[name] = branch
if ud.usehead:
ud.unresolvedrev['default'] = 'HEAD'
ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
ud.basecmd = d.getVar("FETCHCMD_git") or "git -c core.fsyncobjectfiles=0"
ud.write_tarballs = ((data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) or "0") != "0") or ud.rebaseable
ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0") != "0") or ud.rebaseable
ud.setup_revisions(d)
ud.setup_revisons(d)
for name in ud.names:
# Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
if ud.revisions[name]:
ud.unresolvedrev[name] = ud.revisions[name]
ud.revisions[name] = self.latest_revision(ud, d, name)
gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.'))
if gitsrcname.startswith('.'):
gitsrcname = gitsrcname[1:]
ud.branches[name] = ud.revisions[name]
ud.revisions[name] = self.latest_revision(ud.url, ud, d, name)
gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
# for rebaseable git repo, it is necessary to keep mirror tar ball
# per revision, so that even the revision disappears from the
# upstream repo in the future, the mirror will remain intact and still
@ -205,132 +123,111 @@ class Git(FetchMethod):
if ud.rebaseable:
for name in ud.names:
gitsrcname = gitsrcname + '_' + ud.revisions[name]
ud.mirrortarball = 'git2_%s.tar.gz' % gitsrcname
ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball)
gitdir = d.getVar("GITDIR") or (d.getVar("DL_DIR") + "/git2/")
ud.clonedir = os.path.join(gitdir, gitsrcname)
ud.mirrortarball = 'git2_%s.tar.gz' % (gitsrcname)
ud.fullmirror = os.path.join(data.getVar("DL_DIR", d, True), ud.mirrortarball)
ud.clonedir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
ud.localfile = ud.clonedir
def localpath(self, ud, d):
def localpath(self, url, ud, d):
return ud.clonedir
def need_update(self, ud, d):
def need_update(self, u, ud, d):
if not os.path.exists(ud.clonedir):
return True
os.chdir(ud.clonedir)
for name in ud.names:
if not self._contains_ref(ud, d, name, ud.clonedir):
if not self._contains_ref(ud.revisions[name], d):
return True
if ud.write_tarballs and not os.path.exists(ud.fullmirror):
return True
return False
def try_premirror(self, ud, d):
def try_premirror(self, u, ud, d):
# If we don't do this, updating an existing checkout with only premirrors
# is not possible
if d.getVar("BB_FETCH_PREMIRRORONLY") is not None:
if bb.data.getVar("BB_FETCH_PREMIRRORONLY", d, True) is not None:
return True
if os.path.exists(ud.clonedir):
return False
return True
def download(self, ud, d):
def download(self, loc, ud, d):
"""Fetch url"""
if ud.user:
username = ud.user + '@'
else:
username = ""
ud.repochanged = not os.path.exists(ud.fullmirror)
# If the checkout doesn't exist and the mirror tarball does, extract it
if not os.path.exists(ud.clonedir) and os.path.exists(ud.fullmirror):
bb.utils.mkdirhier(ud.clonedir)
runfetchcmd("tar -xzf %s" % ud.fullmirror, d, workdir=ud.clonedir)
os.chdir(ud.clonedir)
runfetchcmd("tar -xzf %s" % (ud.fullmirror), d)
repourl = self._get_repo_url(ud)
repourl = "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
# If the repo still doesn't exist, fallback to cloning it
if not os.path.exists(ud.clonedir):
# We do this since git will use a "-l" option automatically for local urls where possible
if repourl.startswith("file://"):
repourl = repourl[7:]
clone_cmd = "LANG=C %s clone --bare --mirror %s %s --progress" % (ud.basecmd, repourl, ud.clonedir)
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, clone_cmd, ud.url)
progresshandler = GitProgressHandler(d)
runfetchcmd(clone_cmd, d, log=progresshandler)
clone_cmd = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
bb.fetch2.check_network_access(d, clone_cmd)
runfetchcmd(clone_cmd, d)
os.chdir(ud.clonedir)
# Update the checkout if needed
needupdate = False
for name in ud.names:
if not self._contains_ref(ud, d, name, ud.clonedir):
if not self._contains_ref(ud.revisions[name], d):
needupdate = True
if needupdate:
try:
runfetchcmd("%s remote rm origin" % ud.basecmd, d, workdir=ud.clonedir)
runfetchcmd("%s remote prune origin" % ud.basecmd, d)
runfetchcmd("%s remote rm origin" % ud.basecmd, d)
except bb.fetch2.FetchError:
logger.debug(1, "No Origin")
runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d, workdir=ud.clonedir)
fetch_cmd = "LANG=C %s fetch -f --progress %s refs/*:refs/*" % (ud.basecmd, repourl)
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
progresshandler = GitProgressHandler(d)
runfetchcmd(fetch_cmd, d, log=progresshandler, workdir=ud.clonedir)
runfetchcmd("%s prune-packed" % ud.basecmd, d, workdir=ud.clonedir)
runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d, workdir=ud.clonedir)
try:
os.unlink(ud.fullmirror)
except OSError as exc:
if exc.errno != errno.ENOENT:
raise
for name in ud.names:
if not self._contains_ref(ud, d, name, ud.clonedir):
raise bb.fetch2.FetchError("Unable to find revision %s in branch %s even from upstream" % (ud.revisions[name], ud.branches[name]))
runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d)
fetch_cmd = "%s fetch -f --prune %s refs/*:refs/*" % (ud.basecmd, repourl)
bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
runfetchcmd(fetch_cmd, d)
runfetchcmd("%s prune-packed" % ud.basecmd, d)
runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
ud.repochanged = True
def build_mirror_data(self, ud, d):
def build_mirror_data(self, url, ud, d):
# Generate a mirror tarball if needed
if ud.write_tarballs and not os.path.exists(ud.fullmirror):
# it's possible that this symlink points to read-only filesystem with PREMIRROR
if os.path.islink(ud.fullmirror):
os.unlink(ud.fullmirror)
if ud.write_tarballs and (ud.repochanged or not os.path.exists(ud.fullmirror)):
os.chdir(ud.clonedir)
logger.info("Creating tarball of git repository")
runfetchcmd("tar -czf %s ." % ud.fullmirror, d, workdir=ud.clonedir)
runfetchcmd("touch %s.done" % ud.fullmirror, d)
runfetchcmd("tar -czf %s %s" % (ud.fullmirror, os.path.join(".") ), d)
def unpack(self, ud, destdir, d):
""" unpack the downloaded src to destdir"""
subdir = ud.parm.get("subpath", "")
if subdir != "":
readpathspec = ":%s" % subdir
def_destsuffix = "%s/" % os.path.basename(subdir.rstrip('/'))
readpathspec = ":%s" % (subdir)
def_destsuffix = "%s/" % os.path.basename(subdir)
else:
readpathspec = ""
def_destsuffix = "git/"
destsuffix = ud.parm.get("destsuffix", def_destsuffix)
destdir = ud.destdir = os.path.join(destdir, destsuffix)
destdir = os.path.join(destdir, destsuffix)
if os.path.exists(destdir):
bb.utils.prunedir(destdir)
cloneflags = "-s -n"
if ud.bareclone:
cloneflags += " --mirror"
runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, cloneflags, ud.clonedir, destdir), d)
repourl = self._get_repo_url(ud)
runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, repourl), d, workdir=destdir)
runfetchcmd("git clone -s -n %s/ %s" % (ud.clonedir, destdir), d)
if not ud.nocheckout:
os.chdir(destdir)
if subdir != "":
runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d,
workdir=destdir)
runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d, workdir=destdir)
elif not ud.nobranch:
branchname = ud.branches[ud.names[0]]
runfetchcmd("%s checkout -B %s %s" % (ud.basecmd, branchname, \
ud.revisions[ud.names[0]]), d, workdir=destdir)
runfetchcmd("%s branch %s --set-upstream-to origin/%s" % (ud.basecmd, branchname, \
branchname), d, workdir=destdir)
runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d)
runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d)
else:
runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d, workdir=destdir)
runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d)
return True
def clean(self, ud, d):
@ -338,163 +235,81 @@ class Git(FetchMethod):
bb.utils.remove(ud.localpath, True)
bb.utils.remove(ud.fullmirror)
bb.utils.remove(ud.fullmirror + ".done")
def supports_srcrev(self):
return True
def _contains_ref(self, ud, d, name, wd):
cmd = ""
if ud.nobranch:
cmd = "%s log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % (
ud.basecmd, ud.revisions[name])
else:
cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % (
ud.basecmd, ud.revisions[name], ud.branches[name])
try:
output = runfetchcmd(cmd, d, quiet=True, workdir=wd)
except bb.fetch2.FetchError:
return False
def _contains_ref(self, tag, d):
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
cmd = "%s log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % (basecmd, tag)
output = runfetchcmd(cmd, d, quiet=True)
if len(output.split()) > 1:
raise bb.fetch2.FetchError("The command '%s' gave output with more then 1 line unexpectedly, output: '%s'" % (cmd, output))
return output.split()[0] != "0"
def _get_repo_url(self, ud):
def _revision_key(self, url, ud, d, name):
"""
Return the repository URL
Return a unique key for the url
"""
return "git:" + ud.host + ud.path.replace('/', '.') + ud.branches[name]
def _latest_revision(self, url, ud, d, name):
"""
Compute the HEAD revision for the url
"""
if ud.user:
username = ud.user + '@'
else:
username = ""
return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
def _revision_key(self, ud, d, name):
"""
Return a unique key for the url
"""
return "git:" + ud.host + ud.path.replace('/', '.') + ud.unresolvedrev[name]
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
cmd = "%s ls-remote %s://%s%s%s %s" % \
(basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name])
bb.fetch2.check_network_access(d, cmd)
output = runfetchcmd(cmd, d, True)
if not output:
raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, url)
return output.split()[0]
def _lsremote(self, ud, d, search):
"""
Run git ls-remote with the specified search string
"""
# Prevent recursion e.g. in OE if SRCPV is in PV, PV is in WORKDIR,
# and WORKDIR is in PATH (as a result of RSS), our call to
# runfetchcmd() exports PATH so this function will get called again (!)
# In this scenario the return call of the function isn't actually
# important - WORKDIR isn't needed in PATH to call git ls-remote
# anyway.
if d.getVar('_BB_GIT_IN_LSREMOTE', False):
return ''
d.setVar('_BB_GIT_IN_LSREMOTE', '1')
try:
repourl = self._get_repo_url(ud)
cmd = "%s ls-remote %s %s" % \
(ud.basecmd, repourl, search)
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, cmd, repourl)
output = runfetchcmd(cmd, d, True)
if not output:
raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
finally:
d.delVar('_BB_GIT_IN_LSREMOTE')
return output
def _latest_revision(self, ud, d, name):
"""
Compute the HEAD revision for the url
"""
output = self._lsremote(ud, d, "")
# Tags of the form ^{} may not work, need to fallback to other form
if ud.unresolvedrev[name][:5] == "refs/" or ud.usehead:
head = ud.unresolvedrev[name]
tag = ud.unresolvedrev[name]
else:
head = "refs/heads/%s" % ud.unresolvedrev[name]
tag = "refs/tags/%s" % ud.unresolvedrev[name]
for s in [head, tag + "^{}", tag]:
for l in output.strip().split('\n'):
sha1, ref = l.split()
if s == ref:
return sha1
raise bb.fetch2.FetchError("Unable to resolve '%s' in upstream git repository in git ls-remote output for %s" % \
(ud.unresolvedrev[name], ud.host+ud.path))
def latest_versionstring(self, ud, d):
"""
Compute the latest release name like "x.y.x" in "x.y.x+gitHASH"
by searching through the tags output of ls-remote, comparing
versions and returning the highest match.
"""
pupver = ('', '')
tagregex = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or "(?P<pver>([0-9][\.|_]?)+)")
try:
output = self._lsremote(ud, d, "refs/tags/*")
except bb.fetch2.FetchError or bb.fetch2.NetworkAccess:
return pupver
verstring = ""
revision = ""
for line in output.split("\n"):
if not line:
break
tag_head = line.split("/")[-1]
# Ignore non-released branches
m = re.search("(alpha|beta|rc|final)+", tag_head)
if m:
continue
# search for version in the line
tag = tagregex.search(tag_head)
if tag == None:
continue
tag = tag.group('pver')
tag = tag.replace("_", ".")
if verstring and bb.utils.vercmp(("0", tag, ""), ("0", verstring, "")) < 0:
continue
verstring = tag
revision = line.split()[0]
pupver = (verstring, revision)
return pupver
def _build_revision(self, ud, d, name):
def _build_revision(self, url, ud, d, name):
return ud.revisions[name]
def gitpkgv_revision(self, ud, d, name):
def _sortable_buildindex_disabled(self, url, ud, d, rev):
"""
Return a sortable revision number by counting commits in the history
Based on gitpkgv.bblass in meta-openembedded
Return a suitable buildindex for the revision specified. This is done by counting revisions
using "git rev-list" which may or may not work in different circumstances.
"""
rev = self._build_revision(ud, d, name)
localpath = ud.localpath
rev_file = os.path.join(localpath, "oe-gitpkgv_" + rev)
if not os.path.exists(localpath):
commits = None
else:
if not os.path.exists(rev_file) or not os.path.getsize(rev_file):
from pipes import quote
commits = bb.fetch2.runfetchcmd(
"git rev-list %s -- | wc -l" % quote(rev),
d, quiet=True).strip().lstrip('0')
if commits:
open(rev_file, "w").write("%d\n" % int(commits))
else:
commits = open(rev_file, "r").readline(128).strip()
if commits:
return False, "%s+%s" % (commits, rev[:7])
else:
return True, str(rev)
def checkstatus(self, fetch, ud, d):
cwd = os.getcwd()
# Check if we have the rev already
if not os.path.exists(ud.clonedir):
logger.debug(1, "GIT repository for %s does not exist in %s. \
Downloading.", url, ud.clonedir)
self.download(None, ud, d)
if not os.path.exists(ud.clonedir):
logger.error("GIT repository for %s does not exist in %s after \
download. Cannot get sortable buildnumber, using \
old value", url, ud.clonedir)
return None
os.chdir(ud.clonedir)
if not self._contains_ref(rev, d):
self.download(None, ud, d)
output = runfetchcmd("%s rev-list %s -- 2> /dev/null | wc -l" % (ud.basecmd, rev), d, quiet=True)
os.chdir(cwd)
buildindex = "%s" % output.split()[0]
logger.debug(1, "GIT repository for %s in %s is returning %s revisions in rev-list before %s", url, ud.clonedir, buildindex, rev)
return buildindex
def checkstatus(self, uri, ud, d):
fetchcmd = "%s ls-remote %s" % (ud.basecmd, uri)
try:
self._lsremote(ud, d, "")
runfetchcmd(fetchcmd, d, quiet=True)
return True
except bb.fetch2.FetchError:
except FetchError:
return False

View File

@ -1,74 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' git annex implementation
"""
# Copyright (C) 2014 Otavio Salvador
# Copyright (C) 2014 O.S. Systems Software LTDA.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import bb
from bb.fetch2.git import Git
from bb.fetch2 import runfetchcmd
from bb.fetch2 import logger
class GitANNEX(Git):
def supports(self, ud, d):
"""
Check to see if a given url can be fetched with git.
"""
return ud.type in ['gitannex']
def uses_annex(self, ud, d, wd):
for name in ud.names:
try:
runfetchcmd("%s rev-list git-annex" % (ud.basecmd), d, quiet=True, workdir=wd)
return True
except bb.fetch.FetchError:
pass
return False
def update_annex(self, ud, d, wd):
try:
runfetchcmd("%s annex get --all" % (ud.basecmd), d, quiet=True, workdir=wd)
except bb.fetch.FetchError:
return False
runfetchcmd("chmod u+w -R %s/annex" % (ud.clonedir), d, quiet=True, workdir=wd)
return True
def download(self, ud, d):
Git.download(self, ud, d)
annex = self.uses_annex(ud, d, ud.clonedir)
if annex:
self.update_annex(ud, d, ud.clonedir)
def unpack(self, ud, destdir, d):
Git.unpack(self, ud, destdir, d)
try:
runfetchcmd("%s annex init" % (ud.basecmd), d, workdir=ud.destdir)
except bb.fetch.FetchError:
pass
annex = self.uses_annex(ud, d, ud.destdir)
if annex:
runfetchcmd("%s annex get" % (ud.basecmd), d, workdir=ud.destdir)
runfetchcmd("chmod u+w -R %s/.git/annex" % (ud.destdir), d, quiet=True, workdir=ud.destdir)

View File

@ -1,130 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' git submodules implementation
Inherits from and extends the Git fetcher to retrieve submodules of a git repository
after cloning.
SRC_URI = "gitsm://<see Git fetcher for syntax>"
See the Git fetcher, git://, for usage documentation.
NOTE: Switching a SRC_URI from "git://" to "gitsm://" requires a clean of your recipe.
"""
# Copyright (C) 2013 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import bb
from bb.fetch2.git import Git
from bb.fetch2 import runfetchcmd
from bb.fetch2 import logger
class GitSM(Git):
def supports(self, ud, d):
"""
Check to see if a given url can be fetched with git.
"""
return ud.type in ['gitsm']
def uses_submodules(self, ud, d, wd):
for name in ud.names:
try:
runfetchcmd("%s show %s:.gitmodules" % (ud.basecmd, ud.revisions[name]), d, quiet=True, workdir=wd)
return True
except bb.fetch.FetchError:
pass
return False
def _set_relative_paths(self, repopath):
"""
Fix submodule paths to be relative instead of absolute,
so that when we move the repo it doesn't break
(In Git 1.7.10+ this is done automatically)
"""
submodules = []
with open(os.path.join(repopath, '.gitmodules'), 'r') as f:
for line in f.readlines():
if line.startswith('[submodule'):
submodules.append(line.split('"')[1])
for module in submodules:
repo_conf = os.path.join(repopath, module, '.git')
if os.path.exists(repo_conf):
with open(repo_conf, 'r') as f:
lines = f.readlines()
newpath = ''
for i, line in enumerate(lines):
if line.startswith('gitdir:'):
oldpath = line.split(': ')[-1].rstrip()
if oldpath.startswith('/'):
newpath = '../' * (module.count('/') + 1) + '.git/modules/' + module
lines[i] = 'gitdir: %s\n' % newpath
break
if newpath:
with open(repo_conf, 'w') as f:
for line in lines:
f.write(line)
repo_conf2 = os.path.join(repopath, '.git', 'modules', module, 'config')
if os.path.exists(repo_conf2):
with open(repo_conf2, 'r') as f:
lines = f.readlines()
newpath = ''
for i, line in enumerate(lines):
if line.lstrip().startswith('worktree = '):
oldpath = line.split(' = ')[-1].rstrip()
if oldpath.startswith('/'):
newpath = '../' * (module.count('/') + 3) + module
lines[i] = '\tworktree = %s\n' % newpath
break
if newpath:
with open(repo_conf2, 'w') as f:
for line in lines:
f.write(line)
def update_submodules(self, ud, d):
# We have to convert bare -> full repo, do the submodule bit, then convert back
tmpclonedir = ud.clonedir + ".tmp"
gitdir = tmpclonedir + os.sep + ".git"
bb.utils.remove(tmpclonedir, True)
os.mkdir(tmpclonedir)
os.rename(ud.clonedir, gitdir)
runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*true/bare = false/'", d)
runfetchcmd(ud.basecmd + " reset --hard", d, workdir=tmpclonedir)
runfetchcmd(ud.basecmd + " checkout -f " + ud.revisions[ud.names[0]], d, workdir=tmpclonedir)
runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=tmpclonedir)
self._set_relative_paths(tmpclonedir)
runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*false/bare = true/'", d, workdir=tmpclonedir)
os.rename(gitdir, ud.clonedir,)
bb.utils.remove(tmpclonedir, True)
def download(self, ud, d):
Git.download(self, ud, d)
submodules = self.uses_submodules(ud, d, ud.clonedir)
if submodules:
self.update_submodules(ud, d)
def unpack(self, ud, destdir, d):
Git.unpack(self, ud, destdir, d)
submodules = self.uses_submodules(ud, d, ud.destdir)
if submodules:
runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir)
runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir)

View File

@ -28,7 +28,7 @@ import os
import sys
import logging
import bb
import errno
from bb import data
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
from bb.fetch2 import MissingParameterError
@ -37,19 +37,12 @@ from bb.fetch2 import logger
class Hg(FetchMethod):
"""Class to fetch from mercurial repositories"""
def supports(self, ud, d):
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with mercurial.
"""
return ud.type in ['hg']
def supports_checksum(self, urldata):
"""
Don't require checksums for local archives created from
repository checkouts.
"""
return False
def urldata_init(self, ud, d):
"""
init hg specific variable within url data
@ -59,35 +52,21 @@ class Hg(FetchMethod):
ud.module = ud.parm["module"]
if 'protocol' in ud.parm:
ud.proto = ud.parm['protocol']
elif not ud.host:
ud.proto = 'file'
else:
ud.proto = "hg"
# Create paths to mercurial checkouts
relpath = self._strip_leading_slashes(ud.path)
ud.pkgdir = os.path.join(data.expand('${HGDIR}', d), ud.host, relpath)
ud.moddir = os.path.join(ud.pkgdir, ud.module)
ud.setup_revisions(d)
ud.setup_revisons(d)
if 'rev' in ud.parm:
ud.revision = ud.parm['rev']
elif not ud.revision:
ud.revision = self.latest_revision(ud, d)
ud.revision = self.latest_revision(ud.url, ud, d)
# Create paths to mercurial checkouts
hgsrcname = '%s_%s_%s' % (ud.module.replace('/', '.'), \
ud.host, ud.path.replace('/', '.'))
ud.mirrortarball = 'hg_%s.tar.gz' % hgsrcname
ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball)
ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d)
hgdir = d.getVar("HGDIR") or (d.getVar("DL_DIR") + "/hg/")
ud.pkgdir = os.path.join(hgdir, hgsrcname)
ud.moddir = os.path.join(ud.pkgdir, ud.module)
ud.localfile = ud.moddir
ud.basecmd = d.getVar("FETCHCMD_hg") or "/usr/bin/env hg"
ud.write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS")
def need_update(self, ud, d):
def need_update(self, url, ud, d):
revTag = ud.parm.get('rev', 'tip')
if revTag == "tip":
return True
@ -95,22 +74,15 @@ class Hg(FetchMethod):
return True
return False
def try_premirror(self, ud, d):
# If we don't do this, updating an existing checkout with only premirrors
# is not possible
if d.getVar("BB_FETCH_PREMIRRORONLY") is not None:
return True
if os.path.exists(ud.moddir):
return False
return True
def _buildhgcommand(self, ud, d, command):
"""
Build up an hg commandline based on ud
command is "fetch", "update", "info"
"""
proto = ud.parm.get('protocol', 'http')
basecmd = data.expand('${FETCHCMD_hg}', d)
proto = ud.parm.get('proto', 'http')
host = ud.host
if proto == "file":
@ -120,150 +92,85 @@ class Hg(FetchMethod):
if not ud.user:
hgroot = host + ud.path
else:
if ud.pswd:
hgroot = ud.user + ":" + ud.pswd + "@" + host + ud.path
else:
hgroot = ud.user + "@" + host + ud.path
hgroot = ud.user + "@" + host + ud.path
if command == "info":
return "%s identify -i %s://%s/%s" % (ud.basecmd, proto, hgroot, ud.module)
return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module)
options = [];
# Don't specify revision for the fetch; clone the entire repo.
# This avoids an issue if the specified revision is a tag, because
# the tag actually exists in the specified revision + 1, so it won't
# be available when used in any successive commands.
if ud.revision and command != "fetch":
if ud.revision:
options.append("-r %s" % ud.revision)
if command == "fetch":
if ud.user and ud.pswd:
cmd = "%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" clone %s %s://%s/%s %s" % (ud.basecmd, ud.user, ud.pswd, proto, " ".join(options), proto, hgroot, ud.module, ud.module)
else:
cmd = "%s clone %s %s://%s/%s %s" % (ud.basecmd, " ".join(options), proto, hgroot, ud.module, ud.module)
cmd = "%s clone %s %s://%s/%s %s" % (basecmd, " ".join(options), proto, hgroot, ud.module, ud.module)
elif command == "pull":
# do not pass options list; limiting pull to rev causes the local
# repo not to contain it and immediately following "update" command
# will crash
if ud.user and ud.pswd:
cmd = "%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" pull" % (ud.basecmd, ud.user, ud.pswd, proto)
else:
cmd = "%s pull" % (ud.basecmd)
cmd = "%s pull" % (basecmd)
elif command == "update":
if ud.user and ud.pswd:
cmd = "%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" update -C %s" % (ud.basecmd, ud.user, ud.pswd, proto, " ".join(options))
else:
cmd = "%s update -C %s" % (ud.basecmd, " ".join(options))
cmd = "%s update -C %s" % (basecmd, " ".join(options))
else:
raise FetchError("Invalid hg command %s" % command, ud.url)
return cmd
def download(self, ud, d):
def download(self, loc, ud, d):
"""Fetch url"""
logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
# If the checkout doesn't exist and the mirror tarball does, extract it
if not os.path.exists(ud.pkgdir) and os.path.exists(ud.fullmirror):
bb.utils.mkdirhier(ud.pkgdir)
runfetchcmd("tar -xzf %s" % (ud.fullmirror), d, workdir=ud.pkgdir)
if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK):
# Found the source, check whether need pull
updatecmd = self._buildhgcommand(ud, d, "update")
updatecmd = self._buildhgcommand(ud, d, "pull")
logger.info("Update " + loc)
# update sources there
os.chdir(ud.moddir)
logger.debug(1, "Running %s", updatecmd)
try:
runfetchcmd(updatecmd, d, workdir=ud.moddir)
except bb.fetch2.FetchError:
# Runnning pull in the repo
pullcmd = self._buildhgcommand(ud, d, "pull")
logger.info("Pulling " + ud.url)
# update sources there
logger.debug(1, "Running %s", pullcmd)
bb.fetch2.check_network_access(d, pullcmd, ud.url)
runfetchcmd(pullcmd, d, workdir=ud.moddir)
try:
os.unlink(ud.fullmirror)
except OSError as exc:
if exc.errno != errno.ENOENT:
raise
bb.fetch2.check_network_access(d, updatecmd, ud.url)
runfetchcmd(updatecmd, d)
# No source found, clone it.
if not os.path.exists(ud.moddir):
else:
fetchcmd = self._buildhgcommand(ud, d, "fetch")
logger.info("Fetch " + ud.url)
logger.info("Fetch " + loc)
# check out sources there
bb.utils.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
logger.debug(1, "Running %s", fetchcmd)
bb.fetch2.check_network_access(d, fetchcmd, ud.url)
runfetchcmd(fetchcmd, d, workdir=ud.pkgdir)
runfetchcmd(fetchcmd, d)
# Even when we clone (fetch), we still need to update as hg's clone
# won't checkout the specified revision if its on a branch
updatecmd = self._buildhgcommand(ud, d, "update")
os.chdir(ud.moddir)
logger.debug(1, "Running %s", updatecmd)
runfetchcmd(updatecmd, d, workdir=ud.moddir)
runfetchcmd(updatecmd, d)
def clean(self, ud, d):
""" Clean the hg dir """
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude '.hg' --exclude '.hgrags'"
bb.utils.remove(ud.localpath, True)
bb.utils.remove(ud.fullmirror)
bb.utils.remove(ud.fullmirror + ".done")
os.chdir(ud.pkgdir)
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, ud.module), d, cleanup = [ud.localpath])
def supports_srcrev(self):
return True
def _latest_revision(self, ud, d, name):
def _latest_revision(self, url, ud, d, name):
"""
Compute tip revision for the url
"""
bb.fetch2.check_network_access(d, self._buildhgcommand(ud, d, "info"), ud.url)
bb.fetch2.check_network_access(d, self._buildhgcommand(ud, d, "info"))
output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
return output.strip()
def _build_revision(self, ud, d, name):
def _build_revision(self, url, ud, d, name):
return ud.revision
def _revision_key(self, ud, d, name):
def _revision_key(self, url, ud, d, name):
"""
Return a unique key for the url
"""
return "hg:" + ud.moddir
def build_mirror_data(self, ud, d):
# Generate a mirror tarball if needed
if ud.write_tarballs == "1" and not os.path.exists(ud.fullmirror):
# it's possible that this symlink points to read-only filesystem with PREMIRROR
if os.path.islink(ud.fullmirror):
os.unlink(ud.fullmirror)
logger.info("Creating tarball of hg repository")
runfetchcmd("tar -czf %s %s" % (ud.fullmirror, ud.module), d, workdir=ud.pkgdir)
runfetchcmd("touch %s.done" % (ud.fullmirror), d, workdir=ud.pkgdir)
def localpath(self, ud, d):
return ud.pkgdir
def unpack(self, ud, destdir, d):
"""
Make a local clone or export for the url
"""
revflag = "-r %s" % ud.revision
subdir = ud.parm.get("destsuffix", ud.module)
codir = "%s/%s" % (destdir, subdir)
scmdata = ud.parm.get("scmdata", "")
if scmdata != "nokeep":
if not os.access(os.path.join(codir, '.hg'), os.R_OK):
logger.debug(2, "Unpack: creating new hg repository in '" + codir + "'")
runfetchcmd("%s init %s" % (ud.basecmd, codir), d)
logger.debug(2, "Unpack: updating source in '" + codir + "'")
runfetchcmd("%s pull %s" % (ud.basecmd, ud.moddir), d, workdir=codir)
runfetchcmd("%s up -C %s" % (ud.basecmd, revflag), d, workdir=codir)
else:
logger.debug(2, "Unpack: extracting source to '" + codir + "'")
runfetchcmd("%s archive -t files %s %s" % (ud.basecmd, revflag, codir), d, workdir=ud.moddir)

View File

@ -26,14 +26,13 @@ BitBake build tools.
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import urllib.request, urllib.parse, urllib.error
import bb
import bb.utils
from bb.fetch2 import FetchMethod, FetchError
from bb.fetch2 import logger
from bb import data
from bb.fetch2 import FetchMethod
class Local(FetchMethod):
def supports(self, urldata, d):
def supports(self, url, urldata, d):
"""
Check to see if a given url represents a local fetch.
"""
@ -41,74 +40,47 @@ class Local(FetchMethod):
def urldata_init(self, ud, d):
# We don't set localfile as for this fetcher the file is already local!
ud.decodedurl = urllib.parse.unquote(ud.url.split("://")[1].split(";")[0])
ud.basename = os.path.basename(ud.decodedurl)
ud.basepath = ud.decodedurl
ud.needdonestamp = False
ud.basename = os.path.basename(ud.url.split("://")[1].split(";")[0])
return
def localpath(self, urldata, d):
def localpath(self, url, urldata, d):
"""
Return the local filename of a given url assuming a successful fetch.
"""
return self.localpaths(urldata, d)[-1]
def localpaths(self, urldata, d):
"""
Return the local filename of a given url assuming a successful fetch.
"""
searched = []
path = urldata.decodedurl
path = url.split("://")[1]
path = path.split(";")[0]
newpath = path
if path[0] == "/":
return [path]
filespath = d.getVar('FILESPATH')
if filespath:
logger.debug(2, "Searching for %s in paths:\n %s" % (path, "\n ".join(filespath.split(":"))))
newpath, hist = bb.utils.which(filespath, path, history=True)
searched.extend(hist)
if (not newpath or not os.path.exists(newpath)) and path.find("*") != -1:
# For expressions using '*', best we can do is take the first directory in FILESPATH that exists
newpath, hist = bb.utils.which(filespath, ".", history=True)
searched.extend(hist)
logger.debug(2, "Searching for %s in path: %s" % (path, newpath))
return searched
if not os.path.exists(newpath):
dldirfile = os.path.join(d.getVar("DL_DIR"), path)
logger.debug(2, "Defaulting to %s for %s" % (dldirfile, path))
bb.utils.mkdirhier(os.path.dirname(dldirfile))
searched.append(dldirfile)
return searched
return searched
if path[0] != "/":
filespath = data.getVar('FILESPATH', d, True)
if filespath:
newpath = bb.utils.which(filespath, path)
if not newpath:
filesdir = data.getVar('FILESDIR', d, True)
if filesdir:
newpath = os.path.join(filesdir, path)
if not os.path.exists(newpath) and path.find("*") == -1:
dldirfile = os.path.join(data.getVar("DL_DIR", d, True), os.path.basename(path))
return dldirfile
return newpath
def need_update(self, ud, d):
if ud.url.find("*") != -1:
def need_update(self, url, ud, d):
if url.find("*") != -1:
return False
if os.path.exists(ud.localpath):
return False
return True
def download(self, urldata, d):
def download(self, url, urldata, d):
"""Fetch urls (no-op for Local method)"""
# no need to fetch local files, we'll deal with them in place.
if self.supports_checksum(urldata) and not os.path.exists(urldata.localpath):
locations = []
filespath = d.getVar('FILESPATH')
if filespath:
locations = filespath.split(":")
locations.append(d.getVar("DL_DIR"))
return 1
msg = "Unable to find file " + urldata.url + " anywhere. The paths that were searched were:\n " + "\n ".join(locations)
raise FetchError(msg)
return True
def checkstatus(self, fetch, urldata, d):
def checkstatus(self, url, urldata, d):
"""
Check the status of the url
"""
if urldata.localpath.find("*") != -1:
logger.info("URL %s looks like a glob and was therefore not checked.", urldata.url)
logger.info("URL %s looks like a glob and was therefore not checked.", url)
return True
if os.path.exists(urldata.localpath):
return True

View File

@ -1,304 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' NPM implementation
The NPM fetcher is used to retrieve files from the npmjs repository
Usage in the recipe:
SRC_URI = "npm://registry.npmjs.org/;name=${PN};version=${PV}"
Suported SRC_URI options are:
- name
- version
npm://registry.npmjs.org/${PN}/-/${PN}-${PV}.tgz would become npm://registry.npmjs.org;name=${PN};version=${PV}
The fetcher all triggers off the existence of ud.localpath. If that exists and has the ".done" stamp, its assumed the fetch is good/done
"""
import os
import sys
import urllib.request, urllib.parse, urllib.error
import json
import subprocess
import signal
import bb
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
from bb.fetch2 import ChecksumError
from bb.fetch2 import runfetchcmd
from bb.fetch2 import logger
from bb.fetch2 import UnpackError
from bb.fetch2 import ParameterError
def subprocess_setup():
# Python installs a SIGPIPE handler by default. This is usually not what
# non-Python subprocesses expect.
# SIGPIPE errors are known issues with gzip/bash
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
class Npm(FetchMethod):
"""Class to fetch urls via 'npm'"""
def init(self, d):
pass
def supports(self, ud, d):
"""
Check to see if a given url can be fetched with npm
"""
return ud.type in ['npm']
def debug(self, msg):
logger.debug(1, "NpmFetch: %s", msg)
def clean(self, ud, d):
logger.debug(2, "Calling cleanup %s" % ud.pkgname)
bb.utils.remove(ud.localpath, False)
bb.utils.remove(ud.pkgdatadir, True)
bb.utils.remove(ud.fullmirror, False)
def urldata_init(self, ud, d):
"""
init NPM specific variable within url data
"""
if 'downloadfilename' in ud.parm:
ud.basename = ud.parm['downloadfilename']
else:
ud.basename = os.path.basename(ud.path)
# can't call it ud.name otherwise fetcher base class will start doing sha1stuff
# TODO: find a way to get an sha1/sha256 manifest of pkg & all deps
ud.pkgname = ud.parm.get("name", None)
if not ud.pkgname:
raise ParameterError("NPM fetcher requires a name parameter", ud.url)
ud.version = ud.parm.get("version", None)
if not ud.version:
raise ParameterError("NPM fetcher requires a version parameter", ud.url)
ud.bbnpmmanifest = "%s-%s.deps.json" % (ud.pkgname, ud.version)
ud.bbnpmmanifest = ud.bbnpmmanifest.replace('/', '-')
ud.registry = "http://%s" % (ud.url.replace('npm://', '', 1).split(';'))[0]
prefixdir = "npm/%s" % ud.pkgname
ud.pkgdatadir = d.expand("${DL_DIR}/%s" % prefixdir)
if not os.path.exists(ud.pkgdatadir):
bb.utils.mkdirhier(ud.pkgdatadir)
ud.localpath = d.expand("${DL_DIR}/npm/%s" % ud.bbnpmmanifest)
self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -O -t 2 -T 30 -nv --passive-ftp --no-check-certificate "
ud.prefixdir = prefixdir
ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0") != "0")
ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version)
ud.mirrortarball = ud.mirrortarball.replace('/', '-')
ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball)
def need_update(self, ud, d):
if os.path.exists(ud.localpath):
return False
return True
def _runwget(self, ud, d, command, quiet):
logger.debug(2, "Fetching %s using command '%s'" % (ud.url, command))
bb.fetch2.check_network_access(d, command, ud.url)
dldir = d.getVar("DL_DIR")
runfetchcmd(command, d, quiet, workdir=dldir)
def _unpackdep(self, ud, pkg, data, destdir, dldir, d):
file = data[pkg]['tgz']
logger.debug(2, "file to extract is %s" % file)
if file.endswith('.tgz') or file.endswith('.tar.gz') or file.endswith('.tar.Z'):
cmd = 'tar xz --strip 1 --no-same-owner --warning=no-unknown-keyword -f %s/%s' % (dldir, file)
else:
bb.fatal("NPM package %s downloaded not a tarball!" % file)
# Change to subdir before executing command
if not os.path.exists(destdir):
os.makedirs(destdir)
path = d.getVar('PATH')
if path:
cmd = "PATH=\"%s\" %s" % (path, cmd)
bb.note("Unpacking %s to %s/" % (file, destdir))
ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True, cwd=destdir)
if ret != 0:
raise UnpackError("Unpack command %s failed with return value %s" % (cmd, ret), ud.url)
if 'deps' not in data[pkg]:
return
for dep in data[pkg]['deps']:
self._unpackdep(ud, dep, data[pkg]['deps'], "%s/node_modules/%s" % (destdir, dep), dldir, d)
def unpack(self, ud, destdir, d):
dldir = d.getVar("DL_DIR")
with open("%s/npm/%s" % (dldir, ud.bbnpmmanifest)) as datafile:
workobj = json.load(datafile)
dldir = "%s/%s" % (os.path.dirname(ud.localpath), ud.pkgname)
if 'subdir' in ud.parm:
unpackdir = '%s/%s' % (destdir, ud.parm.get('subdir'))
else:
unpackdir = '%s/npmpkg' % destdir
self._unpackdep(ud, ud.pkgname, workobj, unpackdir, dldir, d)
def _parse_view(self, output):
'''
Parse the output of npm view --json; the last JSON result
is assumed to be the one that we're interested in.
'''
pdata = None
outdeps = {}
datalines = []
bracelevel = 0
for line in output.splitlines():
if bracelevel:
datalines.append(line)
elif '{' in line:
datalines = []
datalines.append(line)
bracelevel = bracelevel + line.count('{') - line.count('}')
if datalines:
pdata = json.loads('\n'.join(datalines))
return pdata
def _getdependencies(self, pkg, data, version, d, ud, optional=False, fetchedlist=None):
if fetchedlist is None:
fetchedlist = []
pkgfullname = pkg
if version != '*' and not '/' in version:
pkgfullname += "@'%s'" % version
logger.debug(2, "Calling getdeps on %s" % pkg)
fetchcmd = "npm view %s --json --registry %s" % (pkgfullname, ud.registry)
output = runfetchcmd(fetchcmd, d, True)
pdata = self._parse_view(output)
if not pdata:
raise FetchError("The command '%s' returned no output" % fetchcmd)
if optional:
pkg_os = pdata.get('os', None)
if pkg_os:
if not isinstance(pkg_os, list):
pkg_os = [pkg_os]
blacklist = False
for item in pkg_os:
if item.startswith('!'):
blacklist = True
break
if (not blacklist and 'linux' not in pkg_os) or '!linux' in pkg_os:
logger.debug(2, "Skipping %s since it's incompatible with Linux" % pkg)
return
#logger.debug(2, "Output URL is %s - %s - %s" % (ud.basepath, ud.basename, ud.localfile))
outputurl = pdata['dist']['tarball']
data[pkg] = {}
data[pkg]['tgz'] = os.path.basename(outputurl)
if not outputurl in fetchedlist:
self._runwget(ud, d, "%s --directory-prefix=%s %s" % (self.basecmd, ud.prefixdir, outputurl), False)
fetchedlist.append(outputurl)
dependencies = pdata.get('dependencies', {})
optionalDependencies = pdata.get('optionalDependencies', {})
dependencies.update(optionalDependencies)
depsfound = {}
optdepsfound = {}
data[pkg]['deps'] = {}
for dep in dependencies:
if dep in optionalDependencies:
optdepsfound[dep] = dependencies[dep]
else:
depsfound[dep] = dependencies[dep]
for dep, version in optdepsfound.items():
self._getdependencies(dep, data[pkg]['deps'], version, d, ud, optional=True, fetchedlist=fetchedlist)
for dep, version in depsfound.items():
self._getdependencies(dep, data[pkg]['deps'], version, d, ud, fetchedlist=fetchedlist)
def _getshrinkeddependencies(self, pkg, data, version, d, ud, lockdown, manifest, toplevel=True):
logger.debug(2, "NPM shrinkwrap file is %s" % data)
if toplevel:
name = data.get('name', None)
if name and name != pkg:
for obj in data.get('dependencies', []):
if obj == pkg:
self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False)
return
outputurl = "invalid"
if ('resolved' not in data) or (not data['resolved'].startswith('http')):
# will be the case for ${PN}
fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))
outputurl = runfetchcmd(fetchcmd, d, True)
else:
outputurl = data['resolved']
self._runwget(ud, d, "%s --directory-prefix=%s %s" % (self.basecmd, ud.prefixdir, outputurl), False)
manifest[pkg] = {}
manifest[pkg]['tgz'] = os.path.basename(outputurl).rstrip()
manifest[pkg]['deps'] = {}
if pkg in lockdown:
sha1_expected = lockdown[pkg][version]
sha1_data = bb.utils.sha1_file("npm/%s/%s" % (ud.pkgname, manifest[pkg]['tgz']))
if sha1_expected != sha1_data:
msg = "\nFile: '%s' has %s checksum %s when %s was expected" % (manifest[pkg]['tgz'], 'sha1', sha1_data, sha1_expected)
raise ChecksumError('Checksum mismatch!%s' % msg)
else:
logger.debug(2, "No lockdown data for %s@%s" % (pkg, version))
if 'dependencies' in data:
for obj in data['dependencies']:
logger.debug(2, "Found dep is %s" % str(obj))
self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest[pkg]['deps'], False)
def download(self, ud, d):
"""Fetch url"""
jsondepobj = {}
shrinkobj = {}
lockdown = {}
if not os.listdir(ud.pkgdatadir) and os.path.exists(ud.fullmirror):
dest = d.getVar("DL_DIR")
bb.utils.mkdirhier(dest)
runfetchcmd("tar -xJf %s" % (ud.fullmirror), d, workdir=dest)
return
shwrf = d.getVar('NPM_SHRINKWRAP')
logger.debug(2, "NPM shrinkwrap file is %s" % shwrf)
if shwrf:
try:
with open(shwrf) as datafile:
shrinkobj = json.load(datafile)
except Exception as e:
raise FetchError('Error loading NPM_SHRINKWRAP file "%s" for %s: %s' % (shwrf, ud.pkgname, str(e)))
elif not ud.ignore_checksums:
logger.warning('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname)
lckdf = d.getVar('NPM_LOCKDOWN')
logger.debug(2, "NPM lockdown file is %s" % lckdf)
if lckdf:
try:
with open(lckdf) as datafile:
lockdown = json.load(datafile)
except Exception as e:
raise FetchError('Error loading NPM_LOCKDOWN file "%s" for %s: %s' % (lckdf, ud.pkgname, str(e)))
elif not ud.ignore_checksums:
logger.warning('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname)
if ('name' not in shrinkobj):
self._getdependencies(ud.pkgname, jsondepobj, ud.version, d, ud)
else:
self._getshrinkeddependencies(ud.pkgname, shrinkobj, ud.version, d, ud, lockdown, jsondepobj)
with open(ud.localpath, 'w') as outfile:
json.dump(jsondepobj, outfile)
def build_mirror_data(self, ud, d):
# Generate a mirror tarball if needed
if ud.write_tarballs and not os.path.exists(ud.fullmirror):
# it's possible that this symlink points to read-only filesystem with PREMIRROR
if os.path.islink(ud.fullmirror):
os.unlink(ud.fullmirror)
dldir = d.getVar("DL_DIR")
logger.info("Creating tarball of npm data")
runfetchcmd("tar -cJf %s npm/%s npm/%s" % (ud.fullmirror, ud.bbnpmmanifest, ud.pkgname), d,
workdir=dldir)
runfetchcmd("touch %s.done" % (ud.fullmirror), d, workdir=dldir)

View File

@ -10,6 +10,7 @@ import os
import sys
import logging
import bb
from bb import data
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
from bb.fetch2 import MissingParameterError
@ -19,7 +20,7 @@ class Osc(FetchMethod):
"""Class to fetch a module or modules from Opensuse build server
repositories."""
def supports(self, ud, d):
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with osc.
"""
@ -33,20 +34,20 @@ class Osc(FetchMethod):
# Create paths to osc checkouts
relpath = self._strip_leading_slashes(ud.path)
ud.pkgdir = os.path.join(d.getVar('OSCDIR'), ud.host)
ud.pkgdir = os.path.join(data.expand('${OSCDIR}', d), ud.host)
ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module)
if 'rev' in ud.parm:
ud.revision = ud.parm['rev']
else:
pv = d.getVar("PV", False)
pv = data.getVar("PV", d, 0)
rev = bb.fetch2.srcrev_internal_helper(ud, d)
if rev and rev != True:
ud.revision = rev
else:
ud.revision = ""
ud.localfile = d.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision))
ud.localfile = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d)
def _buildosccommand(self, ud, d, command):
"""
@ -54,9 +55,9 @@ class Osc(FetchMethod):
command is "fetch", "update", "info"
"""
basecmd = d.expand('${FETCHCMD_osc}')
basecmd = data.expand('${FETCHCMD_osc}', d)
proto = ud.parm.get('protocol', 'ocs')
proto = ud.parm.get('proto', 'ocs')
options = []
@ -76,32 +77,34 @@ class Osc(FetchMethod):
return osccmd
def download(self, ud, d):
def download(self, loc, ud, d):
"""
Fetch url
"""
logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
if os.access(os.path.join(d.getVar('OSCDIR'), ud.path, ud.module), os.R_OK):
if os.access(os.path.join(data.expand('${OSCDIR}', d), ud.path, ud.module), os.R_OK):
oscupdatecmd = self._buildosccommand(ud, d, "update")
logger.info("Update "+ ud.url)
logger.info("Update "+ loc)
# update sources there
os.chdir(ud.moddir)
logger.debug(1, "Running %s", oscupdatecmd)
bb.fetch2.check_network_access(d, oscupdatecmd, ud.url)
runfetchcmd(oscupdatecmd, d, workdir=ud.moddir)
runfetchcmd(oscupdatecmd, d)
else:
oscfetchcmd = self._buildosccommand(ud, d, "fetch")
logger.info("Fetch " + ud.url)
logger.info("Fetch " + loc)
# check out sources there
bb.utils.mkdirhier(ud.pkgdir)
os.chdir(ud.pkgdir)
logger.debug(1, "Running %s", oscfetchcmd)
bb.fetch2.check_network_access(d, oscfetchcmd, ud.url)
runfetchcmd(oscfetchcmd, d, workdir=ud.pkgdir)
runfetchcmd(oscfetchcmd, d)
os.chdir(os.path.join(ud.pkgdir + ud.path))
# tar them up to a defined filename
runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d,
cleanup=[ud.localpath], workdir=os.path.join(ud.pkgdir + ud.path))
runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d, cleanup = [ud.localpath])
def supports_srcrev(self):
return False
@ -111,7 +114,7 @@ class Osc(FetchMethod):
Generate a .oscrc to be used for this run.
"""
config_path = os.path.join(d.getVar('OSCDIR'), "oscrc")
config_path = os.path.join(data.expand('${OSCDIR}', d), "oscrc")
if (os.path.exists(config_path)):
os.remove(config_path)
@ -120,8 +123,8 @@ class Osc(FetchMethod):
f.write("apisrv = %s\n" % ud.host)
f.write("scheme = http\n")
f.write("su-wrapper = su -c\n")
f.write("build-root = %s\n" % d.getVar('WORKDIR'))
f.write("urllist = %s\n" % d.getVar("OSCURLLIST"))
f.write("build-root = %s\n" % data.expand('${WORKDIR}', d))
f.write("urllist = http://moblin-obs.jf.intel.com:8888/build/%(project)s/%(repository)s/%(buildarch)s/:full/%(name)s.rpm\n")
f.write("extra-pkgs = gzip\n")
f.write("\n")
f.write("[%s]\n" % ud.host)

View File

@ -1,12 +1,14 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementation for perforce
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2016 Kodak Alaris, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@ -23,187 +25,172 @@ BitBake 'Fetch' implementation for perforce
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
from future_builtins import zip
import os
import logging
import bb
from bb import data
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
from bb.fetch2 import logger
from bb.fetch2 import runfetchcmd
class Perforce(FetchMethod):
""" Class to fetch from perforce repositories """
def supports(self, ud, d):
""" Check to see if a given url can be fetched with perforce. """
def supports(self, url, ud, d):
return ud.type in ['p4']
def urldata_init(self, ud, d):
"""
Initialize perforce specific variables within url data. If P4CONFIG is
provided by the env, use it. If P4PORT is specified by the recipe, use
its values, which may override the settings in P4CONFIG.
"""
ud.basecmd = d.getVar('FETCHCMD_p4')
if not ud.basecmd:
ud.basecmd = "/usr/bin/env p4"
ud.dldir = d.getVar('P4DIR')
if not ud.dldir:
ud.dldir = '%s/%s' % (d.getVar('DL_DIR'), 'p4')
path = ud.url.split('://')[1]
path = path.split(';')[0]
delim = path.find('@');
def doparse(url, d):
parm = {}
path = url.split("://")[1]
delim = path.find("@");
if delim != -1:
(ud.user, ud.pswd) = path.split('@')[0].split(':')
ud.path = path.split('@')[1]
(user, pswd, host, port) = path.split('@')[0].split(":")
path = path.split('@')[1]
else:
ud.path = path
(host, port) = data.getVar('P4PORT', d).split(':')
user = ""
pswd = ""
ud.usingp4config = False
p4port = d.getVar('P4PORT')
if path.find(";") != -1:
keys=[]
values=[]
plist = path.split(';')
for item in plist:
if item.count('='):
(key, value) = item.split('=')
keys.append(key)
values.append(value)
if p4port:
logger.debug(1, 'Using recipe provided P4PORT: %s' % p4port)
ud.host = p4port
else:
logger.debug(1, 'Trying to use P4CONFIG to automatically set P4PORT...')
ud.usingp4config = True
p4cmd = '%s info | grep "Server address"' % ud.basecmd
bb.fetch2.check_network_access(d, p4cmd, ud.url)
ud.host = runfetchcmd(p4cmd, d, True)
ud.host = ud.host.split(': ')[1].strip()
logger.debug(1, 'Determined P4PORT to be: %s' % ud.host)
if not ud.host:
raise FetchError('Could not determine P4PORT from P4CONFIG')
if ud.path.find('/...') >= 0:
ud.pathisdir = True
else:
ud.pathisdir = False
parm = dict(zip(keys, values))
path = "//" + path.split(';')[0]
host += ":%s" % (port)
parm["cset"] = Perforce.getcset(d, path, host, user, pswd, parm)
cleanedpath = ud.path.replace('/...', '').replace('/', '.')
cleanedhost = ud.host.replace(':', '.')
ud.pkgdir = os.path.join(ud.dldir, cleanedhost, cleanedpath)
return host, path, user, pswd, parm
doparse = staticmethod(doparse)
ud.setup_revisions(d)
ud.localfile = d.expand('%s_%s_%s.tar.gz' % (cleanedhost, cleanedpath, ud.revision))
def _buildp4command(self, ud, d, command, depot_filename=None):
"""
Build a p4 commandline. Valid commands are "changes", "print", and
"files". depot_filename is the full path to the file in the depot
including the trailing '#rev' value.
"""
def getcset(d, depot, host, user, pswd, parm):
p4opt = ""
if "cset" in parm:
return parm["cset"];
if user:
p4opt += " -u %s" % (user)
if pswd:
p4opt += " -P %s" % (pswd)
if host:
p4opt += " -p %s" % (host)
if ud.user:
p4opt += ' -u "%s"' % (ud.user)
p4date = data.getVar("P4DATE", d, True)
if "revision" in parm:
depot += "#%s" % (parm["revision"])
elif "label" in parm:
depot += "@%s" % (parm["label"])
elif p4date:
depot += "@%s" % (p4date)
if ud.pswd:
p4opt += ' -P "%s"' % (ud.pswd)
p4cmd = data.getVar('FETCHCOMMAND_p4', d, True)
logger.debug(1, "Running %s%s changes -m 1 %s", p4cmd, p4opt, depot)
p4file = os.popen("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
cset = p4file.readline().strip()
logger.debug(1, "READ %s", cset)
if not cset:
return -1
if ud.host and not ud.usingp4config:
p4opt += ' -p %s' % (ud.host)
return cset.split(' ')[1]
getcset = staticmethod(getcset)
if hasattr(ud, 'revision') and ud.revision:
pathnrev = '%s@%s' % (ud.path, ud.revision)
else:
pathnrev = '%s' % (ud.path)
def urldata_init(self, ud, d):
(host, path, user, pswd, parm) = Perforce.doparse(ud.url, d)
if depot_filename:
if ud.pathisdir: # Remove leading path to obtain filename
filename = depot_filename[len(ud.path)-1:]
else:
filename = depot_filename[depot_filename.rfind('/'):]
filename = filename[:filename.find('#')] # Remove trailing '#rev'
# If a label is specified, we use that as our filename
if command == 'changes':
p4cmd = '%s%s changes -m 1 //%s' % (ud.basecmd, p4opt, pathnrev)
elif command == 'print':
if depot_filename != None:
p4cmd = '%s%s print -o "p4/%s" "%s"' % (ud.basecmd, p4opt, filename, depot_filename)
else:
raise FetchError('No depot file name provided to p4 %s' % command, ud.url)
elif command == 'files':
p4cmd = '%s%s files //%s' % (ud.basecmd, p4opt, pathnrev)
else:
raise FetchError('Invalid p4 command %s' % command, ud.url)
if "label" in parm:
ud.localfile = "%s.tar.gz" % (parm["label"])
return
return p4cmd
base = path
which = path.find('/...')
if which != -1:
base = path[:which]
def _p4listfiles(self, ud, d):
base = self._strip_leading_slashes(base)
cset = Perforce.getcset(d, path, host, user, pswd, parm)
ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d)
def download(self, loc, ud, d):
"""
Return a list of the file names which are present in the depot using the
'p4 files' command, including trailing '#rev' file revision indicator
Fetch urls
"""
p4cmd = self._buildp4command(ud, d, 'files')
bb.fetch2.check_network_access(d, p4cmd, ud.url)
p4fileslist = runfetchcmd(p4cmd, d, True)
p4fileslist = [f.rstrip() for f in p4fileslist.splitlines()]
if not p4fileslist:
raise FetchError('Unable to fetch listing of p4 files from %s@%s' % (ud.host, ud.path))
(host, depot, user, pswd, parm) = Perforce.doparse(loc, d)
if depot.find('/...') != -1:
path = depot[:depot.find('/...')]
else:
path = depot
module = parm.get('module', os.path.basename(path))
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "p4:%s" % data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
# Get the p4 command
p4opt = ""
if user:
p4opt += " -u %s" % (user)
if pswd:
p4opt += " -P %s" % (pswd)
if host:
p4opt += " -p %s" % (host)
p4cmd = data.getVar('FETCHCOMMAND', localdata, True)
# create temp directory
logger.debug(2, "Fetch: creating temporary directory")
bb.utils.mkdirhier(data.expand('${WORKDIR}', localdata))
data.setVar('TMPBASE', data.expand('${WORKDIR}/oep4.XXXXXX', localdata), localdata)
tmppipe = os.popen(data.getVar('MKTEMPDIRCMD', localdata, True) or "false")
tmpfile = tmppipe.readline().strip()
if not tmpfile:
raise FetchError("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.", loc)
if "label" in parm:
depot = "%s@%s" % (depot, parm["label"])
else:
cset = Perforce.getcset(d, depot, host, user, pswd, parm)
depot = "%s@%s" % (depot, cset)
os.chdir(tmpfile)
logger.info("Fetch " + loc)
logger.info("%s%s files %s", p4cmd, p4opt, depot)
p4file = os.popen("%s%s files %s" % (p4cmd, p4opt, depot))
if not p4file:
raise FetchError("Fetch: unable to get the P4 files from %s" % depot, loc)
count = 0
filelist = []
for filename in p4fileslist:
item = filename.split(' - ')
lastaction = item[1].split()
logger.debug(1, 'File: %s Last Action: %s' % (item[0], lastaction[0]))
if lastaction[0] == 'delete':
for file in p4file:
list = file.split()
if list[2] == "delete":
continue
filelist.append(item[0])
return filelist
dest = list[0][len(path)+1:]
where = dest.find("#")
def download(self, ud, d):
""" Get the list of files, fetch each one """
filelist = self._p4listfiles(ud, d)
if not filelist:
raise FetchError('No files found in depot %s@%s' % (ud.host, ud.path))
os.system("%s%s print -o %s/%s %s" % (p4cmd, p4opt, module, dest[:where], list[0]))
count = count + 1
bb.utils.remove(ud.pkgdir, True)
bb.utils.mkdirhier(ud.pkgdir)
for afile in filelist:
p4fetchcmd = self._buildp4command(ud, d, 'print', afile)
bb.fetch2.check_network_access(d, p4fetchcmd, ud.url)
runfetchcmd(p4fetchcmd, d, workdir=ud.pkgdir)
runfetchcmd('tar -czf %s p4' % (ud.localpath), d, cleanup=[ud.localpath], workdir=ud.pkgdir)
def clean(self, ud, d):
""" Cleanup p4 specific files and dirs"""
bb.utils.remove(ud.localpath)
bb.utils.remove(ud.pkgdir, True)
def supports_srcrev(self):
return True
def _revision_key(self, ud, d, name):
""" Return a unique key for the url """
return 'p4:%s' % ud.pkgdir
def _latest_revision(self, ud, d, name):
""" Return the latest upstream scm revision number """
p4cmd = self._buildp4command(ud, d, "changes")
bb.fetch2.check_network_access(d, p4cmd, ud.url)
tip = runfetchcmd(p4cmd, d, True)
if not tip:
raise FetchError('Could not determine the latest perforce changelist')
tipcset = tip.split(' ')[1]
logger.debug(1, 'p4 tip found to be changelist %s' % tipcset)
return tipcset
def sortable_revision(self, ud, d, name):
""" Return a sortable revision number """
return False, self._build_revision(ud, d)
def _build_revision(self, ud, d):
return ud.revision
if count == 0:
logger.error()
raise FetchError("Fetch: No files gathered from the P4 fetch", loc)
runfetchcmd("tar -czf %s %s" % (ud.localpath, module), d, cleanup = [ud.localpath])
# cleanup
bb.utils.prunedir(tmpfile)

View File

@ -25,12 +25,13 @@ BitBake "Fetch" repo (git) implementation
import os
import bb
from bb import data
from bb.fetch2 import FetchMethod
from bb.fetch2 import runfetchcmd
class Repo(FetchMethod):
"""Class to fetch a module or modules from repo (git) repositories"""
def supports(self, ud, d):
def supports(self, url, ud, d):
"""
Check to see if a given url can be fetched with repo.
"""
@ -50,17 +51,17 @@ class Repo(FetchMethod):
if not ud.manifest.endswith('.xml'):
ud.manifest += '.xml'
ud.localfile = d.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch))
ud.localfile = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d)
def download(self, ud, d):
def download(self, loc, ud, d):
"""Fetch url"""
if os.access(os.path.join(d.getVar("DL_DIR"), ud.localfile), os.R_OK):
if os.access(os.path.join(data.getVar("DL_DIR", d, True), ud.localfile), os.R_OK):
logger.debug(1, "%s already exists (or was stashed). Skipping repo init / sync.", ud.localpath)
return
gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", "."))
repodir = d.getVar("REPODIR") or os.path.join(d.getVar("DL_DIR"), "repo")
repodir = data.getVar("REPODIR", d, True) or os.path.join(data.getVar("DL_DIR", d, True), "repo")
codir = os.path.join(repodir, gitsrcname, ud.manifest)
if ud.user:
@ -68,29 +69,30 @@ class Repo(FetchMethod):
else:
username = ""
repodir = os.path.join(codir, "repo")
bb.utils.mkdirhier(repodir)
if not os.path.exists(os.path.join(repodir, ".repo")):
bb.utils.mkdirhier(os.path.join(codir, "repo"))
os.chdir(os.path.join(codir, "repo"))
if not os.path.exists(os.path.join(codir, "repo", ".repo")):
bb.fetch2.check_network_access(d, "repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), ud.url)
runfetchcmd("repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d, workdir=repodir)
runfetchcmd("repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d)
bb.fetch2.check_network_access(d, "repo sync %s" % ud.url, ud.url)
runfetchcmd("repo sync", d, workdir=repodir)
runfetchcmd("repo sync", d)
os.chdir(codir)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude='.repo' --exclude='.git'"
tar_flags = "--exclude '.repo' --exclude '.git'"
# Create a cache
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.join(".", "*") ), d, workdir=codir)
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.join(".", "*") ), d)
def supports_srcrev(self):
return False
def _build_revision(self, ud, d):
def _build_revision(self, url, ud, d):
return ud.manifest
def _want_sortable_revision(self, ud, d):
def _want_sortable_revision(self, url, ud, d):
return False

View File

@ -1,98 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementation for Amazon AWS S3.
Class for fetching files from Amazon S3 using the AWS Command Line Interface.
The aws tool must be correctly installed and configured prior to use.
"""
# Copyright (C) 2017, Andre McCurdy <armccurdy@gmail.com>
#
# Based in part on bb.fetch2.wget:
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import bb
import urllib.request, urllib.parse, urllib.error
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
from bb.fetch2 import runfetchcmd
class S3(FetchMethod):
"""Class to fetch urls via 'aws s3'"""
def supports(self, ud, d):
"""
Check to see if a given url can be fetched with s3.
"""
return ud.type in ['s3']
def recommends_checksum(self, urldata):
return True
def urldata_init(self, ud, d):
if 'downloadfilename' in ud.parm:
ud.basename = ud.parm['downloadfilename']
else:
ud.basename = os.path.basename(ud.path)
ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
ud.basecmd = d.getVar("FETCHCMD_s3") or "/usr/bin/env aws s3"
def download(self, ud, d):
"""
Fetch urls
Assumes localpath was called first
"""
cmd = '%s cp s3://%s%s %s' % (ud.basecmd, ud.host, ud.path, ud.localpath)
bb.fetch2.check_network_access(d, cmd, ud.url)
runfetchcmd(cmd, d)
# Additional sanity checks copied from the wget class (although there
# are no known issues which mean these are required, treat the aws cli
# tool with a little healthy suspicion).
if not os.path.exists(ud.localpath):
raise FetchError("The aws cp command returned success for s3://%s%s but %s doesn't exist?!" % (ud.host, ud.path, ud.localpath))
if os.path.getsize(ud.localpath) == 0:
os.remove(ud.localpath)
raise FetchError("The aws cp command for s3://%s%s resulted in a zero size file?! Deleting and failing since this isn't right." % (ud.host, ud.path))
return True
def checkstatus(self, fetch, ud, d):
"""
Check the status of a URL
"""
cmd = '%s ls s3://%s%s' % (ud.basecmd, ud.host, ud.path)
bb.fetch2.check_network_access(d, cmd, ud.url)
output = runfetchcmd(cmd, d)
# "aws s3 ls s3://mybucket/foo" will exit with success even if the file
# is not found, so check output of the command to confirm success.
if not output:
raise FetchError("The aws ls command for s3://%s%s gave empty output" % (ud.host, ud.path))
return True

View File

@ -1,125 +0,0 @@
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake SFTP Fetch implementation
Class for fetching files via SFTP. It tries to adhere to the (now
expired) IETF Internet Draft for "Uniform Resource Identifier (URI)
Scheme for Secure File Transfer Protocol (SFTP) and Secure Shell
(SSH)" (SECSH URI).
It uses SFTP (as to adhere to the SECSH URI specification). It only
supports key based authentication, not password. This class, unlike
the SSH fetcher, does not support fetching a directory tree from the
remote.
http://tools.ietf.org/html/draft-ietf-secsh-scp-sftp-ssh-uri-04
https://www.iana.org/assignments/uri-schemes/prov/sftp
https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13
Please note that '/' is used as host path seperator, and not ":"
as you may be used to from the scp/sftp commands. You can use a
~ (tilde) to specify a path relative to your home directory.
(The /~user/ syntax, for specyfing a path relative to another
user's home directory is not supported.) Note that the tilde must
still follow the host path seperator ("/"). See exampels below.
Example SRC_URIs:
SRC_URI = "sftp://host.example.com/dir/path.file.txt"
A path relative to your home directory.
SRC_URI = "sftp://host.example.com/~/dir/path.file.txt"
You can also specify a username (specyfing password in the
URI is not supported, use SSH keys to authenticate):
SRC_URI = "sftp://user@host.example.com/dir/path.file.txt"
"""
# Copyright (C) 2013, Olof Johansson <olof.johansson@axis.com>
#
# Based in part on bb.fetch2.wget:
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import bb
import urllib.request, urllib.parse, urllib.error
from bb.fetch2 import URI
from bb.fetch2 import FetchMethod
from bb.fetch2 import runfetchcmd
class SFTP(FetchMethod):
"""Class to fetch urls via 'sftp'"""
def supports(self, ud, d):
"""
Check to see if a given url can be fetched with sftp.
"""
return ud.type in ['sftp']
def recommends_checksum(self, urldata):
return True
def urldata_init(self, ud, d):
if 'protocol' in ud.parm and ud.parm['protocol'] == 'git':
raise bb.fetch2.ParameterError(
"Invalid protocol - if you wish to fetch from a " +
"git repository using ssh, you need to use the " +
"git:// prefix with protocol=ssh", ud.url)
if 'downloadfilename' in ud.parm:
ud.basename = ud.parm['downloadfilename']
else:
ud.basename = os.path.basename(ud.path)
ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
def download(self, ud, d):
"""Fetch urls"""
urlo = URI(ud.url)
basecmd = 'sftp -oBatchMode=yes'
port = ''
if urlo.port:
port = '-P %d' % urlo.port
urlo.port = None
dldir = d.getVar('DL_DIR')
lpath = os.path.join(dldir, ud.localfile)
user = ''
if urlo.userinfo:
user = urlo.userinfo + '@'
path = urlo.path
# Supoprt URIs relative to the user's home directory, with
# the tilde syntax. (E.g. <sftp://example.com/~/foo.diff>).
if path[:3] == '/~/':
path = path[3:]
remote = '%s%s:%s' % (user, urlo.hostname, path)
cmd = '%s %s %s %s' % (basecmd, port, remote, lpath)
bb.fetch2.check_network_access(d, cmd, ud.url)
runfetchcmd(cmd, d)
return True

Some files were not shown because too many files have changed in this diff Show More