嵌入式Linux啓動過程當中的問題積累

嵌入式Linux啓動過程當中的問題積累linux

Dongas 07-12-19bash

1.Bad Magic Numberapp

## Booting image at 33000000 ...dom

Bad Magic Numberui

OMAP5912 OSK # (tftp下載好kernel的uImage後就中止在這,不能啓動kernel)this

問題緣由:啓動參數設置錯誤,0x30000000處不能夠執行。spa

有的開發板sdram不是在0x33000000,因此不能把kernel uImage下載到0x33000000中運行。如我以前的bootcmd參數爲:setenv bootcmd tftpboot 33000000 uImage/; bootm 33000000。但板子Omap5912的sdram地址在0x100000000,將參數改成setenv bootcmd tftpboot 10000000 uImage/; bootm 10000000後即可以啓動kernel了。orm

2.啓動中止在"Starting kernel ..."server

TFTP from server 192.168.167.170; our IP address is 192.168.167.15ip

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沒編譯成功。

確認configure參數是否配置正確,是否選擇了正確的目標編譯平臺,如smdk2410等。

3.不能啓動kernel

Starting kernel ...

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

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

問題緣由:多是Bootargs參數設置錯誤,確認bootargs設置是否正確。

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 up port of RPC 100003/2 on 192.168.167.170

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

Looking up port of RPC 100005/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配置問題。

確認uboot的bootargs參數裏和nfs相關的ip地址信息設置是否正確,以及Host機/etc/exports配置無誤,重起nfs服務,從新嘗試鏈接。另外還須要注意bootargs內console和mem兩個參數的設置。kernel2.6後console最好設置爲ttySAC0,mem也要根據開發板實際狀況設置正確。

5.文件系統不能啓動問題

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 up port of RPC 100003/2 on 192.168.167.170

Looking up port of RPC 100005/1 on 192.168.167.170

VFS: Mounted root (nfs filesystem).

Freeing init memory: 128K

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

問題緣由:製做的文件系統缺乏運行busybox所需的libcrypt.so庫,新版本會有缺庫提示,老版本(1.60)沒有。

注:運行一個busybox文件系統至少須要以下幾個庫:

ld-linux.so.x

libc.so.6

libcrypt.so.x

較新版本的busybox可能還須要

libm.so.6

libgcc_s.so.x

(x爲版本號)

6.文件系統不能啓動問題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 up port of RPC 100003/2 on 192.168.167.170

Looking up port of RPC 100005/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.

問題緣由:對比一個可用的文件系統後發現,缺乏了ld-linux.so.x庫,文件系統裏只有ld-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"

問題緣由:

狀況一:系統賬戶驗證出現問題.懷疑是調用getuid、getguid時並無返回正確值,多是缺乏賬戶驗證相關庫,實際排查後發現,缺乏libnss_files庫。拷貝交叉編譯器的libnss_files庫到文件系統後,啓動文件系統成功。

狀況二:系統沒有root賬號。能夠由whoami命令看出。

手動建立賬號。

#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.

發現沒有/etc/init.d/rcS文件系統同樣能正常啓動。看來rcS只是用來設置一些隨機啓動的參數,對文件可否正常運行關係不大。

注:這個不是錯誤,是偶然發現! :)

相關文章
相關標籤/搜索