Move debootstrap and packaging directories to a temp directory

This avoids errors with filesystem features and permissions when output
directory is shared in Virtualbox (i.e. when using Vagrant)
This commit is contained in:
zador-blood-stained
2017-07-12 19:13:38 +03:00
parent 56eac46d6c
commit 1949c0b6da
30 changed files with 302 additions and 300 deletions

1
.gitignore vendored
View File

@@ -6,6 +6,7 @@ ubuntu-*-cloudimg-console.log
.ignore_changes .ignore_changes
### output directories ### output directories
/.tmp/
/output/ /output/
/cache/ /cache/
/userpatches/ /userpatches/

View File

@@ -61,11 +61,11 @@ fi
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 $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 $SDCARD/etc/lirc/hardware.conf
cp $SRC/config/lirc.conf.cubox-i $CACHEDIR/$SDCARD/etc/lirc/lircd.conf cp $SRC/config/lirc.conf.cubox-i $SDCARD/etc/lirc/lircd.conf
# TODO: Fix the workaround in firstrun? # TODO: Fix the workaround in firstrun?
#chroot $CACHEDIR/$SDCARD /bin/bash -c "LC_ALL=C LANG=C update-rc.d brcm4330-patch defaults>> /dev/null" #chroot $SDCARD /bin/bash -c "LC_ALL=C LANG=C update-rc.d brcm4330-patch defaults > /dev/null"
} }
family_tweaks_bsp() family_tweaks_bsp()

View File

@@ -29,9 +29,9 @@ 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"/' $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"/' $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"/' $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"/' $SDCARD/etc/lirc/hardware.conf
cp $SRC/config/lirc.conf.odroidc2 $CACHEDIR/$SDCARD/etc/lirc/lircd.conf cp $SRC/config/lirc.conf.odroidc2 $SDCARD/etc/lirc/lircd.conf
} }

View File

@@ -40,5 +40,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 $SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove lirc linux-sound-base alsa-base alsa-utils bluez>/dev/null 2>&1"
} }

View File

@@ -43,8 +43,8 @@ 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 $SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove lirc linux-sound-base alsa-base alsa-utils bluez>/dev/null 2>&1"
ln -sf interfaces.espressobin $CACHEDIR/$SDCARD/etc/network/interfaces ln -sf interfaces.espressobin $SDCARD/etc/network/interfaces
echo "#Marvell Espressobin Console" >> $CACHEDIR/$SDCARD/etc/securetty echo "#Marvell Espressobin Console" >> $SDCARD/etc/securetty
echo "ttyMV0" >> $CACHEDIR/$SDCARD/etc/securetty echo "ttyMV0" >> $SDCARD/etc/securetty
} }

View File

@@ -39,8 +39,9 @@ write_uboot_platform()
family_tweaks() family_tweaks()
{ {
# enable service installed from BSP # enable service installed from BSP
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable odroid-c1-hdmi.service >/dev/null 2>&1" chroot $SDCARD /bin/bash -c "systemctl --no-reload enable odroid-c1-hdmi.service >/dev/null 2>&1"
} }
family_tweaks_bsp() family_tweaks_bsp()

View File

@@ -46,17 +46,17 @@ write_uboot_platform()
family_tweaks() family_tweaks()
{ {
echo "#Odroid serial console allow root" >> $CACHEDIR/$SDCARD/etc/securetty echo "#Odroid serial console allow root" >> $SDCARD/etc/securetty
echo "ttyAML0" >> $CACHEDIR/$SDCARD/etc/securetty echo "ttyAML0" >> $SDCARD/etc/securetty
sed -i 's/MODULES=.*/MODULES="meson-ir"/' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf sed -i 's/MODULES=.*/MODULES="meson-ir"/' $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"/' $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"/' $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"/' $SDCARD/etc/lirc/hardware.conf
cp $SRC/config/lirc.conf.odroidc2 $CACHEDIR/$SDCARD/etc/lirc/lircd.conf cp $SRC/config/lirc.conf.odroidc2 $SDCARD/etc/lirc/lircd.conf
# enable service installed from BSP # enable service installed from BSP
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable odroid-c2-hdmi.service >/dev/null 2>&1" chroot $SDCARD /bin/bash -c "systemctl --no-reload enable odroid-c2-hdmi.service >/dev/null 2>&1"
} }
family_tweaks_bsp() family_tweaks_bsp()

View File

@@ -82,6 +82,6 @@ write_uboot_platform()
family_tweaks() family_tweaks()
{ {
echo "blacklist ina231_sensor" > $CACHEDIR/$SDCARD/etc/modprobe.d/blacklist-odroid.conf echo "blacklist ina231_sensor" > $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 $SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove lirc >/dev/null 2>&1"
} }

View File

@@ -32,5 +32,5 @@ write_uboot_platform()
family_tweaks() family_tweaks()
{ {
cp $SRC/packages/blobs/rda/rda8810_modem.bin $CACHEDIR/$SDCARD/boot/modem.bin cp $SRC/packages/blobs/rda/rda8810_modem.bin $SDCARD/boot/modem.bin
} }

View File

@@ -51,6 +51,6 @@ write_uboot_platform()
family_tweaks() family_tweaks()
{ {
if [[ $BOARD == tinkerboard ]]; then if [[ $BOARD == tinkerboard ]]; then
echo "fdt_file=rk3288-miniarm.dtb" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt echo "fdt_file=rk3288-miniarm.dtb" >> $SDCARD/boot/armbianEnv.txt
fi fi
} }

View File

@@ -37,7 +37,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" > $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" >> $SDCARD/etc/modprobe.d/blacklist-guitar.conf
gzip < $SRC/packages/blobs/splash/udoo.bmp > $CACHEDIR/$SDCARD/boot/boot_logo.bmp.gz gzip < $SRC/packages/blobs/splash/udoo.bmp > $SDCARD/boot/boot_logo.bmp.gz
} }

View File

@@ -25,11 +25,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 $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 $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' $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 $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 $SDCARD/etc/lirc/hardware.conf
cp $SRC/config/lirc.conf.cubietruck $CACHEDIR/$SDCARD/etc/lirc/lircd.conf cp $SRC/config/lirc.conf.cubietruck $SDCARD/etc/lirc/lircd.conf
} }

View File

@@ -57,19 +57,19 @@ family_tweaks()
if [[ $BRANCH == default ]]; then if [[ $BRANCH == default ]]; then
# Wi-Fi: mask 2nd interface, disabled powermanagement # Wi-Fi: mask 2nd interface, disabled powermanagement
echo -e "options 8723bs if2name=p2p0 rtw_power_mgnt=0\noptions 8723cs if2name=p2p0 rtw_power_mgnt=0" \ echo -e "options 8723bs if2name=p2p0 rtw_power_mgnt=0\noptions 8723cs if2name=p2p0 rtw_power_mgnt=0" \
>$CACHEDIR/$SDCARD/etc/modprobe.d/wifi-rt8723-pine64.conf > $SDCARD/etc/modprobe.d/wifi-rt8723-pine64.conf
mkdir -p $CACHEDIR/$SDCARD/boot/bat mkdir -p $SDCARD/boot/bat
if [[ $BOARD == pinebook-a64 ]]; then if [[ $BOARD == pinebook-a64 ]]; then
cp -R $SRC/packages/blobs/pinebook/* $CACHEDIR/$SDCARD/boot/ cp -R $SRC/packages/blobs/pinebook/* $SDCARD/boot/
# enable services installed from BSP # enable services installed from BSP
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable pinebook-bluetooth.service pinebook-enable-sound.service \ chroot $SDCARD /bin/bash -c "systemctl --no-reload enable pinebook-bluetooth.service pinebook-enable-sound.service \
pinebook-store-sound-on-suspend.service pinebook-restore-sound-after-resume.service >/dev/null 2>&1" pinebook-store-sound-on-suspend.service pinebook-restore-sound-after-resume.service >/dev/null 2>&1"
fi fi
# power manager # power manager
[[ $BUILD_DESKTOP == yes && $BOARD == pinebook-a64 ]] && chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get -qq -y install xfce4-power-manager >/dev/null 2>&1" [[ $BUILD_DESKTOP == yes && $BOARD == pinebook-a64 ]] && chroot $SDCARD /bin/bash -c "apt-get -qq -y install xfce4-power-manager >/dev/null 2>&1"
fi fi
if [[ $BRANCH == dev && $BOARD == pine64so ]]; then if [[ $BRANCH == dev && $BOARD == pine64so ]]; then
echo "mmc0-broken-cd=on" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt echo "mmc0-broken-cd=on" >> $SDCARD/boot/armbianEnv.txt
fi fi
} }

View File

@@ -34,11 +34,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 $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 $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' $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 $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 $SDCARD/etc/lirc/hardware.conf
cp $SRC/config/lirc.conf.cubietruck $CACHEDIR/$SDCARD/etc/lirc/lircd.conf cp $SRC/config/lirc.conf.cubietruck $SDCARD/etc/lirc/lircd.conf
} }

View File

@@ -31,22 +31,22 @@ 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 $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 $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 $SDCARD/etc/lirc/hardware.conf
cp $SRC/config/lirc.conf.cubietruck $CACHEDIR/$SDCARD/etc/lirc/lircd.conf cp $SRC/config/lirc.conf.cubietruck $SDCARD/etc/lirc/lircd.conf
# 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
case ${BOARD} in case ${BOARD} in
orangepilite|nanopiair|orangepizero*) orangepilite|nanopiair|orangepizero*)
mkdir -p $CACHEDIR/$SDCARD/etc/systemd/system/serial-getty@ttyGS0.service.d mkdir -p $SDCARD/etc/systemd/system/serial-getty@ttyGS0.service.d
if [[ $BRANCH == default ]]; then if [[ $BRANCH == default ]]; then
cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/serial-getty@ttyGS0.service.d/10-switch-role.conf cat <<-EOF > $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
fi fi
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@ttyGS0.service > /dev/null" chroot $SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@ttyGS0.service > /dev/null"
echo "ttyGS0" >> $CACHEDIR/$SDCARD/etc/securetty echo "ttyGS0" >> $SDCARD/etc/securetty
;; ;;
esac esac
} }

View File

@@ -43,19 +43,19 @@ 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 $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 $SDCARD/etc/network/interfaces.default
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.bonding sed 's/wlan0/wlan2/' -i $SDCARD/etc/network/interfaces.bonding
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.hostapd sed 's/wlan0/wlan2/' -i $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 $SDCARD/etc/fstab
# firmware for M4 # firmware for M4
# TODO: move to the u-boot package as a patch? # TODO: move to the u-boot package as a patch?
mkdir -p $CACHEDIR/$SDCARD/boot/bin/ mkdir -p $SDCARD/boot/bin/
cp $SRC/packages/blobs/udoo/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/ cp $SRC/packages/blobs/udoo/m4startup.fw* $SDCARD/boot/bin/
# fix for BT # fix for BT
cp $SRC/packages/blobs/udoo/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$SDCARD/tmp cp $SRC/packages/blobs/udoo/udooneo-bluetooth_1.2-1_armhf.deb $SDCARD/tmp
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1" chroot $SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
fi fi
} }

View File

@@ -48,19 +48,19 @@ 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 $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 $SDCARD/etc/network/interfaces.default
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.bonding sed 's/wlan0/wlan2/' -i $SDCARD/etc/network/interfaces.bonding
sed 's/wlan0/wlan2/' -i $CACHEDIR/$SDCARD/etc/network/interfaces.hostapd sed 's/wlan0/wlan2/' -i $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 $SDCARD/etc/fstab
# firmware for M4 # firmware for M4
# TODO: move to the u-boot package as a patch? # TODO: move to the u-boot package as a patch?
mkdir -p $CACHEDIR/$SDCARD/boot/bin/ mkdir -p $SDCARD/boot/bin/
cp $SRC/packages/blobs/udoo/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/ cp $SRC/packages/blobs/udoo/m4startup.fw* $SDCARD/boot/bin/
# fix for BT # fix for BT
cp $SRC/packages/blobs/udoo/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$SDCARD/tmp cp $SRC/packages/blobs/udoo/udooneo-bluetooth_1.2-1_armhf.deb $SDCARD/tmp
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1" chroot $SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
fi fi
} }

View File

@@ -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/packages/extras-buildpkgs/buildpkg.key $CACHEDIR/$SDCARD/tmp/buildpkg.key cp $SRC/packages/extras-buildpkgs/buildpkg.key $SDCARD/tmp/buildpkg.key
cat <<-'EOF' > $CACHEDIR/$SDCARD/etc/apt/preferences.d/90-armbian-temp.pref cat <<-'EOF' > $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 > $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
@@ -289,7 +289,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 > $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
@@ -309,6 +309,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 $SDCARD/tmp/install.sh
chroot $CACHEDIR/$SDCARD /bin/bash -c "/tmp/install.sh" chroot $SDCARD /bin/bash -c "/tmp/install.sh"
} ############################################################################# } #############################################################################

View File

@@ -52,8 +52,8 @@ compile_uboot()
# create directory structure for the .deb package # create directory structure for the .deb package
local uboot_name=${CHOSEN_UBOOT}_${REVISION}_${ARCH} local uboot_name=${CHOSEN_UBOOT}_${REVISION}_${ARCH}
rm -rf $uboot_name rm -rf $SRC/.tmp/$uboot_name
mkdir -p $uboot_name/usr/lib/{u-boot,$uboot_name} $uboot_name/DEBIAN mkdir -p $SRC/.tmp/$uboot_name/usr/lib/{u-boot,$uboot_name} $SRC/.tmp/$uboot_name/DEBIAN
# process compilation for one or multiple targets # process compilation for one or multiple targets
while read -r target; do while read -r target; do
@@ -105,12 +105,12 @@ compile_uboot()
local f_dst=$(basename $f_src) local f_dst=$(basename $f_src)
fi fi
[[ ! -f $f_src ]] && exit_with_error "U-boot file not found" "$(basename $f_src)" [[ ! -f $f_src ]] && exit_with_error "U-boot file not found" "$(basename $f_src)"
cp $f_src $uboot_name/usr/lib/$uboot_name/$f_dst cp $f_src $SRC/.tmp/$uboot_name/usr/lib/$uboot_name/$f_dst
done done
done <<< "$UBOOT_TARGET_MAP" done <<< "$UBOOT_TARGET_MAP"
# set up postinstall script # set up postinstall script
cat <<-EOF > $uboot_name/DEBIAN/postinst cat <<-EOF > $SRC/.tmp/$uboot_name/DEBIAN/postinst
#!/bin/bash #!/bin/bash
source /usr/lib/u-boot/platform_install.sh source /usr/lib/u-boot/platform_install.sh
[[ \$DEVICE == /dev/null ]] && exit 0 [[ \$DEVICE == /dev/null ]] && exit 0
@@ -121,17 +121,17 @@ compile_uboot()
sync sync
exit 0 exit 0
EOF EOF
chmod 755 $uboot_name/DEBIAN/postinst chmod 755 $SRC/.tmp/$uboot_name/DEBIAN/postinst
# declare -f on non-defined function does not do anything # declare -f on non-defined function does not do anything
cat <<-EOF > $uboot_name/usr/lib/u-boot/platform_install.sh cat <<-EOF > $SRC/.tmp/$uboot_name/usr/lib/u-boot/platform_install.sh
DIR=/usr/lib/$uboot_name DIR=/usr/lib/$uboot_name
$(declare -f write_uboot_platform) $(declare -f write_uboot_platform)
$(declare -f setup_write_uboot_platform) $(declare -f setup_write_uboot_platform)
EOF EOF
# set up control file # set up control file
cat <<-EOF > $uboot_name/DEBIAN/control cat <<-EOF > $SRC/.tmp/$uboot_name/DEBIAN/control
Package: linux-u-boot-${BOARD}-${BRANCH} Package: linux-u-boot-${BOARD}-${BRANCH}
Version: $REVISION Version: $REVISION
Architecture: $ARCH Architecture: $ARCH
@@ -147,19 +147,19 @@ compile_uboot()
# copy config file to the package # copy config file to the package
# useful for FEL boot with overlayfs_wrapper # useful for FEL boot with overlayfs_wrapper
[[ -f .config && -n $BOOTCONFIG ]] && cp .config $uboot_name/usr/lib/u-boot/$BOOTCONFIG [[ -f .config && -n $BOOTCONFIG ]] && cp .config $SRC/.tmp/$uboot_name/usr/lib/u-boot/$BOOTCONFIG
# copy license files from typical locations # copy license files from typical locations
[[ -f COPYING ]] && cp COPYING $uboot_name/usr/lib/u-boot/LICENSE [[ -f COPYING ]] && cp COPYING $SRC/.tmp/$uboot_name/usr/lib/u-boot/LICENSE
[[ -f Licenses/README ]] && cp Licenses/README $uboot_name/usr/lib/u-boot/LICENSE [[ -f Licenses/README ]] && cp Licenses/README $SRC/.tmp/$uboot_name/usr/lib/u-boot/LICENSE
[[ -f arm-trusted-firmware/license.md ]] && cp arm-trusted-firmware/license.md $uboot_name/usr/lib/u-boot/LICENSE.atf [[ -f arm-trusted-firmware/license.md ]] && cp arm-trusted-firmware/license.md $SRC/.tmp/$uboot_name/usr/lib/u-boot/LICENSE.atf
display_alert "Building deb" "${uboot_name}.deb" "info" display_alert "Building deb" "${uboot_name}.deb" "info"
eval 'dpkg -b $uboot_name 2>&1' ${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/compilation.log'} (cd $SRC/.tmp/; eval 'dpkg -b $uboot_name 2>&1' ${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/compilation.log'})
rm -rf $uboot_name rm -rf $SRC/.tmp/$uboot_name
[[ ! -f ${uboot_name}.deb || $(stat -c '%s' "${uboot_name}.deb") -lt 5000 ]] && exit_with_error "Building u-boot package failed" [[ ! -f $SRC/.tmp/${uboot_name}.deb ]] && exit_with_error "Building u-boot package failed"
mv ${uboot_name}.deb $DEST/debs/ mv $SRC/.tmp/${uboot_name}.deb $DEST/debs/
} }
compile_kernel() compile_kernel()
@@ -443,15 +443,15 @@ 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 $SDCARD/tmp/customize-image.sh
chmod +x $CACHEDIR/$SDCARD/tmp/customize-image.sh chmod +x $SDCARD/tmp/customize-image.sh
mkdir -p $CACHEDIR/$SDCARD/tmp/overlay mkdir -p $SDCARD/tmp/overlay
# 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 $SDCARD/tmp/overlay
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 $LINUXFAMILY $BOARD $BUILD_DESKTOP" chroot $SDCARD /bin/bash -c "/tmp/customize-image.sh $RELEASE $LINUXFAMILY $BOARD $BUILD_DESKTOP"
umount $CACHEDIR/$SDCARD/tmp/overlay umount $SDCARD/tmp/overlay
mountpoint -q $CACHEDIR/$SDCARD/tmp/overlay || rm -r $CACHEDIR/$SDCARD/tmp/overlay mountpoint -q $SDCARD/tmp/overlay || rm -r $SDCARD/tmp/overlay
} }
userpatch_create() userpatch_create()

View File

@@ -62,8 +62,8 @@ SERIALCON=ttyS0
#BOOTFS_TYPE='' #BOOTFS_TYPE=''
# set unique mounting directory # set unique mounting directory
SDCARD="sdcard-${BRANCH}-${BOARD}-${RELEASE}-${BUILD_DESKTOP}" SDCARD="$SRC/.tmp/rootfs-${BRANCH}-${BOARD}-${RELEASE}-${BUILD_DESKTOP}"
MOUNT="mount-${BRANCH}-${BOARD}-${RELEASE}-${BUILD_DESKTOP}" MOUNT="$SRC/.tmp/mount-${BRANCH}-${BOARD}-${RELEASE}-${BUILD_DESKTOP}"
DESTIMG="image-${BRANCH}-${BOARD}-${RELEASE}-${BUILD_DESKTOP}" DESTIMG="image-${BRANCH}-${BOARD}-${RELEASE}-${BUILD_DESKTOP}"
[[ ! -f $SRC/config/sources/$LINUXFAMILY.conf ]] && \ [[ ! -f $SRC/config/sources/$LINUXFAMILY.conf ]] && \

View File

@@ -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 $SDCARD $MOUNT
mkdir -p $CACHEDIR/{$SDCARD,$MOUNT,rootfs} $DEST/images mkdir -p $SDCARD $MOUNT $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=${phymem}M tmpfs $CACHEDIR/$SDCARD [[ $use_tmpfs == yes ]] && mount -t tmpfs -o size=${phymem}M tmpfs $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 $SDCARD/tmp/debs
mount --bind $DEST/debs/ $CACHEDIR/$SDCARD/tmp/debs mount --bind $DEST/debs/ $SDCARD/tmp/debs
install_distribution_specific install_distribution_specific
install_common install_common
@@ -70,19 +70,19 @@ debootstrap_ng()
[[ $EXTERNAL_NEW == prebuilt ]] && chroot_installpackages "yes" [[ $EXTERNAL_NEW == prebuilt ]] && chroot_installpackages "yes"
# cleanup for install_kernel and install_board_specific # cleanup for install_kernel and install_board_specific
umount $CACHEDIR/$SDCARD/tmp/debs umount $SDCARD/tmp/debs
mountpoint -q $CACHEDIR/$SDCARD/tmp/debs || rm -rf $CACHEDIR/$SDCARD/tmp/debs mountpoint -q $SDCARD/tmp/debs || rm -rf $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
# clean up / prepare for making the image # clean up / prepare for making the image
umount_chroot "$CACHEDIR/$SDCARD" umount_chroot "$SDCARD"
post_debootstrap_tweaks post_debootstrap_tweaks
if [[ $ROOTFS_TYPE == fel ]]; then if [[ $ROOTFS_TYPE == fel ]]; then
FEL_ROOTFS=$CACHEDIR/$SDCARD/ FEL_ROOTFS=$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
@@ -91,9 +91,9 @@ debootstrap_ng()
fi fi
# stage: unmount tmpfs # stage: unmount tmpfs
[[ $use_tmpfs = yes ]] && umount $CACHEDIR/$SDCARD [[ $use_tmpfs = yes ]] && umount $SDCARD
rm -rf $CACHEDIR/$SDCARD rm -rf $SDCARD
# remove exit trap # remove exit trap
trap - INT TERM EXIT trap - INT TERM EXIT
@@ -111,7 +111,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" | lz4 -dc | tar xp --xattrs -C $CACHEDIR/$SDCARD/ pv -p -b -r -c -N "$display_name" "$cache_fname" | lz4 -dc | tar xp --xattrs -C $SDCARD/
else else
display_alert "Creating new rootfs for" "$RELEASE" "info" display_alert "Creating new rootfs for" "$RELEASE" "info"
@@ -129,69 +129,69 @@ 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 $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 $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 $SDCARD/usr/bin/
mkdir -p $CACHEDIR/$SDCARD/usr/share/keyrings/ mkdir -p $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 $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 $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 $SDCARD/bin/bash ]] && exit_with_error "Debootstrap base system second stage failed"
mount_chroot "$CACHEDIR/$SDCARD" mount_chroot "$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' > $SDCARD/usr/sbin/policy-rc.d
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg-divert --quiet --local --rename --add /sbin/initctl" chroot $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 $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"' > $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"' > $SDCARD/sbin/initctl
chmod 755 $CACHEDIR/$SDCARD/usr/sbin/policy-rc.d chmod 755 $SDCARD/usr/sbin/policy-rc.d
chmod 755 $CACHEDIR/$SDCARD/sbin/initctl chmod 755 $SDCARD/sbin/initctl
chmod 755 $CACHEDIR/$SDCARD/sbin/start-stop-daemon chmod 755 $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 $SDCARD/etc/locale.gen ]] && sed -i "s/^# $DEST_LANG/$DEST_LANG/" $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 $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 $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 $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 $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 $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" "$SDCARD/"
# stage: add armbian repository and install key # stage: add armbian repository and install key
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" > $SDCARD/etc/apt/sources.list.d/armbian.list
cp $SRC/config/armbian.key $CACHEDIR/$SDCARD cp $SRC/config/armbian.key $SDCARD
eval 'chroot $CACHEDIR/$SDCARD /bin/bash -c "cat armbian.key | apt-key add -"' \ eval 'chroot $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 $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 $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 $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'}
@@ -200,7 +200,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 $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'} \
@@ -210,7 +210,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 $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'} \
@@ -223,23 +223,23 @@ 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 $SDCARD /bin/bash -c "apt-get clean"
# this is needed for the build process later since resolvconf generated file in /run is not saved # this is needed for the build process later since resolvconf generated file in /run is not saved
rm $CACHEDIR/$SDCARD/etc/resolv.conf rm $SDCARD/etc/resolv.conf
echo 'nameserver 8.8.8.8' >> $CACHEDIR/$SDCARD/etc/resolv.conf echo 'nameserver 8.8.8.8' >> $SDCARD/etc/resolv.conf
# 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 "$SDCARD"
tar cp --xattrs --directory=$CACHEDIR/$SDCARD/ --exclude='./dev/*' --exclude='./proc/*' --exclude='./run/*' --exclude='./tmp/*' \ tar cp --xattrs --directory=$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" | lz4 -c > $cache_fname --exclude='./sys/*' . | pv -p -b -r -s $(du -sb $SDCARD/ | cut -f1) -N "$display_name" | lz4 -c > $cache_fname
fi fi
mount_chroot "$CACHEDIR/$SDCARD" mount_chroot "$SDCARD"
} ############################################################################# } #############################################################################
# prepare_partitions # prepare_partitions
@@ -317,7 +317,7 @@ prepare_partitions()
fi fi
# stage: calculate rootfs size # stage: calculate rootfs size
local rootfs_size=$(du -sm $CACHEDIR/$SDCARD/ | cut -f1) # MiB local rootfs_size=$(du -sm $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"
@@ -377,52 +377,52 @@ 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 $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 ${LOOP}p${rootpart} b 259 $rootpart > /dev/null [[ $CONTAINER_COMPAT == yes ]] && mknod -m0660 ${LOOP}p${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-force=zlib" [[ $ROOTFS_TYPE == btrfs ]] && local fscreateopt="-o compress-force=zlib"
mount ${fscreateopt} ${LOOP}p${rootpart} $CACHEDIR/$MOUNT/ mount ${fscreateopt} ${LOOP}p${rootpart} $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" >> $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 ${LOOP}p${bootpart} b 259 $bootpart > /dev/null [[ $CONTAINER_COMPAT == yes ]] && mknod -m0660 ${LOOP}p${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 $MOUNT/boot/
mount ${LOOP}p${bootpart} $CACHEDIR/$MOUNT/boot/ mount ${LOOP}p${bootpart} $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" >> $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" >> $SDCARD/etc/fstab
echo "tmpfs /tmp tmpfs defaults,nosuid 0 0" >> $CACHEDIR/$SDCARD/etc/fstab echo "tmpfs /tmp tmpfs defaults,nosuid 0 0" >> $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 $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" >> $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}" >> $SDCARD/boot/armbianEnv.txt
fi fi
echo "rootfstype=$ROOTFS_TYPE" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt echo "rootfstype=$ROOTFS_TYPE" >> $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/' $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\"/" $SDCARD/boot/$bootscript_dst
fi fi
# if we have boot.ini = remove armbianEnv.txt and add UUID there if enabled # if we have boot.ini = remove armbianEnv.txt and add UUID there if enabled
if [[ -f $CACHEDIR/$SDCARD/boot/boot.ini ]]; then if [[ -f $SDCARD/boot/boot.ini ]]; then
[[ $HAS_UUID_SUPPORT == yes ]] && sed -i 's/^setenv rootdev .*/setenv rootdev "'$rootfs'"/' $CACHEDIR/$SDCARD/boot/boot.ini [[ $HAS_UUID_SUPPORT == yes ]] && sed -i 's/^setenv rootdev .*/setenv rootdev "'$rootfs'"/' $SDCARD/boot/boot.ini
[[ -f $CACHEDIR/$SDCARD/boot/armbianEnv.txt ]] && rm $CACHEDIR/$SDCARD/boot/armbianEnv.txt [[ -f $SDCARD/boot/armbianEnv.txt ]] && rm $SDCARD/boot/armbianEnv.txt
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 $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 $SDCARD/boot/boot.cmd $SDCARD/boot/boot.scr > /dev/null 2>&1
} ############################################################################# } #############################################################################
@@ -440,21 +440,21 @@ create_image()
if [[ $ROOTFS_TYPE != nfs ]]; then if [[ $ROOTFS_TYPE != nfs ]]; then
display_alert "Copying files to root directory" "${SDCARD}.raw" "info" display_alert "Copying files to root directory" "${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 $SDCARD/ $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=$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" | gzip -c > $DEST/images/${version}-rootfs.tgz --exclude='./sys/*' . | pv -p -b -r -s $(du -sb $SDCARD/ | cut -f1) -N "rootfs.tgz" | gzip -c > $DEST/images/${version}-rootfs.tgz
fi fi
# stage: rsync /boot # stage: rsync /boot
display_alert "Copying files to /boot directory" "${SDCARD}.raw" "info" display_alert "Copying files to /boot directory" "${SDCARD}.raw" "info"
if [[ $(findmnt --target $CACHEDIR/$MOUNT/boot -o FSTYPE -n) == vfat ]]; then if [[ $(findmnt --target $MOUNT/boot -o FSTYPE -n) == vfat ]]; then
# fat32 # fat32
rsync -rLtWh --info=progress2,stats1 $CACHEDIR/$SDCARD/boot $CACHEDIR/$MOUNT rsync -rLtWh --info=progress2,stats1 $SDCARD/boot $MOUNT
else else
# ext4 # ext4
rsync -aHWXh --info=progress2,stats1 $CACHEDIR/$SDCARD/boot $CACHEDIR/$MOUNT rsync -aHWXh --info=progress2,stats1 $SDCARD/boot $MOUNT
fi fi
# DEBUG: print free space # DEBUG: print free space
@@ -466,12 +466,12 @@ 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 $MOUNT/boot
[[ $ROOTFS_TYPE != nfs ]] && umount -l $CACHEDIR/$MOUNT [[ $ROOTFS_TYPE != nfs ]] && umount -l $MOUNT
losetup -d $LOOP losetup -d $LOOP
rm -rf --one-file-system $CACHEDIR/$DESTIMG $CACHEDIR/$MOUNT rm -rf --one-file-system $CACHEDIR/$DESTIMG $MOUNT
mkdir -p $CACHEDIR/$DESTIMG mkdir -p $CACHEDIR/$DESTIMG
cp $CACHEDIR/$SDCARD/etc/armbian.txt $CACHEDIR/$DESTIMG cp $SDCARD/etc/armbian.txt $CACHEDIR/$DESTIMG
mv $CACHEDIR/${SDCARD}.raw $CACHEDIR/$DESTIMG/${version}.img mv $CACHEDIR/${SDCARD}.raw $CACHEDIR/$DESTIMG/${version}.img
if [[ $COMPRESS_OUTPUTIMAGE == yes && $BUILD_ALL != yes ]]; then if [[ $COMPRESS_OUTPUTIMAGE == yes && $BUILD_ALL != yes ]]; then
@@ -528,13 +528,13 @@ umount_chroot()
unmount_on_exit() unmount_on_exit()
{ {
trap - INT TERM EXIT trap - INT TERM EXIT
umount_chroot "$CACHEDIR/$SDCARD/" umount_chroot "$SDCARD/"
umount -l $CACHEDIR/$SDCARD/tmp >/dev/null 2>&1 umount -l $SDCARD/tmp >/dev/null 2>&1
umount -l $CACHEDIR/$SDCARD >/dev/null 2>&1 umount -l $SDCARD >/dev/null 2>&1
umount -l $CACHEDIR/$MOUNT/boot >/dev/null 2>&1 umount -l $MOUNT/boot >/dev/null 2>&1
umount -l $CACHEDIR/$MOUNT >/dev/null 2>&1 umount -l $MOUNT >/dev/null 2>&1
losetup -d $LOOP >/dev/null 2>&1 losetup -d $LOOP >/dev/null 2>&1
umount -l $CACHEDIR/$SDCARD/tmp/debs >/dev/null 2>&1 umount -l $SDCARD/tmp/debs >/dev/null 2>&1
rm -rf --one-file-system $CACHEDIR/$SDCARD rm -rf --one-file-system $SDCARD
exit_with_error "debootstrap-ng was interrupted" exit_with_error "debootstrap-ng was interrupted"
} ############################################################################# } #############################################################################

View File

@@ -14,52 +14,52 @@ install_desktop ()
display_alert "Installing desktop" "XFCE" "info" display_alert "Installing desktop" "XFCE" "info"
# add loading desktop splash service # add loading desktop splash service
cp $SRC/packages/blobs/desktop/desktop-splash/desktop-splash.service $CACHEDIR/$SDCARD/etc/systemd/system/desktop-splash.service cp $SRC/packages/blobs/desktop/desktop-splash/desktop-splash.service $SDCARD/etc/systemd/system/desktop-splash.service
if [[ $RELEASE == xenial ]]; then if [[ $RELEASE == xenial ]]; then
# install optimized firefox configuration # install optimized firefox configuration
# cp $SRC/config/firefox.conf $CACHEDIR/$SDCARD/etc/firefox/syspref.js # cp $SRC/config/firefox.conf $SDCARD/etc/firefox/syspref.js
# install optimized chromium configuration # install optimized chromium configuration
cp $SRC/config/chromium.conf $CACHEDIR/$SDCARD/etc/chromium-browser/default cp $SRC/config/chromium.conf $SDCARD/etc/chromium-browser/default
fi fi
# install dedicated startup icons # install dedicated startup icons
cp $SRC/packages/blobs/desktop/icons/${RELEASE}.png $CACHEDIR/$SDCARD/usr/share/pixmaps cp $SRC/packages/blobs/desktop/icons/${RELEASE}.png $SDCARD/usr/share/pixmaps
# install default desktop settings # install default desktop settings
cp -R $SRC/packages/blobs/desktop/skel/. $CACHEDIR/$SDCARD/etc/skel cp -R $SRC/packages/blobs/desktop/skel/. $SDCARD/etc/skel
cp -R $SRC/packages/blobs/desktop/skel/. $CACHEDIR/$SDCARD/root cp -R $SRC/packages/blobs/desktop/skel/. $SDCARD/root
# install wallpapers # install wallpapers
mkdir -p $CACHEDIR/$SDCARD/usr/share/backgrounds/xfce/ mkdir -p $SDCARD/usr/share/backgrounds/xfce/
cp $SRC/packages/blobs/desktop/wallpapers/armbian*.jpg $CACHEDIR/$SDCARD/usr/share/backgrounds/xfce/ cp $SRC/packages/blobs/desktop/wallpapers/armbian*.jpg $SDCARD/usr/share/backgrounds/xfce/
# Install custom icons and theme # Install custom icons and theme
cp $SRC/packages/blobs/desktop/vibrancy-colors_2.4-trusty-Noobslab.com_all.deb $CACHEDIR/$SDCARD/tmp/ cp $SRC/packages/blobs/desktop/vibrancy-colors_2.4-trusty-Noobslab.com_all.deb $SDCARD/tmp/
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/vibrancy-colors_2.4-trusty-Noobslab.com_all.deb >/dev/null 2>&1" chroot $SDCARD /bin/bash -c "dpkg -i /tmp/vibrancy-colors_2.4-trusty-Noobslab.com_all.deb >/dev/null 2>&1"
rm -f $CACHEDIR/$SDCARD/tmp/*.deb rm -f $SDCARD/tmp/*.deb
# Enable network manager # Enable network manager
if [[ -f $CACHEDIR/$SDCARD/etc/NetworkManager/NetworkManager.conf ]]; then if [[ -f $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 $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 $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' >> $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 $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 $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 $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
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 $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 $SDCARD/root/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
# enable memory reservations # enable memory reservations
echo "disp_mem_reserves=on" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt echo "disp_mem_reserves=on" >> $SDCARD/boot/armbianEnv.txt
fi fi
} }

View File

@@ -18,76 +18,76 @@ 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" >> $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" > $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" > $SDCARD/etc/modules
else else
tr ' ' '\n' <<< "$MODULES" > $CACHEDIR/$SDCARD/etc/modules tr ' ' '\n' <<< "$MODULES" > $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/blacklist-${BOARD}.conf tr ' ' '\n' <<< "$MODULES_BLACKLIST_DEV" | sed -e 's/^/blacklist /' > $SDCARD/etc/modprobe.d/blacklist-${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/blacklist-${BOARD}.conf tr ' ' '\n' <<< "$MODULES_BLACKLIST_NEXT" | sed -e 's/^/blacklist /' > $SDCARD/etc/modprobe.d/blacklist-${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/blacklist-${BOARD}.conf tr ' ' '\n' <<< "$MODULES_BLACKLIST" | sed -e 's/^/blacklist /' > $SDCARD/etc/modprobe.d/blacklist-${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 $SDCARD/etc/network/interfaces
mkdir -p $CACHEDIR/$SDCARD/selinux mkdir -p $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 $SDCARD/etc/default/console-setup
# change time zone data # change time zone data
echo $TZDATA > $CACHEDIR/$SDCARD/etc/timezone echo $TZDATA > $SDCARD/etc/timezone
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg-reconfigure -f noninteractive tzdata >/dev/null 2>&1" chroot $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 $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 $SDCARD /bin/bash -c "chage -d 0 root"
# display welcome message at first root login # display welcome message at first root login
touch $CACHEDIR/$SDCARD/root/.not_logged_in_yet touch $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/config/bootscripts/$bootscript_src $CACHEDIR/$SDCARD/boot/$bootscript_dst cp $SRC/config/bootscripts/$bootscript_src $SDCARD/boot/$bootscript_dst
[[ -n $BOOTENV_FILE && -f $SRC/config/bootenv/$BOOTENV_FILE ]] && \ [[ -n $BOOTENV_FILE && -f $SRC/config/bootenv/$BOOTENV_FILE ]] && \
cp $SRC/config/bootenv/$BOOTENV_FILE $CACHEDIR/$SDCARD/boot/armbianEnv.txt cp $SRC/config/bootenv/$BOOTENV_FILE $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 $SDCARD/boot/boot.cmd
else else
cp $SRC/config/templates/nfs-boot.cmd.template $CACHEDIR/$SDCARD/boot/boot.cmd cp $SRC/config/templates/nfs-boot.cmd.template $SDCARD/boot/boot.cmd
fi fi
fi fi
[[ -n $OVERLAY_PREFIX && -f $CACHEDIR/$SDCARD/boot/armbianEnv.txt ]] && \ [[ -n $OVERLAY_PREFIX && -f $SDCARD/boot/armbianEnv.txt ]] && \
echo "overlay_prefix=$OVERLAY_PREFIX" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt echo "overlay_prefix=$OVERLAY_PREFIX" >> $SDCARD/boot/armbianEnv.txt
# 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' > $SDCARD/etc/fake-hwclock.data
echo $HOST > $CACHEDIR/$SDCARD/etc/hostname echo $HOST > $SDCARD/etc/hostname
# set hostname in hosts file # set hostname in hosts file
cat <<-EOF > $CACHEDIR/$SDCARD/etc/hosts cat <<-EOF > $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
@@ -97,79 +97,79 @@ 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 $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 $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 $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 $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 $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 $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 $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 $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 $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 $SDCARD /bin/bash -c "dpkg -i /tmp/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log 2>&1
# freeze armbian packages # freeze armbian packages
if [[ $BSPFREEZE == "yes" ]]; then if [[ $BSPFREEZE == "yes" ]]; then
display_alert "Freeze armbian packages" "$BOARD" "info" display_alert "Freeze armbian packages" "$BOARD" "info"
if [[ "$BRANCH" != "default" ]]; then MINIBRANCH="-"$BRANCH; fi if [[ "$BRANCH" != "default" ]]; then MINIBRANCH="-"$BRANCH; fi
chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-mark hold ${CHOSEN_KERNEL} ${CHOSEN_KERNEL/image/headers} \ chroot $SDCARD /bin/bash -c "apt-mark hold ${CHOSEN_KERNEL} ${CHOSEN_KERNEL/image/headers} \
linux-u-boot-${BOARD}-${BRANCH} linux-dtb${MINIBRANCH}-${LINUXFAMILY}" >> $DEST/debug/install.log 2>&1 linux-u-boot-${BOARD}-${BRANCH} linux-dtb${MINIBRANCH}-${LINUXFAMILY}" >> $DEST/debug/install.log 2>&1
fi fi
# copy boot splash images # copy boot splash images
cp $SRC/packages/blobs/splash/armbian-u-boot.bmp $CACHEDIR/$SDCARD/boot/boot.bmp cp $SRC/packages/blobs/splash/armbian-u-boot.bmp $SDCARD/boot/boot.bmp
cp $SRC/packages/blobs/splash/armbian-desktop.png $CACHEDIR/$SDCARD/boot/boot-desktop.png cp $SRC/packages/blobs/splash/armbian-desktop.png $SDCARD/boot/boot-desktop.png
# execute $LINUXFAMILY-specific tweaks # execute $LINUXFAMILY-specific tweaks
[[ $(type -t family_tweaks) == function ]] && family_tweaks [[ $(type -t family_tweaks) == function ]] && family_tweaks
# enable additional services # enable additional services
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable firstrun.service resize2fs.service armhwinfo.service log2ram.service >/dev/null 2>&1" chroot $SDCARD /bin/bash -c "systemctl --no-reload enable firstrun.service resize2fs.service armhwinfo.service log2ram.service >/dev/null 2>&1"
# copy "first run automated config, optional user configured" # copy "first run automated config, optional user configured"
cp $SRC/config/armbian_first_run.txt $CACHEDIR/$SDCARD/boot/armbian_first_run.txt cp $SRC/config/armbian_first_run.txt $SDCARD/boot/armbian_first_run.txt
# switch to beta repository at this stage if building nightly images # switch to beta repository at this stage if building nightly images
[[ $IMAGE_TYPE == nightly ]] && echo "deb http://beta.armbian.com $RELEASE main utils ${RELEASE}-desktop" > $CACHEDIR/$SDCARD/etc/apt/sources.list.d/armbian.list [[ $IMAGE_TYPE == nightly ]] && echo "deb http://beta.armbian.com $RELEASE main utils ${RELEASE}-desktop" > $SDCARD/etc/apt/sources.list.d/armbian.list
# disable low-level kernel messages for non betas # disable low-level kernel messages for non betas
# TODO: enable only for desktop builds? # TODO: enable only for desktop builds?
if [[ -z $BETA ]]; then if [[ -z $BETA ]]; then
sed -i "s/^#kernel.printk*/kernel.printk/" $CACHEDIR/$SDCARD/etc/sysctl.conf sed -i "s/^#kernel.printk*/kernel.printk/" $SDCARD/etc/sysctl.conf
fi fi
# enable getty on serial console # enable getty on serial console
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@$SERIALCON.service >/dev/null 2>&1" chroot $SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@$SERIALCON.service >/dev/null 2>&1"
[[ $LINUXFAMILY == sun*i ]] && mkdir -p $CACHEDIR/$SDCARD/boot/overlay-user [[ $LINUXFAMILY == sun*i ]] && mkdir -p $SDCARD/boot/overlay-user
# 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 $SDCARD/var/swap
# install initial asound.state if defined # install initial asound.state if defined
mkdir -p $CACHEDIR/$SDCARD/var/lib/alsa/ mkdir -p $SDCARD/var/lib/alsa/
[[ -n $ASOUND_STATE ]] && cp $SRC/config/$ASOUND_STATE $CACHEDIR/$SDCARD/var/lib/alsa/asound.state [[ -n $ASOUND_STATE ]] && cp $SRC/config/$ASOUND_STATE $SDCARD/var/lib/alsa/asound.state
# save initial armbian-release state # save initial armbian-release state
cp $CACHEDIR/$SDCARD/etc/armbian-release $CACHEDIR/$SDCARD/etc/armbian-image-release cp $SDCARD/etc/armbian-release $SDCARD/etc/armbian-image-release
} }
install_distribution_specific() install_distribution_specific()
@@ -178,41 +178,41 @@ install_distribution_specific()
case $RELEASE in case $RELEASE in
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/' $SDCARD/etc/ssh/sshd_config
mkdir -p $CACHEDIR/$SDCARD/etc/NetworkManager/dispatcher.d/ mkdir -p $SDCARD/etc/NetworkManager/dispatcher.d/
cat <<-'EOF' > $CACHEDIR/$SDCARD/etc/NetworkManager/dispatcher.d/99disable-power-management cat <<-'EOF' > $SDCARD/etc/NetworkManager/dispatcher.d/99disable-power-management
#!/bin/sh #!/bin/sh
case "$2" in case "$2" in
up) /sbin/iwconfig $1 power off || true ;; up) /sbin/iwconfig $1 power off || true ;;
down) /sbin/iwconfig $1 power on || true ;; down) /sbin/iwconfig $1 power on || true ;;
esac esac
EOF EOF
chmod 755 $CACHEDIR/$SDCARD/etc/NetworkManager/dispatcher.d/99disable-power-management chmod 755 $SDCARD/etc/NetworkManager/dispatcher.d/99disable-power-management
;; ;;
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/' $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 $SDCARD/etc/legal ]] && rm $SDCARD/etc/legal
# Fix for haveged service # Fix for haveged service
# required only on pre-4.x kernels # required only on pre-4.x kernels
mkdir -p -m755 $CACHEDIR/$SDCARD/etc/systemd/system/haveged.service.d mkdir -p -m755 $SDCARD/etc/systemd/system/haveged.service.d
cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/haveged.service.d/10-no-new-privileges.conf cat <<-EOF > $SDCARD/etc/systemd/system/haveged.service.d/10-no-new-privileges.conf
[Service] [Service]
NoNewPrivileges=false NoNewPrivileges=false
EOF EOF
# 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 ondemand.service ureadahead.service setserial.service etc-setserial.service >/dev/null 2>&1" chroot $SDCARD /bin/bash -c "systemctl --no-reload mask ondemand.service ureadahead.service setserial.service etc-setserial.service >/dev/null 2>&1"
# properly disable powersaving wireless mode for NetworkManager # properly disable powersaving wireless mode for NetworkManager
mkdir -p $CACHEDIR/$SDCARD/etc/NetworkManager/conf.d/ mkdir -p $SDCARD/etc/NetworkManager/conf.d/
cat <<-EOF > $CACHEDIR/$SDCARD/etc/NetworkManager/conf.d/zz-override-wifi-powersave-off.conf cat <<-EOF > $SDCARD/etc/NetworkManager/conf.d/zz-override-wifi-powersave-off.conf
[connection] [connection]
wifi.powersave = 2 wifi.powersave = 2
EOF EOF
@@ -226,11 +226,11 @@ install_distribution_specific()
post_debootstrap_tweaks() post_debootstrap_tweaks()
{ {
# remove service start blockers and QEMU binary # remove service start blockers and QEMU binary
rm -f $CACHEDIR/$SDCARD/sbin/initctl $CACHEDIR/$SDCARD/sbin/start-stop-daemon rm -f $SDCARD/sbin/initctl $SDCARD/sbin/start-stop-daemon
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg-divert --quiet --local --rename --remove /sbin/initctl" chroot $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 $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 $SDCARD/usr/sbin/policy-rc.d $SDCARD/usr/bin/$QEMU_BINARY
# reenable resolvconf managed resolv.conf # reenable resolvconf managed resolv.conf
ln -sf /run/resolvconf/resolv.conf $CACHEDIR/$SDCARD/etc/resolv.conf ln -sf /run/resolvconf/resolv.conf $SDCARD/etc/resolv.conf
} }

View File

@@ -539,7 +539,7 @@ prepare_host()
fi fi
# create directory structure # create directory structure
mkdir -p $DEST/debs/extra $DEST/debug $SRC/userpatches/{overlay,CREATE_PATCHES} $SRC/cache/{sources,toolchains,rootfs} mkdir -p $DEST/debs/extra $DEST/debug $SRC/userpatches/{overlay,CREATE_PATCHES} $SRC/cache/{sources,toolchains,rootfs} $SRC/.tmp
find $SRC/patch -type d ! -name . | sed "s%/patch%/userpatches%" | xargs mkdir -p find $SRC/patch -type d ! -name . | sed "s%/patch%/userpatches%" | xargs mkdir -p
# download external Linaro compiler and missing special dependencies since they are needed for certain sources # download external Linaro compiler and missing special dependencies since they are needed for certain sources

View File

@@ -18,7 +18,7 @@ create_board_package()
{ {
display_alert "Creating board support package" "$BOARD $BRANCH" "info" display_alert "Creating board support package" "$BOARD $BRANCH" "info"
local destination=$DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH} local destination=$SRC/.tmp/${RELEASE}/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}
rm -rf $destination rm -rf $destination
mkdir -p $destination/DEBIAN mkdir -p $destination/DEBIAN
@@ -193,9 +193,9 @@ create_board_package()
# create board DEB file # create board DEB file
display_alert "Building package" "$CHOSEN_ROOTFS" "info" display_alert "Building package" "$CHOSEN_ROOTFS" "info"
cd $DEST/debs/$RELEASE/ (cd $SRC/.tmp/${RELEASE}; dpkg -b $(basename $destination))
dpkg -b ${CHOSEN_ROOTFS}_${REVISION}_${ARCH} >/dev/null mkdir -p $DEST/debs/$RELEASE/
mv ${destination}.deb $DEST/debs/$RELEASE/
# cleanup # cleanup
rm -rf ${CHOSEN_ROOTFS}_${REVISION}_${ARCH} rm -rf $destination
} }

View File

@@ -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 $SDCARD /bin/bash -c "dpkg -i /tmp/debs/armbian-firmware_${REVISION}_${ARCH}.deb" >> $DEST/debug/install.log

View File

@@ -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=$SRC/cache/sources/$LINUXSOURCEDIR/ >> $DEST/debug/compilation.log 2>&1 make -s -j4 ARCH=$ARCHITECTURE CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" LINUX_SRC=$SRC/cache/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 $SDCARD/lib/modules/$VER-$LINUXFAMILY/kernel/net/wireless/
mkdir -p $CACHEDIR/$SDCARD/etc/Wireless/RT2870STA mkdir -p $SDCARD/etc/Wireless/RT2870STA
cp RT2870STA.dat $CACHEDIR/$SDCARD/etc/Wireless/RT2870STA/ cp RT2870STA.dat $SDCARD/etc/Wireless/RT2870STA/
depmod -b $CACHEDIR/$SDCARD/ $VER-$LINUXFAMILY depmod -b $SDCARD/ $VER-$LINUXFAMILY
make -s clean >/dev/null make -s clean >/dev/null
cd .. cd ..
mkdir -p $CACHEDIR/$SDCARD/usr/src/ mkdir -p $SDCARD/usr/src/
cp -R src $CACHEDIR/$SDCARD/usr/src/mt7601-3.0.0.4 cp -R src $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
} }

View File

@@ -52,9 +52,9 @@ install_rtl8192cu()
# GCC5 compatibility patch end # GCC5 compatibility patch end
make ARCH=$ARCHITECTURE CROSS_COMPILE=$KERNEL_COMPILER KSRC=$SRC/cache/sources/$LINUXSOURCEDIR/ >> $DEST/debug/compilation.log make ARCH=$ARCHITECTURE CROSS_COMPILE=$KERNEL_COMPILER KSRC=$SRC/cache/sources/$LINUXSOURCEDIR/ >> $DEST/debug/compilation.log
cp *.ko $CACHEDIR/$SDCARD/lib/modules/$VER-$LINUXFAMILY/kernel/net/wireless/ cp *.ko $SDCARD/lib/modules/$VER-$LINUXFAMILY/kernel/net/wireless/
depmod -b $CACHEDIR/$SDCARD/ $VER-$LINUXFAMILY depmod -b $SDCARD/ $VER-$LINUXFAMILY
#cp blacklist*.conf $CACHEDIR/$SDCARD/etc/modprobe.d/ #cp blacklist*.conf $SDCARD/etc/modprobe.d/
} }
if [[ $BRANCH == default && $ARCHITECTURE == arm ]]; then if [[ $BRANCH == default && $ARCHITECTURE == arm ]]; then

View File

@@ -11,7 +11,7 @@
compile_tools() compile_tools()
{ {
local tmpdir=$CACHEDIR/$SDCARD/root/tools local tmpdir=$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 $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 $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 $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 $SDCARD /bin/bash -c "dpkg -i /tmp/debs/armbian-tools-${RELEASE}_${REVISION}_${ARCH}.deb" >> $DEST/debug/tools-build.log

View File

@@ -39,11 +39,11 @@ install_usb_redirector()
sed -e 's/%DAEMONNAME_TAG%/usbsrvd/g' $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/rc.usbsrvd1 > $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/rc.usbsrvd sed -e 's/%DAEMONNAME_TAG%/usbsrvd/g' $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/rc.usbsrvd1 > $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/rc.usbsrvd
chmod +x $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/rc.usbsrvd chmod +x $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/rc.usbsrvd
# copy to root # copy to root
cp $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/usb* $CACHEDIR/$SDCARD/usr/local/bin/ cp $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/usb* $SDCARD/usr/local/bin/
cp $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/tusbd.ko $CACHEDIR/$SDCARD/usr/local/bin/ cp $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/tusbd.ko $SDCARD/usr/local/bin/
cp $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/rc.usbsrvd $CACHEDIR/$SDCARD/etc/init.d/ cp $SRC/cache/sources/usb-redirector-linux-arm-eabi/files/rc.usbsrvd $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 $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"