Mount RAM Disk in live-macOS
This commit is contained in:
parent
314675c32e
commit
72259303b9
3 changed files with 9 additions and 5 deletions
|
|
@ -13,10 +13,7 @@ from wk.io import non_clobber_path
|
|||
|
||||
|
||||
# STATIC VARIABLES
|
||||
if os.path.exists('/.wk-live-macos'):
|
||||
# Workaround for live macOS env
|
||||
DEFAULT_LOG_DIR = '/var/log/WizardKit'
|
||||
elif os.name == 'nt':
|
||||
if os.name == 'nt':
|
||||
# Example: "C:\WK\1955-11-05\WizardKit"
|
||||
DEFAULT_LOG_DIR = (
|
||||
f'{os.environ.get("SYSTEMDRIVE", "C:")}/'
|
||||
|
|
@ -25,7 +22,7 @@ elif os.name == 'nt':
|
|||
)
|
||||
else:
|
||||
# Example: "/home/tech/Logs"
|
||||
DEFAULT_LOG_DIR = f'{os.path.expanduser("~")}/Logs'
|
||||
DEFAULT_LOG_DIR = pathlib.Path('~/Logs').expanduser().resolve()
|
||||
DEFAULT_LOG_NAME = cfg.main.KIT_NAME_FULL
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,5 +12,11 @@ for p in /usr{/local/opt/{e2fsprogs,ruby,util-linux},/local,}/{bin,sbin}; do
|
|||
done
|
||||
export PATH
|
||||
|
||||
# Create and mount RAMDisk
|
||||
if ! [ -d /Volumes/RAM_Disk ]; then
|
||||
diskutil erasevolume HFS+ RAM_Disk $(hdiutil attach -nomount ram://524288)
|
||||
fi
|
||||
cd /Volumes/RAM_Disk
|
||||
|
||||
# Run cmd
|
||||
"$1"
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ cp -av /usr/bin/tput "${WK_DEV}"/usr/bin/
|
|||
|
||||
# WizardKit
|
||||
touch "${WK_DEV}"/.wk-live-macos
|
||||
ln -s /Volumes/RAM_Disk/Logs "${WK_DEV}"/var/root/Logs
|
||||
cp -av ../../images/macOS.png "${WK_DEV}"/usr/local/wallpaper.png
|
||||
rsync -ahvPS /usr/bin/{env,killall} "${WK_DEV}"/usr/bin/
|
||||
rsync -ahvPS live-macos-startup ../../scripts/ "${WK_DEV}"/usr/local/bin/
|
||||
|
|
|
|||
Loading…
Reference in a new issue