Author: jcrouse Date: 2008-04-23 19:17:43 +0200 (Wed, 23 Apr 2008) New Revision: 153
Added: buildrom-devel/config/payloads/grub2.conf buildrom-devel/packages/grub2/ buildrom-devel/packages/grub2/conf/ buildrom-devel/packages/grub2/conf/grub.cfg buildrom-devel/packages/grub2/grub2.mk Modified: buildrom-devel/config/payloads/Config.in buildrom-devel/config/payloads/payloads.conf Log: buildrom: Add GRUB2
Many thanks to Patrick Georgi for his excellent work! This adds GRUB2 - enough to get to the GRUB2 prompt. Detailed configurations and more modules coming later.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: buildrom-devel/config/payloads/Config.in =================================================================== --- buildrom-devel/config/payloads/Config.in 2008-04-22 17:48:29 UTC (rev 152) +++ buildrom-devel/config/payloads/Config.in 2008-04-23 17:17:43 UTC (rev 153) @@ -27,6 +27,10 @@ config PAYLOAD_FILO bool "FILO"
+config PAYLOAD_GRUB2 + depends EXPERIMENTAL + bool "GRUB2" + config PAYLOAD_KERNEL depends on !PLATFORM_GA_2761GXDK bool "Linux kernel payload"
Added: buildrom-devel/config/payloads/grub2.conf =================================================================== --- buildrom-devel/config/payloads/grub2.conf (rev 0) +++ buildrom-devel/config/payloads/grub2.conf 2008-04-23 17:17:43 UTC (rev 153) @@ -0,0 +1,11 @@ +# Configuration file for the GRUB2 payload + +# Common configuration options + +PAYLOAD_BUILD=scripts/Makefile.generic + +PAYLOAD_ELF=$(OUTPUT_DIR)/grub2-payload.elf +PAYLOAD_COMPRESSED=$(OUTPUT_DIR)/grub2-payload.elf.lzma + +PAYLOAD-y=grub2 +PAYLOAD=grub2
Modified: buildrom-devel/config/payloads/payloads.conf =================================================================== --- buildrom-devel/config/payloads/payloads.conf 2008-04-22 17:48:29 UTC (rev 152) +++ buildrom-devel/config/payloads/payloads.conf 2008-04-23 17:17:43 UTC (rev 153) @@ -26,6 +26,7 @@ PCONF-$(CONFIG_PAYLOAD_CUSTOM) = custom.conf PCONF-$(CONFIG_PAYLOAD_COREINFO) = coreinfo.conf PCONF-$(CONFIG_PAYLOAD_TINT) = tint.conf +PCONF-$(CONFIG_PAYLOAD_GRUB2) = grub2.conf
DEPENDS-y= include $(CONFIG_DIR)/payloads/$(PCONF-y)
Added: buildrom-devel/packages/grub2/conf/grub.cfg =================================================================== --- buildrom-devel/packages/grub2/conf/grub.cfg (rev 0) +++ buildrom-devel/packages/grub2/conf/grub.cfg 2008-04-23 17:17:43 UTC (rev 153) @@ -0,0 +1,5 @@ +coreboot + +menuentry "sample" { + set root=(ata0) +}
Added: buildrom-devel/packages/grub2/grub2.mk =================================================================== --- buildrom-devel/packages/grub2/grub2.mk (rev 0) +++ buildrom-devel/packages/grub2/grub2.mk 2008-04-23 17:17:43 UTC (rev 153) @@ -0,0 +1,77 @@ +GRUB2_REVISION=7e743dc7b9262c132488d7bb601ea48e4f730c60 +GRUB2_URL=http://coreboot.org/viewmtn/revision/tar/$(GRUB2_REVISION) +GRUB2_TAR=grub2-$(GRUB2_REVISION).tar + +GRUB2_DIR=$(BUILD_DIR)/grub2 +GRUB2_SRC_DIR=$(GRUB2_DIR)/$(GRUB2_REVISION) +GRUB2_STAMP_DIR=$(GRUB2_DIR)/stamps +GRUB2_LOG_DIR=$(GRUB2_DIR)/logs + +ifeq ($(CONFIG_VERBOSE),y) +GRUB2_CONFIG_LOG=/dev/stdout +GRUB2_BUILD_LOG=/dev/stdout +GRUB2_INSTALL_LOG=/dev/stdout +else +GRUB2_BUILD_LOG=$(GRUB2_LOG_DIR)/build.log +GRUB2_INSTALL_LOG=$(GRUB2_LOG_DIR)/install.log +GRUB2_CONFIG_LOG=$(GRUB2_LOG_DIR)/config.log +endif + +GRUB2_CFG=$(PACKAGE_DIR)/grub2/conf/grub.cfg +GRUB2_MODULES=coreboot cat cmp iso9660 help lspci \ + serial terminal lar terminfo memdisk ata ls \ + configfile boot hexdump linux multiboot ext2 + +HAVE_RUBY:=$(call find-tool,ruby) + +ifeq ($(HAVE_RUBY),n) +$(error To build GRUB2, you need to install 'ruby') +endif + +$(SOURCE_DIR)/$(GRUB2_TAR): + @ mkdir -p $(SOURCE_DIR) + @ wget -O $@ $(GRUB2_URL) + +$(GRUB2_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(GRUB2_TAR) | $(GRUB2_DIR) $(GRUB2_STAMP_DIR) + @ tar -C $(GRUB2_DIR) -xf $(SOURCE_DIR)/$(GRUB2_TAR) + @ touch $@ + +$(GRUB2_STAMP_DIR)/.configured: $(GRUB2_STAMP_DIR)/.unpacked | $(GRUB2_LOG_DIR) + @ echo "Configuring GRUB2..." + @ (cd $(GRUB2_SRC_DIR); sh ./autogen.sh > $(GRUB2_CONFIG_LOG) 2>&1) + @ (cd $(GRUB2_SRC_DIR); export LIBS= CC= LDFLAGS= CFLAGS=; ./configure --with-platform=linuxbios --prefix=$(STAGING_DIR) >> $(GRUB2_CONFIG_LOG) 2>&1) + @ touch $@ + +$(GRUB2_SRC_DIR)/grub-mkimage: $(GRUB2_STAMP_DIR)/.configured + @ echo "Building GRUB2..." + @ (cd $(GRUB2_SRC_DIR); make > $(GRUB2_CONFIG_LOG) 2>&1) + +$(GRUB2_STAMP_DIR)/.installed: $(GRUB2_SRC_DIR)/grub-mkimage + @ chmod uga+x $(GRUB2_SRC_DIR)/mkinstalldirs + @ (cd $(GRUB2_SRC_DIR); make install > $(GRUB2_INSTALL_LOG) 2>&1) + @ touch $@ + +$(GRUB2_DIR)/grub2.elf: $(GRUB2_STAMP_DIR)/.installed + @ $(STAGING_DIR)/bin/grub-mkimage -o $@ $(GRUB2_MODULES) + +$(GRUB2_STAMP_DIR)/.copied: $(GRUB2_DIR)/grub2.elf + @ mkdir -p $(shell dirname $(PAYLOAD_ELF)) + @ cp $(GRUB2_DIR)/grub2.elf $(PAYLOAD_ELF) + @ touch $@ + +$(GRUB2_DIR) $(GRUB2_LOG_DIR) $(GRUB2_STAMP_DIR): + @ mkdir -p $@ + +grub2: $(GRUB2_STAMP_DIR)/.copied + +grub2-clean: + @ rm -f $(GRUB2_DIR)/grub2.lar + @ rm -f $(GRUB2_DIR)/grub2.elf + @ rm -f $(GRUB2_STAMP_DIR)/.copied + @ rm -f $(GRUB2_STAMP_DIR)/.installed + @ if [ -f $(GRUB2_SRC_DIR)/Makefile ]; then \ + make -C $(GRUB2_SRC_DIR) clean > /dev/null 2>&1; \ + fi + +grub2-distclean: + @ rm -rf $(GRUB2_DIR)/*