User Tools

Site Tools


arch:install

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
arch:install [2022/07/18 14:51] – created msarch:install [2023/11/02 23:06] (current) ms
Line 1: Line 1:
 +<code>
 #!/bin/bash #!/bin/bash
 set -e set -e
Line 10: Line 11:
 mount /dev/sda1 /mnt mount /dev/sda1 /mnt
  
-pacstrap /mnt base linux linux-firmware vim+pacstrap -K /mnt base linux linux-firmware vim
  
 genfstab -U /mnt >> /mnt/etc/fstab genfstab -U /mnt >> /mnt/etc/fstab
  
-chroot /mnt /bin/bash <<"EOT"+arch-chroot /mnt <<"EOT"
 ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
 hwclock --systohc hwclock --systohc
Line 26: Line 27:
 echo "KEYMAP=de-latin1" > /etc/vconsole.conf  echo "KEYMAP=de-latin1" > /etc/vconsole.conf 
 echo "vm51" > /etc/hostname echo "vm51" > /etc/hostname
-echo -e "sun\nsun" | passwd root >/dev/null 2>&+echo -e "password\npassword" | passwd root >/dev/null 2>&
-pacman -Sy grub intel-ucode +dd if=/dev/zero of=/swapfile bs=1M count=1024 
 +chmod 600 /swapfile 
 +mkswap /swapfile 
 +echo '/swapfile   none   swap   sw   0 0' | tee -a /etc/fstab 
 +yes | pacman -grub intel-ucode
 grub-install --target=i386-pc /dev/sda grub-install --target=i386-pc /dev/sda
 +sed -i '/GRUB_TIMEOUT=/s/=5/=2/' /etc/default/grub
 +sed -i '/GRUB_CMDLINE_LINUX=/s/="/="console=ttyS0/' /etc/default/grub
 grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
 +echo "[Match]" > /etc/systemd/network/lan-ens3.network
 +echo "Name=ens3" >> /etc/systemd/network/lan-ens3.network
 +echo >> /etc/systemd/network/lan-ens3.network
 +echo "[Network]" >> /etc/systemd/network/lan-ens3.network
 +echo "Address=192.168.1.51/24" >> /etc/systemd/network/lan-ens3.network
 +echo "Gateway=192.168.1.1" >> /etc/systemd/network/lan-ens3.network
 +echo "DNS=8.8.8.8 192.168.1.1" >> /etc/systemd/network/lan-ens3.network
 +systemctl enable systemd-networkd
 +yes | pacman -S openssh
 +systemctl enable sshd.service
 +echo "set enable-bracketed-paste off" >> /etc/inputrc
 +useradd -m -s /bin/bash user
 +echo -e "password\npassword" | passwd user >/dev/null 2>&1
 +yes | pacman -S sudo
 +usermod -aG wheel user
 +sed -i '/wheel ALL=(ALL:ALL) ALL/s/^# //g' /etc/sudoers
 +cd /usr/bin && ln -s vim vi
 +systemctl enable systemd-timesyncd.service
 +systemctl enable systemd-resolved
 EOT EOT
 +rm /mnt/etc/resolv.conf
 +
 +reboot
 +</code>
 +<code>
 +install_arch.txt
 +
 +# in einem Terminal
 +telnet localhost 9911
 +
 +# als root anmelden
 +loadkeys de-latin1
 +
 +timedatectl
 +timedatectl set-timezone Europe/Berlin
 +( ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime )
 +timedatectl set-ntp true
 +
 +# Disk partitionieren
 +Device     Boot   Start      End  Sectors Size Id Type
 +/dev/sda1          2048  2099199  2097152   1G 82 Linux swap / Solaris
 +/dev/sda2       2099200 16777215 14678016   7G 83 Linux
 +
 +mkfs.ext4 /dev/sda2
 +mount /dev/sda2 /mnt
 +mkswap /dev/sda1 
 +swapon /dev/sda1
 +
 +pacstrap /mnt base linux linux-firmware vim
 +
 +genfstab -U /mnt >> /mnt/etc/fstab
 +
 +arch-chroot /mnt
 +
 +ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
 +hwclock --systohc
 +
 +vim /etc/locale.gen
 +locale-gen
 +echo "LANG=en_US.UTF-8" > /etc/locale.conf 
 +
 +echo "KEYMAP=de-latin1" > /etc/vconsole.conf 
 +
 +echo "vm51" > /etc/hostname
 +
 +# mkinitcpio -P
 +
 +# root Passwort setzen
 +passwd
 +
 +pacman -S grub intel-ucode 
 +
 +grub-install --target=i386-pc /dev/sda
 +grub-mkconfig -o /boot/grub/grub.cfg
 +
 +exit
 +(chroot)
 +
 +systemctl reboot
 +systemctl poweroff
 +</code>
 +<code>
 +# Netzwerk
 +# as root
 +ip link set ens3 up
 +ip addr add 192.168.1.51/24 broadcast + dev ens3 
 +ip route add default via 192.168.1.1 dev ens3 
 +
 +vim /etc/systemd/network/lan-verbindung.network
 +   [Match]
 +   Name=ens3
 +
 +   [Network]
 +   Address=192.168.1.51/24
 +   Gateway=192.168.1.1
 +   DNS=192.168.1.1 8.8.8.8
 +
 +systemctl enable systemd-networkd
 +systemctl start systemd-networkd
 +systemctl status systemd-networkd
 +
 +# DNS setup
 +rm /etc/resolv.conf
 +# ln -rsf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
 +systemctl status systemd-resolved
 +systemctl enable systemd-resolved 
 +systemctl start systemd-resolved 
 +resolvectl status
 +
 +ping 8.8.8.8 -c3
 +( ping google.com )
 +
 +# SSH
 +pacman -S openssh
 +systemctl status sshd.service
 +systemctl start sshd.service
 +systemctl enable sshd.service
 +
 +# copy vm host-keys
 +cd /etc/ssh
 +scp user@192.168.1.2:/path/to/ssh* .
 +
 +# inputrc
 +echo "set enable-bracketed-paste off" >> /etc/inputrc
 +
 +# ZSH
 +pacman -S zsh
 +wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
 +
 +# files in Pakete finden
 +pacman -S pkgfile
 +pkgfile --update
 +pkgfile <file>
 +
 +# user anlegen
 +useradd -m -s /bin/bash user
 +passwd user
 +</code>
 +<code>
 +# misc
 +# set keyboard in X11
 +setxkbmap de
 +
 +# xinit
 +cp /etc/X11/xinit/xinitrc /home/user/.xinitrc
 +vi /home/user/.xinitrc
 +...
 +fi
 +
 +exec openbox-session
  
 +</code>
arch/install.1658148686.txt.gz · Last modified: 2023/01/11 20:30 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki