taviso / 123elf

A native port of Lotus 1-2-3 to Linux.
1.17k stars 59 forks source link

`cpio` fails to extract `123.o.z_2` on MacOS #62

Closed dtwilliamson closed 2 years ago

dtwilliamson commented 2 years ago

MacOS cpio doesn't have the -D directory option so I used a relative reference in the command below.

When I did

cd root
for i in 123UNIX{2..5}.IMG; do
    cpio -id < ../${i}
done

The lotus/123.v10/sysV386/lib/123.o.z_1 file (and others) extracted successfully, but 123.o.z_2 did not. I don't see any reason that this happens except that on Linux I get

lotus/123.v10/hlp/USA-English/123_sysV.hlp.z cpio: warning: skipped 4798 bytes of junk lotus/123.v10/sysV386/dvr/l13pepdt.dvr.z lotus/123.v10/sysV386/lib/123.o.z_2 2510 blocks lotus/123.v10/sysV386/bin/inst_dl.z

when I use -v. On MacOS, I get skipped 4798 bytes... and the _2 file isn't listed in the file names.

damouze commented 2 years ago

Devuan ascii cpio does not have the -D option either.

taviso commented 2 years ago

Hmm, I'm not sure what that junk is. Let me figure out what it is, maybe we can extract the non-junk parts with dd or something.

damouze commented 2 years ago

I managed to get everything working by applying the following patch:

--- extract.sh.orig     2022-05-31 09:59:30.000000000 +0200
+++ extract.sh  2022-05-31 10:01:46.662393830 +0200
@@ -23,9 +23,11 @@

 tar -C root -xf 123UNIX1.IMG

+cd root
 for i in 123UNIX{2..5}.IMG; do
-    cpio -D root -id < ${i}
+    cpio -id < ../${i}
 done
+cd -

 find root -iname '*.z' -exec gunzip {} \;
dtwilliamson commented 2 years ago

What about the missing _2 file on MacOS?

vrza commented 2 years ago

@dtwilliamson Should be fixed with https://github.com/taviso/123elf/pull/67

taviso commented 2 years ago

Thanks @vrza, marked fixed.