Image file name

Hi

Is there a way to define the format for the image file coming out of the make process. I have seen talk of a filename pattern, but have not been able to find it.

Ideally I just need to add a timestamp.

thanks

Darren B.

format and name are totally different things...

would be wise to mention your device ... as parameters can vary...

post processing is the simpler way to handle what you want to do.

Create a shell script which will run make clean; make; and then rename the output file?

include/image.mk is where the file name for the images is created

Great, thanks for the leads, I will have a look in image.mk

In the end, I did a quick perl script that just looked for new versions of the images I am building.

use File::Basename;


my @imagelist = (
        "/home/darren/openwrt/bin/targets/ramips/mt7621/openwrt-ramips-mt7621-youhua_wr1200js-squashfs-sysupgrade.bin",
        "/home/darren/openwrt/bin/targets/bcm53xx/generic/openwrt-bcm53xx-asus-rt-ac68u-squashfs.trx"
);

my $destPath = "/home/darren/images/";


my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);


my $timestamp = ($year + 1900).$mon.$mday."T".$hour.$min;


print $timestamp."\n";


foreach my $file (@imagelist)
{
        if (-f $file) {

            my $bname = basename($file);

            my ($nm,$ext) = $bname =~ /(.*?)\.(.+)$/;

            my $newname = $destPath.$bname."-".$timestamp.".".$ext;

            qx!mv $file $newname!;

        }
}