Adding rc.local to Stretch - it might be useful to have it by default, few small desktop related fixes, removing hardware lirc conf for Stretch / sun7i only for now

This commit is contained in:
Igor Pecovnik 2017-08-20 23:03:49 +02:00
parent 0ef5e2ed6d
commit ce1dcf7146
3 changed files with 34 additions and 12 deletions

View File

@ -31,14 +31,16 @@ CPUMIN=480000
family_tweaks()
{
# TODO: replace with udev rule
# default lirc configuration
sed -i '1i sed -i \x27s/DEVICE="\\/dev\\/input.*/DEVICE="\\/dev\\/input\\/\x27$str\x27"/g\x27 /etc/lirc/hardware.conf' \
$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)' \
$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 $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 $SDCARD/etc/lirc/lircd.conf
if [[ "${RELEASE}" != "stretch" ]]; then
# TODO: replace with udev rule
# default lirc configuration
sed -i '1i sed -i \x27s/DEVICE="\\/dev\\/input.*/DEVICE="\\/dev\\/input\\/\x27$str\x27"/g\x27 /etc/lirc/hardware.conf' \
$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)' \
$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 $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 $SDCARD/etc/lirc/lircd.conf
fi
}

View File

@ -20,13 +20,15 @@ install_desktop ()
# install optimized chromium configuration
cp $SRC/config/chromium.conf $SDCARD/etc/chromium-browser/default
fi
# install dedicated startup icons
cp $SRC/packages/blobs/desktop/icons/${DISTRIBUTION}.png $SDCARD/usr/share/pixmaps
# install default desktop settings
cp -R $SRC/packages/blobs/desktop/skel/. $SDCARD/etc/skel
cp -R $SRC/packages/blobs/desktop/skel/. $SDCARD/root
# install dedicated startup icons
cp $SRC/packages/blobs/desktop/icons/${DISTRIBUTION,,}.png $SDCARD/usr/share/pixmaps
sed 's/xenial.png/'${DISTRIBUTION,,}'.png/' -i $SDCARD/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
# install wallpapers
mkdir -p $SDCARD/usr/share/backgrounds/xfce/
cp $SRC/packages/blobs/desktop/wallpapers/armbian*.jpg $SDCARD/usr/share/backgrounds/xfce/

View File

@ -190,6 +190,24 @@ install_distribution_specific()
stretch)
# remove doubled uname from motd
[[ -f $SDCARD/etc/update-motd.d/10-uname ]] && rm $SDCARD/etc/update-motd.d/10-uname
# rc.local is not existing in stretch but we might need it
cat <<-EOF >$SDCARD/etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
EOF
chroot $SDCARD /bin/bash -c "chmod +x /etc/rc.local; systemctl daemon-reload"
;;
esac
}