Doku and functions

This commit is contained in:
Kevin Veen-Birkenbach 2020-04-29 21:44:50 +02:00
parent 4c5dd6e53e
commit 0bbfc59201
3 changed files with 20 additions and 12 deletions

View File

@ -1,11 +1,24 @@
# Raspberry Pi sdc tools # 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. 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
bash ./sd_setup.sh 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: To backup a SD card type in:
```bash ```bash

View File

@ -1,5 +0,0 @@
( echo "kevinfrantz"
echo "mmcblk1"
echo "4"
echo "retropie"
)| sudo bash ./sd_setup.sh

View File

@ -61,7 +61,7 @@ read -r os
os_does_not_support_raspberry_version_error () { 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 case "$os" in
@ -78,7 +78,7 @@ case "$os" in
imagename="ArchLinuxARM-rpi-4-latest.tar.gz" imagename="ArchLinuxARM-rpi-4-latest.tar.gz"
;; ;;
*) *)
os_does_not_support_raspberry_version_error "$os" "$version" os_does_not_support_raspberry_version_error
;; ;;
esac esac
;; ;;
@ -105,7 +105,7 @@ case "$os" in
imagename="retropie-buster-4.6-rpi4.img.gz" 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 esac
;; ;;
@ -159,7 +159,7 @@ mount_partitions(){
echo "The following mounts refering this setup exist:" && mount | grep "$working_folder" 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 case "$os" in
"arch") "arch")
echo "fdisk is executedman fd" echo "fdisk is executedman fd"
@ -209,7 +209,7 @@ case "$os" in
mount_partitions; 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 esac