diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-10-31 17:24:12 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-11-05 08:37:54 +0100 |
commit | 6b12fb727ecbfce6ab4c9151ce69d4d276d4217d (patch) | |
tree | 222dda9ba527f3b60d8cb49dfef50eeaec3e9ed9 | |
parent | a58d8ba424f9b1b915698b3879abfd0afc1ca32b (diff) | |
download | barebox-6b12fb727ecbfce6ab4c9151ce69d4d276d4217d.tar.gz barebox-6b12fb727ecbfce6ab4c9151ce69d4d276d4217d.tar.xz |
blspec: Allow to boot partitions
Instead of only allowing complete devices we now also allow single
partitions to look for bootloader spec entries.
Normally the bootloader spec defines a way to find a partition containing /boot
on a device. On embedded systems it's often useful instead to have only a
single partition image which contains both the kernel and the root filesystems.
This partition image may be written to the device multiple times. With this
patch they can be booted with 'boot emmc0.<partno>'
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/blspec.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common/blspec.c b/common/blspec.c index 8ae09a2676..bf833dac4c 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -369,9 +369,26 @@ int blspec_scan_device(struct blspec *blspec, struct device_d *dev) int blspec_scan_devicename(struct blspec *blspec, const char *devname) { struct device_d *dev; + struct cdev *cdev; + const char *colon; pr_debug("%s: %s\n", __func__, devname); + colon = strchr(devname, '.'); + if (colon) { + char *name = xstrdup(devname); + *strchr(name, '.') = 0; + device_detect_by_name(name); + free(name); + } + + cdev = cdev_by_name(devname); + if (cdev) { + int ret = blspec_scan_cdev(blspec, cdev); + if (!ret) + return 0; + } + dev = get_device_by_name(devname); if (!dev) return -ENODEV; |