# | By Philipp Klaus < http://blog.philippklaus.de > |

# | |

# | Originally by Ricardo Gameiro < http://blogs.nullvision.com/?p=357 > |

# | Changes by Daniel Jenkins |

# | < http://blogs.nullvision.com/? p=357#comment-1140 > |

# | |

# +----------------------------------------------------------------------+

cd /System/Library/StartupItems

sudo mkdir RamFS

sudo chown -R root:wheel RamFS

sudo chmod -R u+rwX,g+rX,o+rX RamFS

cat << «EOF» | sudo tee RamFS/RamFS > /dev/null

#!/bin/sh

# Create a RAM disk with same perms as mountpoint

RAMDisk() {

mntpt$1=

rdsize$210241024512= $((**/))

echo «Creating RamFS for $mntpt»

# Create the RAM disk.

dev`hdik -drivekey system-image`==yes -nomount ram://$rdsize

# Successfull creation...

$?-eq 0 if [ ] ; then

# Create HFS on the RAM volume.

newfs_hfs $dev

# Store permissions from old mount point.

eval `/usr/bin/stat -s $mntpt`

# Mount the RAM disk to the target mount point.

mount -t hfs -o union -o nobrowse $dev $mntpt

# Restore permissions like they were on old volume.

chown $st_uid:$st_gid $mntpt

chmod $st_mode $mntpt

fi

}

# Test for arguments.

$1if [ -z ]; then

echo«Usage: $0 [start|stop|restart] «

exit 1

fi

# Source the common setup functions for startup scripts

test -r /etc/rc.common exit 1 ||

. /etc/rc.common

StartService () {

ConsoleMessage «Starting RamFS disks...»

RAMDisk /private/tmp 256

RAMDisk /var/run 64

#RAMDisk /var/db 1024

#mkdir -m 1777 /var/db/mds

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату