| |
@@ -1,4 +1,4 @@
|
| |
- #!/bin/bash
|
| |
+ #!/bin/sh
|
| |
|
| |
# Copyright (C) 2014-2015 Red Hat Inc.
|
| |
# SPDX-License-Identifier: GPL-2.0+
|
| |
@@ -12,20 +12,19 @@
|
| |
echo "
|
| |
Usage: $(basename ${0}) <options>
|
| |
|
| |
- --image=IMAGE - xz compressed image file name
|
| |
- --target=TARGET - target board
|
| |
- --media=DEVICE - media device file (/dev/[sdX|mmcblkX])
|
| |
- --norootpass - Remove the root password
|
| |
- -y - Assumes yes, will not wait for confirmation
|
| |
- --version - Display version and exit
|
| |
- --resizefs - Resize root filesystem to fill media device
|
| |
- --addconsole - Add system console to extlinux.conf
|
| |
- --addkey= - /path/to/ssh-public-key
|
| |
- --supported - List of supported hardware
|
| |
+ --addconsole - Add system console to extlinux.conf
|
| |
+ --addkey= - /path/to/ssh-public-key
|
| |
+ --image=IMAGE - xz compressed image file name
|
| |
+ --media=DEVICE - media device file (/dev/[sdX|mmcblkX])
|
| |
+ --norootpass - Remove the root password
|
| |
+ --resizefs - Resize root filesystem to fill media device
|
| |
+ --supported - List of supported hardware
|
| |
+ --target=TARGET - target board
|
| |
+ --version - Display version and exit
|
| |
+ -y - Assumes yes, will not wait for confirmation
|
| |
|
| |
Example: $(basename ${0}) --image=Fedora-Rawhide.xz --target=Bananapi --media=/dev/mmcblk0
|
| |
|
| |
-
|
| |
"
|
| |
}
|
| |
|
| |
@@ -33,176 +32,175 @@
|
| |
# and valid targets.
|
| |
DIR=$(dirname $0)
|
| |
if [ -d "/usr/share/arm-image-installer/boards.d" ]; then
|
| |
- BOARDDIR="/usr/share/arm-image-installer/boards.d"
|
| |
+ BOARDDIR="/usr/share/arm-image-installer/boards.d"
|
| |
DOC_DIR="/usr/share/doc/fedora-arm-installer/"
|
| |
else
|
| |
- DIR=$(dirname $0)
|
| |
- BOARDDIR="${DIR}/boards.d"
|
| |
+ DIR=$(dirname $0)
|
| |
+ BOARDDIR="${DIR}/boards.d"
|
| |
DOC_DIR="${DIR}/"
|
| |
fi
|
| |
|
| |
# check the args
|
| |
while [ $# -gt 0 ]; do
|
| |
- case $1 in
|
| |
- --debug)
|
| |
- set -x
|
| |
- ;;
|
| |
- -h|--help)
|
| |
- usage
|
| |
- exit 0
|
| |
- ;;
|
| |
- --target*)
|
| |
- if echo $1 | grep '=' >/dev/null ; then
|
| |
- TARGET=$(echo $1 | sed 's/^--target=//')
|
| |
- else
|
| |
- TARGET=$2
|
| |
- shift
|
| |
- fi
|
| |
- ;;
|
| |
- --image*)
|
| |
- if echo $1 | grep '=' >/dev/null ; then
|
| |
- IMAGE=$(echo $1 | sed 's/^--image=//')
|
| |
- else
|
| |
- IMAGE=$2
|
| |
- shift
|
| |
- fi
|
| |
- ;;
|
| |
- --media*)
|
| |
- if echo $1 | grep '=' >/dev/null ; then
|
| |
- MEDIA=$(echo $1 | sed 's/^--media=//')
|
| |
- else
|
| |
- MEDIA=$2
|
| |
- shift
|
| |
- fi
|
| |
- ;;
|
| |
- --addkey*)
|
| |
- if echo $1 | grep '=' >/dev/null ; then
|
| |
- SSH_KEY=$(echo $1 | sed 's/^--addkey=//')
|
| |
- else
|
| |
- SSH_KEY=$2
|
| |
- shift
|
| |
- fi
|
| |
- ;;
|
| |
- --selinux*)
|
| |
- if echo $1 | grep '=' >/dev/null ; then
|
| |
- SELINUX=$(echo $1 | sed 's/^--selinux=//')
|
| |
- else
|
| |
- SELINUX=$2
|
| |
- shift
|
| |
- fi
|
| |
- ;;
|
| |
- --norootpass)
|
| |
- NOROOTPASS=1
|
| |
- ;;
|
| |
- --resizefs)
|
| |
- RESIZEFS=1
|
| |
- ;;
|
| |
- --addconsole)
|
| |
- CONSOLE=1
|
| |
+ case $1 in
|
| |
+ --debug)
|
| |
+ set -x
|
| |
+ ;;
|
| |
+ -h|--help)
|
| |
+ usage
|
| |
+ exit 0
|
| |
+ ;;
|
| |
+ --target*)
|
| |
+ if echo $1 | grep '=' >/dev/null ; then
|
| |
+ TARGET=$(echo $1 | sed 's/^--target=//')
|
| |
+ else
|
| |
+ TARGET=$2
|
| |
+ shift
|
| |
+ fi
|
| |
+ ;;
|
| |
+ --image*)
|
| |
+ if echo $1 | grep '=' >/dev/null ; then
|
| |
+ IMAGE=$(echo $1 | sed 's/^--image=//')
|
| |
+ else
|
| |
+ IMAGE=$2
|
| |
+ shift
|
| |
+ fi
|
| |
+ ;;
|
| |
+ --media*)
|
| |
+ if echo $1 | grep '=' >/dev/null ; then
|
| |
+ MEDIA=$(echo $1 | sed 's/^--media=//')
|
| |
+ else
|
| |
+ MEDIA=$2
|
| |
+ shift
|
| |
+ fi
|
| |
+ ;;
|
| |
+ --addkey*)
|
| |
+ if echo $1 | grep '=' >/dev/null ; then
|
| |
+ SSH_KEY=$(echo $1 | sed 's/^--addkey=//')
|
| |
+ else
|
| |
+ SSH_KEY=$2
|
| |
+ shift
|
| |
+ fi
|
| |
+ ;;
|
| |
+ --selinux*)
|
| |
+ if echo $1 | grep '=' >/dev/null ; then
|
| |
+ SELINUX=$(echo $1 | sed 's/^--selinux=//')
|
| |
+ else
|
| |
+ SELINUX=$2
|
| |
+ shift
|
| |
+ fi
|
| |
+ ;;
|
| |
+ --norootpass)
|
| |
+ NOROOTPASS=1
|
| |
+ ;;
|
| |
+ --resizefs)
|
| |
+ RESIZEFS=1
|
| |
+ ;;
|
| |
+ --addconsole)
|
| |
+ CONSOLE=1
|
| |
;;
|
| |
--blacklistvc4)
|
| |
FIX_RPI=1
|
| |
- ;;
|
| |
+ ;;
|
| |
--supported)
|
| |
- cat $DOC_DIR/SUPPORTED-BOARDS
|
| |
- exit 0
|
| |
- ;;
|
| |
- --version)
|
| |
- echo "$(basename ${0})-"$VERSION""
|
| |
- exit 0
|
| |
- ;;
|
| |
- -y)
|
| |
- NOASK=1
|
| |
- ;;
|
| |
- *)
|
| |
- echo "$(basename ${0}): Error - ${1}"
|
| |
- usage
|
| |
- exit 1
|
| |
- ;;
|
| |
- esac
|
| |
- shift
|
| |
+ cat $DOC_DIR/SUPPORTED-BOARDS
|
| |
+ exit 0
|
| |
+ ;;
|
| |
+ --version)
|
| |
+ echo "$(basename ${0})-"$VERSION""
|
| |
+ exit 0
|
| |
+ ;;
|
| |
+ -y)
|
| |
+ NOASK=1
|
| |
+ ;;
|
| |
+ *)
|
| |
+ echo "$(basename ${0}): Error - ${1}"
|
| |
+ usage
|
| |
+ exit 1
|
| |
+ ;;
|
| |
+ esac
|
| |
+ shift
|
| |
done
|
| |
|
| |
contains() {
|
| |
- string="$1"
|
| |
- substring="$2"
|
| |
- if test "${string#*$substring}" != "$string"
|
| |
- then
|
| |
- return 0 # $substring is in $string
|
| |
- else
|
| |
- return 1 # $substring is not in $string
|
| |
- fi
|
| |
+ string="$1"
|
| |
+ substring="$2"
|
| |
+ if test "${string#*$substring}" != "$string"; then
|
| |
+ return 0 # $substring is in $string
|
| |
+ else
|
| |
+ return 1 # $substring is not in $string
|
| |
+ fi
|
| |
}
|
| |
|
| |
# ensure sudo user
|
| |
- if [ "$(whoami)" != "root" ] ; then
|
| |
- echo "Error: This script requires 'sudo' privileges in order to write to disk & mount media."
|
| |
- exit 1
|
| |
+ if [ "$(whoami)" != "root" ]; then
|
| |
+ echo "Error: This script requires 'sudo' privileges in order to write to disk & mount media."
|
| |
+ exit 1
|
| |
fi
|
| |
|
| |
# check to make sure populated
|
| |
- if [ "$MEDIA" = "" ] ; then
|
| |
- usage
|
| |
- exit 1
|
| |
+ if [ "$MEDIA" = "" ]; then
|
| |
+ usage
|
| |
+ exit 1
|
| |
fi
|
| |
|
| |
# change cubietruck target to uppercase
|
| |
if [ "$TARGET" = "cubietruck" ]; then
|
| |
- TARGET="Cubietruck"
|
| |
+ TARGET="Cubietruck"
|
| |
fi
|
| |
|
| |
# check for boards
|
| |
- if [ "$TARGET" != "" -a ! -e "${BOARDDIR}/${TARGET}" ] ; then
|
| |
- echo "Error: You must choose a supported board or none at all."
|
| |
- usage
|
| |
- exit 1
|
| |
+ if [ "$TARGET" != "" -a ! -e "${BOARDDIR}/${TARGET}" ]; then
|
| |
+ echo "Error: You must choose a supported board or none at all."
|
| |
+ usage
|
| |
+ exit 1
|
| |
fi
|
| |
|
| |
# image exists
|
| |
- if [ ! -f "$IMAGE" ] && [ "$IMAGE" != "" ] ; then
|
| |
- echo "Error: $IMAGE not found! Please choose an existing image."
|
| |
- exit 1
|
| |
+ if [ ! -f "$IMAGE" ] && [ "$IMAGE" != "" ]; then
|
| |
+ echo "Error: $IMAGE not found! Please choose an existing image."
|
| |
+ exit 1
|
| |
fi
|
| |
|
| |
# device exists
|
| |
- if [ ! -e "$MEDIA" ] ; then
|
| |
- echo "Error: $MEDIA not found! Please choose an existing device."
|
| |
- exit 1
|
| |
+ if [ ! -e "$MEDIA" ]; then
|
| |
+ echo "Error: $MEDIA not found! Please choose an existing device."
|
| |
+ exit 1
|
| |
fi
|
| |
|
| |
clear
|
| |
# Last chance to back out
|
| |
- echo " "
|
| |
+ echo ""
|
| |
echo "====================================================="
|
| |
# Image if included
|
| |
- if [ "$IMAGE" != "" ] ; then
|
| |
- echo "= Selected Image: "
|
| |
- echo "= $IMAGE"
|
| |
+ if [ "$IMAGE" != "" ]; then
|
| |
+ echo "= Selected Image: "
|
| |
+ echo "= $IMAGE"
|
| |
fi
|
| |
echo "= Selected Media : $MEDIA"
|
| |
# target hardware platform
|
| |
- if [ "$TARGET" != "" ] ; then
|
| |
- echo "= U-Boot Target : $TARGET"
|
| |
+ if [ "$TARGET" != "" ]; then
|
| |
+ echo "= U-Boot Target : $TARGET"
|
| |
fi
|
| |
# SE Linux On/Off
|
| |
- if [ "$SELINUX" != "" ] ; then
|
| |
- echo "= SELINUX = $SELINUX"
|
| |
+ if [ "$SELINUX" != "" ]; then
|
| |
+ echo "= SELINUX = $SELINUX"
|
| |
fi
|
| |
# Remove root password
|
| |
- if [ "$NOROOTPASS" != "" ] ; then
|
| |
- echo "= Root Password will be removed."
|
| |
+ if [ "$NOROOTPASS" != "" ]; then
|
| |
+ echo "= Root Password will be removed."
|
| |
fi
|
| |
# Resize root filesystem to fill media device
|
| |
- if [ "$RESIZEFS" != "" ] ; then
|
| |
- echo "= Root partition will be resized"
|
| |
+ if [ "$RESIZEFS" != "" ]; then
|
| |
+ echo "= Root partition will be resized"
|
| |
fi
|
| |
# Console to be added
|
| |
- if [ "$CONSOLE" != "" ] ; then
|
| |
- echo "= Console for $TARGET will be added."
|
| |
+ if [ "$CONSOLE" != "" ]; then
|
| |
+ echo "= Console for $TARGET will be added."
|
| |
fi
|
| |
# User ssh key
|
| |
- if [ "$SSH_KEY" != "" ] ; then
|
| |
- echo "= SSH Public Key $SSH_KEY will be added."
|
| |
+ if [ "$SSH_KEY" != "" ]; then
|
| |
+ echo "= SSH Public Key $SSH_KEY will be added."
|
| |
fi
|
| |
echo "====================================================="
|
| |
echo " "
|
| |
@@ -211,79 +209,77 @@
|
| |
echo "******** WARNING! ALL DATA WILL BE DESTROYED ********"
|
| |
echo "*****************************************************"
|
| |
echo "*****************************************************"
|
| |
- if [ "$NOASK" != 1 ] ; then
|
| |
- echo " "
|
| |
- echo " Type 'YES' to proceed, anything else to exit now "
|
| |
- echo " "
|
| |
- # wait for agreement
|
| |
- read -p "= Proceed? " PROCEED
|
| |
- if [ "$(echo ${PROCEED} | tr [:lower:] [:upper:])" != "YES" ] ; then
|
| |
- echo "User exit, no image written."
|
| |
- exit 0
|
| |
- fi
|
| |
+ if [ "$NOASK" != 1 ]; then
|
| |
+ echo " "
|
| |
+ echo " Type 'YES' to proceed, anything else to exit now "
|
| |
+ echo " "
|
| |
+ # wait for agreement
|
| |
+ read -p "= Proceed? " PROCEED
|
| |
+ if [ "$(echo ${PROCEED} | tr [:lower:] [:upper:])" != "YES" ]; then
|
| |
+ echo "User exit, no image written."
|
| |
+ exit 0
|
| |
+ fi
|
| |
fi
|
| |
# umount before starting
|
| |
umount $MEDIA* &> /dev/null
|
| |
|
| |
# Write the disk image to media
|
| |
- if [ "$IMAGE" != "" ] ; then
|
| |
- echo "= Writing: "
|
| |
- echo "= $IMAGE "
|
| |
- echo "= To: $MEDIA ...."
|
| |
- xzcat $IMAGE | dd of=$MEDIA bs=4M; sync; sleep 3
|
| |
- echo "= Writing image complete!"
|
| |
- # read the new partition table
|
| |
- partprobe "$MEDIA"
|
| |
+ if [ "$IMAGE" != "" ]; then
|
| |
+ echo "= Writing: "
|
| |
+ echo "= $IMAGE "
|
| |
+ echo "= To: $MEDIA ...."
|
| |
+ xzcat $IMAGE | dd of=$MEDIA bs=4M; sync; sleep 3
|
| |
+ echo "= Writing image complete!"
|
| |
+ # read the new partition table
|
| |
+ partprobe "$MEDIA"
|
| |
fi
|
| |
# check to see how many partitions on the image
|
| |
partprobe "$MEDIA"
|
| |
sleep 1
|
| |
case $MEDIA in
|
| |
- "/dev/mmcblk"*)
|
| |
- if [ -e "$MEDIA"p4 ]; then
|
| |
- export FIRMPART="${MEDIA}p1"
|
| |
- BOOTPART="${MEDIA}p2"
|
| |
- ROOTPART="${MEDIA}p4"
|
| |
- PARTNUM=4
|
| |
- else
|
| |
- BOOTPART="${MEDIA}p1"
|
| |
- ROOTPART="${MEDIA}p3"
|
| |
- PARTNUM=3
|
| |
- fi
|
| |
- ;;
|
| |
- *)
|
| |
- if [ -e "$MEDIA"4 ]; then
|
| |
- export FIRMPART="${MEDIA}1"
|
| |
- BOOTPART="${MEDIA}2"
|
| |
- ROOTPART="${MEDIA}4"
|
| |
- PARTNUM=4
|
| |
- else
|
| |
- BOOTPART="${MEDIA}1"
|
| |
- ROOTPART="${MEDIA}3"
|
| |
- PARTNUM=3
|
| |
- fi
|
| |
- ;;
|
| |
+ "/dev/mmcblk"*)
|
| |
+ if [ -e "$MEDIA"p4 ]; then
|
| |
+ export FIRMPART="${MEDIA}p1"
|
| |
+ BOOTPART="${MEDIA}p2"
|
| |
+ ROOTPART="${MEDIA}p4"
|
| |
+ PARTNUM=4
|
| |
+ else
|
| |
+ BOOTPART="${MEDIA}p1"
|
| |
+ ROOTPART="${MEDIA}p3"
|
| |
+ PARTNUM=3
|
| |
+ fi
|
| |
+ ;;
|
| |
+ *)
|
| |
+ if [ -e "$MEDIA"4 ]; then
|
| |
+ export FIRMPART="${MEDIA}1"
|
| |
+ BOOTPART="${MEDIA}2"
|
| |
+ ROOTPART="${MEDIA}4"
|
| |
+ PARTNUM=4
|
| |
+ else
|
| |
+ BOOTPART="${MEDIA}1"
|
| |
+ ROOTPART="${MEDIA}3"
|
| |
+ PARTNUM=3
|
| |
+ fi
|
| |
+ ;;
|
| |
esac
|
| |
|
| |
# resize root filesystem before mounting
|
| |
- if [ "$RESIZEFS" != "" ] ; then
|
| |
- echo "= Resizing $MEDIA ...."
|
| |
- sync
|
| |
+ if [ "$RESIZEFS" != "" ]; then
|
| |
+ echo "= Resizing $MEDIA ...."
|
| |
+ sync
|
| |
count=0
|
| |
- echo ", +" | sfdisk -N "$PARTNUM" "$MEDIA"
|
| |
- while [ $? != '0' ]; do
|
| |
- sleep 5
|
| |
- echo ", +" | sfdisk -N "$PARTNUM" "$MEDIA"
|
| |
+ echo ", +" | sfdisk -N "$PARTNUM" "$MEDIA"
|
| |
+ while [ $? != '0' ]; do
|
| |
+ sleep 5
|
| |
+ echo ", +" | sfdisk -N "$PARTNUM" "$MEDIA"
|
| |
count=$((count+1))
|
| |
- if [ $count -gt 5 ]
|
| |
- then
|
| |
- echo "= Partition Resize Failed."
|
| |
- continue
|
| |
+ if [ $count -gt 5 ]; then
|
| |
+ echo "= Partition Resize Failed."
|
| |
+ continue
|
| |
fi
|
| |
-
|
| |
- done
|
| |
-
|
| |
- partprobe "$MEDIA"
|
| |
+ done
|
| |
+
|
| |
+ partprobe "$MEDIA"
|
| |
|
| |
FS_TYPE=$(file -s "$ROOTPART" | awk '{print $3}')
|
| |
if [ "$FS_TYPE" = "XFS" ]; then
|
| |
@@ -294,7 +290,7 @@
|
| |
umount "$ROOTPART"
|
| |
else
|
| |
fsck.ext4 -fy "$ROOTPART"
|
| |
- resize2fs "$ROOTPART"
|
| |
+ resize2fs "$ROOTPART"
|
| |
fi
|
| |
fi
|
| |
|
| |
@@ -302,66 +298,66 @@
|
| |
mkdir /tmp/{boot,root} &> /dev/null
|
| |
mount "$BOOTPART" /tmp/boot &> /dev/null
|
| |
if [ $? -ne 0 ]; then
|
| |
- echo "Error: mount $BOOTPART /tmp/boot failed"
|
| |
- exit 1
|
| |
+ echo "Error: mount $BOOTPART /tmp/boot failed"
|
| |
+ exit 1
|
| |
fi
|
| |
|
| |
mount "$ROOTPART" /tmp/root &> /dev/null
|
| |
if [ $? -ne 0 ]; then
|
| |
- echo "Error: mount $ROOTPART /tmp/root failed"
|
| |
- exit 1
|
| |
+ echo "Error: mount $ROOTPART /tmp/root failed"
|
| |
+ exit 1
|
| |
fi
|
| |
|
| |
# turn off selinux
|
| |
- if [ "$SELINUX" != "" ] ; then
|
| |
- if [ "$(echo ${SELINUX} | tr [:lower:] [:upper:])" = "OFF" ] ; then
|
| |
- echo "= Turning SELinux off ..."
|
| |
- sed -i 's/append/& enforcing=0/' /tmp/boot/extlinux/extlinux.conf
|
| |
- # turn on selinux
|
| |
- elif [ "$(echo ${SELINUX} | tr [:lower:] [:upper:])" = "ON" ] ; then
|
| |
- echo "= Turning SELinux on ..."
|
| |
- sed -i 's/ enforcing=0//' /tmp/boot/extlinux/extlinux.conf
|
| |
- fi
|
| |
+ if [ "$SELINUX" != "" ]; then
|
| |
+ if [ "$(echo ${SELINUX} | tr [:lower:] [:upper:])" = "OFF" ]; then
|
| |
+ echo "= Turning SELinux off ..."
|
| |
+ sed -i 's/append/& enforcing=0/' /tmp/boot/extlinux/extlinux.conf
|
| |
+ # turn on selinux
|
| |
+ elif [ "$(echo ${SELINUX} | tr [:lower:] [:upper:])" = "ON" ]; then
|
| |
+ echo "= Turning SELinux on ..."
|
| |
+ sed -i 's/ enforcing=0//' /tmp/boot/extlinux/extlinux.conf
|
| |
+ fi
|
| |
fi
|
| |
# Remove root password
|
| |
- if [ "$NOROOTPASS" = "1" ] ; then
|
| |
- echo "= Removing the root password."
|
| |
- sed -i 's/root:x:/root::/' /tmp/root/etc/passwd
|
| |
+ if [ "$NOROOTPASS" = "1" ]; then
|
| |
+ echo "= Removing the root password."
|
| |
+ sed -i 's/root:x:/root::/' /tmp/root/etc/passwd
|
| |
fi
|
| |
# Add ssh key to the image
|
| |
- if [ "$SSH_KEY" != "" ] ; then
|
| |
- if [ -f $SSH_KEY ]; then
|
| |
- echo "= Adding SSH key to authorized keys."
|
| |
- mkdir /tmp/root/root/.ssh/ &> /dev/null
|
| |
- cat $SSH_KEY >> /tmp/root/root/.ssh/authorized_keys
|
| |
- chmod -R u=rwX,o=,g= /tmp/root/root/.ssh/
|
| |
- else
|
| |
- echo "= SSH key $SSH_KEY : Not Found!"
|
| |
- echo "= WARNING: No SSH Key Added."
|
| |
- fi
|
| |
-
|
| |
+ if [ "$SSH_KEY" != "" ]; then
|
| |
+ if [ -f $SSH_KEY ]; then
|
| |
+ echo "= Adding SSH key to authorized keys."
|
| |
+ mkdir /tmp/root/root/.ssh/ &> /dev/null
|
| |
+ cat $SSH_KEY >> /tmp/root/root/.ssh/authorized_keys
|
| |
+ chmod -R u=rwX,o=,g= /tmp/root/root/.ssh/
|
| |
+ else
|
| |
+ echo "= SSH key $SSH_KEY : Not Found!"
|
| |
+ echo "= WARNING: No SSH Key Added."
|
| |
+ fi
|
| |
+
|
| |
fi
|
| |
# determine uboot and write to disk
|
| |
if [ "$TARGET" = "" ]; then
|
| |
- echo "= No U-boot will be written."
|
| |
- TARGET="Mystery Board"
|
| |
+ echo "= No U-boot will be written."
|
| |
+ TARGET="Mystery Board"
|
| |
else
|
| |
- PREFIX=/tmp/root
|
| |
- . "${BOARDDIR}/${TARGET}"
|
| |
- # Add console
|
| |
- if [ "$CONSOLE" = "1" ] && [ "$SYSCON" != "" ] ; then
|
| |
- echo "= Adding console $SYSCON to extlinux.conf ..."
|
| |
- sed -i "s|append|& console=$SYSCON|" /tmp/boot/extlinux/extlinux.conf
|
| |
+ PREFIX=/tmp/root
|
| |
+ . "${BOARDDIR}/${TARGET}"
|
| |
+ # Add console
|
| |
+ if [ "$CONSOLE" = "1" ] && [ "$SYSCON" != "" ]; then
|
| |
+ echo "= Adding console $SYSCON to extlinux.conf ..."
|
| |
+ sed -i "s|append|& console=$SYSCON|" /tmp/boot/extlinux/extlinux.conf
|
| |
if [ "$TARGET" = "rpi2" ] || [ "$TARGET" = "rpi3" ]; then
|
| |
- mkdir /tmp/fw &> /dev/null
|
| |
- mount "$FIRMPART" /tmp/fw &> /dev/null
|
| |
- sed -i "s|# enable_uart=1|enable_uart=1|" /tmp/fw/config.txt
|
| |
- fi
|
| |
- fi
|
| |
+ mkdir /tmp/fw &> /dev/null
|
| |
+ mount "$FIRMPART" /tmp/fw &> /dev/null
|
| |
+ sed -i "s|# enable_uart=1|enable_uart=1|" /tmp/fw/config.txt
|
| |
+ fi
|
| |
+ fi
|
| |
|
| |
fi
|
| |
# fix up rpi2/3
|
| |
- if [ "$FIX_RPI" != "" ] ; then
|
| |
+ if [ "$FIX_RPI" != "" ]; then
|
| |
echo "= Blacklisting the VC4 Driver for the Raspberry Pi 2/3"
|
| |
echo blacklist vc4 > /tmp/root/etc/modprobe.d/blacklist-vc4.conf
|
| |
sed -i 's/append/& rd.driver.blacklist=vc4/' /tmp/boot/extlinux/extlinux.conf
|
| |
uses bash specyfic syntax.