summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-04 17:27:06 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-04 17:27:06 +0200
commitefa4d684d8927428d333f841e37adeedcfe61cfb (patch)
tree5c780a94fdfa9557da018a485d7fe884244aaf48
parent45d593bc5ec78e26e3a967517ed7a51f27c8b91f (diff)
parent10d63913999fbd5c02a2a8daecf877c24663bdca (diff)
downloadbarebox-efa4d684d8927428d333f841e37adeedcfe61cfb.tar.gz
barebox-efa4d684d8927428d333f841e37adeedcfe61cfb.tar.xz
Merge branch 'for-next/misc'
Conflicts: arch/arm/boards/chumby_falconwing/falconwing.c arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c arch/x86/mach-x86.dox scripts/setupmbr/setupmbr.c
-rw-r--r--arch/arm/boards/archosg9/env/boot/sd-card-android5
-rw-r--r--arch/arm/boards/archosg9/env/boot/sd-card-linux5
-rw-r--r--arch/arm/boards/archosg9/env/boot/usb-android5
-rw-r--r--arch/arm/boards/archosg9/env/boot/usb-linux5
-rw-r--r--arch/arm/boards/at91sam9m10ihd/env/boot/android5
-rw-r--r--arch/arm/boards/at91sam9m10ihd/env/boot/mmc5
-rw-r--r--arch/arm/boards/at91sam9m10ihd/env/boot/net5
-rw-r--r--arch/arm/boards/at91sam9m10ihd/env/boot/net-usb5
-rw-r--r--arch/arm/boards/beagle/env/boot/mmc5
-rw-r--r--arch/arm/boards/beagle/env/boot/nand-ubi5
-rw-r--r--arch/arm/boards/beagle/env/boot/nand-ubi-dt5
-rw-r--r--arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd5
-rw-r--r--arch/arm/boards/beaglebone/defaultenv-beaglebone/config19
-rw-r--r--arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-13005
-rw-r--r--arch/arm/boards/ccxmx51/env/boot/nand5
-rw-r--r--arch/arm/boards/clep7212/env/boot/nor5
-rw-r--r--arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext35
-rw-r--r--arch/arm/boards/datamodul-edm-qmx6/env/boot/mmc5
-rw-r--r--arch/arm/boards/delphi-poc20/env/boot/mmc5
-rw-r--r--arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal5
-rw-r--r--arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left5
-rw-r--r--arch/arm/boards/freescale-mx23-evk/mx23-evk.c6
-rw-r--r--arch/arm/boards/friendlyarm-mini2440/env/boot/nand5
-rw-r--r--arch/arm/boards/guf-vincell/env/boot/nand-ubi5
-rw-r--r--arch/arm/boards/highbank/env/boot/ahci5
-rw-r--r--arch/arm/boards/highbank/env/boot/ahci-boot5
-rw-r--r--arch/arm/boards/highbank/env/boot/mmc5
-rw-r--r--arch/arm/boards/highbank/env/boot/mmc-boot5
-rw-r--r--arch/arm/boards/highbank/env/boot/net5
-rw-r--r--arch/arm/boards/highbank/env/boot/net-eth15
-rw-r--r--arch/arm/boards/karo-tx25/env/boot/nand-ubi5
-rw-r--r--arch/arm/boards/mx31moboard/env/boot/nor5
-rw-r--r--arch/arm/boards/mx31moboard/env/boot/sd5
-rw-r--r--arch/arm/boards/mx31moboard/env/boot/usbmsd5
-rw-r--r--arch/arm/boards/panda/env/boot/mmc5
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/env/boot/nand5
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext35
-rw-r--r--arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/mmc5
-rw-r--r--arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/nand5
-rw-r--r--arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/spi5
-rw-r--r--arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi5
-rw-r--r--arch/arm/boards/phytec-phycore-imx31/env/boot/nand-ubi5
-rw-r--r--arch/arm/boards/phytec-phycore-imx35/env/boot/nand-ubi5
-rw-r--r--arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi5
-rw-r--r--arch/ppc/mach-mpc5xxx/include/mach/sdma.h4
-rw-r--r--arch/sandbox/include/asm/bitops.h7
-rw-r--r--arch/x86/lib/barebox.lds.S2
-rw-r--r--arch/x86/mach-i386/include/mach/barebox.lds.h8
-rw-r--r--commands/boot.c2
-rw-r--r--commands/ls.c65
-rw-r--r--commands/miitool.c6
-rw-r--r--common/resource.c2
-rw-r--r--defaultenv/defaultenv-2-base/boot/net5
-rw-r--r--defaultenv/defaultenv-2-base/data/boot-template5
-rw-r--r--defaultenv/defaultenv-2-dfu/boot/dfu5
-rw-r--r--include/stringlist.h3
-rw-r--r--lib/lz4/lz4_decompress.c6
-rw-r--r--lib/lzo/lzo1x_decompress_safe.c64
-rw-r--r--lib/stringlist.c6
-rw-r--r--scripts/setupmbr/setupmbr.c16
-rw-r--r--scripts/tegra/.gitignore1
61 files changed, 128 insertions, 314 deletions
diff --git a/arch/arm/boards/archosg9/env/boot/sd-card-android b/arch/arm/boards/archosg9/env/boot/sd-card-android
index a10a763af1..bc2df696a2 100644
--- a/arch/arm/boards/archosg9/env/boot/sd-card-android
+++ b/arch/arm/boards/archosg9/env/boot/sd-card-android
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "Android from SD card"
- exit
-fi
-
path=/mnt/sd
global.bootm.image=${path}/android
global.bootm.initrd=${path}/initramfs.cpio.lzo
diff --git a/arch/arm/boards/archosg9/env/boot/sd-card-linux b/arch/arm/boards/archosg9/env/boot/sd-card-linux
index 2ba9b9e1c2..b3eaa2437d 100644
--- a/arch/arm/boards/archosg9/env/boot/sd-card-linux
+++ b/arch/arm/boards/archosg9/env/boot/sd-card-linux
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "Linux from SD card"
- exit
-fi
-
path=/mnt/sd
global.bootm.image=${path}/zImage
initrd=${path}/initrd
diff --git a/arch/arm/boards/archosg9/env/boot/usb-android b/arch/arm/boards/archosg9/env/boot/usb-android
index a7ddabe49e..e97e0ade60 100644
--- a/arch/arm/boards/archosg9/env/boot/usb-android
+++ b/arch/arm/boards/archosg9/env/boot/usb-android
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "Android over usb"
- exit
-fi
-
path=/mnt/usb
global.bootm.image=${path}/android
global.bootm.initrd=${path}/initramfs.cpio.lzo
diff --git a/arch/arm/boards/archosg9/env/boot/usb-linux b/arch/arm/boards/archosg9/env/boot/usb-linux
index 12ae6381b2..a257138d45 100644
--- a/arch/arm/boards/archosg9/env/boot/usb-linux
+++ b/arch/arm/boards/archosg9/env/boot/usb-linux
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "Linux over usb"
- exit
-fi
-
path=/mnt/usb
global.bootm.image=${path}/zImage
initrd=${path}/initrd
diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/android b/arch/arm/boards/at91sam9m10ihd/env/boot/android
index e440f18068..8492e41f7f 100644
--- a/arch/arm/boards/at91sam9m10ihd/env/boot/android
+++ b/arch/arm/boards/at91sam9m10ihd/env/boot/android
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "android (nand)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
global.linux.bootargs.dyn.root="root=/dev/mtdblock1 rootfstype=jffs2 rw init=/init rootdelay=1"
# clean the mtdparts otherwise android does not boot
diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/mmc b/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
index 89c66ee8fc..8aeace4b9e 100644
--- a/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
+++ b/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "MMC slot"
- exit
-fi
-
path="/mnt/mmc"
global.bootm.image="${path}/zimage"
diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/net b/arch/arm/boards/at91sam9m10ihd/env/boot/net
index cdb2520d39..7acc83122d 100644
--- a/arch/arm/boards/at91sam9m10ihd/env/boot/net
+++ b/arch/arm/boards/at91sam9m10ihd/env/boot/net
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "network (tftp, nfs) (macb)"
- exit
-fi
-
ethact eth0
path="/mnt/tftp"
diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb b/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
index 6e341a0114..7b791a9575 100644
--- a/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
+++ b/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "network (tftp, nfs) (usb ethernet)"
- exit
-fi
-
usb -f
ethact eth1
diff --git a/arch/arm/boards/beagle/env/boot/mmc b/arch/arm/boards/beagle/env/boot/mmc
index 58bd55742c..db638f8cf8 100644
--- a/arch/arm/boards/beagle/env/boot/mmc
+++ b/arch/arm/boards/beagle/env/boot/mmc
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "MMC (ext3)"
- exit
-fi
-
global.bootm.image="/boot/zImage"
#global.bootm.oftree="/boot/oftree"
global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi b/arch/arm/boards/beagle/env/boot/nand-ubi
index 3037fd4ca9..e0ef904432 100644
--- a/arch/arm/boards/beagle/env/boot/nand-ubi
+++ b/arch/arm/boards/beagle/env/boot/nand-ubi
@@ -1,9 +1,4 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi-dt b/arch/arm/boards/beagle/env/boot/nand-ubi-dt
index b7a1f192c1..5fc0a6c53a 100644
--- a/arch/arm/boards/beagle/env/boot/nand-ubi-dt
+++ b/arch/arm/boards/beagle/env/boot/nand-ubi-dt
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
global.bootm.oftree="/dev/nand0.oftree.bb"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd b/arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd
index dce060542a..aa94b2fa2e 100644
--- a/arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd
+++ b/arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "kernel & rootfs on SD card"
- exit
-fi
-
global.bootm.image=/boot/uImage
global.bootm.oftree=/boot/oftree
#global.bootm.initrd=<path to initrd>
diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/config b/arch/arm/boards/beaglebone/defaultenv-beaglebone/config
deleted file mode 100644
index fbfa7d5174..0000000000
--- a/arch/arm/boards/beaglebone/defaultenv-beaglebone/config
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-# change network settings in /env/network/eth0
-# change mtd partition settings and automountpoints in /env/init/*
-
-# set to false if you do not want to have colors
-global.allow_color=true
-
-# user (used for network filenames)
-global.user=none
-
-# timeout in seconds before the default boot entry is started
-global.autoboot_timeout=3
-
-# default boot entry (one of /env/boot/*)
-global.boot.default=sd
-
-# base bootargs
-global.linux.bootargs.base="console=ttyO0,115200n8"
diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 b/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300
new file mode 100644
index 0000000000..56313bfdfb
--- /dev/null
+++ b/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo -n "changing USB current limit to 1300 mA... "
+i2c_write -b 0 -a 0x24 -r 0x01 0x3e
+echo "done"
diff --git a/arch/arm/boards/ccxmx51/env/boot/nand b/arch/arm/boards/ccxmx51/env/boot/nand
index bb114659ee..d53f07ec5d 100644
--- a/arch/arm/boards/ccxmx51/env/boot/nand
+++ b/arch/arm/boards/ccxmx51/env/boot/nand
@@ -1,9 +1,4 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "NAND Flash"
- exit
-fi
-
global.bootm.image="/dev/kernel"
global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"
diff --git a/arch/arm/boards/clep7212/env/boot/nor b/arch/arm/boards/clep7212/env/boot/nor
index df8c983884..d53f07ec5d 100644
--- a/arch/arm/boards/clep7212/env/boot/nor
+++ b/arch/arm/boards/clep7212/env/boot/nor
@@ -1,9 +1,4 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "NOR Flash"
- exit
-fi
-
global.bootm.image="/dev/kernel"
global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"
diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
index 4d830edc69..e71ad19bf7 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
+++ b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "MMC (ext)"
- exit
-fi
-
global.bootm.image="/mnt/disk0.2/boot/zImage-${global.hostname}"
global.bootm.oftree="/mnt/disk0.2/boot/oftree-${global.board.variant}"
global.linux.bootargs.dyn.root="root=/dev/mmcblk0p3 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/datamodul-edm-qmx6/env/boot/mmc b/arch/arm/boards/datamodul-edm-qmx6/env/boot/mmc
index e311763c48..d5e202f395 100644
--- a/arch/arm/boards/datamodul-edm-qmx6/env/boot/mmc
+++ b/arch/arm/boards/datamodul-edm-qmx6/env/boot/mmc
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "MMC"
- exit
-fi
-
global.bootm.image="/mnt/mmc/zImage"
global.bootm.oftree="/mnt/mmc/oftree"
global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/delphi-poc20/env/boot/mmc b/arch/arm/boards/delphi-poc20/env/boot/mmc
index e311763c48..d5e202f395 100644
--- a/arch/arm/boards/delphi-poc20/env/boot/mmc
+++ b/arch/arm/boards/delphi-poc20/env/boot/mmc
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "MMC"
- exit
-fi
-
global.bootm.image="/mnt/mmc/zImage"
global.bootm.oftree="/mnt/mmc/oftree"
global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal b/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
index ccd0f69bb4..2233f14269 100644
--- a/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
+++ b/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "internal harddisk"
- exit
-fi
-
path="/mnt/internal-hd0.0"
global.bootm.image="${path}/linuximage"
diff --git a/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left b/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
index 21935c6fff..da7bc0398a 100644
--- a/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
+++ b/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "left MMC slot"
- exit
-fi
-
path="/mnt/mmc-left.0"
global.bootm.image="${path}/linuximage"
diff --git a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
index 9f13fac6dd..6348692cb1 100644
--- a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
+++ b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
@@ -70,7 +70,7 @@ mem_initcall(mx23_evk_mem_init);
* If this SD card is also the boot media, we can use the second partition
* for our environment purpose (if present!).
*/
-static int register_persistant_environment(void)
+static int register_persistent_environment(void)
{
struct cdev *cdev;
@@ -116,9 +116,9 @@ static int mx23_evk_devices_init(void)
add_generic_device("mxs_mci", DEVICE_ID_DYNAMIC, NULL, IMX_SSP1_BASE,
0x8000, IORESOURCE_MEM, &mci_pdata);
- rc = register_persistant_environment();
+ rc = register_persistent_environment();
if (rc != 0)
- printf("Cannot create the 'env0' persistant "
+ printf("Cannot create the 'env0' persistent "
"environment storage (%d)\n", rc);
#ifdef CONFIG_USB_GADGET_DRIVER_ARC
diff --git a/arch/arm/boards/friendlyarm-mini2440/env/boot/nand b/arch/arm/boards/friendlyarm-mini2440/env/boot/nand
index 3037fd4ca9..e0ef904432 100644
--- a/arch/arm/boards/friendlyarm-mini2440/env/boot/nand
+++ b/arch/arm/boards/friendlyarm-mini2440/env/boot/nand
@@ -1,9 +1,4 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/guf-vincell/env/boot/nand-ubi b/arch/arm/boards/guf-vincell/env/boot/nand-ubi
index a3f748e746..510ac119b4 100644
--- a/arch/arm/boards/guf-vincell/env/boot/nand-ubi
+++ b/arch/arm/boards/guf-vincell/env/boot/nand-ubi
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree"
bootargs-root-ubi -r root -m nand0.root
diff --git a/arch/arm/boards/highbank/env/boot/ahci b/arch/arm/boards/highbank/env/boot/ahci
index 3bdb809932..46a8c1b321 100644
--- a/arch/arm/boards/highbank/env/boot/ahci
+++ b/arch/arm/boards/highbank/env/boot/ahci
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "AHCI"
- exit
-fi
-
path="/mnt/ahci"
global.bootm.image="${path}/zImage"
diff --git a/arch/arm/boards/highbank/env/boot/ahci-boot b/arch/arm/boards/highbank/env/boot/ahci-boot
index 0064a46fcc..919eac54a7 100644
--- a/arch/arm/boards/highbank/env/boot/ahci-boot
+++ b/arch/arm/boards/highbank/env/boot/ahci-boot
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "AHCI (UEFI boot partiton)"
- exit
-fi
-
path="/mnt/ahci-boot"
global.bootm.image="${path}/zImage"
diff --git a/arch/arm/boards/highbank/env/boot/mmc b/arch/arm/boards/highbank/env/boot/mmc
index 43a04b5d6b..0fff5b4a81 100644
--- a/arch/arm/boards/highbank/env/boot/mmc
+++ b/arch/arm/boards/highbank/env/boot/mmc
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "MMC slot"
- exit
-fi
-
path="/mnt/mmc"
global.bootm.image="${path}/zimage"
diff --git a/arch/arm/boards/highbank/env/boot/mmc-boot b/arch/arm/boards/highbank/env/boot/mmc-boot
index 93cd99b684..f3ae301e1b 100644
--- a/arch/arm/boards/highbank/env/boot/mmc-boot
+++ b/arch/arm/boards/highbank/env/boot/mmc-boot
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "MMC slot (UEFI boot partiton)"
- exit
-fi
-
path="/mnt/mmc-boot"
global.bootm.image="${path}/zimage"
diff --git a/arch/arm/boards/highbank/env/boot/net b/arch/arm/boards/highbank/env/boot/net
index 80862cdac1..6a700087fb 100644
--- a/arch/arm/boards/highbank/env/boot/net
+++ b/arch/arm/boards/highbank/env/boot/net
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "network (tftp, nfs) (eth0)"
- exit
-fi
-
ethact eth0
path="/mnt/tftp"
diff --git a/arch/arm/boards/highbank/env/boot/net-eth1 b/arch/arm/boards/highbank/env/boot/net-eth1
index d9e9804a02..1c70bdf3f0 100644
--- a/arch/arm/boards/highbank/env/boot/net-eth1
+++ b/arch/arm/boards/highbank/env/boot/net-eth1
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "network (tftp, nfs) (eth1)"
- exit
-fi
-
ethact eth1
path="/mnt/tftp"
diff --git a/arch/arm/boards/karo-tx25/env/boot/nand-ubi b/arch/arm/boards/karo-tx25/env/boot/nand-ubi
index 67b0cb4afe..d555a538d1 100644
--- a/arch/arm/boards/karo-tx25/env/boot/nand-ubi
+++ b/arch/arm/boards/karo-tx25/env/boot/nand-ubi
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/mx31moboard/env/boot/nor b/arch/arm/boards/mx31moboard/env/boot/nor
index e36655c689..f584307d7a 100644
--- a/arch/arm/boards/mx31moboard/env/boot/nor
+++ b/arch/arm/boards/mx31moboard/env/boot/nor
@@ -1,9 +1,4 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "NOR Flash"
- exit
-fi
-
global.bootm.image="/dev/nor0.kernel"
global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"
diff --git a/arch/arm/boards/mx31moboard/env/boot/sd b/arch/arm/boards/mx31moboard/env/boot/sd
index 16e734d807..a0c4da9e78 100644
--- a/arch/arm/boards/mx31moboard/env/boot/sd
+++ b/arch/arm/boards/mx31moboard/env/boot/sd
@@ -1,8 +1,3 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "SD Boot"
- exit
-fi
-
boot mci0
diff --git a/arch/arm/boards/mx31moboard/env/boot/usbmsd b/arch/arm/boards/mx31moboard/env/boot/usbmsd
index 6a16d3ecbf..208921da26 100644
--- a/arch/arm/boards/mx31moboard/env/boot/usbmsd
+++ b/arch/arm/boards/mx31moboard/env/boot/usbmsd
@@ -1,8 +1,3 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "USB Boot"
- exit
-fi
-
boot ehci0
diff --git a/arch/arm/boards/panda/env/boot/mmc b/arch/arm/boards/panda/env/boot/mmc
index 58bd55742c..db638f8cf8 100644
--- a/arch/arm/boards/panda/env/boot/mmc
+++ b/arch/arm/boards/panda/env/boot/mmc
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "MMC (ext3)"
- exit
-fi
-
global.bootm.image="/boot/zImage"
#global.bootm.oftree="/boot/oftree"
global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/phytec-phycard-imx6/env/boot/nand b/arch/arm/boards/phytec-phycard-imx6/env/boot/nand
index a51da9e340..cf3b25c11d 100644
--- a/arch/arm/boards/phytec-phycard-imx6/env/boot/nand
+++ b/arch/arm/boards/phytec-phycard-imx6/env/boot/nand
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "Kernel:nand;rootfs:nand"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree"
bootargs-ip
diff --git a/arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext3 b/arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext3
index fa1e9d68c9..443563390c 100644
--- a/arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext3
+++ b/arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext3
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "MMC (ext3)"
- exit
-fi
-
global.bootm.image="/mnt/kernel/linuximage"
#global.bootm.oftree="/boot/oftree"
bootargs-ip
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/mmc b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/mmc
index 93a2357448..32854d12e5 100644
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/mmc
+++ b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/mmc
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "kernel & rootfs on SD card"
- exit
-fi
-
global.bootm.image=/boot/uImage
#global.bootm.oftree=/boot/oftree
global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/nand b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/nand
index 22d657ed9d..cdfd93dce9 100644
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/nand
+++ b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/nand
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root,2048 rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/spi b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/spi
index 2d10184236..7a53d84817 100644
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/spi
+++ b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/spi
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "SPI NOR Flash"
- exit
-fi
-
global.bootm.image="/dev/m25p0.kernel"
# Use rootfs form NAND for now as rootfs partition < 4MB
diff --git a/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi b/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi
index 67b0cb4afe..d555a538d1 100644
--- a/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi
+++ b/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-phycore-imx31/env/boot/nand-ubi b/arch/arm/boards/phytec-phycore-imx31/env/boot/nand-ubi
index 67b0cb4afe..d555a538d1 100644
--- a/arch/arm/boards/phytec-phycore-imx31/env/boot/nand-ubi
+++ b/arch/arm/boards/phytec-phycore-imx31/env/boot/nand-ubi
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-phycore-imx35/env/boot/nand-ubi b/arch/arm/boards/phytec-phycore-imx35/env/boot/nand-ubi
index 67b0cb4afe..d555a538d1 100644
--- a/arch/arm/boards/phytec-phycore-imx35/env/boot/nand-ubi
+++ b/arch/arm/boards/phytec-phycore-imx35/env/boot/nand-ubi
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
index 1987492df7..da7cbddaa7 100644
--- a/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
+++ b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:rootfs ubi.mtd=nand0.rootfs rootfstype=ubifs"
diff --git a/arch/ppc/mach-mpc5xxx/include/mach/sdma.h b/arch/ppc/mach-mpc5xxx/include/mach/sdma.h
index 5e7ff5fffa..6a25d79fb6 100644
--- a/arch/ppc/mach-mpc5xxx/include/mach/sdma.h
+++ b/arch/ppc/mach-mpc5xxx/include/mach/sdma.h
@@ -82,11 +82,11 @@ ALL PARAMETERS ARE ALL LONGWORDS (FOUR BYTES EACH).
sdma->IntPend = (1 << tasknum); \
}
-/* get interupt pending bit of a task */
+/* get interrupt pending bit of a task */
#define SDMA_GET_PENDINGBIT(tasknum) \
((*(vu_long *)(MPC5XXX_SDMA + 0x14)) & (1<<(tasknum)))
-/* get interupt mask bit of a task */
+/* get interrupt mask bit of a task */
#define SDMA_GET_MASKBIT(tasknum) \
((*(vu_long *)(MPC5XXX_SDMA + 0x18)) & (1<<(tasknum)))
diff --git a/arch/sandbox/include/asm/bitops.h b/arch/sandbox/include/asm/bitops.h
index 94646d4d0d..447023da63 100644
--- a/arch/sandbox/include/asm/bitops.h
+++ b/arch/sandbox/include/asm/bitops.h
@@ -12,4 +12,11 @@
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/ops.h>
+#define set_bit(x, y) __set_bit(x, y)
+#define clear_bit(x, y) __clear_bit(x, y)
+#define change_bit(x, y) __change_bit(x, y)
+#define test_and_set_bit(x, y) __test_and_set_bit(x, y)
+#define test_and_clear_bit(x, y) __test_and_clear_bit(x, y)
+#define test_and_change_bit(x, y) __test_and_change_bit(x, y)
+
#endif
diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S
index 05d0f778e5..6cf6b10d1b 100644
--- a/arch/x86/lib/barebox.lds.S
+++ b/arch/x86/lib/barebox.lds.S
@@ -85,7 +85,7 @@ SECTIONS
boot_disk = .;
BYTE(0x00); /* boot disk number (provided by the BIOS)
- /* information about the persistant environment storage */
+ /* information about the persistent environment storage */
. = PATCH_AREA + PATCH_AREA_PERS_START;
pers_env_storage = .;
LONG(0x00000000); /* LBA start lower */
diff --git a/arch/x86/mach-i386/include/mach/barebox.lds.h b/arch/x86/mach-i386/include/mach/barebox.lds.h
index 12eeeacd63..f6f6346398 100644
--- a/arch/x86/mach-i386/include/mach/barebox.lds.h
+++ b/arch/x86/mach-i386/include/mach/barebox.lds.h
@@ -31,27 +31,27 @@
#define PATCH_AREA_BOOT_DEV 16
/**
- * Offset where to store information about the persistant environment storage
+ * Offset where to store information about the persistent environment storage
* It points to an LBA number (8 bytes) and defines the first sector of this
* storage on disk.
*/
#define PATCH_AREA_PERS_START 20
/**
- * Offset where to store information about the persistant environment storage
+ * Offset where to store information about the persistent environment storage
* It points to a short number (2 bytes) and defines the sector count of this
* storage on disk.
*/
#define PATCH_AREA_PERS_SIZE 28
/**
- * Offset where to store information about the persistant environment storage
+ * Offset where to store information about the persistent environment storage
* drive number (BIOS number, 1 byte)
*/
#define PATCH_AREA_PERS_DRIVE 30
/**
- * Mark the persistant environment as not used
+ * Mark the persistent environment as not used
*/
#define PATCH_AREA_PERS_SIZE_UNUSED 0x000
diff --git a/commands/boot.c b/commands/boot.c
index ba26cac986..3341a05ebd 100644
--- a/commands/boot.c
+++ b/commands/boot.c
@@ -151,7 +151,7 @@ static int bootscript_scan_path(struct blspec *blspec, const char *path)
glob(files, 0, NULL, &globb);
for (i = 0; i < globb.gl_pathc; i++) {
- char *bootscript_path = globb.gl_pathv[i];;
+ char *bootscript_path = globb.gl_pathv[i];
if (*basename(bootscript_path) == '.')
continue;
diff --git a/commands/ls.c b/commands/ls.c
index 344079030a..1a5925d427 100644
--- a/commands/ls.c
+++ b/commands/ls.c
@@ -53,6 +53,8 @@ int ls(const char *path, ulong flags)
char tmp[PATH_MAX];
struct stat s;
struct string_list sl;
+ struct string_list *entry;
+ int ret;
string_list_init(&sl);
@@ -71,51 +73,51 @@ int ls(const char *path, ulong flags)
if (!dir)
return -errno;
- while ((d = readdir(dir))) {
- sprintf(tmp, "%s/%s", path, d->d_name);
- if (flags & LS_COLUMN) {
- string_list_add_sorted(&sl, d->d_name);
- } else {
- if (lstat(tmp, &s))
- goto out;
- ls_one(d->d_name, tmp, &s);
- }
- }
+ while ((d = readdir(dir)))
+ string_list_add_sorted(&sl, d->d_name);
closedir(dir);
if (flags & LS_COLUMN) {
string_list_print_by_column(&sl);
- string_list_free(&sl);
- }
-
- if (!(flags & LS_RECURSIVE))
- return 0;
+ } else {
+ string_list_for_each_entry(entry, &sl) {
+ sprintf(tmp, "%s/%s", path, entry->str);
+ ret = lstat(tmp, &s);
+ if (ret) {
+ printf("%s: %s\n", tmp, strerror(-ret));
+ continue;
+ }
- dir = opendir(path);
- if (!dir) {
- errno = ENOENT;
- return -ENOENT;
+ ls_one(entry->str, tmp, &s);
+ }
}
- while ((d = readdir(dir))) {
+ if (!(flags & LS_RECURSIVE))
+ goto out;
- if (!strcmp(d->d_name, "."))
+ string_list_for_each_entry(entry, &sl) {
+ if (!strcmp(entry->str, "."))
+ continue;
+ if (!strcmp(entry->str, ".."))
continue;
- if (!strcmp(d->d_name, ".."))
+ sprintf(tmp, "%s/%s", path, entry->str);
+
+ ret = lstat(tmp, &s);
+ if (ret) {
+ printf("%s: %s\n", tmp, strerror(-ret));
continue;
- sprintf(tmp, "%s/%s", path, d->d_name);
+ }
- if (lstat(tmp, &s))
- goto out;
if (s.st_mode & S_IFDIR) {
char *norm = normalise_path(tmp);
ls(norm, flags);
free(norm);
}
}
+
out:
- closedir(dir);
+ string_list_free(&sl);
return 0;
}
@@ -127,6 +129,9 @@ static int do_ls(int argc, char *argv[])
ulong flags = LS_COLUMN;
struct string_list sl;
+ if (!strcmp(argv[0], "ll"))
+ flags &= ~LS_COLUMN;
+
while((opt = getopt(argc, argv, "RCl")) > 0) {
switch(opt) {
case 'R':
@@ -219,3 +224,11 @@ BAREBOX_CMD_START(ls)
BAREBOX_CMD_GROUP(CMD_GRP_FILE)
BAREBOX_CMD_HELP(cmd_ls_help)
BAREBOX_CMD_END
+
+BAREBOX_CMD_START(ll)
+ .cmd = do_ls,
+ BAREBOX_CMD_DESC("list a file or directory with details")
+ BAREBOX_CMD_OPTS("[-lCR] [FILEDIR...]")
+ BAREBOX_CMD_GROUP(CMD_GRP_FILE)
+ BAREBOX_CMD_HELP(cmd_ls_help)
+BAREBOX_CMD_END
diff --git a/commands/miitool.c b/commands/miitool.c
index 40e34e93cc..c62e7588a8 100644
--- a/commands/miitool.c
+++ b/commands/miitool.c
@@ -115,14 +115,14 @@ static int show_basic_mii(struct mii_bus *mii, struct phy_device *phydev,
for (i = 0; i < 32; i++)
mii_val[i] = mii->read(mii, phydev->addr, i);
+ printf("%s: %s%d: ", phydev->cdev.name,
+ mii->parent->name, mii->parent->id);
+
if (mii_val[MII_BMCR] == 0xffff || mii_val[MII_BMSR] == 0x0000) {
fprintf(stderr, " No MII transceiver present!.\n");
return -1;
}
- printf("%s: %s%d: ", phydev->cdev.name,
- mii->parent->name, mii->parent->id);
-
/* Descriptive rename. */
bmcr = mii_val[MII_BMCR];
bmsr = mii_val[MII_BMSR];
diff --git a/common/resource.c b/common/resource.c
index fe4680e3bd..1ea2a7522a 100644
--- a/common/resource.c
+++ b/common/resource.c
@@ -71,7 +71,7 @@ struct resource *__request_region(struct resource *parent,
goto ok;
if (start > r->end)
continue;
- debug("%s: 0x%08llx:0x%08llx conflicts with 0x%08llx:0x%08llx\n",
+ pr_warn("%s: 0x%08llx:0x%08llx conflicts with 0x%08llx:0x%08llx\n",
__func__,
(unsigned long long)start,
(unsigned long long)end,
diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index 05bb728fa1..ced2fadba2 100644
--- a/defaultenv/defaultenv-2-base/boot/net
+++ b/defaultenv/defaultenv-2-base/boot/net
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "network (tftp, nfs)"
- exit
-fi
-
path="/mnt/tftp"
global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
diff --git a/defaultenv/defaultenv-2-base/data/boot-template b/defaultenv/defaultenv-2-base/data/boot-template
index 9297499036..689d98e1e9 100644
--- a/defaultenv/defaultenv-2-base/data/boot-template
+++ b/defaultenv/defaultenv-2-base/data/boot-template
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "<menu text here>"
- exit
-fi
-
global.bootm.image=<path to image>
#global.bootm.oftree=<path to oftree>
#global.bootm.initrd=<path to initrd>
diff --git a/defaultenv/defaultenv-2-dfu/boot/dfu b/defaultenv/defaultenv-2-dfu/boot/dfu
index c9463b667e..682091141e 100644
--- a/defaultenv/defaultenv-2-dfu/boot/dfu
+++ b/defaultenv/defaultenv-2-dfu/boot/dfu
@@ -1,10 +1,5 @@
#!/bin/sh
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "Device Firmware upgrade (DFU)"
- exit
-fi
-
if [ -d /dfutmp ]; then
rm -r /dfutmp
fi
diff --git a/include/stringlist.h b/include/stringlist.h
index 8738137c8a..127998cb6e 100644
--- a/include/stringlist.h
+++ b/include/stringlist.h
@@ -29,4 +29,7 @@ static inline void string_list_free(struct string_list *sl)
}
}
+#define string_list_for_each_entry(entry, sl) \
+ list_for_each_entry(entry, &(sl)->list, list)
+
#endif /* __STRINGLIST_H */
diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c
index 8e64ce6aec..9f7bf1794a 100644
--- a/lib/lz4/lz4_decompress.c
+++ b/lib/lz4/lz4_decompress.c
@@ -73,6 +73,8 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
len = *ip++;
for (; len == 255; length += 255)
len = *ip++;
+ if (unlikely(length > (size_t)(length + len)))
+ goto _output_error;
length += len;
}
@@ -107,6 +109,8 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
if (length == ML_MASK) {
for (; *ip == 255; length += 255)
ip++;
+ if (unlikely(length > (size_t)(length + *ip)))
+ goto _output_error;
length += *ip++;
}
@@ -156,7 +160,7 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
/* write overflow error detected */
_output_error:
- return (int) (-(((char *)ip) - source));
+ return -1;
}
static int lz4_uncompress_unknownoutputsize(const char *source, char *dest,
diff --git a/lib/lzo/lzo1x_decompress_safe.c b/lib/lzo/lzo1x_decompress_safe.c
index de795a3cff..48bedba824 100644
--- a/lib/lzo/lzo1x_decompress_safe.c
+++ b/lib/lzo/lzo1x_decompress_safe.c
@@ -16,14 +16,34 @@
#include <lzo.h>
#include "lzodefs.h"
-#define HAVE_IP(x) ((size_t)(ip_end - ip) >= (size_t)(x))
-#define HAVE_OP(x) ((size_t)(op_end - op) >= (size_t)(x))
-#define NEED_IP(x) if (!HAVE_IP(x)) goto input_overrun
-#define NEED_OP(x) if (!HAVE_OP(x)) goto output_overrun
-#define TEST_LB(m_pos) if ((m_pos) < out) goto lookbehind_overrun
+#define HAVE_IP(t, x) \
+ (((size_t)(ip_end - ip) >= (size_t)(t + x)) && \
+ (((t + x) >= t) && ((t + x) >= x)))
+
+#define HAVE_OP(t, x) \
+ (((size_t)(op_end - op) >= (size_t)(t + x)) && \
+ (((t + x) >= t) && ((t + x) >= x)))
+
+#define NEED_IP(t, x) \
+ do { \
+ if (!HAVE_IP(t, x)) \
+ goto input_overrun; \
+ } while (0)
+
+#define NEED_OP(t, x) \
+ do { \
+ if (!HAVE_OP(t, x)) \
+ goto output_overrun; \
+ } while (0)
+
+#define TEST_LB(m_pos) \
+ do { \
+ if ((m_pos) < out) \
+ goto lookbehind_overrun; \
+ } while (0)
int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
- unsigned char *out, size_t *out_len)
+ unsigned char *out, size_t *out_len)
{
unsigned char *op;
const unsigned char *ip;
@@ -55,14 +75,14 @@ int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
while (unlikely(*ip == 0)) {
t += 255;
ip++;
- NEED_IP(1);
+ NEED_IP(1, 0);
}
t += 15 + *ip++;
}
t += 3;
copy_literal_run:
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
- if (likely(HAVE_IP(t + 15) && HAVE_OP(t + 15))) {
+ if (likely(HAVE_IP(t, 15) && HAVE_OP(t, 15))) {
const unsigned char *ie = ip + t;
unsigned char *oe = op + t;
do {
@@ -78,8 +98,8 @@ copy_literal_run:
} else
#endif
{
- NEED_OP(t);
- NEED_IP(t + 3);
+ NEED_OP(t, 0);
+ NEED_IP(t, 3);
do {
*op++ = *ip++;
} while (--t > 0);
@@ -92,7 +112,7 @@ copy_literal_run:
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
TEST_LB(m_pos);
- NEED_OP(2);
+ NEED_OP(2, 0);
op[0] = m_pos[0];
op[1] = m_pos[1];
op += 2;
@@ -116,10 +136,10 @@ copy_literal_run:
while (unlikely(*ip == 0)) {
t += 255;
ip++;
- NEED_IP(1);
+ NEED_IP(1, 0);
}
t += 31 + *ip++;
- NEED_IP(2);
+ NEED_IP(2, 0);
}
m_pos = op - 1;
next = get_unaligned_le16(ip);
@@ -134,10 +154,10 @@ copy_literal_run:
while (unlikely(*ip == 0)) {
t += 255;
ip++;
- NEED_IP(1);
+ NEED_IP(1, 0);
}
t += 7 + *ip++;
- NEED_IP(2);
+ NEED_IP(2, 0);
}
next = get_unaligned_le16(ip);
ip += 2;
@@ -151,7 +171,7 @@ copy_literal_run:
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
if (op - m_pos >= 8) {
unsigned char *oe = op + t;
- if (likely(HAVE_OP(t + 15))) {
+ if (likely(HAVE_OP(t, 15))) {
do {
COPY8(op, m_pos);
op += 8;
@@ -161,7 +181,7 @@ copy_literal_run:
m_pos += 8;
} while (op < oe);
op = oe;
- if (HAVE_IP(6)) {
+ if (HAVE_IP(6, 0)) {
state = next;
COPY4(op, ip);
op += next;
@@ -169,7 +189,7 @@ copy_literal_run:
continue;
}
} else {
- NEED_OP(t);
+ NEED_OP(t, 0);
do {
*op++ = *m_pos++;
} while (op < oe);
@@ -178,7 +198,7 @@ copy_literal_run:
#endif
{
unsigned char *oe = op + t;
- NEED_OP(t);
+ NEED_OP(t, 0);
op[0] = m_pos[0];
op[1] = m_pos[1];
op += 2;
@@ -191,15 +211,15 @@ match_next:
state = next;
t = next;
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
- if (likely(HAVE_IP(6) && HAVE_OP(4))) {
+ if (likely(HAVE_IP(6, 0) && HAVE_OP(4, 0))) {
COPY4(op, ip);
op += t;
ip += t;
} else
#endif
{
- NEED_IP(t + 3);
- NEED_OP(t);
+ NEED_IP(t, 3);
+ NEED_OP(t, 0);
while (t > 0) {
*op++ = *ip++;
t--;
diff --git a/lib/stringlist.c b/lib/stringlist.c
index a8af15d757..cc84944f73 100644
--- a/lib/stringlist.c
+++ b/lib/stringlist.c
@@ -64,7 +64,7 @@ int string_list_contains(struct string_list *sl, char *str)
{
struct string_list *entry;
- list_for_each_entry(entry, &sl->list, list) {
+ string_list_for_each_entry(entry, sl) {
if (!strcmp(str, entry->str))
return 1;
}
@@ -77,7 +77,7 @@ void string_list_print_by_column(struct string_list *sl)
int len = 0, num, i;
struct string_list *entry;
- list_for_each_entry(entry, &sl->list, list) {
+ string_list_for_each_entry(entry, sl) {
int l = strlen(entry->str) + 4;
if (l > len)
len = l;
@@ -91,7 +91,7 @@ void string_list_print_by_column(struct string_list *sl)
num = 1;
i = 0;
- list_for_each_entry(entry, &sl->list, list) {
+ string_list_for_each_entry(entry, sl) {
if (!(++i % num))
printf("%s\n", entry->str);
else
diff --git a/scripts/setupmbr/setupmbr.c b/scripts/setupmbr/setupmbr.c
index f1dfd5fde9..1487498f1f 100644
--- a/scripts/setupmbr/setupmbr.c
+++ b/scripts/setupmbr/setupmbr.c
@@ -140,7 +140,7 @@ static void invalidate_daps(struct DAPS *sector)
* Create the indirect sector with the DAPS entries
* @param daps_table Where to store the entries
* @param size Size of the whole image in bytes
- * @param pers_sector_count Count of sectors to skip after MBR for the persistant environment storage
+ * @param pers_sector_count Count of sectors to skip after MBR for the persistent environment storage
* @return 0 on success
*
* This routine calculates the DAPS entries for the case the whole
@@ -326,10 +326,10 @@ static int check_for_space(const void *hd_image, off_t size)
}
/**
- * Setup the persistant environment storage information
+ * Setup the persistent environment storage information
* @param patch_area Where to patch
- * @param pers_sector_start Start sector of the persistant environment storage
- * @param pers_sector_count Count of sectors for the persistant environment storage
+ * @param pers_sector_start Start sector of the persistent environment storage
+ * @param pers_sector_count Count of sectors for the persistent environment storage
* @return 0 on success
*/
static int store_pers_env_info(void *patch_area, uint64_t pers_sector_start, long pers_sector_count)
@@ -355,7 +355,7 @@ static int store_pers_env_info(void *patch_area, uint64_t pers_sector_start, lon
* Prepare the MBR and indirect sector for runtime
* @param fd_barebox barebox image to use
* @param fd_hd Hard disk image to prepare
- * @param pers_sector_count Count of sectors to skip after MBR for the persistant environment storage
+ * @param pers_sector_count Count of sectors to skip after MBR for the persistent environment storage
* @return 0 on success
*
* This routine expects a prepared hard disk image file with a partition table
@@ -390,7 +390,7 @@ static int barebox_overlay_mbr(int fd_barebox, int fd_hd, long pers_sector_count
}
/*
- * the persistant environment storage is in front of the main
+ * the persistent environment storage is in front of the main
* barebox image. To handle both, we need more space in front of the
* the first partition.
*/
@@ -415,7 +415,7 @@ static int barebox_overlay_mbr(int fd_barebox, int fd_hd, long pers_sector_count
/*
* embed the barebox main image into the disk drive image,
- * but keep the persistant environment storage untouched
+ * but keep the persistent environment storage untouched
* (if defined), e.g. store the main image behind this special area.
*/
memcpy(hd_image + ((pers_sector_count + 1) * SECTOR_SIZE),
@@ -471,7 +471,7 @@ static void print_usage(const char *pname)
{
printf("%s: Preparing a hard disk image for boot with barebox on x86.\n", pname);
printf("Usage is\n %s [options] -m <barebox image> -d <hd image>\n", pname);
- printf(" [options] are:\n -s <count> sector count of the persistant environment storage\n");
+ printf(" [options] are:\n -s <count> sector count of the persistent environment storage\n");
printf(" <barebox image> barebox's boot image file\n");
printf(" <hd image> HD image to store the barebox image\n");
printf(" If no '-s <x>' was given, barebox occupies sectors 0 to n, else sector 0 and x+1 to n\n");
diff --git a/scripts/tegra/.gitignore b/scripts/tegra/.gitignore
new file mode 100644
index 0000000000..5d5891b243
--- /dev/null
+++ b/scripts/tegra/.gitignore
@@ -0,0 +1 @@
+cbootimage