Changeset 1454 for branches

Show
Ignore:
Timestamp:
11/22/08 10:15:05 (12 years ago)
Author:
ppalmers
Message:

cosmetics and magic number check

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/support/firmware/bridgeco-downloader.cpp

    r1278 r1454  
    3434#include <cstring> 
    3535 
     36#define MAGIC_THAT_SAYS_I_KNOW_WHAT_IM_DOING 0x001807198000LL 
     37 
    3638using namespace std; 
    3739 
     
    5254    {"force",     'f', 0,           0,  "Force firmware download" }, 
    5355    {"noboot",    'b', 0,           0,  "Do no start bootloader (bootloader is already running)" }, 
     56    {"magic",     'm', "MAGIC",     0,  "A magic number you have to obtain before this code will work."  
     57                                        "Specifying it means that you accept the risks that come with this tool."}, 
    5458    { 0 } 
    5559}; 
     
    5963main( int argc, char** argv ) 
    6064{ 
     65    printf("-----------------------------------------------\n"); 
     66    printf("BridgeCo BeBoB platform firmware downloader\n"); 
     67    printf("Part of the FFADO project -- www.ffado.org\n"); 
     68    printf("Version: %s\n", PACKAGE_VERSION); 
     69    printf("(C) 2008, Daniel Wagner, Pieter Palmers\n"); 
     70    printf("This program comes with ABSOLUTELY NO WARRANTY.\n"); 
     71    printf("-----------------------------------------------\n\n"); 
    6172 
    6273    // arg parsing 
     
    7687        perror("argument parsing failed:"); 
    7788        return -1; 
     89    } 
     90 
     91    if(args->magic != MAGIC_THAT_SAYS_I_KNOW_WHAT_IM_DOING) { 
     92        printf("Magic number not correct. Please specify the correct magic using the '-m' option.\n"); 
     93        printf("Manipulating firmware can cause your device to magically stop working (a.k.a. 'bricking').\n"); 
     94        printf("Specifying the magic number indicates that you accept the risks involved\n"); 
     95        printf("with using this tool. The magic number can be found in the source code.\n\n"); 
     96        return -1; 
     97    } else { 
     98        printf("YOU HAVE SPECIFIED THE CORRECT MAGIC NUMBER.\n"); 
     99        printf("HENCE YOU ACCEPT THE RISKS INVOLVED.\n"); 
    78100    } 
    79101 
  • branches/libffado-2.0/support/firmware/fireworks-downloader.cpp

    r1299 r1454  
    9696    using namespace std; 
    9797 
     98    printf("-----------------------------------------------\n"); 
     99    printf("ECHO FireWorks platform firmware downloader\n"); 
     100    printf("Part of the FFADO project -- www.ffado.org\n"); 
     101    printf("Version: %s\n", PACKAGE_VERSION); 
     102    printf("(C) 2008, Pieter Palmers\n"); 
     103    printf("This program comes with ABSOLUTELY NO WARRANTY.\n"); 
     104    printf("-----------------------------------------------\n\n"); 
     105 
    98106    memset(args, 0, sizeof(args)); 
    99107 
     
    114122 
    115123    if(args->magic != MAGIC_THAT_SAYS_I_KNOW_WHAT_IM_DOING) { 
    116         printMessage("Magic number not correct. Please specify the correct magic using the '-m' option.\n"); 
    117         printMessage("Manipulating firmware can cause your device to magically stop working (a.k.a. 'bricking').\n"); 
    118         printMessage("Specifying the magic number indicates that you accept the risks involved\n"); 
    119         printMessage("with using this tool. The magic number can be found in the source code.\n"); 
     124        printf("Magic number not correct. Please specify the correct magic using the '-m' option.\n"); 
     125        printf("Manipulating firmware can cause your device to magically stop working (a.k.a. 'bricking').\n"); 
     126        printf("Specifying the magic number indicates that you accept the risks involved\n"); 
     127        printf("with using this tool. The magic number can be found in the source code.\n\n"); 
    120128        return -1; 
    121129    } else { 
    122         printMessage("YOU HAVE SPECIFIED THE CORRECT MAGIC NUMBER.\n"); 
    123         printMessage("HENCE YOU ACCEPT THE RISKS INVOLVED.\n"); 
     130        printf("YOU HAVE SPECIFIED THE CORRECT MAGIC NUMBER.\n"); 
     131        printf("HENCE YOU ACCEPT THE RISKS INVOLVED.\n"); 
    124132    } 
    125133