From 0dfe17e27c18986485a2ad9127d735bf121f5c8c Mon Sep 17 00:00:00 2001 From: Huan Truong Date: Fri, 2 Mar 2018 22:39:55 -0500 Subject: [PATCH] [script] add components to bump to v0.1.5 v0.1.5 has several exciting changes - Add dumb-suid as a wrapper for suid bash scripts - Fix pulseaudio - Add splash screen - Fix several problems with read-only-fs --- CHANGELOG.md | 25 ++++++++++++++++++++++--- README.md | 22 ++++++++++++---------- make-crankshaft.sh | 3 +++ precompiled/opt/power_off.sh | 4 ++++ precompiled/opt/sleep.sh | 4 ++++ precompiled/opt/splash.png | Bin 0 -> 8793 bytes precompiled/opt/wake_up.sh | 4 ++++ precompiled/pulseaudio_daemon.conf | 10 ++++------ precompiled/splashscreen.service | 12 ++++++++++++ scripts/customize-image-pi.sh | 17 +++++++++++++---- scripts/read-only-fs.sh | 25 ++++++++++++------------- src/dumb_suid/Makefile | 13 +++++++++++++ src/dumb_suid/dumb_suid.c | 24 ++++++++++++++++++++++++ 13 files changed, 127 insertions(+), 36 deletions(-) create mode 100755 precompiled/opt/power_off.sh create mode 100755 precompiled/opt/sleep.sh create mode 100644 precompiled/opt/splash.png create mode 100755 precompiled/opt/wake_up.sh create mode 100644 precompiled/splashscreen.service create mode 100644 src/dumb_suid/Makefile create mode 100644 src/dumb_suid/dumb_suid.c diff --git a/CHANGELOG.md b/CHANGELOG.md index b5b993a3..fd6577bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,21 @@ -Version alpha0.1.0 2018-02-24 +Version alpha0.1.5 2018-03-02 -- -- Initial release. +What's new: + +- Audio has very minimal stuttering: Pulseaudio problem solved +- Crankshaft is now overall much more polished experience +- The "plug phone in" interface has been revamped +- You can turn off the system with the power button +- Park mode (The "car sleep" icon) - Connect phone to wake it up +- Smaller binaries +- Splash screens/no more "rainbow" screen + +Release notes: + +- Qt5 has been rebuilt with many enhancements +- You can use mouse and keyboard (almost...) +- More information on debugging with X11/Wayland to come later Version alpha0.1.1 2018-02-28 -- @@ -19,6 +33,11 @@ What's new: Release notes: - To mount system read/wite, put a jumper on GPIO4/Ground (Pin 07-09) -- Pulseaudio produces choppier audio even compared to previous one when two streams are played at the same time. +- Pulseaudio produces choppier audio even compared to previous one when two streams are played at the same time + +Version alpha0.1.0 2018-02-24 +-- + +- Initial release diff --git a/README.md b/README.md index b320e8f4..26fd1610 100644 --- a/README.md +++ b/README.md @@ -26,22 +26,24 @@ Release Highlights [Full Changelog](https://github.com/htruong/crankshaft/blob/master/CHANGELOG.md) -**Version alpha0.1.1 2018-02-28** +**Version alpha0.1.5 2018-03-02** What's new: -- Raspbian Lite no longer resizes the FS on first time startup -- Faster startup time -- File system is now mounted read only -> Better SD card longevity -- Hopefully less cracks on audio output -- Allows `wpa_supplicant.conf` to be put in `precompiled` -- Allows screen flipping when putting a jumper on GPIO21/Ground - (Pin 39-40 - that's the last row of pins) +- Audio has very minimal stuttering: Pulseaudio problem solved +- Crankshaft is now overall much more polished experience +- The "plug phone in" interface has been revamped +- You can turn off the system with the power button +- Park mode (The "car sleep" icon) - Connect phone to wake it up +- Smaller binaries +- Splash screens/no more "rainbow" screen Release notes: -- To mount system read/wite, put a jumper on GPIO4/Ground (Pin 07-09) -- Pulseaudio produced choppier audio even compared to previous one when two streams are played at the same time. +- Qt5 has been rebuilt with many enhancements +- You can use mouse and keyboard (almost...) +- More information on debugging with X11/Wayland to come later + Want to report a problem? -- diff --git a/make-crankshaft.sh b/make-crankshaft.sh index 84c4f6df..48da8fa3 100755 --- a/make-crankshaft.sh +++ b/make-crankshaft.sh @@ -135,6 +135,7 @@ set_up_loopdevs() { mkdir ${TEMP_CHROOT_DIR}/usr/local/lib/ mkdir ${TEMP_CHROOT_DIR}/etc/pulse/ mkdir ${TEMP_CHROOT_DIR}/etc/wpa_supplicant/ + mkdir ${TEMP_CHROOT_DIR}/opt/crankshaft/ cp precompiled/autoapp ${TEMP_CHROOT_DIR}/usr/local/bin/ cp precompiled/libaasdk.so ${TEMP_CHROOT_DIR}/usr/local/lib/ @@ -144,6 +145,8 @@ set_up_loopdevs() { cp precompiled/autoapp.service ${TEMP_CHROOT_DIR}/etc/systemd/system/ cp precompiled/autoapp_brightness.service ${TEMP_CHROOT_DIR}/etc/systemd/system/ + cp precompiled/splashscreen.service ${TEMP_CHROOT_DIR}/etc/systemd/system/ + cp precompiled/opt/* ${TEMP_CHROOT_DIR}/opt/crankshaft/ cp precompiled/openauto.rules ${TEMP_CHROOT_DIR}/etc/udev/rules.d/ diff --git a/precompiled/opt/power_off.sh b/precompiled/opt/power_off.sh new file mode 100755 index 00000000..e68e57a8 --- /dev/null +++ b/precompiled/opt/power_off.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sleep 3 +shutdown -h now diff --git a/precompiled/opt/sleep.sh b/precompiled/opt/sleep.sh new file mode 100755 index 00000000..84531381 --- /dev/null +++ b/precompiled/opt/sleep.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo 1 > /sys/class/backlight/rpi_backlight/bl_power +vcgencmd display_power 0 diff --git a/precompiled/opt/splash.png b/precompiled/opt/splash.png new file mode 100644 index 0000000000000000000000000000000000000000..cd8702576bd4620f145a4d284f32ba6dd13e7a85 GIT binary patch literal 8793 zcmdsdcQjmI`|n_sNQe+61QS9;FVWlREeILC1%nLH`zY}xTC_gnJF(s8$UaWZzYhX#B1 zJ1G#Qp2HyKe&+g*MfJVZoSwt9;XY1J;RX;#xSOLaluKC&q!1)WBye}~vj+vazwq#t3sU6zC$Ai_ z|7Ti+3-nKjpPM4rzl<{1e*#kT^l<`73QGt%ii(MWq@;w!9!W|`i3x(lMa9HLM2VM_ zkk}(RNhvvTY0$qL7g3uJ)LG70UGv|%h$BU==YD=(av~yufq}w-62hK7E+S&Gva)|T z#Knb(2qE8K4?p`LArD{fzZuk>d>wsYUVbo756~Y*dk0T{KSeI0rT=ol-AiBpzlc42 z{~ah|$V7tdy+p)>MMd1*|M>M!w6CAB)BiN%Kcamh!Cp=x#!kMT{yvVx^>F6?TbLNT z|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Q^(7>CkVoVXKu5zs Ky;AjA /sys/class/backlight/rpi_backlight/bl_power diff --git a/precompiled/pulseaudio_daemon.conf b/precompiled/pulseaudio_daemon.conf index 7aa15523..3991c2df 100644 --- a/precompiled/pulseaudio_daemon.conf +++ b/precompiled/pulseaudio_daemon.conf @@ -1,7 +1,5 @@ - -default-fragments = 2 -default-fragment-size-msec = 5 -deferred-volume-safety-margin-usec = 1 -; flat-volumes = no -realtime-scheduling = no +default-sample-rate = 48000 +resample-method = speex-fixed-1 +default-fragments = 10 +default-fragment-size-msec = 10 diff --git a/precompiled/splashscreen.service b/precompiled/splashscreen.service new file mode 100644 index 00000000..0f132473 --- /dev/null +++ b/precompiled/splashscreen.service @@ -0,0 +1,12 @@ +[Unit] +Description=Splash screen +DefaultDependencies=no +After=local-fs.target + +[Service] +ExecStart=/usr/bin/fbi -d /dev/fb0 --noverbose -a /opt/crankshaft/splash.png +StandardInput=tty +StandardOutput=tty + +[Install] +WantedBy=sysinit.target diff --git a/scripts/customize-image-pi.sh b/scripts/customize-image-pi.sh index 7acae3a8..75ec1033 100755 --- a/scripts/customize-image-pi.sh +++ b/scripts/customize-image-pi.sh @@ -23,7 +23,7 @@ print_banner() { get_deps() { apt update #apt upgrade - apt install -y libprotobuf10 libpulse0 libboost-log1.62.0 libboost-test1.62.0 libboost-thread1.62.0 libboost-date-time1.62.0 libboost-chrono1.62.0 libboost-atomic1.62.0 libpulse-mainloop-glib0 libfontconfig1 pulseaudio + apt install -y libprotobuf10 libpulse0 libboost-log1.62.0 libboost-test1.62.0 libboost-thread1.62.0 libboost-date-time1.62.0 libboost-chrono1.62.0 libboost-atomic1.62.0 libpulse-mainloop-glib0 libfontconfig1 libinput10 libxkbcommon0 pulseaudio fbi apt clean #update raspi firmware SKIP_WARNING=1 rpi-update @@ -35,15 +35,23 @@ mark_script_run() { house_keeping() { # we don't need to resize the root part - sed -i 's/ quiet init\=.*$//' /boot/cmdline.txt - + sed -i 's/ init\=.*$//' /boot/cmdline.txt + echo "disable_splash=1" >> /boot/config.txt + + # make sure everything has the right owner chown -R root:staff /usr/local/ + chown -R root:staff /opt/crankshaft/ chown root:staff /etc/systemd/system/autoapp.service chown root:staff /etc/systemd/system/autoapp_brightness.service + chown root:staff /etc/systemd/system/splashscreen.service chown root:staff /etc/udev/rules.d/openauto.rules - #chown root:staff /etc/pulse/daemon.conf + cat /root/pulseaudio_daemon.conf >> /etc/pulse/daemon.conf + + chmod u+s /opt/crankshaft/dumb_suid + + sed -i 's/load-module module-udev-detect/load-module module-udev-detect tsched=0/' /etc/pulse/default.pa if [ -f /etc/wpa_supplicant/wpa_supplicant.conf ]; then chown root:staff /etc/wpa_supplicant/wpa_supplicant.conf @@ -52,6 +60,7 @@ house_keeping() { fi # enable the startup actions + systemctl enable splashscreen.service systemctl enable autoapp.service systemctl enable autoapp_brightness.service diff --git a/scripts/read-only-fs.sh b/scripts/read-only-fs.sh index 3e0211f3..09d59efa 100644 --- a/scripts/read-only-fs.sh +++ b/scripts/read-only-fs.sh @@ -1,6 +1,7 @@ #!/bin/bash # CREDIT TO THESE TUTORIALS: +# Ladyada's readonly fs script # petr.io/en/blog/2015/11/09/read-only-raspberry-pi-with-jessie # hallard.me/raspberry-pi-read-only # k3a.me/how-to-make-raspberrypi-truly-read-only-reliable-and-trouble-free @@ -113,16 +114,14 @@ echo "Removing unwanted packages..." # dphys-swapfile xserver-common lightdm fake-hwclock # Let's keep dbus...that includes avahi-daemon, a la 'raspberrypi.local', # also keeping xserver & lightdm for GUI login (WIP, not working yet) -apt-get remove -y --force-yes --purge triggerhappy cron logrotate \ +apt-get remove -y --force-yes --purge triggerhappy \ dphys-swapfile fake-hwclock apt-get -y --force-yes autoremove --purge -# Replace log management with busybox (use logread if needed) -echo "Installing busybox-syslogd..." -apt-get -y --force-yes install busybox-syslogd; dpkg --purge rsyslog - echo "Configuring system..." +sed -i "s/#Storage=auto/Storage=volatile/" /etc/systemd/journald.conf + # Install boot-time R/W jumper test if requested if [ $INSTALL_RW_JUMPER -ne 0 ]; then apt-get install -y --force-yes wiringpi @@ -146,14 +145,14 @@ if [ \`gpio -g read $INVERT_PIN\` -eq 0 ] ; then echo "lcd_rotate=2" >> /boot/config.txt reboot fi -else - grep "lcd_rotate=2" /boot/config.txt >/dev/null - if [ \$? -eq 0 ]; then - # There, need to restore - mount -o remount,rw /boot - sed -i 's/^lcd_rotate=2//g' /boot/config.txt - reboot - fi +#else +# grep "lcd_rotate=2" /boot/config.txt >/dev/null +# if [ \$? -eq 0 ]; then +# # There, need to restore +# mount -o remount,rw /boot +# sed -i 's/^lcd_rotate=2//g' /boot/config.txt +# reboot +# fi fi exit 0 EOF diff --git a/src/dumb_suid/Makefile b/src/dumb_suid/Makefile new file mode 100644 index 00000000..666b59b1 --- /dev/null +++ b/src/dumb_suid/Makefile @@ -0,0 +1,13 @@ +CC=gcc +CFLAGS=-I. -O3 +PROG=dumb_suid + +all: $(PROG) + +$(PROG): $(PROG).c + $(CC) $(CFLAGS) -o $(PROG) $(PROG).c + +.PHONY: clean + +clean: + rm $(PROG) diff --git a/src/dumb_suid/dumb_suid.c b/src/dumb_suid/dumb_suid.c new file mode 100644 index 00000000..f4fccaf7 --- /dev/null +++ b/src/dumb_suid/dumb_suid.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include + +// HACK: Will fix later +// +// This program is a wrapper to suid scripts in /opt/crankshaft +// Because we can't suid the bash scripts +// +// This is probably a dumb and dangerous idea but it works for now + +int main( int argc, char **argv ) +{ + setuid( 0 ); + char scriptname[50]; + strcpy (scriptname, "/opt/crankshaft/"); + strncat(scriptname, argv[1], 50); + printf("Executing '%s' with suid 0!\n", scriptname); + system( scriptname ); + + return 0; +}