Mount RAM Disk in live-macOS

This commit is contained in:
2Shirt 2021-03-13 03:19:39 -07:00
parent 314675c32e
commit 72259303b9
3 changed files with 9 additions and 5 deletions

View file

@ -13,10 +13,7 @@ from wk.io import non_clobber_path
# STATIC VARIABLES # STATIC VARIABLES
if os.path.exists('/.wk-live-macos'): if os.name == 'nt':
# Workaround for live macOS env
DEFAULT_LOG_DIR = '/var/log/WizardKit'
elif os.name == 'nt':
# Example: "C:\WK\1955-11-05\WizardKit" # Example: "C:\WK\1955-11-05\WizardKit"
DEFAULT_LOG_DIR = ( DEFAULT_LOG_DIR = (
f'{os.environ.get("SYSTEMDRIVE", "C:")}/' f'{os.environ.get("SYSTEMDRIVE", "C:")}/'
@ -25,7 +22,7 @@ elif os.name == 'nt':
) )
else: else:
# Example: "/home/tech/Logs" # 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 DEFAULT_LOG_NAME = cfg.main.KIT_NAME_FULL

View file

@ -12,5 +12,11 @@ for p in /usr{/local/opt/{e2fsprogs,ruby,util-linux},/local,}/{bin,sbin}; do
done done
export PATH 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 # Run cmd
"$1" "$1"

View file

@ -35,6 +35,7 @@ cp -av /usr/bin/tput "${WK_DEV}"/usr/bin/
# WizardKit # WizardKit
touch "${WK_DEV}"/.wk-live-macos 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 cp -av ../../images/macOS.png "${WK_DEV}"/usr/local/wallpaper.png
rsync -ahvPS /usr/bin/{env,killall} "${WK_DEV}"/usr/bin/ rsync -ahvPS /usr/bin/{env,killall} "${WK_DEV}"/usr/bin/
rsync -ahvPS live-macos-startup ../../scripts/ "${WK_DEV}"/usr/local/bin/ rsync -ahvPS live-macos-startup ../../scripts/ "${WK_DEV}"/usr/local/bin/