Hi
Just to say that I tested this method with the 3.1 version and it works too.
Step 4 is no longer necessary because the code has been integrated in the original file, at the condition that you rename the original ISO file as 'proxmox.iso'
#!/bin/bash
#########################################################################################################
# Create PXE bootable Proxmox image including ISO #
# #
# Author: mrballcb @ Proxmox Forum (06-12-2012) #
# Thread: http://forum.proxmox.com/threads/8484-Proxmox-installation-via-PXE-solution?p=55985#post55985 #
# Modified: morph027 @ Proxmox Forum (23-02-2015) to work with 3.4 #
#########################################################################################################
BASEDIR=${1:-./}
pushd $BASEDIR >/dev/null
[ -L "proxmox.iso" ] && rm proxmox.iso &>/dev/null
for ISO in *.iso; do
if [ "$ISO" = "*.iso" ]; then continue; fi
if [ "$ISO" = "proxmox.iso" ]; then continue; fi
echo "Using $ISO..."
ln -s "$ISO" proxmox.iso
done
if [ ! -f "proxmox.iso" ]; then
echo "Couldn't find a proxmox iso, aborting."
echo "Add /path/to/iso_dir to the commandline."
exit 2
fi
[ -d pxeboot ] || mkdir pxeboot
pushd pxeboot >/dev/null
[ -d mnt ] || mkdir mnt
echo "Mounting iso image..."
if ! mount -t iso9660 -o ro,loop ../proxmox.iso mnt/ ; then
echo "Failed to mount iso image, aborting."
exit 3
fi
echo "copying kernel..."
cp mnt/boot/linux26 .
rm -f initrd.orig initrd.orig.img initrd.img
echo "copying initrd..."
cp mnt/boot/initrd.img initrd.orig.img
if ! umount mnt ; then
echo "Couldn't unmount iso image, aborting."
exit 4
fi
echo "Unmounted iso, extracting contents of initrd..."
gzip -d -S ".img" ./initrd.orig.img
rm -rf initrd.tmp
mkdir initrd.tmp
pushd initrd.tmp >/dev/null
echo "Added iso, creating and compressing the new initrd..."
cpio -i -d < ../initrd.orig 2>/dev/null
cp ../../proxmox.iso proxmox.iso
(find . | cpio -H newc -o > ../initrd.iso) 2>/dev/null
popd 2>/dev/null
rm -f initrd.iso.img
gzip -9 -S ".img" initrd.iso
# Now clean up temp stuff
echo "Cleaning up temp files..."
rmdir mnt
rm -rf initrd.tmp
rm ./initrd.orig
echo "Done! Look in $PWD for pxeboot files."
popd 2>/dev/null
popd 2>/dev/null
Just tried to push a customized initrd on my PXE but get stucked on
VFS: Cannot open root device "<NULL>" or unknown-block(8,1)
Please append a correct "root=" boot option; here are the available partions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)
If I use the original initrd, it comes to cdrom detection error (of coarse)
I've tried to diff my initrd with the original one and proxmox.iso file is the only difference.
Did not change init script until it this now included in the native code.
Did try several kernel option on my PXE config file with no more success.
Any idea would be appreciated until we use PXE for every staging tasks.
Thx
#!ipxe
dhcp
echo booting proxmox
initrd $domain/proxmox/3.4/initrd.iso.img splash=verbose
chain $domain/proxmox/3.4/linux26 vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 || goto failed
goto start
LABEL Proxmox
MENU LABEL Proxmox PVE Environment 4.0
TEXT HELP
Installiert einen Virtualisierungshost mit Proxmox 4.0
ENDTEXT
LINUX proxmox4/linux26
APPEND vga=791 video=vesafb:ywrap,mtrr ramdisk_size=524288 linux ext4 maxroot=10 swapsize=4 splash=verbose
INITRD proxmox4/initrd.iso.img
We use also Ubuntu with tftp-hpa:
Code:LABEL Proxmox MENU LABEL Proxmox PVE Environment 4.0 TEXT HELP Installiert einen Virtualisierungshost mit Proxmox 4.0 ENDTEXT LINUX proxmox4/linux26 APPEND vga=791 video=vesafb:ywrap,mtrr ramdisk_size=524288 linux ext4 maxroot=10 swapsize=4 splash=verbose INITRD proxmox4/initrd.iso.img