When an ARM kernel is built with CONFIG_EFI enabled, then the
kernel image also looks like a EXE file. Move ARM zImage detection
before EXE detection so that the kernel is still detected as zImage.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This will automatically call barebox_update for the transfered file if
it is an ARM Barebox image and the destination file is defined by some
update handler.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Deleted pieces of code detect MBR-containig device as a FAT-type device,
if it's first partition contains a FAT filesystem. This behaviour enabled one
to mount the FAT FS which is either directly on the device (disk0) or on
the first partition (disk0.0) using the same command:
mount /dev/disk0 /fat
However, the desired behaviour can be reached with a:
mount /dev/disk0 /fat || mount /dev/disk0.0 /fat || echo "Mounting failed"
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
detect_fs would usually mount a device on a directory,
so, use a device-specific type detection.
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sometimes mbr is erroneously recocognised as FAT partion. Due to this the mbr
partition parser is not being called and the partitions on the media are not
detected. This patch should fix the problem. The checking is done as in the
linux kernel.
I have seen the problem using usb sticks. Although partitioning and formatting
them under linux. The file system type field in the mbr remains there which
causes the wrong detections as FAT32 type and not as mbr.
Signed-off-by: Zahari Doychev <zahari.doychev@linux.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds support for extracting LZ4-compressed kernel images,
as well as LZ4-compressed ramdisk images in the kernel boot process.
This depends on the patch below
decompressor: Add LZ4 decompressor module
Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
GPT need to be check before MBR
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Pass the buffer size to the file detection code. This makes sure we do not
read past the buffer. This is especially useful for ext filesystem detection
as the magic is at byte offset 1080. Also introduce a FILE_TYPE_SAFE_BUFSIZE
define which is set to the minimum bufsize the detection code needs to detect
all known filetypes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The filetype strings are not really suitable for shell scripts, so
add a shortname array of filetypes usable for shell scripts.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We may have some disk with MBR as a first sector. In this case, the
current FAT check returns an error. However, the FAT sector exist and
the MBR can tell us where it is.
This patch add to file_name_detect_type function the ability to find
the FAT boot sector on the first sector of the first partition in case
it is not on sector 0.
It also introduce is_fat_or_mbr to check if a buffer is a FAT boot
or MBR sector
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add functions to read the barebox_arm_head, check barebox magicword
and read out the barebox image size.
Create a inital partion of 1Mb to access the barebox image on nand.
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This is a brown paper bag type of bugs. Do not assume that a file
has to be at minimun 512 bytes to be detectable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Several filetypes can be autodetected. Barebox could make use
of this in several ways:
- Add a command to detect filetypes
- detect arm zImages and uImages to unify the different boot commands
- maybe detect UBI or JFFS2 images to construct parts of the kernel
command line
- select correct uncompression function based on filetype
This patch adds basic support to detect filetypes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>