* [PATCH] wic: Add SD/MMC-Cards support
@ 2014-03-18 16:05 João Henrique Ferreira de Freitas
2014-03-18 16:05 ` [PATCH] wic: Add SD/MMC-Cards support to '--ondisk' param João Henrique Ferreira de Freitas
2014-03-18 16:35 ` [PATCH] wic: Add SD/MMC-Cards support Otavio Salvador
0 siblings, 2 replies; 6+ messages in thread
From: João Henrique Ferreira de Freitas @ 2014-03-18 16:05 UTC (permalink / raw)
To: openembedded-core; +Cc: tom.zanussi
If the following .wks is set up to mmcblk0 (sdcard)
part /boot --source bootimg-pcbios --ondisk mmcblk0 --fstype=msdos --label boot --active --align 1024
part / --source rootfs --ondisk mmcblk0 --fstype=ext3 --label platform --align 1024
bootloader --timeout=0 --append="rootwait rootfstype=ext3 video=vesafb vga=0x318 console=tty0"
And the user inspect this file /var/tmp/wic/build/hdd/boot/syslinux.cfg,
the 'root=' will be '/dev/mmcblk02' instead of '/dev/mmcblk0p2'.
This patch add the support to constrain the disk and make the adjusts when
mmcblk devices are used.
I am not sure if is not necessary to fix others places. Until now it's the single point.
João Henrique Ferreira de Freitas (1):
wic: Add SD/MMC-Cards support to '--ondisk' param
scripts/lib/mic/imager/direct.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--
1.8.3.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] wic: Add SD/MMC-Cards support to '--ondisk' param
2014-03-18 16:05 [PATCH] wic: Add SD/MMC-Cards support João Henrique Ferreira de Freitas
@ 2014-03-18 16:05 ` João Henrique Ferreira de Freitas
2014-03-21 17:52 ` Tom Zanussi
2014-03-22 22:41 ` [PATCH v2] " João Henrique Ferreira de Freitas
2014-03-18 16:35 ` [PATCH] wic: Add SD/MMC-Cards support Otavio Salvador
1 sibling, 2 replies; 6+ messages in thread
From: João Henrique Ferreira de Freitas @ 2014-03-18 16:05 UTC (permalink / raw)
To: openembedded-core; +Cc: tom.zanussi
The special case when wic is set up to use SD/MMC-Cards in place
of sdX disks is not handled properly.
Append 'p' to the rootdev when disk is SD/MMC-Cards fix this situation.
---
scripts/lib/mic/imager/direct.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index f8c300c..1f2f8fc 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -345,10 +345,14 @@ class DirectImageCreator(BaseImageCreator):
parts = self._get_parts()
for num, p in enumerate(parts, 1):
if p.mountpoint == "/":
+ part = ''
+ if p.disk.startswith('mmcblk'):
+ part = 'p'
+
if self._ptable_format == 'msdos' and num > 3:
- rootdev = "/dev/%s%-d" % (p.disk, num + 1)
+ rootdev = "/dev/%s%s%-d" % (p.disk, part, num + 1)
else:
- rootdev = "/dev/%s%-d" % (p.disk, num)
+ rootdev = "/dev/%s%s%-d" % (p.disk, part, num)
root_part_uuid = p.part_type
return (rootdev, root_part_uuid)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] wic: Add SD/MMC-Cards support
2014-03-18 16:05 [PATCH] wic: Add SD/MMC-Cards support João Henrique Ferreira de Freitas
2014-03-18 16:05 ` [PATCH] wic: Add SD/MMC-Cards support to '--ondisk' param João Henrique Ferreira de Freitas
@ 2014-03-18 16:35 ` Otavio Salvador
2014-03-19 12:52 ` João Henrique Freitas
1 sibling, 1 reply; 6+ messages in thread
From: Otavio Salvador @ 2014-03-18 16:35 UTC (permalink / raw)
To: João Henrique Ferreira de Freitas
Cc: Tom Zanussi, Patches and discussions about the oe-core layer
On Tue, Mar 18, 2014 at 1:05 PM, João Henrique Ferreira de Freitas
<joaohf@gmail.com> wrote:
> If the following .wks is set up to mmcblk0 (sdcard)
>
> part /boot --source bootimg-pcbios --ondisk mmcblk0 --fstype=msdos --label boot --active --align 1024
> part / --source rootfs --ondisk mmcblk0 --fstype=ext3 --label platform --align 1024
>
> bootloader --timeout=0 --append="rootwait rootfstype=ext3 video=vesafb vga=0x318 console=tty0"
>
> And the user inspect this file /var/tmp/wic/build/hdd/boot/syslinux.cfg,
> the 'root=' will be '/dev/mmcblk02' instead of '/dev/mmcblk0p2'.
>
> This patch add the support to constrain the disk and make the adjusts when
> mmcblk devices are used.
>
> I am not sure if is not necessary to fix others places. Until now it's the single point.
I think this is a sub-optimal solution; we ought to add support for
UUID as this is ensure to be stable across boot iterations; we cannot
guarantee all kernels will enumerate the devices in same order,
specially in DeviceTree time where this is async. There are some
patches merged in master to partially address this issue for the grub
and maybe you could see if a similar approach fits here as well.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wic: Add SD/MMC-Cards support
2014-03-18 16:35 ` [PATCH] wic: Add SD/MMC-Cards support Otavio Salvador
@ 2014-03-19 12:52 ` João Henrique Freitas
0 siblings, 0 replies; 6+ messages in thread
From: João Henrique Freitas @ 2014-03-19 12:52 UTC (permalink / raw)
To: Otavio Salvador
Cc: Tom Zanussi, Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 801 bytes --]
Hi Otavio
On Tue, Mar 18, 2014 at 1:35 PM, Otavio Salvador <otavio@ossystems.com.br>wrote:
> > I am not sure if is not necessary to fix others places. Until now it's
> the single point.
>
> I think this is a sub-optimal solution; we ought to add support for
> UUID as this is ensure to be stable across boot iterations;
You mean filesystem UUID or GUID ?
I think the root= kernel param accept a valid GUID
(<kernel>/init/do_mounts.c) not fs UUID.
wic has some code to support gpt partitions. So GUID will be passed to
kernel root param (if the .wks was enable to it). I have never used but I
am going to try.
The patch fixes the mbr partitions (which is the default of wic).
Thanks.
--
João Henrique Ferreira de Freitas - joaohf_at_gmail.com
Campinas-SP-Brasil
[-- Attachment #2: Type: text/html, Size: 1368 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wic: Add SD/MMC-Cards support to '--ondisk' param
2014-03-18 16:05 ` [PATCH] wic: Add SD/MMC-Cards support to '--ondisk' param João Henrique Ferreira de Freitas
@ 2014-03-21 17:52 ` Tom Zanussi
2014-03-22 22:41 ` [PATCH v2] " João Henrique Ferreira de Freitas
1 sibling, 0 replies; 6+ messages in thread
From: Tom Zanussi @ 2014-03-21 17:52 UTC (permalink / raw)
To: João Henrique Ferreira de Freitas; +Cc: openembedded-core
On Tue, 2014-03-18 at 13:05 -0300, João Henrique Ferreira de Freitas
wrote:
> The special case when wic is set up to use SD/MMC-Cards in place
> of sdX disks is not handled properly.
>
> Append 'p' to the rootdev when disk is SD/MMC-Cards fix this situation.
This is missing your Signed-off-by. Other than that,
Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> ---
> scripts/lib/mic/imager/direct.py | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
> index f8c300c..1f2f8fc 100644
> --- a/scripts/lib/mic/imager/direct.py
> +++ b/scripts/lib/mic/imager/direct.py
> @@ -345,10 +345,14 @@ class DirectImageCreator(BaseImageCreator):
> parts = self._get_parts()
> for num, p in enumerate(parts, 1):
> if p.mountpoint == "/":
> + part = ''
> + if p.disk.startswith('mmcblk'):
> + part = 'p'
> +
> if self._ptable_format == 'msdos' and num > 3:
> - rootdev = "/dev/%s%-d" % (p.disk, num + 1)
> + rootdev = "/dev/%s%s%-d" % (p.disk, part, num + 1)
> else:
> - rootdev = "/dev/%s%-d" % (p.disk, num)
> + rootdev = "/dev/%s%s%-d" % (p.disk, part, num)
> root_part_uuid = p.part_type
>
> return (rootdev, root_part_uuid)
> --
> 1.8.3.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] wic: Add SD/MMC-Cards support to '--ondisk' param
2014-03-18 16:05 ` [PATCH] wic: Add SD/MMC-Cards support to '--ondisk' param João Henrique Ferreira de Freitas
2014-03-21 17:52 ` Tom Zanussi
@ 2014-03-22 22:41 ` João Henrique Ferreira de Freitas
1 sibling, 0 replies; 6+ messages in thread
From: João Henrique Ferreira de Freitas @ 2014-03-22 22:41 UTC (permalink / raw)
To: openembedded-core
The special case when wic is set up to use SD/MMC-Cards in place
of sdX disks is not handled properly.
Append 'p' to the rootdev when disk is SD/MMC-Cards fix this situation.
Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
---
changes since previous version:
* add Signed-off-by
scripts/lib/mic/imager/direct.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index f8c300c..1f2f8fc 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -345,10 +345,14 @@ class DirectImageCreator(BaseImageCreator):
parts = self._get_parts()
for num, p in enumerate(parts, 1):
if p.mountpoint == "/":
+ part = ''
+ if p.disk.startswith('mmcblk'):
+ part = 'p'
+
if self._ptable_format == 'msdos' and num > 3:
- rootdev = "/dev/%s%-d" % (p.disk, num + 1)
+ rootdev = "/dev/%s%s%-d" % (p.disk, part, num + 1)
else:
- rootdev = "/dev/%s%-d" % (p.disk, num)
+ rootdev = "/dev/%s%s%-d" % (p.disk, part, num)
root_part_uuid = p.part_type
return (rootdev, root_part_uuid)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-03-22 22:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 16:05 [PATCH] wic: Add SD/MMC-Cards support João Henrique Ferreira de Freitas
2014-03-18 16:05 ` [PATCH] wic: Add SD/MMC-Cards support to '--ondisk' param João Henrique Ferreira de Freitas
2014-03-21 17:52 ` Tom Zanussi
2014-03-22 22:41 ` [PATCH v2] " João Henrique Ferreira de Freitas
2014-03-18 16:35 ` [PATCH] wic: Add SD/MMC-Cards support Otavio Salvador
2014-03-19 12:52 ` João Henrique Freitas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox