diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/Kconfig | 4 | ||||
-rw-r--r-- | common/Makefile | 5 | ||||
-rw-r--r-- | common/console.c | 40 | ||||
-rw-r--r-- | common/misc.c | 7 |
4 files changed, 30 insertions, 26 deletions
diff --git a/common/Kconfig b/common/Kconfig index f5147597f4..a58f242ff8 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -339,8 +339,8 @@ config DEFAULT_ENVIRONMENT_PATH depends on DEFAULT_ENVIRONMENT prompt "Default environment path" help - The path the default environment will be taken from. Relative - pathes will be relative to the barebox Toplevel dir, but absolute + Space separated list of pathes the default environment will be taken from. + Relative pathes will be relative to the barebox Toplevel dir, but absolute pathes are fine aswell. endmenu diff --git a/common/Makefile b/common/Makefile index 0c075a960f..8b8686db1c 100644 --- a/common/Makefile +++ b/common/Makefile @@ -22,9 +22,10 @@ ifdef CONFIG_DEFAULT_ENVIRONMENT $(obj)/startup.o: include/barebox_default_env.h $(obj)/env.o: include/barebox_default_env.h -ENV_FILES := $(shell find $(srctree)/$(CONFIG_DEFAULT_ENVIRONMENT_PATH)) +ENV_FILES := $(shell cd $(srctree); for i in $(CONFIG_DEFAULT_ENVIRONMENT_PATH); do find $${i} -type f -exec readlink -f {} \;; done) + endif # ifdef CONFIG_DEFAULT_ENVIRONMENT include/barebox_default_env.h: $(ENV_FILES) - $(Q)scripts/bareboxenv -s $(srctree)/$(CONFIG_DEFAULT_ENVIRONMENT_PATH) barebox_default_env + $(Q)scripts/genenv $(srctree) $(CONFIG_DEFAULT_ENVIRONMENT_PATH) $(Q)cat barebox_default_env | scripts/bin2c default_environment > $@ diff --git a/common/console.c b/common/console.c index d3d31f7898..7199d9afb8 100644 --- a/common/console.c +++ b/common/console.c @@ -57,26 +57,32 @@ static int console_std_set(struct device_d *dev, struct param_d *param, const char *val) { struct console_device *cdev = dev->type_data; + char active[4]; unsigned int flag = 0, i = 0; + if (!val) + dev_param_set_generic(dev, param, NULL); + if (strchr(val, 'i') && cdev->f_caps & CONSOLE_STDIN) { - cdev->active[i++] = 'i'; + active[i++] = 'i'; flag |= CONSOLE_STDIN; } if (strchr(val, 'o') && cdev->f_caps & CONSOLE_STDOUT) { - cdev->active[i++] = 'o'; + active[i++] = 'o'; flag |= CONSOLE_STDOUT; } if (strchr(val, 'e') && cdev->f_caps & CONSOLE_STDERR) { - cdev->active[i++] = 'e'; + active[i++] = 'e'; flag |= CONSOLE_STDERR; } - cdev->active[i] = 0; + active[i] = 0; cdev->f_active = flag; + dev_param_set_generic(dev, param, active); + return 0; } @@ -85,8 +91,12 @@ static int console_baudrate_set(struct device_d *dev, struct param_d *param, { struct console_device *cdev = dev->type_data; int baudrate; + char baudstr[16]; unsigned char c; + if (!val) + dev_param_set_generic(dev, param, NULL); + baudrate = simple_strtoul(val, NULL, 10); if (cdev->f_active) { @@ -101,7 +111,8 @@ static int console_baudrate_set(struct device_d *dev, struct param_d *param, } else cdev->setbrg(cdev, baudrate); - sprintf(cdev->baudrate_string, "%d", baudrate); + sprintf(baudstr, "%d", baudrate); + dev_param_set_generic(dev, param, baudstr); return 0; } @@ -129,29 +140,20 @@ int console_register(struct console_device *newcdev) register_device(dev); if (newcdev->setbrg) { - newcdev->baudrate_param.set = console_baudrate_set; - newcdev->baudrate_param.name = "baudrate"; - sprintf(newcdev->baudrate_string, "%d", - CONFIG_BAUDRATE); - console_baudrate_set(dev, &newcdev->baudrate_param, - newcdev->baudrate_string); - newcdev->baudrate_param.value = newcdev->baudrate_string; - dev_add_param(dev, &newcdev->baudrate_param); + dev_add_param(dev, "baudrate", console_baudrate_set, NULL, 0); + dev_set_param(dev, "baudrate", "115200"); } - newcdev->active_param.set = console_std_set; - newcdev->active_param.name = "active"; - newcdev->active_param.value = newcdev->active; - dev_add_param(dev, &newcdev->active_param); + dev_add_param(dev, "active", console_std_set, NULL, 0); initialized = CONSOLE_INIT_FULL; #ifdef CONFIG_CONSOLE_ACTIVATE_ALL - console_std_set(dev, &newcdev->active_param, "ioe"); + dev_set_param(dev, "active", "ioe"); #endif #ifdef CONFIG_CONSOLE_ACTIVATE_FIRST if (list_empty(&console_list)) { first = 1; - console_std_set(dev, &newcdev->active_param, "ioe"); + dev_set_param(dev, "active", "ioe"); } #endif diff --git a/common/misc.c b/common/misc.c index b3292d3120..7edf536bab 100644 --- a/common/misc.c +++ b/common/misc.c @@ -56,6 +56,10 @@ const char *strerror(int errnum) case ENAMETOOLONG : str = "File name too long"; break; case ENOSYS : str = "Function not implemented"; break; case ENOTEMPTY : str = "Directory not empty"; break; + case EHOSTUNREACH : str = "No route to host"; break; + case EINTR : str = "Interrupted system call"; break; + case ENETUNREACH : str = "Network is unreachable"; break; + case ENETDOWN : str = "Network is down"; break; #if 0 /* These are probably not needed */ case ENOTBLK : str = "Block device required"; break; case EFBIG : str = "File too large"; break; @@ -79,8 +83,6 @@ const char *strerror(int errnum) case EAFNOSUPPORT : str = "Address family not supported by protocol"; break; case EADDRINUSE : str = "Address already in use"; break; case EADDRNOTAVAIL : str = "Cannot assign requested address"; break; - case ENETDOWN : str = "Network is down"; break; - case ENETUNREACH : str = "Network is unreachable"; break; case ENETRESET : str = "Network dropped connection because of reset"; break; case ECONNABORTED : str = "Software caused connection abort"; break; case ECONNRESET : str = "Connection reset by peer"; break; @@ -88,7 +90,6 @@ const char *strerror(int errnum) case ETIMEDOUT : str = "Connection timed out"; break; case ECONNREFUSED : str = "Connection refused"; break; case EHOSTDOWN : str = "Host is down"; break; - case EHOSTUNREACH : str = "No route to host"; break; case EALREADY : str = "Operation already in progress"; break; case EINPROGRESS : str = "Operation now in progress"; break; case ESTALE : str = "Stale NFS file handle"; break; |