public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Mkfs.jffs2 source download....
@ 2006-11-15  0:56 KokHow.Teh
  2006-11-15  1:07 ` Josh Boyer
  0 siblings, 1 reply; 9+ messages in thread
From: KokHow.Teh @ 2006-11-15  0:56 UTC (permalink / raw)
  To: linux-mtd

Hi;
	I try to download jffs2 related source tree from
cvs.infradead.org server and I have the following error while trying to
log into the server:

$ cvs
-d:pserver;proxy=<xxx>;proxyport=<xx>:anoncvs@cvs.infradead.org:/home/cv
s login
Usage: cvs [cvs-options] command [command-options-and-arguments]
  where cvs-options are -q, -n, etc.
    (specify --help-options for a list of options)
  where command is add, admin, etc.
    (specify --help-commands for a list of commands
     or --help-synonyms for a list of command synonyms)
  where command-options-and-arguments depend on the specific command
    (specify -H followed by a command name for command-specific help)
  Specify --help to receive this message

The Concurrent Versions System (CVS) is a tool for version control.
For CVS updates and additional information, see
    the CVS home page at http://www.cvshome.org/ or
    Pascal Molli's CVS site at http://www.loria.fr/~molli/cvs-index.html
login: anonymous
Password:
Login incorrect

login: anoncvs
Password:
Login incorrect

login:

	I use anoncvs as password and I am accessing the server behind a
proxy. Any insight and advice is appreciated....

Regards,
KH

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

* Re: Mkfs.jffs2 source download....
  2006-11-15  0:56 Mkfs.jffs2 source download KokHow.Teh
@ 2006-11-15  1:07 ` Josh Boyer
  2006-11-15  1:09   ` KokHow.Teh
  0 siblings, 1 reply; 9+ messages in thread
From: Josh Boyer @ 2006-11-15  1:07 UTC (permalink / raw)
  To: KokHow.Teh; +Cc: linux-mtd

On Wed, 2006-11-15 at 08:56 +0800, KokHow.Teh@infineon.com wrote:
> Hi;
> 	I try to download jffs2 related source tree from
> cvs.infradead.org server and I have the following error while trying to
> log into the server:

CVS is dead.  Use the git trees.  See
http://linux-mtd.infradead.org/source.html

The kernel tree is mtd-2.6.git and the mtd-utils tree is mtd-utils.git

josh

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

* RE: Mkfs.jffs2 source download....
  2006-11-15  1:07 ` Josh Boyer
@ 2006-11-15  1:09   ` KokHow.Teh
  2006-11-15  1:26     ` Josh Boyer
  0 siblings, 1 reply; 9+ messages in thread
From: KokHow.Teh @ 2006-11-15  1:09 UTC (permalink / raw)
  To: linux-mtd

Hi;
 
>On Wed, 2006-11-15 at 08:56 +0800, KokHow.Teh@infineon.com wrote:
>> Hi;
>> 	I try to download jffs2 related source tree from
cvs.infradead.org 
>> server and I have the following error while trying to log into the 
>> server:

>CVS is dead.  Use the git trees.  See
>http://linux-mtd.infradead.org/source.html

>The kernel tree is mtd-2.6.git and the mtd-utils tree is mtd-utils.git

>josh

I am using RedHat 9.0 host and haven't installed git yet. (BTW, which
git version should I use on RedHat 9.0?) So, apart from git, is there
any other way that I could get the source of mkfs.jffs2?

Thanks & Regards,
KH

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

* RE: Mkfs.jffs2 source download....
  2006-11-15  1:09   ` KokHow.Teh
@ 2006-11-15  1:26     ` Josh Boyer
  2006-11-15  3:15       ` Mkfs.jffs2.c:68:21: sys/acl.h: No such file or directory KokHow.Teh
  0 siblings, 1 reply; 9+ messages in thread
From: Josh Boyer @ 2006-11-15  1:26 UTC (permalink / raw)
  To: KokHow.Teh; +Cc: linux-mtd

On Wed, 2006-11-15 at 09:09 +0800, KokHow.Teh@infineon.com wrote:
> Hi;
> 
> >On Wed, 2006-11-15 at 08:56 +0800, KokHow.Teh@infineon.com wrote:
> >> Hi;
> >> 	I try to download jffs2 related source tree from
> cvs.infradead.org 
> >> server and I have the following error while trying to log into the 
> >> server:
> 
> >CVS is dead.  Use the git trees.  See
> >http://linux-mtd.infradead.org/source.html
> 
> >The kernel tree is mtd-2.6.git and the mtd-utils tree is mtd-utils.git
> 
> >josh
> 
> I am using RedHat 9.0 host and haven't installed git yet. (BTW, which
> git version should I use on RedHat 9.0?) So, apart from git, is there
> any other way that I could get the source of mkfs.jffs2?

I'm not if git will run on RH 9.  You should download it from git.or.cz
and compile it to try.  As for an alternative download location for
mtd-utils:

ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.0.1.tar.gz

josh

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

* Mkfs.jffs2.c:68:21: sys/acl.h: No such file or directory
  2006-11-15  1:26     ` Josh Boyer
@ 2006-11-15  3:15       ` KokHow.Teh
  2006-11-15  8:02         ` Ricard Wanderlof
  0 siblings, 1 reply; 9+ messages in thread
From: KokHow.Teh @ 2006-11-15  3:15 UTC (permalink / raw)
  To: linux-mtd

Hi;

	I am trying to build mtd-utils-1.0.1 using a mips cross
toolchain and I am stumbled at mkfs.jffs2 which includes sys/acl.h and
it is not present anywhere in my mips toolchain include directory but it
is present in my host /usr/include/sys/acl.h Has anybody encoutered this
problem before that you could enlighten me on this?

Thanks & Regards,
KH

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

* Re: Mkfs.jffs2.c:68:21: sys/acl.h: No such file or directory
  2006-11-15  3:15       ` Mkfs.jffs2.c:68:21: sys/acl.h: No such file or directory KokHow.Teh
@ 2006-11-15  8:02         ` Ricard Wanderlof
  2006-11-15 10:04           ` KaiGai Kohei
  0 siblings, 1 reply; 9+ messages in thread
From: Ricard Wanderlof @ 2006-11-15  8:02 UTC (permalink / raw)
  To: KokHow.Teh; +Cc: linux-mtd

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3220 bytes --]


On Wed, 15 Nov 2006, KokHow.Teh@infineon.com wrote:

> 	I am trying to build mtd-utils-1.0.1 using a mips cross
> toolchain and I am stumbled at mkfs.jffs2 which includes sys/acl.h and
> it is not present anywhere in my mips toolchain include directory but it
> is present in my host /usr/include/sys/acl.h Has anybody encoutered this
> problem before that you could enlighten me on this?

We've encountered the same problem. I'll expose my ignorance here and say 
that all I know is that acl.h is used for some form of access control list 
feature that has been introduced to mkfs.jffs2, but I don't really know 
what it is for.

We didn't need this feature either so I made a patch to optionally remove 
it from the source, controlled by a #define; it is included as an 
attachment and in the text below. Don't know if this should really be 
included in the main stream source. Obviously at least two people have 
come up against this as a problem.

/Ricard


--- mtd-utils-1.0.1/mkfs.jffs2.c	2006-09-18 09:42:57.000000000 +0200
+++ mtdutils/mkfs.jffs2.c	2006-10-17 13:40:40.000000000 +0200
@@ -47,6 +47,8 @@
   *  -Erik, November 2002
   */

+#undef HAVE_ACL
+
  #define _GNU_SOURCE
  #include <sys/types.h>
  #include <stdio.h>
@@ -65,7 +67,9 @@
  #include <time.h>
  #include <getopt.h>
  #include <sys/xattr.h>
+#ifdef HAVE_ACL
  #include <sys/acl.h>
+#endif
  #include <byteswap.h>
  #define crc32 __complete_crap
  #include <zlib.h>
@@ -1030,6 +1034,7 @@
  	padword();
  }

+#ifdef HAVE_ACL
  typedef struct xattr_entry {
  	struct xattr_entry *next;
  	uint32_t xid;
@@ -1258,6 +1263,10 @@
  		padword();
  	}
  }
+#else
+/* don't do anything, corresponds to  if (!enable_xattr) return;  above */
+#define write_xattr_entry(x)
+#endif

  static void recursive_populate_directory(struct filesystem_entry *dir)
  {
@@ -1451,9 +1460,11 @@
  	"  -q, --squash            Squash permissions and owners making all files be owned by root\n"
  	"  -U, --squash-uids       Squash owners making all files be owned by root\n"
  	"  -P, --squash-perms      Squash permissions on all files\n"
+#ifdef HAVE_ACL
  	"      --with-xattr        stuff all xattr entries into image\n"
  	"      --with-selinux      stuff only SELinux Labels into jffs2 image\n"
  	"      --with-posix-acl    stuff only POSIX ACL entries into jffs2 image\n"
+#endif
  	"  -h, --help              Display this help text\n"
  	"  -v, --verbose           Verbose operation\n"
  	"  -V, --version           Display version information\n"
@@ -1772,6 +1783,7 @@
  					perror_msg_and_die("cannot open (incremental) file");
  				}
  				break;
+#ifdef HAVE_ACL
  			case 1000:	/* --with-xattr  */
  				enable_xattr |= (1 << JFFS2_XPREFIX_USER)
  						| (1 << JFFS2_XPREFIX_SECURITY)
@@ -1786,6 +1798,7 @@
  				enable_xattr |= (1 << JFFS2_XPREFIX_ACL_ACCESS)
  						| (1 << JFFS2_XPREFIX_ACL_DEFAULT);
  				break;
+#endif
  		}
  	}
  	if (out_fd == -1) {

--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30

[-- Attachment #2: Patch file --]
[-- Type: TEXT/PLAIN, Size: 1990 bytes --]

--- mtd-utils-1.0.1/mkfs.jffs2.c	2006-09-18 09:42:57.000000000 +0200
+++ mtdutils/mkfs.jffs2.c	2006-10-17 13:40:40.000000000 +0200
@@ -47,6 +47,8 @@
  *  -Erik, November 2002
  */
 
+#undef HAVE_ACL
+
 #define _GNU_SOURCE
 #include <sys/types.h>
 #include <stdio.h>
@@ -65,7 +67,9 @@
 #include <time.h>
 #include <getopt.h>
 #include <sys/xattr.h>
+#ifdef HAVE_ACL
 #include <sys/acl.h>
+#endif
 #include <byteswap.h>
 #define crc32 __complete_crap
 #include <zlib.h>
@@ -1030,6 +1034,7 @@
 	padword();
 }
 
+#ifdef HAVE_ACL
 typedef struct xattr_entry {
 	struct xattr_entry *next;
 	uint32_t xid;
@@ -1258,6 +1263,10 @@
 		padword();
 	}
 }
+#else
+/* don't do anything, corresponds to  if (!enable_xattr) return;  above */
+#define write_xattr_entry(x)
+#endif
 
 static void recursive_populate_directory(struct filesystem_entry *dir)
 {
@@ -1451,9 +1460,11 @@
 	"  -q, --squash            Squash permissions and owners making all files be owned by root\n"
 	"  -U, --squash-uids       Squash owners making all files be owned by root\n"
 	"  -P, --squash-perms      Squash permissions on all files\n"
+#ifdef HAVE_ACL
 	"      --with-xattr        stuff all xattr entries into image\n"
 	"      --with-selinux      stuff only SELinux Labels into jffs2 image\n"
 	"      --with-posix-acl    stuff only POSIX ACL entries into jffs2 image\n"
+#endif
 	"  -h, --help              Display this help text\n"
 	"  -v, --verbose           Verbose operation\n"
 	"  -V, --version           Display version information\n"
@@ -1772,6 +1783,7 @@
 					perror_msg_and_die("cannot open (incremental) file");
 				}
 				break;
+#ifdef HAVE_ACL
 			case 1000:	/* --with-xattr  */
 				enable_xattr |= (1 << JFFS2_XPREFIX_USER)
 						| (1 << JFFS2_XPREFIX_SECURITY)
@@ -1786,6 +1798,7 @@
 				enable_xattr |= (1 << JFFS2_XPREFIX_ACL_ACCESS)
 						| (1 << JFFS2_XPREFIX_ACL_DEFAULT);
 				break;
+#endif
 		}
 	}
 	if (out_fd == -1) {

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

* Re: Mkfs.jffs2.c:68:21: sys/acl.h: No such file or directory
  2006-11-15  8:02         ` Ricard Wanderlof
@ 2006-11-15 10:04           ` KaiGai Kohei
  2006-11-15 10:23             ` Ricard Wanderlof
  0 siblings, 1 reply; 9+ messages in thread
From: KaiGai Kohei @ 2006-11-15 10:04 UTC (permalink / raw)
  To: Ricard Wanderlof; +Cc: linux-mtd, KokHow.Teh

[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]

Hi,

>>     I am trying to build mtd-utils-1.0.1 using a mips cross
>> toolchain and I am stumbled at mkfs.jffs2 which includes sys/acl.h and
>> it is not present anywhere in my mips toolchain include directory but it
>> is present in my host /usr/include/sys/acl.h Has anybody encoutered this
>> problem before that you could enlighten me on this?
> 
> We've encountered the same problem. I'll expose my ignorance here and 
> say that all I know is that acl.h is used for some form of access 
> control list feature that has been introduced to mkfs.jffs2, but I don't 
> really know what it is for.

The access control list(ACL) enables higher flexible access control
based on UNIX users and groups than traditional user/group/others model.
'--with-xattr' or '--with-posix-acl' options on mkfs.jffs2 enables to
copy the ACLs associated with any files in host environment into jffs2
image file.
The purpose of this feature is improvement of security in embedded region.

> We didn't need this feature either so I made a patch to optionally 
> remove it from the source, controlled by a #define; it is included as an 
> attachment and in the text below. Don't know if this should really be 
> included in the main stream source. Obviously at least two people have 
> come up against this as a problem.

I don't oppose that you like to make the mkfs.jffs2 configurable.
But it is not certain whether you don't need to enable the ACL feature
_only_, or the whole of xattr feature.

'HAVE_ACL' is misnamed, if you intend to disable the whole of xattr
feature. Or, the scope of disabling is wrong, if you intend to disable
the ACL feature only.
In addition, it is a bit messy to require modifying the source code
to enable or disable xattr feature.

The attached patch enable mkfs.jffs2 to be configurable without any
modification of source code.
You will be able to get mkfs.jffs2 with no xattr support by the following
commands:

% cd mtd-utils
% make WITHOUT_XATTR=1

Thanks,
-- 
Open Source Software Promotion Center, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>

[-- Attachment #2: mkfs.jffs2-xattr-configurable.patch --]
[-- Type: text/x-patch, Size: 2645 bytes --]

--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,10 @@ # Remove the trailing slash to make the 
   BUILDDIR := $(CROSS:-=)
 endif
 
+ifeq ($(WITHOUT_XATTR), 1)
+  CFLAGS += -DWITHOUT_XATTR
+endif
+
 RAWTARGETS = ftl_format flash_erase flash_eraseall nanddump doc_loadbios \
 	mkfs.jffs ftl_check mkfs.jffs2 flash_lock flash_unlock flash_info \
 	flash_otp_info flash_otp_dump mtd_debug flashcp nandwrite \
--- a/mkfs.jffs2.c
+++ b/mkfs.jffs2.c
@@ -64,8 +64,10 @@ #include <libgen.h>
 #include <ctype.h>
 #include <time.h>
 #include <getopt.h>
+#ifndef WITHOUT_XATTR
 #include <sys/xattr.h>
 #include <sys/acl.h>
+#endif
 #include <byteswap.h>
 #define crc32 __complete_crap
 #include <zlib.h>
@@ -1030,6 +1032,7 @@ static void write_special_file(struct fi
 	padword();
 }
 
+#ifndef WITHOUT_XATTR
 typedef struct xattr_entry {
 	struct xattr_entry *next;
 	uint32_t xid;
@@ -1259,6 +1262,10 @@ static void write_xattr_entry(struct fil
 	}
 }
 
+#else /* WITHOUT_XATTR */
+#define write_xattr_entry(x)
+#endif
+
 static void recursive_populate_directory(struct filesystem_entry *dir)
 {
 	struct filesystem_entry *e;
@@ -1416,9 +1423,11 @@ static struct option long_options[] = {
 	{"test-compression", 0, NULL, 't'},
 	{"compressor-priority", 1, NULL, 'y'},
 	{"incremental", 1, NULL, 'i'},
+#ifndef WITHOUT_XATTR
 	{"with-xattr", 0, NULL, 1000 },
 	{"with-selinux", 0, NULL, 1001 },
 	{"with-posix-acl", 0, NULL, 1002 },
+#endif
 	{NULL, 0, NULL, 0}
 };
 
@@ -1451,9 +1460,11 @@ static char *helptext =
 "  -q, --squash            Squash permissions and owners making all files be owned by root\n"
 "  -U, --squash-uids       Squash owners making all files be owned by root\n"
 "  -P, --squash-perms      Squash permissions on all files\n"
+#ifndef WITHOUT_XATTR
 "      --with-xattr        stuff all xattr entries into image\n"
 "      --with-selinux      stuff only SELinux Labels into jffs2 image\n"
 "      --with-posix-acl    stuff only POSIX ACL entries into jffs2 image\n"
+#endif
 "  -h, --help              Display this help text\n"
 "  -v, --verbose           Verbose operation\n"
 "  -V, --version           Display version information\n"
@@ -1772,6 +1783,7 @@ int main(int argc, char **argv)
 						  perror_msg_and_die("cannot open (incremental) file");
 					  }
 					  break;
+#ifndef WITHOUT_XATTR
 			case 1000:	/* --with-xattr  */
 					  enable_xattr |= (1 << JFFS2_XPREFIX_USER)
 						  | (1 << JFFS2_XPREFIX_SECURITY)
@@ -1786,6 +1798,7 @@ int main(int argc, char **argv)
 					  enable_xattr |= (1 << JFFS2_XPREFIX_ACL_ACCESS)
 						  | (1 << JFFS2_XPREFIX_ACL_DEFAULT);
 					  break;
+#endif
 		}
 	}
 	if (out_fd == -1) {

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

* Re: Mkfs.jffs2.c:68:21: sys/acl.h: No such file or directory
  2006-11-15 10:04           ` KaiGai Kohei
@ 2006-11-15 10:23             ` Ricard Wanderlof
  2006-11-15 13:19               ` Josh Boyer
  0 siblings, 1 reply; 9+ messages in thread
From: Ricard Wanderlof @ 2006-11-15 10:23 UTC (permalink / raw)
  To: KaiGai Kohei; +Cc: Linux mtd


On Wed, 15 Nov 2006, KaiGai Kohei wrote:

> The access control list(ACL) enables higher flexible access control
> ...

Thanks for the clarification.

> I don't oppose that you like to make the mkfs.jffs2 configurable.
> But it is not certain whether you don't need to enable the ACL feature
> _only_, or the whole of xattr feature.
> 'HAVE_ACL' is misnamed, if you intend to disable the whole of xattr
> feature. Or, the scope of disabling is wrong, if you intend to disable
> the ACL feature only.
> In addition, it is a bit messy to require modifying the source code
> to enable or disable xattr feature.

I agree totally. The patch I submitted was a quick fix to get it to 
work in our environment, without really knowing what was going on.

> The attached patch enable mkfs.jffs2 to be configurable without any
> modification of source code.

After I submitted the patch I too was thinking about extending 
configuration to the Makefile.

Your patch is obviously much better. I think it would be nice if it were 
included in the mtd-utils tree.

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30

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

* Re: Mkfs.jffs2.c:68:21: sys/acl.h: No such file or directory
  2006-11-15 10:23             ` Ricard Wanderlof
@ 2006-11-15 13:19               ` Josh Boyer
  0 siblings, 0 replies; 9+ messages in thread
From: Josh Boyer @ 2006-11-15 13:19 UTC (permalink / raw)
  To: Ricard Wanderlof; +Cc: Linux mtd, KaiGai Kohei

On 11/15/06, Ricard Wanderlof <ricard.wanderlof@axis.com> wrote:
> > The attached patch enable mkfs.jffs2 to be configurable without any
> > modification of source code.
>
> After I submitted the patch I too was thinking about extending
> configuration to the Makefile.
>
> Your patch is obviously much better. I think it would be nice if it were
> included in the mtd-utils tree.

It has been committed as is.  The patch looked quite good.

josh

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

end of thread, other threads:[~2006-11-15 13:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-15  0:56 Mkfs.jffs2 source download KokHow.Teh
2006-11-15  1:07 ` Josh Boyer
2006-11-15  1:09   ` KokHow.Teh
2006-11-15  1:26     ` Josh Boyer
2006-11-15  3:15       ` Mkfs.jffs2.c:68:21: sys/acl.h: No such file or directory KokHow.Teh
2006-11-15  8:02         ` Ricard Wanderlof
2006-11-15 10:04           ` KaiGai Kohei
2006-11-15 10:23             ` Ricard Wanderlof
2006-11-15 13:19               ` Josh Boyer

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