Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Do not load configuration in rescue mode

  • Loading branch information...
commit 2c9f5e7813cc6c0ce240e6bd4c02a7c3fcbc13e8 1 parent ef61a83
Sébastien Bourdeauducq authored April 23, 2011

Showing 1 changed file with 15 additions and 2 deletions. Show diff stats Hide diff stats

  1. 17  src/sysconfig.c
17  src/sysconfig.c
@@ -27,6 +27,7 @@
27 27
 #include <rtems.h>
28 28
 #include <rtems/rtems_bsdnet.h>
29 29
 #include <rtems/dhcp.h>
  30
+#include <rtems/bspcmdline.h>
30 31
 #include <bsp.h>
31 32
 #include <mtklib.h>
32 33
 
@@ -158,14 +159,26 @@ static void sysconfig_credentials_lock_init();
158 159
 static void sysconfig_credentials_lock();
159 160
 static void sysconfig_credentials_unlock();
160 161
 
  162
+static int is_rescue()
  163
+{
  164
+	const char *bsp_cmdline;
  165
+	
  166
+	bsp_cmdline = rtems_bsp_cmdline_get();
  167
+	if(bsp_cmdline == NULL)
  168
+		return 0;
  169
+	return strcmp(bsp_cmdline, "rescue") == 0;
  170
+}
  171
+
161 172
 void sysconfig_load()
162 173
 {
163 174
 	struct sysconfig conf;
164 175
 
165 176
 	sysconfig_credentials_lock_init();
166 177
 	
167  
-	if(readconfig(SYSCONFIG_FILE, &conf))
168  
-		memcpy(&sysconfig, &conf, sizeof(struct sysconfig));
  178
+	if(!is_rescue()) {
  179
+		if(readconfig(SYSCONFIG_FILE, &conf))
  180
+			memcpy(&sysconfig, &conf, sizeof(struct sysconfig));
  181
+	}
169 182
 
170 183
 	if(sysconfig.dhcp_enable)
171 184
 		rtems_bsdnet_config.bootp = my_dhcp;

0 notes on commit 2c9f5e7

Please sign in to comment.
Something went wrong with that request. Please try again.