From d3b956432c1ecce9683c036301881e7b8bed6084 Mon Sep 17 00:00:00 2001 From: Fredrik Lindqvist Date: Mon, 30 Jan 2017 20:52:22 +0100 Subject: [PATCH] Gen 2 is go --- CLA.md | 54 +++++++++++++ CODE_OF_CONDUCT.md | 80 +++++++++++++++++++ README.md | 75 +++++++++-------- stage1/02-net-tweaks/files/hostname | 2 +- stage2/01-sys-tweaks/01-run.sh | 1 - stage2/EXPORT_IMAGE | 1 - stage2/EXPORT_NOOBS | 0 stage3/00-install-packages/00-debconf | 2 - stage3/00-install-packages/00-packages | 11 +-- stage3/00-install-packages/00-packages-nr | 6 -- stage3/00-install-packages/01-run.sh | 9 --- stage3/01-tweaks/00-run.sh | 25 +++++- .../home-assistant@homeassistant.service | 18 +++++ .../files/install_homeassistant.service | 13 +++ .../01-tweaks/files/install_homeassistant.sh | 41 ++++++++++ .../02-cleanup}/00-run.sh | 0 {stage4 => stage3}/EXPORT_IMAGE | 0 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/EXPORT_NOOBS | 0 stage4/prerun.sh | 4 - 26 files changed, 268 insertions(+), 159 deletions(-) create mode 100644 CLA.md create mode 100644 CODE_OF_CONDUCT.md delete mode 100644 stage2/EXPORT_IMAGE delete mode 100644 stage2/EXPORT_NOOBS delete mode 100644 stage3/00-install-packages/00-debconf delete mode 100644 stage3/00-install-packages/00-packages-nr delete mode 100755 stage3/00-install-packages/01-run.sh create mode 100644 stage3/01-tweaks/files/home-assistant@homeassistant.service create mode 100644 stage3/01-tweaks/files/install_homeassistant.service create mode 100644 stage3/01-tweaks/files/install_homeassistant.sh rename {stage4/03-cleanup => stage3/02-cleanup}/00-run.sh (100%) rename {stage4 => stage3}/EXPORT_IMAGE (100%) 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 100644 stage4/EXPORT_NOOBS delete mode 100755 stage4/prerun.sh diff --git a/CLA.md b/CLA.md new file mode 100644 index 0000000..4560e3b --- /dev/null +++ b/CLA.md @@ -0,0 +1,54 @@ +# Contributor License Agreement + +The following terms are used throughout this agreement: + +**You** - the person or legal entity including its affiliates asked to accept this agreement. +An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it. + +**Project** - is an umbrella term that refers to any and all Home Assistant open source projects. + +**Contribution** - any type of work that is submitted to a Project, including any modifications or additions to existing work. + +**Submitted** - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or +verbal communication with Home Assistant, contributors or maintainers. + +# 1. Grant of Copyright License. + +Subject to the terms and conditions of this agreement, You grant to the Projects’ maintainers, contributors, +users and to Home Assistant a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, +prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your contributions and such +derivative works. Except for this license, You reserve all rights, title, and interest in your contributions. + +# 2. Grant of Patent License. + +Subject to the terms and conditions of this agreement, You grant to the Projects’ maintainers, contributors, users and to +Home Assistant a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent +license to make, have made, use, offer to sell, sell, import, and otherwise transfer your contributions, where such license +applies only to those patent claims licensable by you that are necessarily infringed by your contribution or by combination of +your contribution with the project to which this contribution was submitted. + +If any entity institutes patent litigation - including cross-claim or counterclaim in a lawsuit - against You alleging that +your contribution or any project it was submitted to constitutes or is responsible for direct or contributory patent infringement, +then any patent licenses granted to that entity under this agreement shall terminate as of the date such litigation is filed. + +# 3. Source of Contribution. + +Your contribution is either your original creation, based upon previous work that, to the best of your knowledge, +is covered under an appropriate open source license and you have the right under that license to submit that work with modifications, +whether created in whole or in part by you, or you have clearly identified the source of the contribution and any license or other +restriction (like related patents, trademarks, and license agreements) of which you are personally aware. + +## Attribution + +This Contributor License Agreement is adapted from the [GitHub CLA][github-cla]. + +## Signing + +To sign this CLA you must first submit a pull request to a repository under the Home Assistant organization. + +## Adoption + +This Contributor License Agreement (CLA) was first announced on January 21st, 2017 in [this][cla-blog] blog post and adopted January 28th, 2017. + +[github-cla]: https://cla.github.com/agreement +[cla-blog]: https://home-assistant.io/blog/2017/01/21/home-assistant-governance/ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..5d2149d --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,80 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [safety@home-assistant.io][email]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available [here][version]. + +## Adoption + +This Code of Conduct was first adopted January 21st, 2017 and announced in [this][coc-blog] blog post. + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ +[email]: mailto:safety@home-assistant.io +[coc-blog]: https://home-assistant.io/blog/2017/01/21/home-assistant-governance/ diff --git a/README.md b/README.md index af2cba3..7e3b4b0 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,22 @@ -# pi-gen -_Tool used to create the raspberrypi.org Raspbian images_ +Fork of `pi_gen` by [@RPI-Distro](https://github.com/RPi-Distro/pi-gen). -### TODO -1. Documentation +## Building your own +The Haspbian image is built with the same script that generates the official [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) image's from the [Raspberry Pi Foundation](https://www.raspberrypi.org/about/). -## Dependencies +By default the Haspbian image is built on a Debian 8 droplet on Digital Ocean and takes about 30 minutes to build on the cheapest droplet. Dependencies and everything is handled by the build script with the exception of `git`. -`quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin` +Build instructions: +- Install git. `sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install git` +- Clone the `rpi_gen` code. `git clone https://github.com/home-assistant/pi-gen.git` +- Create a file in the current folder named `config`. More about it's contense below. +- Run the build script, with sudo or as root. `sudo ./build.sh` +- Wait ~30 minutes for build to complete. +- Retrieve your freshly built Raspberry Pi image from the `rpi_gen\deploy` folder. + + +### Dependencies + +`quilt qemu-arm-static:qemu-user-static debootstrap kpartx zerofree pxz zip mkdosfs:dosfstools capsh:libcap2-bin bsdtar` ## Config @@ -16,32 +26,18 @@ environment variables. The following environment variables are supported: - * `IMG_NAME` **required** (Default: unset) + * `IMG_NAME`, the name of the distribution to build (required) + * `APT_PROXY`, proxy/cache URL to be included in the build - 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: +A simple example for building Hassbian: ```bash -IMG_NAME='Raspbian' +IMG_NAME='Hassbian' ``` -## Stage Anatomy - - - ### Raspbian Stage Overview -The build of Raspbian is divided up into several stages for logical clarity +The build of Hassbian is divided up into several stages for logical clarity and modularity. This causes some initial complexity, but it simplifies maintenance and allows for more easy customization. @@ -67,7 +63,8 @@ maintenance and allows for more easy customization. defaults, installs fake-hwclock and ntp, wifi and bluetooth support, dphys-swapfile, and other basics for managing the hardware. It also creates necessary groups and gives the pi user access to sudo and the - standard console hardware permission groups. + standard console hardware permission groups. This stage has a minor + modification to prevent ssh from being disabled. 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 @@ -77,16 +74,15 @@ maintenance and allows for more easy customization. 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 3** - the HASSbian stage. This is where all the Home Assistant + specific packages are installed, permissions are set and users created. + This is the only stage we add to the original build script. + + The original **Stage 3** and **Stage 4** are removed since they are not + used on the HASSbian image. + + - - **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. @@ -94,7 +90,8 @@ If you wish to build up to a specified stage (such as building up to stage 2 for Then remove the `EXPORT*` files from `./stage4` (if building up to stage 2) or from `./stage2` (if building a minimal system). ``` -# Example for building a lite system -$ touch ./stage3/SKIP ./stage4/SKIP -$ rm stage4/EXPORT* -``` \ No newline at end of file +# Example for building a lite system without Home Assistant +$ touch ./stage3/SKIP +$ rm stage3/EXPORT* +``` + diff --git a/stage1/02-net-tweaks/files/hostname b/stage1/02-net-tweaks/files/hostname index 41757af..a71fd03 100644 --- a/stage1/02-net-tweaks/files/hostname +++ b/stage1/02-net-tweaks/files/hostname @@ -1 +1 @@ -raspberrypi +hassbian diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 69fa107..d1952de 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -14,7 +14,6 @@ on_chroot << EOF systemctl disable hwclock.sh systemctl disable nfs-common systemctl disable rpcbind -systemctl disable ssh systemctl enable regenerate_ssh_host_keys systemctl enable apply_noobs_os_config systemctl enable resize2fs_once diff --git a/stage2/EXPORT_IMAGE b/stage2/EXPORT_IMAGE deleted file mode 100644 index dc65cd0..0000000 --- a/stage2/EXPORT_IMAGE +++ /dev/null @@ -1 +0,0 @@ --lite 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 index 2ed3b2a..c46ab67 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -1,10 +1 @@ -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 +git python3 python3-venv python3-pip bluetooth libbluetooth-dev rng-tools htop tmux 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 index f64961c..9604dc0 100755 --- a/stage3/01-tweaks/00-run.sh +++ b/stage3/01-tweaks/00-run.sh @@ -1,3 +1,26 @@ #!/bin/bash -e -rm -f ${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/wait.conf +on_chroot << EOF +groupadd -f -r -g 1001 homeassistant +useradd -u 1001 -g 1001 -rm homeassistant +EOF + +install -v -o 1001 -g 1001 -d ${ROOTFS_DIR}/srv/homeassistant +install -m 644 files/home-assistant@homeassistant.service ${ROOTFS_DIR}/etc/systemd/system/ +install -m 644 files/install_homeassistant.service ${ROOTFS_DIR}/etc/systemd/system/ +wget -O files//install_homeassistant.sh https://raw.githubusercontent.com/home-assistant/hassbian-scripts/master/install_homeassistant.sh +install -m 755 files/install_homeassistant.sh ${ROOTFS_DIR}/usr/local/bin/ + +on_chroot << EOF +systemctl enable install_homeassistant.service +EOF + +on_chroot << \EOF +for GRP in dialout gpio spi i2c video; do + adduser homeassistant $GRP +done +for GRP in homeassistant; do + adduser pi $GRP +done +EOF + diff --git a/stage3/01-tweaks/files/home-assistant@homeassistant.service b/stage3/01-tweaks/files/home-assistant@homeassistant.service new file mode 100644 index 0000000..56bf076 --- /dev/null +++ b/stage3/01-tweaks/files/home-assistant@homeassistant.service @@ -0,0 +1,18 @@ +# This is a simple service file for systems with systemd to tun HA as user. +# +# For details please check https://home-assistant.io/getting-started/autostart/ +# +[Unit] +Description=Home Assistant for %i +After=network.target + +[Service] +Type=simple +User=%i +ExecStart=/srv/homeassistant/bin/hass +SendSIGKILL=no + +[Install] +WantedBy=multi-user.target + + diff --git a/stage3/01-tweaks/files/install_homeassistant.service b/stage3/01-tweaks/files/install_homeassistant.service new file mode 100644 index 0000000..abc4343 --- /dev/null +++ b/stage3/01-tweaks/files/install_homeassistant.service @@ -0,0 +1,13 @@ +# This is a simple service file for systems with systemd to tun HA as user. +# +# For details please check https://home-assistant.io/getting-started/autostart/ +# +[Unit] +Description=Install Home Assistant +After=network.target + +[Service] +ExecStart=/usr/local/bin/install_homeassistant.sh + +[Install] +WantedBy=multi-user.target diff --git a/stage3/01-tweaks/files/install_homeassistant.sh b/stage3/01-tweaks/files/install_homeassistant.sh new file mode 100644 index 0000000..e45c31a --- /dev/null +++ b/stage3/01-tweaks/files/install_homeassistant.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +echo "Home Assistant install script for Hassbian" +echo "Copyright(c) 2017 Fredrik Lindqvist " + +echo "Changing to homeassistant user" +sudo -u homeassistant -H /bin/bash << EOF + +echo "Creating Home Assistant venv" +python3 -m venv /srv/homeassistant + +echo "Changing to Home Assistant venv" +source /srv/homeassistant/bin/activate + +echo "Install latest version of Home Assistant" +pip3 install homeassistant + +echo "Deactivating virtualenv" +deactivate + +echo "Downloading HASSbian helper scripts" +cd /home/pi +git clone https://github.com/home-assistant/hassbian-scripts.git + +EOF + +echo "Enable Home Assistant service" +systemctl enable home-assistant@homeassistant.service +sync + +echo "Disable and remove Home Assitant install" +systemctl disable install_homeassistant +rm /etc/systemd/system/install_homeassistant.service +rm /usr/local/bin/install_homeassistant.sh +systemctl daemon-reload + +echo "Start Home Assistant" +systemctl start home-assistant@homeassistant.service + +echo "Installation done. To continue have a look at " +echo "If this script failed then this Raspberry Pi most likely did not have a fully functioning internet connection." diff --git a/stage4/03-cleanup/00-run.sh b/stage3/02-cleanup/00-run.sh similarity index 100% rename from stage4/03-cleanup/00-run.sh rename to stage3/02-cleanup/00-run.sh diff --git a/stage4/EXPORT_IMAGE b/stage3/EXPORT_IMAGE similarity index 100% rename from stage4/EXPORT_IMAGE rename to stage3/EXPORT_IMAGE 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/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