mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
60
common.sh
60
common.sh
@@ -34,7 +34,7 @@ compile_uboot()
|
||||
grab_version "$SOURCES/$BOOTSOURCEDIR" "VER"
|
||||
|
||||
# create patch for manual source changes in debug mode
|
||||
userpatch_create "u-boot"
|
||||
[[ $DEBUG_MODE == yes ]] && userpatch_create "u-boot"
|
||||
|
||||
display_alert "Compiling uboot" "$VER" "info"
|
||||
display_alert "Compiler version" "${UBOOT_COMPILER}gcc $(eval ${UBOOT_TOOLCHAIN:+env PATH=$UBOOT_TOOLCHAIN:$PATH} ${UBOOT_COMPILER}gcc -dumpversion)" "info"
|
||||
@@ -136,8 +136,8 @@ compile_kernel()
|
||||
grab_version "$SOURCES/$LINUXSOURCEDIR" "VER"
|
||||
|
||||
# create patch for manual source changes in debug mode
|
||||
userpatch_create "kernel"
|
||||
|
||||
[[ $DEBUG_MODE == yes ]] && userpatch_create "kernel"
|
||||
|
||||
display_alert "Compiling $BRANCH kernel" "$VER" "info"
|
||||
display_alert "Compiler version" "${KERNEL_COMPILER}gcc $(eval ${KERNEL_TOOLCHAIN:+env PATH=$KERNEL_TOOLCHAIN:$PATH} ${KERNEL_COMPILER}gcc -dumpversion)" "info"
|
||||
cd $SOURCES/$LINUXSOURCEDIR/
|
||||
@@ -385,39 +385,39 @@ customize_image()
|
||||
chmod +x $CACHEDIR/sdcard/tmp/customize-image.sh
|
||||
mkdir -p $CACHEDIR/sdcard/tmp/overlay
|
||||
mount --bind $SRC/userpatches/overlay $CACHEDIR/sdcard/tmp/overlay
|
||||
# separate remount command for compatibility with Trusty (util-linux < 2.27)
|
||||
mount -o remount,ro $CACHEDIR/sdcard/tmp/overlay
|
||||
display_alert "Calling image customization script" "customize-image.sh" "info"
|
||||
chroot $CACHEDIR/sdcard /bin/bash -c "/tmp/customize-image.sh $RELEASE $FAMILY $BOARD $BUILD_DESKTOP"
|
||||
umount $CACHEDIR/sdcard/tmp/overlay
|
||||
rm -r $CACHEDIR/sdcard/tmp/overlay
|
||||
mountpoint -q $CACHEDIR/sdcard/tmp/overlay || rm -r $CACHEDIR/sdcard/tmp/overlay
|
||||
}
|
||||
|
||||
userpatch_create()
|
||||
{
|
||||
if [[ $DEBUG_MODE == yes ]]; then
|
||||
# create commit to start from clean source
|
||||
git add .
|
||||
git -c user.name='Armbian User' -c user.email='user@example.org' commit -q -m "Cleaning working copy"
|
||||
|
||||
local patch="$SRC/userpatches/patch/$1-$LINUXFAMILY-$BRANCH.patch"
|
||||
|
||||
# apply previous user debug mode created patches
|
||||
[[ -f "$patch" && $1 == "u-boot" ]] && display_alert "Applying existing u-boot patch" "$patch" "wrn" && patch --batch --silent -p1 -N < $patch
|
||||
[[ -f "$patch" && $1 == "kernel" ]] && display_alert "Applying existing kernel patch" "$patch" "wrn" && patch --batch --silent -p1 -N < $patch
|
||||
# create commit to start from clean source
|
||||
git add .
|
||||
git -c user.name='Armbian User' -c user.email='user@example.org' commit -q -m "Cleaning working copy"
|
||||
|
||||
# prompt to alter source
|
||||
display_alert "Make your changes in this directory:" "$(pwd)" "wrn"
|
||||
display_alert "Press <Enter> after you are done" "waiting" "wrn"
|
||||
read
|
||||
tput cuu1
|
||||
git add .
|
||||
# create patch out of changes
|
||||
if ! git diff-index --quiet --cached HEAD; then
|
||||
git diff --staged > $patch
|
||||
display_alert "You will find your patch here:" "$patch" "info"
|
||||
else
|
||||
display_alert "No changes found, skipping patch creation" "" "wrn"
|
||||
fi
|
||||
git reset --soft HEAD~
|
||||
for i in {3..1..1};do echo -n "$i." && sleep 1; done
|
||||
local patch="$SRC/userpatches/patch/$1-$LINUXFAMILY-$BRANCH.patch"
|
||||
|
||||
# apply previous user debug mode created patches
|
||||
[[ -f "$patch" && $1 == "u-boot" ]] && display_alert "Applying existing u-boot patch" "$patch" "wrn" && patch --batch --silent -p1 -N < $patch
|
||||
[[ -f "$patch" && $1 == "kernel" ]] && display_alert "Applying existing kernel patch" "$patch" "wrn" && patch --batch --silent -p1 -N < $patch
|
||||
|
||||
# prompt to alter source
|
||||
display_alert "Make your changes in this directory:" "$(pwd)" "wrn"
|
||||
display_alert "Press <Enter> after you are done" "waiting" "wrn"
|
||||
read
|
||||
tput cuu1
|
||||
git add .
|
||||
# create patch out of changes
|
||||
if ! git diff-index --quiet --cached HEAD; then
|
||||
git diff --staged > $patch
|
||||
display_alert "You will find your patch here:" "$patch" "info"
|
||||
else
|
||||
display_alert "No changes found, skipping patch creation" "" "wrn"
|
||||
fi
|
||||
}
|
||||
git reset --soft HEAD~
|
||||
for i in {3..1..1};do echo -n "$i." && sleep 1; done
|
||||
}
|
||||
|
||||
60
general.sh
60
general.sh
@@ -19,6 +19,7 @@
|
||||
# fingerprint_image
|
||||
# addtorepo
|
||||
# prepare_host
|
||||
# download_toolchain
|
||||
|
||||
# cleaning <target>
|
||||
#
|
||||
@@ -240,6 +241,7 @@ fingerprint_image()
|
||||
Sources: http://github.com/igorpecovnik/lib
|
||||
Support: http://www.armbian.com, http://forum.armbian.com/
|
||||
Changelog: http://www.armbian.com/logbook/
|
||||
Documantation: http://docs.armbian.com/
|
||||
--------------------------------------------------------------------------------
|
||||
$(cat $SRC/lib/LICENSE)
|
||||
--------------------------------------------------------------------------------
|
||||
@@ -407,19 +409,12 @@ prepare_host() {
|
||||
find $SRC/lib/patch -type d ! -name . | sed "s%lib/patch%userpatches%" | xargs mkdir -p
|
||||
|
||||
# download external Linaro compiler and missing special dependencies since they are needed for certain sources
|
||||
cd $SRC/toolchains
|
||||
[[ ! -d $SRC/toolchains/gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu ]] && display_alert "Updating external compiler" "aarch64-linux-gnu 4.9" "info" \
|
||||
&& curl -LS --progress-bar "http://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/aarch64-linux-gnu/gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu.tar.xz" | tar xJf -
|
||||
#[[ ! -d $SRC/toolchains/gcc-linaro-4.9-2016.02-x86_64_arm-eabi ]] && display_alert "Updating external compiler" "arm-eabi 4.9" "info" \
|
||||
# && curl -LS --progress-bar "http://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/arm-eabi/gcc-linaro-4.9-2016.02-x86_64_arm-eabi.tar.xz" | tar xJf -
|
||||
[[ ! -d $SRC/toolchains/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabi ]] && display_alert "Updating external compilers" "arm-linux-gnueabi 4.9" "info" \
|
||||
&& curl -LS --progress-bar "http://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/arm-linux-gnueabi/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabi.tar.xz" | tar xJf -
|
||||
[[ ! -d $SRC/toolchains/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf ]] && display_alert "Updating external compilers" "arm-linux-gnueabihf 4.9" "info" \
|
||||
&& curl -LS --progress-bar "http://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/arm-linux-gnueabihf/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf.tar.xz" | tar xJf -
|
||||
[[ ! -d $SRC/toolchains/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux ]] && display_alert "Updating external compilers" "arm-linux-gnueabihf 4.8" "info" \
|
||||
&& curl -LS --progress-bar "http://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz" | tar xJf -
|
||||
[[ ! -d $SRC/toolchains/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf ]] && display_alert "Updating external compilers" "arm-linux-gnueabihf 5.3" "info" \
|
||||
&& curl -LS --progress-bar "https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/arm-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz" | tar xJf -
|
||||
download_toolchain "https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/aarch64-linux-gnu/gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu.tar.xz"
|
||||
download_toolchain "https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/arm-linux-gnueabi/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabi.tar.xz"
|
||||
download_toolchain "https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/arm-linux-gnueabihf/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf.tar.xz"
|
||||
download_toolchain "https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/arm-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz"
|
||||
#download_toolchain "https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/arm-eabi/gcc-linaro-4.9-2016.02-x86_64_arm-eabi.tar.xz"
|
||||
download_toolchain "https://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz"
|
||||
|
||||
dpkg --add-architecture i386
|
||||
apt-get install -qq -y --no-install-recommends lib32stdc++6 libc6-i386 lib32ncurses5 lib32tinfo5 zlib1g:i386 >/dev/null 2>&1
|
||||
@@ -436,3 +431,42 @@ prepare_host() {
|
||||
local freespace=$(findmnt --target $SRC -n -o AVAIL -b 2>/dev/null) # in bytes
|
||||
[[ -n $freespace && $(( $freespace / 1073741824 )) -lt 10 ]] && display_alert "Low free space left" "$(( $freespace / 1073741824 )) GiB" "wrn"
|
||||
}
|
||||
|
||||
# download_toolchain <url>
|
||||
#
|
||||
download_toolchain()
|
||||
{
|
||||
local url=$1
|
||||
local filename=${url##*/}
|
||||
local dirname=${filename//.tar.xz}
|
||||
|
||||
display_alert "Checking toolchain" "$dirname" "info"
|
||||
|
||||
if [[ -f $SRC/toolchains/$dirname/.download-complete ]]; then
|
||||
display_alert "Up to date"
|
||||
return
|
||||
fi
|
||||
|
||||
cd $SRC/toolchains/
|
||||
|
||||
display_alert "Downloading"
|
||||
curl -Lf --progress-bar $url -o $filename
|
||||
curl -Lf --progress-bar ${url}.asc -o ${filename}.asc
|
||||
|
||||
local verified=false
|
||||
|
||||
display_alert "Verifying"
|
||||
if grep -q 'BEGIN PGP SIGNATURE' ${filename}.asc; then
|
||||
gpg --list-keys 8F427EAF || gpg --keyserver keyserver.ubuntu.com --recv-keys 8F427EAF
|
||||
gpg --verify -q ${filename}.asc 2>/dev/null && verified=true
|
||||
else
|
||||
md5sum -c --status ${filename}.asc && verified=true
|
||||
fi
|
||||
if [[ $verified == true ]]; then
|
||||
display_alert "Extracting"
|
||||
tar --overwrite -xf $filename && touch $dirname/.download-complete
|
||||
display_alert "Download complete" "" "info"
|
||||
else
|
||||
display_alert "Verification failed" "" "wrn"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user