mirror of
https://github.com/Fishwaldo/build.git
synced 2025-03-20 22:01:31 +00:00
use uppercase names for global variables MOUNT and SDCARD
This commit is contained in:
parent
e92828ef2d
commit
cd06793def
24 changed files with 317 additions and 317 deletions
|
@ -121,14 +121,14 @@ for line in "${buildlist[@]}"; do
|
||||||
CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \
|
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 \
|
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 \
|
UBOOT_TARGET MODULES MODULES_NEXT MODULES_DEV INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY MODULES_BLACKLIST MODULES_BLACKLIST_NEXT \
|
||||||
MODULES_BLACKLIST_DEV sdcard mount buildtext
|
MODULES_BLACKLIST_DEV MOUNT SDCARD buildtext
|
||||||
|
|
||||||
read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
|
read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
|
||||||
n=$[$n+1]
|
n=$[$n+1]
|
||||||
|
|
||||||
if [[ $from -le $n ]]; then
|
if [[ $from -le $n ]]; then
|
||||||
|
|
||||||
touch "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"
|
touch "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"
|
||||||
jobs=$(ls /run/armbian | wc -l)
|
jobs=$(ls /run/armbian | wc -l)
|
||||||
if [[ $jobs -lt $free_cpu ]]; then
|
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"
|
display_alert "Building in the back $n / ${#buildlist[@]}" "Board: $BOARD Kernel:$BRANCH${RELEASE:+ Release: $RELEASE}${BUILD_DESKTOP:+ Desktop: $BUILD_DESKTOP}" "ext"
|
||||||
|
|
|
@ -261,13 +261,13 @@ chroot_installpackages_local()
|
||||||
-gpg-key="925644A6" -passphrase="testkey1234" -component=temp -distribution=$RELEASE publish repo temp
|
-gpg-key="925644A6" -passphrase="testkey1234" -component=temp -distribution=$RELEASE publish repo temp
|
||||||
aptly -config=$conf -listen=":8189" serve &
|
aptly -config=$conf -listen=":8189" serve &
|
||||||
local aptly_pid=$!
|
local aptly_pid=$!
|
||||||
cp $SRC/lib/extras-buildpkgs/buildpkg.key $CACHEDIR/$sdcard/tmp/buildpkg.key
|
cp $SRC/lib/extras-buildpkgs/buildpkg.key $CACHEDIR/$SDCARD/tmp/buildpkg.key
|
||||||
cat <<-'EOF' > $CACHEDIR/$sdcard/etc/apt/preferences.d/90-armbian-temp.pref
|
cat <<-'EOF' > $CACHEDIR/$SDCARD/etc/apt/preferences.d/90-armbian-temp.pref
|
||||||
Package: *
|
Package: *
|
||||||
Pin: origin "localhost"
|
Pin: origin "localhost"
|
||||||
Pin-Priority: 550
|
Pin-Priority: 550
|
||||||
EOF
|
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
|
deb http://localhost:8189/ $RELEASE temp
|
||||||
EOF
|
EOF
|
||||||
chroot_installpackages
|
chroot_installpackages
|
||||||
|
@ -288,7 +288,7 @@ chroot_installpackages()
|
||||||
unset package_install_target package_checkinstall
|
unset package_install_target package_checkinstall
|
||||||
done
|
done
|
||||||
[[ $NO_APT_CACHER != yes ]] && local apt_extra="-o Acquire::http::Proxy=\"http://${APT_PROXY_ADDR:-localhost:3142}\" -o Acquire::http::Proxy::localhost=\"DIRECT\""
|
[[ $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
|
#!/bin/bash
|
||||||
[[ "$remote_only" != yes ]] && apt-key add /tmp/buildpkg.key
|
[[ "$remote_only" != yes ]] && apt-key add /tmp/buildpkg.key
|
||||||
apt-get $apt_extra -q update
|
apt-get $apt_extra -q update
|
||||||
|
@ -308,6 +308,6 @@ chroot_installpackages()
|
||||||
rm /tmp/buildpkg.key 2>/dev/null
|
rm /tmp/buildpkg.key 2>/dev/null
|
||||||
rm -- "\$0"
|
rm -- "\$0"
|
||||||
EOF
|
EOF
|
||||||
chmod +x $CACHEDIR/$sdcard/tmp/install.sh
|
chmod +x $CACHEDIR/$SDCARD/tmp/install.sh
|
||||||
chroot $CACHEDIR/$sdcard /bin/bash -c "/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
|
# for users that need to prepare files at host
|
||||||
[[ -f $SRC/userpatches/customize-image-host.sh ]] && source $SRC/userpatches/customize-image-host.sh
|
[[ -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
|
cp $SRC/userpatches/customize-image.sh $CACHEDIR/$SDCARD/tmp/customize-image.sh
|
||||||
chmod +x $CACHEDIR/$sdcard/tmp/customize-image.sh
|
chmod +x $CACHEDIR/$SDCARD/tmp/customize-image.sh
|
||||||
mkdir -p $CACHEDIR/$sdcard/tmp/overlay
|
mkdir -p $CACHEDIR/$SDCARD/tmp/overlay
|
||||||
if [[ $(lsb_release -sc) == xenial ]]; then
|
if [[ $(lsb_release -sc) == xenial ]]; then
|
||||||
# util-linux >= 2.27 required
|
# 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
|
else
|
||||||
mount -o bind $SRC/userpatches/overlay $CACHEDIR/$sdcard/tmp/overlay
|
mount -o bind $SRC/userpatches/overlay $CACHEDIR/$SDCARD/tmp/overlay
|
||||||
fi
|
fi
|
||||||
display_alert "Calling image customization script" "customize-image.sh" "info"
|
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"
|
chroot $CACHEDIR/$SDCARD /bin/bash -c "/tmp/customize-image.sh $RELEASE $FAMILY $BOARD $BUILD_DESKTOP"
|
||||||
umount $CACHEDIR/$sdcard/tmp/overlay
|
umount $CACHEDIR/$SDCARD/tmp/overlay
|
||||||
mountpoint -q $CACHEDIR/$sdcard/tmp/overlay || rm -r $CACHEDIR/$sdcard/tmp/overlay
|
mountpoint -q $CACHEDIR/$SDCARD/tmp/overlay || rm -r $CACHEDIR/$SDCARD/tmp/overlay
|
||||||
}
|
}
|
||||||
|
|
||||||
userpatch_create()
|
userpatch_create()
|
||||||
|
|
|
@ -44,14 +44,14 @@ write_uboot_platform()
|
||||||
family_tweaks()
|
family_tweaks()
|
||||||
{
|
{
|
||||||
# default lirc configuration
|
# default lirc configuration
|
||||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/lirc0"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.conf
|
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
|
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
|
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
|
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
|
cp $SRC/lib/scripts/brcm4330 $CACHEDIR/$SDCARD/etc/default
|
||||||
install -m 755 $SRC/lib/scripts/brcm4330-patch $CACHEDIR/$sdcard/etc/init.d/brcm4330-patch
|
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"
|
#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
|
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/console=tty1 //g' -i $CACHEDIR/$SDCARD/boot/boot.cmd
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,5 +42,5 @@ write_uboot_platform()
|
||||||
|
|
||||||
family_tweaks()
|
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()
|
family_tweaks()
|
||||||
{
|
{
|
||||||
install -m 755 $SRC/lib/scripts/c1_init.sh $CACHEDIR/$sdcard/etc/
|
install -m 755 $SRC/lib/scripts/c1_init.sh $CACHEDIR/$SDCARD/etc/
|
||||||
sed -e 's/exit 0//g' -i $CACHEDIR/$sdcard/etc/rc.local
|
sed -e 's/exit 0//g' -i $CACHEDIR/$SDCARD/etc/rc.local
|
||||||
echo "/etc/c1_init.sh" >> $CACHEDIR/$sdcard/etc/rc.local
|
echo "/etc/c1_init.sh" >> $CACHEDIR/$SDCARD/etc/rc.local
|
||||||
echo "exit 0" >> $CACHEDIR/$sdcard/etc/rc.local
|
echo "exit 0" >> $CACHEDIR/$SDCARD/etc/rc.local
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,14 +33,14 @@ write_uboot_platform()
|
||||||
|
|
||||||
family_tweaks()
|
family_tweaks()
|
||||||
{
|
{
|
||||||
sed -i 's/MODULES=.*/MODULES="meson-ir"/' $CACHEDIR/$sdcard/etc/lirc/hardware.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/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/DEVICE=.*/DEVICE="\/dev\/lirc0"/' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||||
sed -i 's/LIRCD_ARGS=.*/LIRCD_ARGS="--uinput"/' $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
|
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/
|
install -m 755 $SRC/lib/scripts/c2_init.sh $CACHEDIR/$SDCARD/etc/
|
||||||
sed -e 's/exit 0//g' -i $CACHEDIR/$sdcard/etc/rc.local
|
sed -e 's/exit 0//g' -i $CACHEDIR/$SDCARD/etc/rc.local
|
||||||
echo "/etc/c2_init.sh" >> $CACHEDIR/$sdcard/etc/rc.local
|
echo "/etc/c2_init.sh" >> $CACHEDIR/$SDCARD/etc/rc.local
|
||||||
echo "exit 0" >> $CACHEDIR/$sdcard/etc/rc.local
|
echo "exit 0" >> $CACHEDIR/$SDCARD/etc/rc.local
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,6 @@ write_uboot_platform()
|
||||||
|
|
||||||
family_tweaks()
|
family_tweaks()
|
||||||
{
|
{
|
||||||
echo "blacklist ina231_sensor" > $CACHEDIR/$sdcard/etc/modprobe.d/blacklist-odroid.conf
|
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"
|
chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ write_uboot_platform()
|
||||||
family_tweaks()
|
family_tweaks()
|
||||||
{
|
{
|
||||||
if [[ $BRANCH == default ]]; then
|
if [[ $BRANCH == default ]]; then
|
||||||
mkdir -p $CACHEDIR/$sdcard/var/lib/alsa/
|
mkdir -p $CACHEDIR/$SDCARD/var/lib/alsa/
|
||||||
cp $SRC/lib/config/asound.state.pine64-default $CACHEDIR/$sdcard/var/lib/alsa/asound.state
|
cp $SRC/lib/config/asound.state.pine64-default $CACHEDIR/$SDCARD/var/lib/alsa/asound.state
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ write_uboot_platform()
|
||||||
|
|
||||||
family_tweaks()
|
family_tweaks()
|
||||||
{
|
{
|
||||||
printf "blacklist wlan_8723bs_vq0\nblacklist ctp_gslX680\nblacklist ctp_gsl3680\n" > $CACHEDIR/$sdcard/etc/modprobe.d/blacklist-guitar.conf
|
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
|
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
|
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
|
# TODO: replace with udev rule
|
||||||
# default lirc configuration
|
# default lirc configuration
|
||||||
sed -i '1i sed -i \x27s/DEVICE="\\/dev\\/input.*/DEVICE="\\/dev\\/input\\/\x27$str\x27"/g\x27 /etc/lirc/hardware.conf' \
|
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)' \
|
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
|
$CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||||
sed -i '1i # Cubietruck automatic lirc device detection by Igor Pecovnik' $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/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
|
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
|
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,15 +38,15 @@ family_tweaks()
|
||||||
# TODO: replace with udev rule
|
# TODO: replace with udev rule
|
||||||
# default lirc configuration
|
# default lirc configuration
|
||||||
sed -i '1i sed -i \x27s/DEVICE="\\/dev\\/input.*/DEVICE="\\/dev\\/input\\/\x27$str\x27"/g\x27 /etc/lirc/hardware.conf' \
|
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)' \
|
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
|
$CACHEDIR/$SDCARD/etc/lirc/hardware.conf
|
||||||
sed -i '1i # Cubietruck automatic lirc device detection by Igor Pecovnik' $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/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
|
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
|
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
|
||||||
if [[ $BRANCH == next ]]; then
|
if [[ $BRANCH == next ]]; then
|
||||||
mkdir -p $CACHEDIR/$sdcard/var/lib/alsa/
|
mkdir -p $CACHEDIR/$SDCARD/var/lib/alsa/
|
||||||
cp $SRC/lib/config/asound.state.sunxi-next $CACHEDIR/$sdcard/var/lib/alsa/asound.state
|
cp $SRC/lib/config/asound.state.sunxi-next $CACHEDIR/$SDCARD/var/lib/alsa/asound.state
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,30 +29,30 @@ esac
|
||||||
family_tweaks()
|
family_tweaks()
|
||||||
{
|
{
|
||||||
# this is for legacy kernel only
|
# this is for legacy kernel only
|
||||||
sed -e 's/DEVICE=""/DEVICE="\/dev\/lirc0"/g' -i $CACHEDIR/$sdcard/etc/lirc/hardware.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/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
|
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
|
cp $SRC/lib/config/lirc.conf.cubietruck $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
|
||||||
if [[ $BRANCH == default ]]; then
|
if [[ $BRANCH == default ]]; then
|
||||||
mkdir -p $CACHEDIR/$sdcard/var/lib/alsa/
|
mkdir -p $CACHEDIR/$SDCARD/var/lib/alsa/
|
||||||
cp $SRC/lib/config/asound.state.sun8i-default $CACHEDIR/$sdcard/var/lib/alsa/asound.state
|
cp $SRC/lib/config/asound.state.sun8i-default $CACHEDIR/$SDCARD/var/lib/alsa/asound.state
|
||||||
fi
|
fi
|
||||||
# enable serial gadget on OTG port since the board doesn't have Ethernet
|
# 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
|
if [[ ( $BOARD == orangepilite || $BOARD == nanopiair ) && $BRANCH == default && ( $RELEASE == jessie || $RELEASE == xenial ) ]]; then
|
||||||
mkdir -p $CACHEDIR/$sdcard/etc/systemd/system/serial-getty@ttyGS0.service.d
|
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
|
cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/serial-getty@ttyGS0.service.d/10-switch-role.conf
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=-/bin/sh -c "echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role"
|
ExecStartPre=-/bin/sh -c "echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role"
|
||||||
EOF
|
EOF
|
||||||
chroot $CACHEDIR/$sdcard /bin/bash -c "systemctl --no-reload enable serial-getty@ttyGS0.service > /dev/null"
|
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@ttyGS0.service > /dev/null"
|
||||||
echo "ttyGS0" >> $CACHEDIR/$sdcard/etc/securetty
|
echo "ttyGS0" >> $CACHEDIR/$SDCARD/etc/securetty
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# u-boot default is nonsec. Legacy requires sec, mainline requires nonsec for SMP
|
# 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
|
local boot_mode=nonsec
|
||||||
[[ $BRANCH == default ]] && boot_mode=sec
|
[[ $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/" \
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,18 +44,18 @@ write_uboot_platform()
|
||||||
|
|
||||||
family_tweaks()
|
family_tweaks()
|
||||||
{
|
{
|
||||||
chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
|
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.default
|
||||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.bonding
|
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.bonding
|
||||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.hostapd
|
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.hostapd
|
||||||
if [[ $BOARD == udoo-neo ]]; then
|
if [[ $BOARD == udoo-neo ]]; then
|
||||||
# SD card is elsewhere
|
# 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
|
# firmware for M4
|
||||||
mkdir -p $CACHEDIR/$sdcard/boot/bin/
|
mkdir -p $CACHEDIR/$SDCARD/boot/bin/
|
||||||
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$sdcard/boot/bin/
|
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/
|
||||||
# fix for BT
|
# fix for BT
|
||||||
cp $SRC/lib/bin/udoo-neo-debs/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$sdcard/tmp
|
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"
|
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,18 +44,18 @@ write_uboot_platform()
|
||||||
|
|
||||||
family_tweaks()
|
family_tweaks()
|
||||||
{
|
{
|
||||||
chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
|
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.default
|
||||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.bonding
|
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.bonding
|
||||||
sed 's/wlan0/wlan2/' -i $CACHEDIR/$sdcard/etc/network/interfaces.hostapd
|
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.hostapd
|
||||||
if [[ $BOARD == udoo-neo ]]; then
|
if [[ $BOARD == udoo-neo ]]; then
|
||||||
# SD card is elsewhere
|
# 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
|
# firmware for M4
|
||||||
mkdir -p $CACHEDIR/$sdcard/boot/bin/
|
mkdir -p $CACHEDIR/$SDCARD/boot/bin/
|
||||||
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$sdcard/boot/bin/
|
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/
|
||||||
# fix for BT
|
# fix for BT
|
||||||
cp $SRC/lib/bin/udoo-neo-debs/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$sdcard/tmp
|
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"
|
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,8 +63,8 @@ SERIALCON=ttyS0
|
||||||
BOOTSIZE=0
|
BOOTSIZE=0
|
||||||
|
|
||||||
# set unique mounting directory
|
# set unique mounting directory
|
||||||
sdcard="sdcard-${BRANCH}-${BOARD}-${RELEASE}"
|
SDCARD="sdcard-${BRANCH}-${BOARD}-${RELEASE}"
|
||||||
mount="mount-${BRANCH}-${BOARD}-${RELEASE}"
|
MOUNT="mount-${BRANCH}-${BOARD}-${RELEASE}"
|
||||||
|
|
||||||
if [[ -f $SRC/lib/config/sources/$LINUXFAMILY.conf ]]; then
|
if [[ -f $SRC/lib/config/sources/$LINUXFAMILY.conf ]]; then
|
||||||
source $SRC/lib/config/sources/$LINUXFAMILY.conf
|
source $SRC/lib/config/sources/$LINUXFAMILY.conf
|
||||||
|
|
|
@ -30,8 +30,8 @@ debootstrap_ng()
|
||||||
trap unmount_on_exit INT TERM EXIT
|
trap unmount_on_exit INT TERM EXIT
|
||||||
|
|
||||||
# stage: clean and create directories
|
# stage: clean and create directories
|
||||||
rm -rf $CACHEDIR/{$sdcard,$mount}
|
rm -rf $CACHEDIR/{$SDCARD,$MOUNT}
|
||||||
mkdir -p $CACHEDIR/{$sdcard,$mount,rootfs} $DEST/images
|
mkdir -p $CACHEDIR/{$SDCARD,$MOUNT,rootfs} $DEST/images
|
||||||
|
|
||||||
# stage: verify tmpfs configuration and mount
|
# stage: verify tmpfs configuration and mount
|
||||||
# default maximum size for tmpfs mount is 1/2 of available RAM
|
# default maximum size for tmpfs mount is 1/2 of available RAM
|
||||||
|
@ -44,7 +44,7 @@ debootstrap_ng()
|
||||||
local use_tmpfs=yes
|
local use_tmpfs=yes
|
||||||
fi
|
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
|
# stage: prepare basic rootfs: unpack cache or create from scratch
|
||||||
create_rootfs_cache
|
create_rootfs_cache
|
||||||
|
@ -52,8 +52,8 @@ debootstrap_ng()
|
||||||
# stage: install kernel and u-boot packages
|
# stage: install kernel and u-boot packages
|
||||||
# install distribution and board specific applications
|
# install distribution and board specific applications
|
||||||
|
|
||||||
mkdir -p $CACHEDIR/$sdcard/tmp/debs
|
mkdir -p $CACHEDIR/$SDCARD/tmp/debs
|
||||||
mount --bind $DEST/debs/ $CACHEDIR/$sdcard/tmp/debs
|
mount --bind $DEST/debs/ $CACHEDIR/$SDCARD/tmp/debs
|
||||||
|
|
||||||
install_distribution_specific
|
install_distribution_specific
|
||||||
install_common
|
install_common
|
||||||
|
@ -72,27 +72,27 @@ debootstrap_ng()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# cleanup for install_kernel and install_board_specific
|
# cleanup for install_kernel and install_board_specific
|
||||||
umount $CACHEDIR/$sdcard/tmp/debs
|
umount $CACHEDIR/$SDCARD/tmp/debs
|
||||||
mountpoint -q $CACHEDIR/$sdcard/tmp/debs || rm -rf $CACHEDIR/$sdcard/tmp/debs
|
mountpoint -q $CACHEDIR/$SDCARD/tmp/debs || rm -rf $CACHEDIR/$SDCARD/tmp/debs
|
||||||
|
|
||||||
# stage: user customization script
|
# stage: user customization script
|
||||||
# NOTE: installing too many packages may fill tmpfs mount
|
# NOTE: installing too many packages may fill tmpfs mount
|
||||||
customize_image
|
customize_image
|
||||||
|
|
||||||
# stage: cleanup
|
# stage: cleanup
|
||||||
rm -f $CACHEDIR/$sdcard/sbin/initctl $CACHEDIR/$sdcard/sbin/start-stop-daemon
|
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/initctl"
|
||||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg-divert --quiet --local --rename --remove /sbin/start-stop-daemon"
|
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/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)
|
# to prevent creating swap file on NFS (needs specific kernel options)
|
||||||
# and f2fs/btrfs (not recommended or 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
|
if [[ $ROOTFS_TYPE == fel ]]; then
|
||||||
FEL_ROOTFS=$CACHEDIR/$sdcard/
|
FEL_ROOTFS=$CACHEDIR/$SDCARD/
|
||||||
display_alert "Starting FEL boot" "$BOARD" "info"
|
display_alert "Starting FEL boot" "$BOARD" "info"
|
||||||
source $SRC/lib/fel-load.sh
|
source $SRC/lib/fel-load.sh
|
||||||
else
|
else
|
||||||
|
@ -101,9 +101,9 @@ debootstrap_ng()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# stage: unmount tmpfs
|
# 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
|
# remove exit trap
|
||||||
trap - INT TERM EXIT
|
trap - INT TERM EXIT
|
||||||
|
@ -121,7 +121,7 @@ create_rootfs_cache()
|
||||||
if [[ -f $cache_fname ]]; then
|
if [[ -f $cache_fname ]]; then
|
||||||
local date_diff=$(( ($(date +%s) - $(stat -c %Y $cache_fname)) / 86400 ))
|
local date_diff=$(( ($(date +%s) - $(stat -c %Y $cache_fname)) / 86400 ))
|
||||||
display_alert "Extracting $display_name" "$date_diff days old" "info"
|
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
|
else
|
||||||
display_alert "Creating new rootfs for" "$RELEASE" "info"
|
display_alert "Creating new rootfs for" "$RELEASE" "info"
|
||||||
|
|
||||||
|
@ -139,75 +139,75 @@ create_rootfs_cache()
|
||||||
|
|
||||||
display_alert "Installing base system" "Stage 1/2" "info"
|
display_alert "Installing base system" "Stage 1/2" "info"
|
||||||
eval 'debootstrap --include=locales ${PACKAGE_LIST_EXCLUDE:+ --exclude=${PACKAGE_LIST_EXCLUDE// /,}} \
|
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'} \
|
${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_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Debootstrap (stage 1/2)..." $TTY_Y $TTY_X'} \
|
||||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
${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/
|
mkdir -p $CACHEDIR/$SDCARD/usr/share/keyrings/
|
||||||
cp /usr/share/keyrings/debian-archive-keyring.gpg $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"
|
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'} \
|
${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_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Debootstrap (stage 2/2)..." $TTY_Y $TTY_X'} \
|
||||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
${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
|
# policy-rc.d script prevents starting or reloading services during image creation
|
||||||
printf '#!/bin/sh\nexit 101' > $CACHEDIR/$sdcard/usr/sbin/policy-rc.d
|
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/initctl"
|
||||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg-divert --quiet --local --rename --add /sbin/start-stop-daemon"
|
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 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
|
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/usr/sbin/policy-rc.d
|
||||||
chmod 755 $CACHEDIR/$sdcard/sbin/initctl
|
chmod 755 $CACHEDIR/$SDCARD/sbin/initctl
|
||||||
chmod 755 $CACHEDIR/$sdcard/sbin/start-stop-daemon
|
chmod 755 $CACHEDIR/$SDCARD/sbin/start-stop-daemon
|
||||||
|
|
||||||
# stage: configure language and locales
|
# stage: configure language and locales
|
||||||
display_alert "Configuring locales" "$DEST_LANG" "info"
|
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
|
[[ -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 "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"' \
|
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'}
|
${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"/' \
|
sed -e 's/CHARMAP=.*/CHARMAP="UTF-8"/' -e 's/FONTSIZE=.*/FONTSIZE="8x16"/' \
|
||||||
-e 's/CODESET=.*/CODESET="guess"/' -i $CACHEDIR/$sdcard/etc/default/console-setup
|
-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"'
|
eval 'LC_ALL=C LANG=C chroot $CACHEDIR/$SDCARD /bin/bash -c "setupcon --save"'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# stage: create apt sources list
|
# stage: create apt sources list
|
||||||
create_sources_list "$RELEASE" "$CACHEDIR/$sdcard/"
|
create_sources_list "$RELEASE" "$CACHEDIR/$SDCARD/"
|
||||||
|
|
||||||
# stage: add armbian repository and install key
|
# stage: add armbian repository and install key
|
||||||
case $RELEASE in
|
case $RELEASE in
|
||||||
wheezy|trusty)
|
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)
|
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
|
esac
|
||||||
cp $SRC/lib/bin/armbian.key $CACHEDIR/$sdcard
|
cp $SRC/lib/bin/armbian.key $CACHEDIR/$SDCARD
|
||||||
eval 'chroot $CACHEDIR/$sdcard /bin/bash -c "cat armbian.key | apt-key add -"' \
|
eval 'chroot $CACHEDIR/$SDCARD /bin/bash -c "cat armbian.key | apt-key add -"' \
|
||||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
||||||
rm $CACHEDIR/$sdcard/armbian.key
|
rm $CACHEDIR/$SDCARD/armbian.key
|
||||||
|
|
||||||
# add armhf arhitecture to arm64
|
# 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
|
# stage: update packages list
|
||||||
display_alert "Updating package list" "$RELEASE" "info"
|
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'} \
|
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Updating package lists..." $TTY_Y $TTY_X'} \
|
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Updating package lists..." $TTY_Y $TTY_X'} \
|
||||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
${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
|
# stage: upgrade base packages from xxx-updates and xxx-backports repository branches
|
||||||
display_alert "Upgrading base packages" "Armbian" "info"
|
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"' \
|
$apt_extra $apt_extra_progress upgrade"' \
|
||||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Upgrading base packages..." $TTY_Y $TTY_X'} \
|
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Upgrading base packages..." $TTY_Y $TTY_X'} \
|
||||||
|
@ -226,7 +226,7 @@ create_rootfs_cache()
|
||||||
|
|
||||||
# stage: install additional packages
|
# stage: install additional packages
|
||||||
display_alert "Installing packages for" "Armbian" "info"
|
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"' \
|
$apt_extra $apt_extra_progress --no-install-recommends install $PACKAGE_LIST"' \
|
||||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Installing Armbian system..." $TTY_Y $TTY_X'} \
|
${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'}
|
eval 'df -h | grep "$CACHEDIR/"' ${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'}
|
||||||
|
|
||||||
# stage: remove downloaded packages
|
# 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
|
# stage: make rootfs cache archive
|
||||||
display_alert "Ending debootstrap process and preparing cache" "$RELEASE" "info"
|
display_alert "Ending debootstrap process and preparing cache" "$RELEASE" "info"
|
||||||
sync
|
sync
|
||||||
# the only reason to unmount here is compression progress display
|
# the only reason to unmount here is compression progress display
|
||||||
# based on rootfs size calculation
|
# 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/*' \
|
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
|
--exclude='./sys/*' . | pv -p -b -r -s $(du -sb $CACHEDIR/$SDCARD/ | cut -f1) -N "$display_name" | pigz --fast > $cache_fname
|
||||||
fi
|
fi
|
||||||
mount_chroot "$CACHEDIR/$sdcard"
|
mount_chroot "$CACHEDIR/$SDCARD"
|
||||||
} #############################################################################
|
} #############################################################################
|
||||||
|
|
||||||
# prepare_partitions
|
# prepare_partitions
|
||||||
|
@ -311,7 +311,7 @@ prepare_partitions()
|
||||||
# mountopts[nfs] is empty
|
# mountopts[nfs] is empty
|
||||||
|
|
||||||
# stage: calculate rootfs size
|
# 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"
|
display_alert "Current rootfs size" "$rootfs_size MiB" "info"
|
||||||
if [[ -n $FIXED_IMAGE_SIZE && $FIXED_IMAGE_SIZE =~ ^[0-9]+$ ]]; then
|
if [[ -n $FIXED_IMAGE_SIZE && $FIXED_IMAGE_SIZE =~ ^[0-9]+$ ]]; then
|
||||||
display_alert "Using user-defined image size" "$FIXED_IMAGE_SIZE MiB" "info"
|
display_alert "Using user-defined image size" "$FIXED_IMAGE_SIZE MiB" "info"
|
||||||
|
@ -385,46 +385,46 @@ prepare_partitions()
|
||||||
partprobe $LOOP
|
partprobe $LOOP
|
||||||
|
|
||||||
# stage: create fs, mount partitions, create fstab
|
# stage: create fs, mount partitions, create fstab
|
||||||
rm -f $CACHEDIR/$sdcard/etc/fstab
|
rm -f $CACHEDIR/$SDCARD/etc/fstab
|
||||||
if [[ -n $rootpart ]]; then
|
if [[ -n $rootpart ]]; then
|
||||||
display_alert "Creating rootfs" "$ROOTFS_TYPE"
|
display_alert "Creating rootfs" "$ROOTFS_TYPE"
|
||||||
[[ $CONTAINER_COMPAT == yes ]] && mknod -m0660 $LOOPp${rootpart} b 259 ${rootpart} > /dev/null
|
[[ $CONTAINER_COMPAT == yes ]] && mknod -m0660 $LOOPp${rootpart} b 259 ${rootpart} > /dev/null
|
||||||
mkfs.${mkfs[$ROOTFS_TYPE]} ${mkopts[$ROOTFS_TYPE]} ${LOOP}p${rootpart}
|
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 == ext4 ]] && tune2fs -o journal_data_writeback ${LOOP}p${rootpart} > /dev/null
|
||||||
[[ $ROOTFS_TYPE == btrfs ]] && local fscreateopt="-o compress=zlib"
|
[[ $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})"
|
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
|
fi
|
||||||
if [[ -n $bootpart ]]; then
|
if [[ -n $bootpart ]]; then
|
||||||
display_alert "Creating /boot" "$bootfs"
|
display_alert "Creating /boot" "$bootfs"
|
||||||
[[ $CONTAINER_COMPAT == yes ]] && mknod -m0660 $LOOPp${bootpart} b 259 ${bootpart} > /dev/null
|
[[ $CONTAINER_COMPAT == yes ]] && mknod -m0660 $LOOPp${bootpart} b 259 ${bootpart} > /dev/null
|
||||||
mkfs.${mkfs[$bootfs]} ${mkopts[$bootfs]} ${LOOP}p${bootpart}
|
mkfs.${mkfs[$bootfs]} ${mkopts[$bootfs]} ${LOOP}p${bootpart}
|
||||||
mkdir -p $CACHEDIR/$mount/boot/
|
mkdir -p $CACHEDIR/$MOUNT/boot/
|
||||||
mount ${LOOP}p${bootpart} $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
|
echo "UUID=$(blkid -s UUID -o value ${LOOP}p${bootpart}) /boot ${mkfs[$bootfs]} defaults${mountopts[$bootfs]} 0 2" >> $CACHEDIR/$SDCARD/etc/fstab
|
||||||
fi
|
fi
|
||||||
[[ $ROOTFS_TYPE == nfs ]] && echo "/dev/nfs / nfs defaults 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
|
echo "tmpfs /tmp tmpfs defaults,nosuid 0 0" >> $CACHEDIR/$SDCARD/etc/fstab
|
||||||
|
|
||||||
# stage: adjust boot script or boot environment
|
# 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
|
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
|
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
|
fi
|
||||||
echo "rootfstype=$ROOTFS_TYPE" >> $CACHEDIR/$sdcard/boot/armbianEnv.txt
|
echo "rootfstype=$ROOTFS_TYPE" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt
|
||||||
elif [[ $rootpart != 1 ]]; then
|
elif [[ $rootpart != 1 ]]; then
|
||||||
local bootscript_dst=${BOOTSCRIPT##*:}
|
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/" \
|
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
|
fi
|
||||||
|
|
||||||
# recompile .cmd to .scr if boot.cmd exists
|
# recompile .cmd to .scr if boot.cmd exists
|
||||||
[[ -f $CACHEDIR/$sdcard/boot/boot.cmd ]] && \
|
[[ -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
|
mkimage -C none -A arm -T script -d $CACHEDIR/$SDCARD/boot/boot.cmd $CACHEDIR/$SDCARD/boot/boot.scr > /dev/null 2>&1
|
||||||
|
|
||||||
} #############################################################################
|
} #############################################################################
|
||||||
|
|
||||||
|
@ -442,21 +442,21 @@ create_image()
|
||||||
if [[ $ROOTFS_TYPE != nfs ]]; then
|
if [[ $ROOTFS_TYPE != nfs ]]; then
|
||||||
display_alert "Copying files to image" "${sdcard}.raw" "info"
|
display_alert "Copying files to image" "${sdcard}.raw" "info"
|
||||||
rsync -aHWXh --exclude="/boot/*" --exclude="/dev/*" --exclude="/proc/*" --exclude="/run/*" --exclude="/tmp/*" \
|
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
|
else
|
||||||
display_alert "Creating rootfs archive" "rootfs.tgz" "info"
|
display_alert "Creating rootfs archive" "rootfs.tgz" "info"
|
||||||
tar cp --xattrs --directory=$CACHEDIR/$sdcard/ --exclude='./boot/*' --exclude='./dev/*' --exclude='./proc/*' --exclude='./run/*' --exclude='./tmp/*' \
|
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
|
--exclude='./sys/*' . | pv -p -b -r -s $(du -sb $CACHEDIR/$SDCARD/ | cut -f1) -N "rootfs.tgz" | pigz > $DEST/images/${version}-rootfs.tgz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# stage: rsync /boot
|
# stage: rsync /boot
|
||||||
display_alert "Copying files to /boot partition" "${sdcard}.raw" "info"
|
display_alert "Copying files to /boot partition" "${sdcard}.raw" "info"
|
||||||
if [[ $(findmnt --target $CACHEDIR/$mount/boot -o FSTYPE -n) == vfat ]]; then
|
if [[ $(findmnt --target $CACHEDIR/$MOUNT/boot -o FSTYPE -n) == vfat ]]; then
|
||||||
# fat32
|
# fat32
|
||||||
rsync -rLtWh --info=progress2,stats1 $CACHEDIR/$sdcard/boot $CACHEDIR/$mount
|
rsync -rLtWh --info=progress2,stats1 $CACHEDIR/$SDCARD/boot $CACHEDIR/$MOUNT
|
||||||
else
|
else
|
||||||
# ext4
|
# ext4
|
||||||
rsync -aHWXh --info=progress2,stats1 $CACHEDIR/$sdcard/boot $CACHEDIR/$mount
|
rsync -aHWXh --info=progress2,stats1 $CACHEDIR/$SDCARD/boot $CACHEDIR/$MOUNT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# DEBUG: print free space
|
# DEBUG: print free space
|
||||||
|
@ -468,18 +468,18 @@ create_image()
|
||||||
|
|
||||||
# unmount /boot first, rootfs second, image file last
|
# unmount /boot first, rootfs second, image file last
|
||||||
sync
|
sync
|
||||||
[[ $BOOTSIZE != 0 ]] && umount -l $CACHEDIR/$mount/boot
|
[[ $BOOTSIZE != 0 ]] && umount -l $CACHEDIR/$MOUNT/boot
|
||||||
[[ $ROOTFS_TYPE != nfs ]] && umount -l $CACHEDIR/$mount
|
[[ $ROOTFS_TYPE != nfs ]] && umount -l $CACHEDIR/$MOUNT
|
||||||
losetup -d $LOOP
|
losetup -d $LOOP
|
||||||
|
|
||||||
if [[ $BUILD_ALL == yes ]]; then
|
if [[ $BUILD_ALL == yes ]]; then
|
||||||
TEMP_DIR="$(mktemp -d $CACHEDIR/${version}.XXXXXX)"
|
TEMP_DIR="$(mktemp -d $CACHEDIR/${version}.XXXXXX)"
|
||||||
cp $CACHEDIR/$sdcard/etc/armbian.txt "${TEMP_DIR}/"
|
cp $CACHEDIR/$SDCARD/etc/armbian.txt "${TEMP_DIR}/"
|
||||||
mv "$CACHEDIR/${sdcard}.raw" "${TEMP_DIR}/${version}.img"
|
mv "$CACHEDIR/${sdcard}.raw" "${TEMP_DIR}/${version}.img"
|
||||||
cd "${TEMP_DIR}/"
|
cd "${TEMP_DIR}/"
|
||||||
sign_and_compress &
|
sign_and_compress &
|
||||||
else
|
else
|
||||||
cp $CACHEDIR/$sdcard/etc/armbian.txt $CACHEDIR/
|
cp $CACHEDIR/$SDCARD/etc/armbian.txt $CACHEDIR/
|
||||||
mv $CACHEDIR/${sdcard}.raw $CACHEDIR/${version}.img
|
mv $CACHEDIR/${sdcard}.raw $CACHEDIR/${version}.img
|
||||||
cd $CACHEDIR/
|
cd $CACHEDIR/
|
||||||
sign_and_compress
|
sign_and_compress
|
||||||
|
@ -559,12 +559,12 @@ umount_chroot()
|
||||||
unmount_on_exit()
|
unmount_on_exit()
|
||||||
{
|
{
|
||||||
trap - INT TERM EXIT
|
trap - INT TERM EXIT
|
||||||
umount_chroot "$CACHEDIR/$sdcard/"
|
umount_chroot "$CACHEDIR/$SDCARD/"
|
||||||
umount -l $CACHEDIR/$sdcard/tmp >/dev/null 2>&1
|
umount -l $CACHEDIR/$SDCARD/tmp >/dev/null 2>&1
|
||||||
umount -l $CACHEDIR/$sdcard >/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/boot >/dev/null 2>&1
|
||||||
umount -l $CACHEDIR/$mount >/dev/null 2>&1
|
umount -l $CACHEDIR/$MOUNT >/dev/null 2>&1
|
||||||
losetup -d $LOOP >/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"
|
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"
|
display_alert "Installing desktop" "XFCE" "info"
|
||||||
|
|
||||||
mkdir -p $CACHEDIR/$sdcard/tmp/bin
|
mkdir -p $CACHEDIR/$SDCARD/tmp/bin
|
||||||
mount --bind $SRC/lib/bin/ $CACHEDIR/$sdcard/tmp/bin
|
mount --bind $SRC/lib/bin/ $CACHEDIR/$SDCARD/tmp/bin
|
||||||
|
|
||||||
# install default desktop settings
|
# 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 /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 /root/"
|
||||||
|
|
||||||
# install wallpapers
|
# install wallpapers
|
||||||
case $RELEASE in
|
case $RELEASE in
|
||||||
wheezy)
|
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"
|
test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
jessie|xenial)
|
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"
|
test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
|
||||||
mkdir -p $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/
|
cp $SRC/lib/config/polkit-jessie/*.pkla $CACHEDIR/$SDCARD/etc/polkit-1/localauthority/50-local.d/
|
||||||
;;
|
;;
|
||||||
|
|
||||||
trusty)
|
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"
|
test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Install custom icons and theme
|
# 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 "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 "unzip -qq /tmp/bin/NumixHolo.zip -d /usr/share/themes"
|
||||||
|
|
||||||
# Enable network manager
|
# Enable network manager
|
||||||
if [[ -f ${CACHEDIR}/$sdcard/etc/NetworkManager/NetworkManager.conf ]]; then
|
if [[ -f ${CACHEDIR}/$SDCARD/etc/NetworkManager/NetworkManager.conf ]]; then
|
||||||
sed "s/managed=\(.*\)/managed=true/g" -i $CACHEDIR/$sdcard/etc/NetworkManager/NetworkManager.conf
|
sed "s/managed=\(.*\)/managed=true/g" -i $CACHEDIR/$SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||||
# Disable dns management withing NM
|
# Disable dns management withing NM
|
||||||
sed "s/\[main\]/\[main\]\ndns=none/g" -i $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
|
printf '[keyfile]\nunmanaged-devices=interface-name:p2p0\n' >> $CACHEDIR/$SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable Pulseaudio timer scheduling which does not work with sndhdmi driver
|
# Disable Pulseaudio timer scheduling which does not work with sndhdmi driver
|
||||||
if [[ -f ${CACHEDIR}/$sdcard/etc/pulse/default.pa ]]; then
|
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
|
sed "s/load-module module-udev-detect$/& tsched=0/g" -i $CACHEDIR/$SDCARD/etc/pulse/default.pa
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable desktop mode autostart for now to enforce creation of normal user account
|
# 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
|
# Compile Turbo Frame buffer for sunxi
|
||||||
if [[ $LINUXFAMILY == sun* && $BRANCH == default ]]; then
|
if [[ $LINUXFAMILY == sun* && $BRANCH == default ]]; then
|
||||||
|
|
||||||
if [[ $RELEASE == jessie || $RELEASE == xenial ]]; then
|
if [[ $RELEASE == jessie || $RELEASE == xenial ]]; then
|
||||||
# Disable compositing by default
|
# 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/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/root/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set default audio-output to HDMI for desktop-images
|
# 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 {
|
pcm.!default {
|
||||||
type hw
|
type hw
|
||||||
card 1
|
card 1
|
||||||
|
@ -83,12 +83,12 @@ install_desktop ()
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# enable memory reservations
|
# enable memory reservations
|
||||||
if [[ -f $CACHEDIR/$sdcard/boot/armbianEnv.txt ]]; then
|
if [[ -f $CACHEDIR/$SDCARD/boot/armbianEnv.txt ]]; then
|
||||||
echo "disp_mem_reserves=on" >> $CACHEDIR/$sdcard/boot/armbianEnv.txt
|
echo "disp_mem_reserves=on" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt
|
||||||
else
|
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
|
||||||
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"
|
display_alert "Applying common tweaks" "" "info"
|
||||||
|
|
||||||
# add dummy fstab entry to make mkinitramfs happy
|
# 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
|
# create modules file
|
||||||
if [[ $BRANCH == dev && -n $MODULES_DEV ]]; then
|
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
|
elif [[ $BRANCH == next || $BRANCH == dev ]]; then
|
||||||
tr ' ' '\n' <<< "$MODULES_NEXT" > $CACHEDIR/$sdcard/etc/modules
|
tr ' ' '\n' <<< "$MODULES_NEXT" > $CACHEDIR/$SDCARD/etc/modules
|
||||||
else
|
else
|
||||||
tr ' ' '\n' <<< "$MODULES" > $CACHEDIR/$sdcard/etc/modules
|
tr ' ' '\n' <<< "$MODULES" > $CACHEDIR/$SDCARD/etc/modules
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create blacklist files
|
# create blacklist files
|
||||||
if [[ $BRANCH == dev && -n $MODULES_BLACKLIST_DEV ]]; then
|
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
|
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
|
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
|
fi
|
||||||
|
|
||||||
# remove default interfaces file if present
|
# remove default interfaces file if present
|
||||||
# before installing board support package
|
# 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
|
# 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
|
# change time zone data
|
||||||
echo $TZDATA > $CACHEDIR/$sdcard/etc/timezone
|
echo $TZDATA > $CACHEDIR/$SDCARD/etc/timezone
|
||||||
chroot $CACHEDIR/$sdcard /bin/bash -c "dpkg-reconfigure -f noninteractive tzdata >/dev/null 2>&1"
|
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg-reconfigure -f noninteractive tzdata >/dev/null 2>&1"
|
||||||
|
|
||||||
# set root password
|
# 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
|
# 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
|
# tmpfs configuration
|
||||||
# Takes effect only in Wheezy and Trusty
|
# Takes effect only in Wheezy and Trusty
|
||||||
if [[ -f $CACHEDIR/$sdcard/etc/default/tmpfs ]]; then
|
if [[ -f $CACHEDIR/$SDCARD/etc/default/tmpfs ]]; then
|
||||||
sed -e 's/#RAMTMP=no/RAMTMP=yes/g' -i $CACHEDIR/$sdcard/etc/default/tmpfs
|
sed -e 's/#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/#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/#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/#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
|
sed -e 's/#TMP_SIZE=/TMP_SIZE=1G/g' -i $CACHEDIR/$SDCARD/etc/default/tmpfs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add custom bashrc loading
|
# 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
|
if [[ -f /etc/bash.bashrc.custom ]]; then
|
||||||
. /etc/bash.bashrc.custom
|
. /etc/bash.bashrc.custom
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# display welcome message at first root login
|
# 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
|
# NOTE: this needs to be executed before family_tweaks
|
||||||
local bootscript_src=${BOOTSCRIPT%%:*}
|
local bootscript_src=${BOOTSCRIPT%%:*}
|
||||||
local bootscript_dst=${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 ]] && \
|
[[ -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
|
# TODO: modify $bootscript_dst or armbianEnv.txt to make NFS boot universal
|
||||||
# instead of copying sunxi-specific template
|
# instead of copying sunxi-specific template
|
||||||
if [[ $ROOTFS_TYPE == nfs ]]; then
|
if [[ $ROOTFS_TYPE == nfs ]]; then
|
||||||
display_alert "Copying NFS boot script template"
|
display_alert "Copying NFS boot script template"
|
||||||
if [[ -f $SRC/userpatches/nfs-boot.cmd ]]; then
|
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
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# initial date for fake-hwclock
|
# 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
|
# this is needed for ubuntu
|
||||||
rm $CACHEDIR/$sdcard/etc/resolv.conf
|
rm $CACHEDIR/$SDCARD/etc/resolv.conf
|
||||||
echo "nameserver 8.8.8.8" >> $CACHEDIR/$sdcard/etc/resolv.conf
|
echo "nameserver 8.8.8.8" >> $CACHEDIR/$SDCARD/etc/resolv.conf
|
||||||
|
|
||||||
# set hostname in hosts file
|
# set hostname in hosts file
|
||||||
cat <<-EOF > $CACHEDIR/$sdcard/etc/hosts
|
cat <<-EOF > $CACHEDIR/$SDCARD/etc/hosts
|
||||||
127.0.0.1 localhost $HOST
|
127.0.0.1 localhost $HOST
|
||||||
::1 localhost $HOST ip6-localhost ip6-loopback
|
::1 localhost $HOST ip6-localhost ip6-loopback
|
||||||
fe00::0 ip6-localnet
|
fe00::0 ip6-localnet
|
||||||
|
@ -114,51 +114,51 @@ install_common()
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
display_alert "Installing kernel" "$CHOSEN_KERNEL" "info"
|
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"
|
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"
|
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
|
# 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"
|
# 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
|
#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"
|
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
|
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"
|
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
|
fi
|
||||||
|
|
||||||
# install board support package
|
# install board support package
|
||||||
display_alert "Installing board support package" "$BOARD" "info"
|
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
|
# 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
|
# execute $LINUXFAMILY-specific tweaks from $BOARD.conf
|
||||||
[[ $(type -t family_tweaks) == function ]] && family_tweaks
|
[[ $(type -t family_tweaks) == function ]] && family_tweaks
|
||||||
|
|
||||||
# enable firstrun script
|
# 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
|
# 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
|
# 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"
|
# 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()
|
install_distribution_specific()
|
||||||
|
@ -169,53 +169,53 @@ install_distribution_specific()
|
||||||
|
|
||||||
wheezy)
|
wheezy)
|
||||||
# add serial console
|
# 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
|
# 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
|
# disable some getties
|
||||||
sed -e 's/5:23:respawn/#5: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
|
sed -e 's/6:23:respawn/#6:23:respawn/g' -i $CACHEDIR/$SDCARD/etc/inittab
|
||||||
|
|
||||||
# install ramlog
|
# install ramlog
|
||||||
cp $SRC/lib/bin/ramlog_2.0.0_all.deb $CACHEDIR/$sdcard/tmp
|
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"
|
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
|
# enabled back at first run. To remove errors
|
||||||
chroot $CACHEDIR/$sdcard /bin/bash -c "service ramlog disable >/dev/null 2>&1"
|
chroot $CACHEDIR/$SDCARD /bin/bash -c "service ramlog disable >/dev/null 2>&1"
|
||||||
rm $CACHEDIR/$sdcard/tmp/ramlog_2.0.0_all.deb
|
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/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/$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
|
sed -e 's/umountnfs $time/umountnfs $time ramlog/g' -i $CACHEDIR/$SDCARD/etc/init.d/rsyslog
|
||||||
;;
|
;;
|
||||||
|
|
||||||
jessie)
|
jessie)
|
||||||
# enable root login for latest ssh on 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
|
# add serial console
|
||||||
#cp $SRC/lib/config/ttyS0.conf $CACHEDIR/$sdcard/etc/init/$SERIALCON.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
|
#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"
|
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"
|
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"
|
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
|
# don't clear screen tty1
|
||||||
mkdir -p "$CACHEDIR/$sdcard/etc/systemd/system/getty@tty1.service.d/"
|
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"
|
printf "[Service]\nTTYVTDisallocate=no" > "$CACHEDIR/$SDCARD/etc/systemd/system/getty@tty1.service.d/10-noclear.conf"
|
||||||
|
|
||||||
# seting timeout
|
# seting timeout
|
||||||
mkdir -p $CACHEDIR/$sdcard/etc/systemd/system/systemd-modules-load.service.d/
|
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
|
printf "[Service]\nTimeoutStopSec=10" > $CACHEDIR/$SDCARD/etc/systemd/system/systemd-modules-load.service.d/10-timeout.conf
|
||||||
|
|
||||||
# handle PMU power button
|
# handle PMU power button
|
||||||
mkdir -p $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/
|
cp $SRC/lib/config/71-axp-power-button.rules $CACHEDIR/$SDCARD/etc/udev/rules.d/
|
||||||
;;
|
;;
|
||||||
|
|
||||||
trusty)
|
trusty)
|
||||||
# add serial console
|
# 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]
|
start on stopped rc RUNLEVEL=[2345]
|
||||||
stop on runlevel [!2345]
|
stop on runlevel [!2345]
|
||||||
|
|
||||||
|
@ -224,66 +224,66 @@ install_distribution_specific()
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# don't clear screen tty1
|
# 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
|
# disable some getties
|
||||||
rm -f $CACHEDIR/$sdcard/etc/init/tty5.conf
|
rm -f $CACHEDIR/$SDCARD/etc/init/tty5.conf
|
||||||
rm -f $CACHEDIR/$sdcard/etc/init/tty6.conf
|
rm -f $CACHEDIR/$SDCARD/etc/init/tty6.conf
|
||||||
|
|
||||||
# enable root login for latest ssh on trusty
|
# 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
|
# 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
|
# that my custom motd works well
|
||||||
if [[ -d $CACHEDIR/$sdcard/etc/update-motd.d ]]; then
|
if [[ -d $CACHEDIR/$SDCARD/etc/update-motd.d ]]; then
|
||||||
mv $CACHEDIR/$sdcard/etc/update-motd.d $CACHEDIR/$sdcard/etc/update-motd.d-backup
|
mv $CACHEDIR/$SDCARD/etc/update-motd.d $CACHEDIR/$SDCARD/etc/update-motd.d-backup
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove what's anyway not working
|
# remove what's anyway not working
|
||||||
#chroot $CACHEDIR/$sdcard /bin/bash -c "apt-get remove --auto-remove ureadahead"
|
#chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get remove --auto-remove ureadahead"
|
||||||
rm $CACHEDIR/$sdcard/etc/init/ureadahead*
|
rm $CACHEDIR/$SDCARD/etc/init/ureadahead*
|
||||||
rm $CACHEDIR/$sdcard/etc/init/plymouth*
|
rm $CACHEDIR/$SDCARD/etc/init/plymouth*
|
||||||
;;
|
;;
|
||||||
|
|
||||||
xenial)
|
xenial)
|
||||||
# enable root login for latest ssh on jessie
|
# 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
|
# 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
|
# Fix for PuTTY/KiTTY & ncurses-based dialogs (i.e. alsamixer) over serial
|
||||||
# may break other terminals like screen
|
# may break other terminals like screen
|
||||||
#printf "[Service]\nEnvironment=TERM=xterm-256color" > /etc/systemd/system/serial-getty@.service.d/10-term.conf
|
#printf "[Service]\nEnvironment=TERM=xterm-256color" > /etc/systemd/system/serial-getty@.service.d/10-term.conf
|
||||||
|
|
||||||
# don't clear screen tty1
|
# don't clear screen tty1
|
||||||
mkdir -p "$CACHEDIR/$sdcard/etc/systemd/system/getty@tty1.service.d/"
|
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"
|
printf "[Service]\nTTYVTDisallocate=no" > "$CACHEDIR/$SDCARD/etc/systemd/system/getty@tty1.service.d/10-noclear.conf"
|
||||||
|
|
||||||
# seting timeout
|
# seting timeout
|
||||||
mkdir -p $CACHEDIR/$sdcard/etc/systemd/system/systemd-modules-load.service.d/
|
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
|
printf "[Service]\nTimeoutStopSec=10" > $CACHEDIR/$SDCARD/etc/systemd/system/systemd-modules-load.service.d/10-timeout.conf
|
||||||
|
|
||||||
# Fix for haveged service
|
# Fix for haveged service
|
||||||
mkdir -p -m755 $CACHEDIR/$sdcard/etc/systemd/system/haveged.service.d
|
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
|
cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/haveged.service.d/10-no-new-privileges.conf
|
||||||
[Service]
|
[Service]
|
||||||
NoNewPrivileges=false
|
NoNewPrivileges=false
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# handle PMU power button
|
# handle PMU power button
|
||||||
mkdir -p $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/
|
cp $SRC/lib/config/71-axp-power-button.rules $CACHEDIR/$SDCARD/etc/udev/rules.d/
|
||||||
|
|
||||||
# disable not working on unneeded services
|
# disable not working on unneeded services
|
||||||
# ureadahead needs kernel tracing options that AFAIK are present only in mainline
|
# 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 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 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 ondemand.service >/dev/null 2>&1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,4 +57,4 @@ REPLACE=""
|
||||||
|
|
||||||
# install basic firmware by default
|
# install basic firmware by default
|
||||||
display_alert "Installing linux firmware" "$REVISION" "info"
|
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
|
cd src
|
||||||
make -s ARCH=$ARCHITECTURE CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" clean >> $DEST/debug/compilation.log 2>&1
|
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
|
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/
|
cp os/linux/*.ko $CACHEDIR/$SDCARD/lib/modules/$VER-$LINUXFAMILY/kernel/net/wireless/
|
||||||
mkdir -p $CACHEDIR/$sdcard/etc/Wireless/RT2870STA
|
mkdir -p $CACHEDIR/$SDCARD/etc/Wireless/RT2870STA
|
||||||
cp RT2870STA.dat $CACHEDIR/$sdcard/etc/Wireless/RT2870STA/
|
cp RT2870STA.dat $CACHEDIR/$SDCARD/etc/Wireless/RT2870STA/
|
||||||
depmod -b $CACHEDIR/$sdcard/ $VER-$LINUXFAMILY
|
depmod -b $CACHEDIR/$SDCARD/ $VER-$LINUXFAMILY
|
||||||
make -s clean >/dev/null
|
make -s clean >/dev/null
|
||||||
cd ..
|
cd ..
|
||||||
mkdir -p $CACHEDIR/$sdcard/usr/src/
|
mkdir -p $CACHEDIR/$SDCARD/usr/src/
|
||||||
cp -R src $CACHEDIR/$sdcard/usr/src/mt7601-3.0.0.4
|
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
|
# TODO: Set the module to build automatically via dkms in the future here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,9 +52,9 @@ install_rtl8192cu()
|
||||||
# GCC5 compatibility patch end
|
# GCC5 compatibility patch end
|
||||||
|
|
||||||
make ARCH=$ARCHITECTURE CROSS_COMPILE=$KERNEL_COMPILER KSRC=$SOURCES/$LINUXSOURCEDIR/ >> $DEST/debug/compilation.log
|
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/
|
cp *.ko $CACHEDIR/$SDCARD/lib/modules/$VER-$LINUXFAMILY/kernel/net/wireless/
|
||||||
depmod -b $CACHEDIR/$sdcard/ $VER-$LINUXFAMILY
|
depmod -b $CACHEDIR/$SDCARD/ $VER-$LINUXFAMILY
|
||||||
#cp blacklist*.conf $CACHEDIR/$sdcard/etc/modprobe.d/
|
#cp blacklist*.conf $CACHEDIR/$SDCARD/etc/modprobe.d/
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $BRANCH == default && $ARCHITECTURE == arm ]]; then
|
if [[ $BRANCH == default && $ARCHITECTURE == arm ]]; then
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
compile_tools()
|
compile_tools()
|
||||||
{
|
{
|
||||||
local tmpdir=$CACHEDIR/$sdcard/root/tools
|
local tmpdir=$CACHEDIR/$SDCARD/root/tools
|
||||||
|
|
||||||
display_alert "Building deb" "armbian-tools" "info"
|
display_alert "Building deb" "armbian-tools" "info"
|
||||||
|
|
||||||
|
@ -66,8 +66,8 @@ compile_tools()
|
||||||
compiling()
|
compiling()
|
||||||
{
|
{
|
||||||
display_alert "... compiling" "temper" "info"
|
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 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 $CTHREADS" >> $DEST/debug/tools-build.log 2>&1
|
||||||
if [[ $? -ne 0 || ! -f $tmpdir/temper/src/pcsensor ]]; then
|
if [[ $? -ne 0 || ! -f $tmpdir/temper/src/pcsensor ]]; then
|
||||||
cd $CACHEDIR
|
cd $CACHEDIR
|
||||||
rm -rf $tmpdir
|
rm -rf $tmpdir
|
||||||
|
@ -75,7 +75,7 @@ compile_tools()
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
display_alert "... compiling" "bluetooth utils" "info"
|
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
|
if [[ $? -ne 0 || ! -f $tmpdir/brcm/brcm_bt_reset ]]; then
|
||||||
cd $CACHEDIR
|
cd $CACHEDIR
|
||||||
rm -rf $tmpdir
|
rm -rf $tmpdir
|
||||||
|
@ -93,4 +93,4 @@ if [[ ! -f $DEST/debs/armbian-tools-${RELEASE}_${REVISION}_${ARCH}.deb ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
display_alert "Installing" "armbian-tools-${RELEASE}_${REVISION}_${ARCH}.deb" "info"
|
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
|
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
|
chmod +x $SOURCES/usb-redirector-linux-arm-eabi/files/rc.usbsrvd
|
||||||
# copy to root
|
# 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/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/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/rc.usbsrvd $CACHEDIR/$SDCARD/etc/init.d/
|
||||||
# not started by default ----- update.rc rc.usbsrvd defaults
|
# 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"
|
display_alert "Installing additional application" "USB redirector" "info"
|
||||||
|
|
Loading…
Add table
Reference in a new issue