【发布时间】:2021-04-04 06:45:36
【问题描述】:
我正在使用 mipsel 工具链编译 linux kernel。
一切正常,除了最后一点指出无效入口点:
sh: 0: Can't open /arch/mips/boot/tools/entry
rm -f arch/mips/boot/vmlinux.bin.gz
gzip -9 arch/mips/boot/vmlinux.bin
mkimage -A mips -O linux -T kernel -C gzip \
-a 0x80010000 -e \
-n 'Linux-2.6.31.3-g29b45174-dirty' \
-d arch/mips/boot/vmlinux.bin.gz arch/mips/boot/uImage
mkimage: invalid entry point -n
现在提到sh: 0: Can't open /arch/mips/boot/tools/entry
所以我检查了那个文件,它有以下内容:
#!/bin/sh
# grab the kernel_entry address from the vmlinux elf image
entry=`$1 $2 | grep kernel_entry`
fs=`echo $entry | grep ffffffff` # check toolchain output
if [ -n "$fs" ]; then
echo "0x"`$1 $2 | grep kernel_entry | cut -c9- | awk '{print $1}'`
else
echo "0x"`$1 $2 | grep kernel_entry | cut -c1- | awk '{print $1}'`
fi
现在我知道有些东西正在生成内核入口点,但生成的入口点是无效的。
问题:究竟是什么生成了内核入口点以及可以采取哪些措施来解决该问题?
问题可以通过以下步骤重现:
编译说明:
$ cd
$ wget https://github.com/steward-fu/a320/releases/download/v1.0/mipsel-4.1.2-nopic.tar.bz2
$ tar xvf mipsel-4.1.2-nopic.tar.bz2
$ sudo mv mipsel-4.1.2-nopic /opt/rg300
$ export PATH=$PATH:/opt/rg300/bin
$ git clone https://github.com/rs-97-cfw/rs97-linux-kernel-NoNDA rg300_kernel
$ cd rg300_kernel
$ ARCH=mips make uImage
【问题讨论】:
-
/arch/mips/boot/tools/entry是否可执行?你试过运行它吗? -
好吧,我只是通过 'chmod +x entry' 让它可执行,但它仍然不起作用。也许入口点本身很糟糕,所以只想知道我可以解决什么问题?
-
你跑了条目,我也报了同样的错误?
-
请分享您正在执行的脚本并产生您引用的输出。
-
@stark 我只有在运行
. entry时才会得到0x。无论如何,我已经更新了编译说明以重现该问题。它是一个小内核映像,因此只需 2 分钟或更短时间
标签: linux-kernel u-boot entry-point