delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/26/16:58:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "gmx" <for_spam AT gmx DOT de>
To: <cygwin AT cygwin DOT com>
Subject: mkcramfs under cygwin ??
Date: Fri, 26 Apr 2002 22:59:11 +0200
Message-ID: <GCEKJAPMFCCHLBOOCMIBIEMBCLAA.for_spam@gmx.de>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

CygWinners - hi again,

since i got no reply to my mkcramfs porting question (ok - mybe it's too special
and i'm too impatiently - sorry),
i spend some time on trying it myself.
I was really wondering how far I git -  better said, it's nearly done! :)

Beside of a little bug, it works basically - i can create compressed ram
filesystems under windows now.

I don`t really know, if i can expect being helped by this list - but i think
this question is cygwin specific.
If i'm wrong here and I inconvenience you - sorry - please tell me where/whom to
ask (maybe "alt.comp.programming.linux.rookies" or such ??)

The only thing i had to fix was to add "typedef long long int loff_t;" to
mkcramfs.c because it's not defined in cygwin's types.h.
Surprisingly, it compiled successfully - just with some warnings.

But there is a bug inside: The created filesystem contains "inconsistent"
symlink entries if i unpack them again with uncramfs on a
linux box - i.e. they are garbled.

linux:/tmp/testdir3/base # ls -la
insgesamt 7
drwxr-xr-x    9 vmware   bin           251 Apr 26 21:34 .
drwxr-xr-x   67 vmware   bin          1653 Apr 26 21:34 ..
drwxr-xr-x    2 vmware   bin           883 Apr 26 21:34 bin
drwxr-xr-x    2 vmware   bin            75 Apr 26 21:34 dev
drwxr-xr-x    3 vmware   bin           532 Apr 26 21:34 etc
drwxr-xr-x    5 vmware   bin           459 Apr 26 21:34 lib
lrwxrwxrwx    1 vmware   bin            13 Apr 26 21:34 linuxrc -> bin/busybox??
drwxr-xr-x    2 vmware   bin            35 Apr 26 21:34 proc
drwxr-xr-x    2 vmware   bin            35 Apr 26 21:34 root
lrwxrwxrwx    1 vmware   bin            86 Apr 26 21:34 sbin ->
binaÐ??a(u??@v??Xw???y??0z??H{??`|??x}???~??¨???À???Ø???ð???????
???8???drwxr-xr-x    2 vmware   bin            35 Apr 26 21:34 tmp
lrwxrwxrwx    1 vmware   bin            49 Apr 26 21:34 usr ->
tmpaè??aee//base/tmp/ion-0.8\pkg-tree\base\root\8
lrwxrwxrwx    1 vmware   bin             8 Apr 26 21:34 var -> tmp/vara


I think this maybe a result of the compile warning
$ make
gcc -Wall -O3    mkcramfs.c  -lz -o mkcramfs
mkcramfs.c: In function `parse_directory':
mkcramfs.c:177: warning: passing arg 4 of `scandir' from incompatible pointer
type
mkcramfs.c: In function `main':
mkcramfs.c:750: warning: int format, ssize_t arg (arg 2)
mkcramfs.c:757: warning: int format, ssize_t arg (arg 2)
mkcramfs.c:771: warning: int format, ssize_t arg (arg 4)
mkcramfs.c:781: warning: int format, ssize_t arg (arg 3)
mkcramfs.c:781: warning: int format, ssize_t arg (arg 4)

I think, the warnings for Lines 750 - 781 don't matter at all and can be
ignored, because it's just printf's/fprintf(stderr,....)'s

but what about this one :
mkcramfs.c:177: warning: passing arg 4 of `scandir' from incompatible pointer
type
?????

Line 177 is:
/* read in the directory and sort */
dircount = scandir(name, &dirlist, 0, cramsort);

I searched for scandir and found the declaration - but I have no clue, what this
means and how to interpret that.
Why does the error happen only with symlinks and not with normal files ?

sadly,I'm on war with pointers and all that stuff - last programming i did was
shell and some java....
(hey, i'm systems administrator - not programmer ;)))

Could someone please(please!) point me to some docs or give me some advice, how
to fix this problem ?
It will cost me weeks to find out, by myself, i think.....

cygwin:
int scandir (const char *__dir,
	     struct dirent ***__namelist,
	     int (*select) (const struct dirent *),
	     int (*compar) (const struct dirent **,const struct dirent **));


i compared that to my linux box:

linux:
extern int scandir (__const char *__restrict __dir,
		    struct dirent ***__restrict __namelist,
		    int (*__selector) (__const struct dirent *),
		    int (*__cmp) (__const void *, __const void *)) __THROW;

looks a little bit different.....

Thanks in advance 4 helping and best regards
Roland

References:
mkcramfs & sources: http://home.austarnet.com.au/paul1/vr/mkcramfs249.tar.gz
uncramfs & sources: http://agenda.fatcathk.com/romdisk/uncramfs-0.6.tar.gz


AUTHOR 1: I hear if you play the NT 4.0 CD backwards, you get a Satanic message.
AUTHOR 2: That's nothing. If you play it forward, it installs NT 4.0.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019