rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | #!/bin/perl |
| 2 | |
| 3 | use File::Basename; |
| 4 | |
| 5 | $CROSS_PREFIX=$ENV{'CROSS_PREFIX'}; |
| 6 | $WORKDIR=$ENV{'WORKDIR'}; |
| 7 | $OUTDIR=$ENV{'OUTDIR'}; |
| 8 | $LOGDIR=$ENV{'OUTDIR'}."/log"; |
| 9 | $PRJ_FILE=$ENV{'PRJ_FILENAME'}; |
| 10 | $COMPLIST=`cat $LOGDIR/infomake.log |grep COMPLIST|sed -e 's/COMPLIST = //g'`; |
| 11 | @COMPS=split(' ', $COMPLIST); |
| 12 | |
| 13 | if(-d "$WORKDIR/custom/$PRJ_FILE") { |
| 14 | $CONFIGDIR="$WORKDIR/custom/$PRJ_FILE/build/config"; |
| 15 | } else { |
| 16 | $CONFIGDIR="$WORKDIR/custom/DEFAULT/build/config"; |
| 17 | } |
| 18 | |
| 19 | #generate ConfigPack images |
| 20 | system("rm -rf $OUTDIR/rootfs/usr/cfg"); |
| 21 | system("mkdir -p $OUTDIR/rootfs/usr/cfg"); |
| 22 | foreach my $comp (@COMPS) |
| 23 | { |
| 24 | if(-e "$WORKDIR/custom/$PRJ_FILE/$comp/cfg") { |
| 25 | system("cp -rf $WORKDIR/custom/$PRJ_FILE/$comp/cfg/* $OUTDIR/rootfs/usr/cfg"); |
| 26 | } elsif (-e "$WORKDIR/custom/DEFAULT/$comp/cfg") { |
| 27 | system("cp -rf $WORKDIR/custom/DEFAULT/$comp/cfg/* $OUTDIR/rootfs/usr/cfg"); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | system("$WORKDIR/install/$CROSS_PREFIX/host/cfgpack/mkcfgpack $OUTDIR/rootfs/usr/cfg $OUTDIR/tmp/default.bin > $LOGDIR/mkcfgpack_default.log"); |
| 32 | system("cp $OUTDIR/tmp/default.bin $OUTDIR/initramfs/usr/cfg/default.bin"); |
| 33 | system("cp $OUTDIR/tmp/default.bin $OUTDIR/rootfs/usr/cfg/default.bin"); |
| 34 | |
| 35 | #generate doxygen document |
| 36 | system("cd $WORKDIR/install/$CROSS_PREFIX/host/doxygen/doc;$WORKDIR/install/$CROSS_PREFIX/host/doxygen/bin/doxygen > $LOGDIR/doxygen.log 2>&1"); |
| 37 | system("rm -rf $OUTDIR/doc;mkdir $OUTDIR/doc"); |
| 38 | system("cp -afr $WORKDIR/install/$CROSS_PREFIX/host/doxygen/doc/html/* $OUTDIR/doc/"); |
| 39 | |
| 40 | |
| 41 | #generate FirmwareConfig FactoryConfig images |
| 42 | system("mkdir -p $OUTDIR/tmp/empty_tmp_dir"); |
| 43 | @DEFAULTCFG=`ls $CONFIGDIR/*.cfg`; |
| 44 | foreach my $file (@DEFAULTCFG) |
| 45 | { |
| 46 | my $cfgfile = basename($file); |
| 47 | chomp $cfgfile; |
| 48 | my $cfg = $cfgfile; |
| 49 | $cfg =~ s/default-//gi; |
| 50 | $cfg =~ s/\.cfg//gi; |
| 51 | system("$WORKDIR/install/$CROSS_PREFIX/host/cfgpack/mkcfgpack -x $CONFIGDIR/$cfgfile $OUTDIR/tmp/empty_tmp_dir $OUTDIR/fc-$cfg.bin >> $LOGDIR/mkcfgpack_fc.log"); |
| 52 | } |
| 53 | system("rm -rf $OUTDIR/tmp/empty_tmp_dir"); |