0
Schwemmlandebene

[sunxi A31S / Banana-pi M2] Syntax error in configuration.sh

Recommended Posts

Hello,

 

first I want to thank for the Armbian distribution and the developer tools.

 

"sudo ./compile.sh" complains about a syntax error in configuration.sh.

Already up-to-date.
Already on 'master'
Your branch is up-to-date with 'origin/master'.
[ o.k. ] Preparing [ host ]
/home/toor/armbian/lib/configuration.sh: line 236: syntax error near unexpected token `)'
/home/toor/armbian/lib/configuration.sh: line 236: `		orangepipc)#enabled'
[ o.k. ] Starting Armbian build script [ @host ]
[ o.k. ] Building [ Armbian 5.00 Bananapim2 Debian jessie next ]
[ o.k. ] Syncing clock [ host ]
[ o.k. ] source downloading [ @host ]
[ o.k. ] ... creating a shallow clone 
fatal: repository '/home/toor/armbian/sources//branchless' does not exist
/home/toor/armbian/lib/general.sh: line 91: cd: /home/toor/armbian/sources//branchless: No such file or directory
[ o.k. ] ... creating a shallow clone 

Seems some ";;" are missing.

 

Greetings,

Steve

Share this post


Link to post
Share on other sites

Hello, 

 

thanks. Seems to be, there's is still one in common.sh.

Already up-to-date.
Already on 'master'
Your branch is up-to-date with 'origin/master'.
[[0;32m o.k. [0m] Preparing [[0;33m host [0m]
[[0;32m o.k. [0m] Starting Armbian build script [[0;33m @host [0m]
[[0;32m o.k. [0m] Building [[0;33m Armbian 5.00 Bananapim2 Debian jessie next [0m]
[snip]
[[0;32m o.k. [0m] Compiling uboot. Please wait. [[0;33m 2016.01 [0m]
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  GEN     include/autoconf.mk.dep
[snip]
  OBJCOPY spl/u-boot-spl.bin
  MKSUNXI spl/sunxi-spl.bin
  CAT     u-boot-sunxi-with-spl.bin
[[0;32m o.k. [0m] Target directory [[0;33m /home/toor/armbian/output/debs/ [0m]
[[0;32m o.k. [0m] Building deb [[0;33m linux-u-boot-next-bananapim2_5.00_armhf.deb [0m]
wc: /home/toor/armbian/output/debs/linux-u-boot-next-bananapim2_5.00_armhf.deb: No such file or directory
/home/toor/armbian/lib/common.sh: line 146: [: -lt: unary operator expected
[[0;32m o.k. [0m] Creating board support package. [[0;33m bananapim2 [0m]
[snip]
[[0;32m o.k. [0m] Possible after install. [[0;33m customize-image.sh [0m]
cp: cannot stat '/home/toor/armbian/output/cache/sdcard/etc/armbian.txt': No such file or directory
[[0;32m o.k. [0m] Writing bootloader [[0;33m /dev/loop0 [0m]
dpkg-deb: error: failed to read archive `/home/toor/armbian/output/debs/linux-u-boot-next-bananapim2_5.00_armhf.deb': No such file or directory
[[0;31m error [0m] U-boot failed to install [[0;33m @host [0m]

rm -rf $CHOOSEN_UBOOT (line 140) and wc -c $CHOOSEN_UBOOT | cut -f 1 -d ' ' may conflict.

 

My config:

toor@ubuntu:~/armbian$ diff compile.sh lib/compile.sh 
20c20
< CLEAN_LEVEL=""					# comma-separated list of clean targets: "make" = make clean for selected kernel and u-boot,
---
> CLEAN_LEVEL="make,debs"					# comma-separated list of clean targets: "make" = make clean for selected kernel and u-boot,
32,38d31
< 
< BUILD_DESKTOP="no"
< BOARD="bananapim2"
< BRANCH="next"
< RELEASE="jessie"
< PROGRESS_DISPLAY="plain"
< PROGRESS_LOG_TO_FILE="yes"

Greetings,

Steve

 

Edit: common.sh mentioned. Line number added.

Share this post


Link to post
Share on other sites

rm -rf $CHOOSEN_UBOOT and wc -c $CHOOSEN_UBOOT | cut -f 1 -d ' ' may conflict.

This part should be fine, error is due to missing quotes around $FILESIZE/single bracket test command in common.sh, 146

I believe your u-boot failed to build, but due to script error it wasn't detected properly.

 

 

 

diff --git a/common.sh b/common.sh
index 1c574b1..a68f311 100644
--- a/common.sh
+++ b/common.sh
@@ -143,7 +143,7 @@ END

        FILESIZE=$(wc -c $DEST/debs/$CHOOSEN_UBOOT | cut -f 1 -d ' ')

-       if [ $FILESIZE -lt 50000 ]; then
+       if [[ $FILESIZE -lt 50000 ]]; then
                display_alert "Building failed, check configuration." "$CHOOSEN_UBOOT deleted" "err"
                rm $DEST/debs/$CHOOSEN_UBOOT
                exit

 

 

 

Edit: I would suggest using default CLEAN_LEVEL value, or at least removing only "debs" while leaving "make"

Share this post


Link to post
Share on other sites

 CLEAN_LEVEL="" and CLEAN_LEVEL="make,debs" give the same error.

  MKSUNXI spl/sunxi-spl.bin
  CAT     u-boot-sunxi-with-spl.bin
[ o.k. ] Target directory [ /home/toor/armbian/output/debs/ ]
[ o.k. ] Building deb [ linux-u-boot-next-bananapim2_5.00_armhf.deb ]
wc: /home/toor/armbian/output/debs/linux-u-boot-next-bananapim2_5.00_armhf.deb: No such file or directory
[ error ] Building failed, check configuration. [ linux-u-boot-next-bananapim2_5.00_armhf.deb deleted ]
rm: cannot remove '/home/toor/armbian/output/debs/linux-u-boot-next-bananapim2_5.00_armhf.deb': No such file or directory

Share this post


Link to post
Share on other sites

output from:

 

set -vx

...

dpkg -b $CHOOSEN_UBOOT >/dev/null #2>&1

++ echo -e '[\e[0;32m o.k. \x1B[0m] Building deb [\e[0;33m linux-u-boot-next-bananapim2_5.00_armhf.deb \x1B[0m]'
[[0;32m o.k. [0m] Building deb [[0;33m linux-u-boot-next-bananapim2_5.00_armhf.deb [0m]
++ dpkg -b linux-u-boot-next-bananapim2_5.00_armhf
dpkg-deb: error: control directory has bad permissions 2755 (must be >=0755 and <=0775)
++ rm -rf linux-u-boot-next-bananapim2_5.00_armhf

Share this post


Link to post
Share on other sites

I've tried the following without success.

1. CLEAN_LEVEL="sources,make,debs"

2. sudo rm -rf sources

3. reboot and apt-get update, apt-get upgrade

 

common.sh:

set -vx
...
dpkg --info $CHOOSEN_UBOOT
dpkg -b $CHOOSEN_UBOOT >/dev/null #2>&1

output:

[ o.k. ] Building deb [ linux-u-boot-next-bananapim2_5.00_armhf.deb ]
++ dpkg --info linux-u-boot-next-bananapim2_5.00_armhf
dpkg-deb: error: error reading archive magic version number from file linux-u-boot-next-bananapim2_5.00_armhf: Is a directory
++ dpkg -b linux-u-boot-next-bananapim2_5.00_armhf
dpkg-deb: error: control directory has bad permissions 2755 (must be >=0755 and <=0775)
++ rm -rf linux-u-boot-next-bananapim2_5.00_armhf
++ CHOOSEN_UBOOT=linux-u-boot-next-bananapim2_5.00_armhf.deb
wc -c $DEST/debs/$CHOOSEN_UBOOT | cut -f 1 -d ' '
+++ cut -f 1 -d ' '
+++ wc -c /home/toor/armbian/output/debs/linux-u-boot-next-bananapim2_5.00_armhf.deb
wc: /home/toor/armbian/output/debs/linux-u-boot-next-bananapim2_5.00_armhf.deb: No such file or directory
++ FILESIZE=
++ [[ '' -lt 50000 ]]
++ display_alert 'Building failed, check configuration.' 'linux-u-boot-next-bananapim2_5.00_armhf.deb deleted' err
++ echo 'Displaying message: Building failed, check configuration.' 'linux-u-boot-next-bananapim2_5.00_armhf.deb deleted' err
++ [[ linux-u-boot-next-bananapim2_5.00_armhf.deb deleted != '' ]]
++ TMPARA='[\e[0;33m linux-u-boot-next-bananapim2_5.00_armhf.deb deleted \x1B[0m]'
++ '[' err == err ']'
++ echo -e '[\e[0;31m error \x1B[0m] Building failed, check configuration. [\e[0;33m linux-u-boot-next-bananapim2_5.00_armhf.deb deleted \x1B[0m]'
[ error ] Building failed, check configuration. [ linux-u-boot-next-bananapim2_5.00_armhf.deb deleted ]
++ rm /home/toor/armbian/output/debs/linux-u-boot-next-bananapim2_5.00_armhf.deb
rm: cannot remove '/home/toor/armbian/output/debs/linux-u-boot-next-bananapim2_5.00_armhf.deb': No such file or directory
++ exit

Share this post


Link to post
Share on other sites

[update] zador.blood.stained, thanks for your help.

Until Sunday afternoon I could build different images with sudo. Suddenly this was broken.

Your advice to run compile.sh as root worked.

Than I added a new user with sudo rights and started from scratch, git clone https://github.com/igorpecovnik/libetc.

and run "sudo compile.sh" successfully.

Now I only use the new user and everything works (kernel patches, customize-image.sh).

Greetings,

Steve

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0