Ho pensato che forse a qualcuno potesse interessare, quindi scrivo questo piccolo topic (un Forse HOW-TO)
Per prima cosa scarichiamo il livecd minimal install-x86-minimal-2005.0.iso.
Ora dobbiamo montarlo per poterne prendere il contenuto
Code: Select all
mount -t iso9660 -o loop install-x86-minimal-2005.0.iso /mnt/isoimage
Code: Select all
mkdir /mnt/isoimage
mkdir /mnt/usb
mkdir /mnt/gentooimage
Code: Select all
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1024, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1024, default 1024): The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Using default value 1024
Command (m for help): w
Code: Select all
mke2fs /dev/sda1Code: Select all
mount /dev/sda1 /mnt/usbCode: Select all
cp -r /mnt/isoimage/* /mnt/usb rinomino la directory isolinux contenente l' immagine del kernel e l' initrd in boot
Code: Select all
mv /mnt/usb/isolinux /mnt/usb/boot Code: Select all
cp -r /boot/grub /mnt/usb/boot Code: Select all
timeout 30
default 0
fallback 1
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Gentoo
root (hd0,0)
kernel /boot/gentoo root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/livecd.squashfs udev nodevfs cdroot vga=791 dokeymap splash=silent,theme:livecd-2005.0
initrd /boot/gentoo.igz
title Gentoo-nofbroot (hd0,0)
kernel /boot/gentoo root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/livecd.squashfs udev nodevfs cdroot
initrd /boot/gentoo.igz
title memtest86
kernel /boot/memtest86
Code: Select all
cd /mnt/usb/boot
ln -s . boot
Code: Select all
cd /mnt/usb/boot
echo "(hd1) /dev/sda" >> devices.mapCode: Select all
grub --no-floppy --device-map=devices.map
grub> root (hd1,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd1)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+16 p (hd1,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.
grub>
Copiamo e montiamo gentoo.igz che contiene lo script linuxrc
Code: Select all
cd /tmp
cp /mnt/usb/boot/gentoo.igz .
mv gentoo.igz gentoo.gz
gzip -d gentoo.gz
mount -o loop gentoo /mnt/gentooimage
Modifichiamo come segue
Code: Select all
....
..
echo -e "${GOOD}>>${NORMAL}${BOLD} Activating udev...${NORMAL}"
runUdev
startVolumes
mv /dev/* /newroot/dev
mknod /newroot/dev/sda b 8 0 <----- da aggiungere
mknod /newroot/dev/sda1 b 8 1 <----- da aggiungere
..
....Code: Select all
umount -d /mnt/gentooimagecomprimiamo con gzip
Code: Select all
gzip gentooCode: Select all
cp gentoo.gz /mnt/usb/boot/gentoo.igzCode: Select all
umount /mnt/usbAltra cosa da tener presente quando si installa da USB è che /dev/sda viene utilizzato per la chiave usb quindi nel caso di controller sata o scsi in fase di installazione si vedranno i dischi su sdb che poi diventeranno sda una volta installato il sistema, la fstab va quindi scritta tenendo conto di questa cosa.
Edit: aggiunte le correzioni di xchris




