QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1606|回复: 2

哥哥,人家 atfa 要 patch 啦! initrd..

[复制链接]
发表于 2005-4-29 16:16:17 | 显示全部楼层 |阅读模式
版主 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]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
发表于 2005-5-7 19:18:35 | 显示全部楼层
是的
不过因为脚本的更新也很快,想到了另一个好的办法
就是做一个开机运行的脚本rc.local
这样就不用每次都patch制作脚本了
差不多已经完成
回复

使用道具 举报

发表于 2005-5-23 00:20:30 | 显示全部楼层
rc.local的想法真好

我当时怎么就忽略了呢

呵呵
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-25 18:45 , Processed in 0.109669 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表