View previous topic :: View next topic |
Author |
Message |
bandrews n00b
Joined: 30 Mar 2005 Posts: 3
|
Posted: Fri Apr 01, 2005 4:14 am Post subject: 2005.0 quick installation script |
|
|
works great for me, i'm just sharing
* you need bin packages if you want to save a ton of time by not compiling anything
* speaking of which you need binaries + source of your 2.6 kernel available for download
NOTE ABOUT VPN_2611_complete.tbz2 : this has binaries of the 2.6.11+mppe gentoo kernel, source to a patched ppp for mppe/vpn , the kernel source itself, kernel modules, grub.conf. if you email me or send me a message on here i'll send you a link to the tarball, it's 75megs and i dont know how many people will leech it
Code: | #!/bin/bash
echo ""
echo ""
echo "speedy stage3-x86 gentoo installation script, ok to wipe /dev/hda right?"
echo ""
echo "assuming..."
echo "* networking is up and i can get to the internet"
echo "* we booted off the Gentoo 2005.0 LiveCD to get to this point"
echo "* IDE system, 1 hdd, drivers where autodetected"
echo "* you have access to IO's v2.6 kernel with pptp VPN support and patched ppp"
echo "* your ok with ext3 for everything, and everything compiled for x86"
echo "* you have access to the binary packages to speed things up"
echo ""
echo -n "Hostname [firewall_1]: "
read HOSTNAME
if [ -z "$HOSTNAME" ]; then
echo "...defaulting to firewall_1."
HOSTNAME=firewall_1
fi
echo -n "Domain Name [domain.tld]: "
read DNAME
if [ -z "$DNAME" ]; then
echo "...defaulting to domain.tld"
DNAME="domain.tld"
fi
# i'm hiding my binary packages because i cant host for the whole internet
echo -n "Porage Bin Host [http://xxxxx.xxx/i686/All]: "
read BHOST
if [ -z "$BHOST" ]; then
echo "...defaulting to http://xxxxx.xxx/i686/All"
BHOST="http://xxxxx.xxx/i686/All"
fi
echo "###########################"
echo make sure ...
echo /dev/hda1 = ~50megs for /boot
echo /dev/hda2 = SWAP SPACE
echo /dev/hda3 = / for everything else
echo "###########################"
echo -n "press any key to continue..."
read
cfdisk /dev/hda
mkfs.ext3 -l /boot /dev/hda1
mkswap /dev/hda2
swapon /dev/hda2
mkfs.ext3 -l / /dev/hda3
mount /dev/hda3 /mnt/gentoo
cd /mnt/gentoo
tar jpxfv /mnt/cdrom/stages/stage3-x86-2005.0.tar.bz2
cd usr
tar jpxfv /mnt/cdrom/snapshots/portage-20050303.tar.bz2
cp /etc/resolv.conf /mnt/gentoo/etc
mount -t proc none /mnt/gentoo/proc
mount /dev/hda1 /mnt/gentoo/boot
echo "#!/bin/bash
env-update
echo \"adding custom aliases to /etc/profile\"
echo \"
alias ls='ls -lah --color=always'
alias nano='nano -w'
alias pico='nano -w'
\" >> /etc/profile
source /etc/profile
emerge sync
echo \"
#these are needed for a distcc bugfix
CC=\\\"gcc\\\"
CXX=\\\"c++\\\"
#MAKEOPTS=\\\"-j12\\\"
FEATURES=\\\"fixpackages buildpkg\\\" #distcc
PORTAGE_BINHOST=\\\"$BHOST\\\"
USE=\\\"-X -qt -gtk mmx sse -gnome -kde snmp imap ldap gd curl apache2 mysql spamassassin qmail samba sqlite ssl readline postgres png php mhash mcal ipv6 imagemagick\\\"
\">> /etc/make.conf
cd /etc
echo setting up timezone to MST
ln -sf /usr/share/zoneinfo/MST /etc/localtime
echo setting up hostname
echo $HOSTNAME > /etc/hostname
echo $DNAME > /etc/dnsdomainname
echo \"127.0.0.1 $HOSTNAME.$DNAME $HOSTNAME\" >> /etc/hosts
echo setting eth0 to DHCP
echo \"
#iface_eth0=\\\"192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0\\\"
#iface_eth1=\\\"207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0\\\"
iface_eth0=\\\"dhcp\\\"
#dhcpcd_eth0=\\\"...\\\"
#alias_eth0=\\\"192.168.0.3 192.168.0.4\\\"
#broadcast_eth0=\\\"192.168.0.255 192.168.0.255\\\"
#netmask_eth0=\\\"255.255.255.0 255.255.255.0\\\"
#gateway=\\\"eth0/192.168.0.1\\\"
\" > /etc/conf.d/net
echo setting up fstab
echo \"
/dev/hda1 /boot ext3 noauto,noatime 1 1
/dev/hda3 / ext3 noatime 0 0
/dev/hda2 none swap sw 0 0
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
\" > /etc/fstab
cd /etc/init.d
ln -s net.eth0 net.eth1
emerge -gk sysklogd logrotate vixie-cron grub coldplug tcpdump traceroute nmap slocate dhcpcd whois gentoolkit devfsd distcc vnstat iptables eject bind-tools lrzsz netkit-telnetd
rc-update -a domanname default
rc-update -a sshd default
rc-update -a sysklogd default
rc-update -a vixie-cron default
rc-update -a coldplug default
rc-update -a net.eth0 default
echo \"setting up vnstat in cron\"
echo \"#!/bin/bash
if [ -x /usr/bin/vnstat ] && [ \\\`ls /var/lib/vnstat/ | wc -l\\\` -ge 1 ] ; then
exec /usr/bin/vnstat -u
fi
\" > /etc/cron.hourly/vnstat.cron
cd /usr/src
wget http://xxxxx.xxx/VPN_2611_complete.tbz2
echo uncompressing kernel and vpn toys...
tar jpxf VPN_2611_complete.tbz2
rm -rf VPN_2611_complete.tbz2
cd VPN
mv usr/src/* /usr/src
mv boot/* /boot
mv etc/* /etc
echo enabling tcpip speed boosts on bootup
echo \"/etc/speed.sh\" >> /etc/conf.d/local.start
echo autoloading pptp vpn encryption module on bootup
echo \"ppp_mppe_mppc\" >> /etc/modules.autoload.d/kernel-2.6
mkdir /lib/modules
mv lib/modules/* /lib/modules
mv /boot/grub.conf /boot/grub/
# i used a patched ppp package that i know works with the kernels pptp modules - i need vpn myself
cd ppp*
make install
echo injecting ppp into the package.provided list
mkdir -p /etc/portage/profile/
echo \"net-dialup/ppp-2.4.2-r10\" >> /etc/portage/profile/package.provided
echo masking ppp so it isn't updated by portage later
echo \">net-dialup/ppp-2.4.2-r10\" >> /etc/portage/package.mask
cp etc.ppp/options /etc/ppp
cp etc.ppp/*-secrets /etc/ppp
chmod o-rwx /etc/ppp/*-secrets
make clean
cd ..
# lets use gentoos port instead
rm -rf pop*
emerge -gk pptp
echo \"
localip 192.168.254.254
remoteip 192.168.254.20-200
\" >> /etc/pptpd.conf
rc-update -a pptpd default
echo \"masking glibc for stability...\"
echo \">sys-libs/glibc-2.3.4.20040808-r1\" >> /etc/portage/package.mask
echo \"setting up rev libs rebuild warning for root login...\"
echo \"
echo \\\"
* Any package that linked against previous versions of packages can be relinked with
* EG: revdep-rebuild --soname libintl.so.2
\\\"
\" >> /root/.profile
echo \"##########################\"
echo set root password
passwd
echo \"#########################################################\"
echo setup grub now
echo HINT:
echo \"\"
echo \"grub> root (hd0,0) (Specify where your /boot partition resides)\"
echo \"grub> setup (hd0) (Install GRUB in the MBR)\"
echo \"grub> quit (Exit the GRUB shell)\"
echo -n \"press any key to continue...\"
read
grub --no-floppy
echo \"###############\"
echo \"everything go ok? your now on the LiveCD, not chrooted\"
rm -rf /finish_up.sh
" > /mnt/gentoo/finish_up.sh
chmod a+x /mnt/gentoo/finish_up.sh
chroot /mnt/gentoo ./finish_up.sh
|
|
|
Back to top |
|
|
kimchi_sg Advocate
Joined: 26 Nov 2004 Posts: 2969
|
Posted: Fri Apr 01, 2005 4:28 am Post subject: |
|
|
Good work.
A suggestion: - include branching in the script to take care of different networking configurations?
I do not need to use PPTP as I enjoy a T2 ethernet pipe from university dorm.
- Allow PORTAGE_BINHOST variable to be made optional, as the majority of the world gets by without one.
- Don't overwrite the default /etc/fstab, use sed to replace the /dev/ROOT, /dev/SWAP and /dev/BOOT entries with the correct values, which should be input by the user beforehand, if possible.
This is to accomodate those who do not have a /boot partition at all.
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|