From 576915304b964622b5e4320e614822a87e574916 Mon Sep 17 00:00:00 2001
From: likeitneverwentaway
Date: Fri, 4 Nov 2016 11:25:42 +0100
Subject: [PATCH 1/7] Update build_arm_image.md
---
build_arm_image.md | 81 +++++++++++++++++++++++++++++-----------------
1 file changed, 51 insertions(+), 30 deletions(-)
diff --git a/build_arm_image.md b/build_arm_image.md
index e98c6c51..20775dc5 100644
--- a/build_arm_image.md
+++ b/build_arm_image.md
@@ -8,6 +8,8 @@ This tutorial is based on [Yunocubian](https://github.com/M5oul/Yunocubian).
You could find [ARM image builder from Debian Jessie](https://github.com/YunoHost/install_script/pull/36).
+**All these steps can be executed with variations of [this script](https://github.com/likeitneverwentaway/rpi_buildbot/blob/master/build_image.sh).**
+
### Download minimal Debian Jessie
Download a Debian Jessie image compatible with the hardware **without desktop environnement** installed:
@@ -19,10 +21,24 @@ Download a Debian Jessie image compatible with the hardware **without desktop en
Plug & boot
-* Connect via [SSH](ssh): **root@exemple.tld/ip_address** with the password which you could find on respectives documentations.
+* Connect via [SSH](ssh): **pi@exemple.tld/ip_address** with the password **raspberry** (or any variations for other distros than Raspbian).
+* Set a root password :
+
+```bash
+sudo passwd
+```
+
+and login as root:
+```bash
+su
+```
+
+
* You should be **root** for next operations.
-Install YunoHost
+Manually install YunoHost on a Raspberry Pi
+
+If you encounter problems during installation check out [this installation guide](http://avignu.wiki.tuxfamily.org/doku.php?id=documentation:yunohost-jessie) for the Raspberry Pi, based on suggestion [from this thread](https://forum.yunohost.org/t/installation-de-yunohost-2-4-sur-raspbian-jessie-minimal-sur-un-raspberry-pi-3/1597).
Do not proceed to **post-installation**.
@@ -33,50 +49,54 @@ apt-get update && apt-get dist-upgrade && apt-get autoremove
```
* Change hostname:
```bash
-hostname -v YunoHost
+sed -i "s/$(hostname)/YunoHost/g" /etc/hosts
+sed -i "s/$(hostname)/YunoHost/g" /etc/hostname
```
-* Set new SSH key generation at first lauching:
+* Allow SSH connection as root:
+```bash
+sed -i '0,/without-password/s/without-password/yes/g' /etc/ssh/sshd_config
+```
+* Delete the **pi** user (this step must be perform directly as root, not logged in as pi and then login as root):
+```bash
+deluser –remove-all-files pi
+```
+* Set the first boot script:
```bash
-# Delete SSH keys
-rm -f /etc/ssh/ssh_host_*
-
-# Add script to regenerate SSH keys at first boot
-nano /etc/init.d/ssh_gen_host_keys
----
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides: Generates new ssh host keys on first boot
-# Required-Start: $remote_fs $syslog
-# Required-Stop: $remote_fs $syslog
-# Default-Start: 2 3 4 5
-# Default-Stop:
-# Short-Description: Generates new ssh host keys on first boot
-# Description: Generatesapt-get --purge clean new ssh host keys on $
-### END INIT INFO
-ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ""
-ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ""
-insserv -r /etc/init.d/ssh_gen_host_keys
-rm -f \$0
----
+wget https://raw.githubusercontent.com/likeitneverwentaway/rpi_buildbot/master/yunohost-firstboot -P /etc/init.d/
# Give executable right
-chmod a+x /etc/init.d/ssh_gen_host_keys
+chmod a+x /etc/init.d/yunohost-firstboot
# Make it execute at next boot
-insserv /etc/init.d/ssh_gen_host_keys
+insserv /etc/init.d/yunohost-firstboot
+```
+* Set the boot promtp script:
+```bash
+wget https://raw.githubusercontent.com/likeitneverwentaway/rpi_buildbot/master/boot_prompt.service -P /etc/systemd/system/
+wget https://raw.githubusercontent.com/likeitneverwentaway/rpi_buildbot/master/boot_prompt.sh -P /usr/bin/
+chmod a+x /usr/bin/boot_prompt.sh
+systemctl enable boot_prompt.service
```
-* Delete logs:
+* Tell the boot_prompt script that the next boot is the first boot:
```bash
-find /var/log -type f -exec rm {} \;
-```
+touch /etc/yunohost/firstboot
+```
* Turn off your board:
```bash
shutdown
```
+
+Don't forget to reset **wpa-supplicant.conf** if you changed it. You could also delete the command history with
+
+```bash
+history -c
+```
+or by editing **/root/.bash_history**.
+
### Copy image
Plug your SD card on your desktop computer and copy it:
Be carefull to not erase your data.
@@ -84,6 +104,7 @@ Plug your SD card on your desktop computer and copy it:
```bash
sudo dd bs=1M if=/dev/sdd of=~/yunohost-jessie-board-year-month-day.img
```
+You can also use the **Read** function of [Win32 Disk Imager](https://sourceforge.net/projects/win32diskimager/).
### Verify image
Copy image to the SD card
From 10d2552d5f508d5ef2652d61d53e0b6533183124 Mon Sep 17 00:00:00 2001
From: likeitneverwentaway
Date: Fri, 4 Nov 2016 11:26:44 +0100
Subject: [PATCH 2/7] Create build_arm_image_fr.md
---
build_arm_image_fr.md | 126 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 126 insertions(+)
create mode 100644 build_arm_image_fr.md
diff --git a/build_arm_image_fr.md b/build_arm_image_fr.md
new file mode 100644
index 00000000..aab88885
--- /dev/null
+++ b/build_arm_image_fr.md
@@ -0,0 +1,126 @@
+# Build ARM image
+
+Le but de ce tutoriel est de créer une image YunoHost prête à l'emploi pour les cartes ARM.
+Elle pourra être utilisée sur de nombreuses cartes (Rasberry Pi, Olimex, Cubieboard…).
+
+Ce tutoriel est basé sur [Yunocubian](https://github.com/M5oul/Yunocubian).
+
+Vous pouvez trouvez le script [ARM image builder from Debian Jessie](https://github.com/YunoHost/install_script/pull/36).
+
+
+**Toutes ces étapes peuvent être executées en utilisant des variations de [ce script](https://github.com/likeitneverwentaway/rpi_buildbot/blob/master/build_image.sh).**
+
+### Télechargez une version minimale de Debian Jessie
+Télechargez une image Debian Jessie compatible avec la carte **sans environnement graphique** installé:
+
+* [ARMbian](http://www.armbian.com/download/) (Olimex, Cubieboard, Banana Pi…)
+* [Raspbian Jessie Lite](https://www.raspberrypi.org/downloads/raspbian/)
+
+### Copiez l'image et installez YunoHost
+Copie de l'image sur la carte SD
+
+Plug & boot
+
+* Connewion via [SSH](ssh): **pi@exemple.tld/ip_address** avec le mot de passe **raspberry** (ou toute autre variation pour des distros différentes de Raspbian).
+* Mettez un mot de passe root :
+
+```bash
+sudo passwd
+```
+
+et se connecter en tant que root:
+```bash
+su
+```
+
+
+* Vous devriez être **root** pour les étapes suivantes.
+
+Installez manuellement YunoHost sur un Raspberry Pi
+
+Si vous rencontrez des problèmes durant l'installation regardez [ce guide d'installation](http://avignu.wiki.tuxfamily.org/doku.php?id=documentation:yunohost-jessie) pour le Raspberry Pi, sur les suggestions [de ce thread](https://forum.yunohost.org/t/installation-de-yunohost-2-4-sur-raspbian-jessie-minimal-sur-un-raspberry-pi-3/1597).
+
+Ne pas faire la **post-installation**.
+
+### Nettoyage de l'image
+* Mise à jour de l'image:
+```bash
+apt-get update && apt-get dist-upgrade && apt-get autoremove
+```
+* Changez l'hostname:
+```bash
+sed -i "s/$(hostname)/YunoHost/g" /etc/hosts
+sed -i "s/$(hostname)/YunoHost/g" /etc/hostname
+```
+* Permettre les connections SSH en tant que root:
+```bash
+sed -i '0,/without-password/s/without-password/yes/g' /etc/ssh/sshd_config
+```
+* Supprimer l'user pi (cette étape doit être effectuer directement en tant que root, pas connecté avec l'user pi puis root):
+```bash
+deluser –remove-all-files pi
+```
+* Mise en place du script de premier boot:
+
+```bash
+wget https://raw.githubusercontent.com/likeitneverwentaway/rpi_buildbot/master/yunohost-firstboot -P /etc/init.d/
+
+# Droit d'execution au script
+chmod a+x /etc/init.d/yunohost-firstboot
+
+# Execute le script au prochain boot
+insserv /etc/init.d/yunohost-firstboot
+```
+* Mise en place du script boot promtp:
+```bash
+wget https://raw.githubusercontent.com/likeitneverwentaway/rpi_buildbot/master/boot_prompt.service -P /etc/systemd/system/
+wget https://raw.githubusercontent.com/likeitneverwentaway/rpi_buildbot/master/boot_prompt.sh -P /usr/bin/
+chmod a+x /usr/bin/boot_prompt.sh
+systemctl enable boot_prompt.service
+```
+
+* Dites au script boot_promt que le prochain boot est le premier boot:
+```bash
+touch /etc/yunohost/firstboot
+```
+
+* Éteindre la carte:
+```bash
+shutdown
+```
+
+
+Ne pas oublier de reset le fichier **wpa-supplicant.conf** si vous l'avez modifié. Vous pouvez aussi supprimer l'historique des commandes avec
+
+```bash
+history -c
+```
+ou en éditant **/root/.bash_history**.
+
+### Copie de l'image
+Branchez la carte SD à votre ordinateur et faites en une copie:
+Faites attention de ne pas supprimer vos données.
+
+```bash
+sudo dd bs=1M if=/dev/sdd of=~/yunohost-jessie-board-year-month-day.img
+```
+
+Vous pouvez aussi utiliser la fonction **Read** de [Win32 Disk Imager](https://sourceforge.net/projects/win32diskimager/).
+
+
+### Verifer l' image
+Copier l'image sur la carte SD
+
+Plug & boot
+
+Post-install
+
+Si tous va bien, vous pouvez publiez votre image.
+
+### Publier l'image
+* Reduire la taille en zippant l'image:
+```bash
+zip yunohost-jessie-board-year-month-day.img.zip yunohost-jessie-board-year-month-day.img
+```
+
+* Publication: vous pouvez publier l'image sur le [forum](https://forum.yunohost.org/).
From 517609fc4ebd31d2de3647a5113b13c3be81b39c Mon Sep 17 00:00:00 2001
From: likeitneverwentaway
Date: Fri, 4 Nov 2016 11:27:45 +0100
Subject: [PATCH 3/7] Update install_on_raspberry.md
---
install_on_raspberry.md | 71 ++++++++++++++++++++++++++++++++++-------
1 file changed, 59 insertions(+), 12 deletions(-)
diff --git a/install_on_raspberry.md b/install_on_raspberry.md
index fc27d7bc..393da50b 100644
--- a/install_on_raspberry.md
+++ b/install_on_raspberry.md
@@ -2,26 +2,24 @@
*Find other ways to install YunoHost **[here](/install)**.*
-## Requirements
+## Pre-requisite
- A Raspberry Pi model 1, 2 or 3
-- A SD card: **4GB** capacity (or more) and **class10** speed rate is highly recommended
-- A different computer to read this guide and access your Raspberry Pi
-- A screen and a keyboard, recommended if a problem occurs and you want to control your Raspberry Pi
-- A [reasonable ISP](/isp), preferably with a good and unlimited upload bandwidth
+- An SD card: **4GB** capacity (or more) and **class10** speed rate are highly recommended
+- An other computer to read this guide and access to your Raspberry Pi
+- A screen and a keyboard are recommended to control your Raspberry Pi if a problem occurs.
+- A [reasonable ISP](/isp), preferably with a good and unlimited upstream bandwidth
- **YunoHost Raspberry Pi images**, available here:
- - [Official Wheezy/YunoHost 2.2 created the 4th June 2015](https://build.yunohost.org/yunohost-rpi2_wheezy.7z)
- - [Non-official Jessie/YunoHost 2.2 created the 5th December 2015](https://forum.yunohost.org/t/building-a-new-image-for-raspberry-debian-jessie-fr-en/1101/2)
+build.yunohost.org
-**This two images are old**. YunoHost image for Raspberry Pi is not maintained, feel free to contribute and contact us if you would like to [maintain an image](build_arm_image_en) for YunoHost project.
-
+There are two ways of installing, depending on if you can start your server from scratch or not.
---
-## Installation steps
+## Installation using an image
1. Copy image to the SD card
@@ -29,17 +27,66 @@
3. Post-install
+## Manual installation
+
+Follow these steps if you can't start from scratch and simply use an image. Note - Yunohost installation is different if you have a Raspberry Pi Zero, be careful!
+
+1. Install git
+```bash
+sudo apt-get install git
+```
+
+2. Clone the Yunohost install script repository
+```bash
+git clone https://github.com/YunoHost/install_script /tmp/install_script
+```
+
+3. The root user must have a password set, if it isn't the case, set it (whithout the install script failed):
+```bash
+sudo passwd root
+```
+
+4. Update the Pi:
+```bash
+apt-get update ; apt-get dist-upgrade -y ; apt-get install rpi-update ; rpi-update ; reboot`
+```
+
+This will upgrade the Pi, then reboot.
+
+
+Raspberry Pi Zero users: follow these specific steps for a successfull installation.
+
+
+
+0.1 Install metronome manually:
+```bash
+apt-get install -y ssl-cert lua-event lua-expat lua-socket lua-sec lua-filesystem
+wget https://github.com/YunoHost/metronome/archive/debian/3.7.9+33b7572-1.zip
+unzip 3.7.9+33b7572-1.zip
+cd metronome-debian-3.7.9-33b7572-1
+dpkg-buildpackage -rfakeroot -uc -b -d
+cd ..
+dpkg -i metronome_3.7.9+33b7572-1_armhf.deb
+apt-mark hold metronome
+```
+
+4. Execute the installation script
+```bash
+cd /tmp/install_script && sudo ./install_yunohost
+```
---
-### Recommended after running the post-installation
+### Recommended after post-installation
* Connect via SSH: **root@IP.OF.RPI** (password: **yunohost**)
* Change root password: `passwd root`
* Upgrade system: `apt-get update && apt-get dist-upgrade && rpi-update`
+* Configure the language, keyboard layout and timezone with the **raspi-config** tool
---
#### Build image
* [Create a Raspberry Pi image](/build_arm_image_en)
-***Need help during one of these steps? [Get support!](/support)***
+***If you need help during one of these steps, do not hesitate to use [our support tools](/support).***
+
From 1800a386f07737b887ad682c180c1cf21696f330 Mon Sep 17 00:00:00 2001
From: likeitneverwentaway
Date: Fri, 4 Nov 2016 11:28:51 +0100
Subject: [PATCH 4/7] Update install_on_raspberry_fr.md
---
install_on_raspberry_fr.md | 57 +++++++++++++++++++++++++++++++++++---
1 file changed, 53 insertions(+), 4 deletions(-)
diff --git a/install_on_raspberry_fr.md b/install_on_raspberry_fr.md
index 9ca86fe9..48f7656a 100644
--- a/install_on_raspberry_fr.md
+++ b/install_on_raspberry_fr.md
@@ -16,11 +16,11 @@
- [Non officielle Jessie/YunoHost 2.2 créée le 5 décembre 2015](https://forum.yunohost.org/t/building-a-new-image-for-raspberry-debian-jessie-fr-en/1101/2)
- Un tutoriel d'installation basée sur YunoHost 2.4 a été écrit par AviGNU : http://avignu.wiki.tuxfamily.org/doku.php?id=documentation:yunohost-jessie
-**Ces deux images ne sont plus à jour**. Personne ne maintiens d’image de YunoHost pour Raspberry Pi. Vous pouvez [maintenir une image](build_arm_image_en) pour le projet YunoHost.
+Il y a deux façon d'installer Yunohost, soit vous pouvez repartir de zéro avec une nouvelle image ou installer manuellement :
---
-## Étapes d’installation
+## Installation avec une image
1. Copier l’image sur une carte SD
@@ -28,19 +28,68 @@
3. Post-installation
+
+## Installation manuelle
+
+Utilisez cette méthode si vous ne pouvez pas repartir de zéro et utiliser une image. Attention, ces étapes sont différentes si vous installez sur un Raspberry Pi Zero !
+
+1. Installer git
+```bash
+sudo apt-get install git
+```
+
+2. Cloner le repo Yunohost install script
+```bash
+git clone https://github.com/YunoHost/install_script /tmp/install_script
+```
+
+3. L'user root doit avoir un mot de passe. Si ce n'est pas le cas l'installation ne marchera pas:
+```bash
+sudo passwd root
+```
+
+4. Mettre à jour le Pi:
+```bash
+apt-get update ; apt-get dist-upgrade -y ; apt-get install rpi-update ; rpi-update ; reboot`
+```
+
+Cela va mettre à jour le Pi, puis rebooter.
+
+
+Raspberry Pi Zero : suivez ces étapes pour une installation réussie.
+
+
+
+0.1 Installez metronome manuellement:
+```bash
+apt-get install -y ssl-cert lua-event lua-expat lua-socket lua-sec lua-filesystem
+wget https://github.com/YunoHost/metronome/archive/debian/3.7.9+33b7572-1.zip
+unzip 3.7.9+33b7572-1.zip
+cd metronome-debian-3.7.9-33b7572-1
+dpkg-buildpackage -rfakeroot -uc -b -d
+cd ..
+dpkg -i metronome_3.7.9+33b7572-1_armhf.deb
+apt-mark hold metronome
+```
+
+4. Executer le script d' installation
+```bash
+cd /tmp/install_script && sudo ./install_yunohost
+```
+
---
### Recommandé après la post-installation
* Se connecter en [ssh](ssh_fr) : **root@IP.DU.RPI** (mot de passe : **yunohost**)
* Changer le mot de passe root : ```passwd root```
-
* Mettre à jour le système d’exploitation : ```apt-get update && apt-get dist-upgrade && rpi-update```
+* Configurer la langue, le clavier et le fuseau horaire avec l'outil **raspi-config**
---
#### Créer une image
-* [Créer une image pour Raspberry](/build_arm_image_en)
+* [Créer une image pour Raspberry](/build_arm_image_fr)
---
***Si vous avez besoin d’aide lors de ces étapes, n’hésitez pas à utiliser les différents [moyens de support](/support_fr).***
From 346086b8ce7e9bcee7db7f781f7927942eaf3cb0 Mon Sep 17 00:00:00 2001
From: likeitneverwentaway
Date: Fri, 4 Nov 2016 11:29:32 +0100
Subject: [PATCH 5/7] Update plug_and_boot_fr.md
---
plug_and_boot_fr.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plug_and_boot_fr.md b/plug_and_boot_fr.md
index 06716c5b..8762e4dc 100644
--- a/plug_and_boot_fr.md
+++ b/plug_and_boot_fr.md
@@ -1,10 +1,10 @@
# Brancher et démarrer votre serveur
-* Branchez votre serveur avec un câble Ethernet (RJ-45) **directement sur votre routeur principal**. N’utilisez pas de connexion sans-fil ou un routeur intermédiaire si vous voulez que la connexion réseau soit automatique.
+* Branchez votre serveur avec un câble Ethernet (RJ-45) **directement sur votre routeur principal**. Vous pouvez aussi configurer la connexion wifi comme expliqué [ici](http://raspbian-france.fr/connecter-wifi-raspberry-pi-3/). La configuration wifi peut aussi se faire sans avoir booté sur la carte, en "montant" la deuxième partition de la carte et enfin éditer le fichier wpa-supplicant.conf. Sur Windows vous pouvez utiliser [Paragon ExtFS](https://www.paragon-software.com/home/extfs-windows/), ne pas oublier de "unmount" pour que les changements soient pris en compte.
* N’oubliez pas de **brancher un écran** si vous voulez observer comment se déroule le démarrage, et un clavier si vous souhaitez un accès en **ligne de commande** à votre serveur.
-* Démarrez le serveur et attendez jusqu’à voir un gros `Y` carré :
+* Démarrez le serveur, le Raspberry Pi va redémarrer tout seul une première fois, puis attendez jusqu’à voir un gros `Y` carré :
From f83a7c8ab15e4a9979893203342caa6184000af0 Mon Sep 17 00:00:00 2001
From: likeitneverwentaway
Date: Fri, 4 Nov 2016 11:29:48 +0100
Subject: [PATCH 6/7] Update plug_and_boot.md
---
plug_and_boot.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plug_and_boot.md b/plug_and_boot.md
index 45b29743..ca2a2c76 100644
--- a/plug_and_boot.md
+++ b/plug_and_boot.md
@@ -1,10 +1,10 @@
# Plug and boot your server up
-* Plug your server in wired Ethernet **directly to your router**. Do not use a wireless connection or an intermediate router if you want the network configuration to be automatic.
+* Plug your server in wired Ethernet, or configure the wifi connection as explained [here](https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md). You can also mount the second partition of the SD card and edit the wpa-supplicant.conf file prior to boot the card for the first time - on Windows you can use [Paragon ExtFS](https://www.paragon-software.com/home/extfs-windows/), don't forget to unmount everytime for changes to take effect.
* Do not forget to **plug a screen** if you want to see how boot is going, and a keyboard if you want to have a **command-line access** to your server.
-* Power up the server and wait until you see a big squared `Y` :
+* Power up the server, wait for the first reboot to happen, and then wait until you see a big squared `Y` :
@@ -14,4 +14,4 @@
*Write down the `IP address` field visible on the screen: It is your server's **local IP address**.*
-
\ No newline at end of file
+
From 08ac29ef7af040bd01021e3703335a216b685d4d Mon Sep 17 00:00:00 2001
From: "ljf (zamentur)"
Date: Sun, 15 Jan 2017 23:20:49 +0100
Subject: [PATCH 7/7] [fix] Typo
---
install_on_raspberry.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install_on_raspberry.md b/install_on_raspberry.md
index 393da50b..3def8d0a 100644
--- a/install_on_raspberry.md
+++ b/install_on_raspberry.md
@@ -7,7 +7,7 @@
- A Raspberry Pi model 1, 2 or 3
-- An SD card: **4GB** capacity (or more) and **class10** speed rate are highly recommended
+- An SD card: **4GB** capacity (or more) and **class10** speed rate is highly recommended
- An other computer to read this guide and access to your Raspberry Pi
- A screen and a keyboard are recommended to control your Raspberry Pi if a problem occurs.
- A [reasonable ISP](/isp), preferably with a good and unlimited upstream bandwidth