From 576915304b964622b5e4320e614822a87e574916 Mon Sep 17 00:00:00 2001 From: likeitneverwentaway Date: Fri, 4 Nov 2016 11:25:42 +0100 Subject: [PATCH] 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