firmware-utils/mkzynfw: add support for the NBG460N board
[openwrt.git] / tools / firmware-utils / src / airlink.c
index 4699af3..560a58d 100644 (file)
@@ -110,7 +110,7 @@ int generate_image(char *kname, char *fsname, char *fname, int EHDR)
        uchar *bk, *bs;
        int fkd, ffd, fsd;
        fkd = open(kname, O_RDONLY);
        uchar *bk, *bs;
        int fkd, ffd, fsd;
        fkd = open(kname, O_RDONLY);
-       ffd = creat(fname, 0x644);
+       ffd = creat(fname, 0644);
        if ((fkd < 0) || (ffd < 0))
                return -1;
        if (fsname) {
        if ((fkd < 0) || (ffd < 0))
                return -1;
        if (fsname) {
@@ -135,6 +135,7 @@ int generate_image(char *kname, char *fsname, char *fname, int EHDR)
        else
                write(ffd, header + 2, 0x20);
        write(ffd, bk, lenk);
        else
                write(ffd, header + 2, 0x20);
        write(ffd, bk, lenk);
+       lenk += 0x20;
        if (!JFFS2) JFFS2 = 0x20;
        printf("Padding header+kernel - 0x%x +  0x%x = 0x%x\n",
               lenk, ((lenk - 1 + JFFS2) / JFFS2) * JFFS2 - lenk,
        if (!JFFS2) JFFS2 = 0x20;
        printf("Padding header+kernel - 0x%x +  0x%x = 0x%x\n",
               lenk, ((lenk - 1 + JFFS2) / JFFS2) * JFFS2 - lenk,
This page took 0.024611 seconds and 4 git commands to generate.