Merged to master at 0b101ee8a0d9..8a45868df606 (from, to] You can see the entire diff with 'git diff' or at https://github.com/brho/akaros/compare/0b101ee8a0d9...8a45868df606
On 2016-08-17 at 11:22 Dan Cross <[email protected]> wrote: > Change-Id: I2710a25a4e48604a8c44a90734447d22ec0e95c6 > Signed-off-by: Dan Cross <[email protected]> > --- > tools/sys-apps/cpio/.gitignore | 1 + > tools/sys-apps/cpio/Makefile | 55 > ++++++++++++++ .../cpio/akaros-patches/2.12/cpio-2.12.patch | > 84 ++++++++++++++++++++++ 3 files changed, 140 insertions(+) > create mode 100644 tools/sys-apps/cpio/.gitignore > create mode 100644 tools/sys-apps/cpio/Makefile > create mode 100644 > tools/sys-apps/cpio/akaros-patches/2.12/cpio-2.12.patch > > diff --git a/tools/sys-apps/cpio/.gitignore > b/tools/sys-apps/cpio/.gitignore new file mode 100644 > index 0000000..00649f3 > --- /dev/null > +++ b/tools/sys-apps/cpio/.gitignore > @@ -0,0 +1 @@ > +cpio-* > diff --git a/tools/sys-apps/cpio/Makefile > b/tools/sys-apps/cpio/Makefile new file mode 100644 > index 0000000..278a678 > --- /dev/null > +++ b/tools/sys-apps/cpio/Makefile > @@ -0,0 +1,55 @@ > +include ../../Makefrag > + > +########## Package-specific variables > +version := 2.12 > +src-dir = cpio-$(version) > +build-dir = $(src-dir)/build > +tarball = cpio-$(version).tar.bz2 > +fetch-url = http://ftp.gnu.org/gnu/cpio/$(tarball) > +config-opts = --prefix=/usr \ > + --bindir=/bin \ > + --disable-nls \ > + --host=x86_64-ucb-akaros \ > + --build=i686-pc-linux-gnu > + > +########## Generic Infrastructure > + > +PHONY := all > +all: make > + > +%.tar.bz2: > + $(Q)wget $(fetch-url) > + > +akaros-patches := $(sort $(wildcard akaros-patches/$(version)/*)) > + > +$(build-dir): $(tarball) $(akaros-patches) > + rm -fr $(src-dir) > + tar -xf $< > + $(Q)mkdir $(build-dir) > && \ > + for i in $(akaros-patches); > do \ > + (cd $(src-dir) && patch -p1 > < ../$$i); \ > + done > + > +PHONY += config > +$(build-dir)/Makefile config: $(build-dir) > + cd $(build-dir) && env ../configure $(config-opts) > + > +PHONY += make > +make: config > + $(Q)$(MAKE) -C $(build-dir) > + > +PHONY += install > +install: make > + $(Q)$(MAKE) -C $(build-dir) install-exec DESTDIR=$(KFS_ROOT) > + > +PHONY += clean > +clean: > + $(Q)[ -d $(build-dir) ] > && \ > + [ -f $(build-dir)/Makefile ] > && \ > + $(MAKE) -C $(build-dir) clean || true > + > +PHONY += mrproper > +mrproper: > + $(Q)rm -rf $(src-dir) > + > +.PHONY: $(PHONY) > diff --git a/tools/sys-apps/cpio/akaros-patches/2.12/cpio-2.12.patch > b/tools/sys-apps/cpio/akaros-patches/2.12/cpio-2.12.patch new file > mode 100644 index 0000000..9cb82b3 > --- /dev/null > +++ b/tools/sys-apps/cpio/akaros-patches/2.12/cpio-2.12.patch > @@ -0,0 +1,84 @@ > +diff -ru cpio-2.12.dist/build-aux/config.guess > cpio-2.12/build-aux/config.guess +--- > cpio-2.12.dist/build-aux/config.guess 2015-08-31 > 15:42:53.000000000 -0400 ++++ cpio-2.12/build-aux/config.guess > 2016-05-25 15:37:40.237245284 -0400 +@@ -229,6 +229,10 @@ > + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. > + echo "${machine}-${os}${release}${abi}" > + exit ;; > ++ *:Akaros:*:*) > ++ UNAME_MACHINE_ARCH=x86_64 > ++ echo x86_64-ucb-akaros1.0 > ++ exit ;; > + *:Bitrig:*:*) > + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` > + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} > +diff -ru cpio-2.12.dist/build-aux/config.sub > cpio-2.12/build-aux/config.sub +--- > cpio-2.12.dist/build-aux/config.sub 2015-08-31 > 15:42:53.000000000 -0400 ++++ cpio-2.12/build-aux/config.sub > 2016-05-25 15:38:09.686046995 -0400 +@@ -1379,7 +1379,7 @@ > + | -hpux* | -unos* | -osf* | -luna* | -dgux* | > -auroraux* | -solaris* \ > + | -sym* | -kopensolaris* | -plan9* \ > + | -amigaos* | -amigados* | -msdos* | -newsos* | > -unicos* | -aof* \ +- | -aos* | -aros* | -cloudabi* | > -sortix* \ ++ | -akaros* | -aos* | -aros* | -cloudabi* | > -sortix* \ > + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | > -mvs* \ > + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | > -xenix* \ > + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* > \ +diff -ru cpio-2.12.dist/gnu/error.c cpio-2.12/gnu/error.c > +--- cpio-2.12.dist/gnu/error.c 2015-08-31 15:58:43.000000000 > -0400 ++++ cpio-2.12/gnu/error.c 2016-08-16 14:33:12.109948212 > -0400 +@@ -170,7 +170,8 @@ > + static void > + print_errno_message (int errnum) > + { > +- char const *s; > ++ char const *s, *estr; > ++ int serrno = errno; > + > + #if defined HAVE_STRERROR_R || _LIBC > + char errbuf[1024]; > +@@ -196,6 +197,11 @@ > + #else > + fprintf (stderr, ": %s", s); > + #endif > ++#ifdef __ros__ > ++ estr = errstr (); > ++ if (serrno == errnum && estr != NULL && *estr != '\0') { > ++ fprintf (stderr, ", %s", estr); > ++#endif > + } > + > + static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3)) > +diff -ru cpio-2.12.dist/lib/sysdep.c cpio-2.12/lib/sysdep.c > +--- cpio-2.12.dist/lib/sysdep.c 2014-11-29 10:38:16.000000000 > -0500 ++++ cpio-2.12/lib/sysdep.c 2016-05-25 > 15:40:00.341059521 -0400 +@@ -29,6 +29,7 @@ > + #include <errno.h> > + > + > ++#ifndef __ros__ > + > + > + #ifndef HAVE_GETPWUID > +@@ -188,3 +189,4 @@ > + } > + #endif > + > ++#endif > +diff -ru cpio-2.12.dist/lib/system.h cpio-2.12/lib/system.h > +--- cpio-2.12.dist/lib/system.h 2015-08-31 15:43:05.000000000 > -0400 ++++ cpio-2.12/lib/system.h 2016-05-25 > 15:43:12.334286686 -0400 +@@ -304,6 +304,13 @@ > + # define GOT_MAJOR > + #endif > + > ++#ifdef __ros__ > ++# define major(device) (device) > ++# define minor(device) (device) > ++# define makedev(major, minor) (((major) << 8) | (minor)) > ++# define GOT_MAJOR > ++#endif > ++ > + #ifndef GOT_MAJOR > + # if MSDOS > + # define major(device) (device) -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
