Changes between Version 5 and Version 6 of opsi/winpe


Ignore:
Timestamp:
03/11/21 18:57:48 (4 weeks ago)
Author:
joergs
Comment:

mkwinpeimg

Legend:

Unmodified
Added
Removed
Modified
  • opsi/winpe

    v5 v6  
    55Used to install Windows >= 7 with OPSI.
    66
    7 Gernerl Information about WinPE at http://en.wikipedia.org/wiki/Windows_Preinstallation_Environment
     7Gernal Information about WinPE at http://en.wikipedia.org/wiki/Windows_Preinstallation_Environment
    88
    9 Since Windows 8, WinPE 4.0 is available. However, Windows 8 can also be installed using WinPE 3.x.
     9== Preparing WinPE from Linux ==
    1010
    11 == WinPE 3.x ==
     11The (excellent) OPSI documentation describes at length, how to prepare a full OS Windows installation (see https://download.uib.de/opsi4.1/documentation/html/en/opsi-getting-started-v4.1/opsi-getting-started-v4.1.html#opsi-getting-started-firststeps-osinstall-fill-base-packages-nt6).
    1212
    13 Since Windows 7.
     13This can be archived quicker, especially, the preparing WinPE can be done directly on the Linux OPSI server, instead of using Windows and the need to install WAIK (or ADK):
    1414
    15 see http://download.uib.de/opsi4.0/doc/html/opsi-getting-started/opsi-getting-started.html#opsi-getting-started-firststeps-osinstall-fill-base-packages-nt6
    16 
    17 Alternativly use following commands:
    18 
    19 Install Windows WAIK
     15Have your Windows installation ISO available. We assume, it is named {{{/tmp/Win10_x64.iso}}}.
    2016
    2117{{{
    22 c:
     18#
     19# Variables. Adapt them to your needs.
     20#
     21WINDOWS_ISO=/tmp/Win10_x64.iso
     22PROD=win10-x64
    2323
    24 rem Create Initial winpe directory
    25 c:\Program Files\Windows AIK\Tools\PETools\copype.cmd amd64 c:\winpe64
     24#
     25# install required software
     26#
     27apt install wimtools syslinux p7zip-full
     28# CentOS/SUSE: yum install wimtools syslinux p7zip p7zip-plugins
    2629
    27 copy c:\winpe64\winpe.wim c:\winpe64\ISO\sources\boot.wim
     30#
     31# Install required OPSI product
     32#
     33opsi-package-updater install ${PROD}
     34cd /var/lib/opsi/depot/${PROD}
    2835
    29 # set variables
    30 set wim=c:\winpe64\ISO\sources\boot.wim
    31 set md=c:\winpe64\mount
     36#
     37# Copy ISO content to installfiles
     38#
     397z x ${WINDOWS_ISO} installfiles
    3240
    33 rem Mount and modify WinPE boot image
     41#
     42# Create winpe
     43#
     44mkdir -p winpe-overlay/Windows/System32
     45printf "%s\r\n" "c:\opsi\startnet.cmd" > winpe-overlay/Windows/System32/startnet.cmd
     46mkwinpeimg --windows-dir=installfiles --overlay=winpe-overlay winpe.img
     477z x winpe.img -owinpe/
    3448
    35 cd c:\winpe64
    36 dism /Get-WIMInfo /WimFile:%wim%
    37 
    38 dism /cleanup-wim
    39 
    40 dism /Mount-Wim /WimFile:%wim% /index:1 /MountDir:%md%
    41 
    42 type C:\winpe64\mount\Windows\System32\startnet.cmd
    43 echo c:\opsi\startnet.cmd > %md%\Windows\System32\startnet.cmd
    44 
    45 dism /unmount-Wim /MountDir:%md% /Commit
     49#
     50# Adapt produkts
     51#
     52opsi-admin -d method updateWIMConfig ${PROD}
    4653}}}
    4754
    48 More customazations are explained at wiki:opsi/dism
     55Using {{{7z x ${SRC} -o${DEST}}}} is a shortcut to avoid mounting the ISO or disk image files.
     56If you prefer, you can use this:
     57{{{
     58TMP=$(mktemp -d)
     59sudo mount ${SRC} ${TMP}
     60cp -a ${TMP}/. ${DEST]/.
     61sudo umount ${TMP}
     62}}}
    4963
    5064
    51 Copy ISO subdirectory as winpe Directory to OPSI server:
    52 
    53 {{{
    54 cp ISO/. /var/lib/opsi/depot/win*\winpe/.
    55 }}}
    56 
    57 Hint: The boot.wim file is also accessable by the 7z archiving programm (at least for WinPE versions <4.0)
     65= Outdated approaches =
    5866
    5967== WinPE 4.0 ==
    60 
    61 Currently this is not supported by OPSI. Modifying this images works, but driver integration fails (create_driver_links.py tries to extract drivers using 7z, which does not work for WinPE >= 4.0).
    6268
    6369=== Modify WinPE for OPSI ===
     
    104110}}}
    105111
     112
     113
     114== WinPE 3.x ==
     115
     116Since Windows 7.
     117
     118see http://download.uib.de/opsi4.0/doc/html/opsi-getting-started/opsi-getting-started.html#opsi-getting-started-firststeps-osinstall-fill-base-packages-nt6
     119
     120Alternatively use following commands:
     121
     122Install Windows WAIK
     123
     124{{{
     125c:
     126
     127rem Create Initial winpe directory
     128c:\Program Files\Windows AIK\Tools\PETools\copype.cmd amd64 c:\winpe64
     129
     130copy c:\winpe64\winpe.wim c:\winpe64\ISO\sources\boot.wim
     131
     132# set variables
     133set wim=c:\winpe64\ISO\sources\boot.wim
     134set md=c:\winpe64\mount
     135
     136rem Mount and modify WinPE boot image
     137
     138cd c:\winpe64
     139dism /Get-WIMInfo /WimFile:%wim%
     140
     141dism /cleanup-wim
     142
     143dism /Mount-Wim /WimFile:%wim% /index:1 /MountDir:%md%
     144
     145type C:\winpe64\mount\Windows\System32\startnet.cmd
     146echo c:\opsi\startnet.cmd > %md%\Windows\System32\startnet.cmd
     147
     148dism /unmount-Wim /MountDir:%md% /Commit
     149}}}
     150
     151More customazations are explained at wiki:opsi/dism
     152
     153
     154Copy ISO subdirectory as winpe Directory to OPSI server:
     155
     156{{{
     157cp ISO/. /var/lib/opsi/depot/win*\winpe/.
     158}}}
     159
     160Hint: The boot.wim file is also accessable by the 7z archiving programm (at least for WinPE versions <4.0)
     161
    106162= Other =
    107163