when $target is a path relative to $objtree the script fails.
This is because we cd to $basedir and then copy to $tempdir which
then is no longer valid. Fix this by converting $tempdir to an
absolute path first.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Christoph Fritz <chf.fritz@googlemail.com>
If barebox is builded out-of-tree we don't find the autogenerated
autoconf.h because we search in the srctree.
With this patch we don't get this error message:
cc1: fatal error: /[...]/barebox/include/generated/autoconf.h: No such file or directory
Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This most likely doesn't fix any real bugs, but it's the
right thing to do and reduces the noise level with static
checkers.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The basic console used for USBboot has two different formattings,
one for text coming from the host and another for text coming from
the target.
This change makes both formattings readable regardless of the
console background color.
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
DFU is for device firmware upgrade, but for development purposes it's
sometmes useful to just start a kernel vie DFU. This adds a boot option
for doing this and also the corresponding counterpart on the host. With
this it's possible to boot a system with:
scripts/dfuboot.sh -k linuximage -d dtb -c "root=ubi0:root ubi.mtd=ubi rootfstype=ubifs ignore_loglevel"
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds a target to generate environment files from directories.
These are compiled into the barebox binary.
use it as:
bbenv-$(CONFIG_SOMETHING) += my-environment
The directory containing the files to compile into the binary
should be named my-environment.
This can be accessed in C code later as:
extern unsigned char __bbenv_my_environment_start[];
extern unsigned char __bbenv_my_environment_end[];
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Finding out whether to rebuild the environment is a difficult task
since we have to track all files in a directory. Instead of trying
this, just rebuild the environment during every build and only if
it differs to the last one overwrite the target. This way make
only sees a change when the environment is changed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Instead of passing the offset to the fix_size tool check the image to
fixup for a valid header so that only recognized files are fixed up.
This makes the usage of this tool safer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We have to use strtoul to run the tool working on 32bit systems.
Otherwise it will generate signed numbers for strings representing
values with the 32nd bit set.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds the crc32 command to be build
as host and optionally as target tool.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Image payload size should always be a multiple of 4 bytes. This fixes
mis-sized image payload by allocating payload buffer as multiple of 4
but load true filesize into the payload buffer.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Xmodem blocks should start with SOH but kwboot never sets the first
block byte. This fixes kwboot's Xmodem block initialization and sets
first block byte to SOH.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The documentation says setupmbr should be used with the image named
'barebox', but it should instead be done with the 'barebox.bin'
image. Attempting to use setupmbr on the ELF barebox image simply
fails:
$ ./scripts/setupmbr/setupmbr -s 32 -m ./barebox -d disk.img
No MBR signature found
barebox image seems not valid: Bad MBR signature
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
"%i" in format string requires a signed integer.
"%d" in format string requires a signed integer.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
In some cases kernel-install can fail without printing anything. Add
error messages for these cases.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds a tool for installing kernels according to the bootloader
spec. systemd already has a similar tool, but it is limited to installing
kernels on the currently running system. The barebox kernel-install
tool instead can also be used to install kernels on removable media on a
development host for cross development. It is compiled in two variants,
as 'kernel-install' for the host and as 'kernel-install-target' using
$CROSS_COMPILE.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
using obj-y for targetprogs only works until only a single program
is compiled. Adding the second one will end up in the linker trying
to link both together.
Add targetprogs-y to fix this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The Altera SoCFPGAs expect a simple header for their first stage
loaders. This adds a tool to generate images for the SoCFPGAs. The
header is either embedded into the image or optionally prepended
to the image. In this case code is added to jump over the image
header.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
this will allow to write the size of barebox at an offset of the binary
this is needed for ARM when using relocated binary
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>