You are not logged in.

#1 2012-08-04 20:30:34

aichingm
Member
Registered: 2011-10-13
Posts: 25

A bash archlinux install script

hi,
i did this yesterday late in the night so it is not perfect but it worked for me!

since the "graphical installer" is history, archlinux has to be installed by hacking the shell. My script will automate the install progress so you just have to enter some parameter in the begining!

you can try it on a virtualbox or use it on a "real" pc.

pls let me now about ideas, errors and any ohter feedback!

Mario

here is the link:
http://arch.mario-aichinger.at/install.sh

use it by entering

 [archiso~]# wget arch.mario-aichinger.at/install.sh
 [archiso~]#. install.sh

Offline

#2 2012-08-04 20:35:05

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: A bash archlinux install script

Isn't a separate /boot partition considered unnecessary these days? And why ext2 partitioning?

Did rather have the thought myself when I saw the original news post - good work for cracking on with it though wink

Offline

#3 2012-08-04 20:38:04

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,642

Re: A bash archlinux install script

satanselbow wrote:

Isn't a separate /boot partition considered unnecessary these days? And why ext2 partitioning?

1. Possibly unnecessary but that doesn't make it a bad idea. A separate /home is also unnecessary, yet many people recommend it.

2. ext2 because /boot has few read/write cycles and needs no journal (and a journal takes up space and time).

Last edited by 2ManyDogs (2012-08-04 20:42:20)


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#4 2012-08-04 20:41:45

aichingm
Member
Registered: 2011-10-13
Posts: 25

Re: A bash archlinux install script

thank you for your replay!

I used a separate boot partition with ext2 because i now that it is working wink you know I used method for a long time and I didn't changed it...

but I will add a "if" on this so the user can decide!

thanks to 2ManyDogs for the technical background!

Last edited by aichingm (2012-08-07 10:04:17)

Offline

#5 2012-08-04 20:47:57

aichingm
Member
Registered: 2011-10-13
Posts: 25

Re: A bash archlinux install script

I know some of the default values are not good chosen but they are just default values wink

Offline

#6 2012-08-05 07:17:11

shadyabhi
Member
From: Bangalore
Registered: 2010-05-23
Posts: 262
Website

Re: A bash archlinux install script

satanselbow wrote:

Isn't a separate /boot partition considered unnecessary these days? And why ext2 partitioning?

I have it because my root partition is encrypted.

Offline

#7 2012-08-06 11:33:15

yaffare
Member
Registered: 2011-12-29
Posts: 71

Re: A bash archlinux install script

Great work! - simple and straightforward

If you have too much time someday you could add choice for syslinux, would be cool


systemd is like pacman. enjoys eating up stuff.

Offline

#8 2012-08-06 15:57:52

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,891
Website

Re: A bash archlinux install script

You have a spelling error 'format'

Look forward to testing, great work smile

Would like to see functions they are easy to create and making scripting much easier

function foo()
{
# code
}

You can then call them for example

keymap
clock
disks
config
bootloader

Mr Green

Offline

#9 2012-08-06 17:26:49

theshadster
Member
Registered: 2012-08-06
Posts: 29

Re: A bash archlinux install script

Sorry for butting in, but I noticed one thing in your script:

"grub-install" specifies an i386 machine as a target. As grub-install will automatically default to
  the current machine, isn't the stipulation of 'i386'  unwarranted ?

A nice script though - I'm about to give it a spin myself !


EDIT:
         Removed a second 'thing' I noticed, after I noticed that I didn't notice it. I think...

Last edited by theshadster (2012-08-06 17:30:29)

Offline

#10 2012-08-06 23:38:20

aichingm
Member
Registered: 2011-10-13
Posts: 25

Re: A bash archlinux install script

Hey thank you all for your replays smile

Got syslinux onboard!

Fixed the 'format' thing and thinking about the function post...

Ok theshadster, I hope I got you right... I removed the --target=i386 on the grub-install. I added it because of

https://wiki.archlinux.org/index.php/GRUB2#Install_to_440-byte_MBR_boot_code_region wrote:

Note: Without --target or --directory option, grub-install cannot determine for which firmware grub(2) is being installed. In such cases grub-install will show source_dir doesn't exist. Please specify --target or --directory message.

maybe this is wrong in the wiki!? Or I just got it wrong... how ever it works so the default is now as the grub-install -h says "current".

Have a nice day/night!
Mario

Offline

#11 2012-08-07 00:51:11

yaffare
Member
Registered: 2011-12-29
Posts: 71

Re: A bash archlinux install script

aichingm wrote:

Got syslinux onboard!

Thx:)

Just posting these things as I noticed them:
- typo "Use costom mirror?" (custom)
- you forgot the slash in "./install.sh", you wrote ". install.sh"
- you could add "chmod +x install.sh" after the wget command
- really nice would be to write the hole output in a text-file, because you cant scroll up
  and so I am never sure if there were any errors. I think you could do this easy
  with the "script textfile.txt" command and then "exit" at the end to leave script-session.


systemd is like pacman. enjoys eating up stuff.

Offline

#12 2012-08-07 02:40:22

1archgamenon2
Banned
Registered: 2011-07-12
Posts: 201

Re: A bash archlinux install script

I need to install on 2 boxes: can U explain more?

Offline

#13 2012-08-07 08:59:00

aichingm
Member
Registered: 2011-10-13
Posts: 25

Re: A bash archlinux install script

corrected typo.

yaffare wrote:

- you forgot the slash in "./install.sh", you wrote ". install.sh"
- you could add "chmod +x install.sh" after the wget command

could you explain why using . install.sh is not good? It  works well and I have not to chmod it before but I'm open for everything!

yaffare wrote:

- really nice would be to write the hole output in a text-file, because you cant scroll up
  and so I am never sure if there were any errors. I think you could do this easy
  with the "script textfile.txt" command and then "exit" at the end to leave script-session.

I'm working on this but for now you have to do it like this:

. install.sh | tee outfile.txt

which is not as good as possible because of some formatting errors on the output in the script but it works...

1archgamenon2 wrote:

I need to install on 2 boxes: can U explain more?

ok, I will try,  but if you could ask more specific it would be easier for me  to help you.

- download the install iso from http://www.archlinux.org/download/
- boot into it
- if you got the prompt setup a network connection
- enter "wget arch.mario-aichinger.at/install.sh"
- and run the script by entering ". install.sh" (imo, for more info read the comment above yours)
- the next steps are very easy: just type in what you will be asked for!
- reboot
- et voilà

Mario

Offline

#14 2012-08-07 09:03:03

buzzqw
Member
Registered: 2010-08-18
Posts: 59

Re: A bash archlinux install script

Hi Mario

just to say: works well smile
tested on Virtualbox

how about also create an rc.conf with LANG, timezone... as used to be ?
also: about asking for adding an user ? (with usual grups access)

thanks

BHH


HDConvertToX, AutoMen, AutoMKV author

Offline

#15 2012-08-07 09:49:55

aichingm
Member
Registered: 2011-10-13
Posts: 25

Re: A bash archlinux install script

hey BHH thank you for testing smile

buzzqw wrote:

how about also create an rc.conf with LANG, timezone... as used to be ?
also: about asking for adding an user ? (with usual grups access)

since the new installer the timezone will be set by using this and not longer in the rc.conf file check out "man rc.conf" for more infos:

Symlink /etc/localtime to /usr/share/zoneinfo/Zone/SubZone. Replace Zone and Subzone to your liking. For example:
# ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime

The install script is already doing this for you by asking for Zone and SubZone. Also the is LANG now set at a different place  (/etc/locale.conf) which is also done in the install script (now^^).

I don't know if adding users is part of the installation or part of the system configuration!? but I will think about this!

Mario

Offline

#16 2012-08-07 10:46:17

aichingm
Member
Registered: 2011-10-13
Posts: 25

Re: A bash archlinux install script

#UPDATE

now the installer will ask for additional packages smile so you can install vim or something else at the installation process!

updated version is now at arch.mario-aichinger.at/install.sh

have fun

Mario

Offline

#17 2012-08-07 11:03:22

totte
Member
Registered: 2011-08-22
Posts: 64

Re: A bash archlinux install script

I used the following in my installation script to select the highest rated local mirror and put it in the top, maybe you'll find it useful:

# Copy header to temporary file
sed -n 1,6p /etc/pacman.d/mirrorlist > /etc/pacman.d/tmp
# Copy first match for Sweden to temporary file
sed -n '/Sweden/{N;p;q;}' /etc/pacman.d/mirrorlist >> /etc/pacman.d/tmp
# Copy all but the above to temporary file
sed -n '1,6d' /etc/pacman.d/mirrorlist | sed -n '/Sweden/{N;d;q;}' >> /etc/pacman.d/tmp
# Replace original file with the temporary file
mv /etc/pacman.d/tmp /etc/pacman.d/mirrorlist

Offline

#18 2012-08-07 12:32:11

1archgamenon2
Banned
Registered: 2011-07-12
Posts: 201

Re: A bash archlinux install script

2ManyDogs wrote:

A separate /home is also unnecessary

DON'T think so!

Offline

#19 2012-08-07 12:42:15

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,642

Re: A bash archlinux install script

1archgamenon2 wrote:
2ManyDogs wrote:

A separate /home is also unnecessary

DON'T think so!

You took this entirely out of context. Here is what I actually said, and why I said it:

satanselbow wrote:

Isn't a separate /boot partition considered unnecessary these days? And why ext2 partitioning?

2ManyDogs wrote:

1. Possibly unnecessary but that doesn't make it a bad idea. A separate /home is also unnecessary, yet many people recommend it.

I was responding to the question about a separate boot partition being unnecessary.

Maybe I should have put "unnecessary" in quotes, or said "strictly speaking" -- many people don't use a separate /home partition, so strictly speaking it is not necessary. You can install Arch in a single partition if that's what you want (in fact, that what this guide does, and it works).

I never said having a separate /home partition wasn't a good idea, and I always create one when I'm installing any distro.

Last edited by 2ManyDogs (2012-08-07 12:48:22)


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#20 2012-08-07 18:42:55

neighborhoodhacker
Member
Registered: 2012-08-06
Posts: 45

Re: A bash archlinux install script

No offense, I'm sure this is great work but if we just start adding tons of options how is this different then /arch/setup?

Offline

#21 2012-08-07 19:08:38

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: A bash archlinux install script

2ManyDogs wrote:

You took this entirely out of context. Here is what I actually said, and why I said it:

And - hindsight being a beautiful thing - I am quite happy to and comfortable in conceding that I typed faster than I thought. Doh! wink

Offline

#22 2012-08-07 19:09:43

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: A bash archlinux install script

neighborhoodhacker wrote:

No offense, I'm sure this is great work but if we just start adding tons of options how is this different then /arch/setup?

Currently, in that it is being actively developed and maintained.

Offline

#23 2012-08-07 19:12:37

totte
Member
Registered: 2011-08-22
Posts: 64

Re: A bash archlinux install script

neighborhoodhacker wrote:

No offense, I'm sure this is great work but if we just start adding tons of options how is this different then /arch/setup?

It was bound to happen. I think it's a good thing, this and other scripts will not be as complex as AIF, making bits and pieces useful for writing your own to speed up installation procedures on virtual machines and the like.

Offline

#24 2012-08-07 19:39:26

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,642

Re: A bash archlinux install script

satanselbow wrote:
2ManyDogs wrote:

You took this entirely out of context. Here is what I actually said, and why I said it:

And - hindsight being a beautiful thing - I am quite happy to and comfortable in conceding that I typed faster than I thought. Doh! wink

Thank you satanselbow. I was more concerned with 1archgamenon2:

1archgamenon2 wrote:
2ManyDogs wrote:

A separate /home is also unnecessary

DON'T think so!

But looking back at some of his other posts I think I wasted my time writing that response. I won't write another.


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#25 2012-08-07 22:10:46

Fantasma
Member
Registered: 2012-07-05
Posts: 2

Re: A bash archlinux install script

aichingm wrote:

corrected typo.

yaffare wrote:

- you forgot the slash in "./install.sh", you wrote ". install.sh"
- you could add "chmod +x install.sh" after the wget command

could you explain why using . install.sh is not good? It  works well and I have not to chmod it before but I'm open for everything!
Mario


it is not a problem at all. The difference is that when you declare any variable in the script if you use ". install.sh" the variables will remain in the environment after the execution of the script (for the session). For example after the instalation you can try echo $hostname , or echo $homefs and the info will be there. In the other hand if you use "./install.sh" this echo commands will retun empty.
I do not know if there are other difference but this it is enough interesting je if anyone know other I will very glad to know.

One interesting command, perhaps you know and decide not to use, is the SELECT command,is a elegant solution for finite options. Example

echo "BootLoader?"
select bootloader in GRUB SYSLINUX NONE; do
	if [ -n "$bootloader" ]; then
		break;
	fi
done

echo $bootloader

The output

BootLoader?
1) GRUB                                                                                                                                        
2) SYSLINUX                                                                                                                                    
3) NONE                                                                                                                                        
#?    

This will loop until you chose one of that.
It is only an idea, it is not better or worse, only different tongue.

Thank you very much for the script it is very usefull!

Offline

Board footer

Powered by FluxBB