Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] wic: Use mke2fs to create the ext2/3/4 image
@ 2014-03-08 22:23 João Henrique Ferreira de Freitas
  2014-03-09  0:15 ` Tom Zanussi
  2014-03-10  1:04 ` Richard Purdie
  0 siblings, 2 replies; 8+ messages in thread
From: João Henrique Ferreira de Freitas @ 2014-03-08 22:23 UTC (permalink / raw)
  To: openembedded-core

OE-core commit f3a95ca6886b55e5819b068bdbd2cceb882d91a6 removed the
populate-extfs.sh. So mke2fs should be used to create ext2/3/4 image.

Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
---
 scripts/lib/mic/kickstart/custom_commands/partition.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
index 91d751e..e0a82f5 100644
--- a/scripts/lib/mic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
@@ -174,7 +174,6 @@ class Wic_PartData(Mic_PartData):
         """
         Prepare content for an ext2/3/4 rootfs partition.
         """
-        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
 
         image_rootfs = rootfs_dir
         rootfs = "%s/rootfs.%s" % (cr_workdir, self.fstype)
@@ -199,11 +198,10 @@ class Wic_PartData(Mic_PartData):
 
         extra_imagecmd = "-i 8192"
 
-        mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, rootfs)
+        mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
+            (self.fstype, extra_imagecmd, rootfs, image_rootfs)
         rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
 
-        populate_cmd = populate_script + " " + image_rootfs + " " + rootfs
-        rc, out = exec_native_cmd(pseudo + populate_cmd, native_sysroot)
 
         # get the rootfs size in the right units for kickstart (Mb)
         du_cmd = "du -Lbms %s" % rootfs
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] wic: Use mke2fs to create the ext2/3/4 image
  2014-03-08 22:23 [PATCH] wic: Use mke2fs to create the ext2/3/4 image João Henrique Ferreira de Freitas
@ 2014-03-09  0:15 ` Tom Zanussi
  2014-03-10  1:04 ` Richard Purdie
  1 sibling, 0 replies; 8+ messages in thread
From: Tom Zanussi @ 2014-03-09  0:15 UTC (permalink / raw)
  To: João Henrique Ferreira de Freitas; +Cc: openembedded-core

On Sat, 2014-03-08 at 19:23 -0300, João Henrique Ferreira de Freitas
wrote:
> OE-core commit f3a95ca6886b55e5819b068bdbd2cceb882d91a6 removed the
> populate-extfs.sh. So mke2fs should be used to create ext2/3/4 image.
> 
> Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>

Thanks for updating this.

Acked-by: Tom Zanussi <tom.zanussi@intel.com>

> ---
>  scripts/lib/mic/kickstart/custom_commands/partition.py | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> index 91d751e..e0a82f5 100644
> --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> @@ -174,7 +174,6 @@ class Wic_PartData(Mic_PartData):
>          """
>          Prepare content for an ext2/3/4 rootfs partition.
>          """
> -        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
>  
>          image_rootfs = rootfs_dir
>          rootfs = "%s/rootfs.%s" % (cr_workdir, self.fstype)
> @@ -199,11 +198,10 @@ class Wic_PartData(Mic_PartData):
>  
>          extra_imagecmd = "-i 8192"
>  
> -        mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, rootfs)
> +        mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
> +            (self.fstype, extra_imagecmd, rootfs, image_rootfs)
>          rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
>  
> -        populate_cmd = populate_script + " " + image_rootfs + " " + rootfs
> -        rc, out = exec_native_cmd(pseudo + populate_cmd, native_sysroot)
>  
>          # get the rootfs size in the right units for kickstart (Mb)
>          du_cmd = "du -Lbms %s" % rootfs
> -- 
> 1.8.3.2
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wic: Use mke2fs to create the ext2/3/4 image
  2014-03-08 22:23 [PATCH] wic: Use mke2fs to create the ext2/3/4 image João Henrique Ferreira de Freitas
  2014-03-09  0:15 ` Tom Zanussi
@ 2014-03-10  1:04 ` Richard Purdie
  2014-03-11  0:05   ` Tom Zanussi
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2014-03-10  1:04 UTC (permalink / raw)
  To: João Henrique Ferreira de Freitas; +Cc: openembedded-core

On Sat, 2014-03-08 at 19:23 -0300, João Henrique Ferreira de Freitas
wrote:
> OE-core commit f3a95ca6886b55e5819b068bdbd2cceb882d91a6 removed the
> populate-extfs.sh. So mke2fs should be used to create ext2/3/4 image.
> 
> Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
> ---
>  scripts/lib/mic/kickstart/custom_commands/partition.py | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> index 91d751e..e0a82f5 100644
> --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> @@ -174,7 +174,6 @@ class Wic_PartData(Mic_PartData):
>          """
>          Prepare content for an ext2/3/4 rootfs partition.
>          """
> -        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
>  
>          image_rootfs = rootfs_dir
>          rootfs = "%s/rootfs.%s" % (cr_workdir, self.fstype)
> @@ -199,11 +198,10 @@ class Wic_PartData(Mic_PartData):
>  
>          extra_imagecmd = "-i 8192"
>  
> -        mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, rootfs)
> +        mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
> +            (self.fstype, extra_imagecmd, rootfs, image_rootfs)
>          rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
>  
> -        populate_cmd = populate_script + " " + image_rootfs + " " + rootfs
> -        rc, out = exec_native_cmd(pseudo + populate_cmd, native_sysroot)
>  
>          # get the rootfs size in the right units for kickstart (Mb)
>          du_cmd = "du -Lbms %s" % rootfs

Don't we need to be careful to find the binary from the native sysroot
here since that is the one with the root directory option?

Cheers,

Richard



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wic: Use mke2fs to create the ext2/3/4 image
  2014-03-10  1:04 ` Richard Purdie
@ 2014-03-11  0:05   ` Tom Zanussi
  2014-03-11  5:06     ` Richard Purdie
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Zanussi @ 2014-03-11  0:05 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On Sun, 2014-03-09 at 18:04 -0700, Richard Purdie wrote:
> On Sat, 2014-03-08 at 19:23 -0300, João Henrique Ferreira de Freitas
> wrote:
> > OE-core commit f3a95ca6886b55e5819b068bdbd2cceb882d91a6 removed the
> > populate-extfs.sh. So mke2fs should be used to create ext2/3/4 image.
> > 
> > Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
> > ---
> >  scripts/lib/mic/kickstart/custom_commands/partition.py | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > index 91d751e..e0a82f5 100644
> > --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> > +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > @@ -174,7 +174,6 @@ class Wic_PartData(Mic_PartData):
> >          """
> >          Prepare content for an ext2/3/4 rootfs partition.
> >          """
> > -        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
> >  
> >          image_rootfs = rootfs_dir
> >          rootfs = "%s/rootfs.%s" % (cr_workdir, self.fstype)
> > @@ -199,11 +198,10 @@ class Wic_PartData(Mic_PartData):
> >  
> >          extra_imagecmd = "-i 8192"
> >  
> > -        mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, rootfs)
> > +        mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
> > +            (self.fstype, extra_imagecmd, rootfs, image_rootfs)
> >          rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
> >  
> > -        populate_cmd = populate_script + " " + image_rootfs + " " + rootfs
> > -        rc, out = exec_native_cmd(pseudo + populate_cmd, native_sysroot)
> >  
> >          # get the rootfs size in the right units for kickstart (Mb)
> >          du_cmd = "du -Lbms %s" % rootfs
> 
> Don't we need to be careful to find the binary from the native sysroot
> here since that is the one with the root directory option?
> 

Hmm, exec_native_cmd(mkfs_cmd, native_sysroot) is being used to do the
'mke2fs -d', which should do the right thing... Am I missing something?

Tom


> Cheers,
> 
> Richard
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wic: Use mke2fs to create the ext2/3/4 image
  2014-03-11  0:05   ` Tom Zanussi
@ 2014-03-11  5:06     ` Richard Purdie
  2014-03-12 19:54       ` Tom Zanussi
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2014-03-11  5:06 UTC (permalink / raw)
  To: Tom Zanussi; +Cc: openembedded-core

On Mon, 2014-03-10 at 19:05 -0500, Tom Zanussi wrote:
> On Sun, 2014-03-09 at 18:04 -0700, Richard Purdie wrote:
> > On Sat, 2014-03-08 at 19:23 -0300, João Henrique Ferreira de Freitas
> > wrote:
> > > OE-core commit f3a95ca6886b55e5819b068bdbd2cceb882d91a6 removed the
> > > populate-extfs.sh. So mke2fs should be used to create ext2/3/4 image.
> > > 
> > > Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
> > > ---
> > >  scripts/lib/mic/kickstart/custom_commands/partition.py | 6 ++----
> > >  1 file changed, 2 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > index 91d751e..e0a82f5 100644
> > > --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > @@ -174,7 +174,6 @@ class Wic_PartData(Mic_PartData):
> > >          """
> > >          Prepare content for an ext2/3/4 rootfs partition.
> > >          """
> > > -        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
> > >  
> > >          image_rootfs = rootfs_dir
> > >          rootfs = "%s/rootfs.%s" % (cr_workdir, self.fstype)
> > > @@ -199,11 +198,10 @@ class Wic_PartData(Mic_PartData):
> > >  
> > >          extra_imagecmd = "-i 8192"
> > >  
> > > -        mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, rootfs)
> > > +        mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
> > > +            (self.fstype, extra_imagecmd, rootfs, image_rootfs)
> > >          rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
> > >  
> > > -        populate_cmd = populate_script + " " + image_rootfs + " " + rootfs
> > > -        rc, out = exec_native_cmd(pseudo + populate_cmd, native_sysroot)
> > >  
> > >          # get the rootfs size in the right units for kickstart (Mb)
> > >          du_cmd = "du -Lbms %s" % rootfs
> > 
> > Don't we need to be careful to find the binary from the native sysroot
> > here since that is the one with the root directory option?
> > 
> 
> Hmm, exec_native_cmd(mkfs_cmd, native_sysroot) is being used to do the
> 'mke2fs -d', which should do the right thing... Am I missing something?

I hadn't realised that the exec_native_cmd took care of resolving the
prefix for you. The populate_script had a prefix because its used with
pseudo (I'd thought it was so it found the right command). 

That does raise another question though, how does this work now pseudo
isn't used?

Cheers,

Richard



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wic: Use mke2fs to create the ext2/3/4 image
  2014-03-11  5:06     ` Richard Purdie
@ 2014-03-12 19:54       ` Tom Zanussi
  2014-03-12 20:34         ` Richard Purdie
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Zanussi @ 2014-03-12 19:54 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On Mon, 2014-03-10 at 22:06 -0700, Richard Purdie wrote:
> On Mon, 2014-03-10 at 19:05 -0500, Tom Zanussi wrote:
> > On Sun, 2014-03-09 at 18:04 -0700, Richard Purdie wrote:
> > > On Sat, 2014-03-08 at 19:23 -0300, João Henrique Ferreira de Freitas
> > > wrote:
> > > > OE-core commit f3a95ca6886b55e5819b068bdbd2cceb882d91a6 removed the
> > > > populate-extfs.sh. So mke2fs should be used to create ext2/3/4 image.
> > > > 
> > > > Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
> > > > ---
> > > >  scripts/lib/mic/kickstart/custom_commands/partition.py | 6 ++----
> > > >  1 file changed, 2 insertions(+), 4 deletions(-)
> > > > 
> > > > diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > > index 91d751e..e0a82f5 100644
> > > > --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > > +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > > @@ -174,7 +174,6 @@ class Wic_PartData(Mic_PartData):
> > > >          """
> > > >          Prepare content for an ext2/3/4 rootfs partition.
> > > >          """
> > > > -        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
> > > >  
> > > >          image_rootfs = rootfs_dir
> > > >          rootfs = "%s/rootfs.%s" % (cr_workdir, self.fstype)
> > > > @@ -199,11 +198,10 @@ class Wic_PartData(Mic_PartData):
> > > >  
> > > >          extra_imagecmd = "-i 8192"
> > > >  
> > > > -        mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, rootfs)
> > > > +        mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
> > > > +            (self.fstype, extra_imagecmd, rootfs, image_rootfs)
> > > >          rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
> > > >  
> > > > -        populate_cmd = populate_script + " " + image_rootfs + " " + rootfs
> > > > -        rc, out = exec_native_cmd(pseudo + populate_cmd, native_sysroot)
> > > >  
> > > >          # get the rootfs size in the right units for kickstart (Mb)
> > > >          du_cmd = "du -Lbms %s" % rootfs
> > > 
> > > Don't we need to be careful to find the binary from the native sysroot
> > > here since that is the one with the root directory option?
> > > 
> > 
> > Hmm, exec_native_cmd(mkfs_cmd, native_sysroot) is being used to do the
> > 'mke2fs -d', which should do the right thing... Am I missing something?
> 
> I hadn't realised that the exec_native_cmd took care of resolving the
> prefix for you. The populate_script had a prefix because its used with
> pseudo (I'd thought it was so it found the right command). 
> 
> That does raise another question though, how does this work now pseudo
> isn't used?
> 

Good point, it did miss pseudo.  Here's a fix to the fix:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-ext2fs-fix-fix



[PATCH] wic: Use pseudo for ext mkfs command

The switchover from populate-exfs.sh to mke2fs forgot to preserve
pseudo, add it back.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/lib/mic/kickstart/custom_commands/partition.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
index e0a82f5..e15150b 100644
--- a/scripts/lib/mic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
@@ -200,7 +200,7 @@ class Wic_PartData(Mic_PartData):
 
         mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
             (self.fstype, extra_imagecmd, rootfs, image_rootfs)
-        rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
+        rc, out = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
 
 
         # get the rootfs size in the right units for kickstart (Mb)
-- 
1.8.3.1



> Cheers,
> 
> Richard
> 




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] wic: Use mke2fs to create the ext2/3/4 image
  2014-03-12 19:54       ` Tom Zanussi
@ 2014-03-12 20:34         ` Richard Purdie
  2014-03-12 20:43           ` Tom Zanussi
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2014-03-12 20:34 UTC (permalink / raw)
  To: Tom Zanussi; +Cc: openembedded-core

On Wed, 2014-03-12 at 14:54 -0500, Tom Zanussi wrote:
> On Mon, 2014-03-10 at 22:06 -0700, Richard Purdie wrote:
> > On Mon, 2014-03-10 at 19:05 -0500, Tom Zanussi wrote:
> > > On Sun, 2014-03-09 at 18:04 -0700, Richard Purdie wrote:
> > > > On Sat, 2014-03-08 at 19:23 -0300, João Henrique Ferreira de Freitas
> > > > wrote:
> > > > > OE-core commit f3a95ca6886b55e5819b068bdbd2cceb882d91a6 removed the
> > > > > populate-extfs.sh. So mke2fs should be used to create ext2/3/4 image.
> > > > > 
> > > > > Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
> > > > > ---
> > > > >  scripts/lib/mic/kickstart/custom_commands/partition.py | 6 ++----
> > > > >  1 file changed, 2 insertions(+), 4 deletions(-)
> > > > > 
> > > > > diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > > > index 91d751e..e0a82f5 100644
> > > > > --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > > > +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > > > @@ -174,7 +174,6 @@ class Wic_PartData(Mic_PartData):
> > > > >          """
> > > > >          Prepare content for an ext2/3/4 rootfs partition.
> > > > >          """
> > > > > -        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
> > > > >  
> > > > >          image_rootfs = rootfs_dir
> > > > >          rootfs = "%s/rootfs.%s" % (cr_workdir, self.fstype)
> > > > > @@ -199,11 +198,10 @@ class Wic_PartData(Mic_PartData):
> > > > >  
> > > > >          extra_imagecmd = "-i 8192"
> > > > >  
> > > > > -        mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, rootfs)
> > > > > +        mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
> > > > > +            (self.fstype, extra_imagecmd, rootfs, image_rootfs)
> > > > >          rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
> > > > >  
> > > > > -        populate_cmd = populate_script + " " + image_rootfs + " " + rootfs
> > > > > -        rc, out = exec_native_cmd(pseudo + populate_cmd, native_sysroot)
> > > > >  
> > > > >          # get the rootfs size in the right units for kickstart (Mb)
> > > > >          du_cmd = "du -Lbms %s" % rootfs
> > > > 
> > > > Don't we need to be careful to find the binary from the native sysroot
> > > > here since that is the one with the root directory option?
> > > > 
> > > 
> > > Hmm, exec_native_cmd(mkfs_cmd, native_sysroot) is being used to do the
> > > 'mke2fs -d', which should do the right thing... Am I missing something?
> > 
> > I hadn't realised that the exec_native_cmd took care of resolving the
> > prefix for you. The populate_script had a prefix because its used with
> > pseudo (I'd thought it was so it found the right command). 
> > 
> > That does raise another question though, how does this work now pseudo
> > isn't used?
> > 
> 
> Good point, it did miss pseudo.  Here's a fix to the fix:
> 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-ext2fs-fix-fix
> 
> 
> 
> [PATCH] wic: Use pseudo for ext mkfs command
> 
> The switchover from populate-exfs.sh to mke2fs forgot to preserve
> pseudo, add it back.
> 
> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> ---
>  scripts/lib/mic/kickstart/custom_commands/partition.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> index e0a82f5..e15150b 100644
> --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> @@ -200,7 +200,7 @@ class Wic_PartData(Mic_PartData):
>  
>          mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
>              (self.fstype, extra_imagecmd, rootfs, image_rootfs)
> -        rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
> +        rc, out = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)

In the original version the full path to mkfs.X was specified, in this
version PATH will be used to find it. Will it find the right version?

Cheers,

Richard



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wic: Use mke2fs to create the ext2/3/4 image
  2014-03-12 20:34         ` Richard Purdie
@ 2014-03-12 20:43           ` Tom Zanussi
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Zanussi @ 2014-03-12 20:43 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On Wed, 2014-03-12 at 13:34 -0700, Richard Purdie wrote:
> On Wed, 2014-03-12 at 14:54 -0500, Tom Zanussi wrote:
> > On Mon, 2014-03-10 at 22:06 -0700, Richard Purdie wrote:
> > > On Mon, 2014-03-10 at 19:05 -0500, Tom Zanussi wrote:
> > > > On Sun, 2014-03-09 at 18:04 -0700, Richard Purdie wrote:
> > > > > On Sat, 2014-03-08 at 19:23 -0300, João Henrique Ferreira de Freitas
> > > > > wrote:
> > > > > > OE-core commit f3a95ca6886b55e5819b068bdbd2cceb882d91a6 removed the
> > > > > > populate-extfs.sh. So mke2fs should be used to create ext2/3/4 image.
> > > > > > 
> > > > > > Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
> > > > > > ---
> > > > > >  scripts/lib/mic/kickstart/custom_commands/partition.py | 6 ++----
> > > > > >  1 file changed, 2 insertions(+), 4 deletions(-)
> > > > > > 
> > > > > > diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > > > > index 91d751e..e0a82f5 100644
> > > > > > --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > > > > +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > > > > > @@ -174,7 +174,6 @@ class Wic_PartData(Mic_PartData):
> > > > > >          """
> > > > > >          Prepare content for an ext2/3/4 rootfs partition.
> > > > > >          """
> > > > > > -        populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
> > > > > >  
> > > > > >          image_rootfs = rootfs_dir
> > > > > >          rootfs = "%s/rootfs.%s" % (cr_workdir, self.fstype)
> > > > > > @@ -199,11 +198,10 @@ class Wic_PartData(Mic_PartData):
> > > > > >  
> > > > > >          extra_imagecmd = "-i 8192"
> > > > > >  
> > > > > > -        mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, rootfs)
> > > > > > +        mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
> > > > > > +            (self.fstype, extra_imagecmd, rootfs, image_rootfs)
> > > > > >          rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
> > > > > >  
> > > > > > -        populate_cmd = populate_script + " " + image_rootfs + " " + rootfs
> > > > > > -        rc, out = exec_native_cmd(pseudo + populate_cmd, native_sysroot)
> > > > > >  
> > > > > >          # get the rootfs size in the right units for kickstart (Mb)
> > > > > >          du_cmd = "du -Lbms %s" % rootfs
> > > > > 
> > > > > Don't we need to be careful to find the binary from the native sysroot
> > > > > here since that is the one with the root directory option?
> > > > > 
> > > > 
> > > > Hmm, exec_native_cmd(mkfs_cmd, native_sysroot) is being used to do the
> > > > 'mke2fs -d', which should do the right thing... Am I missing something?
> > > 
> > > I hadn't realised that the exec_native_cmd took care of resolving the
> > > prefix for you. The populate_script had a prefix because its used with
> > > pseudo (I'd thought it was so it found the right command). 
> > > 
> > > That does raise another question though, how does this work now pseudo
> > > isn't used?
> > > 
> > 
> > Good point, it did miss pseudo.  Here's a fix to the fix:
> > 
> > http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-ext2fs-fix-fix
> > 
> > 
> > 
> > [PATCH] wic: Use pseudo for ext mkfs command
> > 
> > The switchover from populate-exfs.sh to mke2fs forgot to preserve
> > pseudo, add it back.
> > 
> > Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> > ---
> >  scripts/lib/mic/kickstart/custom_commands/partition.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > index e0a82f5..e15150b 100644
> > --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> > +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > @@ -200,7 +200,7 @@ class Wic_PartData(Mic_PartData):
> >  
> >          mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \
> >              (self.fstype, extra_imagecmd, rootfs, image_rootfs)
> > -        rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
> > +        rc, out = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
> 
> In the original version the full path to mkfs.X was specified, in this
> version PATH will be used to find it. Will it find the right version?
> 

Yeah, that's what exec_native_cmd does:

    native_paths = \
        "export PATH=%s/sbin:%s/usr/sbin:%s/usr/bin:$PATH" % \
        (native_sysroot, native_sysroot, native_sysroot)

The original didn't need to specify the full path, not sure why it
did...

Tom

> Cheers,
> 
> Richard
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-03-12 20:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-08 22:23 [PATCH] wic: Use mke2fs to create the ext2/3/4 image João Henrique Ferreira de Freitas
2014-03-09  0:15 ` Tom Zanussi
2014-03-10  1:04 ` Richard Purdie
2014-03-11  0:05   ` Tom Zanussi
2014-03-11  5:06     ` Richard Purdie
2014-03-12 19:54       ` Tom Zanussi
2014-03-12 20:34         ` Richard Purdie
2014-03-12 20:43           ` Tom Zanussi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox