Enable booting from sata on A20 boards

This commit is contained in:
Bob Mottram 2018-04-22 12:44:17 +01:00
parent 110c2a33e4
commit 8b4ada33d3
4 changed files with 26 additions and 7 deletions

View File

@ -153,6 +153,10 @@ MULTIPATH_TOOLS_REPO="https://aur.archlinux.org/multipath-tools.git"
MBR_REPO="https://aur.archlinux.org/mbr.git" MBR_REPO="https://aur.archlinux.org/mbr.git"
CLIAPP_REPO="git://git.liw.fi/cliapp" CLIAPP_REPO="git://git.liw.fi/cliapp"
# Whether to use a SATA drive and if so what its device/partition name is
# eg. sda2
EXTERNAL_DRIVE=
function image_setup { function image_setup {
setup_type=$1 setup_type=$1
@ -453,6 +457,10 @@ do
shift shift
LOCAL_NAME="$1" LOCAL_NAME="$1"
;; ;;
--sata|--hdd)
shift
EXTERNAL_DRIVE="$1"
;;
*) *)
# unknown option # unknown option
;; ;;
@ -601,6 +609,7 @@ make "$IMAGE_TYPE" \
INSECURE="$INSECURE" \ INSECURE="$INSECURE" \
AMNESIC="$AMNESIC" \ AMNESIC="$AMNESIC" \
SOCIALINSTANCE="$SOCIALINSTANCE" \ SOCIALINSTANCE="$SOCIALINSTANCE" \
EXTERNAL_DRIVE="$EXTERNAL_DRIVE" \
LOCAL_NAME="$LOCAL_NAME" LOCAL_NAME="$LOCAL_NAME"
# shellcheck disable=SC2181 # shellcheck disable=SC2181

View File

@ -141,6 +141,10 @@ BMX7_COMMIT='0a82c7c10fef44b259b35e77ab33632aa132d219'
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
# Whether to use a SATA drive and if so what its device/partition name is
# eg. sda2
EXTERNAL_DRIVE=
configure_backports() { configure_backports() {
echo "deb http://${DEBIAN_REPO}/debian/ ${DEBIAN_VERSION}-backports main" >> "$rootdir/etc/apt/sources.list" echo "deb http://${DEBIAN_REPO}/debian/ ${DEBIAN_VERSION}-backports main" >> "$rootdir/etc/apt/sources.list"
} }

View File

@ -155,6 +155,10 @@ beaglebone_repack_kernel() {
a20_setup_boot() { a20_setup_boot() {
dtb="$1" dtb="$1"
a20_root_device='mmcblk0p2'
if [ "$2" ]; then
a20_root_device="$2"
fi
# Setup boot.cmd # Setup boot.cmd
if grep -q btrfs /etc/fstab ; then if grep -q btrfs /etc/fstab ; then
@ -173,7 +177,7 @@ a20_setup_boot() {
setenv mmcdev 0 setenv mmcdev 0
setenv mmcpart 1 setenv mmcpart 1
setenv mmcroot /dev/mmcblk0p2 ro setenv mmcroot /dev/${a20_root_device} ro
setenv mmcrootfstype $fstype rootwait fixrtc setenv mmcrootfstype $fstype rootwait fixrtc
setenv mmcrootflags subvol=@ setenv mmcrootflags subvol=@
@ -239,27 +243,27 @@ case "$MACHINE" in
enable_serial_console ttyO0 enable_serial_console ttyO0
;; ;;
cubietruck) cubietruck)
a20_setup_boot sun7i-a20-cubietruck.dtb a20_setup_boot sun7i-a20-cubietruck.dtb "$EXTERNAL_DRIVE"
enable_serial_console ttyS0 enable_serial_console ttyS0
;; ;;
a20-olinuxino-lime) a20-olinuxino-lime)
a20_setup_boot sun7i-a20-olinuxino-lime.dtb a20_setup_boot sun7i-a20-olinuxino-lime.dtb "$EXTERNAL_DRIVE"
enable_serial_console ttyS0 enable_serial_console ttyS0
;; ;;
a20-olinuxino-lime2) a20-olinuxino-lime2)
a20_setup_boot sun7i-a20-olinuxino-lime2.dtb a20_setup_boot sun7i-a20-olinuxino-lime2.dtb "$EXTERNAL_DRIVE"
enable_serial_console ttyS0 enable_serial_console ttyS0
;; ;;
a20-olinuxino-micro) a20-olinuxino-micro)
a20_setup_boot sun7i-a20-olinuxino-micro.dtb a20_setup_boot sun7i-a20-olinuxino-micro.dtb "$EXTERNAL_DRIVE"
enable_serial_console ttyS0 enable_serial_console ttyS0
;; ;;
cubieboard2) cubieboard2)
a20_setup_boot sun7i-a20-cubieboard2.dtb a20_setup_boot sun7i-a20-cubieboard2.dtb "$EXTERNAL_DRIVE"
enable_serial_console ttyS0 enable_serial_console ttyS0
;; ;;
pcduino3) pcduino3)
a20_setup_boot sun7i-a20-pcduino3.dtb a20_setup_boot sun7i-a20-pcduino3.dtb "$EXTERNAL_DRIVE"
enable_serial_console ttyS0 enable_serial_console ttyS0
;; ;;
esac esac

View File

@ -77,6 +77,7 @@ export INSECURE
export AMNESIC export AMNESIC
export SOCIALINSTANCE export SOCIALINSTANCE
export LOCAL_NAME export LOCAL_NAME
export EXTERNAL_DRIVE
# Locate vmdebootstrap program fetched in Makefile # Locate vmdebootstrap program fetched in Makefile
basedir=`pwd` basedir=`pwd`
@ -225,6 +226,7 @@ sed -i "s|INSECURE=.*|INSECURE=\"${INSECURE}\"|g" "$TEMP_CUSTOMISE3"
sed -i "s|AMNESIC=.*|AMNESIC=\"${AMNESIC}\"|g" "$TEMP_CUSTOMISE3" sed -i "s|AMNESIC=.*|AMNESIC=\"${AMNESIC}\"|g" "$TEMP_CUSTOMISE3"
sed -i "s|SOCIALINSTANCE=.*|SOCIALINSTANCE=\"${SOCIALINSTANCE}\"|g" "$TEMP_CUSTOMISE3" sed -i "s|SOCIALINSTANCE=.*|SOCIALINSTANCE=\"${SOCIALINSTANCE}\"|g" "$TEMP_CUSTOMISE3"
sed -i "s|LOCAL_NAME=.*|LOCAL_NAME=\"${LOCAL_NAME}\"|g" "$TEMP_CUSTOMISE3" sed -i "s|LOCAL_NAME=.*|LOCAL_NAME=\"${LOCAL_NAME}\"|g" "$TEMP_CUSTOMISE3"
sed -i "s|EXTERNAL_DRIVE=.*|EXTERNAL_DRIVE=\"${EXTERNAL_DRIVE}\"|g" "$TEMP_CUSTOMISE3"
sed -i 's|#!/bin/bash||g' "$TEMP_CUSTOMISE3" sed -i 's|#!/bin/bash||g' "$TEMP_CUSTOMISE3"
cat $TEMP_CUSTOMISE2 $TEMP_CUSTOMISE3 > $TEMP_CUSTOMISE4 cat $TEMP_CUSTOMISE2 $TEMP_CUSTOMISE3 > $TEMP_CUSTOMISE4