- Feb 19, 2014
-
-
Masahiro Yamada authored
Now we are ready to switch over to real Kbuild. This commit disables temporary scripts: scripts/{Makefile.build.tmp, Makefile.host.tmp} and enables real Kbuild scripts: scripts/{Makefile.build,Makefile.host,Makefile.lib}. This switch is triggered by the line in scripts/Kbuild.include -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj We need to adjust some build scripts for U-Boot. But smaller amount of modification is preferable. Additionally, we need to fix compiler flags which are locally added or removed. In Kbuild, it is not allowed to change CFLAGS locally. Instead, ccflags-y, asflags-y, cppflags-y, CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o are prepared for that purpose. Signed-off-by:
Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by:
Gerhard Sittig <gsi@denx.de>
-
- Jan 09, 2014
-
-
Henrik Nordström authored
Provide a way to use any host file or device as a block device in U-Boot. This can be used to provide filesystem access within U-Boot to an ext2 image file on the host, for example. The support is plumbed into the filesystem and partition interfaces. We don't want to print a message in the driver every time we find a missing device. Pass the information back to the caller where a message can be printed if desired. Signed-off-by:
Henrik Nordström <henrik@henriknordstrom.net> Signed-off-by:
Simon Glass <sjg@chromium.org> - Removed change to part.c get_device_and_partition() Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Oct 31, 2013
-
-
Masahiro Yamada authored
Signed-off-by:
Masahiro Yamada <yamada.m@jp.panasonic.com>
-
- Oct 14, 2013
-
-
Wolfgang Denk authored
Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
- Sep 20, 2013
-
-
Mark Langsdorf authored
the gpt_pte wasn't being freed if it was checked against an invalid partition. The resulting memory leakage could make it impossible to repeatedly attempt to load non-existent files in a script. Also, downgrade the message for not finding an invalid partition from a printf() to a debug() so as to minimize message spam in perfectly normal situations. Signed-off-by:
Mark Langsdorf <mark.langsdorf@calxeda.com>
-
- Jul 24, 2013
-
-
Wolfgang Denk authored
Signed-off-by:
Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by:
Tom Rini <trini@ti.com>
-
- Jul 22, 2013
-
-
Lan Yixun (dlan) authored
The problem here is that uboot can't mount ext4 filesystem with commit "50ce4c07" applied. We use hard-coded "SECTOR_SIZE"(512) before this commit, now we introduce (block_dev_desc_t *)->log2blksz to replace this macro. And after we calling do_ls()->fs_set_blk_dev(), the variable log2blksz is not initialized, which it's not correct. And this patch try to solve the problem by caculating the value of log2blksz from variable blksz.
-
- Jul 15, 2013
-
-
Frederic Leroy authored
With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type, which is required to represent block numbers for storage devices that exceed 2TiB (the block size usually is 512B), e.g. recent hard drives We now use lbaint_t for partition offset to reflect the lbaint_t change, and access partitions beyond or crossing the 2.1TiB limit. This required changes to signature of ext4fs_devread(), and type of all variables relatives to block sector. ext2/ext4 fs uses logical block represented by a 32 bit value. Logical block is a multiple of device block sector. To avoid overflow problem when calling ext4fs_devread(), we need to cast the sector parameter. Signed-off-by:
Frédéric Leroy <fredo@starox.org>
-
- Jun 04, 2013
-
-
Marek Vasut authored
Make sure to never access beyond bounds of either EFI partition name or DOS partition name. This situation is happening: part.h: disk_partition_t->name is 32-byte long part_efi.h: gpt_entry->partition_name is 36-bytes long The loop in part_efi.c copies over 36 bytes and thus accesses beyond the disk_partition_t->name . Fix this by picking the shortest of source and destination arrays and make sure the destination array is cleared so the trailing bytes are zeroed-out and don't cause issues with string manipulation. Signed-off-by:
Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@ti.com> Cc: Simon Glass <sjg@chromium.org>
-
- May 01, 2013
-
-
Egbert Eich authored
For ISO we check the block size of the device if this is != the CD sector size we assume that the device has no ISO partition. Signed-off-by:
Egbert Eich <eich@suse.com>
-
Egbert Eich authored
Disks beyond 2T in size use blocksizes of 4096 bytes. However a lot of code in u-boot still assumes a 512 byte blocksize. This patch fixes the handling of GPTs. Signed-off-by:
Egbert Eich <eich@suse.com>
-
Egbert Eich authored
Devices that used to have a whole disk FAT filesystem but got then partitioned will most likely still have a FAT or FAT32 signature in the first sector as this sector does not get overwritten by a partitioning tool (otherwise the tool would risk to kill the mbr). The current partition search algorithm will erronously detects such a device as a raw FAT device. Instead of looking for the FAT or FAT32 signatures immediately we use the same algorithm as used by the Linux kernel and first check for a valid boot indicator flag on each of the 4 partitions. If the value of this flag is invalid for the first entry we then do the raw partition check. If the flag for any higher partition is wrong we assume the device is neiter a MBR nor PBR device. Signed-off-by:
Egbert Eich <eich@suse.com>
-
- Apr 02, 2013
-
-
Marc Dietrich authored
start_sect is not aligned to a 4 byte boundary thus causing exceptions on ARM platforms. Access this field via the get_unaligned_le32 macro. Signed-off-by:
Marc Dietrich <marvin24@gmx.de>
-
- Mar 14, 2013
-
-
Stephen Warren authored
This set of ifdefs is used in a number of places. Move its definition somewhere common so it doesn't have to be repeated. Signed-off-by:
Stephen Warren <swarren@nvidia.com> Acked-by:
Simon Glass <sjg@chromium.org> Acked-by:
Tom Rini <trini@ti.com> Signed-off-by:
Tom Warren <twarren@nvidia.com>
-
- Mar 04, 2013
-
-
Simon Glass authored
This allows reading of files from the host filesystem in sandbox. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Tom Rini <trini@ti.com>
-
- Dec 13, 2012
-
-
Łukasz Majewski authored
The restoration of GPT table (both primary and secondary) is now possible. Function 'gpt_restore' presents example of partition restoration process. Signed-off-by:
Lukasz Majewski <l.majewski@samsung.com> Signed-off-by:
Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com>
-
Chang Hyun Park authored
Custom definitions of le_XX_to_int functions have been replaced with standard ones, defined at <compiler.h> Replacement of several GPT related structures members with ones indicating its endianness and proper size. Signed-off-by:
Chang Hyun Park <heartinpiece@outlook.com> Signed-off-by:
Lukasz Majewski <l.majewski@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com>
-
Łukasz Majewski authored
This move is necessary to export gpt header and GPT partition entries to be used with other commands or subsystems. Additionally the part_efi.h file has been cleaned-up to supress checkpatch's warnings. Signed-off-by:
Lukasz Majewski <l.majewski@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com>
-
- Dec 06, 2012
-
-
Jerry Huang authored
In order to calculate the capability, we use the below expression to check: ((dev_desc->lba * dev_desc->blksz)>0L) If the capability is greater than 4GB (e.g. 8GB = 8 * 1024 * 104 * 1024), the result will overflow, the low 32bit may be zero. Therefore, change to check each variable to fix this potential issue. Signed-off-by:
Jerry Huang <Chang-Ming.Huang@freescale.com>
-
- Oct 22, 2012
-
-
Taylor Hutt authored
This change addresses a few printf-formatting errors, and a typecast error. Signed-off-by:
Taylor Hutt <thutt@chromium.org> Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Gabe Black authored
Currently, if the disk partition code is compiled with all of the parition types compiled out, it hits an #error which stops the build. This change adjusts that file so that those functions will fall through to their defaults in those cases instead of breaking the build. These functions are needed because other code calls them, and that code is needed because other config options are overly broad and bring in support we don't need along with support we do. Also reduce repetition of the 6-term #ifdef throughout the file. Signed-off-by:
Gabe Black <gabeblack@chromium.org> Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Oct 19, 2012
-
-
Stephen Warren authored
When get_device_and_partition() finds a disk without a partition table, under some conditions, it "returns" a disk_partition_t that describes the entire raw disk. Make sure to initialize all fields in the partition descriptor in that case. The value chosen for name is just some arbitrary descriptive string. The value chosen for info matches the check at the end of get_device_and_partition(). However, it's probably not that important; it's not obvious that the value is really used. Reported-by:
Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by:
Stephen Warren <swarren@nvidia.com> Reviewed-by:
Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by:
Tom Rini <trini@ti.com>
-
- Oct 17, 2012
-
-
Stephen Warren authored
This information may be useful to compare against command "part uuid", or if you want to manually paste the information into the kernel command-line. Signed-off-by:
Stephen Warren <swarren@nvidia.com> [trini: print_one_part / print_part_dos output strings didn't quite match before the changes] Signed-off-by:
Tom Rini <trini@ti.com>
-
Stephen Warren authored
Minor cleanups required so later patches don't trigger checkpatch. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
A partition is considered bootable if it either has the "legacy BIOS bootable" flag set, or if the partition type UUID matches the standard "system" type. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
When printing the EFI partition table, print the raw attributes. Convert struct gpt_entry_attributes to a union to allow raw access. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
Add no_block_io_protocol and legacy_bios_bootable attribute definitions. These are sourced from UEFI Spec 2.3, page 105, table 19. Credits to the libparted source for the specification pointer. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
When printing the partition table, print the partition type UUID and the individual partition UUID. Do this unconditionally, since partition UUIDs are useful. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
The partition name is a long variable-length string. Move it last on the line to ensure consistent layout and that the entries align with the "header" line. Also, surround it in quotes, so if it's empty, it's obvious that something is still being printed. Also, change the case of the LBA numbers; lower-case looks nicer in my opinion, and will be more consistent with the UUID printing that is added later in this series. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
Simplify the partition printing loop in print_part_efi() to bail out early when the first invalid partition is found, rather than indenting the whole body of the loop. This simplifies later patches. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
When no valid partitions are found, guarantee that we return -1. This most likely already happens, since the most recent get_partition_info() will have returned an error. However, it's best to be explicit. Remove an unnecessary assignment of ret=0 in the success case; this value is over-written with the processed partition ID later. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
- Oct 08, 2012
-
-
Stephen Warren authored
Logically, a disk that contains a raw FAT filesystem does not in fact have a partition table. However, test_part_dos() was claiming that such disks did in fact have a DOS-style partition table. This caused get_device_and_partition() not to return a whole-disk disk_partition_t, since part_type != PART_TYPE_UNKNOWN. part_dos.c's print_partition_extended() detected the raw FAT filesystem condition and printed a fake partition table that encompassed the whole disk. However, part_dos.c's get_partition_info_extended() did not return any valid partitions in this case. This combination caused get_device_and_partition() not to find any valid partitions, and hence to return an error. Fix test_part_dos() not to claim that raw FAT filesystems are DOS partition tables. In turn, this causes get_device_and_partition() to return a whole-disk disk_partition_t, and hence the following commands work: fatls mmc 0 / fatls mmc 0:auto / An alternative would be to modify print_partition_extended() to detect raw FAT filesystems, just like print_partition_extended() does, and to return a fake partition in this case. However, this seems logically incorrect, and also duplicates code, since get_device_and_partition() falls back to returning a whole-disk partition when there is no partition table on the device. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
- Sep 28, 2012
-
-
Stephen Warren authored
Commit 10a37fd7 "disk: get_device_and_partition() "auto" partition" prevented the use of "-" on the command-line to request fallback to the $bootdevice environment variable instead. This patch allows that, or an empty string "" to be used. Tested: setenv bootfile /boot/zImage setenv bootdevice 0:1 ext2load mmc 0:1 ext2load mmc - ext2load mmc "" Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
- Sep 25, 2012
-
-
Stephen Warren authored
The MSDOS/MBR partition table includes a 32-bit unique ID, often referred to as the NT disk signature. When combined with a partition number within the table, this can form a unique ID similar in concept to EFI/GPT's partition UUID. This patch generates UUIDs in the format 0002dd75-01, which matches the format expected by the Linux kernel. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
Each EFI partition table entry contains a UUID. Extend U-Boot's struct disk_partition to be able to store this information, and modify get_partition_info_efi() to fill it in. The implementation of uuid_string() was derived from the Linux kernel, tag v3.6-rc4 file lib/vsprintf.c function uuid_string(). Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
Enhance get_partition_info_efi() to range-check the partition number. This prevents invalid partitions being accessed, and prevents access beyond the end of the gpt_pte[] array. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
Rework get_device_and_partition() to: a) Implement a new partition ID of "auto", which requests that U-Boot search for the first "bootable" partition, and fall back to the first valid partition if none is found. This way, users don't need to specify an explicit partition in their commands. b) Make use of get_device(). c) Add parameter to indicate whether returning a whole device is acceptable, or whether a partition is mandatory. d) Make error-checking of the user's device-/partition-specification more complete. In particular, if strtoul() doesn't convert all characters, it's an error rather than just ignored. The resultant device/partition returned by the function will be as follows, based on whether the disk has a partition table (ptable) or not, and whether the calling command allows the whole device to be returned or not. (D and P are integers, P >= 1) D D: No ptable: !allow_whole_dev: error allow_whole_dev: device D ptable: device D partition 1 D:0 !allow_whole_dev: error allow_whole_dev: device D D:P No ptable: error ptable: device D partition P D:auto No ptable: !allow_whole_dev: error allow_whole_dev: device D ptable: first partition in device D with bootable flag set. If none, first valid paratition in device D. Note: In order to review this patch, it's probably easiest to simply look at the file contents post-application, rather than reading the patch itself. Signed-off-by:
Rob Herring <rob.herring@calxeda.com> [swarren: Rob implemented scanning for bootable partitions. I fixed a couple of issues there, switched the syntax to ":auto", added the error-checking rework, and ":0" syntax for the whole device] Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Stephen Warren authored
This patch introduces function get_device(). This looks up a block_dev_desc_t from an interface name (e.g. mmc) and device number (e.g. 0). This function is essentially the non-partition-specific prefix of get_device_and_partition(). Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
Rob Herring authored
All block device related commands (scsiboot, fatload, ext2ls, etc.) have simliar duplicated device and partition parsing and selection code. This adds a common function to replace various implementations. The new function has an enhancement over current versions. If no device or partition is specified on the command line, the bootdevice env variable will be used (scsiboot does this). Signed-off-by:
Rob Herring <rob.herring@calxeda.com>
-
Rob Herring authored
Determine which partitions are bootable/active. In the partition listing, print "Boot" for partitions with the bootable/active flag set. Signed-off-by:
Rob Herring <rob.herring@calxeda.com>
-