|
|
![]() |
|
|
Top | #1 |
|
OSNN Veteran Addict
Joined: April 2003
Location: In The Void
Posts: 6,377
Blog Entries: 9
Reputation: 1877
Power: 205 |
Place the disc in the drive and press enter when prompted, when you get to the root prompt type passwd to set a password for the root account, and then net-setup eth0 to configure your network card, then type in - /etc/init.d/sshd start - this will start the ssh server, now you just have to run something like putty, or some other ssh util and connect to your machine. Here we will set up the disc(s) Code:
fdisk /dev/sda Code:
(optional) If you want to wipe the drive you can either use dban or dd if=/dev/urandom of=/dev/sda2 cryptsetup -y --cipher aes-cbc-essiv:sha256 --key-size 256 luksFormat /dev/sda2 Code:
cryptsetup luksOpen /dev/sda2 vault pvcreate /dev/mapper/vault vgcreate vg /dev/mapper/vault Code:
lvcreate -L1G -nroot vg lvcreate -L8G -nswap vg lvcreate -L1G -nopt vg lvcreate -L15G -nusr vg lvcreate -L10G -ntmp vg lvcreate -L10G -nvar vg issue vgdisplay to show free space on drive and then lvcreate -l xx -nftpweb vg - xx being vaule from vgdisplay Code:
edit /etc/mke2fs.conf and remove the huge_file option, this is not required unless you will be storing files of 2TB mkfs.ext4 /dev/sda1 tune2fs -O ^has_journal /dev/sda1 - removes journal mkfs.ext4 /dev/mapper/vg-root mkfs.ext4 /dev/mapper/vg-opt mkfs.ext4 /dev/mapper/vg-usr mkfs.ext4 /dev/mapper/vg-tmp mkfs.ext4 /dev/mapper/vg-var mkfs.ext4 /dev/mapper/vg-ftpweb - or whatever you have named it mkswap /dev/mapper/vg-swap swapon /dev/mapper/vg-swap mount /dev/mapper/vg-root /mnt/gentoo mkdir /mnt/gentoo/boot mount /dev/sda1 /mnt/gentoo/boot mkdir /mnt/gentoo/ftpweb mkdir /mnt/gentoo/opt mkdir /mnt/gentoo/usr mkdir /mnt/gentoo/tmp mkdir /mnt/gentoo/var mkdir /mnt/gentoo/var/tmp mount /dev/mapper/vg-opt /mnt/gentoo/opt mount /dev/mapper/vg-tmp /mnt/gentoo/tmp mount /dev/mapper/vg-usr /mnt/gentoo/usr mount /dev/mapper/vg-var /mnt/gentoo/var mount /dev/mapper/vg-ftpweb /mnt/gentoo/ftpweb chmod 1777 /mnt/gentoo/tmp chmod 1777 /mnt/gentoo/var/tmp cd /mnt/gentoo links http://www.gentoo.org/main/en/mirrors.xml Code:
md5sum -c stage3-amd64-<release>.tar.bz2.DIGESTS tar xvjpf stage3-*.tar.bz2 md5sum -c portage-latest.tar.bz2.md5sum tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr Safe Cflags AMD Safe Cflags Intel Find your CPU from the above links and add what is suggested, i just normally add -march=native -mtune=native, and leave what is already in the make.conf file Code:
nano -w /mnt/gentoo/etc/make.conf Code:
mirrorselect -i -o >> /mnt/gentoo/etc/make.conf mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf Code:
cp -L /etc/resolv.conf /mnt/gentoo/etc/ ![]() Code:
mount -t proc none /mnt/gentoo/proc mount --rbind /dev /mnt/gentoo/dev chroot /mnt/gentoo /bin/bash env-update source /etc/profile export PS1="(chroot) $PS1" Optional - This is if you wish to use the latest GCC (as of this writing it was 4.6 - you will have to add the ~arch use flag to make.conf to use this ~amd64 ~x86) Add to /etc/portage/package.keywords Code:
=sys-devel/gcc-4.6* ** echo sys-devel/gcc >> /etc/portage/package.unmask add this to /etc/portage/package.use sys-fs/lvm2 static static-libs sys-fs/mdadm static sys-apps/busybox static static-libs sys-apps/util-linux static-libs sys-fs/cryptsetup static =sys-apps/util-linux-2.20.1-r1 static-libs >=dev-libs/libgpg-error-1.10-r1 static-libs >=dev-libs/libgcrypt-1.5.0-r1 static-libs >=dev-libs/popt-1.16-r1 static-libs Add this to /etc/portage/package.mask >=sys-fs/udev-182 emerge portage emerge gcc gcc-config -l gcc-config 2 env-update && source /etc/profile ![]() Code:
export PS1="(chroot) $PS1" Code:
emerge --oneshot libtool Code:
nano -w /etc/env.d/02locale LANG="xx_XX.UTF-8" LC_COLLATE="C" nano -w /etc/locale.gen locale-gen env-update && source /etc/profile ![]() Code:
export PS1="(chroot) $PS1" Code:
etc-update This will set your local time Code:
cp /usr/share/zoneinfo/XXXXX/XXXXX /etc/localtime echo "XXXX/XXXXXX" > /etc/timezone Now comes the kernel - I always make mine from scratch - you can find out how from here Code:
emerge gentoo-sources cd /usr/src/linux Now we do a few extra steps to get a nice screen when we boot up Code:
make emerge klibc emerge v86d make menuconfig add /usr/share/v86d/initramfs - under general setup make && make modules_install cp arch/x86_64/boot/bzImage /boot/kernel-3.3.1-gentoo Here is where you need to remember what you named your vg-ftpweb dir if you changed it Code:
nano -w /etc/fstab /dev/sda1 /boot ext4 defaults,noatime,nodev 1 2 /dev/mapper/vg-swap none swap sw 0 0 /dev/mapper/vg-root / ext4 defaults,noatime,nodev 0 1 /dev/mapper/vg-opt /opt ext4 defaults,noatime,nodev 0 1 /dev/mapper/vg-usr /usr ext4 defaults,noatime,nodev 0 1 /dev/mapper/vg-tmp /tmp ext4 defaults,noatime,nodev 0 1 /dev/mapper/vg-var /var ext4 defaults,noatime,nodev 0 1 /dev/mapper/vg-ftpweb /ftpweb ext4 defaults,noatime,nodev 0 1 proc /proc proc defaults 0 0 shm /dev/shm tmpfs nodev,nosuid,noexec 0 0 Code:
nano -w /etc/conf.d/hostname Code:
nano -w /etc/conf.d/net For staitc IP's config_eth0="192.168.1.20 netmask 255.255.255.0 brd 192.168.1.255" routes_eth0="default via 192.168.1.15" For DHCP config_eth0="dhcp" cd /etc/init.d ln -s net.lo net.eth0 rc-update add net.eth0 default Code:
nano -w /etc/hosts Code:
passwd - set the root password for your install Here you should just uncomment the options rc_logger="YES" and rc_sys="" Code:
nano -w /etc/rc.conf nano -w /etc/conf.d/rc Code:
nano -w /etc/conf.d/keymaps Code:
nano -w /etc/conf.d/hwclock Code:
emerge syslog-ng rc-update add syslog-ng default emerge vixie-cron rc-update add vixie-cron default emerge mlocate Code:
emerge iptables Code:
rc-update add sshd default Code:
emerge grub Code:
emerge -pv mdadm lvm2 busybox cryptsetup check that they have static and on some static-libs mkdir -p /usr/src/initramfs cd /usr/src/initramfs mkdir bin dev dev/mapper dev/vc etc newroot proc sys cp /bin/busybox /sbin/cryptsetup /sbin/lvm.static /sbin/mdadm bin mv bin/lvm.static bin/lvm ln -s busybox bin/cat ln -s busybox bin/mount ln -s busybox bin/sh ln -s busybox bin/switch_root ln -s busybox bin/umount ln -s busybox bin/sleep ln -s lvm bin/vgscan ln -s lvm bin/vgchange cp -a /dev/console /dev/sda2 /dev/null /dev/urandom dev cp -a /dev/mapper/vg-root dev/mapper ln -s ../console dev/vc/0 mkdir /dev/vc ln -s ../console /dev/vc/0 busybox dumpkmap > etc/kmap-us - again you can change this to your location ln -s busybox bin/loadkmap Code:
nano -w init
#!/bin/sh
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev
#for a french azerty keyboard
loadkmap < /etc/kmap-us
rescue() {
echo "Dropping to rescue shell" >&2
/bin/sh </dev/tty1 >/dev/tty1 2>&1
}
/bin/cryptsetup luksOpen /dev/sda2 vault || rescue
/bin/lvm pvscan || rescue
/bin/lvm vgscan || rescue
/bin/lvm vgchange -ay vg || rescue
mount -r /dev/mapper/vg-root /newroot || rescue
CMDLINE=`cat /proc/cmdline`
umount /dev
umount /sys
umount /proc
exec /bin/busybox switch_root /newroot /sbin/init ${CMDLINE}
Code:
chmod u+x init find . | cpio --quiet -o -H newc | gzip -9 > /boot/initramfs Code:
nano -w /boot/grub/grub.conf default 0 timeout 30 splashimage=(hd0,0)/boot/grub/splash.xpm.gz title Gentoo Linux 3.3.1 root (hd0,0) kernel /boot/kernel-3.3.1-gentoo root=/dev/sda2 rootfstype=ext4 video=uvesafb:1280x800-16,mtrr:3,ywrap initrd /boot/initramfs Now to finish things off Code:
grep -v rootfs /proc/mounts > /etc/mtab grub-install --no-floppy /dev/sda ![]() Code:
exit
cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -l /mnt/gentoo{/boot,/proc,}
reboot
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Gentoo.org - down? | Dark Atheist | Green Room | 2 | November 5th, 2009 12:00am |
| i can haz gentoo help? | Dark Atheist | Linux & BSD | 4 | November 18th, 2008 1:34am |
| which use flags for gentoo? | Dark Atheist | Linux & BSD | 11 | April 19th, 2008 8:34am |
| HOWTO: Install Nvidia Drivers in Ubuntu (or possibly any other linux distro) | lancer | Linux & BSD | 23 | August 24th, 2006 5:48pm |
| [Gentoo] Mysql does not work | DreamweaverN | Linux & BSD | 9 | June 5th, 2004 11:14pm |