1. 程式人生 > >【總結】嵌入式Linux學習中遇到的問題及解決方法

【總結】嵌入式Linux學習中遇到的問題及解決方法

持續更新。。。

(1)uboot中執行nfs 32000000  192.168.1.101:/work/nfs_root/uImage_new

下載新核心時出現:TTT***ERROR:Cannot umount。如下圖:


解決方法:

在linux虛擬機器下輸入:sudo vi  /etc/hosts。在裡面加上一行:

192.168.1.17  /work/nfs_root/

192.168.1.17  是單板uboot設定的IP


(2)Freeing init memory: 164K Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.


解決方法:

如果你剛移植了核心,設定了分割槽,製作了檔案系統,那麼八成是:檔案系統燒錯地方,或者分割槽不對,核心根本沒找到檔案系統。請檢查uboot分割槽和核心中的分割槽是否一致。

Add:

#include<stdlib.h>
(4)ubuntu 14 中安裝arm-linux-gcc-4.4.3,裝好後設置環境變數,然後arm-linux-gcc -v是出現:/opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-gcc: 15: exec: /opt/FriendlyARM/toolschain/4.4.3/bin/.arm-none-linux-gnueabi-gcc: not found
解決方法:執行:apt-get install lsb-core   

(5)git commit -m "first_base_root"的時候出現:

*** Please tell me who you are.
Run
  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got '

[email protected](none)')

解決方法:

vi .git/config

在下面加上:

[user]
 email=your email
 name=your name

(6)ubuntu 編譯核心出現 

recipe for target 'menuconfig' failed
No command 'recipe' found, did you mean:
 Command 'recite' from package 'recite' (universe)
recipe: command not found

解決方法:

sudo apt-get install libncurses5-dev   

(7)ubuntu出現:

error while loading shared libraries: libstdc++.so.6: cannot open shared obj

解決方法:

apt-get install lib32stdc++6

(8)核心啟動過程中,列印: can't run '/etc/init.d/rcS': Permission denied

是製作檔案系統的時候,沒有加上缺陷,導致指令碼檔案無法被正常執行。

解決方法:

 chomd +x /etc/init.d/rcS。。。(9)ls  /dev 目錄下只有console 和 null正常情況下,單板核心啟動並載入檔案系統後,在/dev下會看到一些裝置節點。原因是mdev沒有正常被檔案系統載入,檔案系統指令碼檔案沒有正常執行,或者busybox中沒有配置mdex(預設是配置了的)解決方法: chomd +x /etc/init.d/rcS。
(10)Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373解決方法:開啟 kernel/timeconst.pl@val = @{$canned_values{$hz}};if (!defined(@val)) {@val = compute_values($hz);}output($hz, @val);將if (defined(@val)) 改為if (!@val),再次編譯就可以通過了。(11)安裝ssl時:POD document had syntax errors at /usr/bin/pod2man line 68.解決方法:執行sudo rm /usr/bin/pod2man

(12)單板 passwd root時出現unknown uid 0
解決方法:

13、makefile中的反斜槓\

反斜槓\:換行符的意思,不用寫到一行了,這樣增加makefile可讀性。

OBJS := main.o \
                        display/disp_manager.o        \
                        display/fb.o                  \
                        encoding/ascii.o              \
                        encoding/utf-16be.o           

14、/opt/usr/local/arm/4.3.2/bin/arm-linux-gcc: line 3: /opt/usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-gcc: No such file or directory方法:

    安裝32位的相容庫:

    #sudo apt-get install libncurses5:i386