Commit c713e122 authored by aTc's avatar aTc

init-hwtest.sh: clean up a few things

parent a71d2e69
......@@ -95,11 +95,13 @@ modprobe wl18xx
rfkill unblock wwan
# Disable most output on the LCD and switch to TTY3, use a nicer font size, siwth off all LEDs.
chvt 3
echo 0 > /sys/module/printk/parameters/ignore_loglevel
dmesg -D
clear
setfont Lat15-Terminus24x12.psf.gz
chvt 3
dmesg -D
clear
cd /sys/class/leds
for i in *
do
......@@ -223,7 +225,7 @@ echo 7 > /sys/class/backlight/keyboard-backlight/brightness
log ""
log "Check that they are all white now!"
log ""
log "Enter to continue"
read a < $LOG_DEVICE
log ""
......@@ -255,9 +257,9 @@ if ! $barometer_passed || ! $compass_passed || ! $gyro_passed || ! $fuelgauge_pa
log_err "======================================================================================="
log_err "Warning! Some critical tests have failed! Please press ENTER to start the input-tester."
log_err "======================================================================================="
read a < $LOG_DEVICE
fi
log "Please press ENTER to start the input-tester."
read a < $LOG_DEVICE
/usr/share/pyra/bin/pyra_test_inputs
......@@ -270,31 +272,49 @@ read a < $LOG_DEVICE
log ""
log "Now flashing the OS onto the eMMC..."
log "Checking for OS on second SD Card..."
md /media/sd2
read -a MEMINFO < /proc/meminfo
RAM=$(expr ${MEMINFO[1]} / 1000000)
log "Pyra model : ${pyr_version}"
log "Ram: $RAM GB"
log " "
log "Checking for OS image..."
mkdir -p /media/sd2
mount /dev/mmcblk5p1 /media/sd2
if [ -f "/media/sd2/rootfs.tgz" ]
then
log "Found, now starting flashing..."
./pyra-install.sh /media/sd2/rootfs.tgz /usr/share/pyra/u-boot/pyra-u-boot-4g/ /dev/mmcblk0
ROOTFS=""
if [ -f "/media/sd2/rootfs.tgz" ] ; then
ROOTFS=/media/sd2/rootfs.tgz
elif [ -f "/rootfs.tgz" ] ; then
ROOTFS=/rootfs.tgz
fi
UBOOT=/usr/share/pyra/u-boot/pyra-u-boot-${RAM}g/
if [ -n $ROOTFS ] ; then
log "Found $ROOTFS , now starting flashing..."
chvt 1
INITHWTEST=1 ./pyra-install.sh $ROOTFS $UBOOT /dev/mmcblk0
chvt 3
log ""
log "Done. Finished flashing!"
log "Don't forget to remove the SD Cards after shutdown."
log ""
umount /media/sd2
else
log_err "The OS could not be found on the second SD Card!"
log "Please ensure the card is inserted and has the OS installed."
umount /media/sd2
log_err "The OS could not be found!"
log "Please ensure the card is inserted and has the OS image file installed."
log ""
fi
del /media/sd2
umount /media/sd2
rm -d /media/sd2
log "Press ENTER to shutdown."
log ""
# Or s+enter to go into a shell
log " "
read a < $LOG_DEVICE
poweroff
if [[ a=="s" ]] ; then
chvt 1
/bin/bash
fi
poweroff -f
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment