This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/BEAGLEBN: Boot hangs at starting kernel

Guru 18615 points
Part Number: BEAGLEBN


Tool/software: Linux

Hi everybody,

I have managed to boot my Beaglebone black with a compiled kernel, busybox, device tree and a ramdisk. That is, making u-boot operate like this :)

# for standalone ramdisk:
        # fatload mmc 0:1 0x80200000 zImage
        # fatload mmc 0:1 0x80f00000 am335x-boneblack.dtb
        # fatload mmc 0:1 0x81000000 uRamdisk
        # setenv bootargs console=ttyO0,115200 rdinit=/bin/sh
        # bootz 0x80200000 0x81000000 0x80f00000

This thing boots ok, and I obtain a shell instead of /etc/init, like indicated in rdinit bootarg parameter. I have built busybox as static binary and ramdisk is pretty simple structure but functional :)

Now, for the sake of learning, I am after doing the same thing but integrating uRamdisk inside the kernel :) That is populating menuconfig with the proper path to the initramfs.cpio file.

But, it does not boot at all. It gets stucket at "Starting kernel" and cannot get more output from it, even if I compiled kernel with LL_DEBUG. So now the u-boot instructions are as follow:

# for integrated ramdisk (soflink init to busybox):
        # fatload mmc 0:1 0x80200000 zImage
        # fatload mmc 0:1 0x88000000 am335x-boneblack.dtb
        # setenv bootargs console=ttyO0,115200 rdinit=/bin/sh
        # bootz 0x80200000 - 0x88000000

While I have changed the load addresses, I have tried as well the previous ones and did not change a thing :)

For your convenience, I have attached the bash script I use to automate everything. This works fine and I have tested all the steps take place. I tried to make it as easy as possible and is a short one :)

#!/bin/bash
# required BUILD ORDER --> busybox, modules, rootfs, kernel


echo && echo "---> ENV: vars (choose arm-linux-gnueabihf- OR arm-cortex_a8-linux-gnueabihf-)"
	MELP=${HOME}/MELP 
	RTFS=${MELP}/initramfs 
	BUSY=${MELP}/busybox 
	MYCC=arm-linux-gnueabihf-


echo && echo "---> ROOTFS: creating staging tree and building and installing BUSYBOX"
	echo "---> ROOTFS: remember to set BUSYBOX as STATIC binary" && read
	rm -rf ${RTFS} && mkdir ${RTFS} && mkdir -p ${RTFS}/{bin,sbin,etc,proc,sys} && cd ${BUSY} 
	make ARCH=arm CROSS_COMPILE=${MYCC} distclean defconfig menuconfig
	make ARCH=arm CROSS_COMPILE=${MYCC}
	make ARCH=arm CROSS_COMPILE=${MYCC} CONFIG_PREFIX=${RTFS} install
	ln -sf ${RTFS}/bin/sh ${RTFS}/init
	ln -sf ${RTFS}/bin/sh ${RTFS}/bin/init



echo && echo "---> KERNEL: build modules(first for ramdisk), zImage, and dtbs"
	echo "---> KERNEL: set PATH_TO_RAMDISK and SIZE" && read && cd ${MELP}/linux-stable
	# make ARCH=arm CROSS_COMPILE=${MYCC} mrproper bb.org_defconfig menuconfig modules -j6
	make ARCH=arm CROSS_COMPILE=${MYCC} mrproper multi_v7_defconfig menuconfig modules -j6
	make ARCH=arm CROSS_COMPILE=${MYCC} modules_install INSTALL_MOD_PATH=${RTFS}
	pushd . && cd ${RTFS} && find . | cpio -H newc -o > ../initramfs.cpio && popd
	make ARCH=arm CROSS_COMPILE=${MYCC} zImage dtbs -j6


echo && echo "---> done" && echo && cd ${MELP}

So, just being curious here, but let me know your suggestions and have a really nice day!