• Please review our updated Terms and Rules here

cpio UNIX PC to MightyFrame CTIX "translation"

firebirdta84

Experienced Member
Joined
Jun 26, 2013
Messages
244
Location
Central Iowa
So, I am hoping to -i (copy in, extract) a cpio file that contains absolute path names to be redirected to the current working directory.

When I read cpio in the UNIX PC User's Manual (this link opens the whole manual right to the cpio page), it clearly says that the option I want to use is -R: "Allow files and directories with absolute path names to be redirected on input to the current working directory (see pwd (1)) by removing the leading / from the path name. This option is used only with the -i option."

But, as luck would have it, the MightyFrame options do not contain a -R, only a -r, and in the UNIX PC manual, those clearly are different functions.

Instead, the MightyFrame has:
Usage:
cpio -o[acvBQ] <name-list >collection
cpio -i[cdmrstuvfBQ6] [pattern ...] <collection
cpio -p[adlmruv] directory <name-list


Now, I don't yet have a CTIX User's Manual for the MightyFrame, so the UNIX PC manual is my best resource for this vintage of UNIX.

Does anyone have any idea on which one of the available parameters from the MightyFrame might have this same function?

The MightyFrame runs CTIX, which all documents point to being a Convergent Technologies port of UNIX System V release 2.2.

Please see my CPIO page for more reference:

http://mightyframe.blogspot.com/2015/01/mightyframe-cpio-demystified.html

--
Thanks!
-AJ
 
Last edited:
AJ, cpio is a very hoary old Unix utility that, fortunately, hasn't changed very much. When I extracted the files I needed from the 3B1 cpio collection, cpio -idv did the trick under Linux and extracted the entire tree to the current directory, creating subdirectories.
 
AJ, cpio is a very hoary old Unix utility that, fortunately, hasn't changed very much. When I extracted the files I needed from the 3B1 cpio collection, cpio -idv did the trick under Linux and extracted the entire tree to the current directory, creating subdirectories.

Thanks for this, Chuck(G). I'm glad you've responded here, because I actually used this example you refer to as my first cpio learning experience. Even with that, I found that I had to add an option to get this to work for me, using what appears to be the same source of "development set" files, and extracting them on a freshly installed UNIX PC. I write a section about that on my cpio page here. I needed to add the "-c" option to what you specify above. This may be because I was actually doing the extract on the UNIX PC, instead of modern Linux (which is one of the things I was wanting to learn how to do, actually). I wanted to keep the extraction as native vintage UNIX as possible. I go on to say more about why.

Some more background on this cpio file I'm working with on the MightyFrame. This cpio file was originally created in 1986 by a MightyFrame. I can extract it on modern Linux using the options you specify without any issue. However, this creates other undesired results, such as not preserving file ownerships, and then the "device objects, hard links, other resources" (for which I don't know the proper terminology yet for UNIX/Linux), are not restored in the proper vintage UNIX environment, and therefore, when transferred to the MightyFrame, say, via dd to and from QIC tape, the properties change just enough to be troublesome when operating on the MightyFrame.

And, actually, I've already done this (extract on Linux, transfer to MightyFrame method) many months ago, and have been working to learn and correct the issues resulting on the MightyFrame associated with this method. Going through this painstaking process is actually how we got to the point of having a semi-functioning CTIX OS for the MightyFrame.

So, now that I have a (mostly) functional CTIX OS on the MightyFrame, I thought I would like to try extracting this cpio directly on the MightyFrame, to keep the environment as native as possible, since it was created on a MightyFrame of the exact same version. That way I have a chance to see the original files with their original properties, unaffected by the assumptions imposed upon them by a more modern Linux system, if that makes any sense.

But, with one difference. This cpio file was apparently created with absolute pathnames, as it was a full system backup. The MightyFrame supports multiple MFM hard drives, so on a 2nd, newly formatted and mkfs'd hard drive, mounted to /s1, I am trying to extract the entire contents of this cpio in /s1 as the current directly. However, when I do "cpio -idv" in that directory on the MightyFrame, It insists on replacing every file in every directory that I already have on the system root, such as /dev/*, /bin/*, /etc/*, the operating kernel on /, and so on.

The UNIX PC option of -R is what I would use to accomplish this "restore to current directory" on the UNIX PC, but since the MightyFrame CTIX is missing that option, and has other unknown options, this is where more of my trial and error begins.

I was just hoping that someone such as your self, might remember these variations on vintage UNIX ports as it relates to CPIO, or even, refer me to another relevant vintage operating manual that might have the definitions to my "unknown" cpio options on the MightyFrame (as they differ from the options on the UNIX PC), so that I could figure that out.

Sorry for rambling on, but I hope it's helpful to get a full picture of what I am trying to accomplish here and why.

Thanks again, you have been great help to me on this project!
-AJ
 
Well, according to my old (not Covnergent) SysV documentation, cpio always creates directories in the current directory, not root, which makes sense. As far as permissions and owners, that only transfers over when you are superuser.

If you want, I could try extracting one of your CTIX cpio files on, say, a Xenix system and see if what I just wrote holds true.
 
Thanks, Chuck(G), your perspective here is very helpful to me.

If you want, I could try extracting one of your CTIX cpio files on, say, a Xenix system and see if what I just wrote holds true.

I would greatly appreciate your offer, and your skillful eye on this file. You will likely see things I am missing or misinterpreting.

The .cpio file is about 37Mb, and can be downloaded from here.

Thanks!
-AJ
 
Okay, AJ. I'll get to it sometime tomorrow. Right now, I have to work on re-assembling a floppy drive that someone started disassembling and got himself in a bunch of trouble.

Some people shouldn't be allowed near a soldering iron...
 
So, while I wait for Chuck(G)'s kind analysis, I'll give an update on my further search for CTIX's cpio options. No breakthrough, but interesting to report:

Computerworld, Feb 15, 1988 in the article "A/UX ships following lengthy delay" contains a statement that A/UX is Apple's version of AT&T's UNIX System V, Release 2.2.

So, with that said, I looked up cpio in the A/UX® Command Reference Section (A-L)
(Warning: This link opens the entire 521-page manual to the cpio page)

A/UX:
cpio -o[acBFv]
cpio -i[BcdmrtuvfsSb6] [patterns]
cpio -p[adlmuv] directory


And while the options for cpio here are closer to CTIX, still there are variations. Worse yet, there is no substitute for the -R option that I am seeking.

On a side note, I do see that there is enough interest in A/UX that it's being emulated, with a lot of online activity. They call it Shoebill.

This is a fascinating search journey, however.

Does anyone know of other systems that might have command reference manuals available that ran ports of UNIX System V, Release 2.2? I'll hunt down those, also.
 
Last edited:
I should probably take a look at the 3B1 install script which I do have and see what the cpio calls look like. That was also done by Convergent.

Xenix (which is pretty much SysV based) does not show the -R option and does make reference to extracting to the current directory.
 
I could not extract your cpio file on a BSD system using the native cpio; this version does not have a way to ignore the absolute pathnames. But I did manage to extract your files on that BSD system after building the oldest GNU cpio still easily available (from ftp://ftp.gnu.org/pub/gnu/cpio/cpio-2.4.2.tar.gz ). I just did the normal GNU "./configure" followed by "make" to build it. I assume that if you have a working C compiler and environment that this code will probably work for you too. After building, my command line was, "cpio-2.4.2/cpio -id --no-absolute-filenames < CTIX5.11.cpio" and it seemed to work just fine.
 
FWIW my earliest SVr3.2 experience was on SCO UNIX. The cpio for what I suspect was their last release still doesn't have the function you need: SCO cpio man page. This leads me to guess that the command line option you need didn't exist in the base code for SVr3.2 cpio.

I don't know if the "-r" option can accept filenames from the standard input, or if it is forcing input from the terminal. If it can use the standard input, then maybe you could write a listing ("cpio -it") to a file, edit it to remove the leading slash, then feed it back to cpio as the standard input for the "-r" option (did that make sense?).

EDIT: No, "-r" with standard input won't work. The standard input is already in use for the cpio archive file.
 
Last edited:
SCO Xenix at some point introduced the -A option to cpio, which corresponds to the "--no-absolute-filenames" option of GNU cpio. BSD has no such option, as far as I can tell. But using the --no-absolute-filenames option on Linux at least allows one to extract the files; if done under superuser, the dates, attributes and owner also come through. After that, it's mostly a matter of selecting what method to get the files over (e.g. tar) to your CTIX machine.

If this were my file, I'd write a quick C program to scan the cpio file and replace the leading "/" in each file header with an "x" or some other character, rendering all these relative pathnames. The cpio header description is in cpio(4) in the programmer's reference.
 
I wrote a cpio-to-tar tool in C (uses lib-archive for the grunt work, so that would have to be built as well), it handles that cpio file but I don't recall if it does the /dev files correctly. I actually made that tool because I can never remember the right options for cpio! Not to mention the differences between GNU (Linux) cpio and AIX cpio. Now I just use tar.. :)

-Tor
 
Thanks, everyone, for your input here. This is another great discussion!

I'm just getting back to this thread now, and I plan on methodically working my way through each of your suggestions, and reporting the results.

-AJ
 
I could not extract your cpio file on a BSD system using the native cpio; this version does not have a way to ignore the absolute pathnames. But I did manage to extract your files on that BSD system after building the oldest GNU cpio still easily available (from ftp://ftp.gnu.org/pub/gnu/cpio/cpio-2.4.2.tar.gz ). I just did the normal GNU "./configure" followed by "make" to build it. I assume that if you have a working C compiler and environment that this code will probably work for you too. After building, my command line was, "cpio-2.4.2/cpio -id --no-absolute-filenames < CTIX5.11.cpio" and it seemed to work just fine.

Uniballer, thank you so much for this resource. This was my first choice here.

Now I was able to get as far as the "make". Here is an error I received. Do you have any advice? This seems like a really great tool, worth diagnosing:

# cd cpio-2.4.2
# ls -l
total 1466
-r--r--r-- 1 isam 1000 17982 Jun 2 1991 COPYING
-rw-r--r-- 1 isam 1000 25263 Oct 23 1994 COPYING.LIB
-r--r--r-- 1 isam 1000 36348 Jan 16 1996 ChangeLog
-rw-r--r-- 1 isam 1000 7721 Nov 17 1995 INSTALL
-rw-r--r-- 1 root root 7493 Jan 21 02:15 Makefile
-r--r--r-- 1 isam 1000 7242 Dec 20 1995 Makefile.in
-rw-r--r-- 1 isam 1000 2401 Nov 22 1995 NEWS
-rw-r--r-- 1 isam 1000 2783 Jul 5 1993 README
-r--r--r-- 1 isam 1000 14119 Jan 6 1996 alloca.c
-rw-r--r-- 1 isam 1000 2530 Sep 26 1994 argmatch.c
-r--r--r-- 1 isam 1000 565 Jul 18 1992 bcopy.c
-rw-r--r-- 1 root root 2513 Jan 21 02:14 config.cache
-rw-r--r-- 1 root root 3886 Jan 21 02:15 config.log
-rwxr-xr-x 1 root root 4039 Jan 21 02:14 config.status
-r-xr-xr-x 1 isam 1000 59267 Dec 20 1995 configure
-r--r--r-- 1 isam 1000 1792 Dec 20 1995 configure.in
-r--r--r-- 1 isam 1000 39504 Nov 30 1994 copyin.c
-r--r--r-- 1 isam 1000 22867 Jan 10 1996 copyout.c
-r--r--r-- 1 isam 1000 14706 Jan 8 1996 copypass.c
-rw-r--r-- 1 isam 1000 11622 Nov 30 1994 cpio.1
-rw-r--r-- 1 isam 1000 75 Jul 19 1992 cpio.def
-rw-r--r-- 1 isam 1000 2078 May 29 1992 cpio.h
-rw-r--r-- 1 isam 1000 18155 Dec 20 1995 cpio.info
-r--r--r-- 1 isam 1000 19321 Dec 20 1995 cpio.texi
-rw-r--r-- 1 isam 1000 2609 Jul 18 1992 cpiohdr.h
-rw-r--r-- 1 isam 1000 1342 Apr 28 1993 defer.c
-rw-r--r-- 1 isam 1000 212 Mar 29 1993 defer.h
-rw-r--r-- 1 isam 1000 1835 Oct 7 1994 dirname.c
-rw-r--r-- 1 isam 1000 2822 Nov 24 1992 dstring.c
-rw-r--r-- 1 isam 1000 1997 Aug 22 1992 dstring.h
-r--r--r-- 1 isam 1000 3356 Dec 5 1995 error.c
-r--r--r-- 1 isam 1000 6308 Nov 30 1994 extern.h
-r--r--r-- 1 isam 1000 5975 Nov 4 1994 filemode.c
-rw-r--r-- 1 isam 1000 2483 Jul 18 1992 filetypes.h
-rw-r--r-- 1 isam 1000 4836 Jan 27 1995 fnmatch.c
-rw-r--r-- 1 isam 1000 2355 Oct 2 1994 fnmatch.h
-r--r--r-- 1 isam 1000 22153 Sep 30 1995 getopt.c
-r--r--r-- 1 isam 1000 4438 Oct 31 1994 getopt.h
-r--r--r-- 1 isam 1000 4254 Oct 31 1994 getopt1.c
-r--r--r-- 1 isam 1000 6252 Nov 30 1994 global.c
-rw-r--r-- 1 isam 1000 5277 Jun 23 1995 idcache.c
-r-xr-xr-x 1 isam 1000 4773 Dec 6 1995 install-sh
-r--r--r-- 1 isam 1000 14014 Nov 30 1994 main.c
-rw-r--r-- 1 isam 1000 2106 Aug 22 1992 makefile.os2
-r--r--r-- 1 isam 1000 2100 Nov 30 1994 makefile.pc
-r--r--r-- 1 isam 1000 8033 Nov 30 1994 makepath.c
-r--r--r-- 1 isam 1000 2785 Oct 8 1994 mkdir.c
-r-xr-xr-x 1 isam 1000 606 Jul 25 1995 mkinstalldirs
-r--r--r-- 1 isam 1000 2969 Nov 22 1995 mt.1
-r--r--r-- 1 isam 1000 7238 Nov 22 1995 mt.c
-r--r--r-- 1 isam 1000 6311 Dec 20 1995 rmt.c
-r--r--r-- 1 isam 1000 3321 Nov 30 1994 rmt.h
-r--r--r-- 1 isam 1000 14007 Nov 30 1994 rtapelib.c
-rw-r--r-- 1 isam 1000 45 Nov 30 1994 safe-stat.h
-r--r--r-- 1 isam 1000 1189 Sep 26 1994 strdup.c
-r--r--r-- 1 isam 1000 1439 Sep 26 1994 stripslash.c
-r--r--r-- 1 isam 1000 3252 Nov 30 1994 system.h
-rw-r--r-- 1 isam 1000 15338 Feb 25 1994 tar.c
-rw-r--r-- 1 isam 1000 3746 Apr 8 1992 tar.h
-rw-r--r-- 1 isam 1000 1512 Jul 18 1992 tarhdr.h
-r--r--r-- 1 isam 1000 6079 Nov 30 1994 tcexparg.c
-rw-r--r-- 1 isam 1000 147013 Jan 5 1996 texinfo.tex
-rw-r--r-- 1 isam 1000 6204 Sep 26 1994 userspec.c
-r--r--r-- 1 isam 1000 36584 Jan 16 1996 util.c
-rw-r--r-- 1 isam 1000 84 Jan 8 1996 version.c
-r--r--r-- 1 isam 1000 2298 Jun 23 1995 xmalloc.c
-rw-r--r-- 1 isam 1000 1122 Dec 9 1995 xstrdup.c
# make
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g copyin.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g copyout.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g copypass.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g defer.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g dstring.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g global.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g main.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g tar.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g util.c
"util.c", line 1252: warning: enumeration type clash, operator =
"util.c", line 1298: warning: enumeration type clash, operator =
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g error.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g getopt.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g getopt1.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g filemode.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g version.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g rtapelib.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g dirname.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g idcache.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g makepath.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g xmalloc.c
"xmalloc.c", line 62: syntax error
"xmalloc.c", line 66: redeclaration of p
"xmalloc.c", line 66: cannot initialize extern or union
"xmalloc.c", line 67: syntax error
"xmalloc.c", line 71: redeclaration of p
"xmalloc.c", line 77: redeclaration of formal parameter, n
"xmalloc.c", line 78: syntax error
"xmalloc.c", line 82: redeclaration of p
"xmalloc.c", line 82: unknown size
"xmalloc.c", line 82: cannot initialize extern or union
"xmalloc.c", line 83: syntax error
"xmalloc.c", line 85: redeclaration of p
"xmalloc.c", line 93: redeclaration of formal parameter, n
"xmalloc.c", line 95: syntax error
"xmalloc.c", line 99: redeclaration of p
"xmalloc.c", line 99: unknown size
"xmalloc.c", line 99: illegal initialization
"xmalloc.c", line 100: syntax error
"xmalloc.c", line 102: redeclaration of p
*** Error code 1

Stop.
#
 
It looks to me like your system does not have the type "size_t" defined, or it is defined in a non-standard place. This value type is used in the standard C library for storage size values, but in cpio-2.4.2 it only appears in module xmalloc.c. Unfortunately, it is difficult for me to guess at the best thing to do on your system, but for a first try I would try adding the line "typedef unsigned size_t;" to module xmalloc.c. I would probably insert it just above the "#endif" at line 36. Let me know how that works.
 
It looks to me like your system does not have the type "size_t" defined, or it is defined in a non-standard place. This value type is used in the standard C library for storage size values, but in cpio-2.4.2 it only appears in module xmalloc.c. Unfortunately, it is difficult for me to guess at the best thing to do on your system, but for a first try I would try adding the line "typedef unsigned size_t;" to module xmalloc.c. I would probably insert it just above the "#endif" at line 36. Let me know how that works.

Thanks, Uniballer...I think you're absolutely correct. I have another vintage UNIX knowledgeable friend helping me with this, and he came to the same conclusion.

Furthermore, we found we needed to replace all instances of "rmdir" with "unlink" in both the copyin.c and copypass.c files. There was one instance in each file.

So, it appears it completed successfully:

# pwd
/data/cpio-2.4.2
# make
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g copyin.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g copyout.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g copypass.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g defer.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g dstring.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g global.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g main.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g tar.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g util.c
"util.c", line 1252: warning: enumeration type clash, operator =
"util.c", line 1298: warning: enumeration type clash, operator =
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g error.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g getopt.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g getopt1.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g filemode.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g version.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g rtapelib.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g dirname.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g idcache.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g makepath.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g stripslash.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g userspec.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g xstrdup.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g bcopy.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g mkdir.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g strdup.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g fnmatch.c
cc -c -DRETSIGTYPE=int -DMAJOR_IN_SYSMACROS=1 -DHAVE_NETDB_H=1 -Dconst= -Duid_t=int -Dgid_t=int -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_VPRINTF=1 -DC_ALLOCA=1 -DSTACK_DIRECTION=-1 -I. -g alloca.c
cc -o cpio copyin.o copyout.o copypass.o defer.o dstring.o global.o main.o tar.o util.o error.o getopt.o getopt1.o filemode.o version.o rtapelib.o dirname.o idcache.o makepath.o xmalloc.o stripslash.o userspec.o xstrdup.o bcopy.o mkdir.o strdup.o fnmatch.o alloca.o -lsocket
#
 
Everyone,

This option from Uniballer worked extremely well, once I worked through these bugs mentioned above. Here are the specific results on the file I used as an example at the beginning of this thread:

# ls -l
total 71578
-rw-r--r-- 1 root root 36503552 Jan 21 09:29 CTIX5.11.cpio
# /data/cpio-2.4.2/cpio -id --no-absolute-filenames < CTIX5.11.cpio
mkdir: cannot access usr/spool/lp/.
mkdir: cannot access usr/spool/lp/request/.
mkdir: cannot access usr/spool/uucp/.
mkdir: cannot access usr/spool/uucp/.Log/.
mkdir: cannot access usr/adm/acct/.
mkdir: cannot access u/.
mkdir: cannot access coins/.
mkdir: cannot access work/.
71293 blocks
#

Uniballer, when you tried this same .cpio source file, did you get the same or similar warning messages as this?

Anyway, thanks everyone...this has been an enormous success for me, and I couldn't have done this without the collaboration of the generous contributors here!

-AJ
 
Doing that on Linux I also get 7123 blocks, but no warning messages. Looking at the content of the file it looks like those directories are listed in the cpio file *after* records with files of the same directories.
E.g.
Code:
wxr-xr-x   2 71       2               0 Aug 26  1986 /usr/spool/lp/interface
-rw-r--r--   1 71       2              12 Aug 26  1986 /usr/spool/lp/member/nec
drwxr-xr-x   2 71       2               0 Aug 26  1986 /usr/spool/lp/member
..
-rw-r--r--   1 71       2               3 Aug 26  1986 /usr/spool/lp/seqfile
-rw-r--r--   1 71       2            1612 Aug 26  1986 /usr/spool/lp/outputq
drwxr-xr-x   7 71       2               0 Aug 26  1986 /usr/spool/lp
So at that point (when extracting just /usr/spool/lp) cpio will already have created that directory (/usr/spool/lp/) and *maybe* that's why you get the warning. Although I'm not sure why I don't get the with GNU cpio on Linux - naturally I would assume that the tool ignores such errors from mkdir(2) (it would return EEXIST I guess). So why that doesn't happen for you I'm not sure. Are all the files extracted correctly in those directories? If so it's probably OK.

-Tor
 
Last edited:
On my BSD system, I didn't get the warnings on the directories like you did. But I got over 900 "operation not permitted" warnings for the files originally in /dev, but who cares? They are probably only useful on the system they originated on, anyway. The files I presume that you wanted worked OK.

It is possible that an even earlier version of GNU cpio, if you could find one, would build and run on your system without any errors, because the GNU project started before there was a C language standard, and so tried to deal with many pre-standard compilers and build environments. That's what the "./configure" step is all about. Then again, your system may never have been popular enough to have had direct support in GNU packages. But since you have something working I don't think it's really worthwhile to research it.

You may find some of the other GNU packages useful, too (e.g. I like emacs). Porting them to your system will probably not be any easier than cpio-2.4.2, but I suspect that after doing a couple of them you will find that the same few issues come up in a bunch of them.

I'm glad this worked out for you.
 
Back
Top