新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 嵌入式Linux啟動(dòng)過程中的問題積累

嵌入式Linux啟動(dòng)過程中的問題積累

作者: 時(shí)間:2016-11-25 來源:網(wǎng)絡(luò) 收藏

1.Bad Magic Number

本文引用地址:http://m.butianyuan.cn/article/201611/321524.htm

## Booting image at 33000000 ...

Bad Magic Number

OMAP5912 OSK #(tftp下載好kernel的uImage后就停止在這,不能啟動(dòng)kernel)

問題原因:啟動(dòng)參數(shù)設(shè)置錯(cuò)誤,0x30000000處不可以執(zhí)行。

有的開發(fā)板sdram不是在0x33000000,所以不能把kernel uImage下載到0x33000000中運(yùn)行。如我之前的bootcmd參數(shù)為:setenv bootcmd tftpboot 33000000 uImage/; bootm 33000000。但板子Omap5912的sdram地址在0x100000000,將參數(shù)改為setenv bootcmd tftpboot 10000000 uImage/; bootm 10000000后便可以啟動(dòng)kernel了。

2.啟動(dòng)停止在"Starting kernel ..."

TFTP from server 192.168.167.170; our IP address is 192.168.167.15

Filename uImage

Load address: 0x10000000

Loading: #################################################################

#################################################################

done

Bytes transferred = 2025908 (1ee9b4 hex)

## Booting image at 10000000 ...

Image Name:Linux-2.6.18-mh8_pro500-versatil

Image Type:ARM Linux Kernel Image (uncompressed)

Data Size:2025844 Bytes =1.9 MB

Load Address: 30008000

Entry Point:30008000

Verifying Checksum ... OK

OK

Starting kernel ...(卡在這里)

問題原因:多半是kernel沒編譯成功。

確認(rèn)configure參數(shù)是否配置正確,是否選擇了正確的目標(biāo)編譯平臺(tái),如smdk2410等。

3.不能啟動(dòng)kernel

Starting kernel ...

Uncompressing Linux.........................................................

.................... done, booting the kernel.

問題原因:可能是Bootargs參數(shù)設(shè)置錯(cuò)誤,確認(rèn)bootargs設(shè)置是否正確。

4.不能掛載nfs

eth0: link up

IP-Config: Complete:

device=eth0, addr=192.168.167.15, mask=255.255.255.0, gw=192.168.167.254,

host=192.168.167.15, domain=, nis-domain=(none),

bootserver=192.168.167.170, rootserver=192.168.167.170, rootpath=

Looking upportofRPC100003/2 on 192.168.167.170

Root-NFS: Unable to get nfsd port number from server, using default

Looking upportofRPC100005/1 on 192.168.167.170

Root-NFS: Unable to get mountd port number from server, using default

mount: server 192.168.167.170 not responding, timed out

Root-NFS: Server returned error -5 while mounting /work/nfs/rootfs_bluetooth_omap

VFS: Unable to mount root fs via NFS, trying floppy.

VFS: Cannot open root device "nfs" or unknown-block(2,0)

Please append a correct "root=" boot option

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

問題原因:這種情況通常是nfs配置問題。

確認(rèn)uboot的bootargs參數(shù)里和nfs相關(guān)的ip地址信息設(shè)置是否正確,以及Host機(jī)/etc/exports配置無誤,重起nfs服務(wù),重新嘗試連接。另外還需要注意bootargs內(nèi)console和mem兩個(gè)參數(shù)的設(shè)置。kernel2.6后console最好設(shè)置為ttySAC0,mem也要根據(jù)開發(fā)板實(shí)際情況設(shè)置正確。

5.文件系統(tǒng)不能啟動(dòng)問題

eth0: link up

IP-Config: Complete:

device=eth0, addr=192.168.167.15, mask=255.255.255.0, gw=192.168.167.254,

host=192.168.167.15, domain=, nis-domain=(none),

bootserver=192.168.167.170, rootserver=192.168.167.170, rootpath=

Looking upportofRPC100003/2 on 192.168.167.170

Looking upportofRPC100005/1 on 192.168.167.170

VFS: Mounted root (nfs filesystem).

Freeing init memory: 128K

/sbin/initKernel panic - not syncing: Attempted to kill init!

問題原因:制作的文件系統(tǒng)缺少運(yùn)行busybox所需的libcrypt.so庫,新版本會(huì)有缺庫提示,老版本(1.60)沒有。

注:運(yùn)行一個(gè)busybox文件系統(tǒng)至少需要如下幾個(gè)庫:

ld-linux.so.x

libc.so.6

libcrypt.so.x

較新版本的busybox可能還需要

libm.so.6

libgcc_s.so.x

(x為版本號(hào))

6.文件系統(tǒng)不能啟動(dòng)問題2

eth0: link up

IP-Config: Complete:

device=eth0, addr=192.168.167.15, mask=255.255.255.0, gw=192.168.167.254,

host=192.168.167.15, domain=, nis-domain=(none),

bootserver=192.168.167.170, rootserver=192.168.167.170, rootpath=

Looking upportofRPC100003/2 on 192.168.167.170

Looking upportofRPC100005/1 on 192.168.167.170

VFS: Mounted root (nfs filesystem).

Freeing init memory: 128K

Kernel panic - not syncing: No init found.Try passing init= option to kernel.

問題原因:對(duì)比一個(gè)可用的文件系統(tǒng)后發(fā)現(xiàn),缺少了ld-linux.so.x庫,文件系統(tǒng)里只有l(wèi)d-linux.so.x的連接文件,少拷了庫文件。

8.不能獲得帳戶UID信息

Could not get password database information for UID of current process: User "???" unknown or no memory to allocate password entry

Unknown username "root" in message bus configuration file

Could not get password database information for UID of current process: User "???" unknown or no memory to allocate password entry

Failed to start message bus: Could not get UID and GID for username "root"

問題原因:

情況一:系統(tǒng)帳戶驗(yàn)證出現(xiàn)問題.懷疑是調(diào)用getuid、getguid時(shí)并沒有返回正確值,可能是缺少帳戶驗(yàn)證相關(guān)庫,實(shí)際排查后發(fā)現(xiàn),缺少libnss_files庫??截惤徊婢幾g器的libnss_files庫到文件系統(tǒng)后,啟動(dòng)文件系統(tǒng)成功。

情況二:系統(tǒng)沒有root帳號(hào)??梢杂蓋hoami命令看出。

手動(dòng)創(chuàng)建帳號(hào)。

#vi /etc/passwd

root:x:0:0:root:/root:/bin/sh

kyo:x:500:500:kyo:/home/kyo:/bin/bash

添加組

#vi group

root:x:0:root

9.

Freeing init memory: 128K

init started: BusyBox v1.6.1(2007-08-27 14:33:15 CST) multi-call binary

starting pid 834, tty : /etc/init.d/rcS

Cannot run /etc/init.d/rcS: No such file or directory

Please press Enter to activate this console.

發(fā)現(xiàn)沒有/etc/init.d/rcS文件系統(tǒng)一樣能正常啟動(dòng)??磥韗cS只是用來設(shè)置一些隨機(jī)啟動(dòng)的參數(shù),對(duì)文件能否正常運(yùn)行關(guān)系不大。

注:這個(gè)不是錯(cuò)誤,是偶然發(fā)現(xiàn)! :)



關(guān)鍵詞: 嵌入式Linux啟動(dòng)過

評(píng)論


技術(shù)專區(qū)

關(guān)閉