summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--commands/bootchooser.c4
-rw-r--r--common/Kconfig2
-rw-r--r--common/Makefile1
-rw-r--r--common/bootm.c2
-rw-r--r--drivers/ata/ide-sff.c9
-rw-r--r--drivers/of/of_path.c2
-rw-r--r--drivers/usb/gadget/Kconfig1
-rw-r--r--lib/libfile.c9
-rwxr-xr-xscripts/checkpatch.pl2
10 files changed, 19 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 042486a997..ff2ed8fc0f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
VERSION = 2017
-PATCHLEVEL = 01
+PATCHLEVEL = 02
SUBLEVEL = 0
EXTRAVERSION =
NAME = None
diff --git a/commands/bootchooser.c b/commands/bootchooser.c
index 91938fe551..ac763a6553 100644
--- a/commands/bootchooser.c
+++ b/commands/bootchooser.c
@@ -134,8 +134,8 @@ BAREBOX_CMD_HELP_START(bootchooser)
BAREBOX_CMD_HELP_TEXT("Control misc behaviour of the bootchooser")
BAREBOX_CMD_HELP_TEXT("")
BAREBOX_CMD_HELP_TEXT("Options:")
-BAREBOX_CMD_HELP_OPT ("-a <n|default> [TARGETS]", "set priority of given targets to 'n' or the default priority")
-BAREBOX_CMD_HELP_OPT ("-p <n|default> [TARGETS]", "set remaining attempts of given targets to 'n' or the default attempts")
+BAREBOX_CMD_HELP_OPT ("-a <n|default> [TARGETS]", "set remaining attempts of given targets to 'n' or the default attempts")
+BAREBOX_CMD_HELP_OPT ("-p <n|default> [TARGETS]", "set priority of given targets to 'n' or the default priority")
BAREBOX_CMD_HELP_OPT ("-i", "Show information about the bootchooser")
BAREBOX_CMD_HELP_OPT ("-s", "Mark the last boot successful")
BAREBOX_CMD_HELP_END
diff --git a/common/Kconfig b/common/Kconfig
index 462c104fde..c9fe2cea7a 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -854,6 +854,8 @@ config DEFAULT_ENVIRONMENT_GENERIC
depends on DEFAULT_ENVIRONMENT
depends on !DEFAULT_ENVIRONMENT_GENERIC_NEW
depends on SHELL_HUSH
+ select COMMAND_SUPPORT
+ select GLOBALVAR
select CMD_GETOPT
select CMD_CRC
select CMD_CRC_CMP
diff --git a/common/Makefile b/common/Makefile
index a36ae5e91f..869b15a92a 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -86,6 +86,7 @@ endif
# dependencies on generated files need to be listed explicitly
$(obj)/version.o: include/generated/compile.h
$(obj)/imd-barebox.o: include/generated/compile.h
+$(obj)/pbl-imd-barebox.o: include/generated/compile.h
# compile.h changes depending on hostname, generation number, etc,
# so we regenerate it always.
diff --git a/common/bootm.c b/common/bootm.c
index 59843195cd..81625d9157 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -684,5 +684,5 @@ BAREBOX_MAGICVAR_NAMED(global_bootm_initrd, global.bootm.initrd, "bootm default
BAREBOX_MAGICVAR_NAMED(global_bootm_initrd_loadaddr, global.bootm.initrd.loadaddr, "bootm default initrd loadaddr");
BAREBOX_MAGICVAR_NAMED(global_bootm_oftree, global.bootm.oftree, "bootm default oftree");
BAREBOX_MAGICVAR_NAMED(global_bootm_verify, global.bootm.verify, "bootm default verify level");
-BAREBOX_MAGICVAR_NAMED(global_bootm_verbose, global.bootm.verify, "bootm default verbosity level (0=quiet)");
+BAREBOX_MAGICVAR_NAMED(global_bootm_verbose, global.bootm.verbose, "bootm default verbosity level (0=quiet)");
BAREBOX_MAGICVAR_NAMED(global_bootm_appendroot, global.bootm.appendroot, "Add root= option to Kernel to mount rootfs from the device the Kernel comes from");
diff --git a/drivers/ata/ide-sff.c b/drivers/ata/ide-sff.c
index e32cc3fc24..6dc89d79a5 100644
--- a/drivers/ata/ide-sff.c
+++ b/drivers/ata/ide-sff.c
@@ -389,11 +389,10 @@ int ide_port_register(struct ide_port *ide)
ide->port.ops = &ide_ops;
ret = ata_port_register(&ide->port);
- if (!ret)
- ata_port_detect(&ide->port);
-
if (ret)
- free(ide);
+ return ret;
+
+ ata_port_detect(&ide->port);
- return ret;
+ return 0;
}
diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c
index 946b9c7aa1..e0b2dc1247 100644
--- a/drivers/of/of_path.c
+++ b/drivers/of/of_path.c
@@ -66,7 +66,7 @@ static int __of_find_path(struct device_node *node, const char *part, char **out
return -ENODEV;
}
- if (!dev->driver)
+ if (dev->bus && !dev->driver)
return -ENODEV;
device_detect(dev);
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 81c3723200..eb279ae8df 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -19,6 +19,7 @@ config USB_GADGET_DRIVER_AT91
bool
prompt "at91 gadget driver"
depends on ARCH_AT91
+ depends on !ARCH_SAMA5D4
default y
select USB_GADGET_DUALSPEED
diff --git a/lib/libfile.c b/lib/libfile.c
index 049ec32d77..6b70306dbd 100644
--- a/lib/libfile.c
+++ b/lib/libfile.c
@@ -276,13 +276,14 @@ int copy_file(const char *src, const char *dst, int verbose)
goto out;
}
+ mode = O_WRONLY | O_CREAT;
+
ret = stat(dst, &dststat);
- if (ret)
+ if (ret && ret != -ENOENT)
goto out;
- mode = O_WRONLY | O_CREAT;
-
- if (S_ISREG(dststat.st_mode))
+ /* Set O_TRUNC only if file exist and is a regular file */
+ if (!ret && S_ISREG(dststat.st_mode))
mode |= O_TRUNC;
dstfd = open(dst, mode);
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f3fd3395f1..48ad4938d9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2264,7 +2264,7 @@ sub process {
## }
#need space before brace following if, while, etc
- if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) ||
+ if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) ||
$line =~ /do\{/) {
ERROR("space required before the open brace '{'\n" . $herecurr);
}