2013-07-23 81 views
3

我正在使用ubuntu linux。嘗試將ARM解釋器的支持添加到binfmt。 我收到權限被拒絕的錯誤。binfmt-support - 不允許我回顯註冊

只是增加了支持到binfmt我的機器上:---

sudo apt-get install binfmt-support 

LS在目錄binfmt_misc: -

[email protected]:/proc/sys/fs/binfmt_misc$ ls 
python2.7 python3.2 register status 

binfmt_misc文件系統安裝正確:---

[email protected]:/proc/sys/fs/binfmt_misc$ mount 
/dev/sda8 on/type ext4 (rw,errors=remount-ro) 
proc on /proc type proc (rw,noexec,nosuid,nodev) 
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) 
none on /sys/fs/fuse/connections type fusectl (rw) 
none on /sys/kernel/debug type debugfs (rw) 
none on /sys/kernel/security type securityfs (rw) 
udev on /dev type devtmpfs (rw,mode=0755) 
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) 
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) 
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) 
none on /run/shm type tmpfs (rw,nosuid,nodev) 
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755) 
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) 
gvfsd-fuse on /run/user/ignite/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=ignite) 

模塊啓動&運行:---

[email protected]:/proc/sys/fs/binfmt_misc$ cat /proc/modules | grep binfmt* 
binfmt_misc 17260 1 - Live 0x00000000 

狀態是顯示啓用-----

[email protected]:/proc/sys/fs/binfmt_misc$ cat status 
enabled 

錯誤在回波的時間註冊,甚至使用sudo文件:---

[email protected]:/proc/sys/fs/binfmt_misc$ sudo echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/var/local/rpi/qemu/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register 
bash: /proc/sys/fs/binfmt_misc/register: Permission denied 

爲什麼不讓我回聲註冊,即使sudo?

編輯:---
此命令工作,創建文件夾的手臂:---

[email protected]$ echo "echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register" | sudo sh 

[email protected]:/proc/sys/fs/binfmt_misc$ ls 
arm python2.7 python3.2 register status 


[email protected]:/proc/sys/fs/binfmt_misc$ cat arm 
enabled 
interpreter /usr/local/bin/qemu-arm 
flags: 
offset 0 
magic 7f454c4601010100000000000000000002002800 
mask ffffffffffffff00fffffffffffffffffeffffff 

,但我不能夠運行手臂可執行文件。這是hello world的pre compiled program

[email protected]:~/testing$ file a.out 
a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.6.3, not stripped 
[email protected]:~/testing$ ./a.out 
/lib/ld-linux-armhf.so.3: No such file or directory 

我是不是要執行的chroot執行該手臂可執行?

回答

2

此命令:

sudo echo xyz > /proc/sys/fs/binfmt_misc/register 

執行如你,不是超級用戶。所以,首先你的shell open()小號/proc/sys/fs/binfmt_misc/register,則fork/exec的 「sudo echo xyz」,...

要解決它,這樣做:

sudo sh -c 'echo xyz > /proc/sys/fs/binfmt_misc/register' 
+0

但我不能運行arm可執行文件這是一個預編譯的hello world程序。我必須執行chroot來執行這個預編譯的arm可執行文件嗎? ....請參閱我編輯過的上述文章。 – Katoch

+0

這解釋了爲什麼特定命令不起作用。這可能不是你唯一的問題。 –

1

回答你問題的第二部分是以下。

當運行可執行文件的系統給你的錯誤信息:

[email protected]:~/testing$ ./a.out 
/lib/ld-linux-armhf.so.3: No such file or directory 

這說明了什麼問題。看起來你已經用-L/lib/ld-linux-armhf.so.3的012,動態鏈接共享庫編譯你的源文件。該庫在運行時無法找到。

要麼檢查ld-linux-armhf.so.3文件可以提到(/lib)的路徑上找到或者試圖解釋系統在哪裏可以找到你的.so -file使用以下命令:

export LD_LIBRARY_PATH=/path/to/your/lib:$LD_LIBRARY_PATH

相關問題