Skip to contentSkip to conversation

mkfs.ubifs: remove features

PATCH New Artem Bityutskiy 1 participant 3 messages Mar 18, 2011 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

cover mkfs.ubifs: remove features

We have the feature-removal-schedule.txt file where we documented the plan for changing API for some mtd tools. We made some preparations for this by printing warnings, and now it is time to actually commit the changes.

Artem.

#2 lore raw

PATCH 2/2 nanddump: fail if -s parameter is unaligned

From: Artem Bityutskiy <[email protected]>

Implement the feature which we planned long time ago - make nanddump fail if the -s parameter is not NAND page-aligned. Also bump nanddump version.

---
 feature-removal-schedule.txt |   12 +-----------
 nanddump.c                   |    9 ++++-----
 2 files changed, 5 insertions(+), 16 deletions(-)
feature-removal-schedule.txt +1 -11
index 2899e34..30f0403 100644
@@ -26,15 +26,5 @@ to stop using them.
 The further step is to remove both of them.
 
 ---------------------------
-2. nanddump: fail when the -s parameter is not page aligned
-
-nanddump should be consistent with nandwrite, and refuse accepting non page
-aligned start addresses. These dumps are most likely useless, since nandwrite
-won't write then at this location. Currently only a warning is issued to keep
-backward compatibility during a transition period. This should become an error
-one release after the next release (current is mtd-utils-1.4.0, 18 Sep 2010).
-
-To be done by Artem Bityutskiy.
----------------------------
-3.
+2.
 ---------------------------
nanddump.c +4 -5
index 1dbb247..214fb12 100644
@@ -14,7 +14,7 @@
  */
 
 #define PROGRAM_NAME "nanddump"
-#define VERSION "$Revision: 1.29 $"
+#define VERSION "1.30"
 
 #define _GNU_SOURCE
 #include <ctype.h>
@@ -366,11 +366,10 @@ int main(int argc, char * const argv[])
 
 	/* Initialize start/end addresses and block size */
 	if (start_addr & (mtd.min_io_size - 1)) {
-		fprintf(stderr, "WARNING: The start address is not page-aligned !\n"
-				"The pagesize of this NAND Flash is 0x%x.\n"
-				"nandwrite doesn't allow writes starting at this location.\n"
-				"Future versions of nanddump will fail here.\n",
+		fprintf(stderr, "the start address (-s parameter) is not page-aligned!\n"
+				"The pagesize of this NAND Flash is 0x%x.\n",
 				mtd.min_io_size);
+		goto closeall;
 	}
 	if (length)
 		end_addr = start_addr + length;
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 1/2 mkfs.ubifs: deprecate squash-rino-perm options

In reply to Artem Bityutskiy

From: Artem Bityutskiy <[email protected]>

As we have planned, make --nosquash-rino-perm option to be the default. Deprecate both options at the same time and print a warning if they are used. Later we can remove them

Also, bump mkfs.ubifs version number.

---
 feature-removal-schedule.txt |   25 ++++++++++++-------------
 mkfs.ubifs/mkfs.ubifs.c      |   30 ++++++++++++------------------
 2 files changed, 24 insertions(+), 31 deletions(-)
feature-removal-schedule.txt +12 -13
index 4e9824a..2899e34 100644
@@ -13,19 +13,18 @@ a bug which was found too late, when mkfs.ubifs had already been used in
 production. To fix this bug, 2 new options were introduced:
 --squash-rino-perm which preserves the old behavior and --nosquash-rino-perm
 which makes mkfs.ubifs use the right permissions for the root
-inode. For now --squash-rino-perm is the default, and if neither
---squash-rino-perm nor --nosquash-rino-perm are used, mkfs.ubifs prints a
-warning. This was introduced in mtd-utils-1.4.0 (13 Sep 2010).
-
-So the plan is (to be done by Artem Bityutskiy):
-
-1. keep the warning for few releases to make sure users start using one of the
-   options. Update the mkfs.ubifs documentation at the web site.
-2. make --nosquash-rino-perm to be the default, and remove the warning.
-   Update the mkfs.ubifs documentation at the web site.
-3. eventually deprecate both options by:
-3.1 adding a warning to make users stop using them
-3.2 removing both options.
+inode.
+
+For a while (releases 1.4.0-1.4.3) --squash-rino-perm was the default, and if
+neither --squash-rino-perm nor --nosquash-rino-perm were used,
+mkfs.ubifs printed a warning. This was introduced in mtd-utils-1.4.0 (13 Sep 2010).
+
+Now we have removed a warning and made --nosquash-rino-perm to be the
+default. Also, both options are declared depricated, so users should try
+to stop using them.
+
+The further step is to remove both of them.
+
 ---------------------------
 2. nanddump: fail when the -s parameter is not page aligned
 
mkfs.ubifs/mkfs.ubifs.c +12 -18
index bc0817f..e49a980 100644
@@ -23,7 +23,7 @@
 #include "mkfs.ubifs.h"
 #include <crc32.h>
 
-#define PROGRAM_VERSION "1.4"
+#define PROGRAM_VERSION "1.5"
 
 /* Size (prime number) of hash table for link counting */
 #define HASH_TABLE_SIZE 10099
@@ -109,7 +109,7 @@ static char *output;
 static int out_fd;
 static int out_ubi;
 static int squash_owner;
-static int squash_rino_perm = -1;
+static int squash_rino_perm;
 
 /* The 'head' (position) which nodes are written */
 static int head_lnum;
@@ -195,10 +195,13 @@ static const char *helptext =
 "                         2 - files, 3 - more details)\n"
 "-Q, --squash-rino-perm   ignore permissions of the FS image directory (the one\n"
 "                         specified with --root) and make the UBIFS root inode\n"
-"			  permissions to be {uid=gid=root, u+rwx,go+rx}; this is\n"
-"                         see also the default so far, see explanations below\n"
+"                         permissions to be {uid=gid=root, u+rwx,go+rx}; this is\n"
+"                         a legacy compatibility option and it will be removed\n"
+"                         at some point, do not use it\n"
 "-q, --nosquash-rino-perm for the UBIFS root inode use permissions of the FS\n"
-"                         image directory (the one specified with --root)\n"
+"                         image directory (the one specified with --root); this\n"
+"                         is the default behavior; this option will be removed\n"
+"                         at some point, do not use it, see clarifications below;\n"
 "-h, --help               display this help text\n\n"
 "Note, SIZE is specified in bytes, but it may also be specified in Kilobytes,\n"
 "Megabytes, and Gigabytes if a KiB, MiB, or GiB suffix is used.\n\n"
@@ -217,12 +220,8 @@ static const char *helptext =
 "late, when mkfs.ubifs had already been used in production. To fix this bug, 2 new\n"
 "options were introduced: --squash-rino-perm which preserves the old behavior and\n"
 "--nosquash-rino-perm which makes mkfs.ubifs use the right permissions for the root\n"
-"inode. For now --squash-rino-perm is the default, and if neither --squash-rino-perm\n"
-"nor --nosquash-rino-perm are used, mkfs.ubifs prints a warning. The further plan is:\n"
-" o keep the warning for few releases to make sure users start using one of the\n"
-"   options\n"
-" o make --nosquash-rino-perm to be the default, and remove the warning\n"
-" o eventually deprecate both options\n";
+"inode. Now these options are considered depricated and they will be removed later, so\n"
+"do not use them.\n";
 
 /**
  * make_path - make a path name from a directory and a name.
@@ -666,9 +665,10 @@ static int get_options(int argc, char**argv)
 			break;
 		case 'Q':
 			squash_rino_perm = 1;
+			printf("WARNING: --squash-rino-perm is depricated, do not use it\n");
 			break;
 		case 'q':
-			squash_rino_perm = 0;
+			printf("WARNING: --nosquash-rino-perm is depricated, do not use it\n");
 			break;
 		}
 	}
@@ -1670,12 +1670,6 @@ static int write_data(void)
 		if (err)
 			return sys_err_msg("bad root file-system directory '%s'",
 					   root);
-		if (squash_rino_perm == -1) {
-			printf("WARNING: setting root UBIFS inode UID=GID=0 (root) and permissions "
-				 "to u+rwx,go+rx; use --squash-rino-perm or --nosquash-rino-perm "
-				 "to suppress this warning\n");
-			squash_rino_perm = 1;
-		}
 		if (squash_rino_perm) {
 			root_st.st_uid = root_st.st_gid = 0;
 			root_st.st_mode = mode;
Signature · 1 line
1.7.2.3