From 64a14a749f5c4d199a2764a111b3d1ad1fb206c5 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 19 Jan 2017 19:58:51 +0200 Subject: [PATCH 01/91] Add dride install script --- stage2/03-dride/00-run.sh | 5 +++++ stage2/{03-cleanup => 04-cleanup}/00-run.sh | 0 2 files changed, 5 insertions(+) create mode 100755 stage2/03-dride/00-run.sh rename stage2/{03-cleanup => 04-cleanup}/00-run.sh (100%) diff --git a/stage2/03-dride/00-run.sh b/stage2/03-dride/00-run.sh new file mode 100755 index 0000000..ba14d73 --- /dev/null +++ b/stage2/03-dride/00-run.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +on_chroot << EOF +bash -c "$(curl -s https://dride.io/code/install.sh)" +EOF diff --git a/stage2/03-cleanup/00-run.sh b/stage2/04-cleanup/00-run.sh similarity index 100% rename from stage2/03-cleanup/00-run.sh rename to stage2/04-cleanup/00-run.sh From 39a0952d3c6333d47ec6f0aa4e4f3fadc7d2efaa Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 22 Jan 2017 20:41:19 +0200 Subject: [PATCH 02/91] Add install script [Dirty] --- stage2/01-sys-tweaks/01-run.sh | 229 +++++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 69fa107..6e66d40 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -38,3 +38,232 @@ usermod --pass='*' root EOF rm -f ${ROOTFS_DIR}/etc/ssh/ssh_host_*_key* + +on_chroot << EOF + + +#------------------------------------------------------- +# Script to check if all is good before install script runs +#------------------------------------------------------- + +echo "====== Dride install script ======" +echo "" +echo "" +echo "" +echo "██████╗ ██████╗ ██╗██████╗ ███████╗" +echo "██╔══██╗██╔══██╗██║██╔══██╗██╔════╝" +echo "██║ ██║██████╔╝██║██║ ██║█████╗ " +echo "██║ ██║██╔══██╗██║██║ ██║██╔══╝ " +echo "██████╔╝██║ ██║██║██████╔╝███████╗" +echo "╚═════╝ ╚═╝ ╚═╝╚═╝╚═════╝ ╚══════╝" +echo "" +echo "" +echo "This will install all the necessary dependences and software for dride." +echo "=======================================================" +echo "" +echo "" + + + +echo "" +echo "" +echo "===============================" +echo "*******************************" +echo " *** STARTING INSTALLATION ***" +echo " ** this may take a while **" +echo " *************************" +echo " =========================" +echo "" +echo "" + + + +cd /home + +# Install dependencies +echo "========== Update Aptitude ===========" +sudo apt-get update -y +# sudo apt-get upgrade + +echo "========== Installing build-essential ============" +sudo apt-get install build-essential -y + +echo "========== Installing libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev ============" +sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev -y + +echo "========== Installing pip ============" +sudo wget https://bootstrap.pypa.io/get-pip.py +sudo chmod +x get-pip.py +sudo python get-pip.py + +echo "========== Installing Numpy ============" +sudo pip install numpy + + +echo "========== Downloading and installing OpenCV ============" +cd / +# git clone https://github.com/Itseez/opencv.git --depth 1 +wget -c -O "opencv-3.1.0.zip" "https://github.com/Itseez/opencv/archive/3.1.0.zip" +sudo apt-get install unzip +unzip -q -n "opencv-3.1.0.zip" + +cd opencv-3.1.0 +echo "==>>>====== Building OpenCV ============" +cd /home/opencv-3.1.0 +mkdir build +cd build +cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D CMAKE_INSTALL_PREFIX=/usr/local .. +echo "==>>>====== This might take a long time.. ============" +make -j1 + +sudo make install +sudo ldconfig + +# remove the installation file + + + +# Install Node +echo "========== Installing Node ============" +sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb +sudo dpkg -i node_latest_armhf.deb + + + +# TODO: Add a test if openCV was installed correctly + +echo "========== Install Dride-core [Cardigan] ============" +cd /home +sudo git clone --depth 1 --recursive https://github.com/CardiganCam/Cardigan.git +cd Cardigan + +# make the video dir writable +sudo chmod 777 -R modules/video/ + + +echo "========== Install picamera ============" +sudo pip install "picamera[array]" +# enable camera on raspi-config +grep "start_x=1" /boot/config.txt +if grep "start_x=1" /boot/config.txt +then + echo "Already enabled." +else + sed -i "s/start_x=0/start_x=1/g" /boot/config.txt + reboot +fi + +echo "========== Install omxplayer ============" +sudo apt-get install omxplayer -y + + +# Install WIFi +sudo apt-get install hostapd isc-dhcp-server -y +sudo apt-get install iptables-persistent -y + +cd /home +# get the dhcpd config file +sudo wget https://dride.io/code/dhcpd.conf + +sudo cp dhcpd.conf /etc/dhcp/dhcpd.conf +sudo rm dhcpd.conf + + +sudo bash -c 'echo "INTERFACES=\"wlan0\""> /etc/default/isc-dhcp-server' + +sudo ifdown wlan0 + + +sudo wget https://dride.io/code/interfaces + +sudo cp interfaces /etc/network/interfaces +sudo rm interfaces + + +sudo ifconfig wlan0 192.168.42.1 + + +sudo wget https://dride.io/code/hostapd.conf + +sudo cp hostapd.conf /etc/hostapd/hostapd.conf +sudo rm hostapd.conf + +sudo bash -c 'echo "DAEMON_CONF=\"/etc/hostapd/hostapd.conf\""> /etc/default/hostapd' + +sudo wget https://dride.io/code/hostapd + +sudo cp hostapd /etc/init.d/hostapd +sudo rm hostapd + + +sudo bash -c 'echo "net.ipv4.ip_forward=1"> /etc/sysctl.conf' +sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" + +sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE +sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT +sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT + + +sudo sh -c "iptables-save > /etc/iptables/rules.v4" + +sudo mv /usr/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service ~/ + + +sudo service hostapd start +sudo service isc-dhcp-server start +sudo update-rc.d hostapd enable +sudo update-rc.d isc-dhcp-server enable + + +# dride-ws +cd /home/Cardigan/dride-ws +sudo npm i + + +sudo wget https://dride.io/code/startup/dride-ws +sudo wget https://dride.io/code/startup/dride-core + +#startup script's + +# express on startup +sudo cp dride-ws /etc/init.d/dride-ws +sudo chmod +x /etc/init.d/dride-ws +sudo update-rc.d dride-ws defaults + + +sudo rm dride-ws + +# dride-core on startup +sudo cp dride-core /etc/init.d/dride-core +sudo chmod +x /etc/init.d/dride-core +sudo update-rc.d dride-core defaults +sudo rm dride-core + + + + + + + + + + + + + + + + + + + +echo "" +echo '=============================' +echo '*****************************' +echo '========= Finished ==========' +echo '*****************************' +echo '=============================' +echo "" + + +EOF \ No newline at end of file From a71ba92e59c630c5e7142ade55e99e8ea3790565 Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 22 Jan 2017 20:54:10 +0200 Subject: [PATCH 03/91] Add config OS name --- .gitignore | 1 - config | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 config diff --git a/.gitignore b/.gitignore index ec91fd6..a1d03a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ deploy/* work/* -config SKIP .pc *-pc diff --git a/config b/config new file mode 100644 index 0000000..d94e3f7 --- /dev/null +++ b/config @@ -0,0 +1 @@ +IMG_NAME=drideOS \ No newline at end of file From 6c10b3679416fafce01110da3b175d3edb09f82e Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 23 Jan 2017 19:43:42 +0200 Subject: [PATCH 04/91] fixes for drideOS --- stage2/01-sys-tweaks/01-run.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 6e66d40..a669085 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -14,7 +14,7 @@ on_chroot << EOF systemctl disable hwclock.sh systemctl disable nfs-common systemctl disable rpcbind -systemctl disable ssh +systemctl enable ssh systemctl enable regenerate_ssh_host_keys systemctl enable apply_noobs_os_config systemctl enable resize2fs_once @@ -120,7 +120,8 @@ sudo make install sudo ldconfig # remove the installation file - +cd / +sudo rm opencv-3.1.0.zip # Install Node @@ -140,18 +141,22 @@ cd Cardigan # make the video dir writable sudo chmod 777 -R modules/video/ +# clone dride-ws +cd dride-ws +sudo git clone --depth 1 https://github.com/dride/dride-ws.git + +cd / + + + echo "========== Install picamera ============" sudo pip install "picamera[array]" # enable camera on raspi-config -grep "start_x=1" /boot/config.txt -if grep "start_x=1" /boot/config.txt -then - echo "Already enabled." -else - sed -i "s/start_x=0/start_x=1/g" /boot/config.txt - reboot -fi +echo "" >> /boot/config.txt +echo "#enable piCaera" >> /boot/config.txt +echo "start_x=1" >> /boot/config.txt + echo "========== Install omxplayer ============" sudo apt-get install omxplayer -y From 1ffce90c3e23b82640f49d5e5d21ea611c16525d Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 23 Jan 2017 19:57:49 +0200 Subject: [PATCH 05/91] dride-ws from a zip --- stage2/01-sys-tweaks/01-run.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index a669085..9504842 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -142,9 +142,24 @@ cd Cardigan sudo chmod 777 -R modules/video/ # clone dride-ws -cd dride-ws -sudo git clone --depth 1 https://github.com/dride/dride-ws.git +cd /home/Cardigan +sudo rm -R dride-ws +sudo mkdir dride-ws +cd dride-ws +wget -c -O "dride-ws-0.1.4.zip" "https://github.com/dride/dride-ws/archive/0.1.4.zip" +sudo apt-get install unzip +unzip -q -n "dride-ws-0.1.4.zip" + +sudo rm dride-ws-0.1.4.zip + +cd dride-ws-0.1.4 +find . -maxdepth 1 -exec mv {} .. \; + +cd /home/Cardigan/dride-ws +sudo rm dride-ws-0.1.4 +sudo rm npmbox.npmbox +sudo npm i cd / @@ -220,10 +235,6 @@ sudo update-rc.d hostapd enable sudo update-rc.d isc-dhcp-server enable -# dride-ws -cd /home/Cardigan/dride-ws -sudo npm i - sudo wget https://dride.io/code/startup/dride-ws sudo wget https://dride.io/code/startup/dride-core From 272e8091e4c4f4ab8a0d81505d5b0997a4917b4c Mon Sep 17 00:00:00 2001 From: Yossi Date: Tue, 24 Jan 2017 16:30:32 +0200 Subject: [PATCH 06/91] Add git to the packages installed --- stage2/01-sys-tweaks/01-run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 9504842..ded2657 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -88,6 +88,10 @@ sudo apt-get update -y echo "========== Installing build-essential ============" sudo apt-get install build-essential -y +echo "========== Installing git ============" +sudo apt-get install git -y + + echo "========== Installing libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev ============" sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev -y From 435f481dc9dd2d5fe3ffdff3be31b064dbfa1e55 Mon Sep 17 00:00:00 2001 From: Yossi Date: Tue, 24 Jan 2017 22:20:57 +0200 Subject: [PATCH 07/91] use zipped package instead of git clone for Cardigan --- stage2/01-sys-tweaks/01-run.sh | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index ded2657..fdd9547 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -139,30 +139,20 @@ sudo dpkg -i node_latest_armhf.deb echo "========== Install Dride-core [Cardigan] ============" cd /home -sudo git clone --depth 1 --recursive https://github.com/CardiganCam/Cardigan.git -cd Cardigan +# https://github.com/dride/Cardigan/archive/0.2.zip +wget -c -O "cardigan-0.2.zip" "https://github.com/dride/Cardigan/releases/download/0.2/Cardigan.zip" +sudo apt-get install unzip +unzip -q -n "cardigan-0.2.zip" + +sudo rm cardigan-0.2.zip + # make the video dir writable -sudo chmod 777 -R modules/video/ +sudo chmod 777 -R /home/Cardigan/modules/video/ # clone dride-ws -cd /home/Cardigan -sudo rm -R dride-ws - -sudo mkdir dride-ws -cd dride-ws -wget -c -O "dride-ws-0.1.4.zip" "https://github.com/dride/dride-ws/archive/0.1.4.zip" -sudo apt-get install unzip -unzip -q -n "dride-ws-0.1.4.zip" - -sudo rm dride-ws-0.1.4.zip - -cd dride-ws-0.1.4 -find . -maxdepth 1 -exec mv {} .. \; - cd /home/Cardigan/dride-ws -sudo rm dride-ws-0.1.4 -sudo rm npmbox.npmbox + sudo npm i cd / From ee041195015495ce32b7a172719768fb9e8c5e13 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 25 Jan 2017 14:53:11 +0200 Subject: [PATCH 08/91] remove stage 3 & 4 --- stage2/EXPORT_NOOBS | 0 stage3/00-install-packages/00-debconf | 2 -- stage3/00-install-packages/00-packages | 10 ------ stage3/00-install-packages/00-packages-nr | 6 ---- stage3/00-install-packages/01-run.sh | 9 ------ stage3/01-tweaks/00-run.sh | 3 -- stage3/prerun.sh | 4 --- stage4/00-install-packages/00-debconf | 4 --- stage4/00-install-packages/00-packages | 37 ----------------------- stage4/00-install-packages/00-packages-nr | 3 -- stage4/00-install-packages/01-run.sh | 3 -- stage4/01-console-autologin/00-run.sh | 3 -- stage4/02-extras/00-run.sh | 33 -------------------- stage4/02-extras/files/.gitignore | 2 -- stage4/03-cleanup/00-run.sh | 5 --- stage4/EXPORT_IMAGE | 0 stage4/EXPORT_NOOBS | 0 stage4/prerun.sh | 4 --- 18 files changed, 128 deletions(-) delete mode 100644 stage2/EXPORT_NOOBS delete mode 100644 stage3/00-install-packages/00-debconf delete mode 100644 stage3/00-install-packages/00-packages delete mode 100644 stage3/00-install-packages/00-packages-nr delete mode 100755 stage3/00-install-packages/01-run.sh delete mode 100755 stage3/01-tweaks/00-run.sh delete mode 100755 stage3/prerun.sh delete mode 100644 stage4/00-install-packages/00-debconf delete mode 100644 stage4/00-install-packages/00-packages delete mode 100644 stage4/00-install-packages/00-packages-nr delete mode 100755 stage4/00-install-packages/01-run.sh delete mode 100755 stage4/01-console-autologin/00-run.sh delete mode 100755 stage4/02-extras/00-run.sh delete mode 100644 stage4/02-extras/files/.gitignore delete mode 100755 stage4/03-cleanup/00-run.sh delete mode 100644 stage4/EXPORT_IMAGE delete mode 100644 stage4/EXPORT_NOOBS delete mode 100755 stage4/prerun.sh diff --git a/stage2/EXPORT_NOOBS b/stage2/EXPORT_NOOBS deleted file mode 100644 index e69de29..0000000 diff --git a/stage3/00-install-packages/00-debconf b/stage3/00-install-packages/00-debconf deleted file mode 100644 index 7dbd12e..0000000 --- a/stage3/00-install-packages/00-debconf +++ /dev/null @@ -1,2 +0,0 @@ -# Adobe Flash Player. Copyright 1996-2015. Adobe Systems Incorporated. All Rights Reserved. -rpi-chromium-mods rpi-chromium-mods/adobe note diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages deleted file mode 100644 index 2ed3b2a..0000000 --- a/stage3/00-install-packages/00-packages +++ /dev/null @@ -1,10 +0,0 @@ -gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav -xpdf gtk2-engines alsa-utils -desktop-base -git-core rpi-update -omxplayer -raspberrypi-artwork -policykit-1 -gvfs -rfkill -chromium-browser rpi-chromium-mods diff --git a/stage3/00-install-packages/00-packages-nr b/stage3/00-install-packages/00-packages-nr deleted file mode 100644 index 3915e3a..0000000 --- a/stage3/00-install-packages/00-packages-nr +++ /dev/null @@ -1,6 +0,0 @@ -xserver-xorg-video-fbdev xserver-xorg xinit xserver-xorg-video-fbturbo -epiphany-browser -lxde lxtask menu-xdg gksu -netsurf-gtk zenity xdg-utils -gvfs-backends gvfs-fuse -lightdm gnome-themes-standard-data gnome-icon-theme diff --git a/stage3/00-install-packages/01-run.sh b/stage3/00-install-packages/01-run.sh deleted file mode 100755 index 871f4bc..0000000 --- a/stage3/00-install-packages/01-run.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -e - -on_chroot << EOF -update-alternatives --install /usr/bin/x-www-browser \ - x-www-browser /usr/bin/chromium-browser 86 -update-alternatives --install /usr/bin/gnome-www-browser \ - gnome-www-browser /usr/bin/chromium-browser 86 -EOF - diff --git a/stage3/01-tweaks/00-run.sh b/stage3/01-tweaks/00-run.sh deleted file mode 100755 index f64961c..0000000 --- a/stage3/01-tweaks/00-run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -e - -rm -f ${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/wait.conf diff --git a/stage3/prerun.sh b/stage3/prerun.sh deleted file mode 100755 index a5ea5f4..0000000 --- a/stage3/prerun.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -e -if [ ! -d ${ROOTFS_DIR} ]; then - copy_previous -fi diff --git a/stage4/00-install-packages/00-debconf b/stage4/00-install-packages/00-debconf deleted file mode 100644 index 9b65dda..0000000 --- a/stage4/00-install-packages/00-debconf +++ /dev/null @@ -1,4 +0,0 @@ -# Enable realtime process priority? -jackd2 jackd/tweak_rt_limits boolean true -# Do you accept the Wolfram - Raspberry Pi® Bundle License Agreement? -wolfram-engine shared/accepted-wolfram-eula boolean true diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages deleted file mode 100644 index 0b5859b..0000000 --- a/stage4/00-install-packages/00-packages +++ /dev/null @@ -1,37 +0,0 @@ -java-common oracle-java8-jdk -libreoffice-sdbc-hsqldb -sonic-pi -python idle python3-pygame python-pygame python-tk -python3 idle3 python3-tk -python3-pgzero -python-serial python3-serial -python-picamera python3-picamera -debian-reference-en dillo x2x -wolfram-engine -raspberrypi-net-mods raspberrypi-ui-mods -smartsim penguinspuzzle -python-pip python3-pip -python3-numpy -pypy -python3-pifacecommon python3-pifacedigitalio python3-pifacedigital-scratch-handler python-pifacecommon python-pifacedigitalio -minecraft-pi python-minecraftpi -alacarte rc-gui sense-hat -claws-mail -tree -scratch nuscratch -greenfoot bluej -nodered -libgl1-mesa-dri libgles1-mesa libgles2-mesa xcompmgr -geany -piclone -pulseaudio-module-bluetooth -wiringpi pigpio python-pigpio python3-pigpio raspi-gpio python-gpiozero python3-gpiozero python3-rpi.gpio -python-spidev python3-spidev -realvnc-vnc-server realvnc-vnc-viewer -python-twython python3-twython -python-smbus python3-smbus -python-flask python3-flask -python-picraft python3-picraft -python3-codebug-tether python3-codebug-i2c-tether -python-sense-emu python3-sense-emu sense-emu-tools python-sense-emu-doc -pprompt diff --git a/stage4/00-install-packages/00-packages-nr b/stage4/00-install-packages/00-packages-nr deleted file mode 100644 index aac3603..0000000 --- a/stage4/00-install-packages/00-packages-nr +++ /dev/null @@ -1,3 +0,0 @@ -libreoffice libreoffice-gtk -timidity -pi-package diff --git a/stage4/00-install-packages/01-run.sh b/stage4/00-install-packages/01-run.sh deleted file mode 100755 index 8f215d1..0000000 --- a/stage4/00-install-packages/01-run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -e - -rm -f "${ROOTFS_DIR}/root/.vnc/private.key" diff --git a/stage4/01-console-autologin/00-run.sh b/stage4/01-console-autologin/00-run.sh deleted file mode 100755 index 11ee373..0000000 --- a/stage4/01-console-autologin/00-run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -e - -ln -sf /etc/systemd/system/autologin@.service ${ROOTFS_DIR}/etc/systemd/system/getty.target.wants/getty@tty1.service diff --git a/stage4/02-extras/00-run.sh b/stage4/02-extras/00-run.sh deleted file mode 100755 index 23df1d7..0000000 --- a/stage4/02-extras/00-run.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -e - -HASH=`wget https://api.github.com/repos/KenT2/python-games/git/refs/heads/master -qO -| grep \"sha\" | cut -f 2 -d ':' | cut -f 2 -d \"` - -if [ -f files/python_games.hash ]; then - HASH_LOCAL=`cat files/python_games.hash` -fi - -if [ ! -e files/python_games.tar.gz ] || [ "$HASH" != "$HASH_LOCAL" ]; then - wget "https://github.com/KenT2/python-games/tarball/master" -O files/python_games.tar.gz - echo $HASH > files/python_games.hash -fi - -ln -sf pip3 ${ROOTFS_DIR}/usr/bin/pip-3.2 - -install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/python_games -tar xvf files/python_games.tar.gz -C ${ROOTFS_DIR}/home/pi/python_games --strip-components=1 -chown 1000:1000 ${ROOTFS_DIR}/home/pi/python_games -Rv -chmod +x ${ROOTFS_DIR}/home/pi/python_games/launcher.sh - -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents" -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents/BlueJ Projects" -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents/Greenfoot Projects" -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents/Scratch Projects" -rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/doc/BlueJ/ "${ROOTFS_DIR}/home/pi/Documents/BlueJ Projects" -rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/doc/Greenfoot/ "${ROOTFS_DIR}/home/pi/Documents/Greenfoot Projects" -rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/scratch/Projects/Demos/ "${ROOTFS_DIR}/home/pi/Documents/Scratch Projects" - -#Alacarte fixes -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local" -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local/share" -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local/share/applications" -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local/share/desktop-directories" diff --git a/stage4/02-extras/files/.gitignore b/stage4/02-extras/files/.gitignore deleted file mode 100644 index 589d776..0000000 --- a/stage4/02-extras/files/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -python_games.hash -python_games.tar.gz diff --git a/stage4/03-cleanup/00-run.sh b/stage4/03-cleanup/00-run.sh deleted file mode 100755 index 071a164..0000000 --- a/stage4/03-cleanup/00-run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e - -on_chroot << EOF -apt-get clean -EOF diff --git a/stage4/EXPORT_IMAGE b/stage4/EXPORT_IMAGE deleted file mode 100644 index e69de29..0000000 diff --git a/stage4/EXPORT_NOOBS b/stage4/EXPORT_NOOBS deleted file mode 100644 index e69de29..0000000 diff --git a/stage4/prerun.sh b/stage4/prerun.sh deleted file mode 100755 index a5ea5f4..0000000 --- a/stage4/prerun.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -e -if [ ! -d ${ROOTFS_DIR} ]; then - copy_previous -fi From c8eb87671fcf2954714d78eb8ca75eea0352ae71 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 25 Jan 2017 14:53:27 +0200 Subject: [PATCH 09/91] install dride-core first --- stage2/01-sys-tweaks/01-run.sh | 62 +++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index fdd9547..b4e0923 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -95,6 +95,39 @@ sudo apt-get install git -y echo "========== Installing libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev ============" sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev -y + +# Install Node +echo "========== Installing Node ============" +sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb +sudo dpkg -i node_latest_armhf.deb + +sudo rm /node_latest_armhf.deb + + +# TODO: Add a test if openCV was installed correctly + +echo "========== Install Dride-core [Cardigan] ============" +cd /home +# https://github.com/dride/Cardigan/archive/0.2.zip +wget -c -O "cardigan-0.2.zip" "https://github.com/dride/Cardigan/releases/download/0.2/Cardigan.zip" +unzip -q -n "cardigan-0.2.zip" + +sudo rm cardigan-0.2.zip + +sudo rm -R __MACOSX + + +# make the video dir writable +sudo chmod 777 -R /home/Cardigan/modules/video/ + +# clone dride-ws +cd /home/Cardigan/dride-ws + +sudo npm i + +cd /home + + echo "========== Installing pip ============" sudo wget https://bootstrap.pypa.io/get-pip.py sudo chmod +x get-pip.py @@ -103,6 +136,7 @@ sudo python get-pip.py echo "========== Installing Numpy ============" sudo pip install numpy +sudo rm get-pip.py echo "========== Downloading and installing OpenCV ============" cd / @@ -128,34 +162,6 @@ cd / sudo rm opencv-3.1.0.zip -# Install Node -echo "========== Installing Node ============" -sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb -sudo dpkg -i node_latest_armhf.deb - - - -# TODO: Add a test if openCV was installed correctly - -echo "========== Install Dride-core [Cardigan] ============" -cd /home -# https://github.com/dride/Cardigan/archive/0.2.zip -wget -c -O "cardigan-0.2.zip" "https://github.com/dride/Cardigan/releases/download/0.2/Cardigan.zip" -sudo apt-get install unzip -unzip -q -n "cardigan-0.2.zip" - -sudo rm cardigan-0.2.zip - - -# make the video dir writable -sudo chmod 777 -R /home/Cardigan/modules/video/ - -# clone dride-ws -cd /home/Cardigan/dride-ws - -sudo npm i -cd / - From ccef2885e888b91313587c769360d93cd502f8a6 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 25 Jan 2017 16:23:35 +0200 Subject: [PATCH 10/91] cleanup --- stage2/01-sys-tweaks/01-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index b4e0923..f1e5f22 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -82,7 +82,7 @@ cd /home # Install dependencies echo "========== Update Aptitude ===========" -sudo apt-get update -y +# sudo apt-get update -y # sudo apt-get upgrade echo "========== Installing build-essential ============" @@ -101,7 +101,7 @@ echo "========== Installing Node ============" sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb sudo dpkg -i node_latest_armhf.deb -sudo rm /node_latest_armhf.deb +sudo rm /home/node_latest_armhf.deb # TODO: Add a test if openCV was installed correctly From b7220e8b05652f66b54982b64a1e9d4fae3b7df0 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 25 Jan 2017 16:50:24 +0200 Subject: [PATCH 11/91] nom i at the end of the script --- stage2/01-sys-tweaks/01-run.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index f1e5f22..0a80f50 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -104,6 +104,10 @@ sudo dpkg -i node_latest_armhf.deb sudo rm /home/node_latest_armhf.deb +EOF + +on_chroot << EOF + # TODO: Add a test if openCV was installed correctly echo "========== Install Dride-core [Cardigan] ============" @@ -120,13 +124,10 @@ sudo rm -R __MACOSX # make the video dir writable sudo chmod 777 -R /home/Cardigan/modules/video/ -# clone dride-ws -cd /home/Cardigan/dride-ws -sudo npm i - -cd /home +EOF +on_chroot << EOF echo "========== Installing pip ============" sudo wget https://bootstrap.pypa.io/get-pip.py @@ -178,6 +179,9 @@ sudo apt-get install omxplayer -y # Install WIFi +echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections +echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections + sudo apt-get install hostapd isc-dhcp-server -y sudo apt-get install iptables-persistent -y @@ -261,6 +265,10 @@ sudo rm dride-core +# run npm install on dride-ws +cd /home/Cardigan/dride-ws + +sudo npm i From 68299deb18d55a07621a3285275ef3b0c58d3300 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 25 Jan 2017 16:51:47 +0200 Subject: [PATCH 12/91] cleanup --- stage2/01-sys-tweaks/01-run.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 0a80f50..bd84a62 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -104,9 +104,7 @@ sudo dpkg -i node_latest_armhf.deb sudo rm /home/node_latest_armhf.deb -EOF -on_chroot << EOF # TODO: Add a test if openCV was installed correctly @@ -125,9 +123,7 @@ sudo rm -R __MACOSX sudo chmod 777 -R /home/Cardigan/modules/video/ -EOF -on_chroot << EOF echo "========== Installing pip ============" sudo wget https://bootstrap.pypa.io/get-pip.py From ea93abbd73ecb0afe7146d23cc0db5e570bf6965 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 26 Jan 2017 10:12:43 +0200 Subject: [PATCH 13/91] cleanup --- stage2/01-sys-tweaks/01-run.sh | 6 +----- stage2/03-dride/00-run.sh | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index bd84a62..2d8f6f9 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -88,9 +88,6 @@ echo "========== Update Aptitude ===========" echo "========== Installing build-essential ============" sudo apt-get install build-essential -y -echo "========== Installing git ============" -sudo apt-get install git -y - echo "========== Installing libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev ============" sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev -y @@ -106,8 +103,6 @@ sudo rm /home/node_latest_armhf.deb -# TODO: Add a test if openCV was installed correctly - echo "========== Install Dride-core [Cardigan] ============" cd /home # https://github.com/dride/Cardigan/archive/0.2.zip @@ -158,6 +153,7 @@ sudo ldconfig cd / sudo rm opencv-3.1.0.zip +# TODO: Add a test if openCV was installed correctly diff --git a/stage2/03-dride/00-run.sh b/stage2/03-dride/00-run.sh index ba14d73..8ee313e 100755 --- a/stage2/03-dride/00-run.sh +++ b/stage2/03-dride/00-run.sh @@ -1,5 +1,5 @@ #!/bin/bash -e -on_chroot << EOF -bash -c "$(curl -s https://dride.io/code/install.sh)" -EOF +# on_chroot << EOF +# bash -c "$(curl -s https://dride.io/code/install.sh)" +# EOF From 4f6cdd3a9c7bce5309e7dd6443868e2e8dbccb19 Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Thu, 2 Feb 2017 21:49:03 +0200 Subject: [PATCH 14/91] Update README.md --- README.md | 52 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 7b3ebbc..9478413 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,12 @@ -#TODO - -1. Documentation - #Dependencies `quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin` -#Config - -Upon execution, `build.sh` will source the file `config` in the current -working directory. This bash shell fragment is intended to set needed -environment variables. - -The following environment variables are supported: - - * `IMG_NAME` **required** (Default: unset) - - The name of the image to build with the current stage directories. Setting - `IMG_NAME=Raspbian` is logical for an unmodified RPi-Distro/pi-gen build, - but you should use something else for a customized version. Export files - in stages may add suffixes to `IMG_NAME`. - - * `APT_PROXY` (Default: unset) - - If you require the use of an apt proxy, set it here. This proxy setting - will not be included in the image, making it safe to use an `apt-cacher` or - similar package for development. - -A simple example for building Raspbian: - -```bash -IMG_NAME='Raspbian' -``` - #Stage Anatomy -#Raspbian Stage Overview +# drideOS (Raspbian) Stage Overview The build of Raspbian is divided up into several stages for logical clarity and modularity. This causes some initial complexity, but it simplifies @@ -67,21 +36,4 @@ maintenance and allows for more easy customization. creates necessary groups and gives the pi user access to sudo and the standard console hardware permission groups. - There are a few tools that may not make a whole lot of sense here for - development purposes on a minimal system such as basic python and lua - packages as well as the `build-essential` package. They are lumped right - in with more essential packages presently, though they need not be with - pi-gen. These are understandable for Raspbian's target audience, but if - you were looking for something between truly minimal and Raspbian-lite, - here's where you start trimming. - - - Stage 3, desktop system. Here's where you get the full desktop system - with X11 and LXDE, web browsers, git for development, Raspbian custom UI - enhancements, etc. This is a base desktop system, with some development - tools installed. - - - Stage 4, complete Raspbian system. More development tools, an email - client, learning tools like Scratch, specialized packages like sonic-pi and - wolfram-engine, system documentation, office productivity, etc. This is - the stage that installs all of the things that make Raspbian friendly to - new users. +- Stage 3, Install Dride related softwere. From 3cf7a636109eb92aa8208b766e31c8c8f49c635b Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 5 Apr 2017 11:11:21 +0300 Subject: [PATCH 15/91] remove stages 4 & 5 --- stage4/00-install-packages/00-debconf | 2 -- stage4/00-install-packages/00-packages | 35 ----------------------- stage4/00-install-packages/00-packages-nr | 4 --- stage4/EXPORT_IMAGE | 1 - stage5/00-install-mathematica/00-debconf | 2 -- stage5/00-install-mathematica/00-packages | 1 - stage5/EXPORT_IMAGE | 1 - stage5/EXPORT_NOOBS | 2 -- stage5/prerun.sh | 4 --- 9 files changed, 52 deletions(-) delete mode 100644 stage4/00-install-packages/00-debconf delete mode 100644 stage4/00-install-packages/00-packages delete mode 100644 stage4/00-install-packages/00-packages-nr delete mode 100644 stage4/EXPORT_IMAGE delete mode 100644 stage5/00-install-mathematica/00-debconf delete mode 100644 stage5/00-install-mathematica/00-packages delete mode 100644 stage5/EXPORT_IMAGE delete mode 100644 stage5/EXPORT_NOOBS delete mode 100755 stage5/prerun.sh diff --git a/stage4/00-install-packages/00-debconf b/stage4/00-install-packages/00-debconf deleted file mode 100644 index 87932e2..0000000 --- a/stage4/00-install-packages/00-debconf +++ /dev/null @@ -1,2 +0,0 @@ -# Enable realtime process priority? -jackd2 jackd/tweak_rt_limits boolean true diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages deleted file mode 100644 index 80625b6..0000000 --- a/stage4/00-install-packages/00-packages +++ /dev/null @@ -1,35 +0,0 @@ -java-common oracle-java8-jdk -libreoffice-sdbc-hsqldb -sonic-pi -python idle python3-pygame python-pygame python-tk -python3 idle3 python3-tk -python3-pgzero -python-serial python3-serial -python-picamera python3-picamera -debian-reference-en dillo x2x -raspberrypi-net-mods raspberrypi-ui-mods -smartsim penguinspuzzle -python-pip python3-pip -python3-numpy -pypy -python3-pifacecommon python3-pifacedigitalio python3-pifacedigital-scratch-handler python-pifacecommon python-pifacedigitalio -minecraft-pi python-minecraftpi -alacarte rc-gui sense-hat -claws-mail -tree -scratch nuscratch -greenfoot bluej -nodered -libgl1-mesa-dri libgles1-mesa libgles2-mesa xcompmgr -geany -piclone -pulseaudio-module-bluetooth -wiringpi pigpio python-pigpio python3-pigpio raspi-gpio python-gpiozero python3-gpiozero python3-rpi.gpio -python-spidev python3-spidev -python-twython python3-twython -python-smbus python3-smbus -python-flask python3-flask -python-picraft python3-picraft -python3-codebug-tether python3-codebug-i2c-tether -python-sense-emu python3-sense-emu sense-emu-tools python-sense-emu-doc -pprompt diff --git a/stage4/00-install-packages/00-packages-nr b/stage4/00-install-packages/00-packages-nr deleted file mode 100644 index 561403c..0000000 --- a/stage4/00-install-packages/00-packages-nr +++ /dev/null @@ -1,4 +0,0 @@ -libreoffice libreoffice-gtk -timidity -pi-package -realvnc-vnc-server realvnc-vnc-viewer diff --git a/stage4/EXPORT_IMAGE b/stage4/EXPORT_IMAGE deleted file mode 100644 index ee20363..0000000 --- a/stage4/EXPORT_IMAGE +++ /dev/null @@ -1 +0,0 @@ -IMG_SUFFIX="-4GB" diff --git a/stage5/00-install-mathematica/00-debconf b/stage5/00-install-mathematica/00-debconf deleted file mode 100644 index d9743fe..0000000 --- a/stage5/00-install-mathematica/00-debconf +++ /dev/null @@ -1,2 +0,0 @@ -# Do you accept the Wolfram - Raspberry Pi® Bundle License Agreement? -wolfram-engine shared/accepted-wolfram-eula boolean true diff --git a/stage5/00-install-mathematica/00-packages b/stage5/00-install-mathematica/00-packages deleted file mode 100644 index fa9ba94..0000000 --- a/stage5/00-install-mathematica/00-packages +++ /dev/null @@ -1 +0,0 @@ -wolfram-engine diff --git a/stage5/EXPORT_IMAGE b/stage5/EXPORT_IMAGE deleted file mode 100644 index 2b0f09d..0000000 --- a/stage5/EXPORT_IMAGE +++ /dev/null @@ -1 +0,0 @@ -IMG_SUFFIX="" diff --git a/stage5/EXPORT_NOOBS b/stage5/EXPORT_NOOBS deleted file mode 100644 index a7e95af..0000000 --- a/stage5/EXPORT_NOOBS +++ /dev/null @@ -1,2 +0,0 @@ -NOOBS_NAME="Raspbian with PIXEL" -NOOBS_DESCRIPTION="A port of Debian jessie for the Raspberry Pi (full desktop version)" diff --git a/stage5/prerun.sh b/stage5/prerun.sh deleted file mode 100755 index a5ea5f4..0000000 --- a/stage5/prerun.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -e -if [ ! -d ${ROOTFS_DIR} ]; then - copy_previous -fi From 6d9ab9f47aa16a2dfa843c2401eefc1080b4cd5f Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 12 Apr 2017 13:22:32 +0300 Subject: [PATCH 16/91] install picamera & apt-get pip --- stage2/01-sys-tweaks/01-run.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 40b2490..252d2e8 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -122,15 +122,11 @@ sudo chmod 777 -R /home/Cardigan/modules/video/ echo "========== Installing pip ============" -sudo wget https://bootstrap.pypa.io/get-pip.py -sudo chmod +x get-pip.py -sudo python get-pip.py +sudo apt-get install python-pip echo "========== Installing Numpy ============" sudo pip install numpy -sudo rm get-pip.py - echo "========== Downloading and installing OpenCV ============" cd / # git clone https://github.com/Itseez/opencv.git --depth 1 @@ -160,6 +156,7 @@ sudo rm opencv-3.1.0.zip echo "========== Install picamera ============" +sudo pip install picamera sudo pip install "picamera[array]" # enable camera on raspi-config echo "" >> /boot/config.txt From e6528f24d63662ef5b61706ecf9031bc65bca66e Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 12 Apr 2017 13:37:58 +0300 Subject: [PATCH 17/91] use mpg123 instead of omg --- stage2/01-sys-tweaks/01-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 252d2e8..c1dce57 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -164,8 +164,8 @@ echo "#enable piCaera" >> /boot/config.txt echo "start_x=1" >> /boot/config.txt -echo "========== Install omxplayer ============" -sudo apt-get install omxplayer -y +echo "========== Install mpg123 ============" +sudo apt-get install mpg123 -y # Install WIFi From 2c1726ca8722eafce279419e8d94167ccbac10ca Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 12 Apr 2017 13:40:49 +0300 Subject: [PATCH 18/91] install i2s --- stage2/01-sys-tweaks/01-run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index c1dce57..91f1031 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -164,6 +164,9 @@ echo "#enable piCaera" >> /boot/config.txt echo "start_x=1" >> /boot/config.txt +echo "========== Setup sound to I2S ============" +sudo curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash + echo "========== Install mpg123 ============" sudo apt-get install mpg123 -y From 5b86536360f774e7aa10c6bd41673130634bd681 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 12 Apr 2017 14:15:54 +0300 Subject: [PATCH 19/91] add -y flag to pip install --- stage2/01-sys-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 91f1031..75bfe17 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -122,7 +122,7 @@ sudo chmod 777 -R /home/Cardigan/modules/video/ echo "========== Installing pip ============" -sudo apt-get install python-pip +sudo apt-get install python-pip -y echo "========== Installing Numpy ============" sudo pip install numpy From a0191799c6fdc5c5aa0ef51a795de4ea472e5ce4 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 13 Apr 2017 10:10:34 +0300 Subject: [PATCH 20/91] remove quotes from piCamera[array] --- stage2/01-sys-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 75bfe17..e31c743 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -157,7 +157,7 @@ sudo rm opencv-3.1.0.zip echo "========== Install picamera ============" sudo pip install picamera -sudo pip install "picamera[array]" +sudo pip install picamera[array] # enable camera on raspi-config echo "" >> /boot/config.txt echo "#enable piCaera" >> /boot/config.txt From a997d0eceefd50ccd45174a7ed9d444dc683d01c Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 13 Apr 2017 14:05:51 +0300 Subject: [PATCH 21/91] install piCamera threw apt-get --- stage2/01-sys-tweaks/01-run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index e31c743..ef60686 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -156,8 +156,9 @@ sudo rm opencv-3.1.0.zip echo "========== Install picamera ============" -sudo pip install picamera -sudo pip install picamera[array] +export READTHEDOCS="True" +sudo apt-get install python-picamera + # enable camera on raspi-config echo "" >> /boot/config.txt echo "#enable piCaera" >> /boot/config.txt From 59325d497be495fd28b961f19d228180798c7a42 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 13 Apr 2017 15:43:17 +0300 Subject: [PATCH 22/91] fix piCamera install --- stage2/01-sys-tweaks/01-run.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index ef60686..ef70aa8 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -127,6 +127,18 @@ sudo apt-get install python-pip -y echo "========== Installing Numpy ============" sudo pip install numpy +echo "========== Install picamera ============" +export READTHEDOCS="True" +sudo pip install "picamera[array]" + + +# enable camera on raspi-config +echo "" >> /boot/config.txt +echo "#enable piCaera" >> /boot/config.txt +echo "start_x=1" >> /boot/config.txt + + + echo "========== Downloading and installing OpenCV ============" cd / # git clone https://github.com/Itseez/opencv.git --depth 1 @@ -153,17 +165,7 @@ sudo rm opencv-3.1.0.zip # TODO: Add a test if openCV was installed correctly - - -echo "========== Install picamera ============" -export READTHEDOCS="True" -sudo apt-get install python-picamera - -# enable camera on raspi-config -echo "" >> /boot/config.txt -echo "#enable piCaera" >> /boot/config.txt -echo "start_x=1" >> /boot/config.txt - + echo "========== Setup sound to I2S ============" sudo curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash From 6ba487e168f2f9a0703405a46cdba507d256796b Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 13 Apr 2017 17:28:29 +0300 Subject: [PATCH 23/91] revert to pi camera python 1.12 until a fix will be found --- stage2/01-sys-tweaks/01-run.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index ef70aa8..897d851 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -128,8 +128,7 @@ echo "========== Installing Numpy ============" sudo pip install numpy echo "========== Install picamera ============" -export READTHEDOCS="True" -sudo pip install "picamera[array]" +sudo pip install "picamera[array]==1.12" # enable camera on raspi-config From 0dbe2c49be0c5848d5cf30eb82b20bbc2b748598 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 13 Apr 2017 21:56:53 +0300 Subject: [PATCH 24/91] move opencv install to the bottom --- stage2/01-sys-tweaks/01-run.sh | 49 ++++++++++++++++------------------ 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 897d851..b3f4039 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -138,33 +138,7 @@ echo "start_x=1" >> /boot/config.txt -echo "========== Downloading and installing OpenCV ============" -cd / -# git clone https://github.com/Itseez/opencv.git --depth 1 -wget -c -O "opencv-3.1.0.zip" "https://github.com/Itseez/opencv/archive/3.1.0.zip" -sudo apt-get install unzip -unzip -q -n "opencv-3.1.0.zip" -cd opencv-3.1.0 -echo "==>>>====== Building OpenCV ============" -cd /home/opencv-3.1.0 -mkdir build -cd build -cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D CMAKE_INSTALL_PREFIX=/usr/local .. -echo "==>>>====== This might take a long time.. ============" -make -j1 - -sudo make install -sudo ldconfig - -# remove the installation file -cd / -sudo rm opencv-3.1.0.zip - -# TODO: Add a test if openCV was installed correctly - - - echo "========== Setup sound to I2S ============" sudo curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash @@ -267,7 +241,30 @@ sudo npm i +echo "========== Downloading and installing OpenCV ============" +cd / +# git clone https://github.com/Itseez/opencv.git --depth 1 +wget -c -O "opencv-3.1.0.zip" "https://github.com/Itseez/opencv/archive/3.1.0.zip" +sudo apt-get install unzip +unzip -q -n "opencv-3.1.0.zip" +cd opencv-3.1.0 +echo "==>>>====== Building OpenCV ============" +cd /home/opencv-3.1.0 +mkdir build +cd build +cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D CMAKE_INSTALL_PREFIX=/usr/local .. +echo "==>>>====== This might take a long time.. ============" +make -j1 + +sudo make install +sudo ldconfig + +# remove the installation file +cd / +sudo rm opencv-3.1.0.zip + +# TODO: Add a test if openCV was installed correctly From 603ee58f2574515d6c454f4ba09357d5fa520d58 Mon Sep 17 00:00:00 2001 From: Yossi Date: Fri, 14 Apr 2017 21:22:56 +0300 Subject: [PATCH 25/91] update to Cardigan v0.3 --- stage2/01-sys-tweaks/01-run.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index b3f4039..40041e5 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -106,11 +106,11 @@ sudo rm /home/node_latest_armhf.deb echo "========== Install Dride-core [Cardigan] ============" cd /home -# https://github.com/dride/Cardigan/archive/0.2.zip -wget -c -O "cardigan-0.2.zip" "https://github.com/dride/Cardigan/releases/download/0.2/Cardigan.zip" -unzip -q -n "cardigan-0.2.zip" +# https://github.com/dride/Cardigan/archive/0.3.zip +wget -c -O "cardigan-0.3.zip" "https://github.com/dride/Cardigan/releases/download/0.3/Cardigan.zip" +unzip -q -n "cardigan-0.3.zip" -sudo rm cardigan-0.2.zip +sudo rm cardigan-0.3.zip sudo rm -R __MACOSX @@ -141,7 +141,7 @@ echo "start_x=1" >> /boot/config.txt echo "========== Setup sound to I2S ============" -sudo curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash +sudo curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash echo "========== Install mpg123 ============" sudo apt-get install mpg123 -y From d452ea2f3f9a0168366a12a59c6527ac5bf375a0 Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 16 Apr 2017 10:24:32 +0300 Subject: [PATCH 26/91] add GPS core --- stage2/01-sys-tweaks/01-run.sh | 34 +++ stage2/01-sys-tweaks/02-I2S.sh | 388 +++++++++++++++++++++++++++++++++ 2 files changed, 422 insertions(+) create mode 100755 stage2/01-sys-tweaks/02-I2S.sh diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 40041e5..d67d48c 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -241,6 +241,40 @@ sudo npm i + +## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 +echo "========== Install GPS ============" +sudo apt-get install gpsd gpsd-clients cmake subversion build-essential espeak freeglut3-dev imagemagick libdbus-1-dev libdbus-glib-1-dev libdevil-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgarmin-dev libglc-dev libgps-dev libgtk2.0-dev libimlib2-dev libpq-dev libqt4-dev libqtwebkit-dev librsvg2-bin libsdl-image1.2-dev libspeechd-dev libxml2-dev ttf-liberation -y + +sudo pip install pyserial + + +echo "" >> /boot/config.txt +echo "core_freq=250" >> /boot/config.txt +echo "enable_uart=1" >> /boot/config.txt + +echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt + + + +# 3)Run +sudo systemctl stop serial-getty@ttyS0.service +sudo systemctl disable serial-getty@ttyS0.service +sudo systemctl stop gpsd.socket +sudo systemctl disable gpsd.socket + +# reboot + +# 5) Execute the daemon reset +sudo killall gpsd +sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock + + + + + + + echo "========== Downloading and installing OpenCV ============" cd / # git clone https://github.com/Itseez/opencv.git --depth 1 diff --git a/stage2/01-sys-tweaks/02-I2S.sh b/stage2/01-sys-tweaks/02-I2S.sh new file mode 100755 index 0000000..82d570a --- /dev/null +++ b/stage2/01-sys-tweaks/02-I2S.sh @@ -0,0 +1,388 @@ +#!/bin/bash + +: <<'DISCLAIMER' + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +This script is licensed under the terms of the MIT license. +Unless otherwise noted, code reproduced herein +was written for this script. + +- The Pimoroni Crew - (modified by Adafruit!) + +DISCLAIMER + +# script control variables + +productname="i2s amplifier" # the name of the product to install +scriptname="i2samp" # the name of this script +spacereq=1 # minimum size required on root partition in MB +debugmode="no" # whether the script should use debug routines +debuguser="none" # optional test git user to use in debug mode +debugpoint="none" # optional git repo branch or tag to checkout +forcesudo="no" # whether the script requires to be ran with root privileges +promptreboot="no" # whether the script should always prompt user to reboot +mininstall="no" # whether the script enforces minimum install routine +customcmd="yes" # whether to execute commands specified before exit +armhfonly="yes" # whether the script is allowed to run on other arch +armv6="yes" # whether armv6 processors are supported +armv7="yes" # whether armv7 processors are supported +armv8="yes" # whether armv8 processors are supported +raspbianonly="no" # whether the script is allowed to run on other OSes +osreleases=( "Raspbian" ) # list os-releases supported +oswarning=( "Debian" "Kano" "Mate" "PiTop" "Ubuntu" ) # list experimental os-releases +osdeny=( "Darwin" "Kali" ) # list os-releases specifically disallowed + +FORCE=$1 +DEVICE_TREE=true +ASK_TO_REBOOT=false +CURRENT_SETTING=false +UPDATE_DB=false + +BOOTCMD=/boot/cmdline.txt +CONFIG=/boot/config.txt +APTSRC=/etc/apt/sources.list +INITABCONF=/etc/inittab +BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf +LOADMOD=/etc/modules +DTBODIR=/boot/overlays + +# function define + +prompt() { + read -r -p "$1 [y/N] " response < /dev/tty + if [[ $response =~ ^(yes|y|Y)$ ]]; then + true + else + false + fi +} + +success() { + echo -e "$(tput setaf 2)$1$(tput sgr0)" +} + +inform() { + echo -e "$(tput setaf 6)$1$(tput sgr0)" +} + +warning() { + echo -e "$(tput setaf 1)$1$(tput sgr0)" +} + +newline() { + echo "" +} + +progress() { + count=0 + until [ $count -eq $1 ]; do + echo -n "..." && sleep 1 + ((count++)) + done + echo +} +sudocheck() { + if [ $(id -u) -ne 0 ]; then + echo -e "Install must be run as root. Try 'sudo ./$scriptname'\n" + exit 1 + fi +} + +sysclean() { + sudo apt-get clean && sudo apt-get autoclean + sudo apt-get -y autoremove &> /dev/null +} + +sysupdate() { + if ! $UPDATE_DB; then + echo "Updating apt indexes..." && progress 3 & + sudo apt-get update 1> /dev/null || { warning "Apt failed to update indexes!" && exit 1; } + echo "Reading package lists..." + progress 3 && UPDATE_DB=true + fi +} + +sysupgrade() { + sudo apt-get upgrade + sudo apt-get clean && sudo apt-get autoclean + sudo apt-get -y autoremove &> /dev/null +} + +sysreboot() { + warning "Some changes made to your system require" + warning "your computer to reboot to take effect." + newline + if prompt "Would you like to reboot now?"; then + sync && sudo reboot + fi +} + +arch_check() { + IS_ARMHF=false + IS_ARMv6=false + + if uname -m | grep "armv.l" > /dev/null; then + IS_ARMHF=true + if uname -m | grep "armv6l" > /dev/null; then + IS_ARMv6=true + fi + fi +} + +os_check() { + IS_RASPBIAN=false + IS_MACOSX=false + IS_SUPPORTED=false + IS_EXPERIMENTAL=false + + if [ -f /etc/os-release ]; then + if cat /etc/os-release | grep "Raspbian" > /dev/null; then + IS_RASPBIAN=true && IS_SUPPORTED=true + fi + if command -v apt-get > /dev/null; then + for os in ${osreleases[@]}; do + if cat /etc/os-release | grep $os > /dev/null; then + IS_SUPPORTED=true && IS_EXPERIMENTAL=false + fi + done + for os in ${oswarning[@]}; do + if cat /etc/os-release | grep $os > /dev/null; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=true + fi + done + for os in ${osdeny[@]}; do + if cat /etc/os-release | grep $os > /dev/null; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=false + fi + done + fi + fi + if [ -d ~/.kano-settings ] || [ -d ~/.kanoprofile ]; then + IS_RASPBIAN=false + for os in ${oswarning[@]}; do + if [ $os == "Kano" ]; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=true + fi + done + for os in ${osdeny[@]}; do + if [ $os == "Kano" ]; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=false + fi + done + fi + if [ -f ~/.pt-dashboard-config ] || [ -d ~/.pt-dashboard ]; then + IS_RASPBIAN=false + for os in ${oswarning[@]}; do + if [ $os == "PiTop" ]; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=true + fi + done + for os in ${osdeny[@]}; do + if [ $os == "PiTop" ]; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=false + fi + done + fi + if [ -d ~/.config/ubuntu-mate ]; then + for os in ${osdeny[@]}; do + if [ $os == "Mate" ]; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=false + fi + done + fi + if uname -s | grep "Darwin" > /dev/null; then + IS_MACOSX=true + for os in ${osdeny[@]}; do + if [ $os == "Darwin" ]; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=false + fi + done + fi +} + +raspbian_check() { + IS_SUPPORTED=false + IS_EXPERIMENTAL=false + + if [ -f /etc/os-release ]; then + if cat /etc/os-release | grep "/sid" > /dev/null; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=true + elif cat /etc/os-release | grep "stretch" > /dev/null; then + IS_SUPPORTED=false && IS_EXPERIMENTAL=true + elif cat /etc/os-release | grep "jessie" > /dev/null; then + IS_SUPPORTED=true && IS_EXPERIMENTAL=false + elif cat /etc/os-release | grep "wheezy" > /dev/null; then + IS_SUPPORTED=true && IS_EXPERIMENTAL=false + else + IS_SUPPORTED=false && IS_EXPERIMENTAL=false + fi + fi +} + +: <<'MAINSTART' + +Perform all global variables declarations as well as function definition +above this section for clarity, thanks! + +MAINSTART + +# checks and init + +arch_check +os_check + +if [ $debugmode != "no" ]; then + echo "USER_HOME is $USER_HOME" && newline + echo "IS_RASPBIAN is $IS_RASPBIAN" + echo "IS_MACOSX is $IS_MACOSX" + echo "IS_SUPPORTED is $IS_SUPPORTED" + echo "IS_EXPERIMENTAL is $IS_EXPERIMENTAL" + newline +fi + +if ! $IS_ARMHF; then + warning "This hardware is not supported, sorry!" + warning "Config files have been left untouched" + newline && exit 1 +fi + +if $IS_ARMv8 && [ $armv8 == "no" ]; then + warning "Sorry, your CPU is not supported by this installer" + newline && exit 1 +elif $IS_ARMv7 && [ $armv7 == "no" ]; then + warning "Sorry, your CPU is not supported by this installer" + newline && exit 1 +elif $IS_ARMv6 && [ $armv6 == "no" ]; then + warning "Sorry, your CPU is not supported by this installer" + newline && exit 1 +fi + +if [ $raspbianonly == "yes" ] && ! $IS_RASPBIAN;then + warning "This script is intended for Raspbian on a Raspberry Pi!" + newline && exit 1 +fi + +if $IS_RASPBIAN; then + raspbian_check + if ! $IS_SUPPORTED && ! $IS_EXPERIMENTAL; then + newline && warning "--- Warning ---" && newline + echo "The $productname installer" + echo "does not work on this version of Raspbian." + echo "Check https://github.com/$gitusername/$gitreponame" + echo "for additional information and support" + newline && exit 1 + fi +fi + +if ! $IS_SUPPORTED && ! $IS_EXPERIMENTAL; then + warning "Your operating system is not supported, sorry!" + newline && exit 1 +fi + +if $IS_EXPERIMENTAL; then + warning "Support for your operating system is experimental. Please visit" + warning "forums.adafruit.com if you experience issues with this product." + newline +fi + +if [ $forcesudo == "yes" ]; then + sudocheck +fi + +newline +echo "This script will install everything needed to use" +echo "$productname" +newline + +newline +echo "Checking hardware requirements..." + +if [ -e $CONFIG ] && grep -q "^device_tree=$" $CONFIG; then + DEVICE_TREE=false +fi + +if $DEVICE_TREE; then + + newline + echo "Adding Device Tree Entry to $CONFIG" + + if [ -e $CONFIG ] && grep -q "^dtoverlay=hifiberry-dac$" $CONFIG; then + echo "dtoverlay already active" + else + echo "dtoverlay=hifiberry-dac" | sudo tee -a $CONFIG + ASK_TO_REBOOT=true + fi + + if [ -e $BLACKLIST ]; then + newline + echo "Commenting out Blacklist entry in " + echo "$BLACKLIST" + sudo sed -i -e "s|^blacklist[[:space:]]*i2c-bcm2708.*|#blacklist i2c-bcm2708|" \ + -e "s|^blacklist[[:space:]]*snd-soc-pcm512x.*|#blacklist snd-soc-pcm512x|" \ + -e "s|^blacklist[[:space:]]*snd-soc-wm8804.*|#blacklist snd-soc-wm8804|" $BLACKLIST &> /dev/null + fi +else + newline + echo "No Device Tree Detected, not supported" + newline + exit 1 +fi + +if [ -e $CONFIG ] && grep -q -E "^dtparam=audio=on$" $CONFIG; then + bcm2835off="no" + newline + echo "Disabling default sound driver" + sudo sed -i "s|^dtparam=audio=on$|#dtparam=audio=on|" $CONFIG &> /dev/null + if [ -e $LOADMOD ] && grep -q "^snd-bcm2835" $LOADMOD; then + sudo sed -i "s|^snd-bcm2835|#snd-bcm2835|" $LOADMOD &> /dev/null + fi + ASK_TO_REBOOT=true +elif [ -e $LOADMOD ] && grep -q "^snd-bcm2835" $LOADMOD; then + bcm2835off="no" + newline + echo "Disabling default sound module" + sudo sed -i "s|^snd-bcm2835|#snd-bcm2835|" $LOADMOD &> /dev/null + ASK_TO_REBOOT=true +else + newline + echo "Default sound driver currently not loaded" + bcm2835off="yes" +fi + +echo "Configuring sound output" +if [ -e /etc/asound.conf ]; then + if [ -e /etc/asound.conf.old ]; then + sudo rm -f /etc/asound.conf.old + fi + sudo mv /etc/asound.conf /etc/asound.conf.old +fi +sudo echo -e "pcm.\041default {\n type hw\n card 0\n}" > ~/asound.conf +sudo echo -e "ctl.\041default {\n type hw\n card 0\n}" >> ~/asound.conf +sudo mv ~/asound.conf /etc/asound.conf + +if [ $bcm2835off == "yes" ]; then + newline + echo "We can now test your $productname" + warning "Set your speakers at a low volume!" + if confirm "Do you wish to test your system now?"; then + echo "Testing..." + speaker-test -l5 -c2 -t wav + fi +fi +newline +success "All done!" +newline +echo "Enjoy your new $productname!" +newline + + + +exit 0 \ No newline at end of file From 34139fc433587fe327db85204658b6d9c2f21b90 Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Sun, 16 Apr 2017 10:25:18 +0300 Subject: [PATCH 27/91] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9478413..1814b2a 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ #Dependencies -`quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin` +`sudo apt-get update && sudo apt-get insatll git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin` #Stage Anatomy From 0227ca407a4acfdc5e6a99b658145a214a6a47a3 Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Sun, 16 Apr 2017 10:25:42 +0300 Subject: [PATCH 28/91] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1814b2a..ce2f349 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ #Dependencies -`sudo apt-get update && sudo apt-get insatll git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin` +`sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y` #Stage Anatomy From b9855d7be31458f90a167ba26cca023b5cc66a5c Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Sun, 16 Apr 2017 10:28:30 +0300 Subject: [PATCH 29/91] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ce2f349..012c213 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ #Dependencies -`sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y` +`sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y +cd ../ +sudo git clone https://github.com/dride/drideOS-image-generator +cd drideOS-image-generator +sudo ./build.sh +` #Stage Anatomy From 8da4be5a2e03862418af5758cffe2409a650682d Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Sun, 16 Apr 2017 10:29:04 +0300 Subject: [PATCH 30/91] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 012c213..9b404fe 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ #Dependencies -`sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y -cd ../ -sudo git clone https://github.com/dride/drideOS-image-generator -cd drideOS-image-generator +`sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && +cd ../ && +sudo git clone https://github.com/dride/drideOS-image-generator && +cd drideOS-image-generator && sudo ./build.sh ` From 9bb2ed9537ab687626f8af9bdb7b555e56ef652d Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 16 Apr 2017 10:49:08 +0300 Subject: [PATCH 31/91] unzip Cardigan to designated dir --- stage2/01-sys-tweaks/01-run.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index d67d48c..49af103 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -107,10 +107,9 @@ sudo rm /home/node_latest_armhf.deb echo "========== Install Dride-core [Cardigan] ============" cd /home # https://github.com/dride/Cardigan/archive/0.3.zip -wget -c -O "cardigan-0.3.zip" "https://github.com/dride/Cardigan/releases/download/0.3/Cardigan.zip" -unzip -q -n "cardigan-0.3.zip" - -sudo rm cardigan-0.3.zip +sudo wget -c -O "cardigan-0.3.zip" "https://github.com/dride/Cardigan/releases/download/0.3/Cardigan.zip" +sudo mkdir Cardigan +sudo unzip "cardigan-0.3.zip" -d Cardigan sudo rm -R __MACOSX From 8ef52117e3b6859e23dacc89ce48b4297a29115d Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 16 Apr 2017 17:33:41 +0300 Subject: [PATCH 32/91] remove i2S --- stage2/01-sys-tweaks/02-I2S.sh | 388 --------------------------------- 1 file changed, 388 deletions(-) delete mode 100755 stage2/01-sys-tweaks/02-I2S.sh diff --git a/stage2/01-sys-tweaks/02-I2S.sh b/stage2/01-sys-tweaks/02-I2S.sh deleted file mode 100755 index 82d570a..0000000 --- a/stage2/01-sys-tweaks/02-I2S.sh +++ /dev/null @@ -1,388 +0,0 @@ -#!/bin/bash - -: <<'DISCLAIMER' - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -This script is licensed under the terms of the MIT license. -Unless otherwise noted, code reproduced herein -was written for this script. - -- The Pimoroni Crew - (modified by Adafruit!) - -DISCLAIMER - -# script control variables - -productname="i2s amplifier" # the name of the product to install -scriptname="i2samp" # the name of this script -spacereq=1 # minimum size required on root partition in MB -debugmode="no" # whether the script should use debug routines -debuguser="none" # optional test git user to use in debug mode -debugpoint="none" # optional git repo branch or tag to checkout -forcesudo="no" # whether the script requires to be ran with root privileges -promptreboot="no" # whether the script should always prompt user to reboot -mininstall="no" # whether the script enforces minimum install routine -customcmd="yes" # whether to execute commands specified before exit -armhfonly="yes" # whether the script is allowed to run on other arch -armv6="yes" # whether armv6 processors are supported -armv7="yes" # whether armv7 processors are supported -armv8="yes" # whether armv8 processors are supported -raspbianonly="no" # whether the script is allowed to run on other OSes -osreleases=( "Raspbian" ) # list os-releases supported -oswarning=( "Debian" "Kano" "Mate" "PiTop" "Ubuntu" ) # list experimental os-releases -osdeny=( "Darwin" "Kali" ) # list os-releases specifically disallowed - -FORCE=$1 -DEVICE_TREE=true -ASK_TO_REBOOT=false -CURRENT_SETTING=false -UPDATE_DB=false - -BOOTCMD=/boot/cmdline.txt -CONFIG=/boot/config.txt -APTSRC=/etc/apt/sources.list -INITABCONF=/etc/inittab -BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf -LOADMOD=/etc/modules -DTBODIR=/boot/overlays - -# function define - -prompt() { - read -r -p "$1 [y/N] " response < /dev/tty - if [[ $response =~ ^(yes|y|Y)$ ]]; then - true - else - false - fi -} - -success() { - echo -e "$(tput setaf 2)$1$(tput sgr0)" -} - -inform() { - echo -e "$(tput setaf 6)$1$(tput sgr0)" -} - -warning() { - echo -e "$(tput setaf 1)$1$(tput sgr0)" -} - -newline() { - echo "" -} - -progress() { - count=0 - until [ $count -eq $1 ]; do - echo -n "..." && sleep 1 - ((count++)) - done - echo -} -sudocheck() { - if [ $(id -u) -ne 0 ]; then - echo -e "Install must be run as root. Try 'sudo ./$scriptname'\n" - exit 1 - fi -} - -sysclean() { - sudo apt-get clean && sudo apt-get autoclean - sudo apt-get -y autoremove &> /dev/null -} - -sysupdate() { - if ! $UPDATE_DB; then - echo "Updating apt indexes..." && progress 3 & - sudo apt-get update 1> /dev/null || { warning "Apt failed to update indexes!" && exit 1; } - echo "Reading package lists..." - progress 3 && UPDATE_DB=true - fi -} - -sysupgrade() { - sudo apt-get upgrade - sudo apt-get clean && sudo apt-get autoclean - sudo apt-get -y autoremove &> /dev/null -} - -sysreboot() { - warning "Some changes made to your system require" - warning "your computer to reboot to take effect." - newline - if prompt "Would you like to reboot now?"; then - sync && sudo reboot - fi -} - -arch_check() { - IS_ARMHF=false - IS_ARMv6=false - - if uname -m | grep "armv.l" > /dev/null; then - IS_ARMHF=true - if uname -m | grep "armv6l" > /dev/null; then - IS_ARMv6=true - fi - fi -} - -os_check() { - IS_RASPBIAN=false - IS_MACOSX=false - IS_SUPPORTED=false - IS_EXPERIMENTAL=false - - if [ -f /etc/os-release ]; then - if cat /etc/os-release | grep "Raspbian" > /dev/null; then - IS_RASPBIAN=true && IS_SUPPORTED=true - fi - if command -v apt-get > /dev/null; then - for os in ${osreleases[@]}; do - if cat /etc/os-release | grep $os > /dev/null; then - IS_SUPPORTED=true && IS_EXPERIMENTAL=false - fi - done - for os in ${oswarning[@]}; do - if cat /etc/os-release | grep $os > /dev/null; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=true - fi - done - for os in ${osdeny[@]}; do - if cat /etc/os-release | grep $os > /dev/null; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=false - fi - done - fi - fi - if [ -d ~/.kano-settings ] || [ -d ~/.kanoprofile ]; then - IS_RASPBIAN=false - for os in ${oswarning[@]}; do - if [ $os == "Kano" ]; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=true - fi - done - for os in ${osdeny[@]}; do - if [ $os == "Kano" ]; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=false - fi - done - fi - if [ -f ~/.pt-dashboard-config ] || [ -d ~/.pt-dashboard ]; then - IS_RASPBIAN=false - for os in ${oswarning[@]}; do - if [ $os == "PiTop" ]; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=true - fi - done - for os in ${osdeny[@]}; do - if [ $os == "PiTop" ]; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=false - fi - done - fi - if [ -d ~/.config/ubuntu-mate ]; then - for os in ${osdeny[@]}; do - if [ $os == "Mate" ]; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=false - fi - done - fi - if uname -s | grep "Darwin" > /dev/null; then - IS_MACOSX=true - for os in ${osdeny[@]}; do - if [ $os == "Darwin" ]; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=false - fi - done - fi -} - -raspbian_check() { - IS_SUPPORTED=false - IS_EXPERIMENTAL=false - - if [ -f /etc/os-release ]; then - if cat /etc/os-release | grep "/sid" > /dev/null; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=true - elif cat /etc/os-release | grep "stretch" > /dev/null; then - IS_SUPPORTED=false && IS_EXPERIMENTAL=true - elif cat /etc/os-release | grep "jessie" > /dev/null; then - IS_SUPPORTED=true && IS_EXPERIMENTAL=false - elif cat /etc/os-release | grep "wheezy" > /dev/null; then - IS_SUPPORTED=true && IS_EXPERIMENTAL=false - else - IS_SUPPORTED=false && IS_EXPERIMENTAL=false - fi - fi -} - -: <<'MAINSTART' - -Perform all global variables declarations as well as function definition -above this section for clarity, thanks! - -MAINSTART - -# checks and init - -arch_check -os_check - -if [ $debugmode != "no" ]; then - echo "USER_HOME is $USER_HOME" && newline - echo "IS_RASPBIAN is $IS_RASPBIAN" - echo "IS_MACOSX is $IS_MACOSX" - echo "IS_SUPPORTED is $IS_SUPPORTED" - echo "IS_EXPERIMENTAL is $IS_EXPERIMENTAL" - newline -fi - -if ! $IS_ARMHF; then - warning "This hardware is not supported, sorry!" - warning "Config files have been left untouched" - newline && exit 1 -fi - -if $IS_ARMv8 && [ $armv8 == "no" ]; then - warning "Sorry, your CPU is not supported by this installer" - newline && exit 1 -elif $IS_ARMv7 && [ $armv7 == "no" ]; then - warning "Sorry, your CPU is not supported by this installer" - newline && exit 1 -elif $IS_ARMv6 && [ $armv6 == "no" ]; then - warning "Sorry, your CPU is not supported by this installer" - newline && exit 1 -fi - -if [ $raspbianonly == "yes" ] && ! $IS_RASPBIAN;then - warning "This script is intended for Raspbian on a Raspberry Pi!" - newline && exit 1 -fi - -if $IS_RASPBIAN; then - raspbian_check - if ! $IS_SUPPORTED && ! $IS_EXPERIMENTAL; then - newline && warning "--- Warning ---" && newline - echo "The $productname installer" - echo "does not work on this version of Raspbian." - echo "Check https://github.com/$gitusername/$gitreponame" - echo "for additional information and support" - newline && exit 1 - fi -fi - -if ! $IS_SUPPORTED && ! $IS_EXPERIMENTAL; then - warning "Your operating system is not supported, sorry!" - newline && exit 1 -fi - -if $IS_EXPERIMENTAL; then - warning "Support for your operating system is experimental. Please visit" - warning "forums.adafruit.com if you experience issues with this product." - newline -fi - -if [ $forcesudo == "yes" ]; then - sudocheck -fi - -newline -echo "This script will install everything needed to use" -echo "$productname" -newline - -newline -echo "Checking hardware requirements..." - -if [ -e $CONFIG ] && grep -q "^device_tree=$" $CONFIG; then - DEVICE_TREE=false -fi - -if $DEVICE_TREE; then - - newline - echo "Adding Device Tree Entry to $CONFIG" - - if [ -e $CONFIG ] && grep -q "^dtoverlay=hifiberry-dac$" $CONFIG; then - echo "dtoverlay already active" - else - echo "dtoverlay=hifiberry-dac" | sudo tee -a $CONFIG - ASK_TO_REBOOT=true - fi - - if [ -e $BLACKLIST ]; then - newline - echo "Commenting out Blacklist entry in " - echo "$BLACKLIST" - sudo sed -i -e "s|^blacklist[[:space:]]*i2c-bcm2708.*|#blacklist i2c-bcm2708|" \ - -e "s|^blacklist[[:space:]]*snd-soc-pcm512x.*|#blacklist snd-soc-pcm512x|" \ - -e "s|^blacklist[[:space:]]*snd-soc-wm8804.*|#blacklist snd-soc-wm8804|" $BLACKLIST &> /dev/null - fi -else - newline - echo "No Device Tree Detected, not supported" - newline - exit 1 -fi - -if [ -e $CONFIG ] && grep -q -E "^dtparam=audio=on$" $CONFIG; then - bcm2835off="no" - newline - echo "Disabling default sound driver" - sudo sed -i "s|^dtparam=audio=on$|#dtparam=audio=on|" $CONFIG &> /dev/null - if [ -e $LOADMOD ] && grep -q "^snd-bcm2835" $LOADMOD; then - sudo sed -i "s|^snd-bcm2835|#snd-bcm2835|" $LOADMOD &> /dev/null - fi - ASK_TO_REBOOT=true -elif [ -e $LOADMOD ] && grep -q "^snd-bcm2835" $LOADMOD; then - bcm2835off="no" - newline - echo "Disabling default sound module" - sudo sed -i "s|^snd-bcm2835|#snd-bcm2835|" $LOADMOD &> /dev/null - ASK_TO_REBOOT=true -else - newline - echo "Default sound driver currently not loaded" - bcm2835off="yes" -fi - -echo "Configuring sound output" -if [ -e /etc/asound.conf ]; then - if [ -e /etc/asound.conf.old ]; then - sudo rm -f /etc/asound.conf.old - fi - sudo mv /etc/asound.conf /etc/asound.conf.old -fi -sudo echo -e "pcm.\041default {\n type hw\n card 0\n}" > ~/asound.conf -sudo echo -e "ctl.\041default {\n type hw\n card 0\n}" >> ~/asound.conf -sudo mv ~/asound.conf /etc/asound.conf - -if [ $bcm2835off == "yes" ]; then - newline - echo "We can now test your $productname" - warning "Set your speakers at a low volume!" - if confirm "Do you wish to test your system now?"; then - echo "Testing..." - speaker-test -l5 -c2 -t wav - fi -fi -newline -success "All done!" -newline -echo "Enjoy your new $productname!" -newline - - - -exit 0 \ No newline at end of file From 67800dd04c71493a53766a23a8b840f4cf8634d3 Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 17 Apr 2017 12:33:18 +0300 Subject: [PATCH 33/91] remove gpsd from install --- stage2/01-sys-tweaks/01-run.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 49af103..2054f6a 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -116,7 +116,8 @@ sudo rm -R __MACOSX # make the video dir writable sudo chmod 777 -R /home/Cardigan/modules/video/ - +#make gps position writable +sudo chmod +x /home/Cardigan/daemons/gps/position @@ -265,8 +266,8 @@ sudo systemctl disable gpsd.socket # reboot # 5) Execute the daemon reset -sudo killall gpsd -sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock +#sudo killall gpsd +#sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock From 900433d1e7dc743c05bee59761c0d0a283f81d56 Mon Sep 17 00:00:00 2001 From: Yossi Date: Tue, 18 Apr 2017 09:36:32 +0300 Subject: [PATCH 34/91] fix issue with extract Cardigan.zip --- stage2/01-sys-tweaks/01-run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 2054f6a..a4a9327 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -107,11 +107,12 @@ sudo rm /home/node_latest_armhf.deb echo "========== Install Dride-core [Cardigan] ============" cd /home # https://github.com/dride/Cardigan/archive/0.3.zip +sudo mkdir Cardigan && cd Cardigan sudo wget -c -O "cardigan-0.3.zip" "https://github.com/dride/Cardigan/releases/download/0.3/Cardigan.zip" -sudo mkdir Cardigan -sudo unzip "cardigan-0.3.zip" -d Cardigan +sudo unzip "cardigan-0.3.zip" sudo rm -R __MACOSX +sudo rm -R cardigan-0.3.zip # make the video dir writable From 72360e5b27fa301bfd17bfe3aedd93b94e687a41 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 20 Apr 2017 09:05:13 +0300 Subject: [PATCH 35/91] use modified i2samp install file --- stage2/01-sys-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index a4a9327..29c6a17 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -142,7 +142,7 @@ echo "start_x=1" >> /boot/config.txt echo "========== Setup sound to I2S ============" -sudo curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash +sudo curl -sS https://dride.io/code/i2samp.sh | bash echo "========== Install mpg123 ============" sudo apt-get install mpg123 -y From 6b17fc9ba4d38f9d306a3a2e08af06bd77434e5f Mon Sep 17 00:00:00 2001 From: Yossi Date: Fri, 21 Apr 2017 09:37:51 +0300 Subject: [PATCH 36/91] install production ready npm modules --- stage2/01-sys-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 29c6a17..746abc1 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -238,7 +238,7 @@ sudo rm dride-core # run npm install on dride-ws cd /home/Cardigan/dride-ws -sudo npm i +sudo npm i --production From e308114e289e571487ce92c9cc1eedd665640e5f Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 23 Apr 2017 08:50:19 +0300 Subject: [PATCH 37/91] move i2S to bottom --- stage2/01-sys-tweaks/01-run.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 746abc1..a035216 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -139,11 +139,6 @@ echo "start_x=1" >> /boot/config.txt - - -echo "========== Setup sound to I2S ============" -sudo curl -sS https://dride.io/code/i2samp.sh | bash - echo "========== Install mpg123 ============" sudo apt-get install mpg123 -y @@ -302,7 +297,8 @@ sudo rm opencv-3.1.0.zip # TODO: Add a test if openCV was installed correctly - +echo "========== Setup sound to I2S ============" +sudo curl -sS https://dride.io/code/i2samp.sh | bash From 2a172f0c59e628a6483bbfbf4fe39459628fb269 Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 24 Apr 2017 13:07:35 +0300 Subject: [PATCH 38/91] move cardigan to end of installation process --- stage2/01-sys-tweaks/01-run.sh | 55 ++++++++++++++++------------------ 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index a035216..c4cc093 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -103,25 +103,6 @@ sudo rm /home/node_latest_armhf.deb - -echo "========== Install Dride-core [Cardigan] ============" -cd /home -# https://github.com/dride/Cardigan/archive/0.3.zip -sudo mkdir Cardigan && cd Cardigan -sudo wget -c -O "cardigan-0.3.zip" "https://github.com/dride/Cardigan/releases/download/0.3/Cardigan.zip" -sudo unzip "cardigan-0.3.zip" - -sudo rm -R __MACOSX -sudo rm -R cardigan-0.3.zip - - -# make the video dir writable -sudo chmod 777 -R /home/Cardigan/modules/video/ -#make gps position writable -sudo chmod +x /home/Cardigan/daemons/gps/position - - - echo "========== Installing pip ============" sudo apt-get install python-pip -y @@ -228,16 +209,6 @@ sudo rm dride-core - - -# run npm install on dride-ws -cd /home/Cardigan/dride-ws - -sudo npm i --production - - - - ## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 echo "========== Install GPS ============" sudo apt-get install gpsd gpsd-clients cmake subversion build-essential espeak freeglut3-dev imagemagick libdbus-1-dev libdbus-glib-1-dev libdevil-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgarmin-dev libglc-dev libgps-dev libgtk2.0-dev libimlib2-dev libpq-dev libqt4-dev libqtwebkit-dev librsvg2-bin libsdl-image1.2-dev libspeechd-dev libxml2-dev ttf-liberation -y @@ -301,6 +272,32 @@ echo "========== Setup sound to I2S ============" sudo curl -sS https://dride.io/code/i2samp.sh | bash +echo "========== Install Dride-core [Cardigan] ============" +cd /home +# https://github.com/dride/Cardigan/archive/0.3.zip +sudo mkdir Cardigan && cd Cardigan +sudo wget -c -O "cardigan-0.3.zip" "https://github.com/dride/Cardigan/releases/download/0.3/Cardigan.zip" +sudo unzip "cardigan-0.3.zip" + +sudo rm -R __MACOSX +sudo rm -R cardigan-0.3.zip + + +# make the video dir writable +sudo chmod 777 -R /home/Cardigan/modules/video/ +#make gps position writable +sudo chmod +x /home/Cardigan/daemons/gps/position + + + + +# run npm install on dride-ws +cd /home/Cardigan/dride-ws + +sudo npm i --production + + + From fcfa6df232351e58e5c2579935b3b6602958219d Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 24 Apr 2017 21:51:26 +0300 Subject: [PATCH 39/91] Use Cardigan v0.3.1 :racehorse: --- stage2/01-sys-tweaks/01-run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index c4cc093..075475c 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -276,11 +276,11 @@ echo "========== Install Dride-core [Cardigan] ============" cd /home # https://github.com/dride/Cardigan/archive/0.3.zip sudo mkdir Cardigan && cd Cardigan -sudo wget -c -O "cardigan-0.3.zip" "https://github.com/dride/Cardigan/releases/download/0.3/Cardigan.zip" -sudo unzip "cardigan-0.3.zip" +sudo wget -c -O "cardigan-0.3.1.zip" "https://github.com/dride/Cardigan/releases/download/0.3.1/Cardigan.zip" +sudo unzip "cardigan-0.3.1.zip" sudo rm -R __MACOSX -sudo rm -R cardigan-0.3.zip +sudo rm -R cardigan-0.3.1.zip # make the video dir writable From 7e2138139ba95eac9b618f3ddce1362814844bc8 Mon Sep 17 00:00:00 2001 From: Yossi Date: Tue, 25 Apr 2017 09:03:56 +0300 Subject: [PATCH 40/91] make settings folder writable --- stage2/01-sys-tweaks/01-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 075475c..72d0d72 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -285,6 +285,7 @@ sudo rm -R cardigan-0.3.1.zip # make the video dir writable sudo chmod 777 -R /home/Cardigan/modules/video/ +sudo chmod 777 -R /home/Cardigan/settings/video/ #make gps position writable sudo chmod +x /home/Cardigan/daemons/gps/position From 8bf08b9b79d524e5607a26207a32f7e789501d6d Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 30 Apr 2017 09:19:50 +0300 Subject: [PATCH 41/91] more tweets --- stage2/01-sys-tweaks/01-run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 72d0d72..e4ee6ee 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -289,7 +289,10 @@ sudo chmod 777 -R /home/Cardigan/settings/video/ #make gps position writable sudo chmod +x /home/Cardigan/daemons/gps/position - +# make the firmware dir writable +cd /home/Cardigan +sudo mkdir firmware +sudo chmod 777 -R /home/Cardigan/firmware/ # run npm install on dride-ws @@ -299,9 +302,6 @@ sudo npm i --production - - - echo "" echo '=============================' echo '*****************************' From c0cdf6482528877091778271db3fe88ef886f0b2 Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 30 Apr 2017 09:21:16 +0300 Subject: [PATCH 42/91] get latests cardigan from S3 static url --- stage2/01-sys-tweaks/01-run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index e4ee6ee..01340ad 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -274,13 +274,13 @@ sudo curl -sS https://dride.io/code/i2samp.sh | bash echo "========== Install Dride-core [Cardigan] ============" cd /home -# https://github.com/dride/Cardigan/archive/0.3.zip +# https://s3.amazonaws.com/dride/releases/cardigan/latest.zip sudo mkdir Cardigan && cd Cardigan -sudo wget -c -O "cardigan-0.3.1.zip" "https://github.com/dride/Cardigan/releases/download/0.3.1/Cardigan.zip" -sudo unzip "cardigan-0.3.1.zip" +sudo wget -c -O "cardigan.zip" "https://s3.amazonaws.com/dride/releases/cardigan/latest.zip" +sudo unzip "cardigan.zip" sudo rm -R __MACOSX -sudo rm -R cardigan-0.3.1.zip +sudo rm -R cardigan.zip # make the video dir writable From 3b1bdb22713582aa731d83e44066eee14e30a1db Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 7 May 2017 17:24:16 +0300 Subject: [PATCH 43/91] Fix resize issue --- stage2/01-sys-tweaks/01-run.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 01340ad..971cc35 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -188,6 +188,7 @@ sudo update-rc.d isc-dhcp-server enable sudo wget https://dride.io/code/startup/dride-ws sudo wget https://dride.io/code/startup/dride-core +sudo wget https://dride.io/code/startup/drideOS-resize #startup script's @@ -195,8 +196,6 @@ sudo wget https://dride.io/code/startup/dride-core sudo cp dride-ws /etc/init.d/dride-ws sudo chmod +x /etc/init.d/dride-ws sudo update-rc.d dride-ws defaults - - sudo rm dride-ws # dride-core on startup @@ -205,6 +204,12 @@ sudo chmod +x /etc/init.d/dride-core sudo update-rc.d dride-core defaults sudo rm dride-core +# drideOS-resize on startup +sudo cp dride-core /etc/init.d/drideOS-resize +sudo chmod +x /etc/init.d/drideOS-resize +sudo update-rc.d drideOS-resize defaults +sudo rm drideOS-resize + @@ -220,7 +225,8 @@ echo "" >> /boot/config.txt echo "core_freq=250" >> /boot/config.txt echo "enable_uart=1" >> /boot/config.txt -echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt +# this will be done after initial boot +# echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt From 2ced322c137031c6e4aac1764438a1da091b7d12 Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 8 May 2017 08:51:45 +0300 Subject: [PATCH 44/91] fix typo --- stage2/01-sys-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 971cc35..37aa45a 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -205,7 +205,7 @@ sudo update-rc.d dride-core defaults sudo rm dride-core # drideOS-resize on startup -sudo cp dride-core /etc/init.d/drideOS-resize +sudo cp drideOS-resize /etc/init.d/drideOS-resize sudo chmod +x /etc/init.d/drideOS-resize sudo update-rc.d drideOS-resize defaults sudo rm drideOS-resize From a7615f5b4df41b8f76e718926489be6c9a3140e4 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 10 May 2017 21:25:56 +0300 Subject: [PATCH 45/91] close dride/Cardigan#31 --- stage2/01-sys-tweaks/01-run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 37aa45a..3c5d82b 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -113,10 +113,11 @@ echo "========== Install picamera ============" sudo pip install "picamera[array]==1.12" -# enable camera on raspi-config +# enable camera on raspi-config and allocate more ram to the GPU echo "" >> /boot/config.txt echo "#enable piCaera" >> /boot/config.txt echo "start_x=1" >> /boot/config.txt +echo "gpu_mem=256" >> /boot/config.txt From dd04197a4aa065eb86f68e94467de489912ddb43 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 24 May 2017 17:31:23 +0300 Subject: [PATCH 46/91] Add bluetooth dride/Cardigan#33 --- stage2/01-sys-tweaks/01-run.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 3c5d82b..905a9b9 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -309,6 +309,18 @@ sudo npm i --production +echo "========== Setup bluetooth ============" + +sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev + + +# run npm install on Bluetooth daemon +cd /home/Cardigan/daemons/bluetooth +sudo npm i --production + + + + echo "" echo '=============================' echo '*****************************' From 047334dea0d89897780410fd6e277af4d39d92d7 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 7 Jun 2017 13:43:07 +0300 Subject: [PATCH 47/91] bluetooth setup fixes --- stage2/01-sys-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 905a9b9..5cd7032 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -311,7 +311,7 @@ sudo npm i --production echo "========== Setup bluetooth ============" -sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev +sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev -y # run npm install on Bluetooth daemon From 4df2c00cee983d5016cf5da05ee2ae7bb803a62c Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 7 Jun 2017 13:44:00 +0300 Subject: [PATCH 48/91] Merge remote-tracking branch 'RPi-Distro/dev' into dev # Conflicts: # README.md # stage3/00-install-packages/00-packages --- README.md | 142 ++++++++++++++++++++++++++ scripts/common | 4 +- stage0/files/raspberrypi.gpg | Bin 0 -> 2424 bytes stage1/00-boot-files/files/config.txt | 2 +- 4 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 stage0/files/raspberrypi.gpg diff --git a/README.md b/README.md index 9b404fe..f957079 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +<<<<<<< HEAD #Dependencies `sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && @@ -9,9 +10,109 @@ sudo ./build.sh #Stage Anatomy +======= +# pi-gen + +_Tool used to create the raspberrypi.org Raspbian images_ +### TODO +1. Documentation + + +## Dependencies + +On Debian-based systems: + +```bash +apt-get install quilt parted realpath qemu-user-static debootstrap zerofree pxz zip \ +dosfstools bsdtar libcap2-bin grep rsync +``` + +The file `depends` contains a list of tools needed. The format of this +package is `[:]`. + +>>>>>>> RPi-Distro/dev + + +<<<<<<< HEAD # drideOS (Raspbian) Stage Overview +======= +Upon execution, `build.sh` will source the file `config` in the current +working directory. This bash shell fragment is intended to set needed +environment variables. + +The following environment variables are supported: + + * `IMG_NAME` **required** (Default: unset) + + The name of the image to build with the current stage directories. Setting + `IMG_NAME=Raspbian` is logical for an unmodified RPi-Distro/pi-gen build, + but you should use something else for a customized version. Export files + in stages may add suffixes to `IMG_NAME`. + + * `APT_PROXY` (Default: unset) + + If you require the use of an apt proxy, set it here. This proxy setting + will not be included in the image, making it safe to use an `apt-cacher` or + similar package for development. + + * `BASE_DIR` (Default: location of `build.sh`) + + **CAUTION**: Currently, changing this value will probably break build.sh + + Top-level directory for `pi-gen`. Contains stage directories, build + scripts, and by default both work and deployment directories. + + * `WORK_DIR` (Default: `"$BASE_DIR/work"`) + + Directory in which `pi-gen` builds the target system. This value can be + changed if you have a suitably large, fast storage location for stages to + be built and cached. Note, `WORK_DIR` stores a complete copy of the target + system for each build stage, amounting to tens of gigabytes in the case of + Raspbian. + + * `DEPLOY_DIR` (Default: `"$BASE_DIR/deploy"`) + + Output directory for target system images and NOOBS bundles. + + +A simple example for building Raspbian: + +```bash +IMG_NAME='Raspbian' +``` + + +## Docker Build + +```bash +vi config # Edit your config file. See above. +./build-docker.sh +``` + +If everything goes well, your finished image will be in the `deploy/` folder. +You can then remove the build container with `docker rm pigen_work` + +If something breaks along the line, you can edit the corresponding scripts, and +continue: + +```bash +CONTINUE=1 ./build-docker.sh +``` + +There is a possibility that even when running from a docker container, the +installation of `qemu-user-static` will silently fail when building the image +because `binfmt-support` _must be enabled on the underlying kernel_. An easy +fix is to ensure `binfmt-support` is installed on the host machine before +starting the `./build-docker.sh` script (or using your own docker build +solution). + + +## Stage Anatomy + +### Raspbian Stage Overview +>>>>>>> RPi-Distro/dev The build of Raspbian is divided up into several stages for logical clarity and modularity. This causes some initial complexity, but it simplifies @@ -41,4 +142,45 @@ maintenance and allows for more easy customization. creates necessary groups and gives the pi user access to sudo and the standard console hardware permission groups. +<<<<<<< HEAD - Stage 3, Install Dride related softwere. +======= + There are a few tools that may not make a whole lot of sense here for + development purposes on a minimal system such as basic python and lua + packages as well as the `build-essential` package. They are lumped right + in with more essential packages presently, though they need not be with + pi-gen. These are understandable for Raspbian's target audience, but if + you were looking for something between truly minimal and Raspbian-lite, + here's where you start trimming. + + - **Stage 3** - desktop system. Here's where you get the full desktop system + with X11 and LXDE, web browsers, git for development, Raspbian custom UI + enhancements, etc. This is a base desktop system, with some development + tools installed. + + - **Stage 4** - complete Raspbian system. More development tools, an email + client, learning tools like Scratch, specialized packages like sonic-pi and + wolfram-engine, system documentation, office productivity, etc. This is + the stage that installs all of the things that make Raspbian friendly to + new users. + + +### Stage specification + +If you wish to build up to a specified stage (such as building up to stage 2 +for a lite system), place an empty file named `SKIP` in each of the `./stage` +directories you wish not to include. + +Then remove the `EXPORT*` files from `./stage4` (if building up to stage 2) or +from `./stage2` (if building a minimal system). + +```bash +# Example for building a lite system +touch ./stage3/SKIP ./stage4/SKIP +rm stage4/EXPORT* +``` + +If you wish to build further configurations upon (for example) the lite +system, you can also delete the contents of `./stage3` and `./stage4` and +replace with your own contents in the same format. +>>>>>>> RPi-Distro/dev diff --git a/scripts/common b/scripts/common index bd18a07..74f9c4c 100644 --- a/scripts/common +++ b/scripts/common @@ -16,8 +16,8 @@ bootstrap(){ fi capsh --drop=cap_setfcap -- -c "${BOOTSTRAP_CMD} --components=main,contrib,non-free \ - --arch armhf\ - --no-check-gpg \ + --arch armhf \ + --keyring "${STAGE_DIR}/files/raspberrypi.gpg" \ $1 $2 $3" } export -f bootstrap diff --git a/stage0/files/raspberrypi.gpg b/stage0/files/raspberrypi.gpg new file mode 100644 index 0000000000000000000000000000000000000000..fe1d207eb1ec50f159e3b99415dd00b363262fb4 GIT binary patch literal 2424 zcmajf`9Bkm1IO`g$dxlg3|nqBYx(5Zgek`-np@?b%q)hMn-Fp~bJUt6M>LceeR3py z33zN-wQ)cf;uUeFE+kR6asG;1g4)c~?SHQ$=8Wh@j|vEt)EP zw>6gjR^p%}8+IO<=Is@s9Lg`tc)7$CalzlL<*q#Ss&inZP=IO}dHLtZ;dT%pjW>{+ z<{#eRnp3JQ*DIY7k<=gaDk+wzVhXMdit1*7yC#P7A2PDgpZ1giB0vD}7pOJvy1zS~ zOb&%w5}_FK6)$2C9%@4*_!4~yP&0gJ5>T7-2oMA~#s&Iu97vku5I-*uHwWktmSycpR@bY3LlBd(Lmco( zP0`Q@FQ$TGqJRU9tY@%+VlYxwCdzLWNuF&^e<&hRryZQi-Iz%9c`8_W#*;OJ>5s49 z4XdSj<%cOIx2thETO{<*-v7dZqMdg9IOZsHb;6Ze3-@n)a62gSa$3F`vq*Wo?2;(v z32@FK&X5Wpd9i!ec6OQF3)l7}iOe!V0FL_qfa|;Kh{0oPBYpSJBj3*h`NaD`Gv-o5 zR|-oeq@Hd&2=XY!D^B;l+nO7)A9!Qav9y4Fa$=iW0+Vsrt&B&ouDQ=}CrAMncg`YN z;7IoQ{^HTi3ATN)lv&KvX1D<`N=p4gVd<+U=k(3;^rz?4%SzQ84FhH(yKZu}zh(|(UCdLVYiCEmafUJ9 za5?RC7ZYAHC%cP7%XySq_uqFyr_NwfVSj>40?Khpe&@vdH>bn@RAZFPeGm}+?9pKF zg@*cL%{uj&qe~Iwz(S?qs35Gy9h>#XxDlc@Rc=CHP*Gy*>tRldhpKHb}nWgbo#Z5Zv(vL{F}V`Ue6rWZmM)twq+7nQcw1hhTXpv**GFu+*H(AcjwteFww%Gh*Evrz zS)=P$ZLncm9b7+9HJbDNX;&6~&9Xni19j|l+iviS{WbklxNEYGIe2*VGep1|4 z!=sc{ZxME+4X={3`s+$x_f(^XL$Y&Rn^TM+rFINLMNvljpgnnJ-+rjc`k^MInfN_Z z1CDg5_1wfNl4>_;YBzP^>$LkriO-X(CSFE)oowqRZks^0UgHYL(+gk0Wui&{En>UvxNY6kvl>lBbv^?q<5r0y@}Q zUuRWPu$GnZ36K`XeJy|;H!gw9_xy;pawEcpn3-z1nEK0b9`U!Z4?B>U zjEmk4NSk9O2gjAII(^)PYPd~=EFT`Ns7XhzuegY6+D=&2)2s^>l~=btT%+-SW$OF| zqBkCD>*YuCzwYM?Rr#-Kox{5malTL-ndIdO#aLem(mZZ&Y^e&>CHV*ZYhgej;fOx! zSNuqN{|wsqi~nEH((##;wEb!ILOvcq>)yilp~10M8Bgs=EVGz;2|KN?LH(Md-(hhx zmsV(Z;Qcc_h&2+e#dY|G!}w;>ogLUm@gBNV2F|an=<0l~%V^&_scFVwt=Agv9#pJ) zy0&tSIr~!MQVu<=x)0RM=v{74wUA6HOZZ|0kL9|h`Wg~wJ9AIbv`;u{T-yCk_>~gm zxTF>>rJSn`SrY66hvXM-U(4uHlT$g|JL*ZwQ|R!VA4=AKAU_RH;HeG}IW#*9scRMK zl&F|_>CcBnY&S}M4GM{`V&Aveo&RhZs8GVIG9+699esVUJsc5dtMgjyUcivcQBFs_ zf~bS?=&hg3Z`%~Ai?MgokAJ%OXUPw*I^2o0nM?D|6i4Lbb+_%OcmG4Nt@9a74OJ zxp3d}4r|#cj?)3hdSgDQh&dNJG0W72LYLG>q-nF=gPGs_h~b9Vck+NCQKgnd?>SS* zt(6EX5s&HOfK?iwTqiQg6Wdjr9H!%)#EqbGzpk_EGfa_@J*Dja-0|iB56xw<^0=Z} zUN_pv3jK@}6rf9OvIV~7)zlg&xEK%i?x+A%9(HorlSVCmRJE@zUO@})Y-ZlxH&7}U zUwKeLcuc?3a^5ZOWnl}}FSsq$^?!o)C#OGy_P3f7Ej)k+8uwFwf(@>d53ZKU+F_KS zZ^kxED>&c{2wqt(EX3j2i@{K_^YV`D_2eYf=I3N@{u*-s<5)u6lw;_jTX7Xe8=Uqs zt2No%*puq_a}u&H6jFu(t7LJB7LYkO>Hff1DGfwQs(X!>l3BI=dKYWU()UPq|I7|jmGd(CuMVKStovlS0kL+1NHKvb~7m( mbBSW>Gh1o8c0o;U`-#rW9O+jWRw=$sZP6z*Zm`)u)cgU2<6m6> literal 0 HcmV?d00001 diff --git a/stage1/00-boot-files/files/config.txt b/stage1/00-boot-files/files/config.txt index 9c6860c..06364c5 100644 --- a/stage1/00-boot-files/files/config.txt +++ b/stage1/00-boot-files/files/config.txt @@ -1,5 +1,5 @@ # For more options and information see -# http://rpf.io/configtxtreadme +# http://rpf.io/configtxt # Some settings may impact device functionality. See link above for details # uncomment if you get no picture on HDMI for a default "safe" mode From bc3721a7bb3edcad98acc58e7bcc70d0fec5c214 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 14 Jun 2017 13:42:24 +0300 Subject: [PATCH 49/91] don't install openCV on drideOSZ --- build.sh | 2 ++ stage2/01-sys-tweaks/01-run.sh | 52 +++++++++++++++++----------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/build.sh b/build.sh index 25a8539..f9b26f9 100755 --- a/build.sh +++ b/build.sh @@ -130,6 +130,8 @@ fi export IMG_DATE=${IMG_DATE:-"$(date -u +%Y-%m-%d)"} +export OS_TYPE=$1 + export BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export SCRIPT_DIR="${BASE_DIR}/scripts" export WORK_DIR=${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"} diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 5cd7032..691c974 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -46,7 +46,7 @@ on_chroot << EOF #------------------------------------------------------- # Script to check if all is good before install script runs #------------------------------------------------------- - +echo OS_TYPE echo "====== Dride install script ======" echo "" echo "" @@ -90,8 +90,8 @@ echo "========== Installing build-essential ============" sudo apt-get install build-essential -y -echo "========== Installing libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev ============" -sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev -y +echo "========== Installing libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev gpac ============" +sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev gpac -y # Install Node @@ -117,7 +117,7 @@ sudo pip install "picamera[array]==1.12" echo "" >> /boot/config.txt echo "#enable piCaera" >> /boot/config.txt echo "start_x=1" >> /boot/config.txt -echo "gpu_mem=256" >> /boot/config.txt +echo "gpu_mem=128" >> /boot/config.txt @@ -248,32 +248,32 @@ sudo systemctl disable gpsd.socket +if [ OS_TYPE == "drideOS" ]; then + echo "========== Downloading and installing OpenCV ============" + cd / + # git clone https://github.com/Itseez/opencv.git --depth 1 + wget -c -O "opencv-3.1.0.zip" "https://github.com/Itseez/opencv/archive/3.1.0.zip" + sudo apt-get install unzip + unzip -q -n "opencv-3.1.0.zip" -echo "========== Downloading and installing OpenCV ============" -cd / -# git clone https://github.com/Itseez/opencv.git --depth 1 -wget -c -O "opencv-3.1.0.zip" "https://github.com/Itseez/opencv/archive/3.1.0.zip" -sudo apt-get install unzip -unzip -q -n "opencv-3.1.0.zip" + cd opencv-3.1.0 + echo "==>>>====== Building OpenCV ============" + cd /home/opencv-3.1.0 + mkdir build + cd build + cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D CMAKE_INSTALL_PREFIX=/usr/local .. + echo "==>>>====== This might take a long time.. ============" + make -j1 -cd opencv-3.1.0 -echo "==>>>====== Building OpenCV ============" -cd /home/opencv-3.1.0 -mkdir build -cd build -cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D CMAKE_INSTALL_PREFIX=/usr/local .. -echo "==>>>====== This might take a long time.. ============" -make -j1 + sudo make install + sudo ldconfig -sudo make install -sudo ldconfig - -# remove the installation file -cd / -sudo rm opencv-3.1.0.zip - -# TODO: Add a test if openCV was installed correctly + # remove the installation file + cd / + sudo rm opencv-3.1.0.zip + # TODO: Add a test if openCV was installed correctly +fi echo "========== Setup sound to I2S ============" sudo curl -sS https://dride.io/code/i2samp.sh | bash From 75bb3a5559f9883f7cd324cd2b11745823b83109 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 14 Jun 2017 14:01:02 +0300 Subject: [PATCH 50/91] update readme --- README.md | 82 +------------------------------------------------------ 1 file changed, 1 insertion(+), 81 deletions(-) diff --git a/README.md b/README.md index f957079..ab19c15 100755 --- a/README.md +++ b/README.md @@ -1,41 +1,3 @@ -<<<<<<< HEAD -#Dependencies - -`sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && -cd ../ && -sudo git clone https://github.com/dride/drideOS-image-generator && -cd drideOS-image-generator && -sudo ./build.sh -` - -#Stage Anatomy - -======= -# pi-gen - -_Tool used to create the raspberrypi.org Raspbian images_ - - -### TODO -1. Documentation - - -## Dependencies - -On Debian-based systems: - -```bash -apt-get install quilt parted realpath qemu-user-static debootstrap zerofree pxz zip \ -dosfstools bsdtar libcap2-bin grep rsync -``` - -The file `depends` contains a list of tools needed. The format of this -package is `[:]`. - ->>>>>>> RPi-Distro/dev - - -<<<<<<< HEAD # drideOS (Raspbian) Stage Overview ======= Upon execution, `build.sh` will source the file `config` in the current @@ -112,7 +74,7 @@ solution). ## Stage Anatomy ### Raspbian Stage Overview ->>>>>>> RPi-Distro/dev + The build of Raspbian is divided up into several stages for logical clarity and modularity. This causes some initial complexity, but it simplifies @@ -142,45 +104,3 @@ maintenance and allows for more easy customization. creates necessary groups and gives the pi user access to sudo and the standard console hardware permission groups. -<<<<<<< HEAD -- Stage 3, Install Dride related softwere. -======= - There are a few tools that may not make a whole lot of sense here for - development purposes on a minimal system such as basic python and lua - packages as well as the `build-essential` package. They are lumped right - in with more essential packages presently, though they need not be with - pi-gen. These are understandable for Raspbian's target audience, but if - you were looking for something between truly minimal and Raspbian-lite, - here's where you start trimming. - - - **Stage 3** - desktop system. Here's where you get the full desktop system - with X11 and LXDE, web browsers, git for development, Raspbian custom UI - enhancements, etc. This is a base desktop system, with some development - tools installed. - - - **Stage 4** - complete Raspbian system. More development tools, an email - client, learning tools like Scratch, specialized packages like sonic-pi and - wolfram-engine, system documentation, office productivity, etc. This is - the stage that installs all of the things that make Raspbian friendly to - new users. - - -### Stage specification - -If you wish to build up to a specified stage (such as building up to stage 2 -for a lite system), place an empty file named `SKIP` in each of the `./stage` -directories you wish not to include. - -Then remove the `EXPORT*` files from `./stage4` (if building up to stage 2) or -from `./stage2` (if building a minimal system). - -```bash -# Example for building a lite system -touch ./stage3/SKIP ./stage4/SKIP -rm stage4/EXPORT* -``` - -If you wish to build further configurations upon (for example) the lite -system, you can also delete the contents of `./stage3` and `./stage4` and -replace with your own contents in the same format. ->>>>>>> RPi-Distro/dev From f443722dc0cddee3da3394e329477fb4069ac951 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 14 Jun 2017 14:02:45 +0300 Subject: [PATCH 51/91] update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ab19c15..607fa9a 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +#Dependencies + +sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && cd ../ && sudo git clone https://github.com/dride/drideOS-image-generator && cd drideOS-image-generator && sudo ./build.sh + # drideOS (Raspbian) Stage Overview ======= Upon execution, `build.sh` will source the file `config` in the current From 3c431ecf3090e2de65feddf562405c0aa0c6e3d4 Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Wed, 14 Jun 2017 14:03:33 +0300 Subject: [PATCH 52/91] Create README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 607fa9a..b95008b 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ -#Dependencies +# Dependencies sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && cd ../ && sudo git clone https://github.com/dride/drideOS-image-generator && cd drideOS-image-generator && sudo ./build.sh # drideOS (Raspbian) Stage Overview -======= + + Upon execution, `build.sh` will source the file `config` in the current working directory. This bash shell fragment is intended to set needed environment variables. From 7290ed89813113a90707bd1ace12391f6b433281 Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Wed, 14 Jun 2017 14:10:20 +0300 Subject: [PATCH 53/91] Create README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b95008b..70be5fe 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dependencies -sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && cd ../ && sudo git clone https://github.com/dride/drideOS-image-generator && cd drideOS-image-generator && sudo ./build.sh + sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && cd ../ && sudo git clone https://github.com/dride/drideOS-image-generator && cd drideOS-image-generator && sudo ./build.sh # drideOS (Raspbian) Stage Overview From ae1c57146f71c1a59cf34a4955d94c0b1a734337 Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Wed, 14 Jun 2017 14:11:03 +0300 Subject: [PATCH 54/91] Create README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 70be5fe..44c8613 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Dependencies - sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && cd ../ && sudo git clone https://github.com/dride/drideOS-image-generator && cd drideOS-image-generator && sudo ./build.sh + sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && cd ../ && + sudo git clone https://github.com/dride/drideOS-image-generator && cd drideOS-image-generator && sudo ./build.sh # drideOS (Raspbian) Stage Overview From dac8450eff4214b4fcc6a78a4920a59b745a2448 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 15 Jun 2017 08:14:53 +0300 Subject: [PATCH 55/91] remove more packages unnecessary for drideOSZ --- stage2/01-sys-tweaks/01-run.sh | 75 ++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 691c974..2abbc0e 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -46,7 +46,6 @@ on_chroot << EOF #------------------------------------------------------- # Script to check if all is good before install script runs #------------------------------------------------------- -echo OS_TYPE echo "====== Dride install script ======" echo "" echo "" @@ -86,12 +85,17 @@ echo "========== Update Aptitude ===========" # sudo apt-get update -y # sudo apt-get upgrade -echo "========== Installing build-essential ============" -sudo apt-get install build-essential -y +if [ ${OS_TYPE} == "drideOS" ]; then + echo "========== Installing build-essential ============" + sudo apt-get install build-essential -y -echo "========== Installing libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev gpac ============" -sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev gpac -y + echo "========== Installing libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev ============" + sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libjasper-dev python2.7-dev -y +fi + +echo "========== Installing gpac ============" +sudo apt-get install gpac -y # Install Node @@ -102,12 +106,13 @@ sudo dpkg -i node_latest_armhf.deb sudo rm /home/node_latest_armhf.deb +if [ ${OS_TYPE} == "drideOS" ]; then + echo "========== Installing pip ============" + sudo apt-get install python-pip -y -echo "========== Installing pip ============" -sudo apt-get install python-pip -y - -echo "========== Installing Numpy ============" -sudo pip install numpy + echo "========== Installing Numpy ============" + sudo pip install numpy +fi echo "========== Install picamera ============" sudo pip install "picamera[array]==1.12" @@ -120,10 +125,10 @@ echo "start_x=1" >> /boot/config.txt echo "gpu_mem=128" >> /boot/config.txt - -echo "========== Install mpg123 ============" -sudo apt-get install mpg123 -y - +if [ ${OS_TYPE} == "drideOS" ]; then + echo "========== Install mpg123 ============" + sudo apt-get install mpg123 -y +fi # Install WIFi echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections @@ -214,41 +219,41 @@ sudo rm drideOS-resize +if [ ${OS_TYPE} == "drideOS" ]; then + ## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 + echo "========== Install GPS ============" + sudo apt-get install gpsd gpsd-clients cmake subversion build-essential espeak freeglut3-dev imagemagick libdbus-1-dev libdbus-glib-1-dev libdevil-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgarmin-dev libglc-dev libgps-dev libgtk2.0-dev libimlib2-dev libpq-dev libqt4-dev libqtwebkit-dev librsvg2-bin libsdl-image1.2-dev libspeechd-dev libxml2-dev ttf-liberation -y -## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 -echo "========== Install GPS ============" -sudo apt-get install gpsd gpsd-clients cmake subversion build-essential espeak freeglut3-dev imagemagick libdbus-1-dev libdbus-glib-1-dev libdevil-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgarmin-dev libglc-dev libgps-dev libgtk2.0-dev libimlib2-dev libpq-dev libqt4-dev libqtwebkit-dev librsvg2-bin libsdl-image1.2-dev libspeechd-dev libxml2-dev ttf-liberation -y - -sudo pip install pyserial + sudo pip install pyserial -echo "" >> /boot/config.txt -echo "core_freq=250" >> /boot/config.txt -echo "enable_uart=1" >> /boot/config.txt + echo "" >> /boot/config.txt + echo "core_freq=250" >> /boot/config.txt + echo "enable_uart=1" >> /boot/config.txt -# this will be done after initial boot -# echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt + # this will be done after initial boot + # echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt -# 3)Run -sudo systemctl stop serial-getty@ttyS0.service -sudo systemctl disable serial-getty@ttyS0.service -sudo systemctl stop gpsd.socket -sudo systemctl disable gpsd.socket + # 3)Run + sudo systemctl stop serial-getty@ttyS0.service + sudo systemctl disable serial-getty@ttyS0.service + sudo systemctl stop gpsd.socket + sudo systemctl disable gpsd.socket -# reboot + # reboot -# 5) Execute the daemon reset -#sudo killall gpsd -#sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock + # 5) Execute the daemon reset + #sudo killall gpsd + #sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock +fi - -if [ OS_TYPE == "drideOS" ]; then +if [ ${OS_TYPE} == "drideOS" ]; then echo "========== Downloading and installing OpenCV ============" cd / # git clone https://github.com/Itseez/opencv.git --depth 1 From 541915a2ab45b7d6308bd08d1bd02596eef6994f Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 15 Jun 2017 10:25:56 +0300 Subject: [PATCH 56/91] add pip to OSZ --- stage2/01-sys-tweaks/01-run.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 2abbc0e..88f9f0d 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -106,10 +106,11 @@ sudo dpkg -i node_latest_armhf.deb sudo rm /home/node_latest_armhf.deb -if [ ${OS_TYPE} == "drideOS" ]; then - echo "========== Installing pip ============" - sudo apt-get install python-pip -y +echo "========== Installing pip ============" +sudo apt-get install python-pip -y + +if [ ${OS_TYPE} == "drideOS" ]; then echo "========== Installing Numpy ============" sudo pip install numpy fi From 334972f649f6f6af1a38bb1545169be3e7c43fca Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 15 Jun 2017 12:37:03 +0300 Subject: [PATCH 57/91] added GPS to all builds --- stage2/01-sys-tweaks/01-run.sh | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 88f9f0d..5ecbbce 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -220,35 +220,35 @@ sudo rm drideOS-resize -if [ ${OS_TYPE} == "drideOS" ]; then - ## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 - echo "========== Install GPS ============" - sudo apt-get install gpsd gpsd-clients cmake subversion build-essential espeak freeglut3-dev imagemagick libdbus-1-dev libdbus-glib-1-dev libdevil-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgarmin-dev libglc-dev libgps-dev libgtk2.0-dev libimlib2-dev libpq-dev libqt4-dev libqtwebkit-dev librsvg2-bin libsdl-image1.2-dev libspeechd-dev libxml2-dev ttf-liberation -y - sudo pip install pyserial +## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 +echo "========== Install GPS ============" +sudo apt-get install gpsd gpsd-clients cmake subversion build-essential espeak freeglut3-dev imagemagick libdbus-1-dev libdbus-glib-1-dev libdevil-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgarmin-dev libglc-dev libgps-dev libgtk2.0-dev libimlib2-dev libpq-dev libqt4-dev libqtwebkit-dev librsvg2-bin libsdl-image1.2-dev libspeechd-dev libxml2-dev ttf-liberation -y + +sudo pip install pyserial - echo "" >> /boot/config.txt - echo "core_freq=250" >> /boot/config.txt - echo "enable_uart=1" >> /boot/config.txt +echo "" >> /boot/config.txt +echo "core_freq=250" >> /boot/config.txt +echo "enable_uart=1" >> /boot/config.txt - # this will be done after initial boot - # echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt +# this will be done after initial boot +# echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt - # 3)Run - sudo systemctl stop serial-getty@ttyS0.service - sudo systemctl disable serial-getty@ttyS0.service - sudo systemctl stop gpsd.socket - sudo systemctl disable gpsd.socket +# 3)Run +sudo systemctl stop serial-getty@ttyS0.service +sudo systemctl disable serial-getty@ttyS0.service +sudo systemctl stop gpsd.socket +sudo systemctl disable gpsd.socket - # reboot +# reboot + +# 5) Execute the daemon reset +#sudo killall gpsd +#sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock - # 5) Execute the daemon reset - #sudo killall gpsd - #sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock -fi From 748ec17bfa2f2c801c4f3f776def3992c90056cf Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 15 Jun 2017 13:02:44 +0300 Subject: [PATCH 58/91] remove GPS from OSZ :) --- stage2/01-sys-tweaks/01-run.sh | 53 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 5ecbbce..7a286bc 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -211,44 +211,45 @@ sudo chmod +x /etc/init.d/dride-core sudo update-rc.d dride-core defaults sudo rm dride-core -# drideOS-resize on startup -sudo cp drideOS-resize /etc/init.d/drideOS-resize -sudo chmod +x /etc/init.d/drideOS-resize -sudo update-rc.d drideOS-resize defaults -sudo rm drideOS-resize +if [ ${OS_TYPE} == "drideOS" ]; then + # drideOS-resize on startup + sudo cp drideOS-resize /etc/init.d/drideOS-resize + sudo chmod +x /etc/init.d/drideOS-resize + sudo update-rc.d drideOS-resize defaults + sudo rm drideOS-resize +fi - - -## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 -echo "========== Install GPS ============" -sudo apt-get install gpsd gpsd-clients cmake subversion build-essential espeak freeglut3-dev imagemagick libdbus-1-dev libdbus-glib-1-dev libdevil-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgarmin-dev libglc-dev libgps-dev libgtk2.0-dev libimlib2-dev libpq-dev libqt4-dev libqtwebkit-dev librsvg2-bin libsdl-image1.2-dev libspeechd-dev libxml2-dev ttf-liberation -y - sudo pip install pyserial +if [ ${OS_TYPE} == "drideOS" ]; then + ## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 + echo "========== Install GPS ============" + sudo apt-get install gpsd gpsd-clients cmake subversion build-essential espeak freeglut3-dev imagemagick libdbus-1-dev libdbus-glib-1-dev libdevil-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgarmin-dev libglc-dev libgps-dev libgtk2.0-dev libimlib2-dev libpq-dev libqt4-dev libqtwebkit-dev librsvg2-bin libsdl-image1.2-dev libspeechd-dev libxml2-dev ttf-liberation -y -echo "" >> /boot/config.txt -echo "core_freq=250" >> /boot/config.txt -echo "enable_uart=1" >> /boot/config.txt -# this will be done after initial boot -# echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt + echo "" >> /boot/config.txt + echo "core_freq=250" >> /boot/config.txt + echo "enable_uart=1" >> /boot/config.txt + + # this will be done after initial boot + # echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt -# 3)Run -sudo systemctl stop serial-getty@ttyS0.service -sudo systemctl disable serial-getty@ttyS0.service -sudo systemctl stop gpsd.socket -sudo systemctl disable gpsd.socket + # 3)Run + sudo systemctl stop serial-getty@ttyS0.service + sudo systemctl disable serial-getty@ttyS0.service + sudo systemctl stop gpsd.socket + sudo systemctl disable gpsd.socket -# reboot - -# 5) Execute the daemon reset -#sudo killall gpsd -#sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock + # reboot + # 5) Execute the daemon reset + #sudo killall gpsd + #sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock +fi From 3c09c4c10eff052942e6087dd7183978eccb4fc9 Mon Sep 17 00:00:00 2001 From: Yossi Date: Fri, 16 Jun 2017 08:54:57 +0300 Subject: [PATCH 59/91] store drideOS startup script locally and replace drideOSZ startup file --- stage2/01-sys-tweaks/01-run.sh | 21 +++++----- stage2/01-sys-tweaks/files/startup/dride-core | 42 +++++++++++++++++++ .../01-sys-tweaks/files/startup/dride-core-z | 42 +++++++++++++++++++ stage2/01-sys-tweaks/files/startup/dride-ws | 31 ++++++++++++++ .../files/startup/drideOS-resize | 18 ++++++++ 5 files changed, 144 insertions(+), 10 deletions(-) create mode 100755 stage2/01-sys-tweaks/files/startup/dride-core create mode 100755 stage2/01-sys-tweaks/files/startup/dride-core-z create mode 100755 stage2/01-sys-tweaks/files/startup/dride-ws create mode 100755 stage2/01-sys-tweaks/files/startup/drideOS-resize diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 7a286bc..f35926b 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -193,30 +193,31 @@ sudo update-rc.d isc-dhcp-server enable -sudo wget https://dride.io/code/startup/dride-ws -sudo wget https://dride.io/code/startup/dride-core -sudo wget https://dride.io/code/startup/drideOS-resize - #startup script's # express on startup -sudo cp dride-ws /etc/init.d/dride-ws +sudo cp files/dride-ws /etc/init.d/dride-ws sudo chmod +x /etc/init.d/dride-ws sudo update-rc.d dride-ws defaults -sudo rm dride-ws + # dride-core on startup -sudo cp dride-core /etc/init.d/dride-core +if [ ${OS_TYPE} == "drideOS" ]; then + sudo cp files/dride-core /etc/init.d/dride-core +else + sudo cp files/dride-core-z /etc/init.d/dride-core +fi; + sudo chmod +x /etc/init.d/dride-core sudo update-rc.d dride-core defaults -sudo rm dride-core + if [ ${OS_TYPE} == "drideOS" ]; then # drideOS-resize on startup - sudo cp drideOS-resize /etc/init.d/drideOS-resize + sudo cp files/drideOS-resize /etc/init.d/drideOS-resize sudo chmod +x /etc/init.d/drideOS-resize sudo update-rc.d drideOS-resize defaults - sudo rm drideOS-resize + fi diff --git a/stage2/01-sys-tweaks/files/startup/dride-core b/stage2/01-sys-tweaks/files/startup/dride-core new file mode 100755 index 0000000..6d26154 --- /dev/null +++ b/stage2/01-sys-tweaks/files/startup/dride-core @@ -0,0 +1,42 @@ +#! /bin/sh +# /etc/init.d/dride-core + +### BEGIN INIT INFO +# Provides: dride-core +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: will run the main dride-core process +# Description: +### END INIT INFO + + +case "$1" in + start) + echo "Starting dride-core" + # run application you want to start + sudo python /home/Cardigan/mainPi.py & + + # run gps daemon + sudo python /home/Cardigan/daemons/gps/helper.py & + + # run button / bluetooth daemon + sudo python /home/Cardigan/daemons/bluetooth/initPin.py & + sleep 5 && sudo BLENO_DEVICE_NAME="dride" node /home/Cardigan/daemons/bluetooth/main.js & + ;; + stop) + echo "Stopping dride-core" + # kill application you want to stop + killall python + ;; + *) + echo "Usage: /etc/init.d/dride-core{start|stop}" + exit 1 + ;; +esac + +exit 0 + + + diff --git a/stage2/01-sys-tweaks/files/startup/dride-core-z b/stage2/01-sys-tweaks/files/startup/dride-core-z new file mode 100755 index 0000000..6997616 --- /dev/null +++ b/stage2/01-sys-tweaks/files/startup/dride-core-z @@ -0,0 +1,42 @@ +#! /bin/sh +# /etc/init.d/dride-core + +### BEGIN INIT INFO +# Provides: dride-core +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: will run the main dride-core process +# Description: +### END INIT INFO + + +case "$1" in + start) + echo "Starting dride-core" + # run application you want to start + sudo python /home/Cardigan/mainPiZero.py & + + # run gps daemon + sudo python /home/Cardigan/daemons/gps/helper.py & + + # run button / bluetooth daemon + sudo python /home/Cardigan/daemons/bluetooth/initPin.py & + sleep 5 && sudo BLENO_DEVICE_NAME="dride" node /home/Cardigan/daemons/bluetooth/main.js & + ;; + stop) + echo "Stopping dride-core" + # kill application you want to stop + killall python + ;; + *) + echo "Usage: /etc/init.d/dride-core{start|stop}" + exit 1 + ;; +esac + +exit 0 + + + diff --git a/stage2/01-sys-tweaks/files/startup/dride-ws b/stage2/01-sys-tweaks/files/startup/dride-ws new file mode 100755 index 0000000..18f26e4 --- /dev/null +++ b/stage2/01-sys-tweaks/files/startup/dride-ws @@ -0,0 +1,31 @@ +#! /bin/sh +# /etc/init.d/dride-ws + +### BEGIN INIT INFO +# Provides: dride-ws +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: will run the dride web server on startup +# Description: AKA dride-ws +### END INIT INFO + +case "$1" in + start) + echo "Starting dride-ws" + # run node-express server + sudo node /home/Cardigan/dride-ws/server/app.js & + ;; + stop) + echo "Stopping dride-ws" + # kill application you want to stop + killall node + ;; + *) + echo "Usage: /etc/init.d/dride-ws{start|stop}" + exit 1 + ;; +esac + +exit 0 \ No newline at end of file diff --git a/stage2/01-sys-tweaks/files/startup/drideOS-resize b/stage2/01-sys-tweaks/files/startup/drideOS-resize new file mode 100755 index 0000000..5fa228b --- /dev/null +++ b/stage2/01-sys-tweaks/files/startup/drideOS-resize @@ -0,0 +1,18 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: drideOS-resize +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: will resize the file system & reboot +# Description: +### END INIT INFO + +echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt + +# Delete the script +rm $0 +# reboot +sudo reboot \ No newline at end of file From 54b4babfe2f61591faa6709cf9eb420b4dceaed6 Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 19 Jun 2017 08:53:55 +0300 Subject: [PATCH 60/91] fix startup script's dir --- stage2/01-sys-tweaks/01-run.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index f35926b..ff24cda 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -4,6 +4,11 @@ install -m 644 files/regenerate_ssh_host_keys.service ${ROOTFS_DIR}/lib/systemd/ install -m 755 files/apply_noobs_os_config ${ROOTFS_DIR}/etc/init.d/ install -m 755 files/resize2fs_once ${ROOTFS_DIR}/etc/init.d/ + + + +install -m 755 files/resize2fs_once ${ROOTFS_DIR}/etc/init.d/ + install -d ${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d install -m 644 files/ttyoutput.conf ${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d/ @@ -196,26 +201,26 @@ sudo update-rc.d isc-dhcp-server enable #startup script's # express on startup -sudo cp files/dride-ws /etc/init.d/dride-ws -sudo chmod +x /etc/init.d/dride-ws +sudo cp files/startup/dride-ws ${ROOTFS_DIR}/etc/init.d/dride-ws +sudo chmod +x ${ROOTFS_DIR}/etc/init.d/dride-ws sudo update-rc.d dride-ws defaults # dride-core on startup if [ ${OS_TYPE} == "drideOS" ]; then - sudo cp files/dride-core /etc/init.d/dride-core + sudo cp files/startup/dride-core ${ROOTFS_DIR}/etc/init.d/dride-core else - sudo cp files/dride-core-z /etc/init.d/dride-core + sudo cp files/startup/dride-core-z ${ROOTFS_DIR}/etc/init.d/dride-core fi; -sudo chmod +x /etc/init.d/dride-core +sudo chmod +x ${ROOTFS_DIR}/etc/init.d/dride-core sudo update-rc.d dride-core defaults if [ ${OS_TYPE} == "drideOS" ]; then # drideOS-resize on startup - sudo cp files/drideOS-resize /etc/init.d/drideOS-resize - sudo chmod +x /etc/init.d/drideOS-resize + sudo cp files/startup/drideOS-resize ${ROOTFS_DIR}/etc/init.d/drideOS-resize + sudo chmod +x ${ROOTFS_DIR}/etc/init.d/drideOS-resize sudo update-rc.d drideOS-resize defaults fi From 57f4737d2ee2c41906814f412d63da7bec9f6ce0 Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 19 Jun 2017 22:20:09 +0300 Subject: [PATCH 61/91] try to insert local file --- stage2/01-sys-tweaks/01-run.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index ff24cda..ca8a5c1 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -16,6 +16,11 @@ install -m 644 files/50raspi ${ROOTFS_DIR}/etc/apt/apt.conf.d/ install -m 644 files/console-setup ${ROOTFS_DIR}/etc/default/ + +cp files/startup/drideOS-resize ${ROOTFS_DIR}/etc/init.d/drideOS-resize +chmod +x ${ROOTFS_DIR}/etc/init.d/drideOS-resize + + on_chroot << EOF systemctl disable hwclock.sh systemctl disable nfs-common From 53bd4767a49ec1fcd1fc2d98febe16e3ed5855ee Mon Sep 17 00:00:00 2001 From: Yossi Date: Tue, 20 Jun 2017 00:01:34 +0300 Subject: [PATCH 62/91] fix copy files locally for all startup scripts --- stage2/01-sys-tweaks/01-run.sh | 55 ++++++++++++++++------------------ 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index ca8a5c1..7226a30 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -17,8 +17,31 @@ install -m 644 files/50raspi ${ROOTFS_DIR}/etc/apt/apt.conf.d/ install -m 644 files/console-setup ${ROOTFS_DIR}/etc/default/ -cp files/startup/drideOS-resize ${ROOTFS_DIR}/etc/init.d/drideOS-resize -chmod +x ${ROOTFS_DIR}/etc/init.d/drideOS-resize +#startup script's +# express on startup +cp files/startup/dride-ws ${ROOTFS_DIR}/etc/init.d/dride-ws +chmod +x ${ROOTFS_DIR}/etc/init.d/dride-ws +update-rc.d dride-ws defaults + + +# dride-core on startup +if [ ${OS_TYPE} == "drideOS" ]; then + cp files/startup/dride-core ${ROOTFS_DIR}/etc/init.d/dride-core +else + cp files/startup/dride-core-z ${ROOTFS_DIR}/etc/init.d/dride-core +fi; + +chmod +x ${ROOTFS_DIR}/etc/init.d/dride-core +update-rc.d dride-core defaults + + +if [ ${OS_TYPE} == "drideOS" ]; then + # drideOS-resize on startup + cp files/startup/drideOS-resize ${ROOTFS_DIR}/etc/init.d/drideOS-resize + chmod +x ${ROOTFS_DIR}/etc/init.d/drideOS-resize + update-rc.d drideOS-resize defaults +fi + on_chroot << EOF @@ -203,34 +226,6 @@ sudo update-rc.d isc-dhcp-server enable -#startup script's - -# express on startup -sudo cp files/startup/dride-ws ${ROOTFS_DIR}/etc/init.d/dride-ws -sudo chmod +x ${ROOTFS_DIR}/etc/init.d/dride-ws -sudo update-rc.d dride-ws defaults - - -# dride-core on startup -if [ ${OS_TYPE} == "drideOS" ]; then - sudo cp files/startup/dride-core ${ROOTFS_DIR}/etc/init.d/dride-core -else - sudo cp files/startup/dride-core-z ${ROOTFS_DIR}/etc/init.d/dride-core -fi; - -sudo chmod +x ${ROOTFS_DIR}/etc/init.d/dride-core -sudo update-rc.d dride-core defaults - - -if [ ${OS_TYPE} == "drideOS" ]; then - # drideOS-resize on startup - sudo cp files/startup/drideOS-resize ${ROOTFS_DIR}/etc/init.d/drideOS-resize - sudo chmod +x ${ROOTFS_DIR}/etc/init.d/drideOS-resize - sudo update-rc.d drideOS-resize defaults - -fi - - sudo pip install pyserial From e03b6dd5f3c2e75969da9b8934d3b68fcac42cdf Mon Sep 17 00:00:00 2001 From: Yossi Date: Tue, 20 Jun 2017 00:54:06 +0300 Subject: [PATCH 63/91] fix file location --- stage2/01-sys-tweaks/01-run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 7226a30..f4a3d8e 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -21,7 +21,7 @@ install -m 644 files/console-setup ${ROOTFS_DIR}/etc/default/ # express on startup cp files/startup/dride-ws ${ROOTFS_DIR}/etc/init.d/dride-ws chmod +x ${ROOTFS_DIR}/etc/init.d/dride-ws -update-rc.d dride-ws defaults +update-rc.d ${ROOTFS_DIR}/etc/init.d/dride-ws defaults # dride-core on startup @@ -32,14 +32,14 @@ else fi; chmod +x ${ROOTFS_DIR}/etc/init.d/dride-core -update-rc.d dride-core defaults +update-rc.d ${ROOTFS_DIR}/etc/dride-core defaults if [ ${OS_TYPE} == "drideOS" ]; then # drideOS-resize on startup cp files/startup/drideOS-resize ${ROOTFS_DIR}/etc/init.d/drideOS-resize chmod +x ${ROOTFS_DIR}/etc/init.d/drideOS-resize - update-rc.d drideOS-resize defaults + update-rc.d ${ROOTFS_DIR}/etc/drideOS-resize defaults fi From f36f232a674d165a2c75bfc42ec1f066b0aa698c Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 21 Jun 2017 19:40:34 +0300 Subject: [PATCH 64/91] revert to pull script from server --- stage2/01-sys-tweaks/01-run.sh | 66 ++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index f4a3d8e..991da25 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -17,32 +17,6 @@ install -m 644 files/50raspi ${ROOTFS_DIR}/etc/apt/apt.conf.d/ install -m 644 files/console-setup ${ROOTFS_DIR}/etc/default/ -#startup script's -# express on startup -cp files/startup/dride-ws ${ROOTFS_DIR}/etc/init.d/dride-ws -chmod +x ${ROOTFS_DIR}/etc/init.d/dride-ws -update-rc.d ${ROOTFS_DIR}/etc/init.d/dride-ws defaults - - -# dride-core on startup -if [ ${OS_TYPE} == "drideOS" ]; then - cp files/startup/dride-core ${ROOTFS_DIR}/etc/init.d/dride-core -else - cp files/startup/dride-core-z ${ROOTFS_DIR}/etc/init.d/dride-core -fi; - -chmod +x ${ROOTFS_DIR}/etc/init.d/dride-core -update-rc.d ${ROOTFS_DIR}/etc/dride-core defaults - - -if [ ${OS_TYPE} == "drideOS" ]; then - # drideOS-resize on startup - cp files/startup/drideOS-resize ${ROOTFS_DIR}/etc/init.d/drideOS-resize - chmod +x ${ROOTFS_DIR}/etc/init.d/drideOS-resize - update-rc.d ${ROOTFS_DIR}/etc/drideOS-resize defaults -fi - - on_chroot << EOF systemctl disable hwclock.sh @@ -229,6 +203,46 @@ sudo update-rc.d isc-dhcp-server enable sudo pip install pyserial + +#startup script's +sudo wget https://dride.io/code/startup/dride-ws + +if [ ${OS_TYPE} == "drideOS" ]; then + sudo wget https://dride.io/code/startup/dride-core + sudo wget https://dride.io/code/startup/drideOS-resize +else + sudo wget https://dride.io/code/startup/dride-core-z +fi; + + +# express on startup +sudo cp dride-ws /etc/init.d/dride-ws +sudo chmod +x /etc/init.d/dride-ws +sudo update-rc.d dride-ws defaults +sudo rm dride-ws + +# dride-core on startup +if [ ${OS_TYPE} == "drideOS" ]; then + sudo cp dride-core /etc/init.d/dride-core +else + sudo cp dride-core-z /etc/init.d/dride-core +fi; + +sudo chmod +x /etc/init.d/dride-core +sudo update-rc.d dride-core defaults +sudo rm dride-core + +# drideOS-resize on startup +if [ ${OS_TYPE} == "drideOS" ]; then + sudo cp drideOS-resize /etc/init.d/drideOS-resize + sudo chmod +x /etc/init.d/drideOS-resize + sudo update-rc.d drideOS-resize defaults + sudo rm drideOS-resize +fi; + + + + if [ ${OS_TYPE} == "drideOS" ]; then ## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 echo "========== Install GPS ============" From d7ad71d97e07a5d38cadb65f23abf9ef04f864e7 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 21 Jun 2017 23:39:49 +0300 Subject: [PATCH 65/91] don't create firmware fir --- stage2/01-sys-tweaks/01-run.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 991da25..312508b 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -313,19 +313,17 @@ sudo mkdir Cardigan && cd Cardigan sudo wget -c -O "cardigan.zip" "https://s3.amazonaws.com/dride/releases/cardigan/latest.zip" sudo unzip "cardigan.zip" -sudo rm -R __MACOSX + sudo rm -R cardigan.zip # make the video dir writable sudo chmod 777 -R /home/Cardigan/modules/video/ -sudo chmod 777 -R /home/Cardigan/settings/video/ +sudo chmod 777 -R /home/Cardigan/settings/ #make gps position writable sudo chmod +x /home/Cardigan/daemons/gps/position # make the firmware dir writable -cd /home/Cardigan -sudo mkdir firmware sudo chmod 777 -R /home/Cardigan/firmware/ From f28811d7baec79d5b28fa124da86e92eb0815dbf Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 20 Jul 2017 11:41:57 +0300 Subject: [PATCH 66/91] add indicators --- stage2/01-sys-tweaks/01-run.sh | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 312508b..5558a57 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -272,6 +272,13 @@ if [ ${OS_TYPE} == "drideOS" ]; then fi +if [ ${OS_TYPE} == "drideOS" ]; then + echo "========== Install Indicators ============" + sudo apt-get install scons + cd /home/Cardigan/modules/indicators + sudo python setup.py +fi + @@ -306,6 +313,35 @@ echo "========== Setup sound to I2S ============" sudo curl -sS https://dride.io/code/i2samp.sh | bash +echo "========== Setup mic ============" +# https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/raspberry-pi-wiring-and-test + + +echo "========== Setup RTC ============" +# https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time +sudo apt-get install python-smbus i2c-tools +# TODO: turn on ISC on raspi-config... + +# add to sudo nano /boot/config.txt +# dtoverlay=i2c-rtc,pcf8523 + +# Remove hw-clock +sudo apt-get -y remove fake-hwclock +sudo update-rc.d -f fake-hwclock remove + +# copy new file to +#sudo nano /lib/udev/hwclock-set + +# set HW clock +sudo hwclock -D -r + +echo "========== Setup NeoPixel ============" + +# TODO: .... + + + + echo "========== Install Dride-core [Cardigan] ============" cd /home # https://s3.amazonaws.com/dride/releases/cardigan/latest.zip From 2d327ee21bc8afec8fe677ea216a50c7d2ffb194 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 20 Jul 2017 13:53:17 +0300 Subject: [PATCH 67/91] add build param --- stage2/01-sys-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 5558a57..a15d68f 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -276,7 +276,7 @@ if [ ${OS_TYPE} == "drideOS" ]; then echo "========== Install Indicators ============" sudo apt-get install scons cd /home/Cardigan/modules/indicators - sudo python setup.py + sudo python setup.py build fi From 2d7ce5899a2012cc2cf047a2ef2fa781608532da Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 20 Jul 2017 15:20:09 +0300 Subject: [PATCH 68/91] remove stage 4 & 5 --- stage4/00-install-packages/00-packages | 37 -------------------------- stage4/00-install-packages/01-packages | 19 ------------- stage5/EXPORT_NOOBS | 2 -- 3 files changed, 58 deletions(-) delete mode 100644 stage4/00-install-packages/00-packages delete mode 100644 stage4/00-install-packages/01-packages delete mode 100644 stage5/EXPORT_NOOBS diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages deleted file mode 100644 index e84df51..0000000 --- a/stage4/00-install-packages/00-packages +++ /dev/null @@ -1,37 +0,0 @@ -java-common oracle-java8-jdk -libreoffice-sdbc-hsqldb -sonic-pi -python idle python3-pygame python-pygame python-tk -python3 idle3 python3-tk -python3-pgzero -python-serial python3-serial -python-picamera python3-picamera -debian-reference-en dillo x2x -raspberrypi-net-mods raspberrypi-ui-mods -smartsim penguinspuzzle -python-pip python3-pip -python3-numpy -pypy -python3-pifacecommon python3-pifacedigitalio python3-pifacedigital-scratch-handler python-pifacecommon python-pifacedigitalio -minecraft-pi python-minecraftpi -alacarte rc-gui sense-hat -claws-mail -tree -scratch nuscratch -greenfoot bluej -nodered -libgl1-mesa-dri libgles1-mesa libgles2-mesa xcompmgr -geany -piclone -pulseaudio-module-bluetooth -wiringpi pigpio python-pigpio python3-pigpio raspi-gpio python-gpiozero python3-gpiozero python3-rpi.gpio -python-spidev python3-spidev -python-twython python3-twython -python-smbus python3-smbus -python-flask python3-flask -python-picraft python3-picraft -python3-codebug-tether python3-codebug-i2c-tether -python-sense-emu python3-sense-emu sense-emu-tools python-sense-emu-doc -pprompt -scratch2 -python3-thonny diff --git a/stage4/00-install-packages/01-packages b/stage4/00-install-packages/01-packages deleted file mode 100644 index 4ede68e..0000000 --- a/stage4/00-install-packages/01-packages +++ /dev/null @@ -1,19 +0,0 @@ -python-automationhat python3-automationhat -python-blinkt python3-blinkt -python-cap1xxx python3-cap1xxx -python-drumhat python3-drumhat -python-envirophat python3-envirophat -python-explorerhat python3-explorerhat -python-fourletterphat python3-fourletterphat -python-microdotphat python3-microdotphat -python-mote python3-mote -python-motephat python3-motephat -python-phatbeat python3-phatbeat -python-pianohat python3-pianohat -python-piglow python3-piglow -python-rainbowhat python3-rainbowhat -python-scrollphat python3-scrollphat -python-scrollphathd python3-scrollphathd -python-sn3218 python3-sn3218 -python-skywriter python3-skywriter -python-touchphat python3-touchphat diff --git a/stage5/EXPORT_NOOBS b/stage5/EXPORT_NOOBS deleted file mode 100644 index 908acc8..0000000 --- a/stage5/EXPORT_NOOBS +++ /dev/null @@ -1,2 +0,0 @@ -NOOBS_NAME="Raspbian" -NOOBS_DESCRIPTION="A port of Debian jessie for the Raspberry Pi (full desktop version)" From 82a20db9a55d3e34311460f96c95215a1706ff64 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 20 Jul 2017 16:35:02 +0300 Subject: [PATCH 69/91] compile indicators after openCV --- stage2/01-sys-tweaks/01-run.sh | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index a15d68f..4e2f600 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -272,15 +272,6 @@ if [ ${OS_TYPE} == "drideOS" ]; then fi -if [ ${OS_TYPE} == "drideOS" ]; then - echo "========== Install Indicators ============" - sudo apt-get install scons - cd /home/Cardigan/modules/indicators - sudo python setup.py build -fi - - - if [ ${OS_TYPE} == "drideOS" ]; then echo "========== Downloading and installing OpenCV ============" @@ -335,11 +326,6 @@ sudo update-rc.d -f fake-hwclock remove # set HW clock sudo hwclock -D -r -echo "========== Setup NeoPixel ============" - -# TODO: .... - - echo "========== Install Dride-core [Cardigan] ============" @@ -369,6 +355,14 @@ cd /home/Cardigan/dride-ws sudo npm i --production +if [ ${OS_TYPE} == "drideOS" ]; then + echo "========== Install Indicators ============" + sudo apt-get install scons + cd /home/Cardigan/modules/indicators + sudo python setup.py build +fi + + echo "========== Setup bluetooth ============" From e3627709c799709a67692c93e7a935e8f2d64412 Mon Sep 17 00:00:00 2001 From: Yossi Date: Fri, 21 Jul 2017 08:34:41 +0300 Subject: [PATCH 70/91] fix set settings dir --- stage2/01-sys-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 4e2f600..a64be66 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -341,7 +341,7 @@ sudo rm -R cardigan.zip # make the video dir writable sudo chmod 777 -R /home/Cardigan/modules/video/ -sudo chmod 777 -R /home/Cardigan/settings/ +sudo chmod 777 -R /home/Cardigan/modules/settings/ #make gps position writable sudo chmod +x /home/Cardigan/daemons/gps/position From 0be698ca2c4c2e57cfb97dc7568f4b0d0830b5aa Mon Sep 17 00:00:00 2001 From: Yossi Date: Fri, 21 Jul 2017 19:13:31 +0300 Subject: [PATCH 71/91] remove stage3 --- stage3/00-install-packages/00-packages | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 stage3/00-install-packages/00-packages diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages deleted file mode 100644 index 4b979cc..0000000 --- a/stage3/00-install-packages/00-packages +++ /dev/null @@ -1,10 +0,0 @@ -gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav -xpdf gtk2-engines alsa-utils -desktop-base -git -omxplayer -raspberrypi-artwork -policykit-1 -gvfs -rfkill -chromium-browser rpi-chromium-mods From 80ae3c4a69908a67dea6e4b62b7cc0960842c960 Mon Sep 17 00:00:00 2001 From: Yossi Date: Tue, 25 Jul 2017 13:22:13 +0300 Subject: [PATCH 72/91] refactor indicators installation --- stage2/01-sys-tweaks/01-run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index a64be66..2f9124b 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -359,7 +359,8 @@ if [ ${OS_TYPE} == "drideOS" ]; then echo "========== Install Indicators ============" sudo apt-get install scons cd /home/Cardigan/modules/indicators - sudo python setup.py build + sudo scons + sudo python python/setup.py build fi From 40ea94d8387e153768d5ad90543c63b5be8be1d0 Mon Sep 17 00:00:00 2001 From: Yossi Date: Wed, 26 Jul 2017 16:21:22 +0300 Subject: [PATCH 73/91] fix indicators setup --- stage2/01-sys-tweaks/01-run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 2f9124b..d3d3eff 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -360,7 +360,8 @@ if [ ${OS_TYPE} == "drideOS" ]; then sudo apt-get install scons cd /home/Cardigan/modules/indicators sudo scons - sudo python python/setup.py build + sudo apt-get install python-dev swig + sudo python python/setup.py install fi From 7d17456de13f8c9a02848e1f62e893202ece3d52 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 27 Jul 2017 09:14:56 +0300 Subject: [PATCH 74/91] fix installation process for indicators --- stage2/01-sys-tweaks/01-run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index d3d3eff..7a57a0b 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -360,8 +360,9 @@ if [ ${OS_TYPE} == "drideOS" ]; then sudo apt-get install scons cd /home/Cardigan/modules/indicators sudo scons - sudo apt-get install python-dev swig - sudo python python/setup.py install + sudo apt-get install python-dev swig -y + cd /home/Cardigan/modules/indicators/python + sudo python setup.py install fi From 59b98184bd76fbb89987c6873e2498b9f93df119 Mon Sep 17 00:00:00 2001 From: Yossi Date: Fri, 28 Jul 2017 20:59:28 +0300 Subject: [PATCH 75/91] Enable SPI --- stage2/01-sys-tweaks/01-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 7a57a0b..ebd5c9c 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -131,6 +131,7 @@ echo "" >> /boot/config.txt echo "#enable piCaera" >> /boot/config.txt echo "start_x=1" >> /boot/config.txt echo "gpu_mem=128" >> /boot/config.txt +echo "dtparam=spi=on" >> /boot/config.txt if [ ${OS_TYPE} == "drideOS" ]; then From 7b970cc606433d07f72db25f7944183e4f9738cb Mon Sep 17 00:00:00 2001 From: Yossi Date: Tue, 21 Nov 2017 16:14:51 +0200 Subject: [PATCH 76/91] add SPI modifications for neopixel --- stage2/01-sys-tweaks/01-run.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index ebd5c9c..21c3980 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -251,11 +251,10 @@ if [ ${OS_TYPE} == "drideOS" ]; then echo "" >> /boot/config.txt - echo "core_freq=250" >> /boot/config.txt echo "enable_uart=1" >> /boot/config.txt # this will be done after initial boot - # echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt + # echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes spidev.bufsiz=32768 rootwait" > /boot/cmdline.txt @@ -356,15 +355,17 @@ cd /home/Cardigan/dride-ws sudo npm i --production -if [ ${OS_TYPE} == "drideOS" ]; then - echo "========== Install Indicators ============" - sudo apt-get install scons - cd /home/Cardigan/modules/indicators - sudo scons - sudo apt-get install python-dev swig -y - cd /home/Cardigan/modules/indicators/python - sudo python setup.py install -fi + +echo "========== Install Indicators ============" +echo "# Needed for SPI LED" >> /boot/config.txt +echo "core_freq=250" >> /boot/config.txt +sudo apt-get install scons +cd /home/Cardigan/modules/indicators +sudo scons +sudo apt-get install python-dev swig -y +cd /home/Cardigan/modules/indicators/python +sudo python setup.py install + From 02110280800f5fe6f5b01f193b9cda9d8333053c Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 30 Nov 2017 12:29:40 +0200 Subject: [PATCH 77/91] update RTC installation :tv: --- stage2/01-sys-tweaks/01-run.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 21c3980..4b5f075 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -313,20 +313,25 @@ echo "========== Setup RTC ============" sudo apt-get install python-smbus i2c-tools # TODO: turn on ISC on raspi-config... + + + # add to sudo nano /boot/config.txt -# dtoverlay=i2c-rtc,pcf8523 +echo "dtoverlay=i2c-rtc,ds3231" >> /boot/config.txt +echo "dtparam=i2c_arm=on" >> /boot/config.txt # Remove hw-clock sudo apt-get -y remove fake-hwclock sudo update-rc.d -f fake-hwclock remove # copy new file to -#sudo nano /lib/udev/hwclock-set - -# set HW clock -sudo hwclock -D -r +sudo wget https://dride.io/code/hwclock-set +sudo cp dhcpd.conf /lib/udev/hwclock-set +sudo rm hwclock-set +# we will sync the current date form the app using BLE +# looks at /daemon/bluetooth/updateDate.js echo "========== Install Dride-core [Cardigan] ============" cd /home From 1976bd3a90394ec585e12058acdcc40b30fd1b07 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 30 Nov 2017 16:18:34 +0200 Subject: [PATCH 78/91] fix typo in RTC setup --- stage2/01-sys-tweaks/01-run.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 4b5f075..3a139bb 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -327,12 +327,26 @@ sudo update-rc.d -f fake-hwclock remove # copy new file to sudo wget https://dride.io/code/hwclock-set -sudo cp dhcpd.conf /lib/udev/hwclock-set +sudo cp hwclock-set /lib/udev/hwclock-set sudo rm hwclock-set # we will sync the current date form the app using BLE # looks at /daemon/bluetooth/updateDate.js + +echo "========== Setup Accelerometer ============" +# http://www.stuffaboutcode.com/2014/06/raspberry-pi-adxl345-accelerometer.html +# enable i2c 0 +echo "dtparam=i2c_vc=on" >> /boot/config.txt + + + + + + + + + echo "========== Install Dride-core [Cardigan] ============" cd /home # https://s3.amazonaws.com/dride/releases/cardigan/latest.zip From 654c3840e4e4345dacb191878399d455d30d716c Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 11 Dec 2017 11:35:18 +0200 Subject: [PATCH 79/91] Add FFMPEG --- stage2/01-sys-tweaks/01-run.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 3a139bb..6ddc45d 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -104,6 +104,19 @@ fi echo "========== Installing gpac ============" sudo apt-get install gpac -y +echo "========== Installing htop ============" +sudo apt-get install htop -y + + +echo "========== Setup FFMPEG ============" +sudo git clone git://source.ffmpeg.org/ffmpeg.git +cd ffmpeg +./configure +make +make install + + + # Install Node echo "========== Installing Node ============" From 91fc363f768d02d9af7042787a78998fc63f95f5 Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 11 Dec 2017 12:15:54 +0200 Subject: [PATCH 80/91] Add git --- stage2/01-sys-tweaks/01-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 6ddc45d..ee6a79e 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -109,6 +109,7 @@ sudo apt-get install htop -y echo "========== Setup FFMPEG ============" +sudo apt-get install git -y sudo git clone git://source.ffmpeg.org/ffmpeg.git cd ffmpeg ./configure From bc52bec634bfdda6bddb6b23c233df27265c01e2 Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 11 Dec 2017 12:41:51 +0200 Subject: [PATCH 81/91] Add cleaner cronJob --- stage2/01-sys-tweaks/01-run.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index ee6a79e..623b435 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -388,6 +388,13 @@ cd /home/Cardigan/dride-ws sudo npm i --production +# setup clear cron job +crontab -l > cleanerJob +echo "* * * * * node /home/Cardigan/modules/video/helpers/cleaner.js" >> cleanerJob +#install new cron file +crontab cleanerJob +rm cleanerJob + echo "========== Install Indicators ============" echo "# Needed for SPI LED" >> /boot/config.txt From 585b8136740a4065e15536c4012819d0c655b4b0 Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 11 Dec 2017 17:49:41 +0200 Subject: [PATCH 82/91] replace FFMPEG with libav --- stage2/01-sys-tweaks/01-run.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 623b435..27f8ba1 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -108,14 +108,8 @@ echo "========== Installing htop ============" sudo apt-get install htop -y -echo "========== Setup FFMPEG ============" -sudo apt-get install git -y -sudo git clone git://source.ffmpeg.org/ffmpeg.git -cd ffmpeg -./configure -make -make install - +echo "========== Setup libav ============" +sudo apt-get install libav-tools From bf2cf52a9f63ec4145d1e52c6693eec74c46f7bc Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 11 Dec 2017 18:51:06 +0200 Subject: [PATCH 83/91] cleanup --- stage2/01-sys-tweaks/01-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 27f8ba1..1c0978a 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -109,7 +109,7 @@ sudo apt-get install htop -y echo "========== Setup libav ============" -sudo apt-get install libav-tools +sudo apt-get install libav-tools -y @@ -290,7 +290,7 @@ if [ ${OS_TYPE} == "drideOS" ]; then unzip -q -n "opencv-3.1.0.zip" cd opencv-3.1.0 - echo "==>>>====== Building OpenCV ============" + echo "======== Building OpenCV ============" cd /home/opencv-3.1.0 mkdir build cd build From 5b218b7a73727dfbbd35e36d2d4b252dfc8f74ba Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 11 Dec 2017 21:35:30 +0200 Subject: [PATCH 84/91] Add npm install on video module --- stage2/01-sys-tweaks/01-run.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 1c0978a..9f2e8b9 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -220,7 +220,7 @@ if [ ${OS_TYPE} == "drideOS" ]; then sudo wget https://dride.io/code/startup/dride-core sudo wget https://dride.io/code/startup/drideOS-resize else - sudo wget https://dride.io/code/startup/dride-core-z + sudo wget https://dride.io/code/startup/dride-core fi; @@ -234,7 +234,7 @@ sudo rm dride-ws if [ ${OS_TYPE} == "drideOS" ]; then sudo cp dride-core /etc/init.d/dride-core else - sudo cp dride-core-z /etc/init.d/dride-core + sudo cp dride-core /etc/init.d/dride-core fi; sudo chmod +x /etc/init.d/dride-core @@ -375,6 +375,10 @@ sudo chmod +x /home/Cardigan/daemons/gps/position # make the firmware dir writable sudo chmod 777 -R /home/Cardigan/firmware/ +# run npm install on video module +cd /home/Cardigan/modules/video +sudo npm i --production + # run npm install on dride-ws cd /home/Cardigan/dride-ws From 571e8d945001363d08ff645826b9153aa04ee3e7 Mon Sep 17 00:00:00 2001 From: Yossi Date: Thu, 14 Dec 2017 18:11:41 +0200 Subject: [PATCH 85/91] install latest nodeJS --- stage2/01-sys-tweaks/01-run.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 9f2e8b9..3f63306 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -115,10 +115,7 @@ sudo apt-get install libav-tools -y # Install Node echo "========== Installing Node ============" -sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb -sudo dpkg -i node_latest_armhf.deb - -sudo rm /home/node_latest_armhf.deb +sudo wget -O - https://raw.githubusercontent.com/audstanley/NodeJs-Raspberry-Pi/master/Install-Node.sh | bash; From ca1fa6909ec1bc25bd788673af3fc25685a15263 Mon Sep 17 00:00:00 2001 From: Yossi Date: Fri, 15 Dec 2017 10:06:13 +0200 Subject: [PATCH 86/91] replace node install script --- stage2/01-sys-tweaks/01-run.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 3f63306..a792188 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -115,9 +115,8 @@ sudo apt-get install libav-tools -y # Install Node echo "========== Installing Node ============" -sudo wget -O - https://raw.githubusercontent.com/audstanley/NodeJs-Raspberry-Pi/master/Install-Node.sh | bash; - - +curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - +sudo apt-get install -y nodejs echo "========== Installing pip ============" sudo apt-get install python-pip -y From 27f2b4d44787510f7aaed79baf589a8a1b383638 Mon Sep 17 00:00:00 2001 From: Yossi Date: Fri, 15 Dec 2017 12:10:12 +0200 Subject: [PATCH 87/91] sattle on node 8.9.0 --- stage2/01-sys-tweaks/01-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index a792188..15731e1 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -115,8 +115,8 @@ sudo apt-get install libav-tools -y # Install Node echo "========== Installing Node ============" -curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - -sudo apt-get install -y nodejs +wget -O - https://raw.githubusercontent.com/sdesalas/node-pi-zero/master/install-node-v8.9.0.sh | bash + echo "========== Installing pip ============" sudo apt-get install python-pip -y From 9e881c86703a75f9353f9bb197c4f6eb2f9909a2 Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Sun, 14 Jan 2018 19:02:49 +0200 Subject: [PATCH 88/91] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09bd991..5444448 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dependencies - sudo apt-get update && sudo apt-get install git quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && cd ../ && + sudo apt-get update && sudo apt-get install git curl quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && cd ../ && sudo git clone https://github.com/dride/drideOS-image-generator && cd drideOS-image-generator && sudo ./build.sh ## Stage Anatomy From ee574e101b68c61592e9094b21666523d2c8da11 Mon Sep 17 00:00:00 2001 From: Yossi Neiman Date: Sun, 14 Jan 2018 20:32:40 +0200 Subject: [PATCH 89/91] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5444448..164a136 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dependencies - sudo apt-get update && sudo apt-get install git curl quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin -y && cd ../ && + sudo apt-get update && sudo apt-get install git curl quilt parted realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin grep rsync xz-utils -y && cd ../ && sudo git clone https://github.com/dride/drideOS-image-generator && cd drideOS-image-generator && sudo ./build.sh ## Stage Anatomy From 98295ebe8ddda2a667ead2607b310f268c34e4f1 Mon Sep 17 00:00:00 2001 From: Yossi Date: Sun, 14 Jan 2018 21:46:46 +0200 Subject: [PATCH 90/91] update picamera repo for python 3 --- stage2/01-sys-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 2b790f3..7336193 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -144,7 +144,7 @@ if [ ${OS_TYPE} == "drideOS" ]; then fi echo "========== Install picamera ============" -sudo pip install "picamera[array]==1.12" +sudo apt-get install python3-picamera # enable camera on raspi-config and allocate more ram to the GPU From 70fb0a72b895bd91326bb776b23185b45af39637 Mon Sep 17 00:00:00 2001 From: Yossi Date: Mon, 15 Jan 2018 08:15:41 +0200 Subject: [PATCH 91/91] remove stages 3-5 --- stage3/00-install-packages/00-packages | 13 ---------- stage3/00-install-packages/01-run.sh | 8 ------ stage3/prerun.sh | 5 ---- stage4/00-install-packages/00-packages | 34 -------------------------- stage4/EXPORT_IMAGE | 4 --- stage4/prerun.sh | 5 ---- stage5/EXPORT_IMAGE | 4 --- stage5/EXPORT_NOOBS | 2 -- stage5/prerun.sh | 5 ---- 9 files changed, 80 deletions(-) delete mode 100644 stage3/00-install-packages/00-packages delete mode 100755 stage3/00-install-packages/01-run.sh delete mode 100755 stage3/prerun.sh delete mode 100644 stage4/00-install-packages/00-packages delete mode 100644 stage4/EXPORT_IMAGE delete mode 100755 stage4/prerun.sh delete mode 100644 stage5/EXPORT_IMAGE delete mode 100644 stage5/EXPORT_NOOBS delete mode 100755 stage5/prerun.sh diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages deleted file mode 100644 index 9e4d84c..0000000 --- a/stage3/00-install-packages/00-packages +++ /dev/null @@ -1,13 +0,0 @@ -gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav -xpdf gtk2-engines alsa-utils -desktop-base -git -omxplayer -raspberrypi-artwork -policykit-1 -gvfs -rfkill -chromium-browser rpi-chromium-mods -gldriver-test -fonts-droid-fallback -fonts-liberation2 diff --git a/stage3/00-install-packages/01-run.sh b/stage3/00-install-packages/01-run.sh deleted file mode 100755 index d768747..0000000 --- a/stage3/00-install-packages/01-run.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -e - -on_chroot << EOF -update-alternatives --install /usr/bin/x-www-browser \ - x-www-browser /usr/bin/chromium-browser 86 -update-alternatives --install /usr/bin/gnome-www-browser \ - gnome-www-browser /usr/bin/chromium-browser 86 -EOF diff --git a/stage3/prerun.sh b/stage3/prerun.sh deleted file mode 100755 index ebb5d35..0000000 --- a/stage3/prerun.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e - -if [ ! -d ${ROOTFS_DIR} ]; then - copy_previous -fi diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages deleted file mode 100644 index d3f40ef..0000000 --- a/stage4/00-install-packages/00-packages +++ /dev/null @@ -1,34 +0,0 @@ -java-common oracle-java8-jdk -libreoffice-sdbc-hsqldb -sonic-pi -python idle python3-pygame python-pygame python-tk -python3 idle3 python3-tk -python3-pgzero -python-serial python3-serial -python-picamera python3-picamera -debian-reference-en dillo x2x -raspberrypi-net-mods raspberrypi-ui-mods -smartsim -python-pip python3-pip -python3-numpy -pypy -minecraft-pi python-minecraftpi -alacarte rc-gui sense-hat -claws-mail -tree -scratch nuscratch -greenfoot bluej -nodered -libgl1-mesa-dri libgles1-mesa libgles2-mesa xcompmgr -geany -piclone -wiringpi pigpio python-pigpio python3-pigpio raspi-gpio python-gpiozero python3-gpiozero python3-rpi.gpio -python-spidev python3-spidev -python-twython python3-twython -python-smbus python3-smbus -python-flask python3-flask -python-picraft python3-picraft -python-sense-emu python3-sense-emu sense-emu-tools python-sense-emu-doc -pprompt -scratch2 -python3-thonny diff --git a/stage4/EXPORT_IMAGE b/stage4/EXPORT_IMAGE deleted file mode 100644 index 1f1bd4f..0000000 --- a/stage4/EXPORT_IMAGE +++ /dev/null @@ -1,4 +0,0 @@ -IMG_SUFFIX="-4GB" -if [ "${USE_QEMU}" = "1" ]; then - export IMG_SUFFIX="${IMG_SUFFIX}-qemu" -fi diff --git a/stage4/prerun.sh b/stage4/prerun.sh deleted file mode 100755 index ebb5d35..0000000 --- a/stage4/prerun.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e - -if [ ! -d ${ROOTFS_DIR} ]; then - copy_previous -fi diff --git a/stage5/EXPORT_IMAGE b/stage5/EXPORT_IMAGE deleted file mode 100644 index 79ec11a..0000000 --- a/stage5/EXPORT_IMAGE +++ /dev/null @@ -1,4 +0,0 @@ -IMG_SUFFIX="" -if [ "${USE_QEMU}" = "1" ]; then - export IMG_SUFFIX="${IMG_SUFFIX}-qemu" -fi diff --git a/stage5/EXPORT_NOOBS b/stage5/EXPORT_NOOBS deleted file mode 100644 index 4823501..0000000 --- a/stage5/EXPORT_NOOBS +++ /dev/null @@ -1,2 +0,0 @@ -NOOBS_NAME="Raspbian" -NOOBS_DESCRIPTION="A port of Debian Stretch for the Raspberry Pi (full desktop version)" diff --git a/stage5/prerun.sh b/stage5/prerun.sh deleted file mode 100755 index ebb5d35..0000000 --- a/stage5/prerun.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e - -if [ ! -d ${ROOTFS_DIR} ]; then - copy_previous -fi