Changeset 2196


Ignore:
Timestamp:
Oct 3, 2012, 10:22:34 AM (7 years ago)
Author:
matthijs
Message:

fonrsa: Check if a firmware image has an upgrade script.

Since a while, a firmware running in DEV mode supports upgrading from
unsigned tarballs. However, since an unsigned tarball is just an
ordinary tarball, the current DEV firmware accepts any arbitrary tarball
and happily starts the flashing process. When this tarball does not
contain an "upgrade" script, the flashing process will fail, but only
after killing all networking services and too late too report the
failure to the user.

This commit makes sure that an unsigned tarball is at least checked for
the presence of an (executable) upgrade script, which should catch this
problem in most of the cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fon/fonrsa/fonrsa/fonverify.lua

    r1 r2196  
    5454                return nil, "error extracting tgz"
    5555        end
     56        -- Check that the upgrade script exists and is executable
     57        local mode=posix.stat(directory .. "/upgrade", "mode")
     58        if mode == nil or mode:sub(3, 3) ~= "x" then
     59                return nil, "no upgrade script found"
     60        end
     61
    5662        cleanpath(signature_path, tgz_path, nil)
    5763        return directory, nil
Note: See TracChangeset for help on using the changeset viewer.