Setting up Coreboot + GRUB

follow the instructions until step 5 and then


vi grub.cfg

set default=0
set timeout=5

menuentry "Linux" {
    insmod ext2
    set root=(ata0)
    linux /vmlinuz root=/dev/sda ro ipv6.disable=1 init=/bin/sh
    #console=ttyS1,9600 console=tty0

Note ata0 instead of hd0. You can also troubleshoot and find out about devices and file-systems from the GRUB command line, once you get there


set root=ata0
insmod ext2
ls /


#make distclean
rm -f .config
make menuconfig

Mainboard  --->
ROM chip size (1024 KB (1 MB))

notice the CBFS size also changed

(0x100000) Size of CBFS filesystem in ROM (NEW)

Payload  --->
Add a payload (GRUB2)
GRUB2 version (2.04)
[*] Include GRUB2 runtime config file into ROM image
(grub.cfg) Path of grub.cfg (NEW)

make savedefconfig
cat defconfig
nice make -j5 > ../corebootgrub.log && echo BUILT

quick & dirty system

cd ../
dd if=/dev/zero of=disk.sparse bs=1M count=0 seek=1000

mkfs.ext2 disk.sparse
mkdir -p lala/
mount -o loop disk.sparse lala/
cp /vmlinuz lala/

#tar xjf busybox-1.31.0.tar.bz2 
#cd busybox-1.31.0/
git clone git://
cd busybox/
#make distclean

#make allyesconfig
#make menuconfig
#...disable selinux
#...disable pam
#grep SELINUX .config
#grep PAM .config
#grep ... .config

make defconfig
make menuconfig
[*] Build static binary (no shared libs)
#echo CONFIG_STATIC=y >> .config
#make oldconfig
grep STATIC .config

nice make -j5 > ../busybox.log && echo BUILT
ldd busybox #not a dynamic executable

rm -rf ../busybox.built/
mkdir ../busybox.built/
make CONFIG_PREFIX=../busybox.built install
cd ../

cp -af busybox.built/* lala/
ll lala/
du -sh lala/ #13M
umount lala/

ready to go

emulate a guest

qemu-system-x86_64 -h | less
qemu-system-x86_64 -bios coreboot/build/coreboot.rom -hda disk.sparse
#-serial stdio


E: Could not add [payloads/external/GRUB2/grub2/build/default_payload.elf, 451892 bytes (441 KB)@0x0]; too big?
E: Failed to add 'payloads/external/GRUB2/grub2/build/default_payload.elf' into ROM image.

–> increase the ROM size and CBFS size

FMAP       build/util/cbfstool/fmaptool -h build/fmap_config.h build/fmap.fmd build/fmap.fmap
syntax error
FATAL: Failed while processing provided descriptor recipe for target 'build/fmap.fmap' failed

–> rm -f .config && make menuconfig


Tutorial, part 1: Starting from scratch


coreboot v3 + OpenBIOS


grub command line


16.3 The list of command-line and menu entry commands


Why do I keep getting “sh: can’t access tty; job control turned off” errors? Why doesn’t Control-C work within my shell?