Vorher lesen : ==> Kurze Anleitung zum Einstieg in Linux für Windows-user <==
Arch Linux
dd if=./Arch_201707.iso of=/dev/sdb bs=4M && sync
loadkezs de
(Die
US-Tastatur hat y und z vertauscht) cd /
und das erste
Skript wird heruntergeladen mit:
curl http://skripta.de/ALI1.sh > ALI1.sh
chmod 1777 ./ALI1.sh ./ALI1.sh
################################################
#
# Arch-Linux-Installer-script (ALI1.sh)
# Erster Teil
#
################################################
#
# Tastatur einstellen:
loadkeys de-latin1
#
# WLAN-Netzwerk einstellen:
wlan() {
rfkill unblock wifi
wifi-menu
}
read -p"==> WLAN konfigurieren? (j/n) " response
if [ "$response" == "j" ]; then
wlan
fi
################################################
# Skripte downloaden:
# curl http://skripta.de/ALI1.sh > ALI1.sh
curl http://skripta.de/ALI2.sh > ALI2.sh
curl http://skripta.de/ALI3.sh > ALI3.sh
curl http://skripta.de/xfce.tar.gz > xfce.tar.gz
sync;sync;
echo "Installskripte heruntergeladen..."
chmod 1777 ALI1.sh ALI2.sh ALI3.sh xfce.tar.gz
################################################
# Package-Manager updaten:
pacman -Syy
################################################
# Festplatte vorbereiten:
prepare() {
echo "Festplatte auswählen: "
lsblk
read -p"Festplatte = sda, sdb, sdc ?" response
mountpoint=/dev/$response
echo $mountpoint
# Neuen Bootsektor schreiben auf sda:
dd count=1 BS=512 if=/dev/zero of=${mountpoint}
# Partitionen erstellen:
cfdisk ${mountpoint}
mkfs.ext4 ${mountpoint}1
#oder:
#mkfs.ext4 -L "Archlinux" ${mountpoint}1
#mkswap ${mountpoint}2
#swapon ${mountpoint}2
##########################################
# Festplattenpartition mounten (nach /mnt):
mount ${mountpoint}1 /mnt
# Grundsystem herunterladen und
# auf Festplattenpartition installieren:
pacstrap /mnt base
#pacstrap /mnt base-devel # Entwicklertools (gcc, make ...)
pacstrap /mnt networkmanager mc network-manager-applet net-tools
pacstrap /mnt iw wireless_tools wpa_supplicant wpa_actiond dialog
# Übrige Skripte auf Partition kopieren:
cp ALI1.sh /mnt/ALI1.sh
cp ALI2.sh /mnt/ALI2.sh
cp ALI3.sh /mnt/ALI3.sh
cp xfce.tar.gz /mnt/xfce.tar.gz
# Neue Partitionsinfos notieren:
genfstab -U /mnt >> /mnt/etc/fstab
}
read -p"==> Festplatte vorbereiten/formatieren? (j/n) " response
if [ "$response" == "j" ]; then
prepare
fi
################################################
# Ende ALI1.sh
echo "========================================="
echo "Nun folgendes eingeben:"
echo "=> arch-chroot /mnt <=="
echo "und danach AI2.sh aufrufen"
read -p"Taste drücken..."
Nach Abarbeitung von ALI1 am Prompt eingeben:
arch-chroot /mnt
./ALI2.sh
############################################
#
# Arch-Installer 2. Teil (in chroot):
# ALI2.sh
#
############################################
# Kabel-Netzwerk konfigurieren:
netc() {
ip link
eth="enp1s0"
wlan="wlp2s0"
echo "Stimmt das: "
echo "eth=$eth"
echo "wlan=$wlan"
#read -rsp $'Enter "eth=xxx"\n'
#read -rsp $'Enter "wlan=xxx"\n'
echo -e "WIRED_INTERFACE = ${eth}" >> /etc/conf.d/netcfg
echo -e "WIRELESS_INTERFACE = ${wlan}" >> /etc/conf.d/netcfg
echo "Taste drücken..."
systemctl enable NetworkManager.service
systemctl start NetworkManager.service
# systemctl enable dhcpcd@enp1s0.service
# systemctl start dhcpcd@enp1s0.service
}
read -p"==> Netzwerk konfigurieren? (j/n) " response
if [ "$response" == "j" ]; then
netc
fi
#############################################
# Lokalisierung:
localize() {
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc
echo -e "de_DE.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo -e "LANG=de_DE.UTF-8" > /etc/locale.conf
export LANG=de_DE.UTF-8
echo -e "KEYMAP=de-latin1
FONT=lat9w-16
FONT_MAP=8859-1_to_uni" >>/etc/vconsole.conf
localectl set-x11-keymap de pc105 de
echo archlinux > /etc/hostname
# Neuen User anlegen:
useradd -m -g users -s /bin/bash archie
echo "===================================="
echo " "
echo -e "\e[91mPASSWORT für archie: "
passwd archie
echo -e "archie ALL=(ALL) ALL" >> /etc/sudoers
echo " "
echo -e "\e[91mPassword for root:"
passwd root
}
read -p"==> Localisierung? (j/n) " response
if [ "$response" == "j" ]; then
localize
fi
############################################
# Bootloader installieren
boot() {
# Grub herunterladen:
pacman -Sy grub grub-bios os-prober
set -e
echo "================================"
echo -e "\e[91mACHTUNG: Bootdevice auswählen:"
blkid
echo "================================"
echo -e "\e[1mVoreinstellung = /dev/sda !"
echo -e "\e[0m"
read -p"Weiter mit (w)" response
if [ "$response" != "w" ]; then
exit
fi
bootdevice=/dev/sda
#bootdevice=/dev/sdb
#bootdevice=/dev/sdc
grub-mkconfig -o /boot/grub/grub.cfg
grub-install --target=i386-pc --recheck $bootdevice --force
mkinitcpio -p linux
}
read -p"==> Bootloader installieren? (j/n) " response
if [ "$response" == "j" ]; then
boot
fi
##############################################
# 3.Teil aufrufen
echo "Lokalisierung beendet..."
echo "ALI3.sh aufrufen..."
read -p"(Taste drücken...)"
#############################################
Wenn man an dieser Stelle angelangt ist (und keine Fehler aufgetreten sind), dann hat man exit
exit
reboot
#oder mit
"Strg Alt Del"
./AI3.sh
############################################
#
# Arch-Installer 3. Teil
# ALI3.sh
#
############################################
gui() {
echo "GUI wird installiert..."
# XServer / Windowmanager installieren
# hier: XFCE und Loginmanager lightdm
pacman -Sy xfce4 xfce4-goodies
pacman -Sy gvfs ttf-liberation xdg-user-dirs opendesktop-fonts
pacman -Sy lightdm lightdm-gtk-greeter
pacman -Sy xorg-xinit xorg-server xf86-input-synaptics
systemctl start lightdm.service
systemctl enable lightdm.service
# Alle Grafikkarten-Treiber:
pacman -Sy xorg-drivers
# oder nur ausgewählte:
# lspci | grep VGA
# pacman -S xf86-video-* [zu benutzenden Treiber hier wählen]
# z.B.
# pacman -S xf86-video-intel
# meist nicht benötigt:
# cp /etc/X11/xinit/xinitrc ~/.xinitrc
}
read -p"==> GUI installieren (j/n) ?" response
if [ "$response" == "j" ]; then
gui
fi
############################################
personize() {
# XFCE-Einstellungen / Background / Home :
mkdir /TEMP
tar xzf /xfce.tar.gz -C /TEMP
echo "==> XFCE Einstellungen kopiert nach /TEMP ..."
#read -p"Taste drücken..."
cp /TEMP/Archlinux-icon.png /usr/share/pixmaps
cp /TEMP/Background-2.jpg /usr/share/backgrounds/xfce
cp -R /TEMP/Vertex-* /usr/share/themes > /dev/null
cp /TEMP/xfce4/xfconf/xfce-perchannel-xml/* /etc/xdg/xfce4/xfconf/xfce-perchannel-xml
#cp /TEMP/xfce4/xfconf/xfce-perchannel-xml/* /home/archie/.config/xfce4/xfconf/xfce-perchannel-xml
echo "==> XFCE Default Look installiert"
#read -p"Taste drücken..."
mkdir /etc/lightdm/lightdm.conf.d
touch /etc/lightdm/lightdm.conf.d/50-myconfig.conf
echo -e "\n[SeatDefaults] \nautologin-user=archie \nautologin-user-timeout=0 \n" >> /etc/lightdm/lightdm.conf.d/50-myconfig.conf
groupadd -r autologin
gpasswd -a archie autologin
echo "==> Autologin installiert..."
}
read -p"==> Desktop-Einstellungen kopieren (j/n)?" response
if [ "$response" == "j" ]; then
personize
fi
##############################################
soft() {
echo "Weitere Software wird installiert..."
pacman -Sy pavucontrol pulseaudio-zeroconf
pacman -Sy firefox flashplugin thunderbird
#pacman -Sy libreoffice-fresh-de
pacman -Sy mc bleachbit geany xorriso unrar unzip mtpaint cpupower powertop seahorse
pacman -Sy xarchiver xdg-utils zip unzip samba gvfs-smb
read -p"==> RENAME /etc/samba/samba.conf-sample !" response
#Fuer yaourt: /etc/pacman.conf:
echo -e "[archlinuxfr] \n
SigLevel = Never \n
Server = http://repo.archlinux.fr/x86_64\n " >> /etc/pacman.conf
pacman -Sy yaourt
#als user (nicht root):
su archie
yaourt -S ttf-ms-fonts pamac-aur
su
}
read -p"==> Weitere Software-Pakete installieren? (j/n) " response
if [ "$response" == "j" ]; then
soft
fi
# Cleanup:
echo "PACMAN cleanup..."
pacman -Rsn $(pacman -Qdtq)
###########################################
exits() {
exit
exit
sync
echo "REBOOT !!"
reboot
}
read -p"==> System jetzt neu starten? (j/n)" response
if [ "$response" == "j" ]; then
exits
fi
Am Ende steht wiederum ein Neustart. Das wars eigentlich schon. Viel Spass!