Skip to content
Snippets Groups Projects
freedombone-image-hardware-setup 2.29 KiB
Newer Older
Bob Mottram's avatar
Bob Mottram committed
#!/bin/sh
Bob Mottram's avatar
Bob Mottram committed
#
# .---.                  .              .
# |                      |              |
# |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
# |    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-'
# '    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'
#
#                    Freedom in the Cloud
#
# Hardware setup based on bin/freedombox-hardware-setup from freedom-maker
#
# License
# =======
#
# This program is free software: you can redistribute it and/or modify
Bob Mottram's avatar
Bob Mottram committed
# it under the terms of the GNU Affero General Public License as published by
Bob Mottram's avatar
Bob Mottram committed
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Bob Mottram's avatar
Bob Mottram committed
# GNU Affero General Public License for more details.
Bob Mottram's avatar
Bob Mottram committed
#
Bob Mottram's avatar
Bob Mottram committed
# You should have received a copy of the GNU Affero General Public License
Bob Mottram's avatar
Bob Mottram committed
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Bob Mottram's avatar
Bob Mottram committed

Bob Mottram's avatar
Bob Mottram committed
PROJECT_NAME='freedombone'

Bob Mottram's avatar
Bob Mottram committed
export TEXTDOMAIN=${PROJECT_NAME}-image-hardware-setup
Bob Mottram's avatar
Bob Mottram committed
export TEXTDOMAINDIR="/usr/share/locale"

setup_flash_kernel() {
    if [ ! -d /etc/flash-kernel ] ; then
       mkdir /etc/flash-kernel
Bob Mottram's avatar
Bob Mottram committed
    fi
    echo -n "$1" > /etc/flash-kernel/machine
    command_line=""
    if [ -n "$2" ] ; then
        command_line="console=$2"
Bob Mottram's avatar
Bob Mottram committed
    fi
Bob Mottram's avatar
Bob Mottram committed

    if [ -n "$command_line" ] ; then
        echo flash-kernel flash-kernel/linux_cmdline string "$command_line" | debconf-set-selections
Bob Mottram's avatar
Bob Mottram committed
    fi
Bob Mottram's avatar
Bob Mottram committed

    apt-get -yq install flash-kernel
Bob Mottram's avatar
Bob Mottram committed
}

case "$MACHINE" in
Bob Mottram's avatar
Bob Mottram committed
    beaglebone)
        setup_flash_kernel 'TI AM335x BeagleBone Black' 'ttyO0'
        setup_flash_kernel 'TI AM335x BeagleBone Black Wireless' 'ttyO0'
Bob Mottram's avatar
Bob Mottram committed
        ;;
    cubietruck)
        setup_flash_kernel 'Cubietech Cubietruck'
Bob Mottram's avatar
Bob Mottram committed
        ;;
    a20-olinuxino-lime)
        setup_flash_kernel 'Olimex A20-OLinuXino-LIME'
Bob Mottram's avatar
Bob Mottram committed
        ;;
    a20-olinuxino-lime2)
        setup_flash_kernel 'Olimex A20-OLinuXino-LIME2'
Bob Mottram's avatar
Bob Mottram committed
        ;;
    a20-olinuxino-micro)
        setup_flash_kernel 'Olimex A20-Olinuxino Micro'
Bob Mottram's avatar
Bob Mottram committed
        ;;
    cubieboard2)
        setup_flash_kernel 'Cubietech Cubieboard2'
        ;;
    pcduino3)
        setup_flash_kernel 'LinkSprite pcDuino3'
Bob Mottram's avatar
Bob Mottram committed
        ;;
Bob Mottram's avatar
Bob Mottram committed
esac