The things here should already be compiled (on trisquel 6) for yoru convenience



You need these dependencies to build/use

$ sudo apt-get -y install subversion git

    (these contain tools used for compiling source code) 

$ sudo apt-get -y install build-essential

    (these are required for building coreboot) 

$ sudo apt-get -y install libncurses5-dev doxygen iasl gdb flex bison

    (required for building flashrom) 

$ sudo apt-get -y install libpci-dev pciutils zlib1g-dev libftdi-dev

    (for building grub) 

$ sudo apt-get install bison libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev flex libfont-freetype-perl automake autotools-dev libfreetype6-dev texinfo

    (you also need to install unifont (for text in grub2) 

$ sudo apt-get -y install ttf-unifont 

---

Building GRUB2 from scratch

$ make clean

$ ./autogen.sh

$ ./configure --with-platform=coreboot

$ make 


put a grub.custom.cfg in grub/
this is your config


then put:
./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o grub2-X60.elf --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs minix_be minix minix3_be minix3 minix2_be minix2 zfs ufs2 ufs1_be ufs1 udf squash4 sfs romfs jfs reiserfs procfs odc ntfs nilfs2 newc iso9660 hfsplus cpio exfat cpio_be afs affs btrfs bfs hfs video_bochs video_cirrus password png keystatus sleep loopback' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=grub.custom.cfg

pu grub2-X60.elf in coreboot/

go in coreboot (a .config is already there, you don't need to use make menuconfig)

make

cd build

dd if=coreboot.rom of=top64k.bin bs=1 skip=$[$(stat -c %s coreboot.rom) - 0x10000] count=64k
dd if=coreboot.rom bs=1 skip=$[$(stat -c %s coreboot.rom) - 0x20000] count=64k | hexdump
dd if=top64k.bin of=coreboot.rom bs=1 seek=$[$(stat -c %s coreboot.rom) - 0x20000] count=64k conv=notrunc

now you have a coreboot.rom


---

flashrom and bucts are just make clean and make

flashchips.c should be modified according to your flash chip (if you have factory BIOS)
