View previous topic :: View next topic |
Author |
Message |
gliverman n00b


Joined: 24 Dec 2006 Posts: 51 Location: Carrollton, GA
|
Posted: Mon Mar 15, 2010 1:45 pm Post subject: Install Gentoo via PXE |
|
|
I want to be able to install Gentoo via PXE boot rather than having to tote a minimal cd with me each time. I found that if I put the following in my PXE menu that it works except for the fact that mounting the NFS path fails:
Code: |
LABEL install-x86-minimal
MENU LABEL ^1. Install Gentoo x86
KERNEL linux-installers/gentoo/x86/gentoo
APPEND loop=/default root=/dev/ram0 init=/linuxrc looptype=squashfs doscsi initrd=linux-installers/gentoo/x86/gentoo.igz console=tty1 vga=791 ip=dhcp nfsroot=xxx.xx.4.53:/nfsExports/gentoo/x86 cdroot=1 real_root=/dev/nfs
|
When the system boots it scans through the drivers then gives the following:
Code: |
:: Scanning for jfs...jfs loaded.
:: Scanning for fuse...fuse loaded.
:: Scanning for e1000...e1000 loaded.
:: Scanning for tg3...libphy, tg3 loaded.
>> Activating mdev
>> Making tempfs for /newroot
>> Determining root device...
>> Mounting root...
>> Attempting to mount NFS CD image on xxx.xx.4.53:/nfsExports/gentoo/x86
mount: RPC: Unable to send; errno = Network is unreachable
!! NFS Mounting failed. Is the path correct ?
>> Determining looptype ...
!! Invalid loop location /default
!! Please export LOOP with a valid location, or reboot and pass a proper loop=...
!! kernel command line!
BusyBox v1.7.4 (2010-01-26 12:12:25 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.
/bin/ash: can't access tty; job control turned off
#
|
Can anyone help me with this project? The goal is to make both the x86 install and the amd64 installers available via PXE. |
|
Back to top |
|
 |
gliverman n00b


Joined: 24 Dec 2006 Posts: 51 Location: Carrollton, GA
|
Posted: Mon Mar 15, 2010 3:57 pm Post subject: |
|
|
I just tried to setup the 2010.1 live dvd the same way and got the same errors... here is the PXE menu entry for that one:
Code: |
LABEL install-x86-dvd-nfs
MENU LABEL ^2. Install Gentoo x86 via Live DVD
KERNEL linux-installers/gentoo/x86_dvd/gentoo
APPEND loop=/image.squashfs root=/dev/ram0 init=/linuxrc looptype=squashfs doscsi initrd=linux-installers/gentoo/x86_dvd/gentoo.igz ip=dhcp nfsroot=xxx.xx.4.53:/nfsExports/gentoo/x86_dvd cdroot=1 real_root=/dev/nfs vga=791 splash=silent,theme:livecd-2007.0 console=tty1 quiet
|
As a side note, the theme came up correctly. I Alt-F1'ed straight-off so I could see what was happening and again saw
Code: |
mount: RPC: Unable to send; errno = Network is unavailable
|
|
|
Back to top |
|
 |
gliverman n00b


Joined: 24 Dec 2006 Posts: 51 Location: Carrollton, GA
|
Posted: Mon Mar 15, 2010 4:51 pm Post subject: |
|
|
Minimal CD works fine now
As it turns out, the failure was caused by "ip=dhcp" in the append line... it seems this is left over from an older version of BusyBox according to https://bugs.gentoo.org/show_bug.cgi?id=178756
Live DVD failing
I now have a new issue... the 2010.1 Live DVD fails / hangs during boot as illustrated below:
Code: |
* Loading ALSA modules ...
* Loading: snd-mixer-oss ...
* Loading: snd-pcm.oss ...
* Loading: snd-seq-oss ...
* Loading: snd-eq-midi ...
* Restoring Mixer Levels ...
* No mixer config in /var/lib/alsa/asound.state, you have to unmute your card!
* VideoCard: VMware Inc Abstract SVGA II Adapter
* Configuring OpenGL ...
Switching to xorg-x11 OpenGL interface... done
* Starting D-BUS system messagebus ...
* Starting avahi-daemon ...
* Starting Hardware Abstraction Layer daemon ...
* Starting NFS statd ...
* Starting spin daemon ...
>>> CD size: 50524308 K
* Starting wicd daemon ...
nfs: server xxx.xx.4.53 not responding, still trying
|
Any ideas??? |
|
Back to top |
|
 |
gliverman n00b


Joined: 24 Dec 2006 Posts: 51 Location: Carrollton, GA
|
Posted: Mon Mar 15, 2010 5:22 pm Post subject: Corrected PXE Menu Entry for Minimal CD |
|
|
Put this in your PXE Menu to boot the minimal CD:
Code: |
LABEL install-amd64-minimal-nfs
MENU LABEL ^1. Install Gentoo amd64
KERNEL linux-installers/gentoo/amd64/gentoo
APPEND loop=/image.squashfs root=/dev/ram0 init=/linuxrc looptype=squashfs doscsi initrd=linux-installers/gentoo/amd64/gentoo.igz console=tty1 vga=791 nfsroot=xxx.xx.4.53:/nfsExports/gentoo/amd64 cdroot=1 real_root=/dev/nfs
LABEL install-x86-minimal-nfs
MENU LABEL ^2. Install Gentoo x86
KERNEL linux-installers/gentoo/x86/gentoo
APPEND loop=/image.squashfs root=/dev/ram0 init=/linuxrc looptype=squashfs doscsi initrd=linux-installers/gentoo/x86/gentoo.igz console=tty1 vga=791 nfsroot=xxx.xx.4.53:/nfsExports/gentoo/x86 cdroot=1 real_root=/dev/nfs
|
Copy the kernel and initrd to your tftp server and then copy image.squashfs to an NFS share. Make the paths / IP's look right for your setup and you should be good to go. |
|
Back to top |
|
 |
philiboy n00b

Joined: 16 Mar 2010 Posts: 1
|
Posted: Tue Mar 16, 2010 5:26 pm Post subject: |
|
|
There are actually a couple ways to do this, but this method below does not require any pre-built custom kernels or NFS. When finished, you’ll just have two files on your TFTP server that contain the entire installation media.
If you’re preparing this from a Gentoo system, emerge File-Slurp. You’ll need to mount the Gentoo 2007 Minimal Install CD and pull off three file from it:
isolinux/gentoo
isolinux/gentoo.igz
image.squashfs
Copy gentoo into your TFTP directory, and the other two files into a temporary directory. In this temporary directory, create a script (let’s call it new_script) that contains the following:
#!/usr/bin/perl -w
#
use strict;
use File::Slurp qw(slurp);
my $ifile = slurp($ARGV[0], binmode=> ':raw');
my $newfile;
my $i=1;
my @newfiles = split(/TRAILER!!!/,$ifile);
`mkdir $ARGV[0].dir`;
foreach $newfile (@newfiles)
{
$newfile =~ s/^[\0]*//;
if($newfile){
open F, "> ./$ARGV[0].dir/$i";
$newfile = $newfile . "TRAILER!!!";
for(my $null=22*16+21;$null>0;$null--){
$newfile = $newfile . "\0";
}
print F $newfile;
close F;
print "$i\n";
`cd $ARGV[0].dir; cpio -i -H newc < $i; rm $i; cd ..`;
$i++;
}
}
Run the following commands:
mv gentoo.igz gentoo.gz
gunzip gentoo.gz
chmod +x new_script
./new_script gentoo
cd gentoo.dir
mkdir mnt
mkdir mnt/cdrom
cp ../image.squashfs mnt/cdrom/
Create a file called init.patch that contains:
--- init 2008-03-22 01:10:58.000000000 -0600
+++ init 2008-03-22 01:14:27.000000000 -0600
@@ -283,11 +283,6 @@
[ ! -e ${NEW_ROOT}/dev/tty1 ] && mknod ${NEW_ROOT}/dev/tty1 c 4 1
fi
- if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ]
- then
- bootstrapCD
- fi
-
if [ "${REAL_ROOT}" = '' ]
then
echo -n -e "${WARN}>>${NORMAL}${BOLD} No bootable medium found. Waiting for new devices"
@@ -387,7 +382,7 @@
else
bad_msg "Block device ${REAL_ROOT} is not a valid root device..."
REAL_ROOT=""
- got_good_root=0
+ got_good_root=1
fi
done
@@ -489,7 +484,6 @@
fi
fi
- cache_cd_contents
# Setup the loopback mounts
if [ "${LOOPTYPE}" = 'normal' ]
@@ -503,7 +497,7 @@
elif [ "${LOOPTYPE}" = 'squashfs' ]
then
good_msg 'Mounting squashfs filesystem'
- mount -t squashfs -o loop,ro ${NEW_ROOT}/mnt/cdrom/${LOOPEXT}${LOOP} ${NEW_ROOT}/mnt/livecd
+ mount -t squashfs -o loop,ro /mnt/cdrom/${LOOPEXT}${LOOP} ${NEW_ROOT}/mnt/livecd
test_success 'Mount filesystem'
FS_LOCATION='mnt/livecd'
Run this:
cp init init.orig
patch -p0 --ignore-whitespace < init.patch
find . -print | cpio -o -H newc > ../gentoo.igz
cd ..
Copy the new gentoo.igz file into your TFTP directory. Use the following options in your PXE config:
kernel gentoo
append initrd=gentoo.igz root=/dev/ram0 init=/linuxrc loop=/image.squashfs looptype=squashfs cdroot=1 real_root=/
Boot your computer via PXE and that’s it.
signature spam deleted -- admin |
|
Back to top |
|
 |
gliverman n00b


Joined: 24 Dec 2006 Posts: 51 Location: Carrollton, GA
|
Posted: Tue Mar 16, 2010 6:01 pm Post subject: |
|
|
Philiboy, that would eliminate the need for NFS for the minimal disk but I don't think it would help with the Live DVD since (AFAIK) the files would be too large to TFTP seeing as image.squashfs from the live dvd is over 2GB. Any ideas on that one? Thanks for the help!!! |
|
Back to top |
|
 |
|