xref: /freebsd/tools/regression/msdosfs/msdosfstest-6.sh (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
11f3fbd6cSTai-hwa Liang#!/bin/sh
21f3fbd6cSTai-hwa Liang# A really simple script to create a swap-backed msdosfs filesystem, then
31f3fbd6cSTai-hwa Liang# test to make sure the nmount conversion(mount_msdosfs.c rev 1.37)
41f3fbd6cSTai-hwa Liang# doesn't break multi-byte characters.
51f3fbd6cSTai-hwa Liang
61f3fbd6cSTai-hwa Liangmkdir /tmp/msdosfstest/
71f3fbd6cSTai-hwa Liangmdconfig -a -t swap -s 128m -u 10
81f3fbd6cSTai-hwa Liangbsdlabel -w md10 auto
91f3fbd6cSTai-hwa Liangnewfs_msdos -F 32 -b 8192 /dev/md10a
101f3fbd6cSTai-hwa Liangmount_msdosfs -L zh_TW.Big5 -D CP950 /dev/md10a /tmp/msdosfstest/
11*381edcdaSUlrich Spörlein# The comment is UTF-8, the actual command uses the Big5 representation.
12*381edcdaSUlrich Spörlein# mkdir /tmp/msdosfstest/是否看過坊間常見的許茹芸淚海慶功宴吃蓋飯第四集
13*381edcdaSUlrich Spörleinsubdir=$'\254\117\247\137\254\335\271\114\247\173\266\241\261\140\250\243'\
14*381edcdaSUlrich Spörlein$'\252\272\263\134\257\370\252\345\262\134\256\374\274\171\245\134'\
15*381edcdaSUlrich Spörlein$'\256\142\246\131\273\134\266\272\262\304\245\174\266\260'
16*381edcdaSUlrich Spörleinmkdir /tmp/msdosfstest/$subdir
17*381edcdaSUlrich Spörleincd /tmp/msdosfstest/$subdir
181f3fbd6cSTai-hwa Liangif [ $? -eq 0 ]; then
191f3fbd6cSTai-hwa Liang	echo "ok 6";
201f3fbd6cSTai-hwa Liangelse
211f3fbd6cSTai-hwa Liang	echo "not ok 6";
221f3fbd6cSTai-hwa Liangfi
231f3fbd6cSTai-hwa Liangcd /tmp
241f3fbd6cSTai-hwa Liangumount /tmp/msdosfstest/
251f3fbd6cSTai-hwa Liangmdconfig -d -u 10
261f3fbd6cSTai-hwa Liangrm -rf /tmp/msdosfstest/
27