[klibc] ramfs to tmpfs

Luciano Miguel Ferreira Rocha strange at nsk.no-ip.org
Tue Oct 3 15:49:45 PDT 2006

Well, I've completed my ramfs2tmpfs, with the help of buffer-format.txt,
a GNU's cpio generated file and some looks at your code.

The utility now:

1. creates a tmpfs for the new root (if / isn't alread a tmpfs)

2. unpacks /*.co (cpio), /*.cgz (cpio | gzip) and /*.cbz2 (cpio | bzip2)

3. moves all remaining files from / to the new tmpfs (again, if
   / isn't already a tmpfs)

4. executes the new init (from command-line or one in the standard

The code is licensed under the same license of runinitlib.c, and most of
the other files in klibc.

Input files for unpacking are limited to mmap and off_t.

For compiling w/o bzlib:
klcc -DBZ_NO_STDIO -o btfs *.c -s

For compiling w/ bzlib:

1. get from bzip2 sources:
  blocksort.c bzlib.c bzlib.h bzlib_private.h compress.c decompress.c \
  crctable.c huffman.c randtable.c 

2. change line 124 of bzlib_private.h:
  #define AssertH(cond,errcode) \
   { if (!(cond)) bz_internal_error ( errcode ); }
  #define AssertH(cond,errcode)

3. compile:
  klcc -DBZ_NO_STDIO -o btfs *.c -s

Luciano Rocha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: btfs.tar.gz
Type: application/x-tar-gz
Size: 73973 bytes
Desc: not available
Url : http://www.zytor.com/pipermail/klibc/attachments/20061003/60d9489f/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.zytor.com/pipermail/klibc/attachments/20061003/60d9489f/attachment-0003.bin 

More information about the klibc mailing list