Why u-boot calls grub in rpi3? - linux

I have rpi3.
This situation is under the embedded system.
The RPI reference shows how to boot Ubuntu.
It shows the way that u-boot calls grub and grub calls Linux...
and I have tried this chain loading.
In that situation, I wonder why u-boot calls grub? not directly calls Linux? Is it possible that grub calls Linux without u-boot?

GRUB requires a firmware to load it. U-Boot is one embodiment of such a firmware. For the Raspberry 3 you could use EDK2 [1] or barebox [3] instead.
Linux can be loaded directly from U-Boot. Either using the Linux EFI stub via the bootefi command or via the booti (64 bit) or bootm (32 bit) command.
Some distributions (Suse, Fedora [2]) have decided that it will make maintenance easier if all supported systems are booted in the same way, i.e. via GRUB. Debian Buster is also moving to GRUB on ARMv8 with the Buster release.
[1] https://github.com/tianocore/edk2-platforms/tree/master/Platform/RaspberryPi/RPi3
[2] https://fedoraproject.org/wiki/Changes/uEFIforARMv7
[3] https://www.barebox.org/

Related

Why mdev or udev does not create disk nodes when used kernel is from any distribution

I created a minimal linux init with just busybox to do experiments or use it to recover my work linux. But i got stuck and was fustruted alot that i could not find any disks in /dev. I tried both mounting udev as devtmpfs and tmpfs with mdev -s. Both none seemed to work. Lickily i tried compiling a kernel and booting it i realised kernel was the issue. I also noticed my pluged mouse light was off as if the pc was turned off
I tried kernel from both debian and ubuntu. But same result.
Now im happy with what i got. But using custom kernel means i cant make use of the already existing drivers on a target linux when i do chroot.
So i wanna know why the kernels that come with distros does not generate disk blocks
Edit 1:
My question is,why i cant find ant /dev/sdX or my external keyboard does not work when i boot with kernel from distro isos

Create EFI-stub boot entry from Windows

I use Linux kerne EFI stub to boot. Now I have run into an emergency, because I have lost my UEFI boot entry and I am stuck with Windows.
Is there any possibility to create UEFI NVRAM boot entry for Linux kernel?
I have managed to create it, but without kernel args (like: root=PARTUUID=....) and Linux is not booting without them.
Is there a way how to create boot menu entry from Windows 10 with CLI args?
One solution could be:
Mount the ESP partition under windows.
Create a startup.nsh script to pass kernel parameters
Create boot menu entry which points to the startup.nsh
One way you can resolve this:
You can run any live linux OS, chroot to your still existing installed Linux Distribution, and reinstall grub, which will re-add Linux to the boot menu alongside Windows.

Build a minimum system with Qt embedded and run on Qemu for x86

My aim: Trying to
Build a minimal Qt based GUI system with a single window and sensor connected on USB
demonstrate this using Qemu and later on embedded board with atom
to build it from scratch
Use buildroot to build the rootfilesystem
My experience Have experience in Linux kernel development for device drivers, qemu, Buildroot, USB but has no experience on GUI and framebuffers.
My attempts:Build kernel and rootfile system
with buildroot using the command make qemu_x86_defconfig
Framebuffer support on Linux kernel is enabled along with the following CONFIG_FB, CONFIG_FRAMEBUFFER_CONSOLE, and CONFIG_LOGO (all the options below this are also enabled)
As the first milestone I expected to see the TUX logo when I run the image with the command
qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2 -append root=/dev/sda -vga std but i donot.
Am I making a mistake at the Qemu command or the framebuffer is not enabled?
P.S. A similar question Qt application GUI -- automatic start -- linux. But i am not planning to use the X window as suggested by most users.
I missed the cirrus graphics board driver. Qemu emulates Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA extensions (hardware level, including all non standard modes for i386.
So the steps are:
Download buildroot
make clean
make qemu_x86_defconfig
make linux-menuconfig to configure kernel and in Device drivers->Graphics support->Support for frame buffer devices enable Cirrus Logic support
Save the configuration and run make
Once make is complete run the command in board/qemu/x86/readme.txt
Where did you see that Buildroot has a i386_defconfig? You seem to be confusing kernel defconfigs and Buildroot defconfigs. I would recommend you to start with:
make clean
make qemu_x86_defconfig
make
and then read board/qemu/x86/readme.txt to see how to run the generated system.

grub can't see linux\no boot menu in Win7

I have both windows and linux installed.
I created a new partition but got Grub error:UNKNOWN FILESYSTEM on restart. Then I used windows recovery CD and Bootrec/fixmbr command to get Grub menu back.
But now I don't see the boot menu.laptop simply boots into windows, also I am unable to boot from any other CD or USB
You need to reinstall grub on the boot sector. If you use Ubuntu, there is a very easy way to fix it with Ubuntu's live CD using the boot-repair tool.
I'm not sure if this will work with other Linux distributions but It's worth trying.
If you can't boot from CD or USB you should check your boot priority in the BIOS. Or try to get to boot selection menu (usually by pressing F12) and choose CD\USB over there, anyways, the answer here is in the BIOS and not related to the grub

About compiling Linux kernel in Debian Live

This is my first time compiling Linux kernel. I am using Debian Live. I used kernel-package to compile and I also added a new system call to return an arbitrary integer value greater than zero.
Everything went fine and I got both headers and image .deb files. When I tried to install them with dpkg, there was a warning that said I needed to configure LILO. I then aborted the installation and looked for LILO to find out that Debian Live got neither LILO nor GRUB. I installed GRUB, but it was not installed on my sda1 (USB disk running Debain Live), it said that it was not a proper block device. Debian Live uses squashfs (a file system).
Then, I ignored bootloader and installed the custom kernel. After I rebooted my computer, I was directly booted to the old Debain Live and my system call returns -1.
Please provide some solutions guys.
Thanks,
Debian Live is not a suitable base for you do to your own kernel development on. As you've found, it doesn't contain the tools needed to rebuild itself (that's not what its designed to do).
Install the regular Debian distribution (perhaps inside a virtualisation environment like VMWare Server or VirtualBox). Do your kernel development there.

Resources