Skip to contentSkip to conversation

Allow an absent 'image' in the ubinize configuration.

PATCH In review Richard Titmuss 2 participants 2 messages Sep 23, 2008 – Sep 24, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow an absent 'image' in the ubinize configuration.

Hi,

Some recent changes to ubinize prevent the 'image' parameter from being absent in the configuration file. The following patch fixes that.

ubi-utils/new-utils/src/ubinize.c +14 -12
index 5115db3..ebd5aa0 100644
@@ -561,20 +561,22 @@ int main(int argc, char * const argv[])
            goto out_free;
        }
 
-        fd = open(img, O_RDONLY);
-        if (fd == -1) {
-            sys_errmsg("cannot open \"%s\"", img);
-            goto out_free;
-        }
+        if (img) {
+            fd = open(img, O_RDONLY);
+            if (fd == -1) {
+                sys_errmsg("cannot open \"%s\"", img);
+                goto out_free;
+            }
 
-        verbose(args.verbose, "writing volume %d", vi[i].id);
-        verbose(args.verbose, "image file: %s", img);
+            verbose(args.verbose, "writing volume %d", vi[i].id);
+            verbose(args.verbose, "image file: %s", img);
 
-        err = ubigen_write_volume(&ui, &vi[i], args.ec, st.st_size, fd, args.out_fd);
-        close(fd);
-        if (err) {
-            errmsg("cannot write volume for section \"%s\"", sname);
-            goto out_free;
+            err = ubigen_write_volume(&ui, &vi[i], args.ec, st.st_size, fd, args.out_fd);
+            close(fd);
+            if (err) {
+                errmsg("cannot write volume for section \"%s\"", sname);
+                goto out_free;
+            }
        }
 
        if (args.verbose)
#1 lore raw
Quoted 4 lines · Richard Titmuss

Some recent changes to ubinize prevent the 'image' parameter from being absent in the configuration file. The following patch fixes that.

The patch did not apply cleanly, probably because your e-mail client wrapped it. But after some hand-work I've applied it and pushed.

Thanks.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)