«前の日記(2015-08-04 (Tue)) 最新 次の日記(2015-09-15 (Tue))» 編集

雑記帳


2015-09-11 (Fri) [長年日記]

[OSX] System Integrity Protectionを無効にする方法

自分はDvorak配列を使っている関係で、ローマ字カナ変換の時に、カ行の文字を入力する際には、k[aiueo]と入力するのではなく、c[aiueo]と入力している。ことえりでは、ローマ字変換テーブルを変更するためには、/System/Library/Input Methods/JapaneseIM.app/Contents/Resources/RomajiRule_Default.txtを書き換えないといけない。

しかし、OSX 10.11(El Capitan)から、システムボリュームに対して、root権限でも書き込みができなくなった。(参照)。そのため、ことえりのローマ字変換テーブルを、普通の方法では書き換えることができなくなってしまった。

ではどうするのかというと、System Integrity Protectionを無効にして書き換えればよい。System Integrity Protectionを無効にするには、csrutilを使う。

% csrutil
usage: csrutil <command>
Modify the System Integrity Protection configuration. All configuration changes apply to the entire machine.
Available commands:

    clear
        Clear the existing configuration. Only available in Recovery OS.
    disable
        Disable the protection on the machine. Only available in Recovery OS.
    enable
        Enable the protection on the machine. Only available in Recovery OS.
    status
        Display the current configuration.

    netboot
        add <address>
            Insert a new IPv4 address in the list of allowed NetBoot sources.
        list
            Print the list of allowed NetBoot sources.
        remove <address>
            Remove an IPv4 address from the list of allowed NetBoot sources.

しかし、単に実行しても無効にすることはできない。

% sudo csrutil disable
csrutil: failed to modify system integrity configuration. This tool needs to be executed from the Recovery OS.

Recovery OSでなければならない。ということで、OSX起動時に、Command + Rを押しっぱなしにして、Recovery OSを起動する。そのあと、Terminalを起動して、csrutil disableを実行すればよい。

その状態で、当該ファイルを書き換えれることができる。ことえりのローマ字変換テーブルを、事前に準備しておき、コピーすればよい。

これでようやく、El Capitanのライブ変換を、いつものキー配列で使うことができるようになった。