summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-27 09:41:46 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-27 09:41:46 +0000
commit5d236b2bfda7b460e6b970c3b6f6dc539b14020e (patch)
tree27316274323f1de2f7da190f269061d1c4280847 /bootloader
parent6ca9f232a817ed6717354ae68812f67b08cbc2a9 (diff)
downloadrockbox-5d236b2bfda7b460e6b970c3b6f6dc539b14020e.tar.gz
rockbox-5d236b2bfda7b460e6b970c3b6f6dc539b14020e.tar.bz2
rockbox-5d236b2bfda7b460e6b970c3b6f6dc539b14020e.zip
Generate C file / header for svn version string
It's now easier to force rebuild of files depending on the svn revision version.c/version.h are generated once with new tools/genversion.sh Changes in the VCS are still not auto detected, so you'll have to remove builddir/version.* if you want to change the string in your binaries APPSVERSION is now called RBVERSION and is defined in the generated header instead of being defined by the Makefiles appsversion is now called rbversion (the plugin api number didn't change since old modules are still binary compatible) Change some bootloaders to use knwon-at-buildtime RBVERSION instead of "%s" + rbversion You'll need to run make clean to regenerate dependencies after the removal of apps/version.h To build binaries with a different version string, hand-edit tools/version.sh or tools/genversion.sh (which calls the former) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26320 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/Makefile8
-rw-r--r--bootloader/creativezvm.c3
-rw-r--r--bootloader/gigabeat-s.c4
-rw-r--r--bootloader/gigabeat.c5
-rw-r--r--bootloader/iaudio_coldfire.c6
-rw-r--r--bootloader/ipod.c6
-rw-r--r--bootloader/ipodnano2g.c6
-rw-r--r--bootloader/iriver_h1x0.c7
-rw-r--r--bootloader/iriver_h300.c5
-rw-r--r--bootloader/main-e200r-installer.c6
-rw-r--r--bootloader/main-pp.c6
-rw-r--r--bootloader/meizu_m3.c1
-rw-r--r--bootloader/meizu_m6sl.c1
-rw-r--r--bootloader/meizu_m6sp.c1
-rw-r--r--bootloader/mini2440.c3
-rw-r--r--bootloader/mpio_hd200.c5
-rw-r--r--bootloader/mrobe500.c3
-rw-r--r--bootloader/ondavx747.c3
-rw-r--r--bootloader/samsung_yps3.c1
-rw-r--r--bootloader/show_logo.c5
-rw-r--r--bootloader/telechips.c5
-rw-r--r--bootloader/tpj1022.c2
22 files changed, 37 insertions, 55 deletions
diff --git a/bootloader/Makefile b/bootloader/Makefile
index 3272510051..07f347ee16 100644
--- a/bootloader/Makefile
+++ b/bootloader/Makefile
@@ -46,12 +46,8 @@ ifdef APPEXTRA
INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA)))
endif
-ifndef VERSION
-VERSION=$(shell date +%y%m%d-%H%M)
-endif
-
-CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(DEFINES) \
- -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
+CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) \
+ -DMEM=${MEMORYSIZE}
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
SOURCES = $(SRC)
diff --git a/bootloader/creativezvm.c b/bootloader/creativezvm.c
index 6469de7c29..73968c3b3f 100644
--- a/bootloader/creativezvm.c
+++ b/bootloader/creativezvm.c
@@ -29,6 +29,7 @@
#include "button.h"
#include "common.h"
#include "usb.h"
+#include "version.h"
static void load_fw(unsigned char* ptr, unsigned int len)
@@ -66,7 +67,7 @@ void main(void)
lcd_setfont(FONT_SYSFIXED);
reset_screen();
printf("Rockbox boot loader");
- printf("Version %s", APPSVERSION);
+ printf("Version " RBVERSION);
ret = storage_init();
if(ret)
diff --git a/bootloader/gigabeat-s.c b/bootloader/gigabeat-s.c
index 7c429a9b65..dcff26c4de 100644
--- a/bootloader/gigabeat-s.c
+++ b/bootloader/gigabeat-s.c
@@ -35,11 +35,11 @@
#include "font.h"
#include "lcd.h"
#include "usb-target.h"
+#include "version.h"
#define TAR_CHUNK 512
#define TAR_HEADER_SIZE 157
-const char version[] = APPSVERSION;
/* Where files sent via MTP are stored */
static const char basedir[] = "/Content/0b00/00/";
/* Can use memory after vector table up to 0x01f00000 */
@@ -346,7 +346,7 @@ void main(void)
lcd_clear_display();
printf("Gigabeat S Rockbox Bootloader");
- printf("Version %s", version);
+ printf("Version " RBVERSION);
/* Initialize KPP so we can poll the button states */
button_init_device();
diff --git a/bootloader/gigabeat.c b/bootloader/gigabeat.c
index 81c069469d..7a634b329c 100644
--- a/bootloader/gigabeat.c
+++ b/bootloader/gigabeat.c
@@ -45,11 +45,10 @@
#include "usb.h"
#include "mmu-arm.h"
#include "rtc.h"
+#include "version.h"
#include <stdarg.h>
-char version[] = APPSVERSION;
-
void shutdown(void)
{
/* We need to gracefully spin down the disk to prevent clicks. */
@@ -174,7 +173,7 @@ void main(void)
verbose = true;
printf("Rockbox boot loader");
- printf("Version %s", version);
+ printf("Version " RBVERSION);
sleep(50); /* ATA seems to error without this pause */
diff --git a/bootloader/iaudio_coldfire.c b/bootloader/iaudio_coldfire.c
index a3b318bbbc..5639a0e59b 100644
--- a/bootloader/iaudio_coldfire.c
+++ b/bootloader/iaudio_coldfire.c
@@ -42,6 +42,8 @@
#include "power.h"
#include "powermgmt.h"
#include "file.h"
+#include "version.h"
+
#include "pcf50606.h"
#include "common.h"
@@ -58,8 +60,6 @@ int usb_screen(void)
return 0;
}
-char version[] = APPSVERSION;
-
/* Reset the cookie for the crt0 crash check */
inline void __reset_cookie(void)
{
@@ -188,7 +188,7 @@ void main(void)
}
printf("Rockbox boot loader");
- printf("Version %s", version);
+ printf("Version " RBVERSION);
check_battery();
diff --git a/bootloader/ipod.c b/bootloader/ipod.c
index ee555793d0..af4c1576bb 100644
--- a/bootloader/ipod.c
+++ b/bootloader/ipod.c
@@ -44,6 +44,7 @@
#include "common.h"
#include "hwcompat.h"
#include "usb.h"
+#include "version.h"
#define XSC(X) #X
#define SC(X) XSC(X)
@@ -56,9 +57,6 @@
/* A buffer to load the Linux kernel or Rockbox into */
unsigned char *loadbuffer = (unsigned char *)DRAM_START;
-/* Bootloader version */
-char version[] = APPSVERSION;
-
#if CONFIG_KEYPAD == IPOD_4G_PAD && !defined(IPOD_MINI)
/* check if number of seconds has past */
int timer_check(int clock_start, unsigned int usecs)
@@ -335,7 +333,7 @@ void* main(void)
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version: %s", version);
+ printf("Version: " RBVERSION);
printf("IPOD version: 0x%08x", IPOD_HW_REVISION);
i=ata_init();
diff --git a/bootloader/ipodnano2g.c b/bootloader/ipodnano2g.c
index 14b5bbce20..b2b2138f78 100644
--- a/bootloader/ipodnano2g.c
+++ b/bootloader/ipodnano2g.c
@@ -44,6 +44,7 @@
#include "power.h"
#include "file.h"
#include "common.h"
+#include "version.h"
/* Safety measure - maximum allowed firmware image size.
The largest known current (October 2009) firmware is about 6.2MB so
@@ -54,9 +55,6 @@
/* The buffer to load the firmware into - use an uncached alias of 0x08000000 */
unsigned char *loadbuffer = (unsigned char *)0x48000000;
-/* Bootloader version */
-char version[] = APPSVERSION;
-
extern int line;
void fatal_error(void)
@@ -209,7 +207,7 @@ void main(void)
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version: %s", version);
+ printf("Version: " RBVERSION);
i = storage_init();
diff --git a/bootloader/iriver_h1x0.c b/bootloader/iriver_h1x0.c
index f16a5128c9..1afbafa830 100644
--- a/bootloader/iriver_h1x0.c
+++ b/bootloader/iriver_h1x0.c
@@ -46,6 +46,7 @@
#include "eeprom_settings.h"
#include "rbunicode.h"
#include "common.h"
+#include "version.h"
#include <stdarg.h>
@@ -58,8 +59,6 @@
static bool recovery_mode = false;
#endif
-char version[] = APPSVERSION;
-
/* Reset the cookie for the crt0 crash check */
inline void __reset_cookie(void)
{
@@ -254,7 +253,7 @@ void failsafe_menu(void)
extern int line;
reset_screen();
- printf("Bootloader %s", version);
+ printf("Bootloader " RBVERSION);
check_battery();
printf("=========================");
line += FAILSAFE_OPTIONS;
@@ -502,7 +501,7 @@ void main(void)
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version %s", version);
+ printf("Version " RBVERSION);
/* No need to wait here more because lcd_init and others already do that. */
// sleep(HZ/50); /* Allow the button driver to check the buttons */
diff --git a/bootloader/iriver_h300.c b/bootloader/iriver_h300.c
index d15efb9b72..893532cac7 100644
--- a/bootloader/iriver_h300.c
+++ b/bootloader/iriver_h300.c
@@ -47,6 +47,7 @@
#include "common.h"
#include "rbunicode.h"
#include "isp1362.h"
+#include "version.h"
#include <stdarg.h>
@@ -55,8 +56,6 @@
#define DRAM_START 0x31000000
-char version[] = APPSVERSION;
-
/* Reset the cookie for the crt0 crash check */
inline void __reset_cookie(void)
{
@@ -210,7 +209,7 @@ void main(void)
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version %s", version);
+ printf("Version " RBVERSION);
sleep(HZ/50); /* Allow the button driver to check the buttons */
rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC)
diff --git a/bootloader/main-e200r-installer.c b/bootloader/main-e200r-installer.c
index 0a7b56b1b6..defdea4574 100644
--- a/bootloader/main-e200r-installer.c
+++ b/bootloader/main-e200r-installer.c
@@ -39,9 +39,7 @@
#include "i2c.h"
#include "backlight-target.h"
#include "power.h"
-
-/* Bootloader version */
-char version[] = APPSVERSION;
+#include "version.h"
#define START_SECTOR_OF_ROM 1
#define ROMSECTOR_TO_HACK 63
@@ -116,7 +114,7 @@ void* main(void)
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox e200R installer");
- printf("Version: %s", version);
+ printf("Version: " RBVERSION);
printf(MODEL_NAME);
printf("");
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index 4f1fe2a4e1..37f42eda43 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -39,6 +39,7 @@
#include "crc32-mi4.h"
#include <string.h>
#include "power.h"
+#include "version.h"
#if defined(SANSA_E200) || defined(PHILIPS_SA9200)
#include "i2c.h"
#include "backlight-target.h"
@@ -95,9 +96,6 @@ extern int show_logo(void);
/* A buffer to load the original firmware or Rockbox into */
unsigned char *loadbuffer = (unsigned char *)DRAM_START;
-/* Bootloader version */
-char version[] = APPSVERSION;
-
/* Locations and sizes in hidden partition on Sansa */
#if (CONFIG_STORAGE & STORAGE_SD)
#define PPMI_SECTOR_OFFSET 1024
@@ -525,7 +523,7 @@ void* main(void)
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version: %s", version);
+ printf("Version: " RBVERSION);
printf(MODEL_NAME);
i=storage_init();
diff --git a/bootloader/meizu_m3.c b/bootloader/meizu_m3.c
index 61aa3cecbe..7c0a5bca2d 100644
--- a/bootloader/meizu_m3.c
+++ b/bootloader/meizu_m3.c
@@ -54,7 +54,6 @@
#include "audiohw.h"
#include "rtc.h"
-char version[] = APPSVERSION;
#define LONG_DELAY 200000
#define SHORT_DELAY 50000
#define PAUSE_DELAY 50000
diff --git a/bootloader/meizu_m6sl.c b/bootloader/meizu_m6sl.c
index 0b335bec8a..c230ec3c08 100644
--- a/bootloader/meizu_m6sl.c
+++ b/bootloader/meizu_m6sl.c
@@ -47,7 +47,6 @@
#include <stdarg.h>
-char version[] = APPSVERSION;
#define LONG_DELAY 200000
#define SHORT_DELAY 50000
#define PAUSE_DELAY 50000
diff --git a/bootloader/meizu_m6sp.c b/bootloader/meizu_m6sp.c
index 064d3fc8df..c57fe91b22 100644
--- a/bootloader/meizu_m6sp.c
+++ b/bootloader/meizu_m6sp.c
@@ -45,7 +45,6 @@
#include <stdarg.h>
-char version[] = APPSVERSION;
#define LONG_DELAY 200000
#define SHORT_DELAY 50000
#define PAUSE_DELAY 50000
diff --git a/bootloader/mini2440.c b/bootloader/mini2440.c
index d735084c6a..f4441c3730 100644
--- a/bootloader/mini2440.c
+++ b/bootloader/mini2440.c
@@ -46,6 +46,7 @@
#include "dma-target.h"
#include "uart-s3c2440.h"
#include "led-mini2440.h"
+#include "version.h"
int main(void)
@@ -78,7 +79,7 @@ int main(void)
verbose = true;
printf("Rockbox boot loader");
- printf("Version %s", APPSVERSION);
+ printf("Version " RBVERSION);
rc = storage_init();
if(rc)
diff --git a/bootloader/mpio_hd200.c b/bootloader/mpio_hd200.c
index a031234b5a..8062f7ef22 100644
--- a/bootloader/mpio_hd200.c
+++ b/bootloader/mpio_hd200.c
@@ -43,6 +43,7 @@
#include "file.h"
#include "common.h"
+#include "version.h"
#include <stdarg.h>
@@ -78,8 +79,6 @@ int usb_screen(void)
return 0;
}
-char version[] = APPSVERSION;
-
static inline bool _charger_inserted(void)
{
return (GPIO1_READ & (1<<14)) ? false : true;
@@ -233,7 +232,7 @@ static void bootmenu(void)
/* backbone of menu */
/* run the loader */
printf("Rockbox boot loader");
- printf("Ver: %s", version);
+ printf("Ver: " RBVERSION);
check_battery();
diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c
index 9052cbdc3c..d6ca58e009 100644
--- a/bootloader/mrobe500.c
+++ b/bootloader/mrobe500.c
@@ -45,6 +45,7 @@
#include "tsc2100.h"
#include "time.h"
#include "system-arm.h"
+#include "version.h"
void main(void)
{
@@ -83,7 +84,7 @@ void main(void)
verbose = true;
printf("Rockbox boot loader");
- printf("Version %s", APPSVERSION);
+ printf("Version " RBVERSION);
/* Enter USB mode without USB thread */
if(usb_detect() == USB_INSERTED)
diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c
index 994f45d78d..4dfc78d58c 100644
--- a/bootloader/ondavx747.c
+++ b/bootloader/ondavx747.c
@@ -33,6 +33,7 @@
#include "disk.h"
#include "string.h"
#include "adc.h"
+#include "version.h"
extern int show_logo(void);
extern void power_off(void);
@@ -296,7 +297,7 @@ int main(void)
if(verbose)
reset_screen();
printf(MODEL_NAME" Rockbox Bootloader");
- printf("Version "APPSVERSION);
+ printf("Version " RBVERSION);
#ifdef HAS_BUTTON_HOLD
if(button_hold())
diff --git a/bootloader/samsung_yps3.c b/bootloader/samsung_yps3.c
index 3cf5cb70ec..d4eff81e01 100644
--- a/bootloader/samsung_yps3.c
+++ b/bootloader/samsung_yps3.c
@@ -57,7 +57,6 @@
#include "wmcodec.h"
#include "nand-target.h"
-char version[] = APPSVERSION;
#define LONG_DELAY 200000
#define SHORT_DELAY 50000
#define PAUSE_DELAY 50000
diff --git a/bootloader/show_logo.c b/bootloader/show_logo.c
index 09c6dbd4aa..3273034d05 100644
--- a/bootloader/show_logo.c
+++ b/bootloader/show_logo.c
@@ -23,13 +23,14 @@
#include "font.h"
#include <stdio.h>
#include <string.h>
+#include "version.h"
#include "bitmaps/rockboxlogo.h"
#if LCD_WIDTH <= 128
-#define BOOT_VERSION ("Boot " APPSVERSION)
+#define BOOT_VERSION ("Boot " RBVERSION)
#else
-#define BOOT_VERSION ("Boot Ver. " APPSVERSION)
+#define BOOT_VERSION ("Boot Ver. " RBVERSION)
#endif
/* Ensure TEXT_XPOS is >= 0 */
diff --git a/bootloader/telechips.c b/bootloader/telechips.c
index 98f8bebc38..9e9e75c183 100644
--- a/bootloader/telechips.c
+++ b/bootloader/telechips.c
@@ -43,6 +43,7 @@
#include "power.h"
#include "file.h"
#include "common.h"
+#include "version.h"
/* Show the Rockbox logo - in show_logo.c */
extern int show_logo(void);
@@ -50,8 +51,6 @@ extern int show_logo(void);
/* Address to load main Rockbox image to */
#define LOAD_ADDRESS 0x20000000 /* DRAM_START */
-char version[] = APPSVERSION;
-
extern int line;
#define MAX_LOAD_SIZE (8*1024*1024) /* Arbitrary, but plenty. */
@@ -152,7 +151,7 @@ void* main(void)
available for loading the firmware. Otherwise display the debug screen. */
#ifdef TCCBOOT
printf("Rockbox boot loader");
- printf("Version %s", version);
+ printf("Version " RBVERSION);
printf("ATA");
rc = storage_init();
diff --git a/bootloader/tpj1022.c b/bootloader/tpj1022.c
index db709d1b58..159dcc63cd 100644
--- a/bootloader/tpj1022.c
+++ b/bootloader/tpj1022.c
@@ -39,8 +39,6 @@
#include "file.h"
#include "common.h"
-char version[] = APPSVERSION;
-
void* main(void)
{
int i;