|
版主 wjping119 要的 initrd_create 中加 cp936 的 patch .
[code:1]
diff -Nur initrd_create-5.0.12.orig/liblinuxlive initrd_create-5.0.12/liblinuxlive
--- initrd_create-5.0.12.orig/liblinuxlive 2005-04-29 14:57:12.000000000 +0800
+++ initrd_create-5.0.12/liblinuxlive 2005-04-29 15:55:37.009248544 +0800
@@ -397,12 +397,27 @@
echo "$DEVICE $MOUNTDIR iso9660 noauto,users 0 0" >>$FSTAB
done
- list_partition_devices | while read DEVICE; do
- MOUNTDIR="/mnt/`basename $DEVICE`"
+ fdisk_list="/tmp/fdisk_list" # Just let it be. rm -rf is painful.:-(
+ :> $fdisk_list
+ list_disk_devices | while read disk; do
+ fdisk -l $disk | grep ^/dev >> $fdisk_list
+ done
+
+ # Exclude disk /dev/hda, /dev/hdc...etc, partition only
+ list_partition_devices | grep -v "[a-z]$" | while read DEVICE; do
+ part=`basename $DEVICE`
+ MOUNTDIR="/mnt/$part"
mount_device $DEVICE $1/$MOUNTDIR
umount $1/$MOUNTDIR 2>/dev/null
if [ $? -eq 0 ]; then # add to fstab only if mount+umount is OK
- echo "$DEVICE $MOUNTDIR auto auto,users,suid,dev,exec 0 0" >>$FSTAB
+ wopt=""
+ for type in NTFS FAT; do
+ if grep $DEVICE $fdisk_list | grep "$type" > /dev/null 2>&1; then
+ wopt=",iocharset=cp936,codepage=cp936"
+ break
+ fi
+ done
+ echo "$DEVICE $MOUNTDIR auto auto,users,suid,dev,exec$wopt 0 0" >>$FSTAB
else # remove empty directory
rmdir $1/$MOUNTDIR 2>/dev/null
fi
[/code:1] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|