Filesystem from flash script: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
While there is no issue in executing filesystem_from_usb when booted from SD (provided there are no flash partitions mounted), further preparation is required in order to successfully boot from eMMC/NAND, and use the USB update functionality to update the flash. A USB device is required to have the the Debian distribution on the first partition | While there is no issue in executing filesystem_from_usb when booted from SD (provided there are no flash partitions mounted), further preparation is required in order to successfully boot from eMMC/NAND, and use the USB update functionality to update the flash. A USB device is required to have the the Debian distribution on the first partition and a specific set of steps in the 'tsinit' script - this ensures that all flash partitions are safely unmounted and the necessary tools are available. | ||
Using a linux host PC, format a USB drive with the first partition (min. 2GB) formatted ext2/3. Download the [ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7670-linux/distributions/ts7670_7400v2-debian-wheezy-arm-latest.tar.bz2 distribution tarball] and extract it to first partition of the USB drive. | Using a linux host PC, format a USB drive with the first partition (min. 2GB) formatted ext2/3. Download the [ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7670-linux/distributions/ts7670_7400v2-debian-wheezy-arm-latest.tar.bz2 distribution tarball] and extract it to first partition of the USB drive. |
Revision as of 12:59, 30 December 2014
While there is no issue in executing filesystem_from_usb when booted from SD (provided there are no flash partitions mounted), further preparation is required in order to successfully boot from eMMC/NAND, and use the USB update functionality to update the flash. A USB device is required to have the the Debian distribution on the first partition and a specific set of steps in the 'tsinit' script - this ensures that all flash partitions are safely unmounted and the necessary tools are available.
Using a linux host PC, format a USB drive with the first partition (min. 2GB) formatted ext2/3. Download the distribution tarball and extract it to first partition of the USB drive.
Next, create the file "tsinit" in the root directory of the first partition of the USB drive, make it world executable with `chmod a+x` and make sure it has the contents of the following script:
#!/bin/sh
#We only need unmount /mnt/root and use USB if booted from NAND/eMMC
if [ "$bootmode" == "0x1" ]; then
killall mdnsd >/dev/null #Required to cleanly umount /etc
sleep 1
if [ -e /dev/mtd0 ]; then
umount /mnt/root/ts
fi
umount /etc
umount /mnt/root
mount -obind /mnt/usbdev /mnt/root
mount -obind /mnt/root/etc /etc/
fi
echo ""
source /ts.subr
tshwctl --greenledon --redledon
echo "Flashing kernel"
kernel_from_usb >/dev/null 2>&1
if [ "$?" != "0" ]; then
echo "Failed flashing kernel"
tshwctl --greenledoff
while true; do tshwctl --redledon; sleep .5; tshwctl --redledoff; sleep .5 ; done &
return 1
fi
echo "Flashing filesystem"
eval `filesystem_from_usb`
if [ "$prog_ok" != "1" ] ; then
echo "Failed flashing filesystem"
tshwctl --greenledoff
while true; do tshwctl --redledon; sleep .5; tshwctl --redledoff; sleep .5 ; done &
return 1
fi
#We only need unmount /mnt/root and use USB if booted from NAND
if [ "$bootmode" == "0x1" ]; then
umount /etc
umount /mnt/root
fi
echo "Done"
while true; do tshwctl --greenledon; sleep .5; tshwctl --greenledoff; sleep .5 ; done &