View previous topic :: View next topic |
Author |
Message |
slycordinator Advocate
Joined: 31 Jan 2004 Posts: 3065 Location: Korea
|
Posted: Sat Mar 26, 2005 9:22 pm Post subject: |
|
|
thebigslide wrote: | I like the idea of using sfdisk to setup the partition table. |
Here's how you'd do it.
To store everything for your partition table:
Code: | dd if=/dev/(your_disk) of=mbr.save count=1 bs=512
sfdisk -d /dev/(your_disk) > partitions.save |
Then to restore them:
Code: | dd if=mbr.save of=/dev/(your_disk)
sfdisk /dev/(your_disk) < partitions.save |
The dd command saves the first 512 bytes which will get the table of primary partitions. Then the sfdisk command saves the rest.
Of course this automated way of doing it assumes you already have a set partition table you want saved from an old configuration and the storing part must be done in a running system.
But if with each of your installs the partition scheme stays the same this is a saver.
Last edited by slycordinator on Mon Mar 28, 2005 7:19 am; edited 1 time in total |
|
Back to top |
|
|
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3355 Location: Jackass! Development Labs
|
|
Back to top |
|
|
slycordinator Advocate
Joined: 31 Jan 2004 Posts: 3065 Location: Korea
|
Posted: Sat Mar 26, 2005 10:22 pm Post subject: |
|
|
Why the ( ) ? Would you have preferred this to be in the troubleshooting thread? I was just showing a way to make his script more automated.
And I had just remembered how you'd do it so I posted it. |
|
Back to top |
|
|
hielvc Advocate
Joined: 19 Apr 2002 Posts: 2805 Location: Oceanside, Ca
|
Posted: Sun Mar 27, 2005 6:25 pm Post subject: |
|
|
thebigslide the one problem I see with your script is the Quote: | emerge gcc-config glibc binutils gcc --oneshot && gcc-config i686-pc-linux-gnu-3.4.3 && source /etc/profile | On my box when gcc hickuped a couple of days ago its was caused by Code: | ls /usr/lib/gcc-lib/i686-pc-linux-gnu/
3.3.3/ 3.3.5/ 3.4.3@ 3.4.3-20050110/ | because gcc-config was pointing to 3.4.3 instead of 3.4.3-20050110. This is one of the re-occuring probs with updateing gcc. _________________ An A-Z Index of the Linux BASH command line |
|
Back to top |
|
|
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3355 Location: Jackass! Development Labs
|
Posted: Mon Mar 28, 2005 3:18 am Post subject: |
|
|
slycordinator wrote: | Why the ( ) ? |
i'm just eagerly waiting for the new script to be posted. its getting hard to keep holding my breath! _________________ .
Stage 1/3 | Jackass! | Rockhopper! | Thanks | Google Sucks |
|
Back to top |
|
|
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3355 Location: Jackass! Development Labs
|
|
Back to top |
|
|
slycordinator Advocate
Joined: 31 Jan 2004 Posts: 3065 Location: Korea
|
Posted: Mon Mar 28, 2005 6:48 am Post subject: |
|
|
Bob P wrote: |
i'm just eagerly waiting for the new script to be posted. its getting hard to keep holding my breath! |
I've edited it to include the stuff I mentioned before:
Code: |
#!/bin/bash
##Do\ Bob\'s\ Install
instdisk=sda
fstype=reiserfs
fsnum=sda1
# If you want to manually create partition scheme uncomment next line
#fdisk /dev/$instdisk
# If you want to use a previously saved configuration for your partition scheme
# Uncomment the next 2 lines (also change the file names to suit your saved config)
#dd if=mbr.save of=/dev/$instdisk
#sfdisk /dev/$instdisk < partitions.save
mkfs.${fstype} /dev/${fsnum}
mount /dev/$fsnum -t $fstype /mnt/gentoo
cd /mnt/gentoo
tar xvjpf ~/gentoo-stage3-x86-2004.3.tar.bz2
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
cp /etc/resolv.conf etc/resolv.conf
touch etc/portage/package.{use,keywords,mask,unmask}
mkdir usr/portage;chown portage:portage usr/portage
cat <<- EOF >> etc/portage/package.use
sys-libs/glibc userlocales
sys-kernel/ck-sources symlink
sys-apps/shadow pam
EOF
cat <<- EOF >> etc/portage/package.keywords
sys-devel/gcc ~x86
sys-devel/gcc-config ~x86
sys-libs/libstdc++-v3 ~x86
sys-libs/glibc ~x86
EOF
cat <<- EOF >> etc/portage/package.mask
>sys-devel/gcc-3.4.3-r1
>sys-devel/gcc-config-1.3.9
>sys-libs/libstdc++-v3-3.3.4
>sys-libs/glibc-2.3.4.20050125
EOF
rm etc/make.conf;touch etc/make.conf
cat <<- EOF >> etc/make.conf
USE="nptl gtk -pam -ipv6 mmx sse 3dnow 3dnowex -nls ssl"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -mcpu=athlon-xp -O2 -s -w -pipe -fomit-frame-pointer"
CXXFLAGS="\${CFLAGS}"
PKGDIR=${PORTDIR}/packages
PORT_LOGDIR=/var/log/portage
FEATURES="autoclean userpriv usersandbox sandbox"
EOF
mkdir usr/local/portage;chown portage:portage usr/local/portage
mkdir var/log/portage;chown portage:portage var/log/portage
cat <<- EOF >> etc/locales.build
en_US/ISO-8859-1
en_US.UTF-8/UTF-8
EOF
touch nptl-update;chmod +x nptl-update
cat <<- EOF >> nptl-update
#!/bin/bash
env-update && source /etc/profile
ln -sf /usr/share/zoneinfo/Canada/Central etc/localtime
emerge sync
emerge -C linux-headers && emerge linux26-headers
emerge gcc-config glibc binutils gcc --oneshot && gcc-config 2 && source /etc/profile
rm /etc/make.conf && touch /etc/make.conf
cat <<- EOTF >> etc/make.conf
USE="nptl pthreads ithreads gtk python X -pam xml xml2 zlib -ipv6 mmx ssl 3dnow 3dnowex -nls chroot sftplogging"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -s -w -pipe -fomit-frame-pointer -momit-leaf-frame-pointer -ftracer -mtune=athlon-xp"
CXXFLAGS="\${CFLAGS} -fvisibility-inlines-hidden"
LDFLAGS="-Wl,-O1"
PKGDIR=\${PORTDIR}/packages
PORT_LOGDIR=/var/log/portage
PORTDIR_OVERLAY=/usr/local/portage
PORTAGE_NICENESS=3
FEATURES="autoclean userpriv usersandbox sandbox distlocks ccache"
CCACHE_SIZE="2G"
EOTF
emerge --nodeps ccache
emerge glibc gcc binutils portage glib --oneshot && emerge -e world;env-update;source /etc/profile
EOF
chroot . /nptl-update
echo "Install a bootloader, logger, cron, kernel and reboot"
echo "The author suggests grub, syslog-ng, vixie-cron and ck-sources-2.6.10-ck6"
/bin/bash
|
I also changed the gcc-config command from gcc-config i686-pc-linux-gnu-3.4.3 to gcc-config 2. I believe that'll fix the problem hielvc noted.
edit: Fixed a typo
2nd edit: Fixed make.conf creation
Last edited by slycordinator on Tue Apr 05, 2005 1:13 am; edited 1 time in total |
|
Back to top |
|
|
Schietschijf n00b
Joined: 04 Jan 2005 Posts: 36 Location: Mortsel, Antwerp, Flanders
|
Posted: Tue Mar 29, 2005 9:43 pm Post subject: |
|
|
hello, first of all, I want to thank Bob for this guide! It is really wonderfull and even easier than the gentoo installation guide :p
Second, I want to tell that i did this guide but with the stage3 tarball for the amd64 2005.0. Still it's following the guide but there are only 2 differences I think.
This stage (stage3 for amd64 of the 2005.0 release) already contains gcc 3.4.x, so its al little bit shorter for amd64 users...
Second difference is that linux26-headers doesn't exist anymore in 2005.0, it's now linux-headers version 2.6.x...
That's all that was different, except from my graphical card..
Once again thank you for this guide!
[edit]
Ow, yes, also in my make.conf i did for the CFLAGS -march=athlon64 -mtune=athlon64 and all the rest stays the same...
[/edit] _________________ 56k ruleD ! |
|
Back to top |
|
|
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3355 Location: Jackass! Development Labs
|
Posted: Wed Mar 30, 2005 6:14 am Post subject: |
|
|
glad to hear that you've had good luck.
BTW, we have a thread specifically for using this method with 2005.0. if anyone is interested in using this guide with 2005.0, please look there. we're limiting this thread to 2004.3.
thanks! _________________ .
Stage 1/3 | Jackass! | Rockhopper! | Thanks | Google Sucks |
|
Back to top |
|
|
plonka2000 Apprentice
Joined: 02 Dec 2004 Posts: 160 Location: UK, Surrey
|
Posted: Wed Mar 30, 2005 8:53 am Post subject: |
|
|
Just marking this, as I always come back to it so much... _________________ -Do not be afraid of what is different.
-Do not be afraid of being different.
-After all, ignorance is not an excuse.
Using Gentoo and Windows XPee.
Check my site here |
|
Back to top |
|
|
ruach n00b
Joined: 28 May 2004 Posts: 67 Location: Utah
|
|
Back to top |
|
|
whabee n00b
Joined: 08 Mar 2005 Posts: 42
|
Posted: Thu Mar 31, 2005 9:59 pm Post subject: |
|
|
Great guide bob I followed it on a clean stage 3 install of 2005.0 on a P4 3.0/Intel D865GLCL and it worked flawless, was the fastest and cleanest install of gentoo I ever did and I have done about 30 to date, I love to test and break stuff. Only problems I had were typo errors on my part. |
|
Back to top |
|
|
slycordinator Advocate
Joined: 31 Jan 2004 Posts: 3065 Location: Korea
|
Posted: Mon Apr 04, 2005 8:00 pm Post subject: |
|
|
I noticed a problem (that I don't know how to fix) with the script made earlier by myself and thebigslide.
Here's a section of it:
Code: | rm etc/make.conf;touch etc/make.conf
cat <<- EOF >> etc/make.conf
USE="nptl gtk -pam -ipv6 mmx sse 3dnow 3dnowex -nls ssl"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -mcpu=athlon-xp -O2 -s -w -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
PKGDIR=${PORTDIR}/packages
PORT_LOGDIR=/var/log/portage
FEATURES="autoclean userpriv usersandbox sandbox"
EOF |
After running this section of code, you get /etc/make.conf with the following:
Code: | USE="nptl gtk -pam -ipv6 mmx sse 3dnow 3dnowex -nls ssl"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -mcpu=athlon-xp -O2 -s -w -pipe -fomit-frame-pointer"
CXXFLAGS=""
PKGDIR=/packages
PORT_LOGDIR=/var/log/portage
FEATURES="autoclean userpriv usersandbox sandbox" |
because when that script is run it looks at CFLAGS as a variable. So when it sees ${CFLAGS} it evaluates that to " " since it's an undefined variable.
edit: Well the way to fix it is to explicitly set CXXFLAGS without a reference to CFLAGS if you want an automated script. |
|
Back to top |
|
|
pijalu Guru
Joined: 04 Oct 2004 Posts: 365
|
Posted: Mon Apr 04, 2005 8:33 pm Post subject: |
|
|
slycordinator wrote: |
...
Code: |
cat <<- EOF >> etc/make.conf
USE="nptl gtk -pam -ipv6 mmx sse 3dnow 3dnowex -nls ssl"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -mcpu=athlon-xp -O2 -s -w -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
PKGDIR=${PORTDIR}/packages
PORT_LOGDIR=/var/log/portage
FEATURES="autoclean userpriv usersandbox sandbox"
EOF |
... |
IMHO, escaping the $ should do the trick for CFLAG and PORTDIR
Code: |
cat <<- EOF >> etc/make.conf
USE="nptl gtk -pam -ipv6 mmx sse 3dnow 3dnowex -nls ssl"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -mcpu=athlon-xp -O2 -s -w -pipe -fomit-frame-pointer"
CXXFLAGS="\${CFLAGS}"
PKGDIR=\${PORTDIR}/packages
PORT_LOGDIR=/var/log/portage
FEATURES="autoclean userpriv usersandbox sandbox"
EOF |
|
|
Back to top |
|
|
slycordinator Advocate
Joined: 31 Jan 2004 Posts: 3065 Location: Korea
|
Posted: Tue Apr 05, 2005 1:12 am Post subject: |
|
|
That worked perfectly, thanks. Editing the script as such. |
|
Back to top |
|
|
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3355 Location: Jackass! Development Labs
|
|
Back to top |
|
|
|