forked from opencomputeproject/onie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
onie - add support for UBIFS and JFFS2
Ticket: Reviewed By: curt Testing Done: created some ubifs filesystems Add mkfs.ubifs and mkfs.jffs2 to onie sysroot. Compile time dependencies are zlib, lzo, and libuuid from e2fsprogs. I also had to enable the "SUSV4 legacy" option to uclibc for utime.h (for LZO) Runtime dependencies are libz.so This increases the sysroot.cpio.xz size by 100k bytes Compiling binaries using the ELDK and uClibc is frowned upon. The consensus is that it's not always possible to convince gcc to link only uclibc libraries in all cases. In this change, I was able to build working biaries using the --sysroot option to gcc and additions to the link path. The alternative was to replace the onie toolchain, which we decided to avoid for now.
- Loading branch information
Dustin Byford
committed
Jul 18, 2013
1 parent
5f99728
commit 35b5b30
Showing
18 changed files
with
394 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#------------------------------------------------------------------------------- | ||
# | ||
# | ||
#------------------------------------------------------------------------------- | ||
# | ||
# This is a makefile fragment that defines the build of e2fsprogs | ||
# | ||
|
||
E2FSPROGS_VERSION = 1.42.8 | ||
E2FSPROGS_TARBALL = $(UPSTREAMDIR)/e2fsprogs-$(E2FSPROGS_VERSION).tar.xz | ||
E2FSPROGS_BUILD_DIR = $(MBUILDDIR)/e2fsprogs | ||
E2FSPROGS_DIR = $(E2FSPROGS_BUILD_DIR)/e2fsprogs-$(E2FSPROGS_VERSION) | ||
|
||
E2FSPROGS_SRCPATCHDIR = $(PATCHDIR)/e2fsprogs | ||
E2FSPROGS_SOURCE_STAMP = $(STAMPDIR)/e2fsprogs-source | ||
E2FSPROGS_PATCH_STAMP = $(STAMPDIR)/e2fsprogs-patch | ||
E2FSPROGS_CONFIGURE_STAMP = $(STAMPDIR)/e2fsprogs-configure | ||
E2FSPROGS_BUILD_STAMP = $(STAMPDIR)/e2fsprogs-build | ||
E2FSPROGS_INSTALL_STAMP = $(STAMPDIR)/e2fsprogs-install | ||
E2FSPROGS_STAMP = $(E2FSPROGS_SOURCE_STAMP) \ | ||
$(E2FSPROGS_PATCH_STAMP) \ | ||
$(E2FSPROGS_CONFIGURE_STAMP) \ | ||
$(E2FSPROGS_BUILD_STAMP) \ | ||
$(E2FSPROGS_INSTALL_STAMP) | ||
|
||
PHONY += e2fsprogs e2fsprogs-source e2fsprogs-patch e2fsprogs-configure\ | ||
e2fsprogs-build e2fsprogs-install e2fsprogs-clean | ||
|
||
e2fsprogs: $(E2FSPROGS_STAMP) | ||
|
||
SOURCE += $(E2FSPROGS_SOURCE_STAMP) | ||
|
||
e2fsprogs-source: $(E2FSPROGS_SOURCE_STAMP) | ||
$(E2FSPROGS_SOURCE_STAMP): $(TREE_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Getting and extracting upstream e2fsprogs ====" | ||
$(Q) cd $(UPSTREAMDIR) && sha1sum -c $(E2FSPROGS_TARBALL).sha1 | ||
$(Q) rm -rf $(E2FSPROGS_BUILD_DIR) | ||
$(Q) mkdir -p $(E2FSPROGS_BUILD_DIR) | ||
$(Q) cd $(E2FSPROGS_BUILD_DIR) && tar xf $(E2FSPROGS_TARBALL) | ||
$(Q) touch $@ | ||
|
||
e2fsprogs-patch: $(E2FSPROGS_PATCH_STAMP) | ||
$(E2FSPROGS_PATCH_STAMP): $(E2FSPROGS_SRCPATCHDIR)/* $(E2FSPROGS_SOURCE_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Patching e2fsprogs ====" | ||
$(Q) $(SCRIPTDIR)/apply-patch-series $(E2FSPROGS_SRCPATCHDIR)/series $(E2FSPROGS_DIR) | ||
$(Q) touch $@ | ||
|
||
ifndef MAKE_CLEAN | ||
E2FSPROGS_NEW_FILES = $(shell test -d $(E2FSPROGS_DIR) && test -f $(E2FSPROGS_BUILD_STAMP) && \ | ||
find -L $(E2FSPROGS_DIR) -newer $(E2FSPROGS_BUILD_STAMP) -type f -print -quit) | ||
endif | ||
|
||
e2fsprogs-configure: $(E2FSPROGS_CONFIGURE_STAMP) | ||
$(E2FSPROGS_CONFIGURE_STAMP): $(UCLIBC_INSTALL_STAMP) $(ZLIB_INSTALL_STAMP) \ | ||
$(LZO_INSTALL_STAMP) $(E2FSPROGS_PATCH_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Configure e2fsprogs-$(E2FSPROGS_VERSION) ====" | ||
$(Q) cd $(E2FSPROGS_DIR) && PATH='$(CROSSBIN):$(PATH)' \ | ||
$(E2FSPROGS_DIR)/configure \ | ||
--prefix=$(UCLIBC_DEV_SYSROOT)/usr \ | ||
--host=$(TARGET) \ | ||
--disable-tls \ | ||
CC=$(CROSSPREFIX)gcc \ | ||
CFLAGS="-Os -I$(KERNEL_HEADERS) $(UCLIBC_FLAGS)" | ||
$(Q) touch $@ | ||
|
||
e2fsprogs-build: $(E2FSPROGS_BUILD_STAMP) | ||
$(E2FSPROGS_BUILD_STAMP): $(E2FSPROGS_NEW_FILES) $(E2FSPROGS_CONFIGURE_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Building e2fsprogs-$(E2FSPROGS_VERSION) ====" | ||
$(Q) PATH='$(CROSSBIN):$(PATH)' $(MAKE) -C $(E2FSPROGS_DIR)/lib/uuid | ||
$(Q) touch $@ | ||
|
||
e2fsprogs-install: $(E2FSPROGS_INSTALL_STAMP) | ||
$(E2FSPROGS_INSTALL_STAMP): $(SYSROOT_INIT_STAMP) $(E2FSPROGS_BUILD_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Installing e2fsprogs in $(UCLIBC_DEV_SYSROOT) ====" | ||
$(Q) sudo PATH='$(CROSSBIN):$(PATH)' \ | ||
$(MAKE) -C $(E2FSPROGS_DIR)/lib/uuid install | ||
$(Q) touch $@ | ||
|
||
CLEAN += e2fsprogs-clean | ||
e2fsprogs-clean: | ||
$(Q) rm -rf $(E2FSPROGS_BUILD_DIR) | ||
$(Q) rm -f $(E2FSPROGS_STAMP) | ||
$(Q) echo "=== Finished making $@ for $(PLATFORM)" | ||
|
||
#------------------------------------------------------------------------------- | ||
# | ||
# Local Variables: | ||
# mode: makefile-gmake | ||
# End: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#------------------------------------------------------------------------------- | ||
# | ||
# | ||
#------------------------------------------------------------------------------- | ||
# | ||
# This is a makefile fragment that defines the build of lzo | ||
# | ||
|
||
LZO_VERSION = 2.06 | ||
LZO_TARBALL = $(UPSTREAMDIR)/lzo-$(LZO_VERSION).tar.gz | ||
LZO_BUILD_DIR = $(MBUILDDIR)/lzo | ||
LZO_DIR = $(LZO_BUILD_DIR)/lzo-$(LZO_VERSION) | ||
|
||
LZO_SOURCE_STAMP = $(STAMPDIR)/lzo-source | ||
LZO_CONFIGURE_STAMP = $(STAMPDIR)/lzo-configure | ||
LZO_BUILD_STAMP = $(STAMPDIR)/lzo-build | ||
LZO_INSTALL_STAMP = $(STAMPDIR)/lzo-install | ||
LZO_STAMP = $(LZO_SOURCE_STAMP) \ | ||
$(LZO_CONFIGURE_STAMP) \ | ||
$(LZO_BUILD_STAMP) \ | ||
$(LZO_INSTALL_STAMP) | ||
|
||
PHONY += lzo lzo-source lzo-configure \ | ||
lzo-build lzo-install lzo-clean | ||
|
||
lzo: $(LZO_STAMP) | ||
|
||
SOURCE += $(LZO_SOURCE_STAMP) | ||
|
||
lzo-source: $(LZO_SOURCE_STAMP) | ||
$(LZO_SOURCE_STAMP): $(TREE_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Getting and extracting upstream lzo ====" | ||
$(Q) cd $(UPSTREAMDIR) && sha1sum -c $(LZO_TARBALL).sha1 | ||
$(Q) rm -rf $(LZO_BUILD_DIR) | ||
$(Q) mkdir -p $(LZO_BUILD_DIR) | ||
$(Q) cd $(LZO_BUILD_DIR) && tar xf $(LZO_TARBALL) | ||
$(Q) touch $@ | ||
|
||
ifndef MAKE_CLEAN | ||
LZO_NEW_FILES = $(shell test -d $(LZO_DIR) && test -f $(LZO_BUILD_STAMP) && \ | ||
find -L $(LZO_DIR) -newer $(LZO_BUILD_STAMP) -type f -print -quit) | ||
endif | ||
|
||
lzo-configure: $(LZO_CONFIGURE_STAMP) | ||
$(LZO_CONFIGURE_STAMP): $(LZO_SOURCE_STAMP) $(UCLIBC_INSTALL_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Configure lzo-$(LZO_VERSION) ====" | ||
$(Q) cd $(LZO_DIR) && PATH='$(CROSSBIN):$(PATH)' \ | ||
$(LZO_DIR)/configure \ | ||
--prefix=$(UCLIBC_DEV_SYSROOT)/usr \ | ||
--host=$(TARGET) \ | ||
CC=$(CROSSPREFIX)gcc \ | ||
CFLAGS="-Os -I$(KERNEL_HEADERS) $(UCLIBC_FLAGS)" | ||
$(Q) touch $@ | ||
|
||
lzo-build: $(LZO_BUILD_STAMP) | ||
$(LZO_BUILD_STAMP): $(LZO_CONFIGURE_STAMP) $(LZO_NEW_FILES) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Building lzo-$(LZO_VERSION) ====" | ||
$(Q) PATH='$(CROSSBIN):$(PATH)' $(MAKE) -C $(LZO_DIR) | ||
$(Q) touch $@ | ||
|
||
lzo-install: $(LZO_INSTALL_STAMP) | ||
$(LZO_INSTALL_STAMP): $(SYSROOT_INIT_STAMP) $(LZO_BUILD_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Installing lzo in $(UCLIBC_DEV_SYSROOT) ====" | ||
$(Q) sudo PATH='$(CROSSBIN):$(PATH)' \ | ||
$(MAKE) -C $(LZO_DIR) install | ||
$(Q) touch $@ | ||
|
||
CLEAN += lzo-clean | ||
lzo-clean: | ||
$(Q) rm -rf $(LZO_BUILD_DIR) | ||
$(Q) rm -f $(LZO_STAMP) | ||
$(Q) echo "=== Finished making $@ for $(PLATFORM)" | ||
|
||
#------------------------------------------------------------------------------- | ||
# | ||
# Local Variables: | ||
# mode: makefile-gmake | ||
# End: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#------------------------------------------------------------------------------- | ||
# | ||
# | ||
#------------------------------------------------------------------------------- | ||
# | ||
# This is a makefile fragment that defines the build of mtdutils | ||
# | ||
|
||
MTDUTILS_VERSION = 1.5.0 | ||
MTDUTILS_TARBALL = $(UPSTREAMDIR)/mtd-utils-$(MTDUTILS_VERSION).tar.bz2 | ||
MTDUTILS_BUILD_DIR = $(MBUILDDIR)/mtd-utils | ||
MTDUTILS_DIR = $(MTDUTILS_BUILD_DIR)/mtd-utils-$(MTDUTILS_VERSION) | ||
|
||
MTDUTILS_SOURCE_STAMP = $(STAMPDIR)/mtdutils-source | ||
MTDUTILS_BUILD_STAMP = $(STAMPDIR)/mtdutils-build | ||
MTDUTILS_INSTALL_STAMP = $(STAMPDIR)/mtdutils-install | ||
MTDUTILS_STAMP = $(MTDUTILS_SOURCE_STAMP) \ | ||
$(MTDUTILS_BUILD_STAMP) \ | ||
$(MTDUTILS_INSTALL_STAMP) | ||
|
||
MTDBINS = mkfs.jffs2 mkfs.ubifs ubinize ubiformat ubinfo mtdinfo | ||
|
||
PHONY += mtdutils mtdutils-source mtdutils-build \ | ||
mtdutils-install mtdutils-clean | ||
|
||
mtdutils: $(MTDUTILS_STAMP) | ||
|
||
SOURCE += $(MTDUTILS_SOURCE_STAMP) | ||
|
||
mtdutils-source: $(MTDUTILS_SOURCE_STAMP) | ||
$(MTDUTILS_SOURCE_STAMP): $(TREE_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Getting and extracting upstream mtdutils ====" | ||
$(Q) cd $(UPSTREAMDIR) && sha1sum -c $(MTDUTILS_TARBALL).sha1 | ||
$(Q) rm -rf $(MTDUTILS_BUILD_DIR) | ||
$(Q) mkdir -p $(MTDUTILS_BUILD_DIR) | ||
$(Q) cd $(MTDUTILS_BUILD_DIR) && tar xf $(MTDUTILS_TARBALL) | ||
$(Q) touch $@ | ||
|
||
ifndef MAKE_CLEAN | ||
MTDUTILS_NEW_FILES = $(shell test -d $(MTDUTILS_DIR) && test -f $(MTDUTILS_BUILD_STAMP) && \ | ||
find -L $(MTDUTILS_DIR) -newer $(MTDUTILS_BUILD_STAMP) -type f -print -quit) | ||
endif | ||
|
||
mtdutils-build: $(MTDUTILS_BUILD_STAMP) | ||
$(MTDUTILS_BUILD_STAMP): $(MTDUTILS_NEW_FILES) $(UCLIBC_INSTALL_STAMP) \ | ||
$(E2FSPROGS_INSTALL_STAMP) $(LZO_INSTALL_STAMP) \ | ||
$(ZLIB_INSTALL_STAMP) $(MTDUTILS_SOURCE_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) PATH='$(CROSSBIN):$(PATH)' \ | ||
$(MAKE) -C $(MTDUTILS_DIR) \ | ||
PREFIX=$(UCLIBC_DEV_SYSROOT)/usr \ | ||
CROSS=$(CROSSPREFIX) \ | ||
CFLAGS="-Os -g -I$(KERNEL_HEADERS) -I$(UCLIBC_DEV_SYSROOT)/usr/include $(UCLIBC_FLAGS)" \ | ||
WITHOUT_XATTR=1 | ||
$(Q) touch $@ | ||
|
||
mtdutils-install: $(MTDUTILS_INSTALL_STAMP) | ||
$(MTDUTILS_INSTALL_STAMP): $(SYSROOT_INIT_STAMP) $(MTDUTILS_BUILD_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Installing mtdutils in $(UCLIBC_DEV_SYSROOT) ====" | ||
$(Q) sudo PATH='$(CROSSBIN):$(PATH)' \ | ||
$(MAKE) -C $(MTDUTILS_DIR) \ | ||
PREFIX=$(UCLIBC_DEV_SYSROOT)/usr \ | ||
CROSS=$(CROSSPREFIX) \ | ||
CFLAGS="-Os -g -I$(KERNEL_HEADERS) -I$(UCLIBC_DEV_SYSROOT)/usr/include $(UCLIBC_FLAGS)" \ | ||
WITHOUT_XATTR=1 \ | ||
install | ||
$(Q) for file in $(MTDBINS) ; do \ | ||
sudo cp -av $(UCLIBC_DEV_SYSROOT)/usr/sbin/$$file $(SYSROOTDIR)/usr/sbin/ ; \ | ||
sudo $(CROSSBIN)/$(CROSSPREFIX)strip $(SYSROOTDIR)/usr/sbin/$$file ; \ | ||
done | ||
$(Q) touch $@ | ||
|
||
CLEAN += mtdutils-clean | ||
mtdutils-clean: | ||
$(Q) rm -rf $(MTDUTILS_BUILD_DIR) | ||
$(Q) rm -f $(MTDUTILS_STAMP) | ||
$(Q) echo "=== Finished making $@ for $(PLATFORM)" | ||
|
||
#------------------------------------------------------------------------------- | ||
# | ||
# Local Variables: | ||
# mode: makefile-gmake | ||
# End: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.