1: 2011-07-30 (土) 02:00:04 yuji ソース
Line 1: Line 1:
 +*root化 [#w4f71302]
 +initramfsを編集して,root権を使えるようにしておく。
 +init.rcのon boot以降に,
 + # set RLIMIT_NICE to allow priorities from 19 to -20
 +     setrlimit 13 40 40
 +
 + # added by Yuji Ueno
 +     start setsysinit
 +     start init_root
 +で,start init_rootを追加。
 +さらに,class_start default以降に,
 + # for rootadd by Yuji
 + service setrooted /sbin/init_root.sh
 +     user root
 +     oneshot
 +     disabled
 +を追加。これで起動した時に1度,/sbin/init_root.shを実行するようになる。
 +
 +/sbin/init_root.shを以下の内容で作成した。
 + #!/sbin/ext/busybox sh
 + # mount system and rootfs r/w
 + /sbin/ext/busybox mount -o remount,rw /system;
 + /sbin/ext/busybox mount -t rootfs -o remount,rw rootfs;
 +
 + # make sure we have /system/xbin
 + /sbin/ext/busybox mkdir -p /system/xbin
 +
 + # if symlinked busybox in /system/bin or /system/xbin, remove them
 + LINK=$(/sbin/ext/busybox find /system/bin/busybox -type l);
 + if /sbin/ext/busybox [ $LINK = "/system/bin/busybox" ]; then
 +         /sbin/ext/busybox rm -rf /system/bin/busybox;
 + fi;
 + LINK=$(/sbin/ext/busybox find /system/xbin/busybox -type l);
 +         if /sbin/ext/busybox [ $LINK = "/system/xbin/busybox" ]; then
 + /sbin/ext/busybox rm -rf /system/xbin/busybox;
 + fi;
 +
 + # if real busybox in /system/bin, move to /system/xbin
 + if /sbin/ext/busybox [ -f /system/bin/busybox ]; then
 +         /sbin/ext/busybox rm -rf /system/xbin/busybox
 +         /sbin/ext/busybox mv /system/bin/busybox /system/xbin/busybox
 + fi;
 +
 + # place wrapper script
 + /sbin/ext/busybox cp /sbin/ext/busybox-wrapper /sbin/busybox;
 +
 + /sbin/ext/busybox rm /system/bin/su
 + /sbin/ext/busybox rm /system/xbin/su
 + /sbin/ext/busybox cat /res/misc/su > /system/xbin/su
 + /sbin/ext/busybox chown 0.0 /system/xbin/su
 + /sbin/ext/busybox chmod 4755 /system/xbin/su
 +
 + /sbin/ext/busybox rm /system/app/Superuser.apk
 + /sbin/ext/busybox rm /data/app/Superuser.apk
 +
 + # mount system and rootfs r/o
 + /sbin/ext/busybox mount -t rootfs -o remount,ro rootfs;
 + /sbin/ext/busybox mount -o remount,ro /system;
 +実行権を付けておく。
 +
 +sbin/ext/busybox-wrapperを作成する。
 + #!/sbin/ext/busybox sh
 +
 + if /sbin/ext/busybox [ "$0" = "sh" ]; then
 +     /sbin/ext/busybox sh "$@";
 + elif /sbin/ext/busybox [ "$1" = "sh" ]; then
 +         /sbin/ext/busybox "$@";
 +     else if /sbin/ext/busybox [ -x /system/bin/busybox ]; then
 +         /system/bin/busybox $0 "$@";
 +     elif /sbin/ext/busybox [ -x /system/xbin/busybox ]; then
 +         /system/xbin/busybox $0 "$@";
 +     else
 +         /sbin/ext/busybox $0 "$@";
 +     fi;
 + fi;
 +このファイルにも実行権を付ける。
 +
 +それと,sbin/extの中にbusyboxをコピーする。
 +
 +さらに,initramfs/res/miscの中に,Superuser.apkをコピーする。


トップ   差分 バックアップ 複製 名前変更 リロード   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ   最新ページのRSS 1.0 最新ページのRSS 2.0 最新ページのRSS Atom
Counter: 521, today: 1, yesterday: 0