From 7581f8e3b04df2b1c7ac96514f8d5a86355f0ecb Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Tue, 21 Jun 2011 20:42:43 -0500 Subject: [PATCH] serial, make more generic Signed-off-by: Robert Nelson --- mk_mmc.sh | 31 ++++++++++++++++++++++------- scripts/debian-tweaks.diff | 2 +- scripts/flash-kernel.conf | 3 +++ scripts/{ttyO2.conf => serial.conf} | 2 +- scripts/ubuntu-tweaks.diff | 2 +- 5 files changed, 30 insertions(+), 10 deletions(-) rename scripts/{ttyO2.conf => serial.conf} (69%) diff --git a/mk_mmc.sh b/mk_mmc.sh index 95d1fa1..1898506 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -157,6 +157,10 @@ fi echo "Using: ${ACTUAL_DEB_FILE}" + #Setup serial + sed -i -e 's:SERIAL:'$SERIAL':g' ${DIR}/scripts/serial.conf + sed -i -e 's:SERIAL:'$SERIAL':g' ${DIR}/scripts/*-tweaks.diff + #Set uImage boot address sed -i -e 's:UIMAGE_ADDR:'$UIMAGE_ADDR':g' ${DIR}/scripts/boot.scr/*.cmd @@ -497,7 +501,10 @@ esac fi if [ "${SERIAL_MODE}" ] ; then - sudo touch ${TEMPDIR}/initrd-tree/etc/rcn-serial.conf + if [ ! "${DO_UBOOT_DD}" ] ; then + #this needs more thought, need to disable the check for mx53loco, but maybe we don't need it for omap.. + sudo touch ${TEMPDIR}/initrd-tree/etc/rcn-serial.conf + fi fi cd ${TEMPDIR}/initrd-tree/ @@ -740,6 +747,10 @@ echo "done" function reset_scripts { + #Setup serial + sed -i -e 's:'$SERIAL':SERIAL:g' ${DIR}/scripts/serial.conf + sed -i -e 's:'$SERIAL':SERIAL:g' ${DIR}/scripts/*-tweaks.diff + #Set uInitrd boot address sed -i -e 's:'$UIMAGE_ADDR':UIMAGE_ADDR:g' ${DIR}/scripts/boot.scr/*.cmd @@ -807,7 +818,8 @@ case "$UBOOT_TYPE" in ABI_VER=1 UIMAGE_ADDR="0x80300000" UINITRD_ADDR="0x81600000" - SERIAL_CONSOLE="ttyO2,115200n8" + SERIAL="ttyO2" + SERIAL_CONSOLE="${SERIAL},115200n8" ZRELADD="0x80008000" ;; @@ -820,7 +832,8 @@ case "$UBOOT_TYPE" in ABI_VER=7 UIMAGE_ADDR="0x80300000" UINITRD_ADDR="0x81600000" - SERIAL_CONSOLE="ttyO2,115200n8" + SERIAL="ttyO2" + SERIAL_CONSOLE="${SERIAL},115200n8" ZRELADD="0x80008000" ;; @@ -834,7 +847,8 @@ case "$UBOOT_TYPE" in SMSC95XX_MOREMEM=1 UIMAGE_ADDR="0x80300000" UINITRD_ADDR="0x81600000" - SERIAL_CONSOLE="ttyO2,115200n8" + SERIAL="ttyO2" + SERIAL_CONSOLE="${SERIAL},115200n8" ZRELADD="0x80008000" ;; @@ -847,7 +861,8 @@ case "$UBOOT_TYPE" in ABI_VER=5 UIMAGE_ADDR="0x80300000" UINITRD_ADDR="0x81600000" - SERIAL_CONSOLE="ttyO2,115200n8" + SERIAL="ttyO2" + SERIAL_CONSOLE="${SERIAL},115200n8" ZRELADD="0x80008000" BETA_KERNEL=1 @@ -863,7 +878,8 @@ case "$UBOOT_TYPE" in ABI_VER=6 UIMAGE_ADDR="0x80300000" UINITRD_ADDR="0x81600000" - SERIAL_CONSOLE="ttyO2,115200n8" + SERIAL="ttyO2" + SERIAL_CONSOLE="${SERIAL},115200n8" ZRELADD="0x80008000" #with the crane, we need the beta kernel and serial-more @@ -880,7 +896,8 @@ case "$UBOOT_TYPE" in ABI_VER=8 UIMAGE_ADDR="0x70800000" UINITRD_ADDR="0x72100000" - SERIAL_CONSOLE="ttymxc0,115200" + SERIAL="ttymxc0" + SERIAL_CONSOLE="${SERIAL},115200" ZRELADD="0x70008000" BETA_KERNEL=1 diff --git a/scripts/debian-tweaks.diff b/scripts/debian-tweaks.diff index 0df103e..475729e 100644 --- a/scripts/debian-tweaks.diff +++ b/scripts/debian-tweaks.diff @@ -30,7 +30,7 @@ index 0000000..6d06fc7 + echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf + + if [ ! -e /etc/rcn-serial.conf ]; then -+ cat /target/etc/inittab | grep ttyO2 || echo "S:2345:respawn:/sbin/getty 115200 ttyO2" >> /target/etc/inittab ++ cat /target/etc/inittab | grep SERIAL || echo "S:2345:respawn:/sbin/getty 115200 SERIAL" >> /target/etc/inittab + fi + + cp -r /lib/firmware/ /target/lib/ diff --git a/scripts/flash-kernel.conf b/scripts/flash-kernel.conf index 155287d..9fc7d23 100644 --- a/scripts/flash-kernel.conf +++ b/scripts/flash-kernel.conf @@ -20,6 +20,9 @@ case "$DIST" in natty) FLASH_KERNEL_SKIP=yes ;; + oneiric) + FLASH_KERNEL_SKIP=yes + ;; esac fi diff --git a/scripts/ttyO2.conf b/scripts/serial.conf similarity index 69% rename from scripts/ttyO2.conf rename to scripts/serial.conf index d5739c2..523d937 100644 --- a/scripts/ttyO2.conf +++ b/scripts/serial.conf @@ -2,4 +2,4 @@ start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] respawn -exec /sbin/getty 115200 ttyO2 +exec /sbin/getty 115200 SERIAL diff --git a/scripts/ubuntu-tweaks.diff b/scripts/ubuntu-tweaks.diff index e494a5a..82063d9 100644 --- a/scripts/ubuntu-tweaks.diff +++ b/scripts/ubuntu-tweaks.diff @@ -6,7 +6,7 @@ index 0000000..6d06fc7 @@ -0,0 +1,46 @@ +#!/bin/sh -e +cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf -+cp /etc/ttyO2.conf /target/etc/init/ttyO2.conf ++cp /etc/serial.conf /target/etc/init/SERIAL.conf + +if [ -e /etc/rcn.conf ]; then + mkdir -p /tmp/mmc