firmware-utils: honor env SOURCE_DATE_EPOCH
[openwrt/openwrt.git] / tools / firmware-utils / src / imagetag.c
index 6a46a7ebd995a95822ffa7acc63f668e95b9e6e0..bc70399ccaa390be3ecedaed98e67e66d49a4e0f 100644 (file)
@@ -11,7 +11,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdint.h>
-#include <time.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include <netinet/in.h>
@@ -164,6 +163,8 @@ int tagfile(const char *kernel, const char *rootfs, const char *bin, \
          /* align the start if requested */
          if (args->align_rootfs_flag)
                rootfsoff = (rootfsoff % block_size) > 0 ? (((rootfsoff / block_size) + 1) * block_size) : rootfsoff;
+          else
+               rootfsoff = (rootfsoff % 4) > 0 ? (((rootfsoff / 4) + 1) * 4) : rootfsoff;
 
          /* align the end */
          rootfsend = rootfsoff + getlen(rootfsfile);