Re: [ptxdist] [PATCH] use ^_ as separator in perms files

2016-07-29 Thread Michael Olbrich
On Fri, Jul 29, 2016 at 01:12:04AM +0200, Ladislav Michl wrote:
> On Wed, Jul 27, 2016 at 12:59:39PM +0200, Michael Olbrich wrote:
> > On Mon, Jul 18, 2016 at 01:22:17PM +0200, Ladislav Michl wrote:
> > > Change separator to allow ':' in filenames.
> > 
> > I like it in general. But I think we should explicitly error out if we come
> > across an old command file (NF == 1). And tell the user to run "ptxdist
> > clean root" or something like that.
> [snip]
> 
> Do you mean something like this (untested):

I think it needs to be added to ptxd_dopermissions as well. I think the
stuff below is called first, but it's optional. Maybe some funtion:

ptxd_check_obsolete_perm() {
if ! grep -q -P "\x1F" "${@}" ; then
ptxd_bailout "obsolete perm file detected, please run 'ptxdist clean 
root'"
fi
}

And call it from both. And note the '-P'. Otherwise the \x is not
interpreted.

Michael

> diff --git a/scripts/lib/ptxd_make_image_fix_permissions.sh 
> b/scripts/lib/ptxd_make_image_fix_permissions.sh
> index c1cfdba..d4bf6b0 100644
> --- a/scripts/lib/ptxd_make_image_fix_permissions.sh
> +++ b/scripts/lib/ptxd_make_image_fix_permissions.sh
> @@ -34,6 +34,11 @@ ptxd_make_image_fix_permissions_check() {
>  local ifs_orig="${IFS}"
>  IFS="\x1F"
>  
> +# previous PTXdist versions used ":" as a separator
> +if ! grep -q "${IFS}" "${ptxd_reply_perm_files[@]}"; then
> +   ptxd_bailout "obsolete perm file detected, please run 'ptxdist clean 
> root'"
> +fi
> +
>  # just care about dev-nodes, for now
>  egrep -h "^[n]${IFS}" "${ptxd_reply_perm_files[@]}" |
>  while read kind file uid_should gid_should prm_should type major_should 
> minor_should; do
> 
> ___
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH] use ^_ as separator in perms files

2016-07-28 Thread Ladislav Michl
On Wed, Jul 27, 2016 at 12:59:39PM +0200, Michael Olbrich wrote:
> On Mon, Jul 18, 2016 at 01:22:17PM +0200, Ladislav Michl wrote:
> > Change separator to allow ':' in filenames.
> 
> I like it in general. But I think we should explicitly error out if we come
> across an old command file (NF == 1). And tell the user to run "ptxdist
> clean root" or something like that.
[snip]

Do you mean something like this (untested):

diff --git a/scripts/lib/ptxd_make_image_fix_permissions.sh 
b/scripts/lib/ptxd_make_image_fix_permissions.sh
index c1cfdba..d4bf6b0 100644
--- a/scripts/lib/ptxd_make_image_fix_permissions.sh
+++ b/scripts/lib/ptxd_make_image_fix_permissions.sh
@@ -34,6 +34,11 @@ ptxd_make_image_fix_permissions_check() {
 local ifs_orig="${IFS}"
 IFS="\x1F"
 
+# previous PTXdist versions used ":" as a separator
+if ! grep -q "${IFS}" "${ptxd_reply_perm_files[@]}"; then
+   ptxd_bailout "obsolete perm file detected, please run 'ptxdist clean 
root'"
+fi
+
 # just care about dev-nodes, for now
 egrep -h "^[n]${IFS}" "${ptxd_reply_perm_files[@]}" |
 while read kind file uid_should gid_should prm_should type major_should 
minor_should; do

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH] use ^_ as separator in perms files

2016-07-27 Thread Michael Olbrich
On Mon, Jul 18, 2016 at 01:22:17PM +0200, Ladislav Michl wrote:
> Change separator to allow ':' in filenames.

I like it in general. But I think we should explicitly error out if we come
across an old command file (NF == 1). And tell the user to run "ptxdist
clean root" or something like that.

Michael

> Signed-off-by: Ladislav Michl 
> ---
>  rules/post/image_cpio.make | 2 +-
>  rules/post/image_ext2.make | 2 +-
>  rules/post/image_jffs2.make| 2 +-
>  rules/post/image_squashfs.make | 2 +-
>  rules/post/image_tgz.make  | 6 +++---
>  rules/post/image_ubi.make  | 2 +-
>  rules/post/ptxd_make_image_common.make | 2 +-
>  scripts/lib/ptxd_lib_dopermissions.awk | 2 +-
>  scripts/lib/ptxd_make_image_fix_permissions.sh | 4 ++--
>  scripts/lib/ptxd_make_xpkg_pkg.sh  | 9 ++---
>  10 files changed, 18 insertions(+), 15 deletions(-)
> 
> diff --git a/rules/post/image_cpio.make b/rules/post/image_cpio.make
> index 573faee..200b283 100644
> --- a/rules/post/image_cpio.make
> +++ b/rules/post/image_cpio.make
> @@ -15,7 +15,7 @@ $(IMAGEDIR)/root.cpio: $(STATEDIR)/image_working_dir
>   @echo -n "Creating '$(notdir $(@))' from working dir..."
>   @cd $(image/work_dir) && \
>   ( \
> - awk -F: $(DOPERMISSIONS) $(image/permissions) && \
> + awk $(DOPERMISSIONS) $(image/permissions) && \
>   echo "find . | cpio --quiet -H newc -o > '$(@)'" \
>   ) | $(FAKEROOT) --
>   @echo "done."
> diff --git a/rules/post/image_ext2.make b/rules/post/image_ext2.make
> index 3e3423b..0dbcafd 100644
> --- a/rules/post/image_ext2.make
> +++ b/rules/post/image_ext2.make
> @@ -15,7 +15,7 @@ ifdef PTXCONF_IMAGE_EXT2
>  $(IMAGEDIR)/root.ext2: $(STATEDIR)/image_working_dir
>   @echo -n "Creating root.ext2 from working dir..."
>   @cd $(image/work_dir);  \
> - (awk -F: $(DOPERMISSIONS) $(image/permissions) &&   \
> + (awk $(DOPERMISSIONS) $(image/permissions) &&   \
>   (   \
>   echo -n "$(PTXCONF_SYSROOT_HOST)/bin/genext2fs ";   \
>   echo -n "-b $(PTXCONF_IMAGE_EXT2_SIZE) ";   \
> diff --git a/rules/post/image_jffs2.make b/rules/post/image_jffs2.make
> index 5e448f5..7f12883 100644
> --- a/rules/post/image_jffs2.make
> +++ b/rules/post/image_jffs2.make
> @@ -17,7 +17,7 @@ $(IMAGEDIR)/root.jffs2: $(STATEDIR)/image_working_dir 
> $(STATEDIR)/host-mtd-utils
>   @echo -n "(--eraseblock=$(PTXCONF_IMAGE_JFFS2_BLOCKSIZE) "
>   @echo "$(call remove_quotes,$(PTXCONF_IMAGE_JFFS2_EXTRA_ARGS)))"
>   @cd $(image/work_dir);  \
> - (awk -F: $(DOPERMISSIONS) $(image/permissions) &&   \
> + (awk $(DOPERMISSIONS) $(image/permissions) &&   \
>   (   \
>   echo -n "$(PTXCONF_SYSROOT_HOST)/sbin/mkfs.jffs2 "; \
>   echo -n "-d $(image/work_dir) ";\
> diff --git a/rules/post/image_squashfs.make b/rules/post/image_squashfs.make
> index 6d02255..69dc721 100644
> --- a/rules/post/image_squashfs.make
> +++ b/rules/post/image_squashfs.make
> @@ -19,7 +19,7 @@ ifdef PTXCONF_IMAGE_SQUASHFS
>  $(IMAGEDIR)/root.squashfs: $(STATEDIR)/image_working_dir 
> $(STATEDIR)/host-squashfs-tools.install.post
>   @echo -n "Creating root.squashfs from working dir..."
>   @cd $(image/work_dir);  
> \
> - (awk -F: $(DOPERMISSIONS) $(image/permissions) &&   \
> + (awk $(DOPERMISSIONS) $(image/permissions) &&   \
>   (   \
>   echo -n "$(PTXCONF_SYSROOT_HOST)/sbin/mksquashfs "; \
>   echo -n "$(image/work_dir) ";   
> \
> diff --git a/rules/post/image_tgz.make b/rules/post/image_tgz.make
> index 57f69f4..bace4da 100644
> --- a/rules/post/image_tgz.make
> +++ b/rules/post/image_tgz.make
> @@ -18,10 +18,10 @@ endif
>  
>  $(IMAGEDIR)/root.tgz: $(STATEDIR)/image_working_dir
>   @echo -n 'Creating root.tgz from working dir$(if $(IMAGE_TGZ_LABEL), 
> with label "$(IMAGE_TGZ_LABEL)",)... '
> - @cd $(image/work_dir);  
> \
> - (awk -F: $(DOPERMISSIONS) $(image/permissions) &&   \
> + @cd $(image/work_dir);  \
> + (awk $(DOPERMISSIONS) $(image/permissions) &&   \
>   (   echo -n "tar ${IMAGE_TGZ_LABEL_ARGS} -zcf ";\
> - echo -n "$@ ." )\
> + echo -n "$@ ." )\
>   ) | $(FAKEROOT)

[ptxdist] [PATCH] use ^_ as separator in perms files

2016-07-18 Thread Ladislav Michl
Change separator to allow ':' in filenames.

Signed-off-by: Ladislav Michl 
---
 rules/post/image_cpio.make | 2 +-
 rules/post/image_ext2.make | 2 +-
 rules/post/image_jffs2.make| 2 +-
 rules/post/image_squashfs.make | 2 +-
 rules/post/image_tgz.make  | 6 +++---
 rules/post/image_ubi.make  | 2 +-
 rules/post/ptxd_make_image_common.make | 2 +-
 scripts/lib/ptxd_lib_dopermissions.awk | 2 +-
 scripts/lib/ptxd_make_image_fix_permissions.sh | 4 ++--
 scripts/lib/ptxd_make_xpkg_pkg.sh  | 9 ++---
 10 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/rules/post/image_cpio.make b/rules/post/image_cpio.make
index 573faee..200b283 100644
--- a/rules/post/image_cpio.make
+++ b/rules/post/image_cpio.make
@@ -15,7 +15,7 @@ $(IMAGEDIR)/root.cpio: $(STATEDIR)/image_working_dir
@echo -n "Creating '$(notdir $(@))' from working dir..."
@cd $(image/work_dir) && \
( \
-   awk -F: $(DOPERMISSIONS) $(image/permissions) && \
+   awk $(DOPERMISSIONS) $(image/permissions) && \
echo "find . | cpio --quiet -H newc -o > '$(@)'" \
) | $(FAKEROOT) --
@echo "done."
diff --git a/rules/post/image_ext2.make b/rules/post/image_ext2.make
index 3e3423b..0dbcafd 100644
--- a/rules/post/image_ext2.make
+++ b/rules/post/image_ext2.make
@@ -15,7 +15,7 @@ ifdef PTXCONF_IMAGE_EXT2
 $(IMAGEDIR)/root.ext2: $(STATEDIR)/image_working_dir
@echo -n "Creating root.ext2 from working dir..."
@cd $(image/work_dir);  \
-   (awk -F: $(DOPERMISSIONS) $(image/permissions) &&   \
+   (awk $(DOPERMISSIONS) $(image/permissions) &&   \
(   \
echo -n "$(PTXCONF_SYSROOT_HOST)/bin/genext2fs ";   \
echo -n "-b $(PTXCONF_IMAGE_EXT2_SIZE) ";   \
diff --git a/rules/post/image_jffs2.make b/rules/post/image_jffs2.make
index 5e448f5..7f12883 100644
--- a/rules/post/image_jffs2.make
+++ b/rules/post/image_jffs2.make
@@ -17,7 +17,7 @@ $(IMAGEDIR)/root.jffs2: $(STATEDIR)/image_working_dir 
$(STATEDIR)/host-mtd-utils
@echo -n "(--eraseblock=$(PTXCONF_IMAGE_JFFS2_BLOCKSIZE) "
@echo "$(call remove_quotes,$(PTXCONF_IMAGE_JFFS2_EXTRA_ARGS)))"
@cd $(image/work_dir);  \
-   (awk -F: $(DOPERMISSIONS) $(image/permissions) &&   \
+   (awk $(DOPERMISSIONS) $(image/permissions) &&   \
(   \
echo -n "$(PTXCONF_SYSROOT_HOST)/sbin/mkfs.jffs2 "; \
echo -n "-d $(image/work_dir) ";\
diff --git a/rules/post/image_squashfs.make b/rules/post/image_squashfs.make
index 6d02255..69dc721 100644
--- a/rules/post/image_squashfs.make
+++ b/rules/post/image_squashfs.make
@@ -19,7 +19,7 @@ ifdef PTXCONF_IMAGE_SQUASHFS
 $(IMAGEDIR)/root.squashfs: $(STATEDIR)/image_working_dir 
$(STATEDIR)/host-squashfs-tools.install.post
@echo -n "Creating root.squashfs from working dir..."
@cd $(image/work_dir);  
\
-   (awk -F: $(DOPERMISSIONS) $(image/permissions) &&   \
+   (awk $(DOPERMISSIONS) $(image/permissions) &&   \
(   \
echo -n "$(PTXCONF_SYSROOT_HOST)/sbin/mksquashfs "; \
echo -n "$(image/work_dir) ";   
\
diff --git a/rules/post/image_tgz.make b/rules/post/image_tgz.make
index 57f69f4..bace4da 100644
--- a/rules/post/image_tgz.make
+++ b/rules/post/image_tgz.make
@@ -18,10 +18,10 @@ endif
 
 $(IMAGEDIR)/root.tgz: $(STATEDIR)/image_working_dir
@echo -n 'Creating root.tgz from working dir$(if $(IMAGE_TGZ_LABEL), 
with label "$(IMAGE_TGZ_LABEL)",)... '
-   @cd $(image/work_dir);  
\
-   (awk -F: $(DOPERMISSIONS) $(image/permissions) &&   \
+   @cd $(image/work_dir);  \
+   (awk $(DOPERMISSIONS) $(image/permissions) &&   \
(   echo -n "tar ${IMAGE_TGZ_LABEL_ARGS} -zcf ";\
-   echo -n "$@ ." )\
+   echo -n "$@ ." )\
) | $(FAKEROOT) --
@echo "done."
 endif
diff --git a/rules/post/image_ubi.make b/rules/post/image_ubi.make
index edfae1d..17321dc 100644
--- a/rules/post/image_ubi.make
+++ b/rules/post/image_ubi.make
@@ -22,7 +22,7 @@ $(IMAGEDIR)/root.ubifs: $(STATEDIR)/image_working_dir 
$(STATEDIR)/host-mtd-utils
@echo -n "-e $(PTXCONF_IMAGE_UBIFS_LEB_SIZE) -c 
$(PTXCO