在/opt/STM/STMLinux-2.3/devket/source/kernel/linux-sh4/ 中
运行脚本文件./vmlinux2gz2ub.sh
即可把vmlinux内核 生成映像文件vmlinux.ub
然后把vmlinux.ub 拷到/opt/STM/STMLinux-2.3/devket/sh4/target中
vim vmlinux2gz2ub.sh
可见:
可见:
echo "convert the kernel into a raw binary image:"
rm -rf vmlinux.bin.gz
rm -rf vmlinux.ub
sh4-linux-objcopy -O binary -R .note -R .comment -S vmlinux vmlinux.bin
#
echo "compress the binary image:"
gzip -9 vmlinux.bin
#
echo "package compressed binary image for U-Boot:"
/opt/STM/STLinux-2.3/devkit/sources/u-boot/u-boot-sh4-1.3.1_stm23_0046/tools/mkimage -A sh -O linux -T kernel -C gzip -a 0x80800000 -e 0x80801000 -n "linux-sh4-2.6.23.17_stm23_A21" -d vmlinux.bin.gz vmlinux.ub
原理也比较简单。
rm -rf vmlinux.bin.gz
rm -rf vmlinux.ub
sh4-linux-objcopy -O binary -R .note -R .comment -S vmlinux vmlinux.bin
#
echo "compress the binary image:"
gzip -9 vmlinux.bin
#
echo "package compressed binary image for U-Boot:"
/opt/STM/STLinux-2.3/devkit/sources/u-boot/u-boot-sh4-1.3.1_stm23_0046/tools/mkimage -A sh -O linux -T kernel -C gzip -a 0x80800000 -e 0x80801000 -n "linux-sh4-2.6.23.17_stm23_A21" -d vmlinux.bin.gz vmlinux.ub
原理也比较简单。