Linux 2.6.23で、sandboxのエラーによりカーネルモジュールをビルドするパッケージがインストールできない問題を回避
Linux 2.6.23に上げたところ、NVIDIAドライバなど、カーネルモジュールを含むパッケージをビルドすると、カーネルソースツリー内にファイルを書き込もうとして*1、下のようなエラーが出るようになった。
(ビルド完了) >>> Source compiled. --------------------------- ACCESS VIOLATION SUMMARY --------------------------- LOG FILE = "/var/log/sandbox/sandbox-x11-drivers_-_nvidia-drivers-100.14.19-15230.log" open_wr: /usr/src/linux-2.6.23-gentoo/null.gcda open_wr: /usr/src/linux-2.6.23-gentoo/null.gcda open_wr: /usr/src/linux-2.6.23-gentoo/null.gcda open_wr: /usr/src/linux-2.6.23-gentoo/null.gcda open_wr: /usr/src/linux-2.6.23-gentoo/null.gcda open_wr: /usr/src/linux-2.6.23-gentoo/null.gcda --------------------------------------------------------------------------------
これを回避する2つの方法をメモ。
そのままカーネルをビルドする場合
モジュールパッケージのビルド時に「FEATURES="-sandbox -usersandbox"」を指定。モジュールのパッケージビルド中、一時的にsandboxを外したところで恐らく害はない。$ sudo bash -c 'FEATURES="ccache -sandbox -usersandbox" emerge -avO [パッケージ名...]'
カーネルソースツリーのトップディレクトリにあるMakefileの書き換えによる対処
/usr/src/linux/Makefileに対して、下の4行をコメントアウトするだけで、sandboxを無効にすることなく、この問題を回避できる。--- linux-2.6.23-gentoo/Makefile.orig +++ linux-2.6.23-gentoo/Makefile @@ -515,10 +515,10 @@ CFLAGS += $(call cc-option,-Wno-pointer-sign,) # Use --build-id when available. -LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ - $(call ld-option, -Wl$(comma)--build-id,)) -LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) -LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) +#LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ +# $(call ld-option, -Wl$(comma)--build-id,)) +#LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) +#LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) # Default kernel image to build when no specific target is given. # KBUILD_IMAGE may be overruled on the command line or
関連URL:
- http://bugs.gentoo.org/show_bug.cgi?id=135745 - Bugzilla
- http://forums.gentoo.org/viewtopic-t-597887.html - パッチの中に上記修正を含む
- http://e-words.jp/w/E382B5E383B3E38389E3839CE38383E382AFE382B9.html - sandboxとは(モデルとしての説明)