diff --git a/mod_for_factory_scripts/200patchInitScript b/mod_for_factory_scripts/200patchInitScript index 312deb4578..017523fe49 100755 --- a/mod_for_factory_scripts/200patchInitScript +++ b/mod_for_factory_scripts/200patchInitScript @@ -6,8 +6,8 @@ echo "Applying patch to init scripts." -touch ${ROOT_FS_DIR}/root/.factory_test -patch -d ${ROOT_FS_DIR} -Np1 < ${ROOT_FS_DIR}/etc/init/factory.conf <"${ROOT_FS_DIR}/etc/init/factory.conf" <> /var/log/factory.log +date >>/var/log/factory.log if [ ! -e factory_started ]; then touch factory_started cp -f site_tests/suite_Factory/control . - ./bin/autotest control >> /var/log/factory.log 2>&1 + ./bin/autotest control >>/var/log/factory.log 2>&1 else - ./tools/autotest >> /var/log/factory.log 2>&1 + ./tools/autotest >>/var/log/factory.log 2>&1 fi end script EOF -cat > ${ROOT_FS_DIR}/etc/init/factorylog.conf <"${ROOT_FS_DIR}/etc/init/factorylog.conf" < /dev/tty3 +tail -n 48 -F /var/log/factory.log >/dev/tty3 end script EOF -patch -d ${ROOT_FS_DIR} -Np1 < /dev/null +if [ -d "${TEST_DIR}" ]; then + pushd "${TEST_DIR}" >/dev/null -# Remove the DB directories belonging to other boards. -KEEPDB="data_${BOARD}" -ls -d data_* 2> /dev/null | grep -v ${KEEPDB} | xargs rm -fr + # Remove the DB directories belonging to other boards. + KEEPDB="data_${BOARD}" + ls -d data_* 2>/dev/null | grep -v "${KEEPDB}" | xargs rm -fr -# Ensure there is DB directory in x86-agz and x86-mario. -if [ ! -d ${KEEPDB} -a \ - \( "${BOARD}" = "x86-agz" -o "${BOARD}" = "x86-mario" \) ]; then - echo "No component DB directory found at: ${KEEPDB}" + # Ensure there is DB directory in x86-agz and x86-mario. + if [ ! -d "${KEEPDB}" ] && + [ "${BOARD}" = "x86-agz" -o "{BOARD}" = "x86-mario" ]; then + echo "No component DB directory found at: ${KEEPDB}" + fi + + popd >/dev/null fi - -popd 1> /dev/null diff --git a/mod_for_factory_scripts/600customizeRelease b/mod_for_factory_scripts/600customizeRelease index 4975f2d147..0c8dd21a76 100755 --- a/mod_for_factory_scripts/600customizeRelease +++ b/mod_for_factory_scripts/600customizeRelease @@ -6,17 +6,19 @@ TEST_DIR="${ROOT_FS_DIR}/usr/local/autotest/site_tests/suite_Factory" -pushd ${TEST_DIR} 1> /dev/null +if [ -d "${TEST_DIR}" ]; then + pushd "${TEST_DIR}" >/dev/null -# If there is a customize_$BOARD script for this board, let's run it. -# This allows adding settings for specific factories or systems. -CUSTOMIZE="customize_${BOARD}" -if [ -e "${CUSTOMIZE}" ]; then - echo "Running ${CUSTOMIZE}" - "./${CUSTOMIZE}" + # If there is a customize_$BOARD script for this board, let's run it. + # This allows adding settings for specific factories or systems. + CUSTOMIZE="customize_${BOARD}" + if [ -e "${CUSTOMIZE}" ]; then + echo "Running ${CUSTOMIZE}" + "./${CUSTOMIZE}" + fi + + # We don't need the customize script anymore. + rm -f customize_* + + popd >/dev/null fi - -# We don't need the customize script anymore. -rm -f customize_* - -popd 1> /dev/null