Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
2a2a29d5f1
34
build-all.sh
34
build-all.sh
@ -15,6 +15,18 @@ source $SRC/lib/general.sh
|
||||
# when we want to build from certain start
|
||||
from=0
|
||||
|
||||
free_cpu=$(grep -c 'processor' /proc/cpuinfo)
|
||||
free_cpu=$(($free_cpu + $free_cpu/2))
|
||||
|
||||
echo $MULTITHREAD
|
||||
free_cpu=1001
|
||||
[[ $MULTITHREAD != yes ]] && free_cpu=0
|
||||
|
||||
|
||||
|
||||
rm -rf /run/armbian
|
||||
mkdir -p /run/armbian
|
||||
|
||||
RELEASE_LIST=("trusty" "xenial" "wheezy" "jessie")
|
||||
BRANCH_LIST=("default" "next" "dev")
|
||||
|
||||
@ -109,15 +121,25 @@ for line in "${buildlist[@]}"; do
|
||||
CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \
|
||||
write_uboot_platform family_tweaks setup_write_uboot_platform BOOTSCRIPT UBOOT_FILES LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER \
|
||||
UBOOT_TARGET MODULES MODULES_NEXT MODULES_DEV INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY MODULES_BLACKLIST MODULES_BLACKLIST_NEXT \
|
||||
MODULES_BLACKLIST_DEV
|
||||
MODULES_BLACKLIST_DEV MOUNT SDCARD buildtext
|
||||
|
||||
read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
|
||||
n=$[$n+1]
|
||||
if [[ $from -le $n && ! -f "/run/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid" ]]; then
|
||||
display_alert "Building $n / ${#buildlist[@]}" "Board: $BOARD Kernel:$BRANCH${RELEASE:+ Release: $RELEASE}${BUILD_DESKTOP:+ Desktop: $BUILD_DESKTOP}" "ext"
|
||||
#touch "/run/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"
|
||||
source $SRC/lib/main.sh
|
||||
#rm "/run/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"
|
||||
|
||||
if [[ $from -le $n ]]; then
|
||||
|
||||
touch "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"
|
||||
jobs=$(ls /run/armbian | wc -l)
|
||||
if [[ $jobs -lt $free_cpu ]]; then
|
||||
display_alert "Building in the back $n / ${#buildlist[@]}" "Board: $BOARD Kernel:$BRANCH${RELEASE:+ Release: $RELEASE}${BUILD_DESKTOP:+ Desktop: $BUILD_DESKTOP}" "ext"
|
||||
source $SRC/lib/main.sh >/dev/null & 2>&1
|
||||
else
|
||||
display_alert "Building $buildtext $n / ${#buildlist[@]}" "Board: $BOARD Kernel:$BRANCH${RELEASE:+ Release: $RELEASE}${BUILD_DESKTOP:+ Desktop: $BUILD_DESKTOP}" "ext"
|
||||
source $SRC/lib/main.sh
|
||||
fi
|
||||
#
|
||||
# fake load
|
||||
#sleep $[ ( $RANDOM % 3 ) + 1 ]s
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@ -261,13 +261,13 @@ chroot_installpackages_local()
|
||||
-gpg-key="925644A6" -passphrase="testkey1234" -component=temp -distribution=$RELEASE publish repo temp
|
||||
aptly -config=$conf -listen=":8189" serve &
|
||||
local aptly_pid=$!
|
||||
cp $SRC/lib/extras-buildpkgs/buildpkg.key $CACHEDIR/$sdcard/tmp/buildpkg.key
|
||||
cat <<-'EOF' > $CACHEDIR/$sdcard/etc/apt/preferences.d/90-armbian-temp.pref
|
||||
cp $SRC/lib/extras-buildpkgs/buildpkg.key $CACHEDIR/$SDCARD/tmp/buildpkg.key
|
||||
cat <<-'EOF' > $CACHEDIR/$SDCARD/etc/apt/preferences.d/90-armbian-temp.pref
|
||||
Package: *
|
||||
Pin: origin "localhost"
|
||||
Pin-Priority: 550
|
||||
EOF
|
||||
cat <<-EOF > $CACHEDIR/$sdcard/etc/apt/sources.list.d/armbian-temp.list
|
||||
cat <<-EOF > $CACHEDIR/$SDCARD/etc/apt/sources.list.d/armbian-temp.list
|
||||
deb http://localhost:8189/ $RELEASE temp
|
||||
EOF
|
||||
chroot_installpackages
|
||||
@ -288,7 +288,7 @@ chroot_installpackages()
|
||||
unset package_install_target package_checkinstall
|
||||
done
|
||||
[[ $NO_APT_CACHER != yes ]] && local apt_extra="-o Acquire::http::Proxy=\"http://${APT_PROXY_ADDR:-localhost:3142}\" -o Acquire::http::Proxy::localhost=\"DIRECT\""
|
||||
cat <<-EOF > $CACHEDIR/$sdcard/tmp/install.sh
|
||||
cat <<-EOF > $CACHEDIR/$SDCARD/tmp/install.sh
|
||||
#!/bin/bash
|
||||
[[ "$remote_only" != yes ]] && apt-key add /tmp/buildpkg.key
|
||||
apt-get $apt_extra -q update
|
||||
@ -308,6 +308,6 @@ chroot_installpackages()
|
||||
rm /tmp/buildpkg.key 2>/dev/null
|
||||
rm -- "\$0"
|
||||
EOF
|
||||
chmod +x $CACHEDIR/$sdcard/tmp/install.sh
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "/tmp/install.sh"
|
||||
chmod +x $CACHEDIR/$SDCARD/tmp/install.sh
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "/tmp/install.sh"
|
||||
} #############################################################################
|
||||
|
||||
16
common.sh
16
common.sh
@ -397,19 +397,19 @@ customize_image()
|
||||
{
|
||||
# for users that need to prepare files at host
|
||||
[[ -f $SRC/userpatches/customize-image-host.sh ]] && source $SRC/userpatches/customize-image-host.sh
|
||||
cp $SRC/userpatches/customize-image.sh $CACHEDIR/$sdcard/tmp/customize-image.sh
|
||||
chmod +x $CACHEDIR/$sdcard/tmp/customize-image.sh
|
||||
mkdir -p $CACHEDIR/$sdcard/tmp/overlay
|
||||
cp $SRC/userpatches/customize-image.sh $CACHEDIR/$SDCARD/tmp/customize-image.sh
|
||||
chmod +x $CACHEDIR/$SDCARD/tmp/customize-image.sh
|
||||
mkdir -p $CACHEDIR/$SDCARD/tmp/overlay
|
||||
if [[ $(lsb_release -sc) == xenial ]]; then
|
||||
# util-linux >= 2.27 required
|
||||
mount -o bind,ro $SRC/userpatches/overlay $CACHEDIR/$sdcard/tmp/overlay
|
||||
mount -o bind,ro $SRC/userpatches/overlay $CACHEDIR/$SDCARD/tmp/overlay
|
||||
else
|
||||
mount -o bind $SRC/userpatches/overlay $CACHEDIR/$sdcard/tmp/overlay
|
||||
mount -o bind $SRC/userpatches/overlay $CACHEDIR/$SDCARD/tmp/overlay
|
||||
fi
|
||||
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
|
||||
mountpoint -q $CACHEDIR/$sdcard/tmp/overlay || rm -r $CACHEDIR/$sdcard/tmp/overlay
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "/tmp/customize-image.sh $RELEASE $FAMILY $BOARD $BUILD_DESKTOP"
|
||||
umount $CACHEDIR/$SDCARD/tmp/overlay
|
||||
mountpoint -q $CACHEDIR/$SDCARD/tmp/overlay || rm -r $CACHEDIR/$SDCARD/tmp/overlay
|
||||
}
|
||||
|
||||
userpatch_create()
|
||||
|
||||
@ -11,7 +11,7 @@ setenv rootfstype "ext4"
|
||||
|
||||
# temp fix: increase cpufreq and bus clock / speeds things up with vanilla images
|
||||
mw.l 0x1c2005c 1
|
||||
mw.l 0x1c20000 0x80001110
|
||||
mw.l 0x1c20000 0x80001010
|
||||
|
||||
if load mmc 0 ${load_addr} /boot/armbianEnv.txt || load mmc 0 ${load_addr} armbianEnv.txt; then
|
||||
env import -t ${load_addr} ${filesize}
|
||||
|
||||
@ -1099,7 +1099,7 @@ ir_tx = port:PH07<2><default><default><default>
|
||||
pmuic_type = 2
|
||||
pmu_gpio0 = port:PL06<1><1><2><1>
|
||||
pmu_level0 = 11300
|
||||
pmu_level1 = 01100
|
||||
pmu_level1 = 1100
|
||||
extremity_freq = 1296000000
|
||||
max_freq = 1200000000
|
||||
min_freq = 480000000
|
||||
|
||||
@ -1115,7 +1115,7 @@ ir_tx = port:PH07<2><default><default><default>
|
||||
pmuic_type = 2
|
||||
pmu_gpio0 = port:PL06<1><1><2><1>
|
||||
pmu_level0 = 11300
|
||||
pmu_level1 = 01100
|
||||
pmu_level1 = 1100
|
||||
extremity_freq = 1296000000
|
||||
max_freq = 1200000000
|
||||
min_freq = 480000000
|
||||
|
||||
@ -23,8 +23,6 @@ CONFIG_SWIOTLB=y
|
||||
CONFIG_IOMMU_HELPER=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_KERNEL_MODE_NEON=y
|
||||
CONFIG_ARM64_MODULE_CMODEL_LARGE=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_BUILDTIME_EXTABLE_SORT=y
|
||||
@ -351,6 +349,8 @@ CONFIG_CMA=y
|
||||
# CONFIG_CMA_DEBUG is not set
|
||||
CONFIG_FORCE_MAX_ZONEORDER=11
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_ARM64_MODULE_CMODEL_LARGE=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
|
||||
#
|
||||
# Boot options
|
||||
@ -3074,6 +3074,7 @@ CONFIG_QUOTACTL=y
|
||||
CONFIG_AUTOFS4_FS=y
|
||||
CONFIG_FUSE_FS=y
|
||||
CONFIG_CUSE=y
|
||||
CONFIG_OVERLAYFS_FS=y
|
||||
CONFIG_GENERIC_ACL=y
|
||||
|
||||
#
|
||||
|
||||
@ -3073,7 +3073,7 @@ CONFIG_USB_STORAGE=y
|
||||
# CONFIG_USB_STORAGE_KARMA is not set
|
||||
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
|
||||
# CONFIG_USB_STORAGE_ENE_UB6250 is not set
|
||||
# CONFIG_USB_UAS is not set
|
||||
CONFIG_USB_UAS=y
|
||||
|
||||
#
|
||||
# USB Imaging devices
|
||||
|
||||
@ -2794,7 +2794,7 @@ CONFIG_FB_BACKLIGHT=y
|
||||
CONFIG_FB_CONSOLE_SUNXI=y
|
||||
CONFIG_DISP2_SUNXI=y
|
||||
CONFIG_HDMI_DISP2_SUNXI=y
|
||||
CONFIG_TV_DISP2_SUNXI=m
|
||||
CONFIG_TV_DISP2_SUNXI=y
|
||||
# CONFIG_HDMI_EP952 is not set
|
||||
# CONFIG_DISP2_SUNXI_BOOT_COLORBAR is not set
|
||||
CONFIG_DISP2_SUNXI_DEBUG=y
|
||||
|
||||
@ -44,14 +44,14 @@ write_uboot_platform()
|
||||
family_tweaks()
|
||||
{
|
||||
# default lirc configuration
|
||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/lirc0"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="default"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.cubox-i $CACHEDIR/$sdcard/etc/lirc/lircd.conf
|
||||
install -m 755 $SRC/lib/bin/brcm_patchram_plus_cubox $CACHEDIR/$sdcard/usr/local/bin/brcm_patchram_plus
|
||||
cp $SRC/lib/scripts/brcm4330 $CACHEDIR/$sdcard/etc/default
|
||||
install -m 755 $SRC/lib/scripts/brcm4330-patch $CACHEDIR/$sdcard/etc/init.d/brcm4330-patch
|
||||
#chroot $CACHEDIR/$sdcard /bin/bash -c "LC_ALL=C LANG=C update-rc.d brcm4330-patch defaults>> /dev/null"
|
||||
if [[ $BRANCH == next && -f $CACHEDIR/$sdcard/boot/boot.cmd ]]; then
|
||||
sed -e 's/console=tty1 //g' -i $CACHEDIR/$sdcard/boot/boot.cmd
|
||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/lirc0"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="default"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.cubox-i $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
|
||||
install -m 755 $SRC/lib/bin/brcm_patchram_plus_cubox $CACHEDIR/$SDCARD/usr/local/bin/brcm_patchram_plus
|
||||
cp $SRC/lib/scripts/brcm4330 $CACHEDIR/$SDCARD/etc/default
|
||||
install -m 755 $SRC/lib/scripts/brcm4330-patch $CACHEDIR/$SDCARD/etc/init.d/brcm4330-patch
|
||||
#chroot $CACHEDIR/$SDCARD /bin/bash -c "LC_ALL=C LANG=C update-rc.d brcm4330-patch defaults>> /dev/null"
|
||||
if [[ $BRANCH == next && -f $CACHEDIR/$SDCARD/boot/boot.cmd ]]; then
|
||||
sed -e 's/console=tty1 //g' -i $CACHEDIR/$SDCARD/boot/boot.cmd
|
||||
fi
|
||||
}
|
||||
|
||||
@ -42,5 +42,5 @@ write_uboot_platform()
|
||||
|
||||
family_tweaks()
|
||||
{
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get -y -qq remove --auto-remove lirc linux-sound-base alsa-base alsa-utils bluez>/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove lirc linux-sound-base alsa-base alsa-utils bluez>/dev/null 2>&1"
|
||||
}
|
||||
|
||||
@ -39,8 +39,8 @@ write_uboot_platform()
|
||||
|
||||
family_tweaks()
|
||||
{
|
||||
install -m 755 $SRC/lib/scripts/c1_init.sh $CACHEDIR/$sdcard/etc/
|
||||
sed -e 's/exit 0//g' -i $CACHEDIR/$sdcard/etc/rc.local
|
||||
echo "/etc/c1_init.sh" >> $CACHEDIR/$sdcard/etc/rc.local
|
||||
echo "exit 0" >> $CACHEDIR/$sdcard/etc/rc.local
|
||||
install -m 755 $SRC/lib/scripts/c1_init.sh $CACHEDIR/$SDCARD/etc/
|
||||
sed -e 's/exit 0//g' -i $CACHEDIR/$SDCARD/etc/rc.local
|
||||
echo "/etc/c1_init.sh" >> $CACHEDIR/$SDCARD/etc/rc.local
|
||||
echo "exit 0" >> $CACHEDIR/$SDCARD/etc/rc.local
|
||||
}
|
||||
|
||||
@ -33,14 +33,14 @@ write_uboot_platform()
|
||||
|
||||
family_tweaks()
|
||||
{
|
||||
sed -i 's/MODULES=.*/MODULES="meson-ir"/' $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -i 's/LOAD_MODULES=.*/LOAD_MODULES="true"/' $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -i 's/DEVICE=.*/DEVICE="\/dev\/lirc0"/' $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -i 's/LIRCD_ARGS=.*/LIRCD_ARGS="--uinput"/' $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.odroidc2 $CACHEDIR/$sdcard/etc/lirc/lircd.conf
|
||||
sed -i 's/MODULES=.*/MODULES="meson-ir"/' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -i 's/LOAD_MODULES=.*/LOAD_MODULES="true"/' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -i 's/DEVICE=.*/DEVICE="\/dev\/lirc0"/' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -i 's/LIRCD_ARGS=.*/LIRCD_ARGS="--uinput"/' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.odroidc2 $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
|
||||
|
||||
install -m 755 $SRC/lib/scripts/c2_init.sh $CACHEDIR/$sdcard/etc/
|
||||
sed -e 's/exit 0//g' -i $CACHEDIR/$sdcard/etc/rc.local
|
||||
echo "/etc/c2_init.sh" >> $CACHEDIR/$sdcard/etc/rc.local
|
||||
echo "exit 0" >> $CACHEDIR/$sdcard/etc/rc.local
|
||||
install -m 755 $SRC/lib/scripts/c2_init.sh $CACHEDIR/$SDCARD/etc/
|
||||
sed -e 's/exit 0//g' -i $CACHEDIR/$SDCARD/etc/rc.local
|
||||
echo "/etc/c2_init.sh" >> $CACHEDIR/$SDCARD/etc/rc.local
|
||||
echo "exit 0" >> $CACHEDIR/$SDCARD/etc/rc.local
|
||||
}
|
||||
|
||||
@ -61,6 +61,6 @@ write_uboot_platform()
|
||||
|
||||
family_tweaks()
|
||||
{
|
||||
echo "blacklist ina231_sensor" > $CACHEDIR/$sdcard/etc/modprobe.d/blacklist-odroid.conf
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
|
||||
echo "blacklist ina231_sensor" > $CACHEDIR/$SDCARD/etc/modprobe.d/blacklist-odroid.conf
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ write_uboot_platform()
|
||||
[[ -f $1/u-boot-with-dtb.bin ]] && dd if=$1/u-boot-with-dtb.bin of=$2 bs=1k seek=8 conv=fsync > /dev/null 2>&1 || true
|
||||
if [[ -f $1/pine64-plus.dtb ]]; then
|
||||
if [[ -n $CACHEDIR ]]; then
|
||||
cp $1/{pine64-plus.dtb,pine64.dtb,pine64drm-plus.dtb,pine64drm.dtb} $CACHEDIR/mount/boot
|
||||
cp $1/{pine64-plus.dtb,pine64.dtb,pine64drm-plus.dtb,pine64drm.dtb} $CACHEDIR/$MOUNT/boot
|
||||
else
|
||||
cp $1/{pine64-plus.dtb,pine64.dtb,pine64drm-plus.dtb,pine64drm.dtb} /boot
|
||||
fi
|
||||
@ -55,7 +55,7 @@ write_uboot_platform()
|
||||
family_tweaks()
|
||||
{
|
||||
if [[ $BRANCH == default ]]; then
|
||||
mkdir -p $CACHEDIR/$sdcard/var/lib/alsa/
|
||||
cp $SRC/lib/config/asound.state.pine64-default $CACHEDIR/$sdcard/var/lib/alsa/asound.state
|
||||
mkdir -p $CACHEDIR/$SDCARD/var/lib/alsa/
|
||||
cp $SRC/lib/config/asound.state.pine64-default $CACHEDIR/$SDCARD/var/lib/alsa/asound.state
|
||||
fi
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ write_uboot_platform()
|
||||
|
||||
family_tweaks()
|
||||
{
|
||||
printf "blacklist wlan_8723bs_vq0\nblacklist ctp_gslX680\nblacklist ctp_gsl3680\n" > $CACHEDIR/$sdcard/etc/modprobe.d/blacklist-guitar.conf
|
||||
printf "blacklist gsensor_mir3da\nblacklist gsensor_stk8313\nblacklist gsensor_bma222\nblacklist lightsensor_ltr301\n" >> $CACHEDIR/$sdcard/etc/modprobe.d/blacklist-guitar.conf
|
||||
gzip < $SRC/lib/bin/armbian-u-boot.bmp > $CACHEDIR/$sdcard/boot/boot_logo.bmp.gz
|
||||
printf "blacklist wlan_8723bs_vq0\nblacklist ctp_gslX680\nblacklist ctp_gsl3680\n" > $CACHEDIR/$SDCARD/etc/modprobe.d/blacklist-guitar.conf
|
||||
printf "blacklist gsensor_mir3da\nblacklist gsensor_stk8313\nblacklist gsensor_bma222\nblacklist lightsensor_ltr301\n" >> $CACHEDIR/$SDCARD/etc/modprobe.d/blacklist-guitar.conf
|
||||
gzip < $SRC/lib/bin/armbian-u-boot.bmp > $CACHEDIR/$SDCARD/boot/boot_logo.bmp.gz
|
||||
}
|
||||
|
||||
@ -29,11 +29,11 @@ family_tweaks()
|
||||
# TODO: replace with udev rule
|
||||
# default lirc configuration
|
||||
sed -i '1i sed -i \x27s/DEVICE="\\/dev\\/input.*/DEVICE="\\/dev\\/input\\/\x27$str\x27"/g\x27 /etc/lirc/hardware.conf' \
|
||||
$CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
$CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -i '1i str=$(cat /proc/bus/input/devices | grep "H: Handlers=sysrq rfkill kbd event" | awk \x27{print $(NF)}\x27)' \
|
||||
$CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -i '1i # Cubietruck automatic lirc device detection by Igor Pecovnik' $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/input\/event1"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="devinput"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/$sdcard/etc/lirc/lircd.conf
|
||||
$CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -i '1i # Cubietruck automatic lirc device detection by Igor Pecovnik' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/input\/event1"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="devinput"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
|
||||
}
|
||||
|
||||
@ -38,15 +38,15 @@ family_tweaks()
|
||||
# TODO: replace with udev rule
|
||||
# default lirc configuration
|
||||
sed -i '1i sed -i \x27s/DEVICE="\\/dev\\/input.*/DEVICE="\\/dev\\/input\\/\x27$str\x27"/g\x27 /etc/lirc/hardware.conf' \
|
||||
$CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
$CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -i '1i str=$(cat /proc/bus/input/devices | grep "H: Handlers=sysrq rfkill kbd event" | awk \x27{print $(NF)}\x27)' \
|
||||
$CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -i '1i # Cubietruck automatic lirc device detection by Igor Pecovnik' $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/input\/event1"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="devinput"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/$sdcard/etc/lirc/lircd.conf
|
||||
$CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -i '1i # Cubietruck automatic lirc device detection by Igor Pecovnik' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/input\/event1"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="devinput"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
|
||||
if [[ $BRANCH == next ]]; then
|
||||
mkdir -p $CACHEDIR/$sdcard/var/lib/alsa/
|
||||
cp $SRC/lib/config/asound.state.sunxi-next $CACHEDIR/$sdcard/var/lib/alsa/asound.state
|
||||
mkdir -p $CACHEDIR/$SDCARD/var/lib/alsa/
|
||||
cp $SRC/lib/config/asound.state.sunxi-next $CACHEDIR/$SDCARD/var/lib/alsa/asound.state
|
||||
fi
|
||||
}
|
||||
|
||||
@ -29,30 +29,30 @@ esac
|
||||
family_tweaks()
|
||||
{
|
||||
# this is for legacy kernel only
|
||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/lirc0"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -e 's/MODULES=""/MODULES="sunxi_cir"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="default"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/$sdcard/etc/lirc/lircd.conf
|
||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/lirc0"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -e 's/MODULES=""/MODULES="sunxi_cir"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="default"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
|
||||
if [[ $BRANCH == default ]]; then
|
||||
mkdir -p $CACHEDIR/$sdcard/var/lib/alsa/
|
||||
cp $SRC/lib/config/asound.state.sun8i-default $CACHEDIR/$sdcard/var/lib/alsa/asound.state
|
||||
mkdir -p $CACHEDIR/$SDCARD/var/lib/alsa/
|
||||
cp $SRC/lib/config/asound.state.sun8i-default $CACHEDIR/$SDCARD/var/lib/alsa/asound.state
|
||||
fi
|
||||
# enable serial gadget on OTG port since the board doesn't have Ethernet
|
||||
if [[ ( $BOARD == orangepilite || $BOARD == nanopiair ) && $BRANCH == default && ( $RELEASE == jessie || $RELEASE == xenial ) ]]; then
|
||||
mkdir -p $CACHEDIR/$sdcard/etc/systemd/system/serial-getty@ttyGS0.service.d
|
||||
cat <<-EOF > $CACHEDIR/$sdcard/etc/systemd/system/serial-getty@ttyGS0.service.d/10-switch-role.conf
|
||||
mkdir -p $CACHEDIR/$SDCARD/etc/systemd/system/serial-getty@ttyGS0.service.d
|
||||
cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/serial-getty@ttyGS0.service.d/10-switch-role.conf
|
||||
[Service]
|
||||
ExecStartPre=-/bin/sh -c "echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role"
|
||||
EOF
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "systemctl --no-reload enable serial-getty@ttyGS0.service > /dev/null"
|
||||
echo "ttyGS0" >> $CACHEDIR/$sdcard/etc/securetty
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@ttyGS0.service > /dev/null"
|
||||
echo "ttyGS0" >> $CACHEDIR/$SDCARD/etc/securetty
|
||||
fi
|
||||
|
||||
# u-boot default is nonsec. Legacy requires sec, mainline requires nonsec for SMP
|
||||
if [[ ! -f $CACHEDIR/$sdcard/boot/armbianEnv.txt ]]; then
|
||||
if [[ ! -f $CACHEDIR/$SDCARD/boot/armbianEnv.txt ]]; then
|
||||
local boot_mode=nonsec
|
||||
[[ $BRANCH == default ]] && boot_mode=sec
|
||||
sed -i -e "1s/^/gpio set PL10\ngpio set PG11\nsetenv machid 1029\nsetenv bootm_boot_mode $boot_mode\n/" \
|
||||
-e 's/\ disp.screen0_output_mode=1920x1080p60//' -e 's/\ hdmi.audio=EDID:0//' $CACHEDIR/$sdcard/boot/boot.cmd
|
||||
-e 's/\ disp.screen0_output_mode=1920x1080p60//' -e 's/\ hdmi.audio=EDID:0//' $CACHEDIR/$SDCARD/boot/boot.cmd
|
||||
fi
|
||||
}
|
||||
|
||||
@ -44,18 +44,18 @@ write_uboot_platform()
|
||||
|
||||
family_tweaks()
|
||||
{
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.default
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.bonding
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.hostapd
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.default
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.bonding
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.hostapd
|
||||
if [[ $BOARD == udoo-neo ]]; then
|
||||
# SD card is elsewhere
|
||||
sed 's/mmcblk0p1/mmcblk1p1/' -i $CACHEDIR/$sdcard/etc/fstab
|
||||
sed 's/mmcblk0p1/mmcblk1p1/' -i $CACHEDIR/$SDCARD/etc/fstab
|
||||
# firmware for M4
|
||||
mkdir -p $CACHEDIR/$sdcard/boot/bin/
|
||||
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$sdcard/boot/bin/
|
||||
mkdir -p $CACHEDIR/$SDCARD/boot/bin/
|
||||
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/
|
||||
# fix for BT
|
||||
cp $SRC/lib/bin/udoo-neo-debs/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$sdcard/tmp
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
|
||||
cp $SRC/lib/bin/udoo-neo-debs/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$SDCARD/tmp
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -44,18 +44,18 @@ write_uboot_platform()
|
||||
|
||||
family_tweaks()
|
||||
{
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.default
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.bonding
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.hostapd
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.default
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.bonding
|
||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.hostapd
|
||||
if [[ $BOARD == udoo-neo ]]; then
|
||||
# SD card is elsewhere
|
||||
sed 's/mmcblk0p1/mmcblk1p1/' -i $CACHEDIR/$sdcard/etc/fstab
|
||||
sed 's/mmcblk0p1/mmcblk1p1/' -i $CACHEDIR/$SDCARD/etc/fstab
|
||||
# firmware for M4
|
||||
mkdir -p $CACHEDIR/$sdcard/boot/bin/
|
||||
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$sdcard/boot/bin/
|
||||
mkdir -p $CACHEDIR/$SDCARD/boot/bin/
|
||||
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/
|
||||
# fix for BT
|
||||
cp $SRC/lib/bin/udoo-neo-debs/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$sdcard/tmp
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
|
||||
cp $SRC/lib/bin/udoo-neo-debs/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$SDCARD/tmp
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -43,7 +43,11 @@ ARMBIAN_MAINLINE_KERNEL_VERSION='4.8'
|
||||
MAINLINE_KERNEL_BRANCH=tag:v$(wget -qO- https://www.kernel.org/finger_banner | awk '{print $NF}' | grep -oE "^${ARMBIAN_MAINLINE_KERNEL_VERSION//./\\.}\.?[[:digit:]]*" | tail -1)
|
||||
MAINLINE_KERNEL_DIR='linux-vanilla'
|
||||
|
||||
MAINLINE_UBOOT_SOURCE='git://git.denx.de/u-boot.git'
|
||||
if [[ $USE_GITHUB_UBOOT_MIRROR == yes ]]; then
|
||||
MAINLINE_UBOOT_SOURCE='https://github.com/RobertCNelson/u-boot'
|
||||
else
|
||||
MAINLINE_UBOOT_SOURCE='git://git.denx.de/u-boot.git'
|
||||
fi
|
||||
#MAINLINE_UBOOT_BRANCH="v$(git ls-remote git://git.denx.de/u-boot.git | grep -v rc | grep -v '\^' | tail -1 | cut -d'v' -f 2)"
|
||||
MAINLINE_UBOOT_BRANCH='tag:v2016.11'
|
||||
MAINLINE_UBOOT_DIR='u-boot'
|
||||
@ -59,8 +63,8 @@ SERIALCON=ttyS0
|
||||
BOOTSIZE=0
|
||||
|
||||
# set unique mounting directory
|
||||
sdcard="sdcard-${BRANCH}-${BOARD}-${RELEASE}"
|
||||
mount="mount-${BRANCH}-${BOARD}-${RELEASE}"
|
||||
SDCARD="sdcard-${BRANCH}-${BOARD}-${RELEASE}"
|
||||
MOUNT="mount-${BRANCH}-${BOARD}-${RELEASE}"
|
||||
|
||||
if [[ -f $SRC/lib/config/sources/$LINUXFAMILY.conf ]]; then
|
||||
source $SRC/lib/config/sources/$LINUXFAMILY.conf
|
||||
|
||||
@ -30,8 +30,8 @@ debootstrap_ng()
|
||||
trap unmount_on_exit INT TERM EXIT
|
||||
|
||||
# stage: clean and create directories
|
||||
rm -rf $CACHEDIR/{$sdcard,$mount}
|
||||
mkdir -p $CACHEDIR/{$sdcard,$mount,rootfs} $DEST/images
|
||||
rm -rf $CACHEDIR/{$SDCARD,$MOUNT}
|
||||
mkdir -p $CACHEDIR/{$SDCARD,$MOUNT,rootfs} $DEST/images
|
||||
|
||||
# stage: verify tmpfs configuration and mount
|
||||
# default maximum size for tmpfs mount is 1/2 of available RAM
|
||||
@ -44,7 +44,7 @@ debootstrap_ng()
|
||||
local use_tmpfs=yes
|
||||
fi
|
||||
|
||||
[[ $use_tmpfs == yes ]] && mount -t tmpfs -o size=${tmpfs_max_size}M tmpfs $CACHEDIR/$sdcard
|
||||
[[ $use_tmpfs == yes ]] && mount -t tmpfs -o size=${tmpfs_max_size}M tmpfs $CACHEDIR/$SDCARD
|
||||
|
||||
# stage: prepare basic rootfs: unpack cache or create from scratch
|
||||
create_rootfs_cache
|
||||
@ -52,8 +52,8 @@ debootstrap_ng()
|
||||
# stage: install kernel and u-boot packages
|
||||
# install distribution and board specific applications
|
||||
|
||||
mkdir -p $CACHEDIR/$sdcard/tmp/debs
|
||||
mount --bind $DEST/debs/ $CACHEDIR/$sdcard/tmp/debs
|
||||
mkdir -p $CACHEDIR/$SDCARD/tmp/debs
|
||||
mount --bind $DEST/debs/ $CACHEDIR/$SDCARD/tmp/debs
|
||||
|
||||
install_distribution_specific
|
||||
install_common
|
||||
@ -72,27 +72,27 @@ debootstrap_ng()
|
||||
fi
|
||||
|
||||
# cleanup for install_kernel and install_board_specific
|
||||
umount $CACHEDIR/$sdcard/tmp/debs
|
||||
mountpoint -q $CACHEDIR/$sdcard/tmp/debs || rm -rf $CACHEDIR/$sdcard/tmp/debs
|
||||
umount $CACHEDIR/$SDCARD/tmp/debs
|
||||
mountpoint -q $CACHEDIR/$SDCARD/tmp/debs || rm -rf $CACHEDIR/$SDCARD/tmp/debs
|
||||
|
||||
# stage: user customization script
|
||||
# NOTE: installing too many packages may fill tmpfs mount
|
||||
customize_image
|
||||
|
||||
# stage: cleanup
|
||||
rm -f $CACHEDIR/$sdcard/sbin/initctl $CACHEDIR/$sdcard/sbin/start-stop-daemon
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg-divert --quiet --local --rename --remove /sbin/initctl"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg-divert --quiet --local --rename --remove /sbin/start-stop-daemon"
|
||||
rm -f $CACHEDIR/$sdcard/usr/sbin/policy-rc.d $CACHEDIR/$sdcard/usr/bin/$QEMU_BINARY
|
||||
rm -f $CACHEDIR/$SDCARD/sbin/initctl $CACHEDIR/$SDCARD/sbin/start-stop-daemon
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg-divert --quiet --local --rename --remove /sbin/initctl"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg-divert --quiet --local --rename --remove /sbin/start-stop-daemon"
|
||||
rm -f $CACHEDIR/$SDCARD/usr/sbin/policy-rc.d $CACHEDIR/$SDCARD/usr/bin/$QEMU_BINARY
|
||||
|
||||
umount_chroot "$CACHEDIR/$sdcard"
|
||||
umount_chroot "$CACHEDIR/$SDCARD"
|
||||
|
||||
# to prevent creating swap file on NFS (needs specific kernel options)
|
||||
# and f2fs/btrfs (not recommended or needs specific kernel options)
|
||||
[[ $ROOTFS_TYPE != ext4 ]] && touch $CACHEDIR/$sdcard/var/swap
|
||||
[[ $ROOTFS_TYPE != ext4 ]] && touch $CACHEDIR/$SDCARD/var/swap
|
||||
|
||||
if [[ $ROOTFS_TYPE == fel ]]; then
|
||||
FEL_ROOTFS=$CACHEDIR/$sdcard/
|
||||
FEL_ROOTFS=$CACHEDIR/$SDCARD/
|
||||
display_alert "Starting FEL boot" "$BOARD" "info"
|
||||
source $SRC/lib/fel-load.sh
|
||||
else
|
||||
@ -101,9 +101,9 @@ debootstrap_ng()
|
||||
fi
|
||||
|
||||
# stage: unmount tmpfs
|
||||
[[ $use_tmpfs = yes ]] && umount $CACHEDIR/$sdcard
|
||||
[[ $use_tmpfs = yes ]] && umount $CACHEDIR/$SDCARD
|
||||
|
||||
rm -rf $CACHEDIR/$sdcard
|
||||
rm -rf $CACHEDIR/$SDCARD
|
||||
|
||||
# remove exit trap
|
||||
trap - INT TERM EXIT
|
||||
@ -121,7 +121,7 @@ create_rootfs_cache()
|
||||
if [[ -f $cache_fname ]]; then
|
||||
local date_diff=$(( ($(date +%s) - $(stat -c %Y $cache_fname)) / 86400 ))
|
||||
display_alert "Extracting $display_name" "$date_diff days old" "info"
|
||||
pv -p -b -r -c -N "$display_name" "$cache_fname" | pigz -dc | tar xp --xattrs -C $CACHEDIR/$sdcard/
|
||||
pv -p -b -r -c -N "$display_name" "$cache_fname" | pigz -dc | tar xp --xattrs -C $CACHEDIR/$SDCARD/
|
||||
else
|
||||
display_alert "Creating new rootfs for" "$RELEASE" "info"
|
||||
|
||||
@ -139,75 +139,75 @@ create_rootfs_cache()
|
||||
|
||||
display_alert "Installing base system" "Stage 1/2" "info"
|
||||
eval 'debootstrap --include=locales ${PACKAGE_LIST_EXCLUDE:+ --exclude=${PACKAGE_LIST_EXCLUDE// /,}} \
|
||||
--arch=$ARCH --foreign $RELEASE $CACHEDIR/$sdcard/ $apt_mirror' \
|
||||
--arch=$ARCH --foreign $RELEASE $CACHEDIR/$SDCARD/ $apt_mirror' \
|
||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Debootstrap (stage 1/2)..." $TTY_Y $TTY_X'} \
|
||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
||||
|
||||
[[ ${PIPESTATUS[0]} -ne 0 || ! -f $CACHEDIR/$sdcard/debootstrap/debootstrap ]] && exit_with_error "Debootstrap base system first stage failed"
|
||||
[[ ${PIPESTATUS[0]} -ne 0 || ! -f $CACHEDIR/$SDCARD/debootstrap/debootstrap ]] && exit_with_error "Debootstrap base system first stage failed"
|
||||
|
||||
cp /usr/bin/$QEMU_BINARY $CACHEDIR/$sdcard/usr/bin/
|
||||
cp /usr/bin/$QEMU_BINARY $CACHEDIR/$SDCARD/usr/bin/
|
||||
|
||||
mkdir -p $CACHEDIR/$sdcard/usr/share/keyrings/
|
||||
cp /usr/share/keyrings/debian-archive-keyring.gpg $CACHEDIR/$sdcard/usr/share/keyrings/
|
||||
mkdir -p $CACHEDIR/$SDCARD/usr/share/keyrings/
|
||||
cp /usr/share/keyrings/debian-archive-keyring.gpg $CACHEDIR/$SDCARD/usr/share/keyrings/
|
||||
|
||||
display_alert "Installing base system" "Stage 2/2" "info"
|
||||
eval 'chroot $CACHEDIR/$sdcard /bin/bash -c "/debootstrap/debootstrap --second-stage"' \
|
||||
eval 'chroot $CACHEDIR/$SDCARD /bin/bash -c "/debootstrap/debootstrap --second-stage"' \
|
||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Debootstrap (stage 2/2)..." $TTY_Y $TTY_X'} \
|
||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
||||
|
||||
[[ ${PIPESTATUS[0]} -ne 0 || ! -f $CACHEDIR/$sdcard/bin/bash ]] && exit_with_error "Debootstrap base system second stage failed"
|
||||
[[ ${PIPESTATUS[0]} -ne 0 || ! -f $CACHEDIR/$SDCARD/bin/bash ]] && exit_with_error "Debootstrap base system second stage failed"
|
||||
|
||||
mount_chroot "$CACHEDIR/$sdcard"
|
||||
mount_chroot "$CACHEDIR/$SDCARD"
|
||||
|
||||
# policy-rc.d script prevents starting or reloading services during image creation
|
||||
printf '#!/bin/sh\nexit 101' > $CACHEDIR/$sdcard/usr/sbin/policy-rc.d
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg-divert --quiet --local --rename --add /sbin/initctl"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg-divert --quiet --local --rename --add /sbin/start-stop-daemon"
|
||||
printf '#!/bin/sh\necho "Warning: Fake start-stop-daemon called, doing nothing"' > $CACHEDIR/$sdcard/sbin/start-stop-daemon
|
||||
printf '#!/bin/sh\necho "Warning: Fake initctl called, doing nothing"' > $CACHEDIR/$sdcard/sbin/initctl
|
||||
chmod 755 $CACHEDIR/$sdcard/usr/sbin/policy-rc.d
|
||||
chmod 755 $CACHEDIR/$sdcard/sbin/initctl
|
||||
chmod 755 $CACHEDIR/$sdcard/sbin/start-stop-daemon
|
||||
printf '#!/bin/sh\nexit 101' > $CACHEDIR/$SDCARD/usr/sbin/policy-rc.d
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg-divert --quiet --local --rename --add /sbin/initctl"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg-divert --quiet --local --rename --add /sbin/start-stop-daemon"
|
||||
printf '#!/bin/sh\necho "Warning: Fake start-stop-daemon called, doing nothing"' > $CACHEDIR/$SDCARD/sbin/start-stop-daemon
|
||||
printf '#!/bin/sh\necho "Warning: Fake initctl called, doing nothing"' > $CACHEDIR/$SDCARD/sbin/initctl
|
||||
chmod 755 $CACHEDIR/$SDCARD/usr/sbin/policy-rc.d
|
||||
chmod 755 $CACHEDIR/$SDCARD/sbin/initctl
|
||||
chmod 755 $CACHEDIR/$SDCARD/sbin/start-stop-daemon
|
||||
|
||||
# stage: configure language and locales
|
||||
display_alert "Configuring locales" "$DEST_LANG" "info"
|
||||
|
||||
[[ -f $CACHEDIR/$sdcard/etc/locale.gen ]] && sed -i "s/^# $DEST_LANG/$DEST_LANG/" $CACHEDIR/$sdcard/etc/locale.gen
|
||||
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=$DEST_LANG"' \
|
||||
[[ -f $CACHEDIR/$SDCARD/etc/locale.gen ]] && sed -i "s/^# $DEST_LANG/$DEST_LANG/" $CACHEDIR/$SDCARD/etc/locale.gen
|
||||
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=$DEST_LANG"' \
|
||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
||||
|
||||
if [[ -f $CACHEDIR/$sdcard/etc/default/console-setup ]]; then
|
||||
if [[ -f $CACHEDIR/$SDCARD/etc/default/console-setup ]]; then
|
||||
sed -e 's/CHARMAP=.*/CHARMAP="UTF-8"/' -e 's/FONTSIZE=.*/FONTSIZE="8x16"/' \
|
||||
-e 's/CODESET=.*/CODESET="guess"/' -i $CACHEDIR/$sdcard/etc/default/console-setup
|
||||
eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$sdcard /bin/bash -c "setupcon --save"'
|
||||
-e 's/CODESET=.*/CODESET="guess"/' -i $CACHEDIR/$SDCARD/etc/default/console-setup
|
||||
eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$SDCARD /bin/bash -c "setupcon --save"'
|
||||
fi
|
||||
|
||||
# stage: create apt sources list
|
||||
create_sources_list "$RELEASE" "$CACHEDIR/$sdcard/"
|
||||
create_sources_list "$RELEASE" "$CACHEDIR/$SDCARD/"
|
||||
|
||||
# stage: add armbian repository and install key
|
||||
case $RELEASE in
|
||||
wheezy|trusty)
|
||||
echo "deb http://apt.armbian.com $RELEASE main" > $CACHEDIR/$sdcard/etc/apt/sources.list.d/armbian.list
|
||||
echo "deb http://apt.armbian.com $RELEASE main" > $CACHEDIR/$SDCARD/etc/apt/sources.list.d/armbian.list
|
||||
;;
|
||||
jessie|xenial)
|
||||
echo "deb http://apt.armbian.com $RELEASE main utils ${RELEASE}-desktop" > $CACHEDIR/$sdcard/etc/apt/sources.list.d/armbian.list
|
||||
echo "deb http://apt.armbian.com $RELEASE main utils ${RELEASE}-desktop" > $CACHEDIR/$SDCARD/etc/apt/sources.list.d/armbian.list
|
||||
;;
|
||||
esac
|
||||
cp $SRC/lib/bin/armbian.key $CACHEDIR/$sdcard
|
||||
eval 'chroot $CACHEDIR/$sdcard /bin/bash -c "cat armbian.key | apt-key add -"' \
|
||||
cp $SRC/lib/bin/armbian.key $CACHEDIR/$SDCARD
|
||||
eval 'chroot $CACHEDIR/$SDCARD /bin/bash -c "cat armbian.key | apt-key add -"' \
|
||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
||||
rm $CACHEDIR/$sdcard/armbian.key
|
||||
rm $CACHEDIR/$SDCARD/armbian.key
|
||||
|
||||
# add armhf arhitecture to arm64
|
||||
[[ $ARCH == arm64 ]] && eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg --add-architecture armhf"'
|
||||
[[ $ARCH == arm64 ]] && eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg --add-architecture armhf"'
|
||||
|
||||
# stage: update packages list
|
||||
display_alert "Updating package list" "$RELEASE" "info"
|
||||
eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get -q -y $apt_extra update"' \
|
||||
eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get -q -y $apt_extra update"' \
|
||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Updating package lists..." $TTY_Y $TTY_X'} \
|
||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
||||
@ -216,7 +216,7 @@ create_rootfs_cache()
|
||||
|
||||
# stage: upgrade base packages from xxx-updates and xxx-backports repository branches
|
||||
display_alert "Upgrading base packages" "Armbian" "info"
|
||||
eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$sdcard /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y -q \
|
||||
eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$SDCARD /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y -q \
|
||||
$apt_extra $apt_extra_progress upgrade"' \
|
||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Upgrading base packages..." $TTY_Y $TTY_X'} \
|
||||
@ -226,7 +226,7 @@ create_rootfs_cache()
|
||||
|
||||
# stage: install additional packages
|
||||
display_alert "Installing packages for" "Armbian" "info"
|
||||
eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$sdcard /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y -q \
|
||||
eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$SDCARD /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y -q \
|
||||
$apt_extra $apt_extra_progress --no-install-recommends install $PACKAGE_LIST"' \
|
||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Installing Armbian system..." $TTY_Y $TTY_X'} \
|
||||
@ -239,19 +239,19 @@ create_rootfs_cache()
|
||||
eval 'df -h | grep "$CACHEDIR/"' ${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'}
|
||||
|
||||
# stage: remove downloaded packages
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get clean"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get clean"
|
||||
|
||||
# stage: make rootfs cache archive
|
||||
display_alert "Ending debootstrap process and preparing cache" "$RELEASE" "info"
|
||||
sync
|
||||
# the only reason to unmount here is compression progress display
|
||||
# based on rootfs size calculation
|
||||
umount_chroot "$CACHEDIR/$sdcard"
|
||||
umount_chroot "$CACHEDIR/$SDCARD"
|
||||
|
||||
tar cp --xattrs --directory=$CACHEDIR/$sdcard/ --exclude='./dev/*' --exclude='./proc/*' --exclude='./run/*' --exclude='./tmp/*' \
|
||||
--exclude='./sys/*' . | pv -p -b -r -s $(du -sb $CACHEDIR/$sdcard/ | cut -f1) -N "$display_name" | pigz --fast > $cache_fname
|
||||
tar cp --xattrs --directory=$CACHEDIR/$SDCARD/ --exclude='./dev/*' --exclude='./proc/*' --exclude='./run/*' --exclude='./tmp/*' \
|
||||
--exclude='./sys/*' . | pv -p -b -r -s $(du -sb $CACHEDIR/$SDCARD/ | cut -f1) -N "$display_name" | pigz --fast > $cache_fname
|
||||
fi
|
||||
mount_chroot "$CACHEDIR/$sdcard"
|
||||
mount_chroot "$CACHEDIR/$SDCARD"
|
||||
} #############################################################################
|
||||
|
||||
# prepare_partitions
|
||||
@ -311,7 +311,7 @@ prepare_partitions()
|
||||
# mountopts[nfs] is empty
|
||||
|
||||
# stage: calculate rootfs size
|
||||
local rootfs_size=$(du -sm $CACHEDIR/$sdcard/ | cut -f1) # MiB
|
||||
local rootfs_size=$(du -sm $CACHEDIR/$SDCARD/ | cut -f1) # MiB
|
||||
display_alert "Current rootfs size" "$rootfs_size MiB" "info"
|
||||
if [[ -n $FIXED_IMAGE_SIZE && $FIXED_IMAGE_SIZE =~ ^[0-9]+$ ]]; then
|
||||
display_alert "Using user-defined image size" "$FIXED_IMAGE_SIZE MiB" "info"
|
||||
@ -329,7 +329,7 @@ prepare_partitions()
|
||||
|
||||
# stage: create blank image
|
||||
display_alert "Creating blank image for rootfs" "$sdsize MiB" "info"
|
||||
dd if=/dev/zero bs=1M status=none count=$sdsize | pv -p -b -r -s $(( $sdsize * 1024 * 1024 )) | dd status=none of=$CACHEDIR/tmprootfs.raw
|
||||
dd if=/dev/zero bs=1M status=none count=$sdsize | pv -p -b -r -s $(( $sdsize * 1024 * 1024 )) | dd status=none of=$CACHEDIR/${sdcard}.raw
|
||||
|
||||
# stage: determine partition configuration
|
||||
if [[ $BOOTSIZE != 0 ]]; then
|
||||
@ -360,17 +360,17 @@ prepare_partitions()
|
||||
|
||||
# stage: create partition table
|
||||
display_alert "Creating partitions" "${bootfs:+/boot: $bootfs }root: $ROOTFS_TYPE" "info"
|
||||
parted -s $CACHEDIR/tmprootfs.raw -- mklabel msdos
|
||||
parted -s $CACHEDIR/${sdcard}.raw -- mklabel msdos
|
||||
if [[ $ROOTFS_TYPE == nfs ]]; then
|
||||
# single /boot partition
|
||||
parted -s $CACHEDIR/tmprootfs.raw -- mkpart primary ${parttype[$bootfs]} ${bootstart}s -1s
|
||||
parted -s $CACHEDIR/${sdcard}.raw -- mkpart primary ${parttype[$bootfs]} ${bootstart}s -1s
|
||||
elif [[ $BOOTSIZE == 0 ]]; then
|
||||
# single root partition
|
||||
parted -s $CACHEDIR/tmprootfs.raw -- mkpart primary ${parttype[$ROOTFS_TYPE]} ${rootstart}s -1s
|
||||
parted -s $CACHEDIR/${sdcard}.raw -- mkpart primary ${parttype[$ROOTFS_TYPE]} ${rootstart}s -1s
|
||||
else
|
||||
# /boot partition + root partition
|
||||
parted -s $CACHEDIR/tmprootfs.raw -- mkpart primary ${parttype[$bootfs]} ${bootstart}s ${bootend}s
|
||||
parted -s $CACHEDIR/tmprootfs.raw -- mkpart primary ${parttype[$ROOTFS_TYPE]} ${rootstart}s -1s
|
||||
parted -s $CACHEDIR/${sdcard}.raw -- mkpart primary ${parttype[$bootfs]} ${bootstart}s ${bootend}s
|
||||
parted -s $CACHEDIR/${sdcard}.raw -- mkpart primary ${parttype[$ROOTFS_TYPE]} ${rootstart}s -1s
|
||||
fi
|
||||
|
||||
# stage: mount image
|
||||
@ -381,50 +381,50 @@ prepare_partitions()
|
||||
# NOTE: losetup -P option is not available in Trusty
|
||||
[[ $CONTAINER_COMPAT == yes ]] && mknod -m0660 $LOOP b 7 ${LOOP//\/dev\/loop} > /dev/null
|
||||
|
||||
losetup $LOOP $CACHEDIR/tmprootfs.raw
|
||||
losetup $LOOP $CACHEDIR/${sdcard}.raw
|
||||
partprobe $LOOP
|
||||
|
||||
# stage: create fs, mount partitions, create fstab
|
||||
rm -f $CACHEDIR/$sdcard/etc/fstab
|
||||
rm -f $CACHEDIR/$SDCARD/etc/fstab
|
||||
if [[ -n $rootpart ]]; then
|
||||
display_alert "Creating rootfs" "$ROOTFS_TYPE"
|
||||
[[ $CONTAINER_COMPAT == yes ]] && mknod -m0660 $LOOPp${rootpart} b 259 ${rootpart} > /dev/null
|
||||
mkfs.${mkfs[$ROOTFS_TYPE]} ${mkopts[$ROOTFS_TYPE]} ${LOOP}p${rootpart}
|
||||
[[ $ROOTFS_TYPE == ext4 ]] && tune2fs -o journal_data_writeback ${LOOP}p${rootpart} > /dev/null
|
||||
[[ $ROOTFS_TYPE == btrfs ]] && local fscreateopt="-o compress=zlib"
|
||||
mount ${fscreateopt} ${LOOP}p${rootpart} $CACHEDIR/$mount/
|
||||
mount ${fscreateopt} ${LOOP}p${rootpart} $CACHEDIR/$MOUNT/
|
||||
local rootfs="UUID=$(blkid -s UUID -o value ${LOOP}p${rootpart})"
|
||||
echo "$rootfs / ${mkfs[$ROOTFS_TYPE]} defaults,noatime,nodiratime${mountopts[$ROOTFS_TYPE]} 0 1" >> $CACHEDIR/$sdcard/etc/fstab
|
||||
echo "$rootfs / ${mkfs[$ROOTFS_TYPE]} defaults,noatime,nodiratime${mountopts[$ROOTFS_TYPE]} 0 1" >> $CACHEDIR/$SDCARD/etc/fstab
|
||||
fi
|
||||
if [[ -n $bootpart ]]; then
|
||||
display_alert "Creating /boot" "$bootfs"
|
||||
[[ $CONTAINER_COMPAT == yes ]] && mknod -m0660 $LOOPp${bootpart} b 259 ${bootpart} > /dev/null
|
||||
mkfs.${mkfs[$bootfs]} ${mkopts[$bootfs]} ${LOOP}p${bootpart}
|
||||
mkdir -p $CACHEDIR/$mount/boot/
|
||||
mount ${LOOP}p${bootpart} $CACHEDIR/$mount/boot/
|
||||
echo "UUID=$(blkid -s UUID -o value ${LOOP}p${bootpart}) /boot ${mkfs[$bootfs]} defaults${mountopts[$bootfs]} 0 2" >> $CACHEDIR/$sdcard/etc/fstab
|
||||
mkdir -p $CACHEDIR/$MOUNT/boot/
|
||||
mount ${LOOP}p${bootpart} $CACHEDIR/$MOUNT/boot/
|
||||
echo "UUID=$(blkid -s UUID -o value ${LOOP}p${bootpart}) /boot ${mkfs[$bootfs]} defaults${mountopts[$bootfs]} 0 2" >> $CACHEDIR/$SDCARD/etc/fstab
|
||||
fi
|
||||
[[ $ROOTFS_TYPE == nfs ]] && echo "/dev/nfs / nfs defaults 0 0" >> $CACHEDIR/$sdcard/etc/fstab
|
||||
echo "tmpfs /tmp tmpfs defaults,nosuid 0 0" >> $CACHEDIR/$sdcard/etc/fstab
|
||||
[[ $ROOTFS_TYPE == nfs ]] && echo "/dev/nfs / nfs defaults 0 0" >> $CACHEDIR/$SDCARD/etc/fstab
|
||||
echo "tmpfs /tmp tmpfs defaults,nosuid 0 0" >> $CACHEDIR/$SDCARD/etc/fstab
|
||||
|
||||
# stage: adjust boot script or boot environment
|
||||
if [[ -f $CACHEDIR/$sdcard/boot/armbianEnv.txt ]]; then
|
||||
if [[ -f $CACHEDIR/$SDCARD/boot/armbianEnv.txt ]]; then
|
||||
if [[ $HAS_UUID_SUPPORT == yes ]]; then
|
||||
echo "rootdev=$rootfs" >> $CACHEDIR/$sdcard/boot/armbianEnv.txt
|
||||
echo "rootdev=$rootfs" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt
|
||||
elif [[ $rootpart != 1 ]]; then
|
||||
echo "rootdev=/dev/mmcblk0p${rootpart}" >> $CACHEDIR/$sdcard/boot/armbianEnv.txt
|
||||
echo "rootdev=/dev/mmcblk0p${rootpart}" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt
|
||||
fi
|
||||
echo "rootfstype=$ROOTFS_TYPE" >> $CACHEDIR/$sdcard/boot/armbianEnv.txt
|
||||
echo "rootfstype=$ROOTFS_TYPE" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt
|
||||
elif [[ $rootpart != 1 ]]; then
|
||||
local bootscript_dst=${BOOTSCRIPT##*:}
|
||||
sed -i 's/mmcblk0p1/mmcblk0p2/' $CACHEDIR/$sdcard/boot/$bootscript_dst
|
||||
sed -i 's/mmcblk0p1/mmcblk0p2/' $CACHEDIR/$SDCARD/boot/$bootscript_dst
|
||||
sed -i -e "s/rootfstype=ext4/rootfstype=$ROOTFS_TYPE/" \
|
||||
-e "s/rootfstype \"ext4\"/rootfstype \"$ROOTFS_TYPE\"/" $CACHEDIR/$sdcard/boot/$bootscript_dst
|
||||
-e "s/rootfstype \"ext4\"/rootfstype \"$ROOTFS_TYPE\"/" $CACHEDIR/$SDCARD/boot/$bootscript_dst
|
||||
fi
|
||||
|
||||
# recompile .cmd to .scr if boot.cmd exists
|
||||
[[ -f $CACHEDIR/$sdcard/boot/boot.cmd ]] && \
|
||||
mkimage -C none -A arm -T script -d $CACHEDIR/$sdcard/boot/boot.cmd $CACHEDIR/$sdcard/boot/boot.scr > /dev/null 2>&1
|
||||
[[ -f $CACHEDIR/$SDCARD/boot/boot.cmd ]] && \
|
||||
mkimage -C none -A arm -T script -d $CACHEDIR/$SDCARD/boot/boot.cmd $CACHEDIR/$SDCARD/boot/boot.scr > /dev/null 2>&1
|
||||
|
||||
} #############################################################################
|
||||
|
||||
@ -440,23 +440,23 @@ create_image()
|
||||
[[ $ROOTFS_TYPE == nfs ]] && version=${version}_nfsboot
|
||||
|
||||
if [[ $ROOTFS_TYPE != nfs ]]; then
|
||||
display_alert "Copying files to image" "tmprootfs.raw" "info"
|
||||
display_alert "Copying files to image" "${sdcard}.raw" "info"
|
||||
rsync -aHWXh --exclude="/boot/*" --exclude="/dev/*" --exclude="/proc/*" --exclude="/run/*" --exclude="/tmp/*" \
|
||||
--exclude="/sys/*" --info=progress2,stats1 $CACHEDIR/$sdcard/ $CACHEDIR/$mount/
|
||||
--exclude="/sys/*" --info=progress2,stats1 $CACHEDIR/$SDCARD/ $CACHEDIR/$MOUNT/
|
||||
else
|
||||
display_alert "Creating rootfs archive" "rootfs.tgz" "info"
|
||||
tar cp --xattrs --directory=$CACHEDIR/$sdcard/ --exclude='./boot/*' --exclude='./dev/*' --exclude='./proc/*' --exclude='./run/*' --exclude='./tmp/*' \
|
||||
--exclude='./sys/*' . | pv -p -b -r -s $(du -sb $CACHEDIR/$sdcard/ | cut -f1) -N "rootfs.tgz" | pigz > $DEST/images/${version}-rootfs.tgz
|
||||
tar cp --xattrs --directory=$CACHEDIR/$SDCARD/ --exclude='./boot/*' --exclude='./dev/*' --exclude='./proc/*' --exclude='./run/*' --exclude='./tmp/*' \
|
||||
--exclude='./sys/*' . | pv -p -b -r -s $(du -sb $CACHEDIR/$SDCARD/ | cut -f1) -N "rootfs.tgz" | pigz > $DEST/images/${version}-rootfs.tgz
|
||||
fi
|
||||
|
||||
# stage: rsync /boot
|
||||
display_alert "Copying files to /boot partition" "tmprootfs.raw" "info"
|
||||
if [[ $(findmnt --target $CACHEDIR/$mount/boot -o FSTYPE -n) == vfat ]]; then
|
||||
display_alert "Copying files to /boot partition" "${sdcard}.raw" "info"
|
||||
if [[ $(findmnt --target $CACHEDIR/$MOUNT/boot -o FSTYPE -n) == vfat ]]; then
|
||||
# fat32
|
||||
rsync -rLtWh --info=progress2,stats1 $CACHEDIR/$sdcard/boot $CACHEDIR/$mount
|
||||
rsync -rLtWh --info=progress2,stats1 $CACHEDIR/$SDCARD/boot $CACHEDIR/$MOUNT
|
||||
else
|
||||
# ext4
|
||||
rsync -aHWXh --info=progress2,stats1 $CACHEDIR/$sdcard/boot $CACHEDIR/$mount
|
||||
rsync -aHWXh --info=progress2,stats1 $CACHEDIR/$SDCARD/boot $CACHEDIR/$MOUNT
|
||||
fi
|
||||
|
||||
# DEBUG: print free space
|
||||
@ -468,19 +468,19 @@ create_image()
|
||||
|
||||
# unmount /boot first, rootfs second, image file last
|
||||
sync
|
||||
[[ $BOOTSIZE != 0 ]] && umount -l $CACHEDIR/$mount/boot
|
||||
[[ $ROOTFS_TYPE != nfs ]] && umount -l $CACHEDIR/$mount
|
||||
[[ $BOOTSIZE != 0 ]] && umount -l $CACHEDIR/$MOUNT/boot
|
||||
[[ $ROOTFS_TYPE != nfs ]] && umount -l $CACHEDIR/$MOUNT
|
||||
losetup -d $LOOP
|
||||
|
||||
if [[ $BUILD_ALL == yes ]]; then
|
||||
TEMP_DIR="$(mktemp -d $CACHEDIR/${version}.XXXXXX)"
|
||||
cp $CACHEDIR/$sdcard/etc/armbian.txt "${TEMP_DIR}/"
|
||||
mv "$CACHEDIR/tmprootfs.raw" "${TEMP_DIR}/${version}.img"
|
||||
cp $CACHEDIR/$SDCARD/etc/armbian.txt "${TEMP_DIR}/"
|
||||
mv "$CACHEDIR/${sdcard}.raw" "${TEMP_DIR}/${version}.img"
|
||||
cd "${TEMP_DIR}/"
|
||||
sign_and_compress &
|
||||
else
|
||||
cp $CACHEDIR/$sdcard/etc/armbian.txt $CACHEDIR/
|
||||
mv $CACHEDIR/tmprootfs.raw $CACHEDIR/${version}.img
|
||||
cp $CACHEDIR/$SDCARD/etc/armbian.txt $CACHEDIR/
|
||||
mv $CACHEDIR/${sdcard}.raw $CACHEDIR/${version}.img
|
||||
cd $CACHEDIR/
|
||||
sign_and_compress
|
||||
fi
|
||||
@ -559,12 +559,12 @@ umount_chroot()
|
||||
unmount_on_exit()
|
||||
{
|
||||
trap - INT TERM EXIT
|
||||
umount_chroot "$CACHEDIR/$sdcard/"
|
||||
umount -l $CACHEDIR/$sdcard/tmp >/dev/null 2>&1
|
||||
umount -l $CACHEDIR/$sdcard >/dev/null 2>&1
|
||||
umount -l $CACHEDIR/$mount/boot >/dev/null 2>&1
|
||||
umount -l $CACHEDIR/$mount >/dev/null 2>&1
|
||||
umount_chroot "$CACHEDIR/$SDCARD/"
|
||||
umount -l $CACHEDIR/$SDCARD/tmp >/dev/null 2>&1
|
||||
umount -l $CACHEDIR/$SDCARD >/dev/null 2>&1
|
||||
umount -l $CACHEDIR/$MOUNT/boot >/dev/null 2>&1
|
||||
umount -l $CACHEDIR/$MOUNT >/dev/null 2>&1
|
||||
losetup -d $LOOP >/dev/null 2>&1
|
||||
rm -rf $CACHEDIR/$sdcard
|
||||
rm -rf $CACHEDIR/$SDCARD
|
||||
exit_with_error "debootstrap-ng was interrupted"
|
||||
} #############################################################################
|
||||
|
||||
50
desktop.sh
50
desktop.sh
@ -13,64 +13,64 @@ install_desktop ()
|
||||
{
|
||||
display_alert "Installing desktop" "XFCE" "info"
|
||||
|
||||
mkdir -p $CACHEDIR/$sdcard/tmp/bin
|
||||
mount --bind $SRC/lib/bin/ $CACHEDIR/$sdcard/tmp/bin
|
||||
mkdir -p $CACHEDIR/$SDCARD/tmp/bin
|
||||
mount --bind $SRC/lib/bin/ $CACHEDIR/$SDCARD/tmp/bin
|
||||
|
||||
# install default desktop settings
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "tar xfz /tmp/bin/$RELEASE-desktop.tgz -C /etc/skel/"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "tar xfz /tmp/bin/$RELEASE-desktop.tgz -C /root/"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "tar xfz /tmp/bin/$RELEASE-desktop.tgz -C /etc/skel/"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "tar xfz /tmp/bin/$RELEASE-desktop.tgz -C /root/"
|
||||
|
||||
# install wallpapers
|
||||
case $RELEASE in
|
||||
wheezy)
|
||||
d=$CACHEDIR/$sdcard/usr/share/xfce4/backdrops/
|
||||
d=$CACHEDIR/$SDCARD/usr/share/xfce4/backdrops/
|
||||
test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
|
||||
;;
|
||||
|
||||
jessie|xenial)
|
||||
d=$CACHEDIR/$sdcard/usr/share/backgrounds/xfce/
|
||||
d=$CACHEDIR/$SDCARD/usr/share/backgrounds/xfce/
|
||||
test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
|
||||
mkdir -p $CACHEDIR/$sdcard/etc/polkit-1/localauthority/50-local.d
|
||||
cp $SRC/lib/config/polkit-jessie/*.pkla $CACHEDIR/$sdcard/etc/polkit-1/localauthority/50-local.d/
|
||||
mkdir -p $CACHEDIR/$SDCARD/etc/polkit-1/localauthority/50-local.d
|
||||
cp $SRC/lib/config/polkit-jessie/*.pkla $CACHEDIR/$SDCARD/etc/polkit-1/localauthority/50-local.d/
|
||||
;;
|
||||
|
||||
trusty)
|
||||
d=$CACHEDIR/$sdcard/usr/share/backgrounds/xfce/
|
||||
d=$CACHEDIR/$SDCARD/usr/share/backgrounds/xfce/
|
||||
test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Install custom icons and theme
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/bin/vibrancy-colors_2.4-trusty-Noobslab.com_all.deb >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "unzip -qq /tmp/bin/NumixHolo.zip -d /usr/share/themes"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/bin/vibrancy-colors_2.4-trusty-Noobslab.com_all.deb >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "unzip -qq /tmp/bin/NumixHolo.zip -d /usr/share/themes"
|
||||
|
||||
# Enable network manager
|
||||
if [[ -f ${CACHEDIR}/$sdcard/etc/NetworkManager/NetworkManager.conf ]]; then
|
||||
sed "s/managed=\(.*\)/managed=true/g" -i $CACHEDIR/$sdcard/etc/NetworkManager/NetworkManager.conf
|
||||
if [[ -f ${CACHEDIR}/$SDCARD/etc/NetworkManager/NetworkManager.conf ]]; then
|
||||
sed "s/managed=\(.*\)/managed=true/g" -i $CACHEDIR/$SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||
# Disable dns management withing NM
|
||||
sed "s/\[main\]/\[main\]\ndns=none/g" -i $CACHEDIR/$sdcard/etc/NetworkManager/NetworkManager.conf
|
||||
printf '[keyfile]\nunmanaged-devices=interface-name:p2p0\n' >> $CACHEDIR/$sdcard/etc/NetworkManager/NetworkManager.conf
|
||||
sed "s/\[main\]/\[main\]\ndns=none/g" -i $CACHEDIR/$SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||
printf '[keyfile]\nunmanaged-devices=interface-name:p2p0\n' >> $CACHEDIR/$SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||
fi
|
||||
|
||||
# Disable Pulseaudio timer scheduling which does not work with sndhdmi driver
|
||||
if [[ -f ${CACHEDIR}/$sdcard/etc/pulse/default.pa ]]; then
|
||||
sed "s/load-module module-udev-detect$/& tsched=0/g" -i $CACHEDIR/$sdcard/etc/pulse/default.pa
|
||||
if [[ -f ${CACHEDIR}/$SDCARD/etc/pulse/default.pa ]]; then
|
||||
sed "s/load-module module-udev-detect$/& tsched=0/g" -i $CACHEDIR/$SDCARD/etc/pulse/default.pa
|
||||
fi
|
||||
|
||||
# Disable desktop mode autostart for now to enforce creation of normal user account
|
||||
sed "s/NODM_ENABLED=\(.*\)/NODM_ENABLED=false/g" -i $CACHEDIR/$sdcard/etc/default/nodm
|
||||
sed "s/NODM_ENABLED=\(.*\)/NODM_ENABLED=false/g" -i $CACHEDIR/$SDCARD/etc/default/nodm
|
||||
|
||||
# Compile Turbo Frame buffer for sunxi
|
||||
if [[ $LINUXFAMILY == sun* && $BRANCH == default ]]; then
|
||||
|
||||
if [[ $RELEASE == jessie || $RELEASE == xenial ]]; then
|
||||
# Disable compositing by default
|
||||
sed 's/name="use_compositing" type="bool" value="true"/name="use_compositing" type="bool" value="false"/' -i $CACHEDIR/$sdcard/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
|
||||
sed 's/name="use_compositing" type="bool" value="true"/name="use_compositing" type="bool" value="false"/' -i $CACHEDIR/$sdcard/root/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
|
||||
sed 's/name="use_compositing" type="bool" value="true"/name="use_compositing" type="bool" value="false"/' -i $CACHEDIR/$SDCARD/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
|
||||
sed 's/name="use_compositing" type="bool" value="true"/name="use_compositing" type="bool" value="false"/' -i $CACHEDIR/$SDCARD/root/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
|
||||
fi
|
||||
|
||||
# Set default audio-output to HDMI for desktop-images
|
||||
cat <<-EOF >> $CACHEDIR/$sdcard/etc/asound.conf
|
||||
cat <<-EOF >> $CACHEDIR/$SDCARD/etc/asound.conf
|
||||
pcm.!default {
|
||||
type hw
|
||||
card 1
|
||||
@ -83,12 +83,12 @@ install_desktop ()
|
||||
EOF
|
||||
|
||||
# enable memory reservations
|
||||
if [[ -f $CACHEDIR/$sdcard/boot/armbianEnv.txt ]]; then
|
||||
echo "disp_mem_reserves=on" >> $CACHEDIR/$sdcard/boot/armbianEnv.txt
|
||||
if [[ -f $CACHEDIR/$SDCARD/boot/armbianEnv.txt ]]; then
|
||||
echo "disp_mem_reserves=on" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt
|
||||
else
|
||||
sed "s/sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 //g" -i $CACHEDIR/$sdcard/boot/boot.cmd
|
||||
sed "s/sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 //g" -i $CACHEDIR/$SDCARD/boot/boot.cmd
|
||||
fi
|
||||
fi
|
||||
|
||||
umount $CACHEDIR/$sdcard/tmp/bin && rm -rf $CACHEDIR/$sdcard/tmp/bin
|
||||
umount $CACHEDIR/$SDCARD/tmp/bin && rm -rf $CACHEDIR/$SDCARD/tmp/bin
|
||||
}
|
||||
|
||||
188
distributions.sh
188
distributions.sh
@ -17,94 +17,94 @@ install_common()
|
||||
display_alert "Applying common tweaks" "" "info"
|
||||
|
||||
# add dummy fstab entry to make mkinitramfs happy
|
||||
echo "/dev/mmcblk0p1 / $ROOTFS_TYPE defaults 0 1" >> $CACHEDIR/$sdcard/etc/fstab
|
||||
echo "/dev/mmcblk0p1 / $ROOTFS_TYPE defaults 0 1" >> $CACHEDIR/$SDCARD/etc/fstab
|
||||
|
||||
# create modules file
|
||||
if [[ $BRANCH == dev && -n $MODULES_DEV ]]; then
|
||||
tr ' ' '\n' <<< "$MODULES_DEV" > $CACHEDIR/$sdcard/etc/modules
|
||||
tr ' ' '\n' <<< "$MODULES_DEV" > $CACHEDIR/$SDCARD/etc/modules
|
||||
elif [[ $BRANCH == next || $BRANCH == dev ]]; then
|
||||
tr ' ' '\n' <<< "$MODULES_NEXT" > $CACHEDIR/$sdcard/etc/modules
|
||||
tr ' ' '\n' <<< "$MODULES_NEXT" > $CACHEDIR/$SDCARD/etc/modules
|
||||
else
|
||||
tr ' ' '\n' <<< "$MODULES" > $CACHEDIR/$sdcard/etc/modules
|
||||
tr ' ' '\n' <<< "$MODULES" > $CACHEDIR/$SDCARD/etc/modules
|
||||
fi
|
||||
|
||||
# create blacklist files
|
||||
if [[ $BRANCH == dev && -n $MODULES_BLACKLIST_DEV ]]; then
|
||||
tr ' ' '\n' <<< "$MODULES_BLACKLIST_DEV" | sed -e 's/^/blacklist /' > $CACHEDIR/$sdcard/etc/modprobe.d/${BOARD}.conf
|
||||
tr ' ' '\n' <<< "$MODULES_BLACKLIST_DEV" | sed -e 's/^/blacklist /' > $CACHEDIR/$SDCARD/etc/modprobe.d/${BOARD}.conf
|
||||
elif [[ ($BRANCH == next || $BRANCH == dev) && -n $MODULES_BLACKLIST_NEXT ]]; then
|
||||
tr ' ' '\n' <<< "$MODULES_BLACKLIST_NEXT" | sed -e 's/^/blacklist /' > $CACHEDIR/$sdcard/etc/modprobe.d/${BOARD}.conf
|
||||
tr ' ' '\n' <<< "$MODULES_BLACKLIST_NEXT" | sed -e 's/^/blacklist /' > $CACHEDIR/$SDCARD/etc/modprobe.d/${BOARD}.conf
|
||||
elif [[ $BRANCH == default && -n $MODULES_BLACKLIST ]]; then
|
||||
tr ' ' '\n' <<< "$MODULES_BLACKLIST" | sed -e 's/^/blacklist /' > $CACHEDIR/$sdcard/etc/modprobe.d/${BOARD}.conf
|
||||
tr ' ' '\n' <<< "$MODULES_BLACKLIST" | sed -e 's/^/blacklist /' > $CACHEDIR/$SDCARD/etc/modprobe.d/${BOARD}.conf
|
||||
fi
|
||||
|
||||
# remove default interfaces file if present
|
||||
# before installing board support package
|
||||
rm -f $CACHEDIR/$sdcard/etc/network/interfaces
|
||||
rm -f $CACHEDIR/$SDCARD/etc/network/interfaces
|
||||
|
||||
mkdir -p $CACHEDIR/$sdcard/selinux
|
||||
mkdir -p $CACHEDIR/$SDCARD/selinux
|
||||
|
||||
# console fix due to Debian bug
|
||||
sed -e 's/CHARMAP=".*"/CHARMAP="'$CONSOLE_CHAR'"/g' -i $CACHEDIR/$sdcard/etc/default/console-setup
|
||||
sed -e 's/CHARMAP=".*"/CHARMAP="'$CONSOLE_CHAR'"/g' -i $CACHEDIR/$SDCARD/etc/default/console-setup
|
||||
|
||||
# change time zone data
|
||||
echo $TZDATA > $CACHEDIR/$sdcard/etc/timezone
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg-reconfigure -f noninteractive tzdata >/dev/null 2>&1"
|
||||
echo $TZDATA > $CACHEDIR/$SDCARD/etc/timezone
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg-reconfigure -f noninteractive tzdata >/dev/null 2>&1"
|
||||
|
||||
# set root password
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "(echo $ROOTPWD;echo $ROOTPWD;) | passwd root >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "(echo $ROOTPWD;echo $ROOTPWD;) | passwd root >/dev/null 2>&1"
|
||||
# force change root password at first login
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "chage -d 0 root"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "chage -d 0 root"
|
||||
|
||||
# tmpfs configuration
|
||||
# Takes effect only in Wheezy and Trusty
|
||||
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
|
||||
sed -e 's/#SHM_SIZE=/SHM_SIZE=128M/g' -i $CACHEDIR/$sdcard/etc/default/tmpfs
|
||||
sed -e 's/#TMP_SIZE=/TMP_SIZE=1G/g' -i $CACHEDIR/$sdcard/etc/default/tmpfs
|
||||
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
|
||||
sed -e 's/#SHM_SIZE=/SHM_SIZE=128M/g' -i $CACHEDIR/$SDCARD/etc/default/tmpfs
|
||||
sed -e 's/#TMP_SIZE=/TMP_SIZE=1G/g' -i $CACHEDIR/$SDCARD/etc/default/tmpfs
|
||||
fi
|
||||
|
||||
# add custom bashrc loading
|
||||
cat <<-EOF >> $CACHEDIR/$sdcard/etc/bash.bashrc
|
||||
cat <<-EOF >> $CACHEDIR/$SDCARD/etc/bash.bashrc
|
||||
if [[ -f /etc/bash.bashrc.custom ]]; then
|
||||
. /etc/bash.bashrc.custom
|
||||
fi
|
||||
EOF
|
||||
|
||||
# display welcome message at first root login
|
||||
touch $CACHEDIR/$sdcard/root/.not_logged_in_yet
|
||||
touch $CACHEDIR/$SDCARD/root/.not_logged_in_yet
|
||||
|
||||
# NOTE: this needs to be executed before family_tweaks
|
||||
local bootscript_src=${BOOTSCRIPT%%:*}
|
||||
local bootscript_dst=${BOOTSCRIPT##*:}
|
||||
cp $SRC/lib/config/bootscripts/$bootscript_src $CACHEDIR/$sdcard/boot/$bootscript_dst
|
||||
cp $SRC/lib/config/bootscripts/$bootscript_src $CACHEDIR/$SDCARD/boot/$bootscript_dst
|
||||
|
||||
[[ -n $BOOTENV_FILE && -f $SRC/lib/config/bootenv/$BOOTENV_FILE ]] && \
|
||||
cp $SRC/lib/config/bootenv/$BOOTENV_FILE $CACHEDIR/$sdcard/boot/armbianEnv.txt
|
||||
cp $SRC/lib/config/bootenv/$BOOTENV_FILE $CACHEDIR/$SDCARD/boot/armbianEnv.txt
|
||||
|
||||
# TODO: modify $bootscript_dst or armbianEnv.txt to make NFS boot universal
|
||||
# instead of copying sunxi-specific template
|
||||
if [[ $ROOTFS_TYPE == nfs ]]; then
|
||||
display_alert "Copying NFS boot script template"
|
||||
if [[ -f $SRC/userpatches/nfs-boot.cmd ]]; then
|
||||
cp $SRC/userpatches/nfs-boot.cmd $CACHEDIR/$sdcard/boot/boot.cmd
|
||||
cp $SRC/userpatches/nfs-boot.cmd $CACHEDIR/$SDCARD/boot/boot.cmd
|
||||
else
|
||||
cp $SRC/lib/scripts/nfs-boot.cmd.template $CACHEDIR/$sdcard/boot/boot.cmd
|
||||
cp $SRC/lib/scripts/nfs-boot.cmd.template $CACHEDIR/$SDCARD/boot/boot.cmd
|
||||
fi
|
||||
fi
|
||||
|
||||
# initial date for fake-hwclock
|
||||
date -u '+%Y-%m-%d %H:%M:%S' > $CACHEDIR/$sdcard/etc/fake-hwclock.data
|
||||
date -u '+%Y-%m-%d %H:%M:%S' > $CACHEDIR/$SDCARD/etc/fake-hwclock.data
|
||||
|
||||
echo $HOST > $CACHEDIR/$sdcard/etc/hostname
|
||||
echo $HOST > $CACHEDIR/$SDCARD/etc/hostname
|
||||
|
||||
# this is needed for ubuntu
|
||||
rm $CACHEDIR/$sdcard/etc/resolv.conf
|
||||
echo "nameserver 8.8.8.8" >> $CACHEDIR/$sdcard/etc/resolv.conf
|
||||
rm $CACHEDIR/$SDCARD/etc/resolv.conf
|
||||
echo "nameserver 8.8.8.8" >> $CACHEDIR/$SDCARD/etc/resolv.conf
|
||||
|
||||
# set hostname in hosts file
|
||||
cat <<-EOF > $CACHEDIR/$sdcard/etc/hosts
|
||||
cat <<-EOF > $CACHEDIR/$SDCARD/etc/hosts
|
||||
127.0.0.1 localhost $HOST
|
||||
::1 localhost $HOST ip6-localhost ip6-loopback
|
||||
fe00::0 ip6-localnet
|
||||
@ -114,51 +114,51 @@ install_common()
|
||||
EOF
|
||||
|
||||
display_alert "Installing kernel" "$CHOSEN_KERNEL" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/debs/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/debs/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
|
||||
display_alert "Installing u-boot" "$CHOSEN_UBOOT" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "DEVICE=/dev/null dpkg -i /tmp/debs/${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "DEVICE=/dev/null dpkg -i /tmp/debs/${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
|
||||
display_alert "Installing headers" "${CHOSEN_KERNEL/image/headers}" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/debs/${CHOSEN_KERNEL/image/headers}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/debs/${CHOSEN_KERNEL/image/headers}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
|
||||
# install firmware
|
||||
#if [[ -f $CACHEDIR/$sdcard/tmp/debs/${CHOSEN_KERNEL/image/firmware-image}_${REVISION}_${ARCH}.deb ]]; then
|
||||
#if [[ -f $CACHEDIR/$SDCARD/tmp/debs/${CHOSEN_KERNEL/image/firmware-image}_${REVISION}_${ARCH}.deb ]]; then
|
||||
# display_alert "Installing firmware" "${CHOSEN_KERNEL/image/firmware-image}" "info"
|
||||
# chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/debs/${CHOSEN_KERNEL/image/firmware-image}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
# chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/debs/${CHOSEN_KERNEL/image/firmware-image}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
#fi
|
||||
|
||||
if [[ -f $CACHEDIR/$sdcard/tmp/debs/armbian-firmware_${REVISION}_${ARCH}.deb ]]; then
|
||||
if [[ -f $CACHEDIR/$SDCARD/tmp/debs/armbian-firmware_${REVISION}_${ARCH}.deb ]]; then
|
||||
display_alert "Installing generic firmware" "armbian-firmware" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/debs/armbian-firmware_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/debs/armbian-firmware_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
fi
|
||||
|
||||
if [[ -f $CACHEDIR/$sdcard/tmp/debs/${CHOSEN_KERNEL/image/dtb}_${REVISION}_${ARCH}.deb ]]; then
|
||||
if [[ -f $CACHEDIR/$SDCARD/tmp/debs/${CHOSEN_KERNEL/image/dtb}_${REVISION}_${ARCH}.deb ]]; then
|
||||
display_alert "Installing DTB" "${CHOSEN_KERNEL/image/dtb}" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/debs/${CHOSEN_KERNEL/image/dtb}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/debs/${CHOSEN_KERNEL/image/dtb}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
fi
|
||||
|
||||
# install board support package
|
||||
display_alert "Installing board support package" "$BOARD" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
|
||||
|
||||
# copy boot splash image
|
||||
cp $SRC/lib/bin/armbian.bmp $CACHEDIR/$sdcard/boot/boot.bmp
|
||||
cp $SRC/lib/bin/armbian.bmp $CACHEDIR/$SDCARD/boot/boot.bmp
|
||||
|
||||
# execute $LINUXFAMILY-specific tweaks from $BOARD.conf
|
||||
[[ $(type -t family_tweaks) == function ]] && family_tweaks
|
||||
|
||||
# enable firstrun script
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "update-rc.d firstrun defaults >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "update-rc.d firstrun defaults >/dev/null 2>&1"
|
||||
|
||||
# remove .old on new image
|
||||
rm -rf $CACHEDIR/$sdcard/boot/dtb.old
|
||||
rm -rf $CACHEDIR/$SDCARD/boot/dtb.old
|
||||
|
||||
# enable verbose kernel messages on first boot
|
||||
touch $CACHEDIR/$sdcard/boot/.verbose
|
||||
touch $CACHEDIR/$SDCARD/boot/.verbose
|
||||
|
||||
# copy "first run automated config, optional user configured"
|
||||
cp $SRC/lib/config/armbian_first_run.txt $CACHEDIR/$sdcard/boot/armbian_first_run.txt
|
||||
cp $SRC/lib/config/armbian_first_run.txt $CACHEDIR/$SDCARD/boot/armbian_first_run.txt
|
||||
}
|
||||
|
||||
install_distribution_specific()
|
||||
@ -169,53 +169,53 @@ install_distribution_specific()
|
||||
|
||||
wheezy)
|
||||
# add serial console
|
||||
echo T0:2345:respawn:/sbin/getty -L $SERIALCON 115200 vt100 >> $CACHEDIR/$sdcard/etc/inittab
|
||||
echo T0:2345:respawn:/sbin/getty -L $SERIALCON 115200 vt100 >> $CACHEDIR/$SDCARD/etc/inittab
|
||||
|
||||
# don't clear screen on boot console
|
||||
sed -e 's/getty 38400 tty1/getty --noclear 38400 tty1/g' -i $CACHEDIR/$sdcard/etc/inittab
|
||||
sed -e 's/getty 38400 tty1/getty --noclear 38400 tty1/g' -i $CACHEDIR/$SDCARD/etc/inittab
|
||||
|
||||
# disable some getties
|
||||
sed -e 's/5:23:respawn/#5:23:respawn/g' -i $CACHEDIR/$sdcard/etc/inittab
|
||||
sed -e 's/6:23:respawn/#6:23:respawn/g' -i $CACHEDIR/$sdcard/etc/inittab
|
||||
sed -e 's/5:23:respawn/#5:23:respawn/g' -i $CACHEDIR/$SDCARD/etc/inittab
|
||||
sed -e 's/6:23:respawn/#6:23:respawn/g' -i $CACHEDIR/$SDCARD/etc/inittab
|
||||
|
||||
# install ramlog
|
||||
cp $SRC/lib/bin/ramlog_2.0.0_all.deb $CACHEDIR/$sdcard/tmp
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/ramlog_2.0.0_all.deb >/dev/null 2>&1"
|
||||
cp $SRC/lib/bin/ramlog_2.0.0_all.deb $CACHEDIR/$SDCARD/tmp
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/ramlog_2.0.0_all.deb >/dev/null 2>&1"
|
||||
# enabled back at first run. To remove errors
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "service ramlog disable >/dev/null 2>&1"
|
||||
rm $CACHEDIR/$sdcard/tmp/ramlog_2.0.0_all.deb
|
||||
sed -e 's/TMPFS_RAMFS_SIZE=/TMPFS_RAMFS_SIZE=512m/g' -i $CACHEDIR/$sdcard/etc/default/ramlog
|
||||
sed -e 's/$remote_fs $time/$remote_fs $time ramlog/g' -i $CACHEDIR/$sdcard/etc/init.d/rsyslog
|
||||
sed -e 's/umountnfs $time/umountnfs $time ramlog/g' -i $CACHEDIR/$sdcard/etc/init.d/rsyslog
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "service ramlog disable >/dev/null 2>&1"
|
||||
rm $CACHEDIR/$SDCARD/tmp/ramlog_2.0.0_all.deb
|
||||
sed -e 's/TMPFS_RAMFS_SIZE=/TMPFS_RAMFS_SIZE=512m/g' -i $CACHEDIR/$SDCARD/etc/default/ramlog
|
||||
sed -e 's/$remote_fs $time/$remote_fs $time ramlog/g' -i $CACHEDIR/$SDCARD/etc/init.d/rsyslog
|
||||
sed -e 's/umountnfs $time/umountnfs $time ramlog/g' -i $CACHEDIR/$SDCARD/etc/init.d/rsyslog
|
||||
;;
|
||||
|
||||
jessie)
|
||||
# enable root login for latest ssh on jessie
|
||||
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' $CACHEDIR/$sdcard/etc/ssh/sshd_config
|
||||
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' $CACHEDIR/$SDCARD/etc/ssh/sshd_config
|
||||
|
||||
# add serial console
|
||||
#cp $SRC/lib/config/ttyS0.conf $CACHEDIR/$sdcard/etc/init/$SERIALCON.conf
|
||||
#sed -e "s/ttyS0/$SERIALCON/g" -i $CACHEDIR/$sdcard/etc/init/$SERIALCON.conf
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "systemctl --no-reload enable serial-getty@$SERIALCON.service >/dev/null 2>&1"
|
||||
mkdir -p "$CACHEDIR/$sdcard/etc/systemd/system/serial-getty@$SERIALCON.service.d"
|
||||
printf "[Service]\nExecStart=\nExecStart=-/sbin/agetty -L 115200 %%I $TERM" > "$CACHEDIR/$sdcard/etc/systemd/system/serial-getty@$SERIALCON.service.d/10-rate.conf"
|
||||
#cp $SRC/lib/config/ttyS0.conf $CACHEDIR/$SDCARD/etc/init/$SERIALCON.conf
|
||||
#sed -e "s/ttyS0/$SERIALCON/g" -i $CACHEDIR/$SDCARD/etc/init/$SERIALCON.conf
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@$SERIALCON.service >/dev/null 2>&1"
|
||||
mkdir -p "$CACHEDIR/$SDCARD/etc/systemd/system/serial-getty@$SERIALCON.service.d"
|
||||
printf "[Service]\nExecStart=\nExecStart=-/sbin/agetty -L 115200 %%I $TERM" > "$CACHEDIR/$SDCARD/etc/systemd/system/serial-getty@$SERIALCON.service.d/10-rate.conf"
|
||||
|
||||
# don't clear screen tty1
|
||||
mkdir -p "$CACHEDIR/$sdcard/etc/systemd/system/getty@tty1.service.d/"
|
||||
printf "[Service]\nTTYVTDisallocate=no" > "$CACHEDIR/$sdcard/etc/systemd/system/getty@tty1.service.d/10-noclear.conf"
|
||||
mkdir -p "$CACHEDIR/$SDCARD/etc/systemd/system/getty@tty1.service.d/"
|
||||
printf "[Service]\nTTYVTDisallocate=no" > "$CACHEDIR/$SDCARD/etc/systemd/system/getty@tty1.service.d/10-noclear.conf"
|
||||
|
||||
# seting timeout
|
||||
mkdir -p $CACHEDIR/$sdcard/etc/systemd/system/systemd-modules-load.service.d/
|
||||
printf "[Service]\nTimeoutStopSec=10" > $CACHEDIR/$sdcard/etc/systemd/system/systemd-modules-load.service.d/10-timeout.conf
|
||||
mkdir -p $CACHEDIR/$SDCARD/etc/systemd/system/systemd-modules-load.service.d/
|
||||
printf "[Service]\nTimeoutStopSec=10" > $CACHEDIR/$SDCARD/etc/systemd/system/systemd-modules-load.service.d/10-timeout.conf
|
||||
|
||||
# handle PMU power button
|
||||
mkdir -p $CACHEDIR/$sdcard/etc/udev/rules.d/
|
||||
cp $SRC/lib/config/71-axp-power-button.rules $CACHEDIR/$sdcard/etc/udev/rules.d/
|
||||
mkdir -p $CACHEDIR/$SDCARD/etc/udev/rules.d/
|
||||
cp $SRC/lib/config/71-axp-power-button.rules $CACHEDIR/$SDCARD/etc/udev/rules.d/
|
||||
;;
|
||||
|
||||
trusty)
|
||||
# add serial console
|
||||
cat <<-EOF > $CACHEDIR/$sdcard/etc/init/$SERIALCON.conf
|
||||
cat <<-EOF > $CACHEDIR/$SDCARD/etc/init/$SERIALCON.conf
|
||||
start on stopped rc RUNLEVEL=[2345]
|
||||
stop on runlevel [!2345]
|
||||
|
||||
@ -224,66 +224,66 @@ install_distribution_specific()
|
||||
EOF
|
||||
|
||||
# don't clear screen tty1
|
||||
sed -e s,"exec /sbin/getty","exec /sbin/getty --noclear",g -i $CACHEDIR/$sdcard/etc/init/tty1.conf
|
||||
sed -e s,"exec /sbin/getty","exec /sbin/getty --noclear",g -i $CACHEDIR/$SDCARD/etc/init/tty1.conf
|
||||
|
||||
# disable some getties
|
||||
rm -f $CACHEDIR/$sdcard/etc/init/tty5.conf
|
||||
rm -f $CACHEDIR/$sdcard/etc/init/tty6.conf
|
||||
rm -f $CACHEDIR/$SDCARD/etc/init/tty5.conf
|
||||
rm -f $CACHEDIR/$SDCARD/etc/init/tty6.conf
|
||||
|
||||
# enable root login for latest ssh on trusty
|
||||
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' $CACHEDIR/$sdcard/etc/ssh/sshd_config
|
||||
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' $CACHEDIR/$SDCARD/etc/ssh/sshd_config
|
||||
|
||||
# remove legal info from Ubuntu
|
||||
[[ -f $CACHEDIR/$sdcard/etc/legal ]] && rm $CACHEDIR/$sdcard/etc/legal
|
||||
[[ -f $CACHEDIR/$SDCARD/etc/legal ]] && rm $CACHEDIR/$SDCARD/etc/legal
|
||||
|
||||
# that my custom motd works well
|
||||
if [[ -d $CACHEDIR/$sdcard/etc/update-motd.d ]]; then
|
||||
mv $CACHEDIR/$sdcard/etc/update-motd.d $CACHEDIR/$sdcard/etc/update-motd.d-backup
|
||||
if [[ -d $CACHEDIR/$SDCARD/etc/update-motd.d ]]; then
|
||||
mv $CACHEDIR/$SDCARD/etc/update-motd.d $CACHEDIR/$SDCARD/etc/update-motd.d-backup
|
||||
fi
|
||||
|
||||
# remove what's anyway not working
|
||||
#chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get remove --auto-remove ureadahead"
|
||||
rm $CACHEDIR/$sdcard/etc/init/ureadahead*
|
||||
rm $CACHEDIR/$sdcard/etc/init/plymouth*
|
||||
#chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get remove --auto-remove ureadahead"
|
||||
rm $CACHEDIR/$SDCARD/etc/init/ureadahead*
|
||||
rm $CACHEDIR/$SDCARD/etc/init/plymouth*
|
||||
;;
|
||||
|
||||
xenial)
|
||||
# enable root login for latest ssh on jessie
|
||||
sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' $CACHEDIR/$sdcard/etc/ssh/sshd_config
|
||||
sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' $CACHEDIR/$SDCARD/etc/ssh/sshd_config
|
||||
|
||||
# remove legal info from Ubuntu
|
||||
[[ -f $CACHEDIR/$sdcard/etc/legal ]] && rm $CACHEDIR/$sdcard/etc/legal
|
||||
[[ -f $CACHEDIR/$SDCARD/etc/legal ]] && rm $CACHEDIR/$SDCARD/etc/legal
|
||||
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "systemctl --no-reload enable serial-getty@$SERIALCON.service >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@$SERIALCON.service >/dev/null 2>&1"
|
||||
|
||||
# Fix for PuTTY/KiTTY & ncurses-based dialogs (i.e. alsamixer) over serial
|
||||
# may break other terminals like screen
|
||||
#printf "[Service]\nEnvironment=TERM=xterm-256color" > /etc/systemd/system/serial-getty@.service.d/10-term.conf
|
||||
|
||||
# don't clear screen tty1
|
||||
mkdir -p "$CACHEDIR/$sdcard/etc/systemd/system/getty@tty1.service.d/"
|
||||
printf "[Service]\nTTYVTDisallocate=no" > "$CACHEDIR/$sdcard/etc/systemd/system/getty@tty1.service.d/10-noclear.conf"
|
||||
mkdir -p "$CACHEDIR/$SDCARD/etc/systemd/system/getty@tty1.service.d/"
|
||||
printf "[Service]\nTTYVTDisallocate=no" > "$CACHEDIR/$SDCARD/etc/systemd/system/getty@tty1.service.d/10-noclear.conf"
|
||||
|
||||
# seting timeout
|
||||
mkdir -p $CACHEDIR/$sdcard/etc/systemd/system/systemd-modules-load.service.d/
|
||||
printf "[Service]\nTimeoutStopSec=10" > $CACHEDIR/$sdcard/etc/systemd/system/systemd-modules-load.service.d/10-timeout.conf
|
||||
mkdir -p $CACHEDIR/$SDCARD/etc/systemd/system/systemd-modules-load.service.d/
|
||||
printf "[Service]\nTimeoutStopSec=10" > $CACHEDIR/$SDCARD/etc/systemd/system/systemd-modules-load.service.d/10-timeout.conf
|
||||
|
||||
# Fix for haveged service
|
||||
mkdir -p -m755 $CACHEDIR/$sdcard/etc/systemd/system/haveged.service.d
|
||||
cat <<-EOF > $CACHEDIR/$sdcard/etc/systemd/system/haveged.service.d/10-no-new-privileges.conf
|
||||
mkdir -p -m755 $CACHEDIR/$SDCARD/etc/systemd/system/haveged.service.d
|
||||
cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/haveged.service.d/10-no-new-privileges.conf
|
||||
[Service]
|
||||
NoNewPrivileges=false
|
||||
EOF
|
||||
|
||||
# handle PMU power button
|
||||
mkdir -p $CACHEDIR/$sdcard/etc/udev/rules.d/
|
||||
cp $SRC/lib/config/71-axp-power-button.rules $CACHEDIR/$sdcard/etc/udev/rules.d/
|
||||
mkdir -p $CACHEDIR/$SDCARD/etc/udev/rules.d/
|
||||
cp $SRC/lib/config/71-axp-power-button.rules $CACHEDIR/$SDCARD/etc/udev/rules.d/
|
||||
|
||||
# disable not working on unneeded services
|
||||
# ureadahead needs kernel tracing options that AFAIK are present only in mainline
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "systemctl --no-reload mask ureadahead.service >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "systemctl --no-reload mask setserial.service etc-setserial.service >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "systemctl --no-reload mask ondemand.service >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload mask ureadahead.service >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload mask setserial.service etc-setserial.service >/dev/null 2>&1"
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload mask ondemand.service >/dev/null 2>&1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@ -57,4 +57,4 @@ REPLACE=""
|
||||
|
||||
# install basic firmware by default
|
||||
display_alert "Installing linux firmware" "$REVISION" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/debs/armbian-firmware_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/debs/armbian-firmware_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log
|
||||
|
||||
@ -65,14 +65,14 @@ install_mt7601()
|
||||
cd src
|
||||
make -s ARCH=$ARCHITECTURE CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" clean >> $DEST/debug/compilation.log 2>&1
|
||||
make -s -j4 ARCH=$ARCHITECTURE CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" LINUX_SRC=$SOURCES/$LINUXSOURCEDIR/ >> $DEST/debug/compilation.log 2>&1
|
||||
cp os/linux/*.ko $CACHEDIR/$sdcard/lib/modules/$VER-$LINUXFAMILY/kernel/net/wireless/
|
||||
mkdir -p $CACHEDIR/$sdcard/etc/Wireless/RT2870STA
|
||||
cp RT2870STA.dat $CACHEDIR/$sdcard/etc/Wireless/RT2870STA/
|
||||
depmod -b $CACHEDIR/$sdcard/ $VER-$LINUXFAMILY
|
||||
cp os/linux/*.ko $CACHEDIR/$SDCARD/lib/modules/$VER-$LINUXFAMILY/kernel/net/wireless/
|
||||
mkdir -p $CACHEDIR/$SDCARD/etc/Wireless/RT2870STA
|
||||
cp RT2870STA.dat $CACHEDIR/$SDCARD/etc/Wireless/RT2870STA/
|
||||
depmod -b $CACHEDIR/$SDCARD/ $VER-$LINUXFAMILY
|
||||
make -s clean >/dev/null
|
||||
cd ..
|
||||
mkdir -p $CACHEDIR/$sdcard/usr/src/
|
||||
cp -R src $CACHEDIR/$sdcard/usr/src/mt7601-3.0.0.4
|
||||
mkdir -p $CACHEDIR/$SDCARD/usr/src/
|
||||
cp -R src $CACHEDIR/$SDCARD/usr/src/mt7601-3.0.0.4
|
||||
# TODO: Set the module to build automatically via dkms in the future here
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,9 @@ install_rtl8192cu()
|
||||
# GCC5 compatibility patch end
|
||||
|
||||
make ARCH=$ARCHITECTURE CROSS_COMPILE=$KERNEL_COMPILER KSRC=$SOURCES/$LINUXSOURCEDIR/ >> $DEST/debug/compilation.log
|
||||
cp *.ko $CACHEDIR/$sdcard/lib/modules/$VER-$LINUXFAMILY/kernel/net/wireless/
|
||||
depmod -b $CACHEDIR/$sdcard/ $VER-$LINUXFAMILY
|
||||
#cp blacklist*.conf $CACHEDIR/$sdcard/etc/modprobe.d/
|
||||
cp *.ko $CACHEDIR/$SDCARD/lib/modules/$VER-$LINUXFAMILY/kernel/net/wireless/
|
||||
depmod -b $CACHEDIR/$SDCARD/ $VER-$LINUXFAMILY
|
||||
#cp blacklist*.conf $CACHEDIR/$SDCARD/etc/modprobe.d/
|
||||
}
|
||||
|
||||
if [[ $BRANCH == default && $ARCHITECTURE == arm ]]; then
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
compile_tools()
|
||||
{
|
||||
local tmpdir=$CACHEDIR/$sdcard/root/tools
|
||||
local tmpdir=$CACHEDIR/$SDCARD/root/tools
|
||||
|
||||
display_alert "Building deb" "armbian-tools" "info"
|
||||
|
||||
@ -66,8 +66,8 @@ compile_tools()
|
||||
compiling()
|
||||
{
|
||||
display_alert "... compiling" "temper" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "cd /root/tools/temper/src; make clean" >> $DEST/debug/tools-build.log 2>&1
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "cd /root/tools/temper/src; make $CTHREADS" >> $DEST/debug/tools-build.log 2>&1
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "cd /root/tools/temper/src; make clean" >> $DEST/debug/tools-build.log 2>&1
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "cd /root/tools/temper/src; make $CTHREADS" >> $DEST/debug/tools-build.log 2>&1
|
||||
if [[ $? -ne 0 || ! -f $tmpdir/temper/src/pcsensor ]]; then
|
||||
cd $CACHEDIR
|
||||
rm -rf $tmpdir
|
||||
@ -75,7 +75,7 @@ compile_tools()
|
||||
return
|
||||
fi
|
||||
display_alert "... compiling" "bluetooth utils" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "cd /root/tools/brcm; make $CTHREADS" >> $DEST/debug/tools-build.log 2>&1
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "cd /root/tools/brcm; make $CTHREADS" >> $DEST/debug/tools-build.log 2>&1
|
||||
if [[ $? -ne 0 || ! -f $tmpdir/brcm/brcm_bt_reset ]]; then
|
||||
cd $CACHEDIR
|
||||
rm -rf $tmpdir
|
||||
@ -93,4 +93,4 @@ if [[ ! -f $DEST/debs/armbian-tools-${RELEASE}_${REVISION}_${ARCH}.deb ]]; then
|
||||
fi
|
||||
|
||||
display_alert "Installing" "armbian-tools-${RELEASE}_${REVISION}_${ARCH}.deb" "info"
|
||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg -i /tmp/debs/armbian-tools-${RELEASE}_${REVISION}_${ARCH}.deb" >> $DEST/debug/tools-build.log
|
||||
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/debs/armbian-tools-${RELEASE}_${REVISION}_${ARCH}.deb" >> $DEST/debug/tools-build.log
|
||||
|
||||
@ -39,11 +39,11 @@ install_usb_redirector()
|
||||
sed -e 's/%DAEMONNAME_TAG%/usbsrvd/g' $SOURCES/usb-redirector-linux-arm-eabi/files/rc.usbsrvd1 > $SOURCES/usb-redirector-linux-arm-eabi/files/rc.usbsrvd
|
||||
chmod +x $SOURCES/usb-redirector-linux-arm-eabi/files/rc.usbsrvd
|
||||
# copy to root
|
||||
cp $SOURCES/usb-redirector-linux-arm-eabi/files/usb* $CACHEDIR/$sdcard/usr/local/bin/
|
||||
cp $SOURCES/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/tusbd.ko $CACHEDIR/$sdcard/usr/local/bin/
|
||||
cp $SOURCES/usb-redirector-linux-arm-eabi/files/rc.usbsrvd $CACHEDIR/$sdcard/etc/init.d/
|
||||
cp $SOURCES/usb-redirector-linux-arm-eabi/files/usb* $CACHEDIR/$SDCARD/usr/local/bin/
|
||||
cp $SOURCES/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/tusbd.ko $CACHEDIR/$SDCARD/usr/local/bin/
|
||||
cp $SOURCES/usb-redirector-linux-arm-eabi/files/rc.usbsrvd $CACHEDIR/$SDCARD/etc/init.d/
|
||||
# not started by default ----- update.rc rc.usbsrvd defaults
|
||||
# chroot $CACHEDIR/$sdcard /bin/bash -c "update-rc.d rc.usbsrvd defaults
|
||||
# chroot $CACHEDIR/$SDCARD /bin/bash -c "update-rc.d rc.usbsrvd defaults
|
||||
}
|
||||
|
||||
display_alert "Installing additional application" "USB redirector" "info"
|
||||
|
||||
3
main.sh
3
main.sh
@ -214,7 +214,7 @@ overlayfs_wrapper "cleanup"
|
||||
VER=$(dpkg --info $DEST/debs/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb | grep Descr | awk '{print $(NF)}')
|
||||
VER="${VER/-$LINUXFAMILY/}"
|
||||
|
||||
[[ -n $RELEASE ]] && create_board_package
|
||||
[[ -n $RELEASE && ! -f $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb && ! -d $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH} ]] && create_board_package
|
||||
|
||||
# chroot-buildpackages
|
||||
[[ $EXTERNAL_NEW == compile ]] && chroot_build_packages
|
||||
@ -230,3 +230,4 @@ fi
|
||||
end=`date +%s`
|
||||
runtime=$(((end-start)/60))
|
||||
display_alert "Runtime" "$runtime min" "info"
|
||||
rm -f "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"
|
||||
1230
patch/kernel/marvell-dev/patch-4.4.32-33.patch
Normal file
1230
patch/kernel/marvell-dev/patch-4.4.32-33.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,39 +0,0 @@
|
||||
From 832757c73ba9b69d0ee2d2753cca228f0d831386 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Bergstrand <martin@bergstrand.us>
|
||||
Date: Mon, 24 Oct 2016 17:00:54 -0500
|
||||
Subject: [PATCH] Use Correct I2C Touchscreen Driver
|
||||
|
||||
---
|
||||
drivers/input/touchscreen/gt9xxf/gt9xxf.c | 5 +++++
|
||||
drivers/input/touchscreen/gt9xxf/gt9xxf.h | 2 +-
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/input/touchscreen/gt9xxf/gt9xxf.c b/drivers/input/touchscreen/gt9xxf/gt9xxf.c
|
||||
index 83f2358..95b13f4 100755
|
||||
--- a/drivers/input/touchscreen/gt9xxf/gt9xxf.c
|
||||
+++ b/drivers/input/touchscreen/gt9xxf/gt9xxf.c
|
||||
@@ -1454,6 +1454,11 @@ static s32 gtp_init_panel(struct goodix_ts_data *ts)
|
||||
GTP_INFO("gt9xx:index = %d\n",index);
|
||||
|
||||
}
|
||||
+ if (!strcmp(config_info.name,"gt911_DB2")){
|
||||
+ index = 4;
|
||||
+ GTP_INFO("gt9xx:index = %d\n",index);
|
||||
+
|
||||
+ }
|
||||
}
|
||||
#endif
|
||||
|
||||
diff --git a/drivers/input/touchscreen/gt9xxf/gt9xxf.h b/drivers/input/touchscreen/gt9xxf/gt9xxf.h
|
||||
index 3db7c68..dd2a729 100755
|
||||
--- a/drivers/input/touchscreen/gt9xxf/gt9xxf.h
|
||||
+++ b/drivers/input/touchscreen/gt9xxf/gt9xxf.h
|
||||
@@ -156,7 +156,7 @@ extern void gtp_io_init(int ms);
|
||||
|
||||
// TODO: define your config for Sensor_ID == 4 here, if needed
|
||||
#define CTP_CFG_GROUP5 {\
|
||||
- }
|
||||
+ 0x42,0x00,0x04,0x58,0x02,0x0A,0x0D,0x00,0x01,0x08,0x28,0x08,0x5A,0x46,0x03,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0x28,0x0A,0x41,0x43,0xB5,0x06,0x00,0x00,0x00,0x42,0x02,0x11,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x5A,0x94,0xC5,0x02,0x08,0x00,0x00,0x04,0x98,0x35,0x00,0x8A,0x3B,0x00,0x7C,0x43,0x00,0x72,0x4B,0x00,0x67,0x55,0x00,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x12,0x10,0x0E,0x0C,0x0A,0x08,0x06,0x04,0x02,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x24,0x22,0x21,0x20,0x1F,0x1E,0x1D,0x0C,0x0A,0x08,0x06,0x04,0x02,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x01}
|
||||
|
||||
// TODO: define your config for Sensor_ID == 5 here, if needed
|
||||
#define CTP_CFG_GROUP6 {\
|
||||
@ -1,60 +0,0 @@
|
||||
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
|
||||
index bf428a1..bcfbbb5 100755
|
||||
--- a/arch/arm64/Kconfig
|
||||
+++ b/arch/arm64/Kconfig
|
||||
@@ -477,6 +477,31 @@ config SECCOMP
|
||||
and the task is only allowed to execute a few safe syscalls
|
||||
defined by each seccomp mode.
|
||||
|
||||
+config ARM64_MODULE_CMODEL_LARGE
|
||||
+ bool
|
||||
+
|
||||
+config ARM64_ERRATUM_843419
|
||||
+ bool "Cortex-A53: 843419: A load or store might access an incorrect address"
|
||||
+ depends on MODULES
|
||||
+ default y
|
||||
+ select ARM64_MODULE_CMODEL_LARGE
|
||||
+ select ARM64_MODULE_CMODEL_LARGE if MODULES
|
||||
+ help
|
||||
+ This option builds kernel modules using the large memory model in
|
||||
+ order to avoid the use of the ADRP instruction, which can cause
|
||||
+ a subsequent memory access to use an incorrect address on Cortex-A53
|
||||
+ parts up to r0p4.
|
||||
+
|
||||
+ Note that the kernel itself must be linked with a version of ld
|
||||
+ which fixes potentially affected ADRP instructions through the
|
||||
+ use of veneers.
|
||||
+ This option links the kernel with '--fix-cortex-a53-843419' and
|
||||
+ builds modules using the large memory model in order to avoid the use
|
||||
+ of the ADRP instruction, which can cause a subsequent memory access
|
||||
+ to use an incorrect address on Cortex-A53 parts up to r0p4.
|
||||
+
|
||||
+ If unsure, say Y.
|
||||
+
|
||||
endmenu
|
||||
|
||||
menu "Boot options"
|
||||
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
|
||||
index e2782e1..4196f47 100755
|
||||
--- a/arch/arm64/Makefile
|
||||
+++ b/arch/arm64/Makefile
|
||||
@@ -34,6 +34,19 @@ AS += -EL
|
||||
LD += -EL
|
||||
endif
|
||||
|
||||
+ifeq ($(CONFIG_ARM64_MODULE_CMODEL_LARGE), y)
|
||||
+KBUILD_CFLAGS_MODULE += -mcmodel=large
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
|
||||
+ld-843419-workaround := $(call ld-option, --fix-cortex-a53-843419)
|
||||
+ifeq ($(ld-843419-workaround),)
|
||||
+$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
|
||||
+else
|
||||
+LDFLAGS_vmlinux += --fix-cortex-a53-843419
|
||||
+endif
|
||||
+endif
|
||||
+
|
||||
comma = ,
|
||||
|
||||
CHECKFLAGS += -D__aarch64__
|
||||
@ -129,11 +129,11 @@ Main() {
|
||||
;;
|
||||
9|1080p50|1920x1080p50) # res
|
||||
HDMIMode=9
|
||||
pll_video=594
|
||||
pll_video=297
|
||||
;;
|
||||
10|1080p60|1080p|1920x1080p60) # res
|
||||
HDMIMode=10
|
||||
pll_video=594
|
||||
pll_video=297
|
||||
;;
|
||||
11|1080p25|1080p|1920x1080p25) # res
|
||||
HDMIMode=11
|
||||
@ -156,8 +156,8 @@ Main() {
|
||||
pll_video=594
|
||||
;;
|
||||
23|1080p24_3d|1920x1080p24_3d) # res
|
||||
HDMIMode=23
|
||||
pll_video=594
|
||||
HDMIMode=23
|
||||
pll_video=594
|
||||
;;
|
||||
24|720p50_3d|1280x720p50_3d) # res
|
||||
HDMIMode=24
|
||||
@ -404,4 +404,4 @@ InstallSunxiTools() {
|
||||
make install
|
||||
} # InstallSunxiTools
|
||||
|
||||
Main "$@"
|
||||
Main "$@"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user