- This topic has 9 replies, 5 voices, and was last updated 15 years, 1 month ago by
thomasb.
-
AuthorPosts
-
February 2, 2010 at 9:34 am #377925
toppmac
ParticipantHi,
I am a newbie with instadmg and scripting. But I want to create an image with us as language with Norwegian keyboard layout.
I have made a beta image, but I’m struggling with the keyboard layout. Can anyone help me with this?
February 2, 2010 at 11:20 am #377929alantrewartha
Participantthis topic
[url]https://www.afp548.com/forum/viewtopic.php?showtopic=22278[/url]
might be of help
February 2, 2010 at 11:25 am #377930toppmac
ParticipantHi,
I have seen on this topic, and tried to create a script from these suggestions, but i can not get it to work. Does anyone have it fixed and want to share it with a newbie:) Or show me the right way to do it.
February 2, 2010 at 1:45 pm #377931alantrewartha
Participantthe script i posted on there definitely does work to regionalise as British as part of a PKG postflight script. so you can adapt that. the Norwegian keyboard ID is 12. you can see this by changing the input source manually for a user and inspecting the contents of ~/Library/Preferences/ByHost/com.apple.HIToolbox.[GUID].plist
HTH
February 8, 2010 at 12:02 pm #377958hetjan
ParticipantI’m having the same experience. If I understand the way Mac OS X works this method will work for each individual user but the login window will still be using the US keyboard…
February 15, 2010 at 11:33 pm #377980thomasb
ParticipantI find it safer and easier to just set all the initial settings the way I want them by hand, clean/modify the plist files with [b]Property List Editor[/b] and then install them with package installers. Scripting plist files with PlistBuddy/defaults can be a pain in the neck, and you will need to create the plist-files first anyway to be able to figure out how to create them with scripts.
I just uploaded an example package (Localization-100210) to the [url=https://www.afp548.com/filemgmt/viewcat.php?cid=12][b]User submitted[/b][/url] category here at AFP548.com – I guess it will show up soon. It should help you get the desired language and keyboard layout over the login window and for every new user account.
This tip will come in handy for editing those annoying .GlobalPreferences files: [url=http://www.macosxhints.com/article.php?story=20090915152215383]http://www.macosxhints.com/article.php?story=20090915152215383[/url]
I have a separate package for setting the NTP server(s) and timezone, which I guess I could have included in my localization package, but not this time. See this thread for more info on how to make an NTP/timezone package: [url=https://www.afp548.com/forum/viewtopic.php?forum=45&showtopic=21477]https://www.afp548.com/forum/viewtopic.php?forum=45&showtopic=21477[/url]
A lot of settings can be set using Local MCX too, which is an other interesting approach, but I feel Apple is lagging behind in terms of keeping Workgroup Manager up to date with new settings in Snow Leopard (i.e. Finder preferences). Since this localization package requires you to modify and install plist-files for both root, global Library and home Library, I find it easier to make a separate package for that purpose alone.
Good luck!
February 17, 2010 at 12:51 am #377990thomasb
ParticipantHere is the [url=http://thomasberglund.no/misc/Localization-100210.zip]Localization[/url] package example, for those of you waiting.
February 17, 2010 at 1:27 pm #377996umd
Participantthanks for sharing the package!!!!
But couldn’t be it a problem to install foreign UUID (for example the ByHost plists) on to other machines?
maybe it is an alternativ to combine the package with a script running at the first boot renaming those plists files?
February 17, 2010 at 4:54 pm #377999thomasb
ParticipantYes, you need to rename the ByHost files. If you are using DeployStudio, the checkbox for renaming ByHost files is checked by default.
If you want to make your own script to run on first boot with a LaunchDaemon, you can easily do that too.
March 11, 2010 at 2:49 pm #378174thomasb
ParticipantA little followup. Here is the script I use to rename byhost files for User Template and the root user at first boot (launched by a LaunchDaemon).
[code]#!/bin/sh
#
# This script will rename ByHost files
#
# Thomas Berglund, 09.12.08
# Thanks to hostdog74 at the unix.com forum for the directory traversing pseudocode 🙂# Make sure script is run by root user
if [ “$(id -u)” != “0” ] ; then
echo “This script must be run by root user.” 1>&2
exit 1
fi# Get the Universally Unique Identifier (UUID)
# ioreg commands found in a comment at https://www.afp548.com/article.php?story=leopard_byhost_changes
#
# Check if hardware is PPC or early Intel
if [[ `ioreg -rd1 -c IOPlatformExpertDevice | grep -i “UUID” | cut -c27-50` == “00000000-0000-1000-8000-” ]]; then
LEOUUID=`ioreg -rd1 -c IOPlatformExpertDevice | grep -i “UUID” | cut -c51-62 | awk {‘print tolower()’}`# Check if hardware is new Intel
elif [[ `ioreg -rd1 -c IOPlatformExpertDevice | grep -i “UUID” | cut -c27-50` != “00000000-0000-1000-8000-” ]]; then
LEOUUID=`ioreg -rd1 -c IOPlatformExpertDevice | grep -i “UUID” | cut -c27-62`
fi# Path to localized home directories
dirPath=”/System/Library/User Template”# Find all ByHost direcotries
find “${dirPath}” -name “ByHost” | while read BYHOST
do
# Find all .plist files in ByHost directories
find “${BYHOST}” -type f -name “*.plist” | while read file
do
# Make new filename with new UUID
newName=”`echo ${file} | sed “s/\(.*\)\.[^\.]*.plist/\1.${LEOUUID}.plist/”`”# Rename files
mv “${file}” “${newName}”
done
done# Path to root directory
dirPath2=”/private/var/root”# Find all ByHost direcotries
find “${dirPath2}” -name “ByHost” | while read BYHOST
do
# Find all .plist files in ByHost directories
find “${BYHOST}” -type f -name “*.plist” | while read file
do
# Make new filename with new UUID
newName=”`echo ${file} | sed “s/\(.*\)\.[^\.]*.plist/\1.${LEOUUID}.plist/”`”# Rename files
mv “${file}” “${newName}”
done
done[/code] -
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed