Come eseguire lo script .sh da usb in modalità di ripristino terminale? [chiuso]

2

Sono un utente alle prime armi. Vorrei eseguire MacUserGenerator script di shell esportati per creare un account su un nuovo iMac senza doverlo fare manualmente nel processo di configurazione. Non sono sicuro se questo è possibile? Lo script della shell bash si trova sulla mia penna USB: usbName/Install/Scripts/createAccount.sh

Passaggi effettuati:

  1. Avvio in modalità di recupero / modalità utente singolo

  2. Esegui quanto segue:

    diskutil list
    diskutil mountDisk both usb stick and internal HD
    cd /Volumes/usbName/Install/Scripts/
    sh createAccount.sh
    
    fsck –fy
    mount –uw /
    mount_msdos /dev/disk2s1 /Volumes
    cd Install/Scripts
    sh createAccount.sh
  1. Il precedente sputa:

    Print: Entry, ":_writers_UserCertificate", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":_writers_hint", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":_writers_jpegphoto", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":_writers_passwd", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":_writers_picture", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":_writers_realname", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":_writers_UserCertificate", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":authentication_authority", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":generateduid", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":gid", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":home", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":name", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":passwd", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":realname", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":shell", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":uid", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    Print: Entry, ":ShadowHashData", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    sed: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist: No such file or directory
    sed: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist: No such file or directory
    chmod: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist: No such file or directory
    Print: Entry, ":jpegphoto", Does Not Exist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    File Doesn't Exist, Will Create: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist
    sed: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist: No such file or directory
    sed: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist: No such file or directory
    sed: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist: No such file or directory
    sed: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist: No such file or directory
    sed: /private/var/db/dslocal/nodes/Default/users/esoadmin.plist: No such file or directory
    Print: Entry, ":DidSeeCloudSetup", Does Not Exist
    File Doesn't Exist, Will Create: /Users/esoadmin/Library/Preferences/com.apple.SetupAssistant.plist
    Print: Entry, ":DidSeeSiriSetup", Does Not Exist
    File Doesn't Exist, Will Create: /Users/esoadmin/Library/Preferences/com.apple.SetupAssistant.plist
    Print: Entry, ":DidSeeTouchIDSetup", Does Not Exist
    File Doesn't Exist, Will Create: /Users/esoadmin/Library/Preferences/com.apple.SetupAssistant.plist
    Print: Entry, ":LastSeenCloudProductVersion", Does Not Exist
    File Doesn't Exist, Will Create: /Users/esoadmin/Library/Preferences/com.apple.SetupAssistant.plist
    Print: Entry, ":LastSeenBuddyBuildVersion", Does Not Exist
    File Doesn't Exist, Will Create: /Users/esoadmin/Library/Preferences/com.apple.SetupAssistant.plist
    Print: Entry, ":DidSeePrivacy", Does Not Exist
    File Doesn't Exist, Will Create: /Users/esoadmin/Library/Preferences/com.apple.SetupAssistant.plist
    mkdir: /Users/esoadmin/Library/Preferences: Read-only file system
    chmod: /Users/esoadmin: No such file or directory
    chown: esoadmin: illegal user name
    chmod: /Users/esoadmin/Library: No such file or directory
    chown: esoadmin: illegal user name
    chmod: /Users/esoadmin/Library/Preferences: No such file or directory
    chown: esoadmin: illegal user name
    

Che cosa non va e come posso risolverlo?

    
posta DankDalf 05.12.2018 - 16:53
fonte

2 risposte

1

Amico mio, a prima vista avrai un problema con la gerarchia dei file, dato che non è il volume normale e la sua struttura che lo script ha fatto presumere di usare.

Il tuo file system di root in modalità di ripristino è un volume diverso e non quello normale utilizzato nell'uso normale.

Probabilmente starai meglio in modalità normale, oppure eseguendo il boot in modalità utente singolo e poi eseguendo lo script.

F.

    
risposta data 06.12.2018 - 00:24
fonte
1

Sono questi due script? Hai corso entrambi? Ho perso il contesto. Se hai digitato questi comandi nel terminale dovresti vedere i comandi nell'output, ma non sono stato in grado di trovare i comandi. È necessario posizionare la chiavetta USB nella macchina prima di avviarsi.

Penso che il problema è che i comandi che stai tentando di utilizzare non vengono eseguiti nella modalità single user.

Supponiamo di essere avviato in modalità utente singolo. Devi fare il prossimo:

fsck –fy
mount –uw /

# diskutil mountDisk sia usb stick che HD interno

In modalità utente singolo, il disco di avvio è ora in modalità lettura / scrittura. È necessario posizionare la chiavetta USB nella macchina prima di avviarsi. In 10.4.11, quando si avviava in modalità utente singolo, l'unità flash veniva automaticamente montata. Supponiamo che lo sia ancora. Le cose potrebbero essere cambiate. Potrebbe essere necessario seguire queste istruzioni. link

Vediamo cosa è montato:

diskutil list

Ho il sospetto che sia necessario avviare più macOS. Questo ha funzionato per me in 10.4.11. Mi sto guardando in giro per vedere cosa succede ora ...

sh /etc/rc

Vedi questa pagina per i sistemi operativi successivi link leggi la sezione attorno a questo comando.  # 3 launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist

cd /Volumes/usbName/Install/Scripts/

Il tuo script è stato scritto per la shell SH? La documentazione indica che è scritto per bash

bash createAccount.sh

Dovrai mettere un po 'di debug nel tuo script per vedere cosa sta succedendo. Puoi provare:

 bash -v createAccount.sh
    
risposta data 13.12.2018 - 20:18
fonte

Leggi altre domande sui tag