From ca5f873b083d6228e17e73abf121bcc1cb1d7b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Tue, 2 Oct 2018 09:58:24 +0200 Subject: [PATCH] Rewrite of card scripts completely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce the card specific code to what's needed. Signed-off-by: Andreas Müller --- scripts/imx-card-kernel-write.sh | 15 + scripts/imx-card-write.sh | 14 + scripts/include/card-helpers.inc | 279 ++++++++++++++++++ scripts/include/common-helpers.inc | 54 ++++ scripts/include/machine-imx.inc | 95 ++++++ scripts/include/machine-raspberrypi.inc | 103 +++++++ scripts/include/machine-ti-old-omap.inc | 118 ++++++++ scripts/raspberrypi-card-kernel-write.sh | 15 + scripts/raspberrypi-card-write.sh | 14 + .../freescale-imx/card-kernel-write.sh | 153 ---------- .../sdcard-write/freescale-imx/card-write.sh | 77 ----- .../sdcard-write/freescale-imx/machine.inc | 4 - .../sdcard-write/raspberrypi/card-write.sh | 70 ----- scripts/sdcard-write/raspberrypi/machine.inc | 6 - scripts/sdcard-write/tools.inc | 231 --------------- scripts/ti-old-omap-README | 5 + scripts/ti-old-omap-card-part.sh | 47 +++ scripts/ti-old-omap-card-write.sh | 14 + 18 files changed, 773 insertions(+), 541 deletions(-) create mode 100755 scripts/imx-card-kernel-write.sh create mode 100755 scripts/imx-card-write.sh create mode 100644 scripts/include/card-helpers.inc create mode 100644 scripts/include/common-helpers.inc create mode 100644 scripts/include/machine-imx.inc create mode 100644 scripts/include/machine-raspberrypi.inc create mode 100644 scripts/include/machine-ti-old-omap.inc create mode 100755 scripts/raspberrypi-card-kernel-write.sh create mode 100755 scripts/raspberrypi-card-write.sh delete mode 100755 scripts/sdcard-write/freescale-imx/card-kernel-write.sh delete mode 100755 scripts/sdcard-write/freescale-imx/card-write.sh delete mode 100644 scripts/sdcard-write/freescale-imx/machine.inc delete mode 100755 scripts/sdcard-write/raspberrypi/card-write.sh delete mode 100644 scripts/sdcard-write/raspberrypi/machine.inc delete mode 100644 scripts/sdcard-write/tools.inc create mode 100644 scripts/ti-old-omap-README create mode 100755 scripts/ti-old-omap-card-part.sh create mode 100755 scripts/ti-old-omap-card-write.sh diff --git a/scripts/imx-card-kernel-write.sh b/scripts/imx-card-kernel-write.sh new file mode 100755 index 0000000..88da713 --- /dev/null +++ b/scripts/imx-card-kernel-write.sh @@ -0,0 +1,15 @@ +#! /bin/bash + +# imx-card-kernel-write.sh +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script writes kernel+modules to SDCard. To +# select card device a dialog based GUI is used. + +# Includes +. `dirname $0`/include/common-helpers.inc +. `dirname $0`/include/card-helpers.inc +. `dirname $0`/include/machine-imx.inc + +StartCardKernelWrite diff --git a/scripts/imx-card-write.sh b/scripts/imx-card-write.sh new file mode 100755 index 0000000..6ae0dcc --- /dev/null +++ b/scripts/imx-card-write.sh @@ -0,0 +1,14 @@ +#! /bin/bash + +# imx-card-write.sh +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script writes image to sdcard and aligns rootfs partition to max size. + +# Includes +. `dirname $0`/include/common-helpers.inc +. `dirname $0`/include/card-helpers.inc +. `dirname $0`/include/machine-imx.inc + +StartCardWrite diff --git a/scripts/include/card-helpers.inc b/scripts/include/card-helpers.inc new file mode 100644 index 0000000..5ec2580 --- /dev/null +++ b/scripts/include/card-helpers.inc @@ -0,0 +1,279 @@ +#! /bin/bash + +# card-helpers.inc +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script contains some helper functions and can be sourced by other +# scripts + +# SelectCardDevice() creates a dialog to select one of all available removable +# devices. The path to the selected device is stored in the variale DevicePath. +SelectCardDevice() { + if [ -z "$DevicePath" ]; then + iCount=0 + for dev in /dev/sd[a-z] ; do + DeviceFile=`basename $dev` + # we are only interested in removable devices + if [ `cat /sys/block/$DeviceFile/removable` = '1' ] && [ `cat /sys/block/$DeviceFile/size` -gt "0" ]; then + iCount=`expr $iCount + 1` + DevicePathArr[${iCount}]=$dev + # pretify display + secondline= + display= + IFS=$'\n' + for line in `lsblk --raw --noheadings --output NAME,LABEL,MODEL $dev` ; do + # a bug in lsblk? + line=`echo $line | sed 's:\\\x20: :g'` + if [ "x$secondline" = "x" ]; then + # first line - it is for device + secondline="1" + display="$line" + else + if [ "x$secondline" = "x1" ]; then + secondline="2" + # second line - header + partition + display="$display / partitions: $line" + else + # second line - separator + partition + display="$display + $line" + fi + fi + done + display=`echo $display | sed 's: : :g'` + display=`echo $display | sed 's: : :g'` + display=`echo $display | sed 's: : :g'` + + unset IFS + menuitems+=( "$iCount" "$display" ) + fi + done + + if [ $iCount -eq 0 ]; then + ErrorOut 'No removable devices found!' + fi + + dialog --title 'Select card device'\ + --menu 'Move using [UP] [DOWN],[Enter] to select' 10 100 $iCount\ + "${menuitems[@]}"\ + 2>/tmp/menuitem.$$ + + # get OK/Cancel + sel=$? + # get selected menuitem + menuitem=`cat /tmp/menuitem.$$` + rm -f /tmp/menuitem.$$ + + # Cancel Button or + if [ $sel -eq 1 -o $sel -eq 255 ] ; then + ErrorOut 'Cancel selected at SelectCardDevice().' + fi + DevicePath=${DevicePathArr[$menuitem]} + fi +} + +# SelectDeployedFile() opens a dialog to select file containing rootfs/kernel/... +# It expects one parameter which contains find parameters e.g for raspberrypi: +# '-name *.rpi-sdimg -type l'. +# Output variables: +# DeployedFile: The file selected +# DeployFileDir: Path of the file selected +SelectDeployedFile() { + if [ -z "$DeployedFile" ]; then + # OE environment found? + if [ -z "$BUILDDIR" ]; then + ErrorOut "The environment variable BUILDDIR is not set. It is usually set before running bitbake." + fi + iCount=0 + strSelection= + for grep_result in `grep -h TMPDIR $BUILDDIR/conf/*.conf | sed -e s/' '/''/g -e s/'\"'/''/g`; do + # exclude comments + tmp_dir=`echo $grep_result | grep '^TMPDIR='` + if [ ! -z "$tmp_dir" ]; then + OeTmpDir=`echo $tmp_dir | sed -e s/'TMPDIR='/''/g` + fi + done + for BuildPath in ${OeTmpDir}-*; do + for i in `find ${BuildPath}/deploy/images/${Machine} $FindString | sort` ; do + iCount=`expr $iCount + 1` + RootFileNameArr[${iCount}]=$i + strSelection="$strSelection $iCount "`basename $i` + done + done + + # were files found? + if [ $iCount -eq 0 ]; then + ErrorOut "No files found in ${OeTmpDir}-\* matching $FindString" + fi + + dialog --title 'Select rootfs'\ + --menu 'Move using [UP] [DOWN],[Enter] to select' 30 100 $iCount\ + ${strSelection}\ + 2>/tmp/menuitem.$$ + + # get OK/Cancel + sel=$? + # get selected menuitem + menuitem=`cat /tmp/menuitem.$$` + rm -f /tmp/menuitem.$$ + + # Cancel Button or + if [ $sel -eq 1 -o $sel -eq 255 ] ; then + ErrorOut "Cancel selected at SelectDeployedFile()." + fi + DeployedFile=${RootFileNameArr[$menuitem]} + fi + DeployFileDir=`dirname $DeployedFile` + + # Now that we know the file, exact_machine can be set without wildcards + Machine=`basename $DeployFileDir` +} + +SelectSuSudo() { + # Select su/sudo + dialog --title 'Select how you want to logon as root'\ + --menu 'Move using [UP] [DOWN],[Enter] to select' 10 100 2 1 su 2 sudo \ + 2>/tmp/menuitem.$$ + + # get OK/Cancel + sel=$? + # get selected menuitem + menuitem=`cat /tmp/menuitem.$$` + rm -f /tmp/menuitem.$$ + + # Cancel Button or + if [ $sel -eq 1 -o $sel -eq 255 ] ; then + ErrorOut "Cancel selected at SelectSuSudo()." + fi +} + +SelectInOut() { + # DevicePath for target card + SelectCardDevice + + # select rootfs source + SelectDeployedFile +} + +# EnsureUnmount() tests if a device partition is mounted. If so partition is +# unmounted. Device name is expected in first parameter. +EnsureUnmount() { + # check if the card is currently mounted + MOUNTSTR=$(mount | grep $1) + if [ -n "$MOUNTSTR" ] ; then + echo -e "\n$1 is mounted. Unmounting..." + umount -f ${1}?* + echo "${style_green}Unmount done${style_normal}" + fi +} + +# PrepareWrite performs actions required before data write can start: +# * Check if source and destination locations are valid +# * Extract source path to variable DeployFileDir +# * eventually unmount destination +# The following variables are expected: +# * DevicePath: destination block-device e.g '/dev/sdc' +# * DeployedFile (optional): source file (rootfs/kernel/..) +PrepareWrite() { + # device node valid? + if [ ! -b "${DevicePath}" ] ; then + ErrorOut "$DevicePath is not a valid block device!" + fi + + if [ -n "${DeployedFile}" ] ; then + # rootfs/kernel valid? + if [ ! -e "${DeployedFile}" ] ; then + ErrorOut "$DeployedFile can not be found!" + fi + fi + EnsureUnmount $DevicePath +} + +# RunUserStartRoot() tests if we are running as root. If not, it calls SelectInOut. It expects +# SelectInOut to leave the required parameters for root call in variable RootParams. +# After this it asks user how to log on as root. Then the main script is started +# as root. +RunUserStartRoot() { + # we are not already root? + if [ ! $( id -u ) -eq 0 ]; then + SelectInOut + SelectSuSudo + + # prepare passing params to root-run - make sure they have same + # signature as loaded at the end of this file + RootParams="$DevicePath $DeployedFile $DeployFileDir $Machine $FindString $KernelImageType" + + # dialog's gui is done here + clear + echo + if [ "x$1" = "x" ] ; then + # No message text passed: use standard + echo "${style_bold}All data currenly stored on $DevicePath will be overwritten!${style_normal}" + else + # Use message text passed + echo $1 | sed "s|\%DevicePath\%|$DevicePath|" + fi + + if [ $menuitem -eq 1 ]; then + echo -e "\nEnter valid root password if you are sure you want to continue" + # Call this prog as root + exec su -c "${0} $RootParams" + else + echo -e "\nEnter valid sudo password if you are sure you want to continue" + sudo -k + # Call this prog as root + exec sudo ${0} $RootParams + fi + # sice we're 'execing' above, we wont reach this exit unless something + # goes wrong. + ErrorOut "RunUserStartRoot() should not have reached here!" + fi +} + +StartCardWrite() { + # If not set on call - get defaults from machine.inc + if [ -z "$Machine" ]; then + Machine="$DEFAULT_MACHINE_FAMILY" + fi + if [ -z "$FindString" ]; then + FindString="$DEFAULT_FIND_ROOTFS" + fi + + RunUserStartRoot + PrepareWrite + RootCardWriteCallback +} + +StartCardKernelWrite() { + # If not set on call - get defaults from machine.inc + if [ -z "$Machine" ]; then + Machine="$DEFAULT_MACHINE_FAMILY" + fi + if [ -z "$FindString" ]; then + FindString="$DEFAULT_FIND_KERNEL" + fi + if [ -z "$KernelImageType" ]; then + KernelImageType="$DEFAULT_KERNEL_IMAGE_TYPE" + fi + + RunUserStartRoot "${style_bold}The kernel images on %DevicePath% will be overwritten!${style_normal}" + PrepareWrite + RootCardKernelWriteCallback +} + + +# check common prerequisites +CheckPrerequisite "dialog" +CheckPrerequisite "lsblk" + +# For user call the first two params can be set optionally - the first +# target/source dialogs won't be displayed then +DevicePath=$1 +DeployedFile=$2 +# For root call all params are mandatory +if [ $( id -u ) -eq 0 ]; then + DeployFileDir=$3 + Machine=$4 + FindString=$5 + KernelImageType=$6 +fi diff --git a/scripts/include/common-helpers.inc b/scripts/include/common-helpers.inc new file mode 100644 index 0000000..5b7141b --- /dev/null +++ b/scripts/include/common-helpers.inc @@ -0,0 +1,54 @@ +#! /bin/bash + +# common-helpers.inc +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script contains some helper functions and can be sourced by other +# scripts + +# set terminal styles +# are we on terrminal? +if [ -t 1 ] ; then + # tput available? + if [ ! "x`which tput 2>/dev/null`" = "x" ] ; then + # supports colors ? + ncolors=`tput colors` + if [ -n "$ncolors" -a $ncolors -ge 8 ] ; then + style_bold="`tput bold`" + style_underline="`tput smul`" + style_standout="`tput smso`" + style_normal="`tput sgr0`" + style_black="`tput setaf 0`" + style_red="`tput setaf 1`" + style_green="`tput setaf 2`" + style_yellow="`tput setaf 3`" + style_blue="`tput setaf 4`" + style_magenta="`tput setaf 5`" + style_cyan="`tput setaf 6`" + style_white="`tput setaf 7`" + fi + fi +fi + +# base tempdir +base_tempdir=`mktemp -u` +base_tempdir=`dirname "$base_tempdir"` + +# ErrorOut outputs error text in first param and exits script +ErrorOut() { + clear + echo "${style_red}${style_bold}${1}${style_normal}" + echo + exit -1 +} + +# CheckPrerequisite checks if required hosttool is found on host. In case not +# it outputs a message and exits script. +CheckPrerequisite() { + if [ "x`which $1 2>/dev/null`" = "x" ] ; then + ErrorOut "You need to install $1 first!" + fi +} + + diff --git a/scripts/include/machine-imx.inc b/scripts/include/machine-imx.inc new file mode 100644 index 0000000..b317072 --- /dev/null +++ b/scripts/include/machine-imx.inc @@ -0,0 +1,95 @@ +#! /bin/bash + +# machine-imx.inc +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script contains settings and callbacks for NXP imx boards + +# default settings +DEFAULT_MACHINE_FAMILY='*imx*' +DEFAULT_FIND_ROOTFS='-name *.sdcard -o -name *.wic.gz -type l' +DEFAULT_KERNEL_IMAGE_TYPE='uImage' +DEFAULT_FIND_KERNEL="-name ${DEFAULT_KERNEL_IMAGE_TYPE}-abiversion-* -type l" + +# callback for card-write +RootCardWriteCallback() { + # rootfs write/resize to card fit + time( + # write + echo "Write $DeployedFile to $DevicePath..." + if echo $DeployedFile | grep -q '.wic.gz'; then + gunzip -c $DeployedFile | dd of=$DevicePath bs=1024K + else + dd of=$DevicePath if=$DeployedFile bs=1024K + fi + sync + echo "${style_green}Write done.${style_normal}" + # resize + echo "Resize ${DevicePath}2..." + parted -s $DevicePath -- resizepart 2 -0 + resize2fs "${DevicePath}2" + echo "${style_green}Resize done.${style_normal}" + ) +} + +# callback for card-kernel-write +RootCardKernelWriteCallback() { + tmpdir=`mktemp -d` + + # initial kernel + mount ${DevicePath}1 $tmpdir || exit 1 + echo "Write initial kernel and devicetrees to boot partition..." + rm -f $tmpdir/${KernelImageType}* + cp -f $DeployedFile $tmpdir/$KernelImageType + # devicetrees + rm -f $tmpdir/*.dtb + for dtb in `find ${DeployFileDir} -name "${KernelImageType}*.dtb" -type l`; do + dtbname=`basename $dtb | sed 's:'${KernelImageType}'-::'` + cp -f $dtb $tmpdir/${dtbname} + done + echo "${style_green}Write done.${style_normal}" + + echo "Unmount boot partition..." + sleep 1 + umount ${DevicePath}1 || exit 1 + echo "${style_green}Unmount done.${style_normal}" + + # rootfs/boot + mount ${DevicePath}2 $tmpdir || exit 1 + echo "Write kernel to rootfs..." + rm -f $tmpdir/boot/${KernelImageType}* + KernelWithAbiName=`basename $DeployedFile | sed -e 's:-abiversion-::'` + cp $DeployedFile $tmpdir/boot/$KernelWithAbiName + ln -sf $KernelWithAbiName $tmpdir/boot/$KernelImageType + echo "${style_green}Write done.${style_normal}" + + # rootfs/lib/modules + echo "Write modules to rootfs..." + kernel_abi_ver=`echo $KernelWithAbiName | sed 's:'${KernelImageType}'::g'` + for modules in `find ${DeployFileDir} -name "modules-${Machine}.tgz"`; do + tar xvzf ${modules} -C $tmpdir/ + done + echo "${style_green}Write done.${style_normal}" + + # run depmod (stolen from dempodwrapper) + sys_map=`realpath ${DeployFileDir}/../../../pkgdata/${Machine}/kernel-depmod/System.map-$kernel_abi_ver` + echo "Run depmod on modules..." + depmod -a -b $tmpdir -F "$sys_map" "$kernel_abi_ver" + echo "${style_green}Run done.${style_normal}" + + # cleanup + echo "Unmount rootfs partition..." + umount ${DevicePath}2 || exit 1 + echo "${style_green}Unmount done.${style_normal}" + rm -rf $tmpdir +} + + +CheckPrerequisite "time" +CheckPrerequisite "gunzip" +CheckPrerequisite "dd" +CheckPrerequisite "parted" +CheckPrerequisite "resize2fs" +CheckPrerequisite "depmod" + diff --git a/scripts/include/machine-raspberrypi.inc b/scripts/include/machine-raspberrypi.inc new file mode 100644 index 0000000..bc5493c --- /dev/null +++ b/scripts/include/machine-raspberrypi.inc @@ -0,0 +1,103 @@ +#! /bin/bash + +# machine-raspberrypi.inc +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script contains settings and callbacks fir raspberrypi boards + +# default settings +DEFAULT_MACHINE_FAMILY='raspberrypi*' +DEFAULT_FIND_ROOTFS='-name *.rpi-sdimg -type l' +DEFAULT_KERNEL_IMAGE_TYPE='Image' +DEFAULT_FIND_KERNEL="-name ${DEFAULT_KERNEL_IMAGE_TYPE}-abiversion-* -type l" + +# callback for card-write +RootCardWriteCallback() { + # rootfs write/resize to card fit + time( + # write + echo "Write $DeployedFile to $DevicePath..." + dd of=$DevicePath if=$DeployedFile bs=1024K + sync + echo "${style_green}Write done.${style_normal}" + echo "Resize ${DevicePath}2..." + parted -s $DevicePath -- resizepart 2 -0 + resize2fs "${DevicePath}2" + echo "${style_green}Resize done.${style_normal}" + ) +} + +# callback for card-kernel-write +RootCardKernelWriteCallback() { + tmpdir=`mktemp -d` + + # initial kernel / devicetrees + mount ${DevicePath}1 $tmpdir || exit 1 + echo "Write initial kernel and devicetrees to boot partition..." + # kernel (REVISIT for aarch64) + cp -f $DeployedFile $tmpdir/kernel7.img + # devicetrees + rm -f $tmpdir/*.dtb + for dtb in `find ${DeployFileDir} -name "bcm27*.dtb"`; do + cp -f $dtb $tmpdir/ + done + echo "${style_green}Write done.${style_normal}" + + # devicetree overlays + echo "Write devicetree-overlays to boot partition..." + rm -f $tmpdir/overlays/*.dtbo + for dtbo in `find ${DeployFileDir} -name "*.dtbo"`; do + bname=`basename $dtbo` + if ! echo "${bname}" | grep -q 'Image-'; then + cp -f ${dtbo} $tmpdir/overlays/ + fi + done + echo "${style_green}Write done.${style_normal}" + + # TODO bootfiles? + echo "Unmount boot partition..." + sleep 1 + umount ${DevicePath}1 || exit 1 + echo "${style_green}Unmount done.${style_normal}" + + + # rootfs/boot + mount ${DevicePath}2 $tmpdir || exit 1 + echo "Write kernel to rootfs..." + rm -f $tmpdir/boot/${KernelImageType}* + KernelFileName=`basename $DeployedFile` + cp $DeployedFile $tmpdir/boot/ + ln -sf $KernelFileName $tmpdir/boot/$KernelImageType + echo "${style_green}Write done.${style_normal}" + + # rootfs/lib/modules + echo "Write modules to rootfs..." + kernel_abi_ver=`echo $KernelFileName | sed 's:'${KernelImageType}'-::g'` + rm -rf $tmpdir/lib/modules/$kernel_abi_ver + for modules in `find ${DeployFileDir} -name "modules-${Machine}.tgz"`; do + tar xvzf ${modules} -C $tmpdir/ + done + echo "${style_green}Write done.${style_normal}" + + # run depmod (stolen from dempodwrapper) + sys_map=`realpath ${DeployFileDir}/../../../pkgdata/${Machine}/kernel-depmod/System.map-$kernel_abi_ver` + echo "Run depmod on modules..." + depmod -a -b $tmpdir -F "$sys_map" "$kernel_abi_ver" + echo "${style_green}Run done.${style_normal}" + + # cleanup + echo "Unmount rootfs partition..." + umount ${DevicePath}2 || exit 1 + echo "${style_green}Unmount done.${style_normal}" + rm -rf $tmpdir +} + + +CheckPrerequisite "time" +CheckPrerequisite "gunzip" +CheckPrerequisite "dd" +CheckPrerequisite "parted" +CheckPrerequisite "resize2fs" +CheckPrerequisite "depmod" + diff --git a/scripts/include/machine-ti-old-omap.inc b/scripts/include/machine-ti-old-omap.inc new file mode 100644 index 0000000..2749934 --- /dev/null +++ b/scripts/include/machine-ti-old-omap.inc @@ -0,0 +1,118 @@ +#! /bin/bash + +# machine-ti-old-omap.inc +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script contains settings and callbacks fir raspberrypi boards + +# default settings +DEFAULT_MACHINE_FAMILY='' +DEFAULT_FIND_ROOTFS='-name *.rootfs.tar.bz2 -type l' +DEFAULT_KERNEL_IMAGE_TYPE='Image' +DEFAULT_FIND_KERNEL="-name ${DEFAULT_KERNEL_IMAGE_TYPE}-abiversion-* -type l" + +# callback for card-write +RootCardWriteCallback() { + tmpdir=`mktemp -d` + + # bootloaders and environment + echo "Writing bootloaders and environment to boot partition" + mount ${DevicePath}1 $tmpdir || exit 1 + rm -rf $tmpdir/* + if [ -e ${DeployFileDir}/MLO ] ; then + cp ${DeployFileDir}/MLO $tmpdir/MLO + fi + cp ${DeployFileDir}/u-boot.img $tmpdir/u-boot.img + if [ -e ${DeployFileDir}/uEnv.txt ] ; then + cp ${DeployFileDir}/uEnv.txt $tmpdir + fi + sleep 1 + umount ${DevicePath}1 || exit 1 + + # rootfs + time( + mount ${DevicePath}2 $tmpdir || exit 1 + rm -rf $tmpdir/* + cd $tmpdir + tar xvjf $DeployedFile + cd .. + umount ${DevicePath}2 || exit 1 + ) + rm -rf $tmpdir +} + +# callback for card-kernel-write +RootCardKernelWriteCallback() { + # TODO + tmpdir=`mktemp -d` + + # initial kernel / devicetrees + mount ${DevicePath}1 $tmpdir || exit 1 + echo "Write initial kernel and devicetrees to boot partition..." + # kernel (REVISIT for aarch64) + cp -f $DeployedFile $tmpdir/kernel7.img + # devicetrees + rm -f $tmpdir/*.dtb + for dtb in `find ${DeployFileDir} -name "bcm27*.dtb"`; do + cp -f $dtb $tmpdir/ + done + echo "${style_green}Write done.${style_normal}" + + # devicetree overlays + echo "Write devicetree-overlays to boot partition..." + rm -f $tmpdir/overlays/*.dtbo + for dtbo in `find ${DeployFileDir} -name "*.dtbo"`; do + bname=`basename $dtbo` + if ! echo "${bname}" | grep -q 'Image-'; then + cp -f ${dtbo} $tmpdir/overlays/ + fi + done + echo "${style_green}Write done.${style_normal}" + + # TODO bootfiles? + echo "Unmount boot partition..." + sleep 1 + umount ${DevicePath}1 || exit 1 + echo "${style_green}Unmount done.${style_normal}" + + + # rootfs/boot + mount ${DevicePath}2 $tmpdir || exit 1 + echo "Write kernel to rootfs..." + rm -f $tmpdir/boot/${KernelImageType}* + KernelFileName=`basename $DeployedFile` + cp $DeployedFile $tmpdir/boot/ + ln -sf $KernelFileName $tmpdir/boot/$KernelImageType + echo "${style_green}Write done.${style_normal}" + + # rootfs/lib/modules + echo "Write modules to rootfs..." + kernel_abi_ver=`echo $KernelFileName | sed 's:'${KernelImageType}'-::g'` + rm -rf $tmpdir/lib/modules/$kernel_abi_ver + for modules in `find ${DeployFileDir} -name "modules-${Machine}.tgz"`; do + tar xvzf ${modules} -C $tmpdir/ + done + echo "${style_green}Write done.${style_normal}" + + # run depmod (stolen from dempodwrapper) + sys_map=`realpath ${OeTmpDir}/pkgdata/${Machine}/kernel-depmod/System.map-$kernel_abi_ver` + echo "Run depmod on modules..." + depmod -a -b $tmpdir -F "$sys_map" "$kernel_abi_ver" + echo "${style_green}Run done.${style_normal}" + + # cleanup + echo "Unmount rootfs partition..." + umount ${DevicePath}2 || exit 1 + echo "${style_green}Unmount done.${style_normal}" + rm -rf $tmpdir +} + + +CheckPrerequisite "time" +CheckPrerequisite "gunzip" +CheckPrerequisite "dd" +CheckPrerequisite "parted" +CheckPrerequisite "resize2fs" +CheckPrerequisite "depmod" + diff --git a/scripts/raspberrypi-card-kernel-write.sh b/scripts/raspberrypi-card-kernel-write.sh new file mode 100755 index 0000000..d2a8ffd --- /dev/null +++ b/scripts/raspberrypi-card-kernel-write.sh @@ -0,0 +1,15 @@ +#! /bin/bash + +# raspberrypi-card-kernel-write.sh +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script writes kernel+modules to SDCard. To +# select card device a dialog based GUI is used. + +# Includes +. `dirname $0`/include/common-helpers.inc +. `dirname $0`/include/card-helpers.inc +. `dirname $0`/include/machine-raspberrypi.inc + +StartCardKernelWrite diff --git a/scripts/raspberrypi-card-write.sh b/scripts/raspberrypi-card-write.sh new file mode 100755 index 0000000..f4adecf --- /dev/null +++ b/scripts/raspberrypi-card-write.sh @@ -0,0 +1,14 @@ +#! /bin/bash + +# raspberrypi-card-write.sh +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script writes image to sdcard and aligns rootfs partition to max size. + +# Includes +. `dirname $0`/include/common-helpers.inc +. `dirname $0`/include/card-helpers.inc +. `dirname $0`/include/machine-raspberrypi.inc + +StartCardWrite diff --git a/scripts/sdcard-write/freescale-imx/card-kernel-write.sh b/scripts/sdcard-write/freescale-imx/card-kernel-write.sh deleted file mode 100755 index 17330b0..0000000 --- a/scripts/sdcard-write/freescale-imx/card-kernel-write.sh +++ /dev/null @@ -1,153 +0,0 @@ -#! /bin/bash - -# card-kernel-write.sh -# (c) Copyright 2013-2018 Andreas Müller -# Licensed under terms of GPLv2 -# -# This script writes kernel+modules to SDCard. To -# select card device a dialog based GUI is used. - -SelectKernel() { - # OE environment found? - if [ -z $BUILDDIR ]; then - echo "The environment variable BUILDDIR is not set. It is usually set before running bitbake." - exit 1 - fi - iCount=0 - strSelection= - for grep_result in `grep -h TMPDIR $BUILDDIR/conf/*.conf | sed -e s/' '/''/g -e s/'\"'/''/g`; do - # exclude comments - tmp_dir=`echo $grep_result | grep '^TMPDIR='` - if [ ! -z $tmp_dir ]; then - TMPDIR=`echo $tmp_dir | sed -e s/'TMPDIR='/''/g` - fi - done - for BuildPath in ${TMPDIR}-*; do - # Find avaliable kernels - for i in `find ${BuildPath}/deploy/images/${MACHINE} -name ${KERNEL_IMAGE_TYPE}-abiversion-* | sort` ; do - iCount=`expr $iCount + 1` - KernelNameArr[${iCount}]=$i - strSelection="$strSelection $iCount "`basename $i` - done - done - - # were files found? - if [ $iCount -eq 0 ]; then - echo "No kernel images found in ${TMPDIR}-\*" - exit 1 - fi - - dialog --title 'Select kernel'\ - --menu 'Move using [UP] [DOWN],[Enter] to select' 30 100 $iCount\ - ${strSelection}\ - 2>/tmp/menuitem.$$ - - # get OK/Cancel - sel=$? - # get selected menuitem - menuitem=`cat /tmp/menuitem.$$` - rm -f /tmp/menuitem.$$ - - # Cancel Button or - if [ $sel -eq 1 -o $sel -eq 255 ] ; then - echo Cancel selected 1 - return 1 - fi - KernelImage=${KernelNameArr[$menuitem]} -} - -run_user() { - if [ -z $DevicePath ]; then - # DevicePath for memory card - SelectCardDevice || exit 1 - fi - - if [ -z $KernelImage ]; then - # select rootfs - SelectKernel || exit 1 - fi - RootParams="$DevicePath $KernelImage $KERNEL_IMAGE_TYPE" -} - -run_root() { - # device node valid? - if [ ! -b $DevicePath ] ; then - echo "$DevicePath is not a valid block device!" - exit 1 - fi - # rootfs valid? - if [ ! -e $KernelImage ] ; then - echo "$KernelImage can not be found!" - exit 1 - fi - - IMAGEDIR=$(dirname $KernelImage) - - # check if the card is currently mounted - chk_umount $DevicePath - - # create temp mount path - if [ ! -d /tmp/tmp_mount$$ ] ; then - mkdir /tmp/tmp_mount$$ - fi - - # initial kernel - mount ${DevicePath}1 /tmp/tmp_mount$$ || exit 1 - echo "Writing initial kernel and devicetrees to boot partition" - rm -f /tmp/tmp_mount$$/${KernelImageType}* - cp -f $KernelImage /tmp/tmp_mount$$/$KernelImageType - - # devicetrees - rm -f /tmp/tmp_mount$$/*.dtb - for dtb in `find ${IMAGEDIR} -name "${KernelImageType}*.dtb" -type l`; do - dtbname=`basename $dtb | sed 's:'${KernelImageType}'-::'` - cp -f $dtb /tmp/tmp_mount$$/${dtbname} - done - - sleep 1 - umount ${DevicePath}1 || exit 1 - - # rootfs/boot - mount ${DevicePath}2 /tmp/tmp_mount$$ || exit 1 - echo "Writing kernel to rootfs" - rm -f /tmp/tmp_mount$$/boot/${KernelImageType}* - KernelWithAbiName=`basename $KernelImage | sed -e 's:-abiversion-::'` - cp $KernelImage /tmp/tmp_mount$$/boot/$KernelWithAbiName - ln -sf $KernelWithAbiName /tmp/tmp_mount$$/boot/$KernelImageType - - # rootfs/lib/modules - echo "Writing modules to rootfs..." - kernel_abi_ver=`echo $KernelWithAbiName | sed 's:'${KernelImageType}'::g'` - - for modules in `find ${IMAGEDIR} -name "modules-${MACHINE}.tgz"`; do - tar xvzf ${modules} -C /tmp/tmp_mount$$/ - done - # run depmod (stolen from dempodwrapper - sys_map=`realpath ${IMAGEDIR}/../../../pkgdata/${MACHINE}/kernel-depmod/System.map-$kernel_abi_ver` - echo "Running depmod on modules" - depmod -a -b /tmp/tmp_mount$$ -F "$sys_map" "$kernel_abi_ver" - - echo "Unmount / write cache..." - umount ${DevicePath}2 || exit 1 - - rm -rf /tmp/tmp_mount$$ -} - -. `dirname $0`/machine.inc -. `dirname $0`/../tools.inc - -if [ -z $MACHINE ]; then - MACHINE=$DEFAULT_MACHINE -fi -if [ -z $KERNEL_IMAGE_TYPE ]; then - KERNEL_IMAGE_TYPE=$DEFAULT_KERNEL_IMAGE_TYPE -fi - -DevicePath=$1 -KernelImage=$2 -KernelImageType=$3 - -# On the 1st call: run user -# After the 2nd call: run root -RootParams='$DevicePath $KernelImage $KERNEL_IMAGE_TYPE' -chk_root "The kernel images on %DevicePath% will be overwritten!!" && run_root diff --git a/scripts/sdcard-write/freescale-imx/card-write.sh b/scripts/sdcard-write/freescale-imx/card-write.sh deleted file mode 100755 index 9f99d4e..0000000 --- a/scripts/sdcard-write/freescale-imx/card-write.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/bash - -# write-card.sh -# (c) Copyright 2013-2018 Andreas Müller -# Licensed under terms of GPLv2 -# -# This script writes image to sdcard and aligns rootfs partition to max size. - -run_user() { - if [ -z $DevicePath ]; then - # DevicePath for memory card - SelectCardDevice || exit 1 - fi - - if [ -z $RootFsFile ]; then - # select rootfs - SelectRootfs '-name *.sdcard -o -name *.wic.gz -type l' || exit 1 - fi - RootParams="$DevicePath $RootFsFile" -} - -run_root() { - # device node valid? - if [ ! -b $DevicePath ] ; then - echo "$DevicePath is not a valid block device!" - exit 1 - fi - # rootfs valid? - if [ ! -e $RootFsFile ] ; then - echo "$RootFsFile can not be found!" - exit 1 - fi - - IMAGEDIR=$(dirname $RootFsFile) - - # check if the card is currently mounted - chk_umount $DevicePath - - # rootfs write/resize to card fit - time( - echo "Writing $RootFsFile to $DevicePath..." - if echo $RootFsFile | grep -q '.wic.gz'; then - gunzip -c $RootFsFile | dd of=$DevicePath bs=1024K - else - dd of=$DevicePath if=$RootFsFile bs=1024K - fi - sync - echo "Resizing ${DevicePath}2..." - parted -s $DevicePath -- resizepart 2 -0 - resize2fs "${DevicePath}2" - ) -} - -# includes -. `dirname $0`/machine.inc -. `dirname $0`/../tools.inc - -CheckPrerequisite "dd" -CheckPrerequisite "time" -CheckPrerequisite "parted" -CheckPrerequisite "resize2fs" - -if [ -z $MACHINE ]; then - MACHINE=$DEFAULT_MACHINE -fi - - -DevicePath=$1 -RootFsFile=$2 - -# On the 1st call: run user -# After the 2nd call: run root -RootParams='$DevicePath $RootFsFile' -chk_root&&run_root - - - diff --git a/scripts/sdcard-write/freescale-imx/machine.inc b/scripts/sdcard-write/freescale-imx/machine.inc deleted file mode 100644 index 0ff7a3c..0000000 --- a/scripts/sdcard-write/freescale-imx/machine.inc +++ /dev/null @@ -1,4 +0,0 @@ -# default settings -DEFAULT_MACHINE='*imx*' -DEFAULT_KERNEL_IMAGE_TYPE=uImage -KERNEL_MAJOR_VERSION=4 diff --git a/scripts/sdcard-write/raspberrypi/card-write.sh b/scripts/sdcard-write/raspberrypi/card-write.sh deleted file mode 100755 index 10fca4c..0000000 --- a/scripts/sdcard-write/raspberrypi/card-write.sh +++ /dev/null @@ -1,70 +0,0 @@ -#! /bin/bash - -# write-card.sh -# (c) Copyright 2013-2018 Andreas Müller -# Licensed under terms of GPLv2 -# -# This script writes image to sdcard and aligns rootfs partition to max size. - -run_user() { - if [ -z $DevicePath ]; then - # DevicePath for memory card - SelectCardDevice || exit 1 - fi - - if [ -z $RootFsFile ]; then - # select rootfs - SelectRootfs '-name *.rpi-sdimg -type l' || exit 1 - fi - RootParams="$DevicePath $RootFsFile" -} - -run_root() { - # device node valid? - if [ ! -b $DevicePath ] ; then - echo "$DevicePath is not a valid block device!" - exit 1 - fi - # rootfs valid? - if [ ! -e $RootFsFile ] ; then - echo "$RootFsFile can not be found!" - exit 1 - fi - - IMAGEDIR=$(dirname $RootFsFile) - - # check if the card is currently mounted - chk_umount $DevicePath - - # rootfs write/resize to card fit - time( - echo "Writing $RootFsFile to $DevicePath..." - dd of=$DevicePath if=$RootFsFile bs=1024K - sync - echo "Resizing ${DevicePath}2..." - parted -s $DevicePath -- resizepart 2 -0 - resize2fs "${DevicePath}2" - ) -} - -# includes -. `dirname $0`/machine.inc -. `dirname $0`/../tools.inc - -CheckPrerequisite "dd" -CheckPrerequisite "time" -CheckPrerequisite "parted" -CheckPrerequisite "resize2fs" - -if [ -z $MACHINE ]; then - MACHINE=$DEFAULT_MACHINE -fi - - -DevicePath=$1 -RootFsFile=$2 - -# On the 1st call: run user -# After the 2nd call: run root -RootParams='$DevicePath $RootFsFile' -chk_root&&run_root diff --git a/scripts/sdcard-write/raspberrypi/machine.inc b/scripts/sdcard-write/raspberrypi/machine.inc deleted file mode 100644 index f15c2e1..0000000 --- a/scripts/sdcard-write/raspberrypi/machine.inc +++ /dev/null @@ -1,6 +0,0 @@ -# default settings -DEFAULT_MACHINE='raspberrypi*' -DEFAULT_KERNEL_IMAGE_TYPE=Image - -# TODO card-kernel-write!!! -KERNEL_MAJOR_VERSION=4 diff --git a/scripts/sdcard-write/tools.inc b/scripts/sdcard-write/tools.inc deleted file mode 100644 index 7cf9210..0000000 --- a/scripts/sdcard-write/tools.inc +++ /dev/null @@ -1,231 +0,0 @@ -#! /bin/bash - -# tools.inc -# (c) Copyright 2013-2018 Andreas Müller -# Licensed under terms of GPLv2 -# -# This script contains some helper functions and can be sourced by other -# scripts - -# set terminal styles -# are we on terrminal? -if [ -t 1 ] ; then - # tput available? - if [ ! "x`which tput 2>/dev/null`" = "x" ] ; then - # supports colors ? - ncolors=`tput colors` - if [ -n "$ncolors" -a $ncolors -ge 8 ] ; then - style_bold="`tput bold`" - style_underline="`tput smul`" - style_standout="`tput smso`" - style_normal="`tput sgr0`" - style_black="`tput setaf 0`" - style_red="`tput setaf 1`" - style_green="`tput setaf 2`" - style_yellow="`tput setaf 3`" - style_blue="`tput setaf 4`" - style_magenta="`tput setaf 5`" - style_cyan="`tput setaf 6`" - style_white="`tput setaf 7`" - fi - fi -fi - -# ErrorOut outputs error text in first param and exits script -ErrorOut() { - echo - echo "${style_red}${style_bold}${1}!${style_normal}" - echo - exit -1 -} - -# CheckPrerequisite checks if required hosttool is found on host. In case not -# it outputs a message and exits script. -CheckPrerequisite() { - if [ "x`which $1 2>/dev/null`" = "x" ] ; then - ErrorOut "You need to install $1 first!" - fi -} - - -# SelectCardDevice() creates a dialog to select one of all available removable -# devices. The path to the selected device is stored in the variale DevicePath. -SelectCardDevice() { - iCount=0 - for dev in /dev/sd[a-z] ; do - DeviceFile=`basename $dev` - # we are only interested in removable devices - if [ `cat /sys/block/$DeviceFile/removable` = '1' ] && [ `cat /sys/block/$DeviceFile/size` -gt "0" ]; then - iCount=`expr $iCount + 1` - DevicePathArr[${iCount}]=$dev - # pretify display - secondline= - display= - IFS=$'\n' - for line in `lsblk --raw --noheadings --output NAME,LABEL,MODEL $dev` ; do - # a bug in lsblk? - line=`echo $line | sed 's:\\\x20: :g'` - if [ "x$secondline" = "x" ]; then - # first line - it is for device - secondline="1" - display="$line" - else - if [ "x$secondline" = "x1" ]; then - secondline="2" - # second line - header + partition - display="$display / partitions: $line" - else - # second line - separator + partition - display="$display + $line" - fi - fi - done - display=`echo $display | sed 's: : :g'` - display=`echo $display | sed 's: : :g'` - display=`echo $display | sed 's: : :g'` - - unset IFS - menuitems+=( "$iCount" "$display" ) - fi - done - - if [ $iCount -eq 0 ]; then - ErrorOut 'No removable devices found!' - fi - - dialog --title 'Select card device'\ - --menu 'Move using [UP] [DOWN],[Enter] to select' 10 100 $iCount\ - "${menuitems[@]}"\ - 2>/tmp/menuitem.$$ - - # get OK/Cancel - sel=$? - # get selected menuitem - menuitem=`cat /tmp/menuitem.$$` - rm -f /tmp/menuitem.$$ - - # Cancel Button or - if [ $sel -eq 1 -o $sel -eq 255 ] ; then - echo 'Cancel selected SelectCardDevice()' - return 1 - fi - DevicePath=${DevicePathArr[$menuitem]} -} - -# SelectRootfs() opens a dialog to select file containing rootfs. It expects -# one parameter which contains find parameters e.g for raspberrypi: ' -SelectRootfs() { - # OE environment found? - if [ -z $BUILDDIR ]; then - ErrorOut "The environment variable BUILDDIR is not set. It is usually set before running bitbake." - fi - iCount=0 - strSelection= - for grep_result in `grep -h TMPDIR $BUILDDIR/conf/*.conf | sed -e s/' '/''/g -e s/'\"'/''/g`; do - # exclude comments - tmp_dir=`echo $grep_result | grep '^TMPDIR='` - if [ ! -z $tmp_dir ]; then - TMPDIR=`echo $tmp_dir | sed -e s/'TMPDIR='/''/g` - fi - done - for BuildPath in ${TMPDIR}-*; do - for i in `find ${BuildPath}/deploy/images/${MACHINE} $1 | sort` ; do - iCount=`expr $iCount + 1` - RootFileNameArr[${iCount}]=$i - strSelection="$strSelection $iCount "`basename $i` - done - done - - # were files found? - if [ $iCount -eq 0 ]; then - ErrorOut "No rootfs files found in ${TMPDIR}-\*" - fi - - dialog --title 'Select rootfs'\ - --menu 'Move using [UP] [DOWN],[Enter] to select' 30 100 $iCount\ - ${strSelection}\ - 2>/tmp/menuitem.$$ - - # get OK/Cancel - sel=$? - # get selected menuitem - menuitem=`cat /tmp/menuitem.$$` - rm -f /tmp/menuitem.$$ - - # Cancel Button or - if [ $sel -eq 1 -o $sel -eq 255 ] ; then - echo Cancel selected 1 - return 1 - fi - RootFsFile=${RootFileNameArr[$menuitem]} - echo -} - - -# chk_root() tests if we are running as root. If not, it calls run_user and then -# asks operator how to log on as root. Then the main script is started as root -chk_root() { - # we are not already root? - if [ ! $( id -u ) -eq 0 ]; then - # do all non root operations - run_user - # abort in case run_user was performed without success - if [ $? -ne 0 ] ; then - return 1 - fi - - dialog --title 'Select how you want to logon as root'\ - --menu 'Move using [UP] [DOWN],[Enter] to select' 10 100 2 1 su 2 sudo \ - 2>/tmp/menuitem.$$ - - # get OK/Cancel - sel=$? - # get selected menuitem - menuitem=`cat /tmp/menuitem.$$` - rm -f /tmp/menuitem.$$ - - # Cancel Button or - if [ $sel -eq 1 -o $sel -eq 255 ] ; then - echo 'Cancel selected chk_root()' - return 1 - fi - - clear - if [ "x$1" = "x" ] ; then - echo "All data currenly stored on $DevicePath will be overwritten!!" - else - echo $1 | sed "s|\%DevicePath\%|$DevicePath|" - fi - - if [ $menuitem -eq 1 ]; then - echo -e "\nEnter valid root password if you are sure you want to continue" - # Call this prog as root - exec su -c "${0} $RootParams" - else - echo -e "\nEnter valid sudo password if you are sure you want to continue" - sudo -k - # Call this prog as root - exec sudo ${0} $RootParams - fi - return 1 # sice we're 'execing' above, we wont reach this exit - # unless something goes wrong. - fi -} - -# chk_umount() tests if a device partition is mounted. If so partition is -# unmounted. Devic name is expected in first parameter. -chk_umount() { - # check if the card is currently mounted - MOUNTSTR=$(mount | grep $1) - if [ -n "$MOUNTSTR" ] ; then - echo -en "\n$1 is mounted. Unmounting..." - umount -f ${1}?* - echo " ${style_green}done${style_normal}" - fi -} - - -# common prerequisites -CheckPrerequisite "dialog" -CheckPrerequisite "lsblk" - diff --git a/scripts/ti-old-omap-README b/scripts/ti-old-omap-README new file mode 100644 index 0000000..0f88878 --- /dev/null +++ b/scripts/ti-old-omap-README @@ -0,0 +1,5 @@ +ti-old-omap: +These scripts are used when using old image style (non WKS / dd) for TI +omap3/zitara machines. Intended for images build with meta-bbone and +meta-gumstix-community (would like to let them die but we still have active +products based on these very old layers). diff --git a/scripts/ti-old-omap-card-part.sh b/scripts/ti-old-omap-card-part.sh new file mode 100755 index 0000000..ab9d4c0 --- /dev/null +++ b/scripts/ti-old-omap-card-part.sh @@ -0,0 +1,47 @@ +#! /bin/bash + +# card-part.sh +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script prepares partitions on SDCards. It wraps +# http://omappedia.org/wiki/Minimal-FS_SD_Configuration by dialog based GUI. + +# includes +. `dirname $0`/include/common-helpers.inc +. `dirname $0`/../tools.inc + + +# overrride default +SelectInOut() { + # DevicePath for target card + SelectCardDevice + + RootParams="$DevicePath" +} + +# implement here - not im machine-ti-old-omap.inc +RootCardWriteCallback() { + # kill u-boot environment + dd if=/dev/zero of=$DevicePath bs=1024 count=1024 + + # Create the FAT partition of 64MB and make it bootable + parted -s $DevicePath mklabel msdos + parted -s $DevicePath mkpart primary fat32 63s 64MB + parted -s $DevicePath toggle 1 boot + + # Create the rootfs partition until end of device + parted -s $DevicePath -- mkpart primary ext4 64MB -0 + + # write partitions + mkfs.vfat -F 32 -n "boot" -I ${DevicePath}1 + mke2fs -F -j -t ext4 -L "rootfs" ${DevicePath}2 +} + + +CheckPrerequisite "parted" +CheckPrerequisite "dd" +CheckPrerequisite "mkfs.vfat" +CheckPrerequisite "mkfs.vfat" + +StartCardWrite diff --git a/scripts/ti-old-omap-card-write.sh b/scripts/ti-old-omap-card-write.sh new file mode 100755 index 0000000..dd88b55 --- /dev/null +++ b/scripts/ti-old-omap-card-write.sh @@ -0,0 +1,14 @@ +#! /bin/bash + +# raspberrypi-card-write.sh +# (c) Copyright 2018 Andreas Müller +# Licensed under terms of GPLv2 +# +# This script writes image to sdcard and aligns rootfs partition to max size. + +# Includes +. `dirname $0`/include/common-helpers.inc +. `dirname $0`/include/card-helpers.inc +. `dirname $0`/include/machine-ti-old-omap.inc + +StartCardWrite