Jump to content

Nouveau script d'install (sans install prealable os x) ?


19 posts in this topic

Recommended Posts

HELP := j'aurais besoin de quelqu'un pour definir les kext à mettre en place pour une install PARFAITE (et pas qu'en apparence)

 

Explication : je fais des test sur os x server, j'ai eu des soucis (resolu) avec le ionetworkingfamilly ... donc pas cool. J'ai une dissimétrie entre copie sur serveur ou depuis le serveur vs 10,5,2 (imac->serveur 27Mo/s ET serveur->imac = 52Mo/s)

 

Mon serveur dispose d'un raid0 (4*320go) De plus depuis les test sur du 10,5,3 le raid ne fait plus du 130Mo/s mais uniquement du 99Mo/s ...

 

En cause ? .... surement les kext employés !!!

 

LES SCRIPT = Il est fini à 98%

 

il s'agit d'une méthode pc_efi + retail en ayant juste besoin de :

 

-stick usb (8gb) ou hd externe usb/fw ou montage réseau si dispo

-pack LS8v11 ou LTL (gros boulot merci à eux) à mettre à la racine de ce stick ou hd externe

- et copier les outils suivant dans le répertoire /tools de ce stick ou disque ext. : open installer et vi et efistudio

 

Donc :

 

vous devez prendre le pack LS8 ou LTL (dispo sur le forum en lien)

puis ajouter à l'arborescence de ce pack (une fois décompressé)

à la racine donc :

/tools

dedans copiez : vi open installer efistudio clear (ils sont dispo sur un mac sous /usr/bin /usr/sbin ou /sbin ) # clear semble ne pas fonctionner en mode live DVD (kalyway 10,5,2 en tout cas)

 

/combo_update

dedans copiez : MacOSXComboUpdate10.5.x .... .dmg

 

/retail_dvd

dedans placez : votre dvd original d'install MAIS en image .dmg dedans (a vous de la faire, non mais ... ;-) )

 

Et enfin copiez ce script à la racine , au meme niveau que post-install.sh et pre-install.sh ... etc (en fait ce script permet de ce substituer à ces deux scripts)

 

Placez le tout sur une clef usb , un disque dur externe usb ou sur un partage réseau montable depuis le DVD live de kalyway ...

 

Bootez sur le dvd d'install kaliway , puis brancher votre stick ou disque usb .... puis ouvre un terminal ...

ensuite lancez ce script ... ./install.vx.x.x.Xsh

 

##### LIVE INFO ####

 

Il tourne assez bien a vous de tester ....

et m'aider sur les kext .

 

 

#!/bin/bash

# Author : coucou
# Script usefull for INSTALL/UPDATE using EFI and RETAIL
# v0.0.3
# This script use the LS8 pack for kext etc ... (big app for him and the other dev.)
# use at your own risk, i'm not responsible of any damage to your computer
# MAKE BACKUP BEFORE use ...

# Why rewritting again and again this kind script ?
# because all script are made for people already
# having OS X x86 working ... this is for fresh install with nothing else than :

# - bootable KALYWAY or leo4ALL DVD [ i call them Live DVD os OS X hihihi;-) ]
# - ANY MEDIA containing this pack AND your OS X (server or workstation) RETAIL .dmg + ComboUpdate .dmg [usb stick, hard drive, Network share etc ...]

# ... and a bunch of kext and hdd ...;-)

# TODO
# 1 - REBUILD DMG DVD avec le menu voir comment est contruit le kalyway 10.5.2
# 2 - verifiy the presence of each tool used in this script (diskutil etc ...)
# debug ,  mac adresse : serversetup -getMacAddress  (ou listallhardwareports)  $ sudo networksetup -getmacaddress (devicename|"portname")

# Let's GO !!!

###################### GLOBAL VAR ########################

# Installation informations
#  /Volumes required
DESTINATION_VOL=""
INSTALL_SOURCE_VOL=""

###################### FUNCTIONS HERE #####################

# Launch Disk Utility in order to partitionning hard drives manually
diskPart()
{
# TODO auto partitionning of the desired Volume with : diskutil (but caution, dangerous) 
open "/Applications/Utilities/Disk Utility.app"
}

# Launch EfiStudio app 
efiStudio()
{
open "/Volumes/${INSTALL_SOURCE_VOL}/tools/EFIStudio.app"
}

# Install pc_efi_vx on your choosen disk
installPcEfi()
{
# This installs PC EFI Vxx automatically.

PC_EFI_PATH=""
#testing presence of correct PC EFI INSTALL_SOURCE files ( testing "pc_efi_v80" directory)
if [ -d "/Volumes/${INSTALL_SOURCE_VOL}/pc_efi_v80" ]
then
	# PC EFI Working paths can be set ('cause exist)
	PC_EFI_PATH="/Volumes/${INSTALL_SOURCE_VOL}/pc_efi_v80"
else
	echo "Cannot locate PC EFI install files directory, bye bye."
	exit 1
fi

# Desired boot EFI release, default : boot_v8
BOOT_RELEASE="boot_v8"
#TODO boot release selector and validate presence of needed files
#read -p " Please enter EFI boot release wanted (Example : boot_v8, boot_v7 ...) ? : " BOOT_RELEASE

# This detects the disk and partition of volume #{DESTINATION_VOL}
DESTINATION_DISK=`diskutil list | grep ${DESTINATION_VOL} | grep -o disk.`
DESTINATION_PART=`diskutil list | grep ${DESTINATION_VOL} | grep -o disk.s.`

# Are we ok with this ?
echo
echo "We are about to install PC EFI with this informations : "
installationInfo
echo
echo "- PC EFI"
echo "  Target disk and part	 : " ${DESTINATION_DISK} "-" ${DESTINATION_PART}
echo "  Boot release choosen	 : " ${BOOT_RELEASE}
read -p "  Are these correct ? If not [CTRL+C], else any key"

# Destination partition must be correctly unmounted
diskutil umount /dev/${DESTINATION_PART}

# Install PC EFI
${PC_EFI_PATH}/startupfiletool /dev/${DESTINATION_PART} ${PC_EFI_PATH}/${BOOT_RELEASE}
#${PC_EFI_PATH} or "${PC_EFI_PATH}" ? hum ... testing for space name


# Install GUID Support - skip if you use MBR
dd if=${PC_EFI_PATH}/guid/boot1h of=/dev/r${DESTINATION_PART} bs=512 count=1
dd if=${PC_EFI_PATH}/guid/boot0 of=/dev/${DESTINATION_DISK} bs=400 count=1

# Partition should mount automatically now. If not, mount it manually.
diskutil mount /dev/${DESTINATION_PART}
}

# Procede to update of your install
installUpdate()
{
# mount .dmg files in order to access it
#DEBUG => some issue with mouting point with space name ? (hdiutil attach "/Volumes/${INSTALL_SOURCE_VOL}/combo_update/*.dmg" MUST REMOVE "" ... why ... ?)
# ... so don't know if supporting volume name with space ???
hdiutil attach /Volumes/${INSTALL_SOURCE_VOL}/combo_update/*.dmg -mountpoint "/Volumes/${INSTALL_SOURCE_VOL}/temp" -noverify
# TODO inteligent .pkg selector will be better ... TODO
OS_UPDATE_PKG="/Volumes/${INSTALL_SOURCE_VOL}/temp/*.pkg"

echo
echo "We are about to update your OS X installation with this informations (be sure that backup are done...): "
installationInfo
echo -e "  Update package : " $OS_UPDATE_PKG "\n"
read -p "  Are these correct ? If not [CTRL+C], else any key"
echo	"  Please wait, it will take time to finished ..."

# Update your OS X install with combo file mount under $INSTALL_SOURCE_VOL/temp (target disk : $DESTINATION_VOL)
installer -pkg ${OS_UPDATE_PKG} -target "/Volumes/${DESTINATION_VOL}"
# or open /Volumes/${INSTALL_SOURCE_VOL}/temp/*.pkg

# freeing mount point ../temp for further action
hdiutil detach "/Volumes/${INSTALL_SOURCE_VOL}/temp"
}

# Install Mac os X on your disk $DESTINATION_VOL
installOS()
{
# mount .dmg files in order to access it
hdiutil attach /Volumes/${INSTALL_SOURCE_VOL}/retail_dvd/*.dmg -mountpoint "/Volumes/${INSTALL_SOURCE_VOL}/temp" -noverify
# TODO inteligent .pkg selector will be better ... TODO
OS_INSTALL_MPKG="/Volumes/${INSTALL_SOURCE_VOL}/temp/System/Installation/Packages/OSInstall.mpkg"

echo "Ok, we are about install Mac OS X with this informations: "
installationInfo
echo -e "  Mac OS X system install with this package :" $OS_INSTALL_MPKG "\n"
read -p "  Are these correct ? If not [CTRL+C], else any key"
echo	"  Please wait, it will take time to finished ... (20 mn)"

# Install OS X (Fresh install)

installer -pkg ${OS_INSTALL_MPKG} -target "/Volumes/${DESTINATION_VOL}" -lang fr
#open ${OS_INSTALL_MPKG}

# freeing mount point ../temp for further action
hdiutil detach  "/Volumes/${INSTALL_SOURCE_VOL}/temp"
}

# Deploying KEXT (driver) to your fresh install/update
installKext()
{
# Here you can add every kext you want to be installed (backup, remove and copy)
# This is a minimalistic kext deployement in order to be closed of VANILLA install;-) (thkx gain LS8 for the info.)
# NOTICE : NO NEED to sudoing  when moving/copying/deleting files when running from live DVD
echo	
echo "We are about to copy KEXT and Stuff with this informations : "
installationInfo
read -p "  Are these correct ? If not [CTRL+C], else any key"

# BACKUP incompatible vanilla kexts 

echo
echo -e " Vanilla kexts will be stored in /Volumes/${DESTINATION_VOL}/vanilla/\n"

#if existing old vanilla backup kext .moving to .sav
if [ -d "/Volumes/${DESTINATION_VOL}/vanilla" ]
then
	rm -rf "/Volumes/${DESTINATION_VOL}/vanilla.sav" > /dev/null
	mv  "/Volumes/${DESTINATION_VOL}/vanilla" "/Volumes/${DESTINATION_VOL}/vanilla.sav"
fi
# Creating backup folder
mkdir -p "/Volumes/${DESTINATION_VOL}/vanilla"

# File not needed for Hackintosh --> especially Gigabyte P35 ICH9/R motherboard
mv "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/AppleIntelCPUPowerManagement.kext" "/Volumes/${DESTINATION_VOL}/vanilla/"
mv "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/JMicronATA.kext" "/Volumes/${DESTINATION_VOL}/vanilla/"

###################### INSTALL + BACKUP Hacked kexts #############################

# AppleHDA patched with Taruga 1.20
mv "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/AppleHDA.kext" "/Volumes/${DESTINATION_VOL}/vanilla/"
cp -r "/Volumes/${INSTALL_SOURCE_VOL}/kext/AppleHDA.kext" "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/"
echo -e " Audio driver installed\n"

# AppleACPIPlatform.kext (FIX given by LS8)
mv "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/AppleACPIPlatform.kext" "/Volumes/${DESTINATION_VOL}/vanilla/"
cp -r "/Volumes/${INSTALL_SOURCE_VOL}/kext/AppleACPIPlatform.kext" "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/"
echo -e " ACPI driver installed\n"	

# Page decryption EFI module - required for vanilla and binary hacked kernels, not required for kernels compiled from sources
cp -r "/Volumes/${INSTALL_SOURCE_VOL}/kext/dsmos.kext" "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/"
echo -e " Page decryption EFI module installed\n"

# ICH9R SATA drivers - vanilla kext version 1.1.0 (from 10.5.3) with "internal disk displayed as external" fix
mv "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/IOAHCIFamily.kext" "/Volumes/${DESTINATION_VOL}/vanilla/"
cp -r "/Volumes/${INSTALL_SOURCE_VOL}/kext/IOAHCIFamily.kext" "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/"
echo -e " Intel SATA driver installed\n"

# PC EFI compatible AppleSMBIOS-28 Rev.? by mac.nub (choose version: desktop/laptop)
mv "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/AppleSMBIOS.kext" "/Volumes/${DESTINATION_VOL}/vanilla/"
cp -r "/Volumes/${INSTALL_SOURCE_VOL}/smbios/imac/AppleSMBIOS.kext" "/Volumes/${DESTINATION_VOL}/System/Library/Extensions/"
# sudo cp -r smbios/macbook/AppleSMBIOS.kext /Volumes/${DESTINATION_VOL}/System/Library/Extensions/
echo -e " SMBIOS installed\n"

# Remove kext cache (if any cause we are not running os x on the install Volume)
rm -r "/Volumes/${DESTINATION_VOL}/System/Library/Extensions.mkext"

echo
echo " ----------------------------------------------------------------------------------------------------------------"
echo " Realtek ethernet driver is placed in packages/RealtekR1000_1.04.zip - install manually if required."
echo " JMicronATA driver (fixed for 4GB RAM) is placed in packages/JMicronATA_64bit.zip - install manually if required."
echo -e " ----------------------------------------------------------------------------------------------------------------\n"
}

# Retrieving system information such as, where you want to install :  $DESTINATION_VOL, install files location : $INSTALL_SOURCE_VOL
# and then, set working variable $PC_EFI_PATH and $PATH
requiredInfo()
{
echo
echo ">>> Answer carrefully to this question, if not you can damage previous install (case sensitive area) <<<"
echo
# Destination volume : volume where you want to install or update OS X << BE CARREFUL >> everything will be removed or modified here !!!
read -p " - Please enter the DESTINATION volume name, exactly (ie. Macintosh) ? : " DESTINATION_VOL

#testing presence of correct DESTINATION volume (by testing directory)
if [ -r "/Volumes/${DESTINATION_VOL}" ]
then
	echo "   We are going to work on this volume /Volumes/" ${DESTINATION_VOL}
else
	echo "   Cannot locate DESTINATION volume, bye bye."
	exit 1
fi
}

# retrieving system informations ...
installationInfo()
{
# Sump up of the location/install info
echo
echo "- Install informations :"
echo "  Destination volume	   " ${DESTINATION_VOL} " ( /Volumes/"${DESTINATION_VOL} " )"
echo "  Installation file volume " ${INSTALL_SOURCE_VOL} " ( /Volumes/"${INSTALL_SOURCE_VOL} " )"
echo
read -p "  Press any key to continue ..." PUSH
}

repairPermissions()
{
echo
# We are repairing disk permisions for a clean reboot ...
echo "- Repairing $DESTINATION_VOL volume, please wait until finished ..."
diskutil repairpermissions "/Volumes/${DESTINATION_VOL}/"
echo
echo "  Installation/Update complete. You can restart your computer now."
echo "  Then generate and install your EFI string. Can be found in tools folder"
echo
echo "  Download latest EFIStudio from http://forum.netkas.org/index.php/topic,64.msg1864.html#msg1864"
read -p "  It's done, press any key" PUSH
}

####################### BEGIN HERE #######################


# Source volume : volume where is located your installation updates, scripts, kexts and stuff files (please don't modify the folders tree of $INSTALL_SOURCE_VOL.)
#read -p " - Please enter the volume name where are located your INSTALLATION FILES (ie. USB, EXTERNAL ...) ? : " INSTALL_SOURCE_VOL
INSTALL_SOURCE_VOL=`pwd | awk -F \/ '{print $3}'`
#testing presence of correct INSTALL_SOURCE files (just testing "tools" and destination folders)
if [ -r "/Volumes/${INSTALL_SOURCE_VOL}/tools" ]
then
	echo "   We are going to use files of /Volumes/" ${INSTALL_SOURCE_VOL}
else
	echo "-> Your installations files MUST BE located at the ROOT OF YOUR INSTALL STICK OR DISK OR NETWORK MOUNT POINT."
	echo "   I cannot locate install files, bye bye."
	exit 1
fi

# Make accessible additionals tools needed for this scripts to work
export PATH=${PATH}:"/Volumes/${INSTALL_SOURCE_VOL}/tools"

#TODO : user-freindly partitionning step ... actualy you must EXACTLY know what you're doing to proceed savefully

# Install menu
CHOICE=1
until [ "$CHOICE" = "0" ]
do
#	clear
echo 
echo " ----------------- INSTALL MENU --------------------"
echo "													"
echo " 1 - Partition tool"
echo " 2 - Install (Retail) + PC EFI"
echo " 3 - Update (Combo)"
echo " 4 - Install (Retail) + Update (Combo)+ PC EFI"
echo " 5 - (Re)Install PC EFI"
echo " 6 - Installation infos"
echo " 0 - Exit"
echo
echo " ---------------------------------------------------"
# User choice :
echo
read -p " ? - Please enter your choice : " CHOICE
echo
# Main area ...
case ${CHOICE} in
	1)	echo "Disk partitionning ..."
		echo "Please wait while loading from DVD"
		diskPart 
;;
	2)	echo " Installing OS X ..."
		read -p " Are you sure ? If not [CTRL+C], else any key" PUSH			
		diskPart
		requiredInfo
		installPcEfi
		installOS
		installKext
		repairPermissions
;;
	3)	echo " Updating your system ..."
		read -p " Before updating, make sure you have done a BACKUP with disk utility. If not [CTRL+C], else any key" PUSH
		requiredInfo
		installUpdate
		installKext
		repairPermissions
;;
	4)	echo " Installing OS X and applying combo update..."
		read -p " Are you sure ? If not [CTRL+C], else any key" PUSH
		diskPart
		requiredInfo
		installPcEfi
		installOS
		installUpdate
		installKext
		repairPermissions
;;
	5)	echo " Installing PC EFI ..."
		read -p " Are you sure ? If not [CTRL+C], else any key" PUSH
		diskPart
		requiredInfo
		installPcEfi
;;	
	6)	echo "Verify installation set var ..."
		installationInfo
;;		
	0)	echo " Bye."
;;
	*)	echo " Unknown choice, play again ..."
;; 
esac
done
exit 0
# EOF

Edited by coucou

aucun soucis (LS8 est aussi sur l'affaire)

 

n'hesites pas a tout remettre en cause et critiquer !!! (c'est même fait pour)

 

- En phase 1, j'essaie de poser les bases pour un installeur.

 

- Apres en seconde phase je compte le mettre + le pack qui va bien (car je n'ai pas encore bossé l'efi et les modif de kext , a part les vendor id etc) dans un stick usb BOOTABLE AVEC OS X (style dvd kalyway 10,5,2): comme ca on place le pack sur le stick, il est bootable + on met le retail qui va bien + le combio update souhaité et bye bye ...

 

EFI-x ? non c'est pas ça .... je delire la .

 

A+

 

Faites gaffe c'est un script en dev. donc backup backup.(veux pas me faire des enemis moi ici ;-)

merci les gars.

 

(moi aussi pas le temps ...madame est conciliante les boutchous aussi ... pouahhhhh , mais je suis assez creuvé ... lol)

 

bon j'ai fait quelques tests et cela à l'air de bien se passé cela devient "testable" à quelques incohérence prés.

 

En tout cas les methodes via le programme "installer" sont opérationnels (avant , quand je n'avais pas de script je faisait un "open" et cela me placait devant un GUI d'installation ) et cela veut dire que l'installation d'os se fait en mode silent (pas de GUI à part quand on doit faire du Disk Uility part ... mais cela pourra changé ...)

 

Pensez bien à mettre UN SEUL .DMG pour le repertoire /combo_update et un SEUL .DMG pour le repertoire /retail_dvd (le script ne s'est pas encore choisir si il y en a plusieurs ...)

 

De plus :

 

je compte virer la saisie du disque source : avec un $0 (plus un chti traitement pour récupérer le volumes) ... facile donc.

MAiS pour moi le script n'est pas parfait il va falloir du taf pour pafaire tout ça.(mais la je léve un peu le pieds : fatigue)

 

 

IMPORTANT : je fait tout mes test avec la MAcOSXServerComboUpdate10,5,3 (et 10.5.2) + le retail dvd server 10.5.0

le tout sur une GA-EP35-D3SR sponsorisé par gigabyte pour les adorateurs de la pomme ... qui ont pas trop le sous OU qui veulent faire mumuse (lol)

Pour le stick bootable t'a pensé utiliser quoi comme système? 10.4? 10.5?

je ne sais pas encore ...tout ca c'est en gestation dans mon chti cerveau ..clone X a l'air de pouvoir faire des jolis dvd bootable ... donc je vais voir

 

la j'essaie de prendre en main le package Maker

Très bien coucou, ça représente beaucoup de boulot tout ça. je testerais aussi ce script (j'ai la même CM que toi) bientôt.

J'ai jeté un oeil rapide et, si tu me permet, j'aurais deux trois suggestions:

- peut-être, pour rester dans l'esprit "Vanilla", remplacer l'applesmbios de macdotnub par ApplesmbiosEfi de Chun-nan, qui permet de converser l'applesmbios orgininal d'Apple. Il existe également un Applesmbiosresolver et un désactiveur pour AppleintelCPUPowerManagement réalisés par Kabyl, mais ils ne sont plus visibles sur son blog.

- Au niveau du bootloader, il y a également chameleon, compatible SSE2 et quelques améliorations en plus. La méthode d'installation à scripter est quasiment identique à celle de PC_EFI.

http://chameleon. osx86. hu (les espaces sont volontaires, insanely refuse ce lien, ils sont fous??)

Au niveau de PackageMaker, c'est un bon outil mais alors il ne faut bien penser l'arborescence dès le départ, car ensuite on ne peut plus changer l'ordre des menus et des kext sans modifier les précédents (un peu galère quoi). Aussi un truc vraiment important au cas où tu aurais plusieurs kext portant le même nom, pense bien à leur donner des packageidentifier bien différents, car packagemaker ne le fait pas toujours très bien tout seul et fini par s'emmêler les pinceaux entre les kexts. Pour l'intégration des scripts, tu as juste à enregistrer tes shell scripts en .command avec text edit et ça roule. Bonne continuation. :)

je suis en train de faire un test avec le pack V3 de LTL ...on va voir ce que ca donne ...

 

(en mode retail + combo update officiel apple le tout en 10,5,3 au final ... a voir donc , reponse dans 20 mn)

 

le soucis est vraiment le kernel + les kext . Si on pouvait faire du versionning ce serait quand même le minimum ... car la on plaque des kext au petit bonheur la chance ...

 

Je parle pas niveau insatll + reboot (sleep reboot sop) etc tout ca c bon dans tout mes tests ...

c'est surtout les perf. !!! et chti bug par ci par la ... qui ne font pas pro

 

edit : je viens de passer en kernel modbin + ajout du fichier IONetworkingFamilly (UUID 35 issue)

 

et tourne bien, 50 Mo/s en lecture sur le raid 0 (apple) du serveur vers client mais encore du 30 mo/s en ecriture... ca progresse

 

mon script peut aussi etre modifier au niveau de l'install des kexts ...pour pouvoir s'adapter an 'importe quel pack

  • 2 weeks later...
  • 1 year later...
  • 1 month later...
up!

 

tropicalités,

 

un petit Up pour savoir, je n'y avais pas pensé il y a un an mais j'aimerais me monter un serveur avec OSX server 10.5.8,

1) quel matos faut il pour une config ideale sachant que je suis à la reunion donc pas de crypto vendeur d'une rue sombre de Paris si possible

2) ce post est il toujours d'actualité pour l'install

 

ca doit tourner comme une horloge ne professionnel pour le budget d'un mac mini ou presque.

 

merci d'avance

×
×
  • Create New...