From 0bbfc59201be24186a6bd4098d10890eb14873e3 Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Wed, 29 Apr 2020 21:44:50 +0200 Subject: [PATCH] Doku and functions --- README.md | 17 +++++++++++++++-- execute.sh | 5 ----- sd_setup.sh | 10 +++++----- 3 files changed, 20 insertions(+), 12 deletions(-) delete mode 100644 execute.sh diff --git a/README.md b/README.md index 3935b91..d2b00c4 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,24 @@ # Raspberry Pi sdc tools This repository contains some shell scripts to install Arch Linux for the Raspberry Pi on a SD-Card and to backup a SD-Card. -## Use -To install Arch Linux on a SD card type in: + +## Setup +### Guided +To install a Linux distribution manually on a SD card type in: ```bash bash ./sd_setup.sh ``` +### Piped +To pase the configuration to the program use this syntax: +```bash +( + echo "$USER" #The username + echo "mmcblk1" #The device + echo "5" #The raspberry pi number + echo "retropie" #The operation system +)| sudo bash ./sd_setup.sh +``` +## Backup To backup a SD card type in: ```bash diff --git a/execute.sh b/execute.sh deleted file mode 100644 index 5d9ee2f..0000000 --- a/execute.sh +++ /dev/null @@ -1,5 +0,0 @@ -( echo "kevinfrantz" - echo "mmcblk1" - echo "4" - echo "retropie" -)| sudo bash ./sd_setup.sh diff --git a/sd_setup.sh b/sd_setup.sh index 79ce858..9b89f31 100644 --- a/sd_setup.sh +++ b/sd_setup.sh @@ -61,7 +61,7 @@ read -r os os_does_not_support_raspberry_version_error () { - echo "$1 for Raspberry Pi Version $2 is not supported!" && exit 1; + echo "$os for Raspberry Pi Version $version is not supported!" && exit 1; } case "$os" in @@ -78,7 +78,7 @@ case "$os" in imagename="ArchLinuxARM-rpi-4-latest.tar.gz" ;; *) - os_does_not_support_raspberry_version_error "$os" "$version" + os_does_not_support_raspberry_version_error ;; esac ;; @@ -105,7 +105,7 @@ case "$os" in imagename="retropie-buster-4.6-rpi4.img.gz" ;; *) - os_does_not_support_raspberry_version_error "$os" "$version" + os_does_not_support_raspberry_version_error ;; esac ;; @@ -159,7 +159,7 @@ mount_partitions(){ echo "The following mounts refering this setup exist:" && mount | grep "$working_folder" } -echo "Copy data to sd-card..." +echo "Copy data to $sd_card_path..." case "$os" in "arch") echo "fdisk is executedman fd" @@ -209,7 +209,7 @@ case "$os" in mount_partitions; ;; *) - echo "The operation system \"$os\" is not supported yet!" && exit 1; + echo "Image transfer for operation system \"$os\" is not supported yet!" && exit 1; ;; esac