From: James Cameron Date: Fri, 29 Aug 2008 06:13:43 +0000 (+1000) Subject: Try to generate name.crc instead of name.img.crc X-Git-Tag: v0.2~31^2 X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c75cb88d28c264117cb78cd116e9349691de15e;p=xodist Try to generate name.crc instead of name.img.crc --- diff --git a/mkjffs2.sh b/mkjffs2.sh index 6cd7685..f3c521d 100755 --- a/mkjffs2.sh +++ b/mkjffs2.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e # # Copyright © 2008 Andres Salomon # @@ -33,6 +33,12 @@ fi ROOT_DIR=$1 IMG_NAME=$2 +if [ "${IMG_NAME}" == "${IMG_NAME/.img/.crc}" ]; then + CRC_NAME=${IMG_NAME}.crc +else + CRC_NAME=${IMG_NAME/.img/.crc} +fi + if [ ! -d "${ROOT_DIR}" ]; then echo "" 1>&2 echo "*** Unable to find root directory!" 1>&2 @@ -46,4 +52,4 @@ create_ofwboot ${ROOT_DIR} jffs2 mkfs.jffs2 -n -e128KiB -r ${ROOT_DIR} -o ${IMG_NAME}.pre sumtool -n -p -e 128KiB -i ${IMG_NAME}.pre -o ${IMG_NAME} rm -f ${IMG_NAME}.pre -./crcimg.pl < ${IMG_NAME} > ${IMG_NAME}.crc +./crcimg.pl < ${IMG_NAME} > ${CRC_NAME}