diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-08-30 01:52:49 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-08-30 01:52:49 +0200 |
commit | cf8eb07b11f42d59a2685c6519f874a3f159c26b (patch) | |
tree | ef518b68f67fe683e3ad41ac8fc437af5d22eec5 | |
parent | 843b4b3405f6377e52e86d79bd58d0d217be7793 (diff) |
add code
-rwxr-xr-x | artixinstall | 42 | ||||
-rwxr-xr-x | mkartix | 49 |
2 files changed, 91 insertions, 0 deletions
diff --git a/artixinstall b/artixinstall new file mode 100755 index 0000000..b5a2286 --- /dev/null +++ b/artixinstall @@ -0,0 +1,42 @@ +#! /bin/bash + +if [ "${UID}" != "0" ]; then + echo "artixinstall: requires root permissions" + exit 1 +fi + +pacman -Sy --noconfirm parted + +parted /dev/sda mklabel msdos +parted -a optimal /dev/sda mkpart primary ext4 0% 256MiB +parted -a optimal /dev/sda mkpart primary btrfs 256MiB 100% + +mkfs.ext4 -F -L BOOT /dev/sda1 +mkfs.btrfs -f /dev/sda2 + +mkdir /btrfs +mount -o compress=zstd /dev/sda2 /btrfs + +btrfs subvolume create /btrfs/root +btrfs subvolume create /btrfs/swap + +chattr +c /btrfs/swap +dd if=/dev/zero of=/btrfs/swap/swapfile bs=1M count=4096 status=progress +chmod 0600 /btrfs/swap/swapfile +mkswap -U clear /btrfs/swap/swapfile +swapon /btrfs/swap/swapfile + +mount --bind /btrfs/root /mnt +mkdir /mnt/boot +mount /dev/sda1 /mnt/boot + +basestrap /mnt base base-devel openrc elogind-openrc +basestrap /mnt linux linux-firmware + +artix-chroot /mnt bash -c 'curl https://raw.githubusercontent.com/HimbeerserverDE/artixinstall/main/mkartix | bash' + +umount -R /mnt + +echo "Artix has been successfully installed! Press Enter to reboot." +read +reboot @@ -0,0 +1,49 @@ +#! /bin/bash + +ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime +hwclock --systohc + +sed -i "s/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/" /etc/locale.gen +locale-gen + +cat <<EOT > /etc/locale.conf +export LANG="en_US.UTF-8" +export LC_COLLATE="C" +EOT + +pacman -S --noconfirm btrfs-progs grub os-prober +grub-install --recheck /dev/sda +grub-mkconfig -o /boot/grub/grub.cfg + +echo -en 'artix\nartix' | passwd + +echo artix > /etc/hostname + +cat <<EOT > /etc/hosts +# Static table lookup for hostnames. +# See hosts(5) for details. + +127.0.0.1 localhost +127.0.1.1 artix.local artix + +# IPv6 +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +EOT + +sed -i 's/hostname="localhost"/hostname="artix"/' /etc/conf.d/hostname + +pacman -S --noconfirm dhcpcd + +cat <<EOT >> /etc/conf.d/net + +config_eth0="dhcp" +EOT + +ln -s /etc/init.d/net.lo /etc/init.d/net.eth0 +rc-update add net.eth0 default + +sed -i 's/keymap="us"/keymap="de"/' /etc/conf.d/keymaps + +exit 0 |