Difference between pages "Rootfs over encrypted lvm" and "PXE Network Windows Installation"

From Funtoo
(Difference between pages)
Jump to: navigation, search
(Editing the fstab)
 
(Creating a Setup Instruction File)
 
Line 1: Line 1:
This howto describes how to setup LVM and rootfs with cryptoLUKS-encrypted drive
+
''Howto use your Funtoo machine to serve a MS Windows installation over the network''
 +
In this guide we will assume that you have followed the [[PXE network boot server]] Wiki article and have a working network/pxe boot setup. As of now this guide will cover Windows XP. Soon it will be expanded to also cover Windows 7.
 +
==Prerequisites==
 +
#A working Funtoo installation
 +
#A working PXE Setup (DHCP, TFTP, PXELinux)
 +
#app-arch/cabextract
 +
#A legitimate copy of Microsoft Windows
 +
#Driver for your NIC - ''Suggested to use a complete driver pack with all major supported NIC hardware for the version of Windows to be installed.''
 +
#RIS Linux toolkit >=0.4
 +
#A working Samba server setup
  
= Prepare the hard drive and partitions =
+
== Creating the Windows XP Image ==
This is an example partition scheme, you may want to choose differently.
+
<code>/dev/sda1</code> used as <code>/boot</code>. <code>/dev/sda2</code> will be encrypted drive with LVM.
+
  
* <code>/dev/sda1</code> -- <code>/boot</code> partition.
+
*In the previous guide, [http://www.funtoo.org/wiki/PXE_network_boot_server PXE Network Boot Server], we used /tftproot as the working directory so we will also use it in this guide for convenience. If you chose to use a different working directory then please apply it where needed in place of the /tftproot we will be going by here.
* <code>/dev/sda2</code> -- BIOS boot partition (not needed for MBR - only needed if you are using GPT) This step required for GRUB2. For more info, see: [http://www.funtoo.org/Funtoo_Linux_Installation#Prepare_Hard_Disk] for more information on GPT and MBR.  
+
 
* <code>/dev/sda3</code> -- <code>/</code> partition, will be the drive with LUKS and LVM.
+
First you will need to create an ISO from your Windows XP installation disc. If you already have the ISO image you may skip this step.  
  
 
<console>
 
<console>
# ##i##dd if=/dev/zero of=/dev/sda3 bs=100M
+
###i## dd if=/dev/sr0 of=/tftproot/winxp.iso
# ##i##dd if=/dev/urandom of=/dev/sda3 bs=100M
+
 
</console>
 
</console>
The <code>dd</code> part is optional, and the command only needs to be run for security reasons (i.e only if you had top secret files on your drive). The command overwrites the lingering data on the device with random data. It takes around 6 hours to complete for a 200GB drive.
+
If your cdrom device isn't ''<code>/dev/sr0</code>'' please use the appropriate device in this command.
  
{{Note}} You will get a message about reaching the end of the device when the <code>dd</code> command has finished. This behavior is intended.
+
== Mount the ISO and Prepare Installation Sources ==
 
+
Mount the image to ''<code>/tftproot/cdrom</code>'':
= Encrypting the drive =
+
 
<console>
 
<console>
# ##i##cryptsetup --cipher aes-xts-plain64 luksFormat /dev/sda3
+
###i## mkdir /tftproot/cdrom; mount -o loop /tftproot/winxp.iso /tftproot/cdrom
# ##i##cryptsetup luksOpen /dev/sda3 dmcrypt_root
+
 
</console>
 
</console>
 
+
Create the new directory for the network installation files and copy the needed files to it:
There you'll be prompted to enter your password phrase for encrypted drive, type your paranoid password there.
+
 
+
= Create logical volumes =
+
 
<console>
 
<console>
# ##i##pvcreate /dev/mapper/dmcrypt_root
+
###i## mkdir /tftproot/winxp; cp -R /tftproot/cdrom/i386 /tftproot/winxp/i386
# ##i##vgcreate vg /dev/mapper/dmcrypt_root
+
# ##i##lvcreate -L10G --name root vg         
+
# ##i##lvcreate -L2G --name swap vg
+
# ##i##lvcreate -L5G --name portage vg
+
# ##i##lvcreate -l 100%FREE -nhome vg
+
 
</console>
 
</console>
Feel free to specify your desired size by altering the numbers after the -L flag. For example, to make your portage dataset 20GB's, use the flag -L20G instead of -L5G.
+
Depending on your CD/DVD copy of windows the directory name may be I386 as opposed to i386, if that is the case you will just need to change the first part of the command, keeping the new directory name i386 - this is going to be very important later on when creating the remap file!
 
+
Check the contents of your newly created i386 directory to see if the filenames are in all CAPS or if they are already in lowercase.  
= Create a filesystem on volumes =
+
<console>
 +
###i## ls /tftproot/winxp/i386
 +
</console>
 +
If you happen to have all UPPERCASE filenames, lets go ahead and run a script to convert it to all lowercase:
 
<console>
 
<console>
# ##i##mkfs.ext2 /dev/sda1
+
###i## cd /tftproot/winxp/i386;ls | awk '$0!=tolower($0){printf "mv \"%s\" \"%s\"\n",$0,tolower($0)}' | sh
# ##i##mkswap /dev/mapper/vg-swap
+
# ##i##mkfs.ext4 /dev/mapper/vg-root
+
# ##i##mkfs.ext4 /dev/mapper/vg-portage
+
# ##i##mkfs.ext4 /dev/mapper/vg-home
+
 
</console>
 
</console>
  
= Basic system setup =
+
==Extracting and Modifying the Required Boot Files ==
 +
Install {{Package|app-arch/cabextract}}
 
<console>
 
<console>
# ##i##swapon /dev/mapper/vg-swap
+
###i## emerge -av app-arch/cabextract
# ##i##mkdir /mnt/funtoo
+
</console>
# ##i##mount /dev/mapper/vg-root /mnt/funtoo
+
Extract the prepackaged drivers:
# ##i##mkdir -p /mnt/funtoo/{boot,usr/portage,home}
+
<console>
# ##i##mount /dev/sda1 /mnt/funtoo/boot
+
###i## cd /tftproot/winxp/i386;cabextract driver.cab
# ##i##mount /dev/mapper/vg-portage /mnt/funtoo/usr/portage
+
</console>
# ##i##mount /dev/mapper/vg-home /mnt/funtoo/home
+
Install support for a large list of network cards:
 +
<console>
 +
###i## cd /tftproot/;wget http://downloads.sourceforge.net/project/bootfloppy/pxefiles.tar.gz
 +
###i## tar zxvf pxefiles.tar.gz; cp pxefiles/drivers/* winxp/i386/
 +
</console>
 +
Copy the BINLSRV /INFParser tools to /tftproot:
 +
<console>
 +
###i## cp pxefiles/script/* /tftproot/
 +
</console>
 +
Extract the netboot startrom:
 +
<console>
 +
###i## cd /tftproot; cabextract winxp/i386/startrom.n1_
 +
</console>
 +
Fix the startrom for netbooting xp:
 +
<console>
 +
###i## sed -i -e 's/NTLDR/XPLDR/gi' startrom.n12
 +
###i## mv startrom.n12 winxp.0
 +
</console>
 +
Fix XPLDR:
 +
<console>
 +
###i## cabextract winxp/i386/setupldr.ex_
 +
###i## sed -i -e 's/winnt\.sif/winxp\.sif/gi' setupldr.exe
 +
###i## sed -i -e 's/ntdetect\.com/ntdetect\.wxp/gi' setupldr.exe
 +
###i## mv setupldr.exe xpldr
 +
###i## cp winxp/i386/ntdetect.com ntdetect.wxp
 
</console>
 
</console>
Now perform all the steps required for basic system install, please follow [http://docs.funtoo.org/wiki/Funtoo_Linux_Installation]
 
don't forget to emerge the following before your install is finished:
 
  
* '''cryptsetup'''
+
== Creating a remapping file ==
* '''lvm2'''
+
Create the file <code>/tftproot/tftpd.remap</code> and add the following to it:
* '''a bootloader (grub recommended)'''
+
* '''kernel sources '''
+
 
+
= Editing the fstab =
+
Fire up your favorite text editor to edit <code>/etc/fstab</code>. You want to put the following in the file:
+
 
{{File
 
{{File
|/etc/fstab|<pre>
+
|/tftproot/tftpd.remap|<pre>
# <fs>                  <mountpoint>  <type>    <opts>                          <dump/pass>
+
ri ^[az]: # Remove “drive letters”
/dev/sda1              /boot        ext2      noauto,noatime                  1 2
+
rg \\ / # Convert backslashes to slashes
/dev/mapper/vg-swap    none          swap      sw                              0 0
+
rg \# @ # Convert hash marks to @ signs
/dev/mapper/vg-root    /             ext4      noatime,nodiratime,defaults    0 1
+
rg /../ /..no../ # Convert /../ to /..no../
/dev/sr0                /mnt/cdrom    auto      noauto,ro                      0 0
+
rg A a
/dev/mapper/vg-portage  /usr/portage  ext4      noatime,nodiratime              0 0
+
rg B b
/dev/mapper/vg-home    /home        ext4      noatime,nodiratime              0 0
+
rg C c
 +
rg D d
 +
rg E e
 +
rg F f
 +
rg G g
 +
rg H h
 +
rg I i
 +
rg J j
 +
rg K k
 +
rg L l
 +
rg M m
 +
rg N n
 +
rg O o
 +
rg P p
 +
rg Q q
 +
rg R r
 +
rg S s
 +
rg T t
 +
rg U u
 +
rg V v
 +
rg W w
 +
rg X x
 +
rg Y y
 +
rg Z z
 +
r ^/(.*) \1
 +
r ^xpldr xpldr
 +
r ^ntdetect.wxp ntdetect.wxp
 +
r ^winxp.sif winxp.sif
 
</pre>}}
 
</pre>}}
  
= Kernel options =
+
==Install/Configure Samba ==
{{Note}}This part is particularly important: pay close attention.
+
If you don't already have {{Package|net-fs/samba}} installed, then:
{{kernelop
+
| <br> |<pre>
+
General setup --->
+
      [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
+
</pre>}}
+
 
+
{{kernelop
+
| <br> |<pre>
+
Device Drivers --->
+
      Generic Driver Options --->
+
      [*] Maintain a devtmpfs filesystem to mount at /dev
+
</pre>}}
+
 
+
{{kernelop
+
| <br> |<pre>
+
Device Drivers --->
+
      [*] Multiple devices driver support --->
+
      <*>Device Mapper Support
+
        <*> Crypt target support
+
</pre>}}
+
 
+
{{kernelop
+
| <br> |<pre>
+
Cryptographic API --->
+
      <*> XTS support
+
      -*-AES cipher algorithms
+
</pre>}}
+
 
+
= Initramfs setup and configuration =
+
== Better-initramfs ==
+
'''Build your initramfs with [https://bitbucket.org/piotrkarbowski/better-initramfs better-initramfs] project.'''
+
 
+
{{note}}better-initramfs supports neither dynamic modules nor udev, so you should compile your kernel with built-in support for your block devices.
+
 
+
 
<console>
 
<console>
# ##i##cd /opt
+
###i## emerge -av net-fs/samba
# ##i##git clone git://github.com/slashbeast/better-initramfs.git
+
# ##i##cd better-initramfs
+
# ##i##less README.rst
+
# ##i##bootstrap/bootstrap-all
+
# ##i##make prepare
+
# ##i##make image
+
 
</console>
 
</console>
 +
Create a Samba share for your tftp server in <code>/etc/samba/smb.conf</code>
  
Copy resulting <code>initramfs.cpio.gz</code> to <code>/boot</code>:
+
{{Note}} Be sure you have the other required samba settings configured in the file
<console># ##i##cp output/initramfs.cpio.gz /boot</console>
+
{{File
 +
|/etc/samba/smb.conf|<pre>
 +
[Global]
 +
interfaces = lo eth0 wlan0
 +
bind interfaces only = yes
 +
workgroup = WORKGROUP
 +
security = user
  
Alternatively, a pre-compiled binary initramfs is available at https://bitbucket.org/piotrkarbowski/better-initramfs/downloads
+
[tftproot]
 +
path = /tftproot
 +
browsable = true
 +
read only = yes
 +
writable = no
 +
guest ok = yes
 +
</pre>}}
 +
Start Samba:
 
<console>
 
<console>
# ##i##wget https://bitbucket.org/piotrkarbowski/better-initramfs/downloads/release-x86_64-v0.7.2.tar.bz2
+
###i## /etc/init.d/samba start
# ##i##tar xf release-x86_64-v0.5.tar.bz2
+
</console>  
# ##i##cd release*
+
or if samba has already been started:
# ##i##gzip initramfs.cpio
+
# ##i##cp initramfs.cpio.gz /boot
+
</console>
+
 
+
Remember, better-initramfs project is a work in progress, so you need to update from time to time. It can be done easily with <code>git</code>. Go to the better-initramfs source dir and follow:
+
 
<console>
 
<console>
# ##i##cd /opt/better-initramfs
+
###i## /etc/init.d/samba restart
# ##i##git pull
+
# ##i##less ChangeLog
+
 
</console>
 
</console>
{{Note}}Please read the ChangeLog carefuly and perform necessary updates to <code>/etc/boot.conf</code>. Also, please backup the working <code>/boot/initramfs.cpio.gz</code> and <code>/etc/boot.conf</code> before updating better-initramfs.
 
  
== Genkernel ==
+
== Creating a Setup Instruction File ==
Funtoo's genkernel capable to create initramfs for encrypted drive. Compile and install kernel and initramfs of your favorite kernel sources:
+
Create the file <code>/tftproot/winxp.sif</code> and add the following, replacing <tt>SAMBA_SERVER_IP</tt> with the local IP address of your samba server:
<console>
+
{{File
# ##i##genkernel --kernel-config=/path/to/your/custom-kernel-config --no-mrproper --makeopts=-j5 --install --lvm --luks all </console>
+
|/tftproot/winxp.sif|<pre>
Configure the bootloader as described above, with correct kernel and initramfs images names. An example for genkernel and grub2. You will be editing <code>/etc/boot.conf</code>:
+
[data]
 +
floppyless = "1"
 +
msdosinitiated = "1"
 +
; Needed for second stage
 +
OriSrc = "\\SAMBA_SERVER_IP\tftproot\winxp\i386"
 +
OriTyp = "4"
 +
LocalSourceOnCD = 1
 +
DisableAdminAccountOnDomainJoin = 1
  
<pre>
+
[SetupData]
boot {
+
OsLoadOptions = "/fastdetect"
  generate grub
+
; Needed for first stage
  default "Funtoo Linux"
+
SetupSourceDevice = "\Device\LanmanRedirector\SAMBA_SERVER_IP\tftproot\winxp"
  timeout 3
+
}
+
"Funtoo Linux" {
+
  kernel kernel-genkernel-x86_64-2.6.39
+
  initrd initramfs-genkernel-x86_64-2.6.39
+
  params += crypt_root=/dev/sda3 dolvm real_root=/dev/mapper/vg-root  rootfstype=ext4 resume=swap:/dev/mapper/vg-swap quiet
+
</pre>
+
  
= Bootloader Configuration =
+
[UserData]
== Grub2 configuration ==
+
ComputerName = *
An example <code>/etc/boot.conf</code> for better-initramfs:
+
</pre>}}
 
+
<pre>
+
boot {
+
  generate grub
+
  default "Funtoo Linux"
+
  timeout 3
+
}
+
"Funtoo Linux" {
+
  kernel bzImage[-v]
+
  initrd /initramfs.cpio.gz
+
  params += enc_root=/dev/sda3 lvm luks root=/dev/mapper/vg-root  rootfstype=ext4 resume=swap:/dev/mapper/vg-swap quiet
+
</pre>
+
 
+
Now, run <code>boot-update</code> to write the configuration files to <code>/boot/grub/grub.cfg</code>
+
  
== Lilo configuration ==
+
== Editing the pxelinux.cfg/default boot menu ==
For oldschool geeks, an example for lilo bootloader. Emerge lilo with device-mapper support
+
Edit your boot menu so that it contains the following entry:
 
<console>
 
<console>
# ##i##echo 'sys-boot/lilo device-mapper' >> /etc/portage/package.use/lilo
+
LABEL WinXP
# ##i##emerge lilo
+
MENU LABEL Install MS Windows XP
 +
KERNEL winxp.0
 
</console>
 
</console>
  
Example <code>/etc/lilo.conf</code>:
+
== Re-Start all required daemons ==
<pre>
+
If the daemon isn't already running use start instead or restart in the following commands
append="init=/linuxrc dolvm crypt_root=/dev/sda2 real_root=/dev/mapper/vg-root"
+
boot=/dev/sda
+
compact
+
default=funtoo
+
lba32
+
prompt
+
read-only
+
timeout=50
+
image=/boot/kernel-genkernel-x86_64-2.6.39
+
initrd=/boot/initramfs-genkernel-x86_64-2.6.39
+
label=funtoo
+
</pre>
+
 
+
== Syslinux bootloader setup ==
+
Syslinux is another advanced bootloader which you can find on all live CD's. Syslinux bootloader does not require additional BIOS boot partition. /dev/sda2 is the root partition.
+
 
<console>
 
<console>
# ##i##emerge syslinux
+
###i## /etc/init.d/dnsmasq restart
# ##i##mkdir /boot/extlinux
+
###i## /etc/init.d/in.tftpd restart
# ##i##extlinux --install /boot/extlinux
+
# ##i##dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/mbr.bin of=/dev/sda
+
- or -
+
# ##i##sgdisk /dev/sda --attributes=1:set:2
+
# ##i##dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/gptmbr.bin of=/dev/sda, for GPT partition
+
 
</console>
 
</console>
Example <code>/boot/extlinux/extlinux.conf</code>:
 
<pre>
 
LABEL kernel1_bzImage-3.2.1
 
MENU LABEL Funtoo Linux bzImage-3.2.1
 
LINUX /bzImage-3.2.1
 
INITRD /initramfs.cpio.gz
 
APPEND rootfstype=ext4 luks enc_root=/dev/sda2 lvm root=/dev/mapper/vg-root
 
</pre>
 
  
= Final steps =
+
== Modify Binlsrv, update driver cache, and start driver hosting service ==
Umount everything, close encrypted drive and reboot
+
Change the BASEPATH= variable at or around line #62 of ''<code>binlsrv.py</code>'' so that it is:
 
<console>
 
<console>
# ##i##umount -l -v /mnt/funtoo/{dev, proc, home, usr/portage, boot}
+
###i## nano binlsrv.py
# ##i##vgchange -a n
+
BASEPATH='/tftproot/winxp/i386/'
# ##i##cryptsetup luksClose /dev/sda2 dmcrypt_root
+
 
</console>
 
</console>
After reboot you will get the following:
+
Generate driver cache:
 
<console>
 
<console>
>>> better-initramfs started. Kernel version 2.6.35-gentoo-r10
+
###i## cd /tftproot;./infparser.py winxp/i386/
>>> Create all the symlinks to /bin/busybox.
+
>>> Initiating /dev/dir
+
>>> Getting LVM volumes up (if any)
+
Reding all physical volumes. This make take awhile...
+
No volume group found
+
No volume group found
+
>>> Opening encrypted partition and mapping to /dev/mapper/dmcrypt_root
+
Enter passphrase fore /dev/sda2:
+
 
</console>
 
</console>
Type your password
+
Start binlservice:
 
+
 
<console>
 
<console>
>>> Again, getting LVM volumes up (if any, after map dmcrypt).
+
###i## ./binlsrv.py
  Reading all physical volumes.  This may take a while...
+
  Found volume group "vg" using metadata type lvm2
+
  4 logical volume(s) in volume group "vg" now active
+
>>> Mounting rootfs to /newroot
+
>>> Umounting /sys and /proc.
+
>>> Switching root to /newroot and executing /sbin/init.
+
INIT: version 2.88 booting
+
Loading /libexec/rc/console/keymap
+
  OpenRC 0.6.1 is starting up Funtoo Linux (x86_64)
+
...boot messages omitted for clarity
+
 
+
orion login: oleg
+
Password:
+
Last login: Thu Oct 14 20:49:21 EEST 2010 on tty1
+
oleg@orion ~ %
+
 
</console>
 
</console>
  
= Additional links and information =
+
== Booting the client ==  
* [[gentoo-wiki:Root filesystem over LVM2, DM-Crypt and RAID|Root filesystem over LVM2, DM-Crypt, and RAID]]
+
If all is well, you should be able to boot the client choosing to ''boot from network'' in the boot options, you should get to your PXELinux bootloader, and see the Install Windows XP option after pressing enter you *should* kick off your XP installation via network!! Congratulations!
* [http://wiki.archlinux.org/index.php/System_Encryption_with_LUKS_for_dm-crypt System Encryption with LUKS for dm-crypt]
+
* [http://en.wikipedia.org/wiki/Logical_volume_management Wikipedia article on LVM]
+
* [https://wiki.archlinux.org/index.php/Dm-crypt_with_LUKS Arch Wiki article]
+
  
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Revision as of 23:52, 14 January 2014

Howto use your Funtoo machine to serve a MS Windows installation over the network In this guide we will assume that you have followed the PXE network boot server Wiki article and have a working network/pxe boot setup. As of now this guide will cover Windows XP. Soon it will be expanded to also cover Windows 7.

Contents

Prerequisites

  1. A working Funtoo installation
  2. A working PXE Setup (DHCP, TFTP, PXELinux)
  3. app-arch/cabextract
  4. A legitimate copy of Microsoft Windows
  5. Driver for your NIC - Suggested to use a complete driver pack with all major supported NIC hardware for the version of Windows to be installed.
  6. RIS Linux toolkit >=0.4
  7. A working Samba server setup

Creating the Windows XP Image

  • In the previous guide, PXE Network Boot Server, we used /tftproot as the working directory so we will also use it in this guide for convenience. If you chose to use a different working directory then please apply it where needed in place of the /tftproot we will be going by here.

First you will need to create an ISO from your Windows XP installation disc. If you already have the ISO image you may skip this step.

# dd if=/dev/sr0 of=/tftproot/winxp.iso

If your cdrom device isn't /dev/sr0 please use the appropriate device in this command.

Mount the ISO and Prepare Installation Sources

Mount the image to /tftproot/cdrom:

# mkdir /tftproot/cdrom; mount -o loop /tftproot/winxp.iso /tftproot/cdrom

Create the new directory for the network installation files and copy the needed files to it:

# mkdir /tftproot/winxp; cp -R /tftproot/cdrom/i386 /tftproot/winxp/i386

Depending on your CD/DVD copy of windows the directory name may be I386 as opposed to i386, if that is the case you will just need to change the first part of the command, keeping the new directory name i386 - this is going to be very important later on when creating the remap file! Check the contents of your newly created i386 directory to see if the filenames are in all CAPS or if they are already in lowercase.

# ls /tftproot/winxp/i386

If you happen to have all UPPERCASE filenames, lets go ahead and run a script to convert it to all lowercase:

# cd /tftproot/winxp/i386;ls | awk '$0!=tolower($0){printf "mv \"%s\" \"%s\"\n",$0,tolower($0)}' | sh

Extracting and Modifying the Required Boot Files

Install app-arch/cabextract

# emerge -av app-arch/cabextract

Extract the prepackaged drivers:

# cd /tftproot/winxp/i386;cabextract driver.cab

Install support for a large list of network cards:

# cd /tftproot/;wget http://downloads.sourceforge.net/project/bootfloppy/pxefiles.tar.gz
# tar zxvf pxefiles.tar.gz; cp pxefiles/drivers/* winxp/i386/

Copy the BINLSRV /INFParser tools to /tftproot:

# cp pxefiles/script/* /tftproot/

Extract the netboot startrom:

# cd /tftproot; cabextract winxp/i386/startrom.n1_

Fix the startrom for netbooting xp:

# sed -i -e 's/NTLDR/XPLDR/gi' startrom.n12
# mv startrom.n12 winxp.0

Fix XPLDR:

# cabextract winxp/i386/setupldr.ex_
# sed -i -e 's/winnt\.sif/winxp\.sif/gi' setupldr.exe
# sed -i -e 's/ntdetect\.com/ntdetect\.wxp/gi' setupldr.exe
# mv setupldr.exe xpldr
# cp winxp/i386/ntdetect.com ntdetect.wxp

Creating a remapping file

Create the file /tftproot/tftpd.remap and add the following to it:

ri ^[az]: # Remove “drive letters”
rg \\ / # Convert backslashes to slashes
rg \# @ # Convert hash marks to @ signs
rg /../ /..no../ # Convert /../ to /..no../
rg A a
rg B b
rg C c
rg D d
rg E e
rg F f
rg G g
rg H h
rg I i
rg J j
rg K k
rg L l
rg M m
rg N n
rg O o
rg P p
rg Q q
rg R r
rg S s
rg T t
rg U u
rg V v
rg W w
rg X x
rg Y y
rg Z z
r ^/(.*) \1
r ^xpldr xpldr
r ^ntdetect.wxp ntdetect.wxp
r ^winxp.sif winxp.sif

Install/Configure Samba

If you don't already have net-fs/samba installed, then:

# emerge -av net-fs/samba

Create a Samba share for your tftp server in /etc/samba/smb.conf

Note Note: Be sure you have the other required samba settings configured in the file

[Global]
interfaces = lo eth0 wlan0
bind interfaces only = yes
workgroup = WORKGROUP
security = user

[tftproot]
path = /tftproot
browsable = true
read only = yes
writable = no
guest ok = yes

Start Samba:

# /etc/init.d/samba start

or if samba has already been started:

# /etc/init.d/samba restart

Creating a Setup Instruction File

Create the file /tftproot/winxp.sif and add the following, replacing SAMBA_SERVER_IP with the local IP address of your samba server:

[data]
floppyless = "1"
msdosinitiated = "1"
; Needed for second stage
OriSrc = "\\SAMBA_SERVER_IP\tftproot\winxp\i386"
OriTyp = "4"
LocalSourceOnCD = 1
DisableAdminAccountOnDomainJoin = 1

[SetupData]
OsLoadOptions = "/fastdetect"
; Needed for first stage
SetupSourceDevice = "\Device\LanmanRedirector\SAMBA_SERVER_IP\tftproot\winxp"

[UserData]
ComputerName = *

Editing the pxelinux.cfg/default boot menu

Edit your boot menu so that it contains the following entry:

LABEL WinXP
	MENU LABEL Install MS Windows XP
	KERNEL winxp.0

Re-Start all required daemons

If the daemon isn't already running use start instead or restart in the following commands

# /etc/init.d/dnsmasq restart
# /etc/init.d/in.tftpd restart

Modify Binlsrv, update driver cache, and start driver hosting service

Change the BASEPATH= variable at or around line #62 of binlsrv.py so that it is:

# nano binlsrv.py
BASEPATH='/tftproot/winxp/i386/'

Generate driver cache:

# cd /tftproot;./infparser.py winxp/i386/

Start binlservice:

# ./binlsrv.py

Booting the client

If all is well, you should be able to boot the client choosing to boot from network in the boot options, you should get to your PXELinux bootloader, and see the Install Windows XP option after pressing enter you *should* kick off your XP installation via network!! Congratulations!