Add BF_BINARY_PREFIX define to configure binary path by build system.
authorGerd Zellweger <mail@gerdzellweger.com>
Sat, 6 Dec 2014 12:02:33 +0000 (13:02 +0100)
committerGerd Zellweger <mail@gerdzellweger.com>
Wed, 10 Dec 2014 09:20:29 +0000 (10:20 +0100)
hake/ArchDefaults.hs
kernel/arch/arm_gem5/startup_arch.c
kernel/arch/armv5/startup_arch.c
kernel/arch/omap44xx/startup_arch.c
kernel/arch/x86/startup_x86.c
usr/init/init.c
usr/kaluga/boot_modules.c
usr/spawnd/main.c
usr/startd/main.c

index 2108aa1..e8ac60d 100644 (file)
@@ -52,7 +52,7 @@ cFlags = [ Str s | s <- [ "-Wno-packed-bitfield-compat" ] ]
 cxxFlags = [ Str s | s <- [ "-Wno-packed-bitfield-compat" ] ]
        ++ commonCxxFlags
 
-cDefines options = [ Str ("-D"++s) | s <- [ "BARRELFISH" ]]
+cDefines options = [ Str ("-D"++s) | s <- [ "BARRELFISH", "BF_BINARY_PREFIX=\\\"\\\"" ] ]
                    ++ Config.defines
                    ++ Config.arch_defines options
 
index d098c26..d6dad3b 100644 (file)
@@ -35,8 +35,8 @@
 #define STARTUP_PROGRESS()      debug(SUBSYS_STARTUP, "%s:%d\n",          \
                                       __FUNCTION__, __LINE__);
 
-#define BSP_INIT_MODULE_NAME    "armv7/sbin/init"
-#define APP_INIT_MODULE_NAME   "armv7/sbin/monitor"
+#define BSP_INIT_MODULE_NAME    BF_BINARY_PREFIX "armv7/sbin/init"
+#define APP_INIT_MODULE_NAME   BF_BINARY_PREFIX "armv7/sbin/monitor"
 
 
 
index 7814b46..b3db1eb 100644 (file)
@@ -32,7 +32,7 @@
 #define STARTUP_PROGRESS()      debug(SUBSYS_STARTUP, "%s:%d\n",          \
                                       __FUNCTION__, __LINE__);
 
-#define BSP_INIT_MODULE_NAME    "armv5/sbin/init"
+#define BSP_INIT_MODULE_NAME    BF_BINARY_PREFIX "armv5/sbin/init"
 
 #define INIT_L1_BYTES           (ARM_L1_MAX_ENTRIES * ARM_L1_BYTES_PER_ENTRY)
 
@@ -550,7 +550,7 @@ spawn_init(const char*      name,
     // On to userland...
     STARTUP_PROGRESS();
     dispatch(init_dcb);
-    
+
     panic("Not reached.");
 }
 
index 09566f7..f963a5b 100644 (file)
                                       __FUNCTION__, __LINE__);
 
 #ifdef __ARM_ARCH_7M__//armv7-M : cortex-M3 processor on pandaboard
-#define BSP_INIT_MODULE_NAME    "armv7-m/sbin/init"
-#define APP_INIT_MODULE_NAME   "armv7-m/sbin/monitor"
+#define BSP_INIT_MODULE_NAME    BF_BINARY_PREFIX "armv7-m/sbin/init"
+#define APP_INIT_MODULE_NAME   BF_BINARY_PREFIX "armv7-m/sbin/monitor"
 #else//"normal" armv7-A
-#define BSP_INIT_MODULE_NAME    "armv7/sbin/init"
-#define APP_INIT_MODULE_NAME   "armv7/sbin/monitor"
+#define BSP_INIT_MODULE_NAME    BF_BINARY_PREFIX "armv7/sbin/init"
+#define APP_INIT_MODULE_NAME   BF_BINARY_PREFIX "armv7/sbin/monitor"
 #endif
 
 
index 9e8fb20..58b88d4 100644 (file)
@@ -497,13 +497,13 @@ static struct cmdarg cmdargs[] = {
  * Name of multiboot module containing program for init domains.
  */
 #if defined(__k1om__)
-#       define BSP_INIT_MODULE_PATH     "k1om/sbin/init"
+#       define BSP_INIT_MODULE_PATH     BF_BINARY_PREFIX "k1om/sbin/init"
 #elif defined(__x86_64__)
-#       define BSP_INIT_MODULE_PATH     "x86_64/sbin/init"
+#       define BSP_INIT_MODULE_PATH     BF_BINARY_PREFIX "x86_64/sbin/init"
 #elif defined(__scc__)
-#       define BSP_INIT_MODULE_PATH     "scc/sbin/init"
+#       define BSP_INIT_MODULE_PATH     BF_BINARY_PREFIX "scc/sbin/init"
 #elif defined(__i386__)
-#       define BSP_INIT_MODULE_PATH     "x86_32/sbin/init"
+#       define BSP_INIT_MODULE_PATH     BF_BINARY_PREFIX "x86_32/sbin/init"
 #else
 #       error "Unknown x86"
 #endif
index 9898d9e..b23a3be 100644 (file)
 static coreid_t my_core_id;
 
 #if defined(__k1om__)
-#       define MONITOR_NAME  "k1om/sbin/monitor"
-#       define MEM_SERV_NAME "k1om/sbin/mem_serv"
+#       define MONITOR_NAME  BF_BINARY_PREFIX "k1om/sbin/monitor"
+#       define MEM_SERV_NAME BF_BINARY_PREFIX "k1om/sbin/mem_serv"
 #elif defined(__x86_64__)
-#       define MONITOR_NAME  "x86_64/sbin/monitor"
-#       define MEM_SERV_NAME "x86_64/sbin/mem_serv"
+#       define MONITOR_NAME  BF_BINARY_PREFIX "x86_64/sbin/monitor"
+#       define MEM_SERV_NAME BF_BINARY_PREFIX "x86_64/sbin/mem_serv"
 #elif defined(__scc__)
-#       define MONITOR_NAME  "scc/sbin/monitor"
-#       define MEM_SERV_NAME "scc/sbin/mem_serv"
+#       define MONITOR_NAME  BF_BINARY_PREFIX "scc/sbin/monitor"
+#       define MEM_SERV_NAME BF_BINARY_PREFIX "scc/sbin/mem_serv"
 #elif defined(__i386__)
-#       define MONITOR_NAME  "x86_32/sbin/monitor"
-#       define MEM_SERV_NAME "x86_32/sbin/mem_serv"
+#       define MONITOR_NAME  BF_BINARY_PREFIX "x86_32/sbin/monitor"
+#       define MEM_SERV_NAME BF_BINARY_PREFIX "x86_32/sbin/mem_serv"
 #elif defined(__ARM_ARCH_7A__)
-#       define MONITOR_NAME  "armv7/sbin/monitor"
-#       define MEM_SERV_NAME "armv7/sbin/mem_serv"
+#       define MONITOR_NAME  BF_BINARY_PREFIX "armv7/sbin/monitor"
+#       define MEM_SERV_NAME BF_BINARY_PREFIX "armv7/sbin/mem_serv"
 #elif defined(__ARM_ARCH_7M__)
-#       define MONITOR_NAME  "armv7-m/sbin/monitor"
-#       define MEM_SERV_NAME "armv7-m/sbin/mem_serv"
+#       define MONITOR_NAME  BF_BINARY_PREFIX "armv7-m/sbin/monitor"
+#       define MEM_SERV_NAME BF_BINARY_PREFIX "armv7-m/sbin/mem_serv"
 #elif defined(__arm__)
-#       define MONITOR_NAME  "armv5/sbin/monitor"
-#       define MEM_SERV_NAME "armv5/sbin/mem_serv"
+#       define MONITOR_NAME  BF_BINARY_PREFIX "armv5/sbin/monitor"
+#       define MEM_SERV_NAME BF_BINARY_PREFIX "armv5/sbin/mem_serv"
 #else
 #       error Unknown architecture
 #endif
@@ -314,7 +314,5 @@ int main(int argc, char *argv[])
         }
     }
 
-    printf("Init done.\n");
-
     return EXIT_SUCCESS;
 }
index 5248d67..8dea8a6 100644 (file)
@@ -191,9 +191,9 @@ void init_environ(void)
 {
     int r;
 
-    /* PATH=/arch/sbin */
+    /* PATH=/build-arch/sbin */
     char pathstr[64];
-    snprintf(pathstr, sizeof(pathstr), "/%s/sbin",
+    snprintf(pathstr, sizeof(pathstr), "/" BF_BINARY_PREFIX "%s/sbin",
              cpu_type_to_archstr(CURRENT_CPU_TYPE));
     pathstr[sizeof(pathstr) - 1] = '\0';
     r = setenv("PATH", pathstr, 0);
index bc74819..870dda3 100644 (file)
@@ -1,8 +1,7 @@
 /**
  * \file
  * \brief Spawn daemon for Barrelfish.
- * At boot, decides which cores to boot and which domains to spawn.
- * After boot, offers a service on each core to spawn programs from
+ * Offers a service on each core to spawn programs from
  * the file system.
  */
 
@@ -40,7 +39,7 @@ static void init_environ(void)
 
     /* PATH=/arch/sbin */
     char pathstr[64];
-    snprintf(pathstr, sizeof(pathstr), "/%s/sbin",
+    snprintf(pathstr, sizeof(pathstr), "/" BF_BINARY_PREFIX "%s/sbin",
              cpu_type_to_archstr(CURRENT_CPU_TYPE));
     pathstr[sizeof(pathstr) - 1] = '\0';
     r = setenv("PATH", pathstr, 0);
index 6e3a59a..ff3c2b5 100644 (file)
@@ -44,9 +44,8 @@ static void init_environ(void)
 {
     int r;
 
-    /* PATH=/arch/sbin */
     char pathstr[64];
-    snprintf(pathstr, sizeof(pathstr), "/%s/sbin",
+    snprintf(pathstr, sizeof(pathstr), "/" BF_BINARY_PREFIX "%s/sbin",
              cpu_type_to_archstr(CURRENT_CPU_TYPE));
     pathstr[sizeof(pathstr) - 1] = '\0';
     r = setenv("PATH", pathstr, 0);