diff --git a/common.sh b/common.sh index 1681bbb42..7f13c5694 100644 --- a/common.sh +++ b/common.sh @@ -369,9 +369,9 @@ process_patch_file() { echo "$patch $description" >> $DEST/debug/install.log patch --batch --silent -p1 -N < $patch >> $DEST/debug/install.log 2>&1 - if [ $? -ne 0 ]; then + if [[ $? -ne 0 ]]; then display_alert "... $(basename $patch)" "failed" "wrn"; - if [[ $EXIT_PATCHING_ERROR == "yes" ]]; then exit_with_error "Aborting due to" "EXIT_PATCHING_ERROR"; fi + if [[ $EXIT_PATCHING_ERROR == yes ]]; then exit_with_error "Aborting due to" "EXIT_PATCHING_ERROR"; fi else display_alert "... $(basename $patch)" "succeeded" "info" fi diff --git a/config/boot-odroid-c1.ini b/config/boot-odroid-c1.ini index da9026314..72222ca39 100644 --- a/config/boot-odroid-c1.ini +++ b/config/boot-odroid-c1.ini @@ -90,4 +90,4 @@ if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; f if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi -bootm 0x21000000 0x22000000 0x21800000" \ No newline at end of file +bootm 0x21000000 0x22000000 0x21800000 diff --git a/debootstrap-ng.sh b/debootstrap-ng.sh index 61b33e7b1..166015b92 100644 --- a/debootstrap-ng.sh +++ b/debootstrap-ng.sh @@ -203,7 +203,7 @@ create_rootfs_cache() # stage: configure language and locales display_alert "Configuring locales" "$DEST_LANG" "info" - if [ -f $CACHEDIR/sdcard/etc/locale.gen ]; then sed -i "s/^# $DEST_LANG/$DEST_LANG/" $CACHEDIR/sdcard/etc/locale.gen; fi + if [[ -f $CACHEDIR/sdcard/etc/locale.gen ]]; then sed -i "s/^# $DEST_LANG/$DEST_LANG/" $CACHEDIR/sdcard/etc/locale.gen; fi eval 'LC_ALL=C LANG=C chroot $CACHEDIR/sdcard /bin/bash -c "locale-gen $DEST_LANG"' ${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'} eval 'LC_ALL=C LANG=C chroot $CACHEDIR/sdcard /bin/bash -c "update-locale LANG=$DEST_LANG LANGUAGE=$DEST_LANG LC_MESSAGES=POSIX"' \ ${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'} diff --git a/distributions.sh b/distributions.sh index 17c2f9f19..c41a70785 100644 --- a/distributions.sh +++ b/distributions.sh @@ -121,7 +121,7 @@ trusty) mkdir $CACHEDIR/sdcard/selinux # that my custom motd works well - if [ -d "$CACHEDIR/sdcard/etc/update-motd.d" ]; then + if [[ -d $CACHEDIR/sdcard/etc/update-motd.d ]]; then mv $CACHEDIR/sdcard/etc/update-motd.d $CACHEDIR/sdcard/etc/update-motd.d-backup fi @@ -130,7 +130,7 @@ trusty) sed -e "s/CODENAME/$RELEASE/g" -i $CACHEDIR/sdcard/etc/apt/apt.conf.d/50unattended-upgrades # remove what's anyway not working - #chroot $CACHEDIR/sdcard /bin/bash -c "apt-get remove --auto-remove ureadahead" + #chroot $CACHEDIR/sdcard /bin/bash -c "apt-get remove --auto-remove ureadahead" rm $CACHEDIR/sdcard/etc/init/ureadahead* rm $CACHEDIR/sdcard/etc/init/plymouth* ;; @@ -178,7 +178,7 @@ xenial) chroot $CACHEDIR/sdcard /bin/bash -c "systemctl --no-reload mask setserial.service etc-setserial.service >/dev/null 2>&1" # disable initramfs - sed -i 's/update_initramfs=yes/update_initramfs=no/' $CACHEDIR/sdcard/etc/initramfs-tools/update-initramfs.conf + #sed -i 's/update_initramfs=yes/update_initramfs=no/' $CACHEDIR/sdcard/etc/initramfs-tools/update-initramfs.conf ;; *) @@ -205,7 +205,7 @@ chroot $CACHEDIR/sdcard /bin/bash -c "dpkg-reconfigure -f noninteractive tzdata chroot $CACHEDIR/sdcard /bin/bash -c "(echo $ROOTPWD;echo $ROOTPWD;) | passwd root >/dev/null 2>&1" # create proper fstab -if [ "$BOOTSIZE" -eq "0" ]; then +if [[ $BOOTSIZE -eq 0 ]]; then local device="/dev/mmcblk0p1 / ext4 defaults,noatime,nodiratime,data=writeback,commit=600,errors=remount-ro" else local device="/dev/mmcblk0p2 / ext4 defaults,noatime,nodiratime,data=writeback,commit=600,errors=remount-ro" @@ -213,7 +213,7 @@ fi echo "$device 0 0" >> $CACHEDIR/sdcard/etc/fstab # flash media tunning -if [ -f "$CACHEDIR/sdcard/etc/default/tmpfs" ]; then +if [[ -f $CACHEDIR/sdcard/etc/default/tmpfs ]]; then sed -e 's/#RAMTMP=no/RAMTMP=yes/g' -i $CACHEDIR/sdcard/etc/default/tmpfs sed -e 's/#RUN_SIZE=10%/RUN_SIZE=128M/g' -i $CACHEDIR/sdcard/etc/default/tmpfs sed -e 's/#LOCK_SIZE=/LOCK_SIZE=/g' -i $CACHEDIR/sdcard/etc/default/tmpfs @@ -223,7 +223,7 @@ fi # add custom bashrc loading cat <> $CACHEDIR/sdcard/etc/bash.bashrc -if [ -f /etc/bash.bashrc.custom ]; then +if [[ -f /etc/bash.bashrc.custom ]]; then . /etc/bash.bashrc.custom fi END diff --git a/main.sh b/main.sh index a66cb506f..599018fbe 100644 --- a/main.sh +++ b/main.sh @@ -75,10 +75,20 @@ else CCACHE="" fi +if [[ $FORCE_CHECKOUT == yes ]]; then FORCE="-f"; else FORCE=""; fi + +# optimize build time with 100% CPU usage +CPUS=$(grep -c 'processor' /proc/cpuinfo) +if [[ $USEALLCORES != no ]]; then + CTHREADS="-j$(($CPUS + $CPUS/2))" +else + CTHREADS="-j1" +fi + # Check and fix dependencies, directory structure and settings prepare_host -# if KERNEL_ONLY, BOARD, BRANCH or RELEASE are not set, display selection manu +# if KERNEL_ONLY, BOARD, BRANCH or RELEASE are not set, display selection menu if [[ -z $KERNEL_ONLY ]]; then options+=("yes" "Kernel, u-boot and other packages") @@ -146,14 +156,6 @@ echo `date +"%d.%m.%Y %H:%M:%S"` $VERSION >> $DEST/debug/install.log display_alert "Starting Armbian build script" "@host" "info" -# optimize build time with 100% CPU usage -CPUS=$(grep -c 'processor' /proc/cpuinfo) -if [[ $USEALLCORES != no ]]; then - CTHREADS="-j$(($CPUS + $CPUS/2))" -else - CTHREADS="-j1" -fi - # display what we do if [[ $KERNEL_ONLY == yes ]]; then display_alert "Compiling kernel" "$BOARD" "info" @@ -170,8 +172,6 @@ start=`date +%s` # fetch_from_github [repository, sub directory] -if [[ $FORCE_CHECKOUT == yes ]]; then FORCE="-f"; else FORCE=""; fi - [[ $CLEAN_LEVEL == *sources* ]] && cleaning "sources" display_alert "source downloading" "@host" "info" diff --git a/makeboarddeb.sh b/makeboarddeb.sh index e7fdc50da..300b5cb2f 100644 --- a/makeboarddeb.sh +++ b/makeboarddeb.sh @@ -21,7 +21,7 @@ create_board_package (){ display_alert "Creating board support package" "$BOARD" "info" - if [[ $BRANCH == "next" ]]; then + if [[ $BRANCH == next ]]; then ROOT_BRACH="-next"; else ROOT_BRACH="";