You are not logged in.

#1 2005-12-25 12:05:05

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Script for fresh install..

Ok.. Ive been thinking of making a bash script, something I can run after every fresh install to download all my configs/settings that I have saved and copy them into the correct location. Not only that I want it to run for example this too:

pacman -Syu

but the problem is that I have to answer "Y" to install and stuff when asked.. dont know how to implement this into my script..

The goal with this script is that after a fresh install, after running my script it shall:

* install all packages / programs that I need/want
* Configure all settings / looks that I want
* download & install & set manual kernel & apply ck-patches

After the script is run everything should be as I would like it to be..

Any help is appreciated, even links to good bash scripting sites / hints & tips / new ideas are welcome.

/Jinn


The ultimate Archlinux release name: "I am your father"

Offline

#2 2005-12-25 12:11:30

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: Script for fresh install..

1st hint: running "yes | pacman -Syu" should cover the <I have to answer "Y" to install and stuff when asked> problem.

2nd hint: configs should probably tar-ed and bzipped and untared to destination

3rd hint: there's kernel26archck in [community] repo, containing the archck kernel (archck = ck + some other patches, something like cko) which you might find easier to set up.

Offline

#3 2005-12-25 12:14:14

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Script for fresh install..

jinn wrote:

but the problem is that I have to answer "Y" to install and stuff when asked.. dont know how to implement this into my script..

you can use --noconfirm to by pass the questions. You can also use yes and pipe it : yes "Y" | to whatever

Offline

#4 2005-12-25 16:37:43

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: Script for fresh install..

Sweet.. thanx!

about the kernel26archck.. I rather feel its better building the kernel myselft, and remove all of the stuff that I dont specifically need, and therefor obtaining a minimal / optimal settings for my computer. Is it possible to do the same with an arch kernel? I mean can I just go to the kernel folder and do make menuconfig and edit &save & compile?

Cheers
Jinn


The ultimate Archlinux release name: "I am your father"

Offline

#5 2005-12-25 16:40:29

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: Script for fresh install..

btw.. About pacman, is there a way to measure witch server works fastest for me than trying to manually download something from each server? is there a script or something to try out the connect / download speed of each server?


The ultimate Archlinux release name: "I am your father"

Offline

#6 2005-12-25 17:50:39

arooaroo
Member
From: London, UK
Registered: 2005-01-13
Posts: 1,268
Website

Re: Script for fresh install..

jinn wrote:

btw.. About pacman, is there a way to measure witch server works fastest for me than trying to manually download something from each server? is there a script or something to try out the connect / download speed of each server?

I'm not on my AL box at the moment, but isn't there an sortmirror script that somes with pacman?

Otherwise, Tor wrote a script called checkmirror in Python recently.

Offline

#7 2005-12-25 17:59:40

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: Script for fresh install..

I was also doing some research about this:

2nd hint: configs should probably tar-ed and bzipped and untared to destination

Couldnt find anything good... any hints on where I can read this or maybe a howto?

--Edit
Reading the tar manual right now..

cheers
Jinn


The ultimate Archlinux release name: "I am your father"

Offline

#8 2005-12-26 19:12:18

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Script for fresh install..

IceRAM wrote:

1st hint: running "yes | pacman -Syu" should cover the <I have to answer "Y" to install and stuff when asked> problem.

2nd hint: configs should probably tar-ed and bzipped and untared to destination

3rd hint: there's kernel26archck in [community] repo, containing the archck kernel (archck = ck + some other patches, something like cko) which you might find easier to set up.

LOL, I love that, sounds like IceRAM already 'knows the answer' and is helping you along tongue They're good pointers though.

I've been thinking about something like this for a while... I have a rather laboriously written bash script that I add to whenever I change a configuration file, and I've cronned it to back up all these files weekly, as well as make a list of the packages I have in a dated text file. I haven't written the script to return everything to its proper place though, so this would be good.

The main reason that I haven't done it myself is that scripts like LostFiles (see the wiki scripts section) clear out any unwanted junk from the system anyway... so I'm assuming you want this in case something goes horrifically wrong, or because you want to mirror your installation elsewhere?

Don't get me wrong, I still think it's a great idea; keep us posted. big_smile


.oO Komodo Dave Oo.

Offline

#9 2005-12-26 19:14:34

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Script for fresh install..

Penguin wrote:
jinn wrote:

but the problem is that I have to answer "Y" to install and stuff when asked.. dont know how to implement this into my script..

you can use --noconfirm to by pass the questions. You can also use yes and pipe it : yes "Y" | to whatever

..and in fact you only need yes |, correct?


.oO Komodo Dave Oo.

Offline

#10 2005-12-26 19:22:29

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Script for fresh install..

Komodo wrote:
Penguin wrote:
jinn wrote:

but the problem is that I have to answer "Y" to install and stuff when asked.. dont know how to implement this into my script..

you can use --noconfirm to by pass the questions. You can also use yes and pipe it : yes "Y" | to whatever

..and in fact you only need yes |, correct?

that will output a lowercase y, but in his question he wanted an uppercase.

Offline

#11 2005-12-26 19:32:31

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: Script for fresh install..

jinn wrote:

about the kernel26archck.. I rather feel its better building the kernel myselft, and remove all of the stuff that I dont specifically need, and therefor obtaining a minimal / optimal settings for my computer. Is it possible to do the same with an arch kernel? I mean can I just go to the kernel folder and do make menuconfig and edit &save & compile?

Pointer: "man makepkg"

ArchCK kernel info: pkg info.
Download all the files needed for the package from CVS (there's a link on the above page pointing here) and run makepkg in the folder where you saved them. A new kernel26archkernel will be built. You might want to previously customize the pkgname/pkgver/pkgrel in the PKGBUILD.

Note that the kernel will be compiled with the config from the "config" file. You can replace the config with something else (obtained by running make menuconfig or whatever) - don't forget to update the md5sums in case you replace any of the files needed by the PKGBUILD.

About packages: there was some script around here (forums) which allowed a user to make a custom ArchLinux install CD, allowing someone to put on the CD what packages they needed. You might find helpful.

Good luck.

Offline

#12 2005-12-26 20:21:38

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Script for fresh install..

Penguin wrote:
Komodo wrote:
Penguin wrote:

you can use --noconfirm to by pass the questions. You can also use yes and pipe it : yes "Y" | to whatever

..and in fact you only need yes |, correct?

that will output a lowercase y, but in his question he wanted an uppercase.

Useful to know, thanks. Would that usually matter? Are most things case insensitive for such input or not?


.oO Komodo Dave Oo.

Offline

#13 2005-12-26 22:52:00

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: Script for fresh install..

About packages: there was some script around here (forums) which allowed a user to make a custom ArchLinux install CD, allowing someone to put on the CD what packages they needed. You might find helpful.

Yes I am aware of that. Ive been studying that script a little and checking what is done. Anyway I am almost finished with my script and it doesnt contain any difficult or complex functions.. its really simple..

about why I want this script is because I do alot of reinstalls from scratch.. usually because I break the system by trying different stuff or when I feel like I have played to much with installing / configurating packages / configs and that it does not perform as good as it should..

Another reason is that I want to use this script to install on my other computers.. Ofcourse some files such as xorg.conf will have to be edited but only very small piece of it.. this will save me alot of time, not only that,  all the packages that I use will  be installed too.. so that I dont need to graduately install everything as I need them.. I mean packages like xpdf or java are a must among many others.. why not make save some time instead of doing pacman individually for each package.. Also I could forget the names of some certain packages..

in my case.. its a timesaver.. and fun smile. I am basicly new to writing scripts so this is educational for me!

another thing I want to get of my chest.. linux rulez!! so extremely much better than windoze.. I couldnt say this as honestly as I wished, if I had not come in counter with a great linux distro called arch..


The ultimate Archlinux release name: "I am your father"

Offline

#14 2005-12-27 00:06:31

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Script for fresh install..

yeah, linux is awesome man... once you pop, you just can't stop! big_smile


.oO Komodo Dave Oo.

Offline

#15 2005-12-27 11:52:40

postlogic
Member
Registered: 2005-02-24
Posts: 410
Website

Re: Script for fresh install..

Just a suggestion, but what you could do, is to create a PKGBUILD for your script, include it on a custom arch install cd and then you'll have it all without having to do anything but install :-)

Offline

#16 2005-12-27 16:46:16

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: Script for fresh install..

@postlogic

hey.. thats a sweet idea.. thanx. I'll work on that as soon as I try out the script and check that it works as it should.

cheers mate
Jinn


The ultimate Archlinux release name: "I am your father"

Offline

#17 2005-12-27 17:51:58

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Script for fresh install..

Please keep us posted on this one jinn; it will be a most useful script to have.

If you run out of steam and think of calling it quits, don't! Come by here and ask more Qs in this thread, or show us what you've done so far.

Good luck wink


.oO Komodo Dave Oo.

Offline

#18 2005-12-28 07:17:44

postlogic
Member
Registered: 2005-02-24
Posts: 410
Website

Re: Script for fresh install..

Anyone knows if there's any way to modify the install script to add more files to configure during the install process? That would -definately- be nice, too.

It would solve the "issue" about you having to alter xorg.conf for your different systems too, jinn.

Offline

#19 2005-12-28 11:38:38

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Script for fresh install..

postlogic wrote:

It would solve the "issue" about you having to alter xorg.conf for your different systems too, jinn.

A good point postlogic, although hopefully Tpowa's new simple hardware detection tool will be integrated soon, which *should* solve that problem; nonetheless, I guess it'd be handy to be able to add stuff yourself, since automated detection is never perfect tongue


.oO Komodo Dave Oo.

Offline

#20 2005-12-28 19:54:46

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: Script for fresh install..

getting better and better ideas from you guys, thanks!

I'll have to take a little break from arch.. I have exam soon and the last week Ive been sitting atleast 5h/day fixing my newly installed arch & trying out new stuff, working with the script.. Damn.. its really addictive.. I know that I have to make my brother hide the laptop or i wont be able to hold myself.. crap..

Anyway keep on posting sweet ideas smile. Ill work on the script as soon as I get some time.

Cheers mates!
Jinn


The ultimate Archlinux release name: "I am your father"

Offline

#21 2005-12-28 20:24:44

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Script for fresh install..

jinn wrote:

I know that I have to make my brother hide the laptop or i wont be able to hold myself..

Boy, do I know that feeling...


.oO Komodo Dave Oo.

Offline

#22 2006-01-18 22:07:25

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: Script for fresh install..

I'm back!

My exams are over.. but new courses started, yet the exams for the new courses wont be until 8 weeks. So I will reserve the last week as always for crazy 10hours studying and use the other 7 weeks irresponsively with arch / movies / fun & lazy stuff..

Damn it feels good to be able to nerd of with archlinux again. I would easily say to stop playing with linux is harder than stop smoking..


The ultimate Archlinux release name: "I am your father"

Offline

Board footer

Powered by FluxBB