13GB NetBoot image?

ToriAnneke
Contributor II

Hi all,

I just made a brand new NetBoot image of 10.7.4 and after the build it's almost 13GBs
Trashed most of the apps and utilities, ran monolingual also ... but wow 13GB !!!

Used the latest method as described in Casper NetBoot Automator Action 1.1
Anyone made a slimmed down low-fat netboot ?

My previous 10.6.x netboot images were about 3.9 GBs

thanks in advance.

1 ACCEPTED SOLUTION

jhbush
Valued Contributor II

I kill off the hidden swap file from a 13GB file and that takes it down to 5-6GB. Still not as good as DS, but better.

View solution in original post

22 REPLIES 22

CasperSally
Valued Contributor II

My 10.7 netboot images are 11 gigs I think. It doesn't take any longer to boot than the smaller netinstall, though.

jwojda
Valued Contributor II

my understanding is that it still only pulls across the wire the chunks that are needed. so if it only needs 4 of the 13gig, it only pulls that 4... The only thing the larger size does is take up space on the server.

ToriAnneke
Contributor II

Ok .. cool. .i thought I was doing something wrong ... but, yeah it does boot just as fast as my slimmed down 10.6.x

Thanks!
-p

mm2270
Legendary Contributor III

Yes, it only pulls down the boot files and some other pieces it needs locally and the rest it will read off the server. But, it is astonishing that even a slimmed down Lion install can take up from 11 to 13 GBs of disk space. I imagine Mountain Lion will only be bigger.

andyinindy
Contributor II

I really wish that the Casper netboot creator/automator action created a bare bones netboot image, along the lines of what DeployStudio does. My DS netboot images are around 2GB on average, and are created & configured quickly and automatically using their setup assistant. The process of creating a Casper netboot image is archaic in comparison; takes forever, lots of manual tweaks, not really Lion compatible, etc. Maybe you guys could buy the DeployStudio project and integrate it into your imaging approach? Please?

</rant>

timsutton
Contributor
Maybe you guys could buy the DeployStudio project and integrate it into your imaging approach? Please?

DeployStudio's Runtime builder is a shell script, user-visible like all their other shell scripts that perform most of the actual workflow tasks. So, how their Runtime gets built is no secret. People have long been modifying rolling their own Runtime NBIs by using modified versions of the sys_builder.sh script.

jhbush
Valued Contributor II

I kill off the hidden swap file from a 13GB file and that takes it down to 5-6GB. Still not as good as DS, but better.

ToriAnneke
Contributor II

Yep.. just as jhbush said..

I killed it and it shrunk down to 4.9GB

Thanks!!

barnesaw
Contributor III

If space on your netboot server is so tight that a 13 GB file (versus a 2GB) is such an issue, you need to go out and buy a hard drive. A 13 GB Casper nbi boots no slower than a 2 GB DS nbi, and it is infinitely more useful since it's an actual operating system that can be used for more than barebones troubleshooting.

Personally, I couldn't abandon DS fast enough. I'll spend 50 bucks on a new hard drive to not have to use that waste of time.

jhbush
Valued Contributor II

barnesaw, it's not the space it's the 6GB of data that the machine has to pull down to boot up. My other issue is that I have sites around the world with small pipes and transferring 6GB vs 13GB is a big deal to me. Some people have mentioned on here that the machine only pulls down what it needs and the size doesn't matter. My testing here shows otherwise.

Sonic84
Contributor III

theres a lot of stuff you can remove to make your netboot a lot smaller. The one I use is Mac OS X 10.7.4 and is a ~1.5GB compressed dmg. It's only for using Casper Imaging, web access, and basic troubleshooting.... I've got to keep it tiny because it's being shared with sites using DSL. A 13GB nbi would saturate their pipe for days.

stuff to remove: apps/Utilities you don't need
extra languages and old frameworks (Use Monolingual.app like you mentioned )
system stuff (like those control panel videos...)
Desktop wallpapers, voices, user icons, fonts, the list goes on. also, before you capture the image, be sure to delete the swapfile and the sleepstate.

here is a list of files I delete before capturing a netboot image. Hope this helps!

/Library/Updates/*
/Library/Application Support/CrashReporter/*
/Library/QuickLook/iWork.qlgenerator
/private/var/db/dyld/*
/private/var/folders/*
/usr/share/man/*
/usr/share/emacs
/usr/share/vim
/usr/share/gutenprint
/usr/share/cups
/usr/share/doc
/usr/lib/mecab/dic
/System/Library/Address Book Plug-Ins/*
/System/Library/Automator/*
/System/Library/Speech/*
/System/Library/Fonts/STHeiti Light.ttc
/System/Library/Fonts/AquaKana.ttc
/System/Library/Fonts/AppleGothic.ttf
/System/Library/Fonts/LastResort.ttf
/System/Library/Fonts/Menlo.ttc
/System/Library/Fonts/Courier.dfont
/System/Library/Fonts/?????? ProN W3.otf
/System/Library/Fonts/?????? ProN W6.otf
/System/Library/Fonts/?????? ProN W3.otf
/System/Library/Fonts/?????? ProN W6.otf
/System/Library/Fonts/?? Pro.ttf
/System/Library/Fonts/????.ttf
/System/Library/Fonts/????.ttf
/System/Library/User Template/*
/System/Library/Caches/*
/System/Library/Screen Savers/Forest.slideSaver
/System/Library/Screen Savers/iTunes Artwork.saver
/System/Library/Screen Savers/Nature Patterns.slideSaver
/System/Library/Screen Savers/Paper Shadow.slideSaver
/System/Library/Screen Savers/Random.saver
/System/Library/Screen Savers/RSS Visualizer.qtz
/System/Library/Screen Savers/Arabesque.qtz
/System/Library/Screen Savers/Word of the Day.qtz
/System/Library/Screen Savers/Shell.qtz
/System/Library/Screen Savers/Spectrum.qtz
/System/Library/Screen Savers/Abstract.slideSaver
/System/Library/Screen Savers/Beach.slideSaver
/System/Library/Screen Savers/Cosmos.slideSaver
/System/Library/Screen Savers/FloatingMessage.saver
/System/Library/CoreServices/"Setup Assistant.app"/Contents/Resources/TransitionSection.bundle/Contents/Resources/intro.mov
/System/Library/CoreServices/"Setup Assistant.app"/Contents/Resources/TransitionSection.bundle/Contents/Resources/intro-sound.mp3
/System/Library/CoreServices/Front Row.app
/System/Library/CoreServices/RawCamera.bundle
/System/Library/CoreServices/Menu Extras/TextInput.menu
/System/Library/CoreServices/Menu Extras/WWAN.menu
/System/Library/CoreServices/Menu Extras/Sync.menu
/System/Library/CoreServices/Menu Extras/HomeSync.menu
/System/Library/CoreServices/Menu Extras/TimeMachine.menu
/System/Library/CoreServices/Menu Extras/Fax.menu
/System/Library/CoreServices/Menu Extras/iChat.menu
/System/Library/CoreServices/Menu Extras/Script Menu.menu
/System/Library/CoreServices/Menu Extras/IrDA.menu
/System/Library/CoreServices/Menu Extras/RemoteDesktop.menu
/System/Library/CoreServices/Menu Extras/PPP.menu
/System/Library/CoreServices/Menu Extras/VPN.menu
/System/Library/CoreServices/Menu Extras/UniversalAccess.menu
/System/Library/CoreServices/Menu Extras/Spaces.menu
/System/Library/CoreServices/Menu Extras/PPPoE.menu
/System/Library/CoreServices/Menu Extras/ExpressCard.menu
/System/Library/CoreServices/Menu Extras/Ink.menu
/usr/X11
/usr/libexec/cups
/usr/lib/podcastproducer
/System/Library/Input Methods/CharacterPalette.app
/System/Library/Input Methods/ChineseHandwriting.app
/System/Library/Input Methods/InkServer.app
/System/Library/Input Methods/50onPaletteServer.app
/System/Library/Input Methods/KoreanIM.app
/System/Library/Input Methods/Kotoeri.app
/System/Library/Input Methods/PluginIM.app
/System/Library/Input Methods/SCIM.app
/System/Library/Input Methods/TamilIM.app
/System/Library/Input Methods/TCIM.app
/System/Library/Input Methods/VietnameseIM.app
/System/Library/PreferencePanes/MobileMe.prefPane
/System/Library/PreferencePanes/TimeMachine.prefPane
/System/Library/PreferencePanes/Expose.prefPane
/System/Library/PreferencePanes/Ink.prefPane
/System/Library/PreferencePanes/Spotlight.prefPane
/System/Library/PreferencePanes/FibreChannel.prefPane
/System/Library/PreferencePanes/SoftwareUpdate.prefPane
/System/Library/PreferencePanes/Mac.prefPane
/System/Library/PreferencePanes/Trackpad.prefPane/Contents/Resources/BTTrackpad.mov
/System/Library/PreferencePanes/Trackpad.prefPane/Contents/Resources/ButtonlessTrackpadCombo.mov
/System/Library/PreferencePanes/Trackpad.prefPane/Contents/Resources/TrackpadCombo.mov
/System/Library/PreferencePanes/Mouse.prefPane/Contents/Resources/touchMovie.mov
/System/Library/CoreServices/Encodings/*
/System/Library/Frameworks/XgridFoundation.framework
/private/var/log/*
/Library/Internet Plug-Ins/NP-PPC-Dir-Shockwave
/Library/Internet Plug-Ins/flashplayer.xpt
/Library/Internet Plug-Ins/Flash Player.plugin
/Library/Perl
/Library/Receipts/*
/usr/bin/php
/Library/Application Support/CrashReporter
/Library/Application Support/iLifeMediaBrowser
/Library/Application Support/Macromedia
/Library/Application Support/ProApps
/Library/Audio/*
/Library/Desktop Pictures/.DS_Store
/Library/Desktop Pictures/.thumbnails
/Library/Desktop Pictures/Abstract
/Library/Desktop Pictures/Aqua Blue.jpg
/Library/Desktop Pictures/Aqua Graphite.jpg
/Library/Desktop Pictures/Art
/Library/Desktop Pictures/Black & White
/Library/Desktop Pictures/Classic Aqua Blue.jpg
/Library/Desktop Pictures/Classic Aqua Graphite.jpg
/Library/Desktop Pictures/Flow 1.jpg
/Library/Desktop Pictures/Flow 2.jpg
/Library/Desktop Pictures/Flow 3.jpg
/Library/Desktop Pictures/Jaguar Aqua Blue.jpg
/Library/Desktop Pictures/Jaguar Aqua Graphite.jpg
/Library/Desktop Pictures/Lines Blue.jpg
/Library/Desktop Pictures/Lines Graphite.jpg
/Library/Desktop Pictures/Lines Moss.jpg
/Library/Desktop Pictures/Lines Plum.jpg
/Library/Desktop Pictures/Nature
/Library/Desktop Pictures/Panther Aqua Blue.jpg
/Library/Desktop Pictures/Panther Aqua Graphite.jpg
/Library/Desktop Pictures/Patterns
/Library/Desktop Pictures/Plants
/Library/Desktop Pictures/Ripples Blue.jpg
/Library/Desktop Pictures/Ripples Moss.jpg
/Library/Desktop Pictures/Ripples Purple.jpg
/Library/Desktop Pictures/Small Ripples graphite.png
/Library/Desktop Pictures/Small Ripples.png
/Library/Desktop Pictures/Solid Colors
/Library/Desktop Pictures/Tiles Blue.jpg
/Library/Desktop Pictures/Tiles Pine.jpg
/Library/Desktop Pictures/Tiles Warm Grey.jpg
/Library/Developer/*
/Library/Dictionaries/*
/Library/Documentation/*
/Library/Fonts/*
/Library/iTunes
/Library/Logs
/Library/Modem Scripts
/Library/PDF Services
/Library/Scripts
/Library/Spotlight
/Library/User Pictures/Animals
/Library/User Pictures/Flowers
/Library/User Pictures/Fun
/Library/User Pictures/Instruments
/Library/User Pictures/Nature
/Library/User Pictures/Sports/Bowling.tif
/Library/User Pictures/Sports/Football.tif
/Library/User Pictures/Sports/Golf.tif
/Library/User Pictures/Sports/Hockey.tif
/Library/User Pictures/Sports/Soccer.tif
/Library/User Pictures/Sports/Target.tif
/Library/User Pictures/Sports/Tennis.tif
/Library/User Pictures/Sports/8ball.tif
/Library/User Pictures/Sports/Baseball.tif
/Library/WebServer/*
/Library/Widgets/*
/usr/bin/emacs
/usr/bin/emacs-undumped
/System/Library/Speech/*
/Library/Application Support/Apple/Mail
/Library/Application Support/Apple/Grapher
/Library/Application Support/Apple/System Image Utility
/Library/Application Support/Apple/Fonts
/Library/Application Support/Apple/iChat Icons
/Library/Application Support/Apple/Automator
/Library/Application Support/Apple/WikiServer
/Library/Printers/*
/Library/Image Capture/*
/Library/Desktop Pictures/*

/Applications/Address Book.app
/Applications/Automator.app
/Applications/Calculator.app
/Applications/Chess.app
/Applications/Dashboard.app
/Applications/Dictionary.app
/Applications/DVD Player.app
/Applications/FaceTime.app
/Applications/Font Book.app
/Applications/iCal.app
/Applications/iChat.app
/Applications/Image Capture.app
/Applications/iTunes.app
/Applications/Launchpad.app
/Applications/Mission Control.app
/Applications/Photo Booth.app
/Applications/QuickTime Player.app
/Applications/Stickies.app
/Applications/Time Machine.app
/Applications/Mail.app
/Applications/Utilities/AirPort Utility.app
/Applications/Utilities/AppleScript Editor.app
/Applications/Utilities/Audio MIDI Setup.app
/Applications/Utilities/Bluetooth File Exchange.app
/Applications/Utilities/Boot Camp Assistant.app
/Applications/Utilities/ColorSync Utility.app
/Applications/Utilities/DigitalColor Meter.app
/Applications/Utilities/Grab.app
/Applications/Utilities/Grapher.app
/Applications/Utilities/Migration Assistant.app
/Applications/Utilities/Podcast Capture.app
/Applications/Utilities/Podcast Publisher.app
/Applications/Utilities/RAID Utility.app
/Applications/Utilities/VoiceOver Utility.app
/Applications/Utilities/X11.app

/System/Library/Caches/*
/Library/Caches/*
/private/var/vm/sleepimage
/private/var/vm/swapfile*

gachowski
Valued Contributor II

Jeff,

Thank you ver much!!! I am in the same boat!!!!

C

matt4836
Contributor II

Note to all, if you attempt to delete all those files...Do it AFTER you create the NBI. Mount the .DMG file from your NBI then delete the files. Your DMG can then be compressed using Disk Utility. I was able to get mine down to 2.2GB as well. Didn't make the net boot process much faster but it is more portable (copying to the server and so forth).

franton
Valued Contributor III

Nice job! I'll be trying this tomorrow!

franton
Valued Contributor III

I've automated this for 10.8. Here's a very rough v.1 of the script.

#!/bin/bash

# Very unsophisticated script to trim down a Casper NetBoot.dmg file inside a .nbi folder
# Author  : r.purves@arts.ac.uk
# Version : 1.0 - Initial Version

# REQUIRES that the NetBoot.dmg file inside the .nbi file be mounted before use!
# REQUIRES that the NetBoot.dmg have the volume name of "Macintosh HD 1"

# Start by setting up the array variable to hold all the files and folders we're going to delete

delete[0]="/Library/Preferences/SystemConfiguration/preferences.plist"
delete[1]="/Library/Updates/*"
delete[2]="/Library/Updates/*"
delete[3]="/Library/Application Support/CrashReporter/*"
delete[4]="/Library/QuickLook/*"
delete[5]="/private/var/db/dyld/*"
delete[6]="/usr/share/man/*"
delete[7]="/usr/share/emacs"?
delete[8]="/usr/share/vim"
delete[9]="/usr/share/cups"
delete[10]="/usr/share/doc"
delete[11]="/System/Library/Address Book Plug-Ins/*"
delete[12]="/System/Library/Automator/*"
delete[13]="/System/Library/Speech/*"
delete[14]="/System/Library/User Template/*"
delete[15]="/System/Library/Caches/*"
delete[16]="/System/Library/Screen Savers/*"
delete[17]="/System/Library/CoreServices/RawCamera.bundle"
delete[18]="/usr/X11/*"
delete[19]="/usr/libexec/cups/*"
delete[20]="/System/Library/Input Methods/CharacterPalette.app"
delete[21]="/System/Library/Input Methods/InkServer.app"
delete[22]="/System/Library/Input Methods/50onPaletteServer.app"
delete[23]="/System/Library/Input Methods/KoreanIM.app"
delete[24]="/System/Library/Input Methods/Kotoeri.app"
delete[25]="/System/Library/Input Methods/PluginIM.app"
delete[26]="/System/Library/Input Methods/SCIM.app"
delete[27]="/System/Library/Input Methods/TamilIM.app"
delete[28]="/System/Library/Input Methods/TCIM.app"
delete[29]="/System/Library/Input Methods/VietnameseIM.app"
delete[30]="/System/Library/CoreServices/Encodings/*"
delete[31]="/private/var/log/*"
delete[32]="/Library/Internet Plug-Ins/*"
delete[33]="/Library/Perl"
delete[34]="/Library/Receipts/*"
delete[35]="/usr/bin/php"
delete[36]="/Library/Application Support/CrashReporter"
delete[37]="/Library/Application Support/iLifeMediaBrowser"
delete[38]="/Library/Application Support/Macromedia"
delete[39]="/Library/Application Support/ProApps"
delete[40]="/Library/Audio/*"
delete[41]="/Library/Dictionaries/*"
delete[42]="/Library/Documentation/*"
delete[43]="/Library/iTunes/*"
delete[44]="/Library/Logs/*"
delete[45]="/Library/Modem Scripts/*"
delete[46]="/Library/PDF Services/*"
delete[47]="/Library/Scripts/*"
delete[48]="/Library/Spotlight/*"
delete[49]="/Library/User Pictures/*"
delete[50]="/Library/WebServer/*"
delete[51]="/Library/Widgets/*"
delete[52]="/usr/bin/emacs"
delete[53]="/usr/bin/emacs-undumped"
delete[54]="/Library/Application Support/Apple/Mail"
delete[55]="/Library/Application Support/Apple/Grapher"
delete[56]="/Library/Application Support/Apple/iChat Icons"
delete[57]="/Library/Application Support/Apple/Automator"
delete[58]="/Library/Printers/*"
delete[59]="/Library/Image Capture/*"
delete[60]="/private/var/vm/sleepimage"
delete[61]="/private/var/vm/swapfile*"

# Let's do the deleting!

# Calculate the length of the delete array.
# 61 when I created it. May have changed since.

tLen=${#delete[@]}

# Loop around the array and delete the files/folders.

for (( i=0; i<${tLen}; i++ ));
do
  echo "Now deleting /Volumes/Macintosh HD 1"${delete[$i]}
  rm -rf /Volumes/Macintosh HD 1${delete[$i]}
done

exit 0

technicholas
Contributor

THANKS! I will try this we have huge netboot files and I would like to see if this fixes our 4+ macbook pro netbooting issue.

technicholas
Contributor

franton, could you write a script that Sonic shared... that would be great would remove a lot of crap on our netboot files.

franton
Valued Contributor III

If I get a chance tomorrow, i'll post the latest version.

SeanA
Contributor III

thanks, franton.

msimpson
New Contributor

One minor thing I overlooked is that you can use Composer to create OS images. It automates most of the above for you (previously I'd been manually removing the swap file etc).

franton
Valued Contributor III
#!/bin/bash

# Very unsophisticated script to trim down a Casper NetBoot.dmg file inside a .nbi folder
# Author  : r.purves@arts.ac.uk
# Version : 1.0 - Initial Version

# REQUIRES that the NetBoot.dmg file inside the .nbi file be mounted before use!
# REQUIRES that the NetBoot.dmg have the volume name of "Macintosh HD 1"

# Start by setting up the array variable to hold all the files and folders we're going to delete

delete[0]="/Library/Preferences/SystemConfiguration/preferences.plist"
delete[1]="/Library/Updates/*"
delete[2]="/Library/Desktop Pictures/Antelope Canyon.jpg"
delete[3]="/Library/Desktop Pictures/Bahamas Aerial.jpg"
delete[4]="/Library/Desktop Pictures/Beach.jpg"
delete[5]="/Library/Desktop Pictures/Blue Pond.jpg"
delete[6]="/Library/Desktop Pictures/Bristle Grass.jpg"
delete[7]="/Library/Desktop Pictures/Brushes.jpg"
delete[8]="/Library/Desktop Pictures/Circles.jpg"
delete[9]="/Library/Desktop Pictures/Ducks on a Misty Pond.jpg"
delete[10]="/Library/Desktop Pictures/Eagle & Waterfall.jpg"
delete[11]="/Library/Desktop Pictures/Earth and Moon.jpg"
delete[12]="/Library/Desktop Pictures/Earth Horizon.jpg"
delete[13]="/Library/Desktop Pictures/Elephant.jpg"
delete[14]="/Library/Desktop Pictures/Flamingos.jpg"
delete[15]="/Library/Desktop Pictures/Floating Ice.jpg"
delete[16]="/Library/Desktop Pictures/Floating Leaves.jpg"
delete[17]="/Library/Desktop Pictures/Forest in Mist.jpg"
delete[18]="/Library/Desktop Pictures/Frog.jpg"
delete[19]="/Library/Desktop Pictures/Galaxy.jpg"
delete[20]="/Library/Desktop Pictures/Grass Blades.jpg"
delete[21]="/Library/Desktop Pictures/Hawaiian Print.jpg"
delete[22]="/Library/Desktop Pictures/Isles.jpg"
delete[23]="/Library/Desktop Pictures/Lake.jpg"
delete[24]="/Library/Desktop Pictures/Lion.jpg"
delete[25]="/Library/Desktop Pictures/Milky Way.jpg"
delete[26]="/Library/Desktop Pictures/Moon.jpg"
delete[27]="/Library/Desktop Pictures/Mt. Fuji.jpg"
delete[28]="/Library/Desktop Pictures/Pink Forest.jpg"
delete[29]="/Library/Desktop Pictures/Pink Lotus Flower.jpg"
delete[30]="/Library/Desktop Pictures/Poppies.jpg"
delete[31]="/Library/Desktop Pictures/Red Bells.jpg"
delete[32]="/Library/Desktop Pictures/Rice Paddy.jpg"
delete[33]="/Library/Desktop Pictures/Shapes.jpg"
delete[34]="/Library/Desktop Pictures/Sky.jpg"
delete[35]="/Library/Desktop Pictures/Snow.jpg"
delete[36]="/Library/Desktop Pictures/Zebras.jpg"
delete[37]="/Library/Desktop Pictures/Solid Colours/*"
delete[38]="/Library/Application Support/CrashReporter/*"
delete[39]="/Library/QuickLook/*"
delete[40]="/private/var/db/dyld/*"
delete[41]="/usr/share/man/*"
delete[42]="/usr/share/emacs"?
delete[43]="/usr/share/vim"
delete[44]="/usr/share/cups"
delete[45]="/usr/share/doc"
delete[46]="/System/Library/Address Book Plug-Ins/*"
delete[47]="/System/Library/Automator/*"
delete[48]="/System/Library/Speech/*"
delete[49]="/System/Library/User Template/*"
delete[50]="/System/Library/Caches/*"
delete[51]="/System/Library/Screen Savers/*"
delete[52]="/System/Library/CoreServices/RawCamera.bundle"
delete[53]="/usr/X11/*"
delete[54]="/usr/libexec/cups/*"
delete[55]="/System/Library/Input Methods/CharacterPalette.app"
delete[56]="/System/Library/Input Methods/InkServer.app"
delete[57]="/System/Library/Input Methods/50onPaletteServer.app"
delete[58]="/System/Library/Input Methods/KoreanIM.app"
delete[59]="/System/Library/Input Methods/Kotoeri.app"
delete[60]="/System/Library/Input Methods/PluginIM.app"
delete[61]="/System/Library/Input Methods/SCIM.app"
delete[62]="/System/Library/Input Methods/TamilIM.app"
delete[63]="/System/Library/Input Methods/TCIM.app"
delete[64]="/System/Library/Input Methods/VietnameseIM.app"
delete[65]="/System/Library/CoreServices/Encodings/*"
delete[66]="/private/var/log/*"
delete[67]="/Library/Internet Plug-Ins/*"
delete[68]="/Library/Perl"
delete[69]="/Library/Receipts/*"
delete[70]="/usr/bin/php"
delete[71]="/Library/Application Support/CrashReporter"
delete[72]="/Library/Application Support/iLifeMediaBrowser"
delete[73]="/Library/Application Support/Macromedia"
delete[74]="/Library/Application Support/ProApps"
delete[75]="/Library/Audio/*"
delete[76]="/Library/Dictionaries/*"
delete[77]="/Library/Documentation/*"
delete[78]="/Library/iTunes/*"
delete[79]="/Library/Logs/*"
delete[80]="/Library/Modem Scripts/*"
delete[81]="/Library/PDF Services/*"
delete[82]="/Library/Scripts/*"
delete[83]="/Library/Spotlight/*"
delete[84]="/Library/User Pictures/*"
delete[85]="/Library/WebServer/*"
delete[86]="/Library/Widgets/*"
delete[87]="/usr/bin/emacs"
delete[88]="/usr/bin/emacs-undumped"
delete[89]="/Library/Application Support/Apple/Mail"
delete[90]="/Library/Application Support/Apple/Grapher"
delete[91]="/Library/Application Support/Apple/iChat Icons"
delete[92]="/Library/Application Support/Apple/Automator"
delete[93]="/Library/Printers/*"
delete[94]="/Library/Image Capture/*"
delete[95]="/private/var/vm/sleepimage"
delete[96]="/private/var/vm/swapfile*"

# Let's do the deleting!

# Calculate the length of the delete array.
# 61 when I created it. 96 now. May have changed since.

tLen=${#delete[@]}

# Loop around the array and delete the files/folders.

for (( i=0; i<${tLen}; i++ ));
do
  echo "Now deleting /Volumes/Macintosh HD 1"${delete[$i]}
  rm -rf /Volumes/Macintosh HD 1${delete[$i]}
done

exit 0

That's the latest cleaner script. It relies heavily on you having already built your .nbi image AND it being given a specific volume name. It won't take much to modify it for anyone else's needs. Cleaning is ALL it does at present!

Code itself is simple. Just a big array variable with all the folder/files to be deleted which it does one by one and then quits. It's up to yourself to compress the .dmg and insert it back into the .nbi but this is a fairly trivial task. I'm sure it could be automated further but sadly I have an Xserve that's unwell at the moment.

mcooper
New Contributor III

Richard, I copied your script, mounted my dmg from the NBI with the name Macintosh HD 1, but any line that has a directory or file with a space doesn't delete.

An example; delete[27]="/Library/Desktop Pictures/Mt. Fuji.jpg" does not delete. I've tried delete[27]="/Library/Desktop Pictures/Mt. Fuji.jpg" and delete[27]="/Library/Desktop Pictures/Mt. Fuji.jpg" as well. Any help would be appreciated