You are not logged in.
Hi,
I've build a mini script to help new user to install Arch:
Just a few details:
* swap is set to 3Gb
* root is 20% of disk size
* home is remaining space
* it's not thinked for dual-boot (so the script intialize hdd!!! caution!)
#!/bin/bash
#
##################################################################
#title :archinstaller.sh
#description :This script will help to install ArchLinux
#author :Dennis Anfossi (ITfor s.r.l.)
#date :01/07/2013
#version :0.1
#usage :bash archinstaller.sh
##################################################################
#
start_time=$(date +%s)
clear
echo "==================================="
echo " Welcome To ArchLinux Installer!"
echo "==================================="
# Check network
echo -n "* Check internet connection.."
wget -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &> /dev/null
if [ ! -s /tmp/index.google ];then
echo -e "Failed!"
echo "You need to configure network before continue.."
exit 1
else
echo -e "Done!"
fi
# List disk(s)
echo -e "* Retrieving Hard-Disk informations..\n"
fdisk -l /dev/[sh]d? | grep [D]is[cko] | sed -e 's/[Dd]isk//g' | sed -e 's/[Dd]isco//g' | head -1 | awk '{print $1 " " $2 " " $3}' | sed 's/,//g'
echo -e "\n"
# ask which disk to use
echo -n "Select the disk to use (es. /dev/sda): "
read dest_disk
if [ -z "$dest_disk" ]; then
echo "Error: You must insert a device! "
exit 1
fi
# Check for a block device
echo ""
echo -n "* Check if" $dest_disk "is a valid block device.."
udevadm info --query=all --name=$dest_disk |grep DEVTYPE=disk > /dev/null 2&>1
if [ $? = 0 ]; then
echo -e $desk_disk "is not a valid block device!"
exit 1
else
echo -e "Done!"
fi
# Initializing
echo -e "\nWARNING:"
echo -e "---------------------------------------"
echo "The destination drive will be formatted."
echo "All data on" $dest_disk "will be lost!"
echo -e "---------------------------------------"
read -p "Continue (y/n)? "
if [ $REPLY != "n" ]; then
wipefs -a $dest_disk > /dev/null 2&>1
dd if=/dev/zero of=$dest_disk count=100 bs=512 > /dev/null 2&>1 ; partprobe > /dev/null 2&>1 ; sync > /dev/null 2&>1
else
exit
fi
sleep 5
disk_size=$(fdisk -l ${dest_disk} | grep [D]is[cko] | sed -e 's/[Dd]isk//g' | sed -e 's/[Dd]isco//g' | awk '{print $1 " " $2 " " $3}' | sed 's/,//g' | awk '{print $2}' | sed 's/\.[0-9]//g')
root_size=$((20 * $disk_size / 100))
swap_size=3
echo -n "* Creating partitions.."
# Partitioning
## swap_partition
echo -e "n\n \
p\n \
1\n \
\n \
+${swap_size}G\n \
t\n \
82\n
w" | fdisk ${dest_disk} > /dev/null 2>&1
## root_partition
echo -e "n\n \
p\n \
2\n \
\n \
+${root_size}G\n \
w" | fdisk ${dest_disk} > /dev/null 2>&1
# home_partition
echo -e "n\n \
p\n \
3\n \
\n \
\n \
w" | fdisk ${dest_disk} > /dev/null 2>&1
echo -e "Done!"
# formatting partition
## swap
echo -n "* Formatting swap.."
mkswap ${dest_disk}1 > /dev/null 2>&1
echo -e "Done!"
## root
echo -n "* Formatting root.."
mkfs.ext4 ${dest_disk}2 > /dev/null 2>&1
echo -e "Done!"
## home
echo -n "* Formatting home.."
mkfs.ext4 ${dest_disk}3 > /dev/null 2>&1
echo -e "Done!"
# mounting partition
## root
echo -n "* Mounting root.."
mount ${dest_disk}2 /mnt > /dev/null 2>&1
echo -e "Done!"
## home
echo -n "* Mounting home.."
mkdir /mnt/home
mount ${dest_disk}3 /mnt/home > /dev/null 2>&1
echo -e "Done!"
# install base system
echo -n "* Installing system.."
pacstrap /mnt base base-devel > /dev/null 2>&1
echo "Done!"
# configuring system
## fstab
echo -n "* Configuring fstab.."
genfstab -L -p /mnt >> /mnt/etc/fstab > /dev/null 2>&1
echo -e "Done!"
## locale
echo -n "* Configuring locale.."
echo "it_IT.UTF-8" > /mnt/etc/locale.gen
echo "en_US.UTF-8 UTF-8" >> /mnt/etc/locale.gen
arch-chroot /mnt /usr/bin/locale-gen > /dev/null 2>&1
echo -e "Done!"
## password
echo "* Setting root password.."
echo -n "Insert new password: "
read new_pass
echo -e $new_pass"\n"$new_pass |arch-chroot /mnt /usr/bin/passwd > /dev/null 2>&1
## hostname
echo "* Setting hostname.."
echo -n "Choose new hostname: "
read new_hn
echo $new_hn > /mnt/etc/hostname > /dev/null 2>&1
# mkinitcpio
echo -n "* Running mkinitcpio.."
arch-chroot /mnt mkinitcpio -p linux > /dev/null 2>&1
echo -e "Done!"
# installing grub & os prober
echo -n "* Installing grub.."
pacstrap /mnt grub os-prober > /dev/null 2>&1
echo -e "Done!"
echo -n "* Configuring grub.."
arch-chroot /mnt /usr/bin/grub-install $dest_disk > /dev/null 2>&1
arch-chroot /mnt /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg > /dev/null 2>&1
echo -e "Done!"
# exit
cd ; umount /mnt/* > /dev/null 2&>1 ; umount /mnt > /dev/null 2>&1
echo "* Installation completed!"
finish_time=$(date +%s)
min=$(( $((finish_time - start_time)) /60 ))
echo -e "\nTotal install time:" $min "minutes."
exit 0
If someone wants comment or improve this script, feel free .. is GNU GPLv2
Last edited by danfossi (2013-10-08 13:33:02)
Offline
Not an Installation issue, moving to Community Contributions...
You might want to open fstab and mkinitcpio.conf and the like in $EDITOR afterwards so that they can be checked.
Offline
You should specify the license in the script.
Offline
There's a lot of he sed she sed in there:
My first thoughts after reading just a bit of it are to use ping in place of wget, and *please* use (a single) awk in place of the "sed sed sed sed sed head awk sed awk sed"
Last edited by Trilby (2013-07-02 12:28:03)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
new version.. :)
#!/bin/bash
#
##################################################################
#title :archinstaller.sh
#description :This script will help you to install ArchLinux
#author :Dennis Anfossi
#date :01/07/2013
#version :1.1
#license :GPLv2
#usage :./archinstaller.sh
##################################################################
#
start_time=$(date +%s)
clear
echo "======================================"
echo " Welcome To ArchLinux Installer!"
echo "======================================"
# Check network
echo -n "* Check internet connection.."
wget -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &> /dev/null
if [ ! -s /tmp/index.google ];then
echo -e "Failed!"
echo "You need to configure network before continue.."
exit 1
else
echo -e "Done!"
fi
# List disk(s)
echo -e "* Retrieving Hard-Disk informations..\n"
fdisk -l /dev/[sh]d? | grep [D]is[cko] | sed -e 's/[Dd]isk//g' | sed -e 's/[Dd]isco//g' | head -1 | awk '{print $1 " " $2 " " $3}' | sed 's/,//g'
echo -e "\n"
# ask which disk to use
echo -n "Select the disk to use (es. /dev/sda): "
read dest_disk
if [ -z "$dest_disk" ]; then
echo "Error: You must insert a device! "
exit 1
fi
# Check for a block device
echo ""
echo -n "* Check if" $dest_disk "is a valid block device.."
udevadm info --query=all --name=$dest_disk |grep DEVTYPE=disk > /dev/null 2&>1
if [ $? = 0 ]; then
echo -e $desk_disk "is not a valid block device!"
exit 1
else
echo -e "Done!"
fi
# Initializing
echo -e "\nWARNING:"
echo -e "---------------------------------------"
echo "The destination drive will be formatted."
echo "All data on" $dest_disk "will be lost!"
echo -e "---------------------------------------"
read -p "Continue (y/n)? "
if [ $REPLY != "n" ]; then
umount $dest_disk* > /dev/null 2&>1
wipefs -a $dest_disk > /dev/null 2&>1
dd if=/dev/zero of=$dest_disk count=100 bs=512 > /dev/null 2&>1 ; partprobe > /dev/null 2&>1 ; sync > /dev/null 2&>1 ; partprobe -s > /dev/null 2>&1 ; sleep 5
else
echo "* Setup cancelled!"
exit 0
fi
disk_size=$(fdisk -l ${dest_disk} | grep [D]is[cko] | sed -e 's/[Dd]isk//g' | sed -e 's/[Dd]isco//g' | awk '{print $1 " " $2 " " $3}' | sed 's/,//g' | awk '{print $2}' | sed 's/\.[0-9]//g' | head -1)
root_size=$(( 20 * $disk_size / 100 ))
swap_size=3
echo -n "* Creating partitions.."
# Partitioning
## swap_partition
echo -e "n\n \
p\n \
1\n \
\n \
+${swap_size}G\n \
t\n \
82\n
w" | fdisk ${dest_disk} > /dev/null 2>&1
## wait a moment
sleep 1
## root_partition
echo -e "n\n \
p\n \
2\n \
\n \
+${root_size}G\n \
w" | fdisk ${dest_disk} > /dev/null 2>&1
## wait a moment
sleep 1
# home_partition
echo -e "n\n \
p\n \
3\n \
\n \
\n \
w" | fdisk ${dest_disk} > /dev/null 2>&1
echo -e "Done!"
# formatting partition
## swap
echo -n "* Formatting swap.."
mkswap ${dest_disk}1 > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
fi
## root
echo -n "* Formatting root.."
mkfs.ext4 ${dest_disk}2 > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
fi
## home
echo -n "* Formatting home.."
mkfs.ext4 ${dest_disk}3 > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
fi
# mounting partition
## root
echo -n "* Mounting root.."
mount ${dest_disk}2 /mnt > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
exit 1
fi
## home
echo -n "* Mounting home.."
mkdir /mnt/home
mount ${dest_disk}3 /mnt/home > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
fi
# install base system
echo -n "* Installing system.."
pacstrap /mnt base base-devel zsh grml-zsh-config vim screen > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
exit 1
fi
# configuring system
## fstab
echo -n "* Configuring fstab.."
genfstab -L /mnt >> /mnt/etc/fstab
echo -e "Done!"
## locale
echo -n "* Configuring locale.."
echo "it_IT.UTF-8 UTF-8" > /mnt/etc/locale.gen
echo "it_IT ISO-8859-1" >> /mnt/etc/locale.gen
echo "it_IT@euro ISO-8859-15" >> /mnt/etc/locale.gen
echo "en_US.UTF-8 UTF-8" >> /mnt/etc/locale.gen
echo "LANG=it_IT.utf8" > /mnt/etc/locale.conf
arch-chroot /mnt /usr/bin/locale-gen > /dev/null 2>&1
echo -e "Done!"
## vconsole
echo -n "* Configuring console.."
echo "KEYMAP=it" > /mnt/etc/vconsole.conf
echo -e "Done!"
## zoneinfo
echo -n "* Zone Info.."
ln -sf /usr/share/zoneinfo/Europe/Rome /mnt/etc/localtime > /dev/null 2>&1
echo -e "Done!"
## password
echo "* Setting root password.."
echo -n "Insert new password: "
read new_pass
echo -e $new_pass"\n"$new_pass |arch-chroot /mnt /usr/bin/passwd > /dev/null 2>&1
## hostname
echo "* Setting hostname.."
echo -n "Choose new hostname: "
read new_hn
echo $new_hn > /mnt/etc/hostname
# mkinitcpio
echo -n "* Running mkinitcpio.."
arch-chroot /mnt mkinitcpio -p linux > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
exit 1
fi
# installing grub & os prober
echo -n "* Installing grub.."
pacstrap /mnt grub os-prober > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
exit 1
fi
echo -n "* Configuring grub.."
arch-chroot /mnt /usr/bin/grub-install $dest_disk > /dev/null 2>&1
arch-chroot /mnt /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
exit 1
fi
### Additionals Packages ###
echo -e "---------------------------------------"
echo "Base system installed successfull"
echo "Do you want to install more packages ?"
echo -e "---------------------------------------"
read -p "Continue (y/n)? "
if [ $REPLY != "n" ]; then
pkgs=$(dialog --stdout --checklist "Other Packages:" 15 40 10 \
apr "" on \
apg "" on \
atool "" on \
audacity "" on \
avidemux-cli "" on \
bash-completion "" on \
cdrkit "" on \
cifs-utils "" on \
clusterssh "" on \
cups "" on \
cups-filters "" on \
dbus "" on \
dhclient "" on \
dialog "" on \
dnsutils "" on \
dosfstools "" on \
e2fsprogs "" on \
exiv2 "" on \
fdupes "" on \
ffmpeg "" on \
file "" on \
fsarchiver "" on \
git "" on \
gnu-netcat "" on \
gpart "" on \
gparted "" on \
gptfdisk "" on \
gvfs "" on \
gvfs-afc "" on \
gvfs-afp "" on \
gvfs-obexftp "" on \
gvfs-smb "" on \
hddtemp "" off \
hdparm "" off \
ifuse "" on \
imagemagick "" off \
ipcalc "" on \
iputils "" on \
iso-codes "" on \
lame "" on \
libdvdread "" on \
lsof "" on \
lshw "" on \
lvm2 "" on \
man-pages "" on \
man-pages-it "" on \
mc "" on \
mdadm "" off \
minicom "" off \
mtools "" on \
mpfr "" off \
mpg123 "" off \
nano "" on \
nmap "" on \
ntp "" on \
net-snmp "" off \
net-tools "" on \
nettle "" off \
networkmanager "" on \
nmap "" on \
ntfs-3g "" on \
openssh "" on \
openvpn "" on \
p7zip "" on \
partimage "" on \
partclone "" on \
pydf "" on \
rsync "" on \
rsyslog "" on \
screen "" on \
subversion "" off \
smbclient "" on \
sudo "" on \
tcpdump "" on \
tightvnc "" on \
tree "" on \
truecrypt "" off \
usbmuxd "" on \
unzip "" on \
unrar "" on \
vlc "" on \
youtube-dl "" on \
)
echo -n "* Installing selected packages.."
pacstrap /mnt $pkgs > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
arch-chroot /mnt /usr/bin/systemctl enable NetworkManager.service > /dev/null 2>&1
arch-chroot /mnt /usr/bin/systemctl enable sshd.service > /dev/null 2>&1
else
echo -e "Error!"
fi
fi
# Personalization
## Add user
echo "* Adding user.."
echo -n "Choose username: "
read new_usr
arch-chroot /mnt /usr/bin/useradd -m -G wheel -s /bin/zsh $new_usr
### password
echo "* Setting" $new_usr "password.."
echo -n "Insert new password: "
read usr_new_pass
echo -e $usr_new_pass"\n"$usr_new_pass |arch-chroot /mnt /usr/bin/passwd $new_usr > /dev/null 2>&1
## root shell
arch-chroot /mnt /usr/bin/usermod -s /usr/bin/zsh root > /dev/null 2>&1
## Stuff
echo -n "* Customization.."
cp -rf /etc/zsh* /mnt/etc/
cp -rf /etc/bash.* /mnt/etc/
cp -rf /etc/screenrc /mnt/etc/
cp -rf /etc/vimrc /mnt/etc/
cat /root/.zshrc.local | sed 's#/usr/bin/dynmotd##g' > /mnt/root/.zshrc.local
cat /root/.zshrc.local | sed 's#/usr/bin/dynmotd##g' > /mnt/home/$new_usr/.zshrc.local
echo -e "Done!"
# Server Packages
echo -e "---------------------------------------"
echo "Do you want to install server-side packages ?"
echo -e "---------------------------------------"
read -p "Continue (y/n)? "
if [ $REPLY != "n" ]; then
srv_pkgs=$(dialog --stdout --checklist "Server-Side Packages:" 15 40 10 \
apache "" off \
bind "" off \
dnsmasq "" off \
iptables "" on \
openssh "" off \
openvpn "" off \
php "" off \
samba "" off \
tftp-hpa "" off \
virtualbox "" off \
webmin "" off \
)
echo -n "* Installing selected packages.."
pacstrap /mnt $srv_pkgs > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
fi
fi
### Xorg & GUI ###
echo -e "---------------------------------------"
echo "Do you want to install Xorg & GUI (Mate) ?"
echo -e "---------------------------------------"
read -p "Continue (y/n)? "
if [ $REPLY != "n" ]; then
echo -n "* Installing Xorg, LXDM, Mate.."
echo "[mate]
SigLevel = Never
Server = http://repo.mate-desktop.org/archlinux/"\$"arch" >> /mnt/etc/pacman.conf
echo "[mate]
SigLevel = Never
Server = http://repo.mate-desktop.org/archlinux/"\$"arch" >> /etc/pacman.conf
pacstrap /mnt xorg mate mate-extras lxdm > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
arch-chroot /mnt /usr/bin/systemctl enable lxdm.service
else
echo -e "Error!"
fi
fi
echo -e "---------------------------------------"
echo "Do you want to install GUI applciations ?"
echo -e "---------------------------------------"
read -p "Continue (y/n)? "
if [ $REPLY != "n" ]; then
gui_pkgs=$(dialog --stdout --checklist "Graphical Packages:" 15 40 10 \
avidemux-gtk "" on \
brasero "" on \
chromium "" on \
deja-dup "" on \
dia "" off \
easytag "" off \
evolution "" off \
filezilla "" on \
firefox "" on \
firefox-i18n-it "" on \
flashplugin "" on \
gimp "" on \
gksu "" off \
gstreamer0.10-plugins "" on \
grsync "" on \
inkscape "" off \
libgpod "" on \
libimobiledevice "" on \
libreoffice-base "" on \
libreoffice-draw "" on \
libreoffice-calc "" on \
libreoffice-writer "" on \
libreoffice-impress "" on \
libreoffice-it "" on \
network-manager-applet "" on \
networkmanager-openvpn "" on \
parano "" on \
parcellite "" on \
putty "" on \
rdesktop "" on \
rhythmbox "" on \
shotwell "" on \
sylpheed "" on \
tasque ""on \
terminator "" on \
xlockmore "" on \
)
echo -n "* Installing selected packages.."
pacstrap /mnt $gui_pkgs > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
fi
fi
# Exit
echo -n "Umounting partitions.."
cd ; umount /mnt/* > /dev/null 2&>1 ; umount /mnt > /dev/null 2>&1
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
fi
echo -e "---------------------------------------"
echo "Installation completed!"
echo "Eject any DVD or USB and reboot!"
echo -e "---------------------------------------"
# Report
finish_time=$(date +%s)
min=$(( $((finish_time - start_time)) /60 ))
echo -e "\nTotal install time:" $min "minutes."
exit 0
Last edited by danfossi (2013-10-01 13:15:35)
Offline
nice, thanks
could be evolved in some nifty script
BHH
HDConvertToX, AutoMen, AutoMKV author
Offline
Cool script. Some thoughts:
Replace
echo -e ""
with
echo ''
when possible.
For simple messages there is no need for -e or double quotes.
Also
disk_size=$(fdisk -l ${dest_disk} | grep [D]is[cko] | sed -e 's/[Dd]isk//g' | sed -e 's/[Dd]isco//g' | awk '{print $1 " " $2 " " $3}' | sed 's/,//g' | awk '{print $2}' | sed 's/\.[0-9]//g' | head -1)
??? lol
lsblk -n -o SIZE /dev/sda | head -n 1
This prints out 5G if the size of /dev/sda is 5 Gigabytes .
Offline
Cool script. Some thoughts:
Replaceecho -e ""
with
echo ''
when possible.
For simple messages there is no need for -e or double quotes.
Or any quotes at all. The bare command "echo" will print a newline.
Also
lsblk -n -o SIZE /dev/sda | head -n 1
This prints out 5G if the size of /dev/sda is 5 Gigabytes .
lsblk -dno size /dev/sda
Offline
teateawhy wrote:Cool script. Some thoughts:
Replaceecho -e ""
with
echo ''
when possible.
For simple messages there is no need for -e or double quotes.Or any quotes at all. The bare command "echo" will print a newline.
Alsoteateawhy wrote:lsblk -n -o SIZE /dev/sda | head -n 1
This prints out 5G if the size of /dev/sda is 5 Gigabytes .
lsblk -dno size /dev/sda
This is amazing!!
Thank you all!!!
I will try to make the script more readable / usable in the next version .. Meanwhile, gather suggestions and criticisms;)
Offline
@danfossi
I made a new version of your script that uses configuration instead of interactive user input. It's only 13 fields of configuration so far and gets you an arch linux base install. The personalization part has been stripped off for now.
There are some things you can take over into your script , for example:
* Use this shell option:
set -e -u
That way you can get rid of all the checking, because the shell ends the script on every command that does not return 0.
The checking i am talking about:
if [ $? = 0 ]; then
echo -e "Done!"
else
echo -e "Error!"
exit 1
fi
* add option not to use swap
* use
swapon
after creating the swap filesystem (probably swap won't work without)
* remove some of the /dev/null redirections, so users see what has gone wrong if a command failed
* It is probably better not to use this for unmounting,
cd ; umount /mnt/* > /dev/null 2&>1 ; umount /mnt > /dev/null 2>&1
(If you remove the /dev/null part, you will see that this returns errors.)
but this instead:
cd ; umount /mnt/home ; umount /mnt
Other ideas:
* Add option to set root size and swap size
* Use something else than fdisk for formatting, that accepts commands instead of piping stuff into an interactive shell. Maybe parted .
* Add option for GPT formatting
finally my version:
#!/bin/bash
#
##################################################################
#title : installscript
#description : Automated installation script for arch linux
#author : teateawhy , based on archinstaller.sh by Dennis Anfossi .
#contact : https://bbs.archlinux.org/profile.php?id=57887
#date : 10-08
#version : 0.1
#license : GPLv2
#usage : ./installscript
##################################################################
#
# MBR AND BIOS ONLY. NO UEFI SUPPORT.
## -------------
## CONFIGURATION
# Confirm before running (yes/no)
confirm='yes'
# This drive will be formatted (/dev/sdx)
dest_disk=''
# example:
# dest_disk='/dev/sda'
# swap (yes/no)
swap='no'
# Partition sizes ( Append G for Gibibytes, M for Mebibytes )
swap_size=''
root_size='25G'
# mirror
mirrorlist=''
# example:
# mirrorlist='Server = http://mirror.de.leaseweb.net/archlinux/$repo/os/$arch'
# Install base-devel group (yes/no)
base_devel='yes'
# language
locale_gen='en_US.UTF-8 UTF-8'
locale_conf='LANG=en_US.UTF-8'
keymap='KEYMAP=us'
font='FONT=Lat2-Terminus16'
# timezone (only one slash in the middle)
timezone=''
# example: timezone='Europe/Berlin'
# hostname
hostname=''
# example:
# hostname='myhostname'
## END CONFIGURATION
## -----------------
start_time=$(date +%s)
# functions
config_fail() {
echo
echo 'installscript:'
echo "Configuration error, please check variable $1 ."
exit 1
}
# Paranoid shell
set -e -u
# Check configuration
[ -z "$confirm" ] && config_fail 'confirm'
[ -z "$dest_disk" ] && config_fail 'dest_disk'
[ -z "$swap" ] && config_fail 'swap'
if [ "$swap" = 'yes' ]; then
[ -z "$swap_size" ] && config_fail 'swap_size'
fi
[ -z "$root_size" ] && config_fail 'root_size'
[ -z "$base_devel" ] && config_fail 'base_devel'
[ -z "$locale_gen" ] && config_fail 'locale_gen'
[ -z "$locale_conf" ] && config_fail 'locale_conf'
[ -z "$keymap" ] && config_fail 'keymap'
[ -z "$font" ] && config_fail 'font'
[ -z "$timezone" ] && config_fail 'timezone'
[ -z "$hostname" ] && config_fail 'hostname'
## Check if dest_disk is a valid block device
udevadm info --query=all --name=$dest_disk | grep DEVTYPE=disk || config_fail 'dest_disk'
# Check internet connection
wget -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google
if [ ! -s /tmp/index.google ];then
echo
echo 'installscript:'
echo 'Error, please check your network connection.'
exit 1
fi
# Initializing
REPLY='yes'
if [ "$confirm" != 'no' ]; then
echo
echo 'installscript:'
echo 'WARNING:'
echo '---------------------------------------'
echo 'The destination drive will be formatted.'
echo "All data on" $dest_disk "will be lost!"
echo '---------------------------------------'
read -p 'Continue (yes/no)? '
fi
if [ "$REPLY" = 'yes' ]; then
umount $dest_disk* || :
wipefs -a $dest_disk
dd if=/dev/zero of=$dest_disk count=100 bs=512; partprobe; sync; partprobe -s; sleep 5
else
exit 0
fi
# Partitioning
## swap_partition
if [ "$swap" = 'yes' ]; then
swap_part_number=1
root_part_number=2
home_part_number=3
else
root_part_number=1
home_part_number=2
fi
if [ "$swap" = 'yes' ]; then
echo -e "n\n \
p\n \
${swap_part_number}\n \
\n \
+${swap_size}\n \
t\n \
82\n
w" | fdisk ${dest_disk}
## wait a moment
sleep 1
fi
## root_partition
echo -e "n\n \
p\n \
${root_part_number}\n \
\n \
+${root_size}\n \
w" | fdisk ${dest_disk}
## wait a moment
sleep 1
# home_partition
echo -e "n\n \
p\n \
${home_part_number}\n \
\n \
\n \
w" | fdisk ${dest_disk}
# Create filesystems
## swap
if [ "$swap" = 'yes' ]; then
mkswap ${dest_disk}${swap_part_number}
swapon ${dest_disk}${swap_part_number}
fi
## root
mkfs.ext4 ${dest_disk}${root_part_number}
## home
mkfs.ext4 ${dest_disk}${home_part_number}
# mounting partition
## root
mount ${dest_disk}${root_part_number} /mnt
## home
mkdir /mnt/home
mount ${dest_disk}${home_part_number} /mnt/home
## mirrorlist
echo "$mirrorlist" > /etc/pacman.d/mirrorlist
# pacstrap
if [ "$base_devel" = 'yes' ]; then
pacstrap /mnt base base-devel
else
pacstrap /mnt base
fi
# configure system
## fstab
genfstab -L /mnt > /mnt/etc/fstab
## locale
echo "$locale_gen" >> /mnt/etc/locale.gen
echo "$locale_conf" > /mnt/etc/locale.conf
arch-chroot /mnt /usr/bin/locale-gen
## console font and keymap
echo "$keymap" > /mnt/etc/vconsole.conf
echo "$font" >> /mnt/etc/vconsole.conf
## timezone
ln -s /usr/share/zoneinfo/$timezone /mnt/etc/localtime
## hardware clock
hwclock --systohc --utc
## hostname
echo "$hostname" > /mnt/etc/hostname
# mkinitcpio
arch-chroot /mnt mkinitcpio -p linux
## password
## echo root:$root_password | arch-chroot /mnt /usr/bin/chpasswd
## echo -e $new_pass"\n"$new_pass | arch-chroot /mnt /usr/bin/passwd
# install grub & os prober packages
pacstrap /mnt grub os-prober
# write grub to mbr
arch-chroot /mnt /usr/bin/grub-install $dest_disk
# configure grub
arch-chroot /mnt /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg
echo
echo 'installscript:'
echo 'Successfully installed base system.'
# Exit
cd /
umount /mnt/home
umount /mnt
echo
echo 'installscript:'
echo 'Installation completed!'
echo 'Eject any DVD or remove USB installation media and reboot!'
# Report
finish_time=$(date +%s)
min=$(( $((finish_time - start_time)) /60 ))
echo
echo 'installscript:'
echo -e "\nTotal install time:" $min 'minutes.'
exit 0
Offline
using cd rom installer (on wm) the partprobe fail (read only filesystem..)
BHH
HDConvertToX, AutoMen, AutoMKV author
Offline
You found a bug. Replace partprobe with
partprobe $dest_disk
and it should work. Can't test this because i do not have a cd rom drive in my computer.
Offline
i just tested the script on a virtual machine, while arch iso installer mounted as CDrom
thanks
BHH
BTW me too don't have a cdrom drive
HDConvertToX, AutoMen, AutoMKV author
Offline
@danfossi
I made a new version of your script that uses configuration instead of interactive user input. It's only 13 fields of configuration so far and gets you an arch linux base install. The personalization part has been stripped off for now.There are some things you can take over into your script , for example:
* Use this shell option:
set -e -u
That way you can get rid of all the checking, because the shell ends the script on every command that does not return 0.
The checking i am talking about:if [ $? = 0 ]; then echo -e "Done!" else echo -e "Error!" exit 1 fi
* add option not to use swap
* useswapon
after creating the swap filesystem (probably swap won't work without)
* remove some of the /dev/null redirections, so users see what has gone wrong if a command failed
* It is probably better not to use this for unmounting,cd ; umount /mnt/* > /dev/null 2&>1 ; umount /mnt > /dev/null 2>&1
(If you remove the /dev/null part, you will see that this returns errors.)
but this instead:cd ; umount /mnt/home ; umount /mnt
Other ideas:
* Add option to set root size and swap size
* Use something else than fdisk for formatting, that accepts commands instead of piping stuff into an interactive shell. Maybe parted .
* Add option for GPT formattingfinally my version:
#!/bin/bash # ################################################################## #title : installscript #description : Automated installation script for arch linux #author : teateawhy , based on archinstaller.sh by Dennis Anfossi . #contact : https://bbs.archlinux.org/profile.php?id=57887 #date : 10-08 #version : 0.1 #license : GPLv2 #usage : ./installscript ################################################################## # # MBR AND BIOS ONLY. NO UEFI SUPPORT. ## ------------- ## CONFIGURATION # Confirm before running (yes/no) confirm='yes' # This drive will be formatted (/dev/sdx) dest_disk='' # example: # dest_disk='/dev/sda' # swap (yes/no) swap='no' # Partition sizes ( Append G for Gibibytes, M for Mebibytes ) swap_size='' root_size='25G' # mirror mirrorlist='' # example: # mirrorlist='Server = http://mirror.de.leaseweb.net/archlinux/$repo/os/$arch' # Install base-devel group (yes/no) base_devel='yes' # language locale_gen='en_US.UTF-8 UTF-8' locale_conf='LANG=en_US.UTF-8' keymap='KEYMAP=us' font='FONT=Lat2-Terminus16' # timezone (only one slash in the middle) timezone='' # example: timezone='Europe/Berlin' # hostname hostname='' # example: # hostname='myhostname' ## END CONFIGURATION ## ----------------- start_time=$(date +%s) # functions config_fail() { echo echo 'installscript:' echo "Configuration error, please check variable $1 ." exit 1 } # Paranoid shell set -e -u # Check configuration [ -z "$confirm" ] && config_fail 'confirm' [ -z "$dest_disk" ] && config_fail 'dest_disk' [ -z "$swap" ] && config_fail 'swap' if [ "$swap" = 'yes' ]; then [ -z "$swap_size" ] && config_fail 'swap_size' fi [ -z "$root_size" ] && config_fail 'root_size' [ -z "$base_devel" ] && config_fail 'base_devel' [ -z "$locale_gen" ] && config_fail 'locale_gen' [ -z "$locale_conf" ] && config_fail 'locale_conf' [ -z "$keymap" ] && config_fail 'keymap' [ -z "$font" ] && config_fail 'font' [ -z "$timezone" ] && config_fail 'timezone' [ -z "$hostname" ] && config_fail 'hostname' ## Check if dest_disk is a valid block device udevadm info --query=all --name=$dest_disk | grep DEVTYPE=disk || config_fail 'dest_disk' # Check internet connection wget -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google if [ ! -s /tmp/index.google ];then echo echo 'installscript:' echo 'Error, please check your network connection.' exit 1 fi # Initializing REPLY='yes' if [ "$confirm" != 'no' ]; then echo echo 'installscript:' echo 'WARNING:' echo '---------------------------------------' echo 'The destination drive will be formatted.' echo "All data on" $dest_disk "will be lost!" echo '---------------------------------------' read -p 'Continue (yes/no)? ' fi if [ "$REPLY" = 'yes' ]; then umount $dest_disk* || : wipefs -a $dest_disk dd if=/dev/zero of=$dest_disk count=100 bs=512; partprobe; sync; partprobe -s; sleep 5 else exit 0 fi # Partitioning ## swap_partition if [ "$swap" = 'yes' ]; then swap_part_number=1 root_part_number=2 home_part_number=3 else root_part_number=1 home_part_number=2 fi if [ "$swap" = 'yes' ]; then echo -e "n\n \ p\n \ ${swap_part_number}\n \ \n \ +${swap_size}\n \ t\n \ 82\n w" | fdisk ${dest_disk} ## wait a moment sleep 1 fi ## root_partition echo -e "n\n \ p\n \ ${root_part_number}\n \ \n \ +${root_size}\n \ w" | fdisk ${dest_disk} ## wait a moment sleep 1 # home_partition echo -e "n\n \ p\n \ ${home_part_number}\n \ \n \ \n \ w" | fdisk ${dest_disk} # Create filesystems ## swap if [ "$swap" = 'yes' ]; then mkswap ${dest_disk}${swap_part_number} swapon ${dest_disk}${swap_part_number} fi ## root mkfs.ext4 ${dest_disk}${root_part_number} ## home mkfs.ext4 ${dest_disk}${home_part_number} # mounting partition ## root mount ${dest_disk}${root_part_number} /mnt ## home mkdir /mnt/home mount ${dest_disk}${home_part_number} /mnt/home ## mirrorlist echo "$mirrorlist" > /etc/pacman.d/mirrorlist # pacstrap if [ "$base_devel" = 'yes' ]; then pacstrap /mnt base base-devel else pacstrap /mnt base fi # configure system ## fstab genfstab -L /mnt > /mnt/etc/fstab ## locale echo "$locale_gen" >> /mnt/etc/locale.gen echo "$locale_conf" > /mnt/etc/locale.conf arch-chroot /mnt /usr/bin/locale-gen ## console font and keymap echo "$keymap" > /mnt/etc/vconsole.conf echo "$font" >> /mnt/etc/vconsole.conf ## timezone ln -s /usr/share/zoneinfo/$timezone /mnt/etc/localtime ## hardware clock hwclock --systohc --utc ## hostname echo "$hostname" > /mnt/etc/hostname # mkinitcpio arch-chroot /mnt mkinitcpio -p linux ## password ## echo root:$root_password | arch-chroot /mnt /usr/bin/chpasswd ## echo -e $new_pass"\n"$new_pass | arch-chroot /mnt /usr/bin/passwd # install grub & os prober packages pacstrap /mnt grub os-prober # write grub to mbr arch-chroot /mnt /usr/bin/grub-install $dest_disk # configure grub arch-chroot /mnt /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg echo echo 'installscript:' echo 'Successfully installed base system.' # Exit cd / umount /mnt/home umount /mnt echo echo 'installscript:' echo 'Installation completed!' echo 'Eject any DVD or remove USB installation media and reboot!' # Report finish_time=$(date +%s) min=$(( $((finish_time - start_time)) /60 )) echo echo 'installscript:' echo -e "\nTotal install time:" $min 'minutes.' exit 0
Amazing.. I'm glad that a script born to the need for two people is evolving in this way..
Offline
Hi my friends,
some little news:
* Added GPT support for disk => 1TB
* changed partprobe with partprobe $dest_disk (to avoid /dev/sr0 error)
* changed partitions creation method from fdisk to parted
#!/bin/bash
#
##################################################################
#title : installscript
#description : Automated installation script for arch linux
#author : Dennis Anfossi & teateawhy , based on archinstaller.sh by Dennis Anfossi .
#contact : https://bbs.archlinux.org/profile.php?id=57887
#date : 10-09
#version : 0.2
#license : GPLv2
#usage : ./installscript
##################################################################
#
# MBR AND BIOS ONLY. NO UEFI SUPPORT.
## -------------
## CONFIGURATION
# Confirm before running (yes/no)
confirm='yes'
# This drive will be formatted (/dev/sdx)
dest_disk=''
# example:
# dest_disk='/dev/sda'
# Check disk size
dest_disk_size=$(fdisk -l ${dest_disk} | grep [D]is[cko] | sed -e 's/[Dd]isk//g' | sed -e 's/[Dd]isco//g' | awk '{print $1 " " $2 " " $3}' | sed 's/,//g' | awk '{print $2}' | sed 's/\.[0-9]//g' | head -1)
# GPT (yes/no)
if [ "$dest_disk_size" -lt "1000" ]; then
gpt='no'
else
gpt='yes'
fi
# swap (yes/no)
swap='yes'
# Partition sizes (Use GiB by default)
swap_size='3'
root_size='25'
# mirror
#mirrorlist=''
# example:
# mirrorlist='Server = http://mirror.de.leaseweb.net/archlinux/$repo/os/$arch'
# Install base-devel group (yes/no)
base_devel='yes'
# language
locale_gen='en_US.UTF-8 UTF-8'
locale_conf='LANG=en_US.UTF-8'
keymap='KEYMAP=us'
font='FONT=Lat2-Terminus16'
# timezone (only one slash in the middle)
timezone=''
# example: timezone='Europe/Berlin'
# hostname
hostname=''
# example:
# hostname='myhostname'
## END CONFIGURATION
## -----------------
start_time=$(date +%s)
# functions
config_fail() {
echo
echo 'installscript:'
echo "Configuration error, please check variable $1 ."
exit 1
}
# Paranoid shell
set -e -u
# Check configuration
[ -z "$confirm" ] && config_fail 'confirm'
[ -z "$dest_disk" ] && config_fail 'dest_disk'
[ -z "$swap" ] && config_fail 'swap'
if [ "$swap" = 'yes' ]; then
[ -z "$swap_size" ] && config_fail 'swap_size'
fi
[ -z "$root_size" ] && config_fail 'root_size'
[ -z "$base_devel" ] && config_fail 'base_devel'
[ -z "$locale_gen" ] && config_fail 'locale_gen'
[ -z "$locale_conf" ] && config_fail 'locale_conf'
[ -z "$keymap" ] && config_fail 'keymap'
[ -z "$font" ] && config_fail 'font'
[ -z "$timezone" ] && config_fail 'timezone'
[ -z "$hostname" ] && config_fail 'hostname'
## Check if dest_disk is a valid block device
udevadm info --query=all --name=$dest_disk | grep DEVTYPE=disk || config_fail 'dest_disk'
# Check internet connection
wget -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google
if [ ! -s /tmp/index.google ];then
echo
echo 'installscript:'
echo 'Error, please check your network connection.'
exit 1
fi
# Initializing
REPLY='yes'
if [ "$confirm" != 'no' ]; then
echo
echo 'installscript:'
echo 'WARNING:'
echo '---------------------------------------'
echo 'The destination drive will be formatted.'
echo "All data on" $dest_disk "will be lost!"
echo '---------------------------------------'
read -p 'Continue (yes/no)? '
fi
if [ "$REPLY" = 'yes' ]; then
umount $dest_disk* || :
wipefs -a $dest_disk
dd if=/dev/zero of=$dest_disk count=100 bs=512; partprobe $dest_disk; sync; sleep 5
else
exit 0
fi
# Partitioning
if [ "$gpt" = 'yes' ]; then
parted ${dest_disk} mklabel gpt
else
parted ${dest_disk} mklabel msdos
fi
## swap_partition
if [ "$swap" = 'yes' ]; then
swap_part_number=1
root_part_number=2
home_part_number=3
else
root_part_number=1
home_part_number=2
fi
if [ "$swap" = 'yes' ]; then
parted ${dest_disk} mkpart primary linux-swap 1024KiB "${swap_size}"GiB
## wait a moment
sleep 1
fi
## root_partition
parted ${dest_disk} mkpart primary ext4 "${swap_size}"GiB "${root_size}"GiB
## wait a moment
sleep 1
# home_partition
parted ${dest_disk} mkpart primary ext4 "${root_size}"GiB 100%
## wait a moment
sleep 1
# Create filesystems
## swap
if [ "$swap" = 'yes' ]; then
mkswap ${dest_disk}${swap_part_number}
swapon ${dest_disk}${swap_part_number}
fi
## root
mkfs.ext4 ${dest_disk}${root_part_number}
## home
mkfs.ext4 ${dest_disk}${home_part_number}
# mounting partition
## root
mount ${dest_disk}${root_part_number} /mnt
## home
mkdir /mnt/home
mount ${dest_disk}${home_part_number} /mnt/home
## mirrorlist
echo "$mirrorlist" > /etc/pacman.d/mirrorlist
# pacstrap
if [ "$base_devel" = 'yes' ]; then
pacstrap /mnt base base-devel
else
pacstrap /mnt base
fi
# configure system
## fstab
genfstab -L /mnt > /mnt/etc/fstab
## locale
echo "$locale_gen" >> /mnt/etc/locale.gen
echo "$locale_conf" > /mnt/etc/locale.conf
arch-chroot /mnt /usr/bin/locale-gen
## console font and keymap
echo "$keymap" > /mnt/etc/vconsole.conf
echo "$font" >> /mnt/etc/vconsole.conf
## timezone
ln -s /usr/share/zoneinfo/$timezone /mnt/etc/localtime
## hardware clock
hwclock --systohc --utc
## hostname
echo "$hostname" > /mnt/etc/hostname
# mkinitcpio
arch-chroot /mnt mkinitcpio -p linux
## password
## echo root:$root_password | arch-chroot /mnt /usr/bin/chpasswd
## echo -e $new_pass"\n"$new_pass | arch-chroot /mnt /usr/bin/passwd
# install grub & os prober packages
pacstrap /mnt grub os-prober
# write grub to mbr
arch-chroot /mnt /usr/bin/grub-install $dest_disk
# configure grub
arch-chroot /mnt /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg
echo
echo 'installscript:'
echo 'Successfully installed base system.'
# Exit
cd /
umount /mnt/home
umount /mnt
echo
echo 'installscript:'
echo 'Installation completed!'
echo 'Eject any DVD or remove USB installation media and reboot!'
# Report
finish_time=$(date +%s)
min=$(( $((finish_time - start_time)) /60 ))
echo
echo 'installscript:'
echo -e "\nTotal install time:" $min 'minutes.'
exit 0
ToDo:
* Add UEFI support
* Add option to set root size and swap size
Offline
Hi,
i created a github repository for this project, you can find it at
https://github.com/vitamins/archinstaller
There you can find a new version, which has some improvements:
* messages in color
* select your filesystem (ext4, ext3, etc.)
* make a list of additional packages that will be installed by the script
* set hardware clock (utc or localtime)
* set root password
Gpt support had to be removed for now.
And last but not least, i added an option to encrypt your home partition with dm-crypt and LUKS. You can enter the new passhprase during runtime.
(Tested in virtualbox.)
@danfossi
There is a problem with the latest script you posted, it fails at the parted command. This is because of the way parted is used.
Sadly i could not solve this, so i went back to using fdisk, which removes gpt support, too.
I suggest that we go back to using fdisk (i still know parted was my suggestion...), and use gdisk for gpt. (Gdisk wants different input than fdisk, but it should not be too hard to figure this out.)
Parted is worse than fdisk, in my opinion, because you need to calculate the beginning and end of a partition in the script, when you add a partition.
If you use swap, you would have to set "swap size" + "root size" as the beginning of the home partition. In your latest script, you simply set "root size" as the beginning of the home partition(wrong).
I suggest that we use github from now, if you want to.
The name has been changed back to archinstaller.sh , i think it is better to keep it like that.
Offline
great work guys!
BHH
HDConvertToX, AutoMen, AutoMKV author
Offline
Hi,
i created a github repository for this project, you can find it at
https://github.com/vitamins/archinstaller
There you can find a new version, which has some improvements:
* messages in color
* select your filesystem (ext4, ext3, etc.)
* make a list of additional packages that will be installed by the script
* set hardware clock (utc or localtime)
* set root password
Gpt support had to be removed for now.
And last but not least, i added an option to encrypt your home partition with dm-crypt and LUKS. You can enter the new passhprase during runtime.
(Tested in virtualbox.)@danfossi
There is a problem with the latest script you posted, it fails at the parted command. This is because of the way parted is used.
Sadly i could not solve this, so i went back to using fdisk, which removes gpt support, too.
I suggest that we go back to using fdisk (i still know parted was my suggestion...), and use gdisk for gpt. (Gdisk wants different input than fdisk, but it should not be too hard to figure this out.)
Parted is worse than fdisk, in my opinion, because you need to calculate the beginning and end of a partition in the script, when you add a partition.
If you use swap, you would have to set "swap size" + "root size" as the beginning of the home partition. In your latest script, you simply set "root size" as the beginning of the home partition(wrong).I suggest that we use github from now, if you want to.
The name has been changed back to archinstaller.sh , i think it is better to keep it like that.
@teateawhy
Amazing work my friend!! the addition of color is a touch of class like the encrypted home!
I've tried the old version of script (with parted) and don't crash on my VirtualBox.. Obviously I agree with you in saying that working with parted is more complicated to calculate the start and end of every partitions and in order to add support UEFI seems an exacting job.
I love github so I'm favorable to switch on it for the next version.
"archinstaller.sh"... love it! <3
Offline
Version 0.4 is out.
* added back gpt support with gdisk
* added syslinux (necessary for gpt)
* option to select syslinux or grub (grub only for mbr by now)
* decide for gpt or mbr based on disk size, if not configured
Usage:
# download
wget https://raw.github.com/vitamins/archinstaller/master/archinstaller_0.4.sh
# Edit the CONFIGURATION
nano archinstaller_0.4.sh
# run
chmod +x archinstaller_0.4.sh
./archinstaller_0.4.sh
Last edited by teateawhy (2013-10-10 10:30:44)
Offline
Some suggestions
1)since the introducition of installing DE to use reflector before pulling down all files.
just add reflector to get an updated ad speedly download of all packages
2) maybe use powerpillow
3) in ari.conf ask about video card, just handle ati/nvidia/intel and download the basic gpl packages:
ATI: xf86-video-ati
Nvidia: xf86-video-nouveau nouveau-dri nouveau-fw
Intel: xf86-video-intel libva-intel-driver
4) another variable to add could be "service to start"
for example if i add networkmanager as package i would like to enable it at boot (systemctl enable networkmanager) (or nfs services...)
you could just parse the string and for every word do systemctl enable xxxx
thanks!
BHH
HDConvertToX, AutoMen, AutoMKV author
Offline
Hi buzzqw,
thanks for your ideas.
1)since the introducition of installing DE to use reflector before pulling down all files.
Currently the dependencies for this script are very little, because archinstaller.sh is designed to run without installing additional packages. Also reflector is not part of the archiso ( i wish it was), which is a common platform to run this script.
Secondly there is already the possibility to specify a mirror to be used for downloading with the mirrolist='' option. Additionally a mirrorlist sorted by score is fetched from archlinux.org and appended to the mirrorlist specified there.
Using reflector is easily done with the current script. Install reflector on the install host, and run it with the options you have in mind. Write the mirrorlist to /etc/pacman.d/mirrorlist with --save /etc/pacman.d/mirrorlist . In ari.conf set the option mirrorlist='keep' , and archinstaller.sh will use the mirrorlist you have generated with reflector.
2) maybe use powerpillow
Powerpill is not part of the arch linux repos, and therefore not supported.
Anyway i encourage you to add powerpill to the script yourself, and see how it works out.
3) in ari.conf ask about video card, just handle ati/nvidia/intel and download the basic gpl packages:
ATI: xf86-video-ati
Nvidia: xf86-video-nouveau nouveau-dri nouveau-fw
Intel: xf86-video-intel libva-intel-drive
With the current script, you can easily achieve this by adding your driver to the list in ari.conf .
packages='xf86-video-ati'
( or xf86-video-intel / xf86-video-nouveau / xf86-video-nv )
I am not sure why you listed additional packages whilst the wiki only mentions xf86-video-... packages here .
4) another variable to add could be "service to start"
for example if i add networkmanager as package i would like to enable it at boot (systemctl enable networkmanager) (or nfs services...)
you could just parse the string and for every word do systemctl enable xxxx
No.
It is better to reboot, use systemctl start xyz and see how it works out. Then enable it for the next boot after you know it works.
Last edited by teateawhy (2013-10-15 15:52:31)
Offline
better save then wrong
i have already a "post_inst.sh" script (tuned to my hw/software) that will install reflector, powerpill,graphics driver, network manager.. libreoffice.. and so on
i am trying to reduce to only one script
with my script i add yourt too (remember that is launched after install/reboot)
pacman -Sy reflector
reflector --verbose -l 7 --sort rate --save /etc/pacman.d/mirrorlist
echo "[archlinuxfr]" | tee -a /etc/pacman.conf
echo "SigLevel = Never" | tee -a /etc/pacman.conf
echo "Server = http://repo.archlinux.fr/\$arch" | tee -a /etc/pacman.conf
pacman -Syyu yaourt
one question about user add.. i always use thin string for adding user
useradd -m -g users -G wheel,video,audio,sys,lp,storage,scanner,games,network -s /bin/bash buzzqw
in archinstaller is missing several groups.. only wheel is present.. why ?
about graphics... it's just for a quick alias, so you don't have to specify driver-package.. just your video card
thanks for your work (already used 2 time your script on different pc without any problem)!
BHH
HDConvertToX, AutoMen, AutoMKV author
Offline
one question about user add.. i always use thin string for adding user
useradd -m -g users -G wheel,video,audio,sys,lp,storage,scanner,games,network -s /bin/bash buzzqw
in archinstaller is missing several groups.. only wheel is present.. why ?
No. Adding your user to a lot of groups is not necessary anymore.
https://wiki.archlinux.org/index.php/Sy … nformation
thanks for your work (already used 2 time your script on different pc without any problem)!
Good to hear that, don't forget to give danfossi credit.
Offline
Hi Archers,
thanks to the strong contribution of "teateawhy," what was a sketch of scripts, now follows all the points listed by the official documentation of Arch with minimal user effort.
Among the features of the script there are:
* Support GPT/MBR (GPT is used by default for HDD > 1TiB)
* Support UEFI system
* Allows you to choose between GRUB/syslinux
* Allows you to choose whether to activate a swap partition
* Allows you to choose how much space to allocate for swap/root partition
* Allows you to choose which filesystem to use
* Can encrypt home partition (Allows you to choose chyper)
* Allows you to choose a preferred mirror for the installation / can be update by the script
* Allows you to choose a preferred mirror for the installation
* Can install additional packages after the installation of base system
* Allows you to choose which keymap/font/locale/timezone to use
* Set hostname
* Set hardware clock
* Allows you to set a root password
* Allows you to add an additional user (non privileged)
* Allows you to configure network with dhcpcd/netctl/ifplugd
* Allows you to install Xorg (only vesa driver are included by default)
* Allows you to install a desktop environment (xfce4/gnome/kde/cinnamon/lxde/enlightenment17)
* Allows you to install a display manager
* Allows you to choose if boot the system in graphical mode
How To Download:
wget https://raw.github.com/vitamins/archinstaller/master/archinstaller_0.4.6.sh
wget https://raw.github.com/vitamins/archinstaller/master/ari.conf
How To Use:
nano ./ari.conf (edit with your preferences)
chmod a+x ./archinstaller_0.4.6.sh
./archinstaller_0.4.6.sh
How To Check for update:
* Visit GitHub project's page: https://github.com/vitamins/archinstaller
Last edited by danfossi (2013-10-24 07:53:33)
Offline
You might want to open fstab and mkinitcpio.conf and the like in $EDITOR afterwards so that they can be checked.
It took a while, but your suggestion is implemented now. Fstab, crypttab and mkinitcpio.conf are opened in an editor when setting edit_conf to yes.
Offline