From 181462d1eea84df941ec59c9c46d75179d56e89f Mon Sep 17 00:00:00 2001 From: Sylvain Date: Fri, 6 May 2016 07:14:26 +0200 Subject: [PATCH] rebuild with new raspbian doc more precise. --- build_arm_image/01_create_sdcard.sh | 17 ++++++++-- build_arm_image/README.md | 49 +++++++++++++++++++++-------- build_arm_image/intsall_arm.sh | 9 ------ 3 files changed, 50 insertions(+), 25 deletions(-) delete mode 100755 build_arm_image/intsall_arm.sh diff --git a/build_arm_image/01_create_sdcard.sh b/build_arm_image/01_create_sdcard.sh index f164833..0d29b6d 100755 --- a/build_arm_image/01_create_sdcard.sh +++ b/build_arm_image/01_create_sdcard.sh @@ -1,15 +1,23 @@ #!/bin/bash # -# Create the sdcard on your PC with the latest debian. +# Create the sdcard on your PC with the latest debian raspbian. # # Usage: -# ./01_create_sdcard.sh downloaded_debian_image.zip /dev/sdcard_device +# ./01_create_sdcad.sh downloaded_debian_image.zip /dev/sdcard_device # ./01_create_sdcard.sh generated_yunohost.img /dev/sdcard_device # +# HowTo: +# find your sdcard device: +# mount it first graphicaly +# next issue a df -h look for something "/dev/mmcblk0p1" +# create a totally new image: +# delete _build_arm_steps/ which is the cache folder. +# follows steps in README.md # # Status: functional # Licence: GPLv3 # Author: sylvain303@github +# SeeAlso: # informations about Raspbian image: # Raspbian Jessie Lite Version: November 2015 Release date: 2015-11-21 @@ -17,8 +25,11 @@ # Kernel version: 4.1 # http://downloads.raspberrypi.org/raspbian/release_notes.txt + +# DOWNLOAD_URL used only for echo a message +# SHA_DEBIAN_IMG_ZIP need to be updated to match your image DOWNLOAD_URL=https://www.raspberrypi.org/downloads/raspbian/ -SHA_DEBIAN_IMG_ZIP=97888fcd9bfbbae2a359b0f1d199850852bf0104 +SHA_DEBIAN_IMG_ZIP="b78bb50bdac5ec8c108f34104f788e214ac23635" die() { echo "$*" diff --git a/build_arm_image/README.md b/build_arm_image/README.md index 1e739ca..583768e 100644 --- a/build_arm_image/README.md +++ b/build_arm_image/README.md @@ -1,18 +1,34 @@ # Build your own yunohost image for Raspberry Pi This folder contains helper scripts to build an arm image of yunohost for raspberry. -The files here are for builder. They are not needed to install your yunohost. +The files here are for builder. They are not needed to install your yunohost, the purpose is to reproduce the .img. +Of course you can try the step exlained here, and you will get a fresh yunohost at the end. The folder etc/ structure maps debian OS folders, shell script here are helpers. Files in etc/ subfolders will be copied on the sdcard when installation is finished. Those scripts are following the steps provided here: https://yunohost.org/#/build_arm_image +### Notes: + +`01_create_sdcard.sh` can be used to copy raspbian image to a sdcard and stop here, without yunohost. +An ssh key is added to remote access pi@raspbian account without passphrase. + +Ex: +``` +ssh -i _build_arm_steps/nopasskey pi@DHCP_IP +``` + +Don't forget to at first: `sudo raspbi-config` + enlarge file-system to have full size sdcard for your raspberry. +(also accomplished by: `sudo raspi-config --expand-rootfs`) +Enjoy. + ## License All the content here is distributed under [GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt). ## See also * https://forum.yunohost.org/t/building-a-new-image-for-raspberry-debian-jessie-fr-en/1101/13 - discussion about building a new image for Raspberry Pi. +* http://build.yunohost.org/ - some build here ## Files @@ -20,7 +36,7 @@ Description of the files available here. All step stripts are using your PC to store some files in the folder `_build_arm_steps/`. This folder will be created by `01_create_sdcard.sh`. You can wipe it, or remove selected script data form it, to redo a step. -All step scripts are designed to run in this folder: +All step scripts are designed to run in this folder on your PC: ~~~bash git clone this_repos @@ -39,8 +55,11 @@ Scripts are prefixed by a number which is the order they must be ran. #### 01_create_sdcard.sh Create a bootable image for raspbian. You have to download the .zip of the raspbian image. -This script embeds sudo call for using dd to copy the raw image to the sdcard. -It will add an ssh key to pi default rasbian user in oder to connect later to continue automated installation. The pi user will be removed at the end (See #4). The ssh key-pair is generated only for you. +([See:](https://www.raspberrypi.org/downloads/raspbian/) + +This script embeds sudo call for using `dd` to copy the raw image to the sdcard. +It will add an ssh key to `pi` default rasbian user in order to connect later to continue automated installation (See `02_install_yunohost.sh`) +The pi user will be removed at the end (Not yet, See #4). The ssh key-pair is generated only for you, in `_build_arm_steps/` Usage: @@ -50,15 +69,17 @@ Usage: It takes some minutes to perform all the steps (~ 2m3.867s at last run). Be patient. -Use `df` or `lsblk` to find the name of your sdcard device. The script is taking care of umonting the partition if any. It also guesses the disk's name if you gave a partition's name instead of entire disk device's name. +Use commend like `df` or `lsblk` to find the name of your sdcard device. The script is taking care of umonting the partition if any. +It also guesses the disk's name if you gave a partition's name instead of entire disk device's name. i +(ex: /dev/mmcblk0p2 --> /dev/mmcblk0) BE CAREFULL not to wipe the wrong device! #### 02_install_yunohost.sh -Should I say you have to plug the new sdcard freshly created and boot the Raspberry PI pluged on the same network as your PC? +Should I say: you have to plug the new sdcard freshly created and boot the Raspberry PI pluged on the same network as your PC? -The Raspberry has hopefully booted and is displaying a console's prompt: +The Raspberry has hopefully booted and is displaying a console's prompt, which looks like: ~~~ Raspbian GNU/Linux 8 raspberrypi tty1 @@ -74,15 +95,16 @@ My IP address is 192.168.1.123 Or what ever your DHCP is giving… -Run: +Run (on the PC, not the raspberry): ~~~bash ./02_install_yunohost.sh 192.168.1.123 ~~~ -This step is quite long. It took ~24min on my Raspberry. Be patient, A message will be displayed on the screen to explain how you can watch it if you want. +This step is quite long. It took ~24min on my Raspberry. Be patient. +A message will be displayed on the screen to explain how you can watch it if you want. -If you got ssh `Host key verification failed.`, fix it then: +If you got ssh `Host key verification failed.`, to fix it then: ~~~bash rm _build_arm_steps/yuno_step* @@ -92,20 +114,21 @@ rm _build_arm_steps/yuno_step* #### 03_copy_sdcard_to_img.sh -When the build is finished the Raspberry will shutdown. Unplug and insert the sdcard back in the computer. +When the build is finished, the Raspberry will shutdown. Unplug and insert the sdcard back in the computer. ~~~bash ./03_copy_sdcard_to_img.sh /dev/sdcard_device ~~~ -This will ask your sudo password and dd the resulting img from the sdcard back to your PC. Stored in `_build_arm_steps/` folder. It takes arround 6min on my PC to copy an sdcard of 8G. +This will ask your sudo password and `dd` the resulting img from the sdcard back to your PC. +Stored in `_build_arm_steps/` folder. It takes arround 6min on my PC to copy an sdcard of 8G. The image will be automaticly shrinked to its minimal size using autosizer.sh. #### test the image back -You can test the resutling image back with `01_create_sdcard.sh`. +You can test the resutling image back again with `01_create_sdcard.sh`. ~~~bash ./01_create_sdcard.sh _build_arm_steps/newly_created_image.img /dev/sdcard_device diff --git a/build_arm_image/intsall_arm.sh b/build_arm_image/intsall_arm.sh deleted file mode 100755 index 4c05d26..0000000 --- a/build_arm_image/intsall_arm.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# complete install with some specific ARM (raspberry) scripts. -# -# to be run for building an SD card image. -# - -cp etc/init.d/yunohost-firstboot /etc/init.d/ -chmod a+x /etc/init.d/yunohost-firstboot -insserv /etc/init.d/yunohost-firstboot