diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-09-26 17:25:43 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-09-26 17:25:43 -0300 |
commit | d876a2fa81899eb2bc689a0ac9d0ecd9513cf187 (patch) | |
tree | 2943b2d4bfff42028f977283f7162db9c19ddf32 /share/hydractl/provision-raspi | |
parent | 96e21d9866cfc7b853f5cb8728ff2f7d7409ea84 (diff) | |
download | hydra-d876a2fa81899eb2bc689a0ac9d0ecd9513cf187.tar.gz hydra-d876a2fa81899eb2bc689a0ac9d0ecd9513cf187.tar.bz2 |
Adds provision-chroot
Diffstat (limited to 'share/hydractl/provision-raspi')
-rwxr-xr-x | share/hydractl/provision-raspi | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/share/hydractl/provision-raspi b/share/hydractl/provision-raspi index 5b3ea15..38bc0b7 100755 --- a/share/hydractl/provision-raspi +++ b/share/hydractl/provision-raspi @@ -1,6 +1,7 @@ #!/bin/bash # # System installer, Raspberry Pi version. +# Based on https://wiki.debian.org/MatthiasSchmitz#Building_own_Debian_image_for_Raspberry_Pi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -49,6 +50,11 @@ RPI_URL="https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update" # Get config parameters. hydra_provision_config +# Check for requirements. +for req in debootstrap parted qemu-user-static; do + hydra_install_package $req +done + # Partitioning hydra_sudo_run parted -s -- $device mklabel msdos hydra_sudo_run parted -s -- $device unit MB mkpart primary fat32 1 100 @@ -62,13 +68,13 @@ hydra_sudo_run mkfs.ext4 "$device"p2 hydra_sudo_run mount "$device"p2 $WORK # Bootstrap the system -hydra_sudo_run debootstrap --foreign --arch=$arch $version $WORK +hydra_sudo_run debootstrap --foreign --arch=$arch $version $WORK $mirror hydra_sudo_run cp /usr/bin/qemu-arm-static $WORK/usr/bin/ $CHROOT /debootstrap/debootstrap --second-stage # Apt configuration -echo "deb http://http.debian.net/debian/ $version main contrib non-free" | hydra_sudo_run tee $WORK/etc/apt/sources.list -echo "deb http://security.debian.org/ $version/updates main contrib non-free" | hydra_sudo_run tee -a $WORK/etc/apt/sources.list +echo "deb $mirror $version main contrib non-free" | hydra_sudo_run tee $WORK/etc/apt/sources.list > /dev/null +echo "deb http://security.debian.org/ $version/updates main contrib non-free" | hydra_sudo_run tee -a $WORK/etc/apt/sources.list > /dev/null # Basic packages $CHROOT apt-get update @@ -76,7 +82,7 @@ $CHROOT apt-get install -y locales && $CHROOT dpkg-reconfigure locales $CHROOT apt-get install -y screen cron lsb-release openssl openssh-server less ntp # Hostname -echo $hostname.$domain | hydra_sudo_run tee $WORK/etc/hostname +echo $hostname.$domain | hydra_sudo_run tee $WORK/etc/hostname > /dev/null # Temporary root password $CHROOT passwd @@ -86,8 +92,8 @@ $CHROOT apt-get install -y wpasupplicant firmware-ralink # para conexao usando s hydra_sudo_run chmod 0600 $WORK/etc/network/interfaces # Modules -echo "vchiq" | hydra_sudo_run tee -a $WORK/etc/modules -echo "snd_bcm2835" | hydra_sudo_run tee -a $WORK/etc/modules +echo "vchiq" | hydra_sudo_run tee -a $WORK/etc/modules > /dev/null +echo "snd_bcm2835" | hydra_sudo_run tee -a $WORK/etc/modules > /dev/null # Fstab echo "Doing a basic network config..." @@ -98,14 +104,14 @@ proc /proc proc defaults 0 0 EOF # Inittab -echo "T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100" | hydra_sudo_run tee -a $WORK/etc/inittab +echo "T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100" | hydra_sudo_run tee -a $WORK/etc/inittab > /dev/null # Networking hydra_provision_networking # Boot setup hydra_sudo_run mount "$device"p1 /$WORK/boot/ -echo $CMDLINE | hydra_sudo_run tee $WORK/boot/cmdline.txt +echo $CMDLINE | hydra_sudo_run tee $WORK/boot/cmdline.txt > /dev/null $CHROOT apt-get install -y git-core binutils ca-certificates $CHROOT wget $RPI_URL -O /usr/bin/rpi-update $CHROOT chmod +x /usr/bin/rpi-update |