Commit Graph

59 Commits

Author SHA1 Message Date
6d0830b26f Fix do_image_rpi_sdimg/do_image_wic dependencies
The dependency resolution code in bitbake has recently been optimized and this
seems to have slightly changed the behaviour of do_image_rpi_sdimg and
do_image_wic. We ensure that the main build artifacts are present by depending
on the relevant do_deploy and do_populate_sysroot tasks. However, we need to
ensure that other build tasks for these dependencies have also been executed
before we try to create our image. This can be achieved by adding a recursive
dependency on do_build, so that the do_build tasks of all recipes in the
dependency chain of do_image_rpi_sdimg/do_image_wic are executed before the
image function itself is executed.

The original issue seen here was that 'recipedata' files were not copied to
'tmp/deploy/licenses' as do_populate_lic for each dependency had not been ran
before the image creation function. The write_deploy_manifest function from
license.bbclass (listed in IMAGE_POSTPROCESS_COMMAND) therefore failed. Adding
the recursive dependency on do_build fixes this issue, ensuring do_populate_lic
runs before do_image_rpi_sdimg/do_image_wic.

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
2018-02-28 18:02:58 +00:00
37e4e18f4a sdcard_image-rpi: Use un-timestamped link to rootfs partition image
The timestamp in the rootfs partition image filename may not match the current
timestamp if the do_image_rpi_sdimg step is repeated without repeating the
previous do_image_ext3 (or similar) step.

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
2017-09-24 20:39:35 +01:00
134e7dd943 sdcard_image-rpi: Drop unnecessary sync commands
These commands are unnecessary and seem to mask failures to find the rootfs.ext3
file when re-running the do_image_rpi_sdimg stage without re-running the
preceeding do_image_ext3 stage.

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
2017-09-24 20:39:35 +01:00
e9bb7f0c6d Support using u-boot with Image format for raspberrypi3-64
For raspberrypi3-64 we need to use the Image or Image.gz format with u-boot
instead of the legacy uImage format. We also need to issue the 'booti' command
to boot the kernel instead of 'bootm'.

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
2017-09-24 20:39:35 +01:00
cbd2412fb4 linux-raspberrypi-base.bbclass: Drop
The only remaining function in linux-raspberrypi-base was split_overlays() which
is used in the sdcard_image-rpi class. So we can move this function over and
drop the now-empty linux-raspberrypi-base class.

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
2017-09-24 20:39:35 +01:00
8311d16e59 linux-raspberrypi: Drop unnecessary code
* The kerneltype variable is not used anywhere after being set.

* The manipulation of KERNEL_DEVICETREE is effectively a no-op, we read the
  current value in get_dts() and store this back into the same variable.

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
2017-09-24 20:39:35 +01:00
f70b24b1f1 sdcard_image-rpi: fix absolute path in vfat symlink
Fix bitbake complaining with:

ERROR: core-image-minimal-1.0-r0 do_image_complete: sstate found an absolute
path symlink [...].vfat pointing at [...].vfat. Please replace this with a
relative link.

This patch redefines SDIMG_VFAT as a file name instead of a full absolute path,
then fixing the symlink creation by pointing to a relative target. The cp
command that deploys the artifact is changed accordingly to include the
destination path.

Signed-off-by: Andrea Galbusera <gizero@gmail.com>
2017-08-29 16:27:05 +01:00
fc17cd7419 sdcard_image-rpi: replace IMAGE_DEPENDS_rpi-sdimg by do_image_rpi-sdimg[depends]
* oe-core removed IMAGE_DEPENDS -> parsing fails with hint how to fix
* add required task for each recipe

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
2017-06-29 23:00:36 +01:00
a6bb80c935 sdcard_image-rpi.bbclass: deploy vfat partition
This is useful to update the bootloader/vfat partition from u-boot when
you don't want to update everything:

U-Boot> tftpboot 0x1000000 tmp/0VXje
Waiting for Ethernet connection... done.
Using sms0 device
TFTP from server 192.168.0.1; our IP address is 192.168.0.26
Filename 'image.vfat'.
Load address: 0x1000000
Loading: ##################################################  40 MiB
	 2.1 MiB/s
done
Bytes transferred = 41943040 (2800000 hex)
U-Boot> mmc part

Partition Map for MMC device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	8192      	81920     	a63a4fbc-01	0c Boot
  2	90112     	163840    	a63a4fbc-02	83
U-Boot> mmc erase 0x2000 0x14000

MMC erase: dev # 0, block # 8192, count 81920 ... 81920 blocks erased:
OK
U-Boot> mmc write 0x1000000 0x2000 0x14000

MMC write: dev # 0, block # 8192, count 81920 ... 81920 blocks written:
OK
U-Boot>

Signed-off-by: Matthew McClintock <msm-oss@mcclintock.net>
2017-06-21 10:54:32 -05:00
6c8ca9ccf1 sdcard_image: fix sdcard image generation
Rely on  shell environment when copying devicetree
and devicetree overlays to target image.

Signed-off-by: Janek Filus <janek.filus@bytesatwork.ch>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2017-03-11 17:38:06 -08:00
50f769f82c sdcard: Use kernel8.img for 64bit kernel image name
This helps the firmware to identify the kernel as 64bit
image

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2017-02-16 20:53:10 +01:00
3ad29d11e7 Remove True option to getVar calls
getVar() now defaults to expanding by default.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2017-01-18 16:42:59 +01:00
96b9c633d7 linux-raspberrypi-base.bbclass: remove version hack
* no more required (version > 3.17 | > 4.3.x | > 4.4.5)
* causes error with rt kernel

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
2016-12-29 19:23:28 +01:00
3360f98cad sdcard_image-rpi.bbclass: Include boot script when using u-boot
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2016-10-31 15:59:31 +01:00
41689e8fe2 sdcard_image-rpi.bbclass: Remove redundant RPI_KERNEL_VERSION
The value of the RPI_KERNEL_VERSION can change between None and the
kernel version which can result in taskhash mismatch errors while
building images.

The taskhash mismatch errors can be reproduced using:
bitbake -c cleansstate virtual/kernel core-image-minimal && bitbake core-image-minimal

The get_dts() and split_overlays() functions are modified so that the
kernel version argument is optional. If the version is not supplied to
these functions, they will fallback to the Python equivalent of the
expression used for RPI_KERNEL_VERSION.

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2016-10-13 10:39:59 +02:00
4817e2c087 sdcard_image-rpi.bbclass: avoid corrupted images with latest oe-core
oe-core's commit d54339d4b1a7e884de636f6325ca60409ebd95ff creates image in
IMGDEPLOYDIR and copies through sstate to DEPLOY_DIR_IMAGE. That causes
DEPLOY_DIR_IMAGE not valid when calling IMAGE_CMD. Therefore use
IMGDEPLOYDIR for sdcard creation too.

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
2016-09-21 17:34:17 +01:00
1a32817fb8 sdcard_image-rpi.bbclass: support for .dtbo files for dtb overlays
Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
Add support for both extensions for overlays (".dtb" and ".dtbo")

CAUTION: in IMAGE_CMD_rpi-sdimg, 'TMPDIR' is not set, causing 'STAGING_KERNEL_BUILDDIR' to not be expanded, causing get_dts() to not being able to get the kernel version!
To avoid this problem, the kernel version is added in a new variable outside the scope of IMAGE_CMD_rpi-sdimg, and its value passed to get_dts() and split_overlays()!

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
2016-09-21 16:50:32 +01:00
d98f2a74db linux-raspberrypi-base.bbclass: support for .dtbo files for dtb overlays
Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
Add support for both variants of overlays ("-overlay.dtb" and ".dtbo")
Change which variant needs to be supported based on the kernel version

CAUTION: when called from IMAGE_CMD_rpi-sdimg, 'TMPDIR' is not set, causing 'STAGING_KERNEL_BUILDDIR' to not be expanded, causing get_kernelversion_file() to fail!
To avoid this problem, get_dts() and split_overlays() MUST be called with the kernel version parameter set, when called from IMAGE_CMD_rpi-sdimg!

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
2016-09-21 16:47:26 +01:00
4c02c7ce07 sdcard_image-rpi.bbclass: remove redundant IMAGEDATESTAMP
The IMAGE_NAME variable already contains the date and time so it is
redundant to also include the date again with IMAGEDATESTAMP
when writing to image-version-info in the boot partition.

Signed-off-by: Jonathan Liu <net147@gmail.com>
2016-09-16 18:30:08 +01:00
3fb0a1914a sdcard_image-rpi.bbclass: Add the vardepexcludes
The problem reappears because we need to add to the variable
and not assign

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2016-07-13 12:40:40 +01:00
6564e126ae sdcard_image-rpi.bbclass: Exclude DATETIME from task stamp
This helps in fixing occasional error seen quite often

ERROR: wpe-image-1.0-r0 do_image_rpi_sdimg: Taskhash mismatch 7ea6b505bb7a2cc5ca03552bcf3333fa verses 3be7cdad8c4532430d96368c5ca523d4 for /a/builder/home/kraj/work/oe/meta-metrological/recipes-core/images/wp
e-image.bb.do_image_rpi_sdimg
ERROR: Taskhash mismatch 7ea6b505bb7a2cc5ca03552bcf3333fa verses 3be7cdad8c4532430d96368c5ca523d4 for /a/builder/home/kraj/work/oe/meta-metrological/recipes-core/images/wpe-image.bb.do_image_rpi_sdimg

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2016-07-08 14:25:56 +01:00
43ecd9ac99 sdcard_image-rpi: Always install dtb files
We now need dtb files when booting via u-boot.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2016-07-08 12:17:47 +01:00
d49bd07c5b u-boot: Use mainline u-boot recipe from oe-core
The repository used by u-boot-rpi has not been updated since 2012. In the
meantime, mailine u-boot has gained Raspberry Pi support. All we need to do is
set UBOOT_MACHINE to an appropriate value in the machine config files.

Currently configs are only provided for raspberrypi and raspberrypi2. The master
branch of u-boot now also appears to have a config file for raspberrypi3 so
support for this can be added in the future when u-boot is upgraded in oe-core.

The mainline u-boot recipe creates the file "u-boot.bin" instead of
"u-boot.img".

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2016-07-08 12:17:41 +01:00
cd338c26e2 sdcard_image-rpi.bbclass: Fix do_image_rpi_sdimg tashhash mismatch
IMAGE_CMD_rpi-sdimg() uses the IMAGEDATESTAMP variable, so the taskhash
of the function keeps changing. This results in a taskhash mismatch
error.

Fix this by excluding the IMAGEDATESTAMP variable from the checksum.

Change-Id: Ie6f30ad29e279d5312ec655ac4a3bf246c8a04de
Signed-off-by: Jonathan Liu <net147@gmail.com>
2016-05-04 15:52:15 +02:00
8f285bb8f3 sdcard_image: Depend on do_deploy for kernel
SD image is expecting dtb files to be deployed in deploy area, this step
however is done when do_deploy of kernel is finished and we need to pin that in
dependency list, otherwise there are build race conditions during builds
especially visible when building with initramfs enabled.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2016-03-28 16:35:50 +02:00
16718000cf sdcard_image-rpi.bbclass: use existing ROOTFS_SIZE variable
The ROOTFS_SIZE variable is already set to the aligned root filesystem size.

Signed-off-by: Jonathan Liu <net147@gmail.com>
2015-09-23 23:02:58 +03:00
bfe2307cc4 sdcard_image-rpi.bbclass: Allocate more space for boot partition
The boot partition currently has a size of 20 MiB but just the start elf
binaries account almost 12 MiB, which means that only 8 MiB is left for
the kernel image. A recent kernel with many of its options built-in can
easily be more than 4 MiB so let's double the boot partition size to 40
MiB to make sure that it has enough room for the kernel image, the DTBs
and possible even a backup kernel.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
[javier: Extended the commit message]
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
2015-08-09 23:55:55 +02:00
d676d54f04 sdcard_image: Fix sdcard image generation
Recent updates to the MSDOS tools (OE-core is now at 3.0.28) have made
it an error to overwrite an image using mkfs.vfat.  This patch fixes
that problem by removing any old/stale images, thus starting from scratch.

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
2015-08-09 23:51:06 +02:00
4a4373c02d devicetree: auto-disable dts for old kernels
After '6392a63 rpi-base.inc: Use KERNEL_DEVICETREE by default' was
introduced, kernel versions < 3.18 might not be buildable. Since full
device tree support was introduced in 3.18 this change ensures that all
kernel < 3.18 will automatically disable device tree.

Signed-off-by: Petter Mabäcker <petter@technux.se>
2015-06-05 14:49:46 +02:00
54c5451a04 Add support for Raspberry PI 2
Add machine configuration file.
Change the kernel image name on SD card.
Use the defconfig for this machine (bcm2709_defconfig).

Change-Id: I6549d5f49b1ed32ef4d44aca6f7af4234618c1a8
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2015-02-08 14:46:42 +02:00
dedd45f4f8 Use variable for kernel image deployed name on SD card
Change-Id: I4a55b53d337930aae3351629a902dbac832ac958
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2015-02-08 00:30:40 +02:00
2dbc974596 devicetree: Add support for DT overlays with RPi bootloader
Compile overlay device trees and put them in 'overlays/' folder
on sdcard RPi boot partition.

Change-Id: I3da0032b3c2618165008eec1fc94e97824d09099
Signed-off-by: Francois Muller <francois@concept-embarque.fr>
2015-02-07 20:54:37 +01:00
4dc75cedf7 devicetree: Add minimal support with RPi bootloader
[RPi DT info] https://github.com/raspberrypi/documentation/blob/master/configuration/device-tree.md#part-3-using-device-trees-on-raspberry-pi

RPi bootloader detects a DT-ready kernel by checking for a specific trailer in kernel.img.
Using latest raspberrypi/firmware (firmware.inc) enables this check ability.
Using latest raspberrypi/tools (rpi-mkimage.bb) gives access to mkknlimg for adding the
required trailer to kernel image.


If KERNEL_DEVICETREE is filled in, the trailer is added to the kernel image before
kernel install task. While creating the SDCard image, this modified kernel is
put on boot partition (as kernel.img) as well as DeviceTree blobs (.dtb files).
If KERNEL_DEVICETREE is empty, this new process isn't operated, legacy one does.

KERNEL_DEVICETREE for RPi is really supported only starting from linux-rapsberry 3.18+
kernels, so as for now it defaults to empty (in machine config file).

Change-Id: Ifea71bbda729b8f3c47be7ba0ba03be5ad2ceeaa
Signed-off-by: Francois Muller <francois@concept-embarque.fr>
2015-02-05 14:07:00 +01:00
f638f7cf38 sdcard_image-rpi: make rpi-sdimg image dependent on rootfs type
The rootfs may be using a filesystem type other than ext3 so it should
not be hardcoded.

Change-Id: I71c1a96831ce4617b24de7743fe3b70ec5822a33
Signed-off-by: Jonathan Liu <net147@gmail.com>
2014-03-06 00:29:13 +11:00
a760ea5fa2 sdcard_image-rpi: Make rpi-sdimg image dependent on ext3
Change-Id: Ib48c8fd941be5ceb8fe2bcc087f53fb4ef1c0eb5
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2014-02-25 17:47:07 +02:00
c2102292fa sdcard_image-rpi.bbclass: use absolute path to rootfs
Change-Id: Ib513f195351b379dbb9f503dc5927f2018169b95
Signed-off-by: Jonathan Liu <net147@gmail.com>
2014-02-18 22:39:47 +11:00
5e62146ae3 Add initramfs support
Permit to build an image with initramfs.
Add information in README to build with initramfs.

Change-Id: Icb812151a22771717805ec0a82feb7993f462b47
Signed-off-by: Sébastien Mennetrier <s.mennetrier@innotis.org>
2014-02-14 01:23:33 +02:00
d9ce376660 sdcard_image-rpi: Add support for u-boot and uImage
If KERNEL_IMAGETYPE is uImage, use u-boot image as kernel.img and copy uImage
too. Otherwise, use kernel image as kernel.img (as we did until now
unconditionally).

Change-Id: Iac46a57e4266299f2fe5746cb6957dcfc0e90443
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2014-02-09 03:05:13 +02:00
164e87c291 sdcard_image-rpi.bbclass: Allow optional compression
Image files will typically contain lots of null blocks and should compress well.
This will help with distribution of images over slow network links.

Change-Id: Icec7454ff61cd81a2872037037a93ce01191ece5
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2013-11-12 17:17:46 +02:00
770b88b2ce sdcard_image-rpi.bbclass: Fix error in conditional test
When the shell tests for rootfs type I was seeing "[[: not found".  I
use echo and egrep to test for the xz rootfs type to work around this
error.

Signed-off-by: Seth Bollinger <seth.boll@gmail.com>
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2013-05-02 14:11:32 +02:00
c5f81306b5 sdcard_image-rpi: Use the size of the generated rootfs
When constructing the SD card image, the code was using
the inherited ROOTFS_SIZE, which is the size of the
rootfs contents. When building (for example) a compressed
rootfs, this allocates a partition much larger than necessary.

Instead, take the size of the generated rootfs file that is
about to be written into the generated image, and round it
up to the IMAGE_ROOTFS_ALIGNMENT size.

Fix some comments - the alignment is 4MiB, not 4KiB.

Signed-off-by: Jan Schmidt <thaytan@noraisin.net>
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2013-05-02 13:10:14 +02:00
fe5cd81d27 sdcard_image-rpi.bbclass: Copy startup files required for 16MB GPU operation.
start_cd.elf and fixup_cd.dat are required when running the system with
a 16MB GPU memory configuration.  This change copies all files contained
in bcm2835-bootfiles instead of cherry picking.

Signed-off-by: Seth Bollinger <seth.boll@gmail.com>
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2013-05-01 21:20:42 +02:00
cf62711b7c sdcard_image-rpi: Remove RPI_GPU_FIRMWARE and add/remove files to boot partition
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2012-11-27 22:42:43 +02:00
4ed04f4073 sdcard_image-rpi: Use the partition table as described in comments
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2012-10-18 00:40:50 +03:00
e0f7145000 sdcard_image-rpi: Ship config.txt from RPi-config recipe
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2012-09-18 19:16:04 +03:00
ce41133438 sdcard_image-rpi: Fix xzcat command while writing rootfs partition
[GITHUB #74]

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2012-09-18 19:13:55 +03:00
29f4242ad0 sdcard_image-rpi: Ship cmdline.txt file
Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2012-09-16 21:36:53 +03:00
b5d53c70f0 sdcard_image-rpi.bbclass: Inherit image_types as this class will be in IMAGE_CLASSES
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2012-09-16 20:55:02 +03:00
b1331fce45 README: Move RPI_GPU_FIRMWARE instructions to README
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2012-09-16 20:55:01 +03:00
280c217470 sdcard_image-rpi: Fix SDIMG_SIZE
The final SDIMG_SIZE was missing a IMAGE_ROOTFS_ALIGNMENT padding.

[GITHUB #65]

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
2012-09-16 03:17:34 +03:00