Kernel booting frozen due to mounting failure - linux

I built a new yocto image for a custom board. I flashed it to an SD card and tried booting it, but freezes while booting Kernel.
The image has SYSTEMD feature enabled. If I disable SYSTEMD, it boots fine. Do i need to configure anything ? like in fstab? I am stuck at this point for a long time, so please advice.

I was able to resolve this error. I enabled CONFIG_CGROUPS related features as mentioned in (link) in my machine's defconfig and the Kernel boots fine :)

Related

Secureboot: grub can be loaded, but the bzImage has a "Invalid Signature"

I want to make a bootable emergency USB-stick that automatically repartitions my system and unpacks a rootfs to the hard disk, installs the bootloader, etc.
I compiled my own kernel and created my own initrd with various scripts.
this works very well. only booting from an USB-stick causes problems when secureboot is active.
to work around the problem I took an official Ubuntu livecd and copied all the content like isolinux/ EFI/* and so on, I changed all grub-configuration-boot-entrys to my kernel and my initrd. So I think the bootloader should be secureboot capable.
i set the following parameters in grub.cfg and built a new iso:
set check_signatures=no
if secureboot is disabled, the system boots correctly.
if secureboot is active, the bootloader can be loaded. so the secureboot is done? but then the process aborts with the following error:
invalid signature: /boot/bzImage
although set check_signatures=no is set.
Does anyone have an idea?
Is there no other way than to sign my kernel and distribute the keys across all systems? - can I distribute the key via ssh without direct access to the hardware?
problem solved with signed-shim bootloader, free to download

How to examine and debug Yocto's bootloader on i.MX6Q?

I am building a trusted execution environment on IMX6Q with a Linux Yocto version in the untrusted processor mode. When I switch to non-secure for the first time after reset to load the linux kernel, I get flooded with data and prefetch abort exceptions after I jump to the kernels bootloader.It also seems like, that those exceptions occur as soon as the MMU is switched on.
Booting the Kernel without changing to non-secure state works fine.
Is it possible, that the control bits of the non-secure copy of the first-stage page tables are written with the NS-Bit cleared which causes the MMU to refuse any access to those regions ?
Where can I find the startup code that is setting up the page tables in the Yocto-BSP for IMX6Q ?
How can I debug the Linux Bootloader?
Is it possible to simply change source code of the bootloader in the build-directory of the BSP and rebuild the image?
Thanks in advance,
Paul
How can I debug the Linux Bootloader?
Yes, you can with beautiful printf/puts... BTW if you want to really debug with jtag in early stages of uboot you can refer to this NXP forum post
Is it possible to simply change source code of the bootloader in the build-directory of the BSP and rebuild the image?
You can easily work with the git directory of u-boot in your workbuild/tmp/work/.. dir
Modify what you need
compile it with bitbake -f -c compile u-boot-imx
Deploy it with bitbake -f -c deploy u-boot-imx
At the end your new u-boot will be placed in usual workbuild/tmp/deploy/images/...

Where is g_multi configured in BeagleBone Black?

With the default Debian installation in a BeableBone Black you can access it via USB as different devices: mass storage device, virtual ethernet and virtual serial uart. This is accomplished with the g_multi module. You can review its configuration via files in /sys/module/g_multi/parameters/ .
I am trying to use it only as a mass storage device but with other disk/block device, not the second partition in the boot block device. I have checked that it is always the same partition not matter if it is /dev/mmcblk1p2 (when I have a microSD inserted on boot) or /dev/mmcblk0p2 (without it). I have tried removing g_multi after boot and modprobing g_multi or g_mass_storage with my own configuration, and it works OK.
But I don't want the default configuration to load on startup, so I need g_multi to not load at all, or to load with my own parameters.
I search for its configuration in every place I could think of: configuration for modules in /etc, configuration for systemd, parameters of uboot for kernel, decompiling dtbs, and even with a compiled kernel I searched for the manufacturer that the startup g_multi shows in its /sys/module/g_multi/parameters/iManufacturer in all the files.
I am not able to find anything. Could someone help me?
Thank you very much in advance.
I have finally found it. It is a bit hidden (in a Debian perspective).
It is configured in the /opt/scripts/boot/am335x_evm.sh script.
I had forgotten all those scripts and utilities for the Beagle platforms. I had to follow the major part of the boot proccess.

U-Boot script for choosing the most recent image

I have a u-boot which copies a multiimage (Linux kernel+rootfs+dts) from a serial FLASH to the DDR. The device is remotely powered. The device requires fail safe remote firmware upgrade which survives power failure. I always keep two images on the FLASH. While I write a new firmware to the FLASH there is always another, older, firmware image on the FLASH. U-boot after power up shall boot the most recent firmware.
Boot time is important, but not critical. For example, I thought to let u-boot to boot the first "valid" image. A Linux application would decide if a reboot is required and modify u-boot environment.
I can patch u-boot - add a command which finds the most recent firmware on the FLASH. I would expect that somebody somewhere already solved this problem and likely better than me. Is there a patch/script for u-boot which allows to automatically choose the latest firmware based on some metadata?
Any other approaches to the problem?
Yes.
Use Uboot's bootcount feature.
It increments every boot retry. and is supposed to be cleared by an application on the filesystem after the kernel was booted.
If it reached a a threshold. you can then boot another image from uboot.

how to install XMHF on ubuntu 12.04

I am new to linux OS. According to the requirement of my project I have to install extensible Hypervisor Framework( XMHF) and then build the required hypapp over it. Grub is supposed to load the XMHF at boot time and then the ubuntu OS has to laod over it, But when i am trying to boot the system according to the steps mentioned to install XMHF the system stops at the Starting up.... state at the time of booting. I dont know where i have done mistake. I have checked it many times but nothing useful. Can anyone please help me with this?? "Installing XMHF" manual can be found at http://xmhf.sourceforge.net/doc/xmhf/doc/installing-xmhf.md.html
My grub entry for XMHF is
title XMHF
rootnoverify (hd0,0) // as i have no primary partition for the hard drive
kernel /boot/init-x86.bin
module /boot/hypervisor.bin.gz
modulenounzip (hd0)+1
I had the exact same problem.
I had to properly configure serial output, either physically or serial-over-lan, to see XMHF's output. In my case, I missed a Intel VT related switch in BIOS.
How to configure serial console can be found here: https://www.cyberciti.biz/faq/linux-serial-console-howto/
go through this http://xmhf.sourceforge.net/doc/xmhf/doc/installing-xmhf.md.html this will be helpful :D

Resources