Carl-Daniel Hailfinger wrote: > Jordan Crouse wrote: > > > On 31/07/06 17:36 +0200, Carl-Daniel Hailfinger wrote: > > > I need some help fighting the buildrom makefiles. > > [lots of tips snipped] > > Thank you very much! > > Next try attached. It should work, but it still needs wiring up in the > main makefile.
Wired up in the main makefile, should compile cleanly. Please note that this only adds the necessary infrastructure and does not yet change anything in the generated ROM. Comments? Suggestions? Regards, Carl-Daniel -- Echte DSL-Flatrate dauerhaft für 0,- Euro*. Nur noch kurze Zeit! "Feel free" mit GMX DSL: http://www.gmx.net/de/go/dsl
diff --git a/Config.mk b/Config.mk index 854d933..b6bcdc9 100644 --- a/Config.mk +++ b/Config.mk @@ -26,6 +26,9 @@ # Say 'y' here to build uclibc as a shar # win if you selected more then one of the above) UCLIBC_DYNAMIC=y +# say 'y' here to build a full rom image with lzma compression +LZMA_PACKAGE=y + # say 'y' here to build a full rom image (minus the vsa) LINUXBIOS_PACKAGE=y @@ -59,6 +62,10 @@ ifeq ($(INITRD_KEXEC_TOOLS),y) INITRD_PACKAGES += kexec-tools endif +ifeq ($(LZMA_PACKAGE), y) +TARGETS += lzma +endif + ifeq ($(LINUXBIOS_PACKAGE), y) TARGETS += linuxbios endif diff --git a/Makefile b/Makefile index 13c11e7..9199ef0 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ include Vars.mk PKGLIST=uclibc kernel $(INITRD_PACKAGES) +ifeq ($(LZMA_PACKAGE),y) +PKGLIST += lzma +endif + ifeq ($(LINUXBIOS_PACKAGE),y) PKGLIST += linuxbios endif @@ -15,8 +19,9 @@ all: $(TARGETS) payload: $(OUTPUT_DIR)/olpc-payload.elf initrd: $(OUTPUT_DIR)/initrd +initrd.uncompressed: $(OUTPUT_DIR)/initrd.uncompressed -$(OUTPUT_DIR)/initrd: uclibc $(INITRD_PACKAGES) +$(OUTPUT_DIR)/initrd.uncompressed: uclibc $(INITRD_PACKAGES) @ cp -af $(SKELETON_DIR)/* $(INITRD_DIR) @ chmod 0755 $(INITRD_DIR)/linuxrc @@ -28,7 +33,10 @@ initrd: $(OUTPUT_DIR)/initrd @ echo "Building the initrd..." @ install -d $(OUTPUT_DIR) - @ cd $(INITRD_DIR); find . | cpio -o -H newc 2> /dev/null | gzip -9 > $@ + @ cd $(INITRD_DIR); find . | cpio -o -H newc 2> /dev/null > $@ + +$(OUTPUT_DIR)/initrd: initrd.uncompressed + @ gzip -9 -c -n $(OUTPUT_DIR)/initrd.uncompressed > $@ # Note that we refuse to continue if the ELF image is too big diff --git a/packages/lzma/lzma.mk b/packages/lzma/lzma.mk new file mode 100644 index 0000000..c5f0c5f --- /dev/null +++ b/packages/lzma/lzma.mk @@ -0,0 +1,46 @@ +LZMA_URL=http://switch.dl.sourceforge.net/sourceforge/sevenzip +LZMA_SOURCE=lzma443.tar.bz2 +LZMA_DIR=$(BUILD_DIR)/lzma +LZMA_SRC_DIR=$(LZMA_DIR)/lzma-443 +LZMA_STAMP_DIR=$(LZMA_DIR)/stamps +LZMA_LOG_DIR=$(LZMA_DIR)/logs + +ifeq ($(VERBOSE),y) +LZMA_BUILD_LOG=/dev/stdout +LZMA_CONFIG_LOG=/dev/stdout +else +LZMA_BUILD_LOG=$(LZMA_LOG_DIR)/build.log +LZMA_CONFIG_LOG=$(LZMA_LOG_DIR)/config.log +endif + +$(SOURCE_DIR)/$(LZMA_SOURCE): + @ mkdir -p $(SOURCE_DIR) + @ wget -P $(SOURCE_DIR) $(LZMA_URL)/$(LZMA_SOURCE) + +$(LZMA_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(LZMA_SOURCE) + @ mkdir -p $(LZMA_SRC_DIR) + @ tar -C $(LZMA_SRC_DIR) -jxf $(SOURCE_DIR)/$(LZMA_SOURCE) + @ touch $@ + +$(LZMA_SRC_DIR)/C/7zip/Compress/LZMA_Alone/lzma: $(LZMA_STAMP_DIR)/.unpacked + @ echo "Building lzma..." + @ ( export CC=$(HOST_CC); export CFLAGS=$(HOST_CFLAGS); \ + export LDFLAGS=$(HOST_LDFLAGS); unset LIBS; \ + cd $(LZMA_SRC_DIR)/C/7zip/Compress/LZMA_Alone; \ + $(MAKE) -C $(LZMA_SRC_DIR)/C/7zip/Compress/LZMA_Alone -f makefile.gcc > $(LZMA_BUILD_LOG) 2>&1 ) + +$(STAGING_DIR)/bin/lzma: $(LZMA_SRC_DIR)/C/7zip/Compress/LZMA_Alone/lzma + @ install -d $(STAGING_DIR)/bin + @ install -m 0755 $< $@ + +$(LZMA_STAMP_DIR) $(LZMA_LOG_DIR): + @ mkdir -p $@ + +lzma: $(LZMA_STAMP_DIR) $(LZMA_LOG_DIR) $(STAGING_DIR)/bin/lzma + +lzma-clean: + @ $(MAKE) -C $(LZMA_SRC_DIR) clean > /dev/null 2>&1 + +lzma-distclean: + @ rm -rf $(LZMA_DIR)/* +
_______________________________________________ Devel mailing list [email protected] http://mailman.laptop.org/mailman/listinfo/devel
