4 # Copyright (C) 2007 Karel Zak <kzak@redhat.com>
6 # This file is part of util-linux-ng.
8 # This file is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This file is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 TS_TOPDIR="$(dirname $0)/../.."
19 TS_DESC="mkfs endianness"
21 . $TS_TOPDIR/functions.sh
27 IMAGE_DATA="$TS_OUTDIR/${TS_TESTNAME}-data"
28 IMAGE_CREATED="$TS_OUTDIR/${TS_TESTNAME}-cramfs.img" #Image created during the test and compared against the known images.
31 local TO_ENDIANNESS="$1"; shift
32 ts_log "create $TO_ENDIANNESS endian"
34 $TS_CMD_MKCRAMFS -N "$TO_ENDIANNESS" "$IMAGE_DATA" "$IMAGE_CREATED" 2>&1 >> $TS_OUTPUT
36 md5sum $IMAGE_CREATED | cut -d" " -f1 >> $TS_OUTPUT
42 mkdir -p $IMAGE_DATA/dirA/dirB
43 yes "Testing cramfs 1234567890 Endianness check 1234567890 Endianness check" \
44 | dd of=$IMAGE_DATA/dirA/dirB/a bs=512 count=1 &> /dev/null
45 yes "Testing cramfs 1234567890 Endianness check 1234567890 Endianness check" \
46 | dd of=$IMAGE_DATA/dirA/dirB/b bs=512 count=30 &> /dev/null
48 #perform tests for both endians