From d138763b56bb9f831b7bab6788190e80dfc33161 Mon Sep 17 00:00:00 2001 From: Cristi Magherusan Date: Sun, 27 Jul 2008 13:06:43 +0300 Subject: [PATCH] removed the .config file, separated the AVATT payload from the LAB one --- .config | 16 ++++++++------ config/payloads/Config.in | 31 ++++++++++++++++++++++----- config/payloads/avatt.conf | 31 +++++++++++++++++++++++++++ config/payloads/payloads.conf | 2 ++ config/platforms/qemu.conf | 2 +- packages/kernel/qemu.mk | 2 +- packages/kvm/kvm.mk | 2 +- packages/uclibc/conf/defconfig | 1 + scripts/Makefile.avatt | 48 ++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 120 insertions(+), 15 deletions(-) create mode 100644 config/payloads/avatt.conf create mode 100644 scripts/Makefile.avatt diff --git a/.config b/.config index ebc6298..2d5faa9 100644 --- a/.config +++ b/.config @@ -1,10 +1,10 @@ # # Automatically generated make config: don't edit # Buildrom version: -# Sat Jul 19 00:56:59 2008 +# Sun Jul 27 12:49:03 2008 # CONFIG_HAVE_DOT_CONFIG=y -CONFIG_ADVANCED=y +# CONFIG_ADVANCED is not set CONFIG_EXPERIMENTAL=y # @@ -81,7 +81,8 @@ CONFIG_USE_LZMA=y # CONFIG_PAYLOAD_FILO is not set # CONFIG_PAYLOAD_GRUB2 is not set # CONFIG_PAYLOAD_KERNEL is not set -CONFIG_PAYLOAD_LAB=y +# CONFIG_PAYLOAD_LAB is not set +CONFIG_PAYLOAD_AVATT=y # CONFIG_PAYLOAD_OFW is not set # CONFIG_PAYLOAD_OPENBIOS is not set # CONFIG_PAYLOAD_MEMTEST is not set @@ -90,13 +91,14 @@ CONFIG_PAYLOAD_LAB=y # CONFIG_CHOOSE_32BIT is not set CONFIG_CUSTOM_PAYLOAD="" CONFIG_CMDLINE="" +# CONFIG_KBL_KEXEC_ONLY is not set +# CONFIG_KBL is not set +CONFIG_LAB_PAUSE=5 +CONFIG_BUSYBOX=y # -# LAB Configuration +# AVATT Configuration # -# CONFIG_KBL_KEXEC_ONLY is not set -# CONFIG_KBL is not set -# CONFIG_KVM is not set CONFIG_LAB_PAUSE=5 CONFIG_BUSYBOX=y # CONFIG_MEMTEST_SERIAL is not set diff --git a/config/payloads/Config.in b/config/payloads/Config.in index 9f110a4..b812c8e 100644 --- a/config/payloads/Config.in +++ b/config/payloads/Config.in @@ -52,6 +52,12 @@ config PAYLOAD_LAB bool "Linux As Bootloader" select PAYLOAD_64BIT +config PAYLOAD_AVATT + depends on !PLATFORM_GA_2761GXDK + bool "AVATT - Linux + KVM payload, virtualization-aware BIOS" + select PAYLOAD_64BIT + select KVM + config PAYLOAD_OFW depends on EXPERIMENTAL depends on !PLATFORM_M57SLI @@ -123,11 +129,25 @@ config KBL Say 'Y' here to include the the Kexec Bootloader as a cheep substitute for kexec-tools -config KVM - bool "Include the KVM tools" - default n - help - Say 'Y' here to include the KVM tools +config LAB_PAUSE + int "Seconds to pause before booting, to allow access to the busybox environment" + default 5 + help + Set the number of seconds you'd like to pause before booting the kexec'ed + kernel here. During this pause, you can press enter to gain access to the + busybox environment. + +config BUSYBOX + bool "Busybox" + default y + help + Say 'Y' here to include the busybox tools + +endmenu + + +menu "AVATT Configuration" +depends on PAYLOAD_AVATT config LAB_PAUSE int "Seconds to pause before booting, to allow access to the busybox environment" @@ -145,6 +165,7 @@ config BUSYBOX endmenu + menu "Memtest86 Configuration" depends on PAYLOAD_MEMTEST diff --git a/config/payloads/avatt.conf b/config/payloads/avatt.conf new file mode 100644 index 0000000..67c9d3e --- /dev/null +++ b/config/payloads/avatt.conf @@ -0,0 +1,31 @@ +# Configuration options for the AVATT payload, which contains a Linux kernel and a minimalist userbase containing the KVM tools + +# General options for all platforms + +PAYLOAD_BUILD=scripts/Makefile.avatt + +### Payload specific configuration + +# Specify the default command line for the image +COMMAND_LINE=console=tty0 console=ttyS0,115200 rdinit=/linuxrc + +# This is the version string printed during boot. + +ifeq ($(CONFIG_PLATFORM_OLPC),y) +ROM_VERSION=BTest_$(FIRMWARE_REVISION) +else +ROM_VERSION="BuildROM AVATT V1.0" +endif + +########################################### +# You shouldn't change anything under this point +########################################### + +PAYLOAD_ELF=$(OUTPUT_DIR)/avatt-payload.elf +PAYLOAD_COMPRESSED=$(OUTPUT_DIR)/avatt-payload.elf.lzma + +PAYLOAD-y= kernel uclibc busybox zlib kvm + +PAYLOAD-$(CONFIG_OLPCFLASH) += olpcflash + +HOSTTOOLS-y += mkelfimage unifdef diff --git a/config/payloads/payloads.conf b/config/payloads/payloads.conf index ea86043..6586d9e 100644 --- a/config/payloads/payloads.conf +++ b/config/payloads/payloads.conf @@ -17,6 +17,7 @@ PAYLOAD_TARGET= PAYLOAD-y= PAYLOAD-$(CONFIG_PAYLOAD_LAB) = lab +PAYLOAD-$(CONFIG_PAYLOAD_AVATT) = avatt PAYLOAD-$(CONFIG_PAYLOAD_ETHERBOOT) = etherboot PAYLOAD-$(CONFIG_PAYLOAD_GPXE) = gpxe PAYLOAD-$(CONFIG_PAYLOAD_FILO) = filo @@ -37,6 +38,7 @@ PCONF-$(CONFIG_PAYLOAD_COREINFO) = libpayload-dep.conf PCONF-$(CONFIG_PAYLOAD_CUSTOM) = custom.conf PCONF-$(CONFIG_PAYLOAD_KERNEL) = kernel.conf PCONF-$(CONFIG_PAYLOAD_LAB) = lab.conf +PCONF-$(CONFIG_PAYLOAD_AVATT) = avatt.conf PCONF-$(CONFIG_PAYLOAD_OFW) = ofw.conf PCONF-$(CONFIG_PAYLOAD_OPENBIOS) = openbios.conf PCONF-$(CONFIG_PAYLOAD_TINT) = libpayload-dep.conf diff --git a/config/platforms/qemu.conf b/config/platforms/qemu.conf index 380e27b..71696b5 100644 --- a/config/platforms/qemu.conf +++ b/config/platforms/qemu.conf @@ -5,7 +5,7 @@ TARGET_ARCH=i686 CFLAGS_platform = -# kernel configuration (for LAB) +# kernel configuration (for LAB and AVATT) KERNEL_VERSION=2.6.22.2 KERNEL_CONFIG=$(PACKAGE_DIR)/kernel/conf/defconfig-qemu diff --git a/packages/kernel/qemu.mk b/packages/kernel/qemu.mk index 5a4cf4a..e9c3f88 100644 --- a/packages/kernel/qemu.mk +++ b/packages/kernel/qemu.mk @@ -1,4 +1,4 @@ -# Build file for the QEMU LAB kernel +# Build file for the QEMU LAB and AVATT kernel KERNEL_URL=http://kernel.org/pub/linux/kernel/v2.6/ KERNEL_SOURCE=linux-$(KERNEL_VERSION).tar.bz2 diff --git a/packages/kvm/kvm.mk b/packages/kvm/kvm.mk index 8da6121..d69cf18 100644 --- a/packages/kvm/kvm.mk +++ b/packages/kvm/kvm.mk @@ -37,7 +37,7 @@ $(KVM_SRC_DIR): $(KVM_STAMP_DIR)/.configured @ ( export CFLAGS="$(CFLAGS) -I$(STAGING_DIR)/include "; \ export LDFLAGS="$(LDFLAGS) -L$(STAGING_DIR)/lib \ --rpath-link,$(STAGING_DIR)/lib \ - -lpthread -lc "; \ + -Os -nostdinc -nostdlib -fno-builtin "; \ $(MAKE) -C $(KVM_SRC_DIR) libkvm vgabios qemu ) @ strip -s $(KVM_SRC_DIR)/qemu/qemu-nbd @ strip -s $(KVM_SRC_DIR)/qemu/qemu-img diff --git a/packages/uclibc/conf/defconfig b/packages/uclibc/conf/defconfig index bb59f61..5b67f6e 100644 --- a/packages/uclibc/conf/defconfig +++ b/packages/uclibc/conf/defconfig @@ -108,6 +108,7 @@ ASSUME_DEVPTS=y # UCLIBC_PWD_BUFFER_SIZE=256 UCLIBC_GRP_BUFFER_SIZE=256 +AIO=y # # Networking Support diff --git a/scripts/Makefile.avatt b/scripts/Makefile.avatt new file mode 100644 index 0000000..c853ae2 --- /dev/null +++ b/scripts/Makefile.avatt @@ -0,0 +1,48 @@ +# Targets specifically for the AVATT payload + +$(OUTPUT_DIR)/initrd.uncompressed: $(PAYLOAD-y) + @ cp -af $(SKELETON_DIR)/* $(INITRD_DIR) + @ chmod 0755 $(INITRD_DIR)/linuxrc + @ sed -i 's/%%AVATT_PAUSE%%/$(CONFIG_AVATT_PAUSE)/' $(INITRD_DIR)/linuxrc + + @ echo "Cleaning up shared libraries..." + + find $(INITRD_DIR) -type f -perm +100 -exec file -rNF '' {} \; | \ + awk ' /executable.*dynamically/ { print $$1}' > $(INITRD_DIR)/.list + + (cd $(INITRD_DIR); export CFLAGS="$(CROSS_CFLAGS)"; \ + python $(BIN_DIR)/mklibs.py \ + --root $(STAGING_DIR) -d ./ `cat $(INITRD_DIR)/.list` > /dev/null) + rm -f $(INITRD_DIR)/.list + + echo "BUILDROM AVATT $(ROM_VERSION)" > $(INITRD_DIR)/buildrom-version + echo -n "Build timestamp: " >> $(INITRD_DIR)/buildrom-version + date "+%Y%m%d %H:%M:%S" >> $(INITRD_DIR)/buildrom-version + + echo "Building the initrd..." + install -d $(OUTPUT_DIR) + cd $(INITRD_DIR); find . | cpio -o -H newc 2> /dev/null > $@ + +$(OUTPUT_DIR)/initrd: $(OUTPUT_DIR)/initrd.uncompressed + @ gzip -9 -c -n $< > $@ + +$(OUTPUT_DIR)/avatt-payload-uncompressed.elf: $(OUTPUT_DIR)/initrd.uncompressed + @ echo "Building the uncompressed ELF payload..." + @ rm -f $@ + @ $(STAGING_DIR)/sbin/mkelfImage --command-line="$(COMMAND_LINE)" \ + --ramdisk=$(OUTPUT_DIR)/initrd.uncompressed \ + $(OUTPUT_DIR)/vmlinux $@ + @ chmod 0644 $@ + +$(OUTPUT_DIR)/avatt-payload.elf: $(OUTPUT_DIR)/initrd + @ echo "Building the ELF payload..." + @ rm -f $@ + @ $(STAGING_DIR)/sbin/mkelfImage --command-line="$(COMMAND_LINE)" \ + --ramdisk=$(OUTPUT_DIR)/initrd $(OUTPUT_DIR)/vmlinux $@ + @ chmod 0644 $@ + @ $(BIN_DIR)/checkrom.sh $@ + +$(OUTPUT_DIR)/avatt-payload.elf.lzma: $(OUTPUT_DIR)/avatt-payload-uncompressed.elf + @ echo "Compressing the ELF payload with lzma..." + @ $(STAGING_DIR)/bin/lzma e $< 2> /dev/null $@ + @ $(BIN_DIR)/checkrom.sh $@ -- 2.11.4.GIT