Giter Club home page Giter Club logo

easy-arch's Introduction

easy-arch is a bash script that boostraps Arch Linux with sane opinionated defaults.

  • BTRFS snapshots: you will have a resilient setup that automatically takes snapshots of your volumes based on a weekly schedule
  • LUKS2 encryption: your data will live on a LUKS2 partition protected by a password
  • ZRAM: the setup use ZRAM which aims to replace traditional swap partition/files by making the system snappier
  • systemd-oomd: systemd-oomd will take care of OOM situations at userspace level rather than at kernel level, making the system less prone to kernel crashes
  • VM additions: the script automatically provides guest tools if it detects that a virtualized environment such as VMWare Workstation, VirtualBox, QEMU-KVM is being used
  • User account setup: a default user account with sudo permissions can be configured in order to avoid hassle in the post installation phase
  • CI checks: ShellChecker checks every PR periodically for bash syntax errors, bad coding practices, etc...

One-step Automated Install (shorter)

bash <(curl -sL bit.ly/easy-arch)

Alternative Methods (manual)

wget -O easy-arch.sh https://raw.githubusercontent.com/classy-giraffe/easy-arch/main/easy-arch.sh
chmod +x easy-arch.sh
bash easy-arch.sh

Partitions layout

The partitions layout is simple and it consists solely of two partitions:

  1. A FAT32 partition (512MiB), mounted at /boot/ as ESP.
  2. A LUKS2 encrypted container, which takes the rest of the disk space, mounted at / as root.
Partition Number Label Size Mountpoint Filesystem
1 ESP 512 MiB /boot/ FAT32
2 Cryptroot Rest of the disk / BTRFS Encrypted (LUKS2)

BTRFS subvolumes layout

The BTRFS subvolumes layout follows the traditional and suggested layout used by Snapper, you can find it here.

Subvolume Number Subvolume Name Mountpoint
1 @ /
2 @home /home
3 @root /root
4 @srv /srv
5 @snapshots /.snapshots
6 @var_log /var/log
7 @var_pkgs /var/cache/pacman/pkg

easy-arch's People

Contributors

classy-giraffe avatar cyfraka avatar fawzakin avatar i-c-u-p avatar isparsh avatar pm4rcin avatar stjiub avatar tommytran732 avatar uni-dos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

easy-arch's Issues

bios compatibility

How can I install arch using this script if my system don't support UEFI boot, can I use this on bios too?

Not working on Asus laptop (GL502VS)

Hey! Looking for any help to get this working on my laptop, which seems to be having hardware related complications (or maybe UEFI settings?).

These are the errors that pop up during installation and lead to a non-bootable drive:

sed: can't read /mnt/etc/locale.gen: No such file or directory
warning: /mnt/etc/fstab installed as /mnt/etc/fstab.pacnew
warning: /mnt/etc/hosts installed as /mnt/etc/hosts.pacnew
sed: can't read /mnt/etc/default/grub: No such file or directory
useradd: group 'users' does not exist
useradd: the GROUP= configuration in /etc/default/useradd will be ignored
useradd: group 'wheel' does not exist
chpasswd: (user jasper) pam_chauthtok() failed, error:
User not known to the underlying authentication module
chpasswd: (line 1, user jasper) password not changed
sed: can't read /mnt/etc/pacman.conf: No such file or directory

I've checked that it's not related to:

  • Using NVMe or HDD
  • Arch version
  • Type of kernel
  • Type of network adapter

Any ideas? Thank you in advance.

Proposition: two hard drive setup & systemd boot

First I want to say that easy-arch is the perfect script for my laptop.

Propositions I will be happy to see and test if you implement one ore both of them:

  1. I have a 256GB SSD and 128 GB M.2 SSD and for the moment BTRFS using the both of the drives I used only in Fedora 34/35
  2. Systemd boot

Switching bootloaders

I'm starting this issue being totally honest: I hate GRUB so my opinion on it may be biased, which is why I'm asking for your opinions, as you people are the main users of this project and I value your input more than mine. The question is: Should we move to rEFInd or stay on GRUB (or maybe even some other bootloader)? The reason I'm asking this is because I totally dislike GRUB, it's a big program we probably don't even need and the only reason we're using it is for booting into BTRFS snapshots, other than that it's useless. This combined to the fact that now rEFInd can be used to boot into snapshots, hence my question. You're asked to express your sincere opinion. Cheers, tommy! ๐Ÿ˜ƒ

wheel privilege

On a fresh install using this script, the wheel group is not enabled in the visudo config file.

I didn't now if you chose that behavior but, maybe you can add a line of text saying that:"by default the system don't have the wheel group uncommented from the visudo file, ecc...".

If u won't i can edit maybe the last output text of the script to make the script saying something like that.

best

Consider switching to encrypted swap or zram

I don't think the way it sets up unencrypted swap right now is a good idea. I think its better to encrypt it using dmcrypt or just to switch to zram and use the same configuration as Fedora does.

Mandatory Acess Control

I think the setup script should also auto setup some security beyond disk encryption.

A MAC system is important for security, but a lot of new users actually forget to set it up (which does not help by the fact that a lot of guides completely ignore this topic). On Arch, it seems like AppArmor is the only mature and readily available MAC system. SELinux on Arch is still a WIP and doesn't seem to have a default targetted policies like Fedora/Red Hat, and I have never seen any major linux distros using Tomoyo. AppArmor is also needed to confine Snap packages should the user choose to install them. Thus, I think we should just install and enable AppArmor out of the box. What do you think?

Adding normal user account

Hello, I'm curious why the script doesn't ask for a normal user and only leaves root as the initial user.

My extensive fork here has that feature. I wonder if it is a good idea if I create a pull request for that.

Thank you for your script.

Failed to commit transaction conflicting files could not install files to new root

Describe the bug
After choosing my network manager and kernel the script goes on to use pacman to do it's job and fails with the "Failed to commit transaction (conflicting files) could not install files to new root", percedes with the rest of the automation, and throws errors after fstab creation such as could not read grub config, no chpasswd file or directory like packages were never installed, and ends the script. I can chroot in but im unable to install packages as well.
This is my first time installing arch (switching from kubuntu) and all day ive been unable to follow the Arch Wiki and this to a issue where my machine is unable to even recognize the filesystem like there is no efi (lsblk confirms there is).

Additional context

  • Thinkpad X1 Carbon Gen 6 with 512 Gb nvme drive (20KH* model)
  • Formatted nvme drive and new partition table
  • Turned off secure boot and double checked

To Reproduce

  1. Run the script
  2. Select option 1 for both kernel and network manager
  3. Failure to install scripts
  4. Setup user and hostname
  5. Failure to complete the rest of the system due to missing packages??

Problem with snapshots subvolume

Hi, I saw that you first create the subvolume .snapshots, mount it and later on you create the snapper config and delete the subvolume and create a directory .snapshots and mount that directory. Are this correct steps for setting up snapper or did you write too many lines? I'm asking seriously since it's new to me so I could not be familiar with the steps.

Consider switching to LUKS2 or encrypted /boot

As it stands right now, we seem to be using LUKS1 for no apparent reason. I think we should consider 1 of the following:

  1. If we don't plan to encrypt /boot, it might be a better idea to use LUKS2 than LUKS1.
  2. If we are using LUKS1, then why not making the boot partition a BTRFS subvolume and encrypt it as well? (/boot/efi will be kept seperated) After all, this does have security benefits and help prevent some evil maid attacks.

Unbootable installation

Script runs through with no problems, but ends up actually in an unbootable state

PXL_20221009_200246813_1

Untitled

Untitled3

Switched the boot mode in BIOS from [Legacy+UEFI] to [UEFI], still unbootable. Did the whole installation once more again. Still unbootable.
What now?

Untitledas

Follow opensuse's btrfs subvolumes layout

Hi,
I think we should adopt suse's layout for subvolumes. In my opinion they have sensible arguments. One thing to note is that we don't have to create subvolume for /tmp since it's by default tmpfs. I don't know what about /boot, maybe you have an idea? Source

[feature]: Adding more package options to script.

Hello there, great work!
Reading through the script I had a few suggestions:-

  1. In the base installation command, I notice base-devel is missing. It already includes a bunch of stuff like sudo, gawk, gcc, automake and others. I realize that some users may not want all of the things so we should definitely keep a condition (like the kernel choices but only yes/no for this one) whether the user wants to install this package or not.
  2. Similarly, we should keep a condition for users to have a choice between their network utilities (example: NetworkManager, iwd, or skip/install later).

I would definitely like to add them myself as soon as I can, but real-life is keeping me busy atm.

Selecting Linux Hardened leads to GRUB rescue mode

Hello!

Sorry in advance - I have a very Arch-newbie question. (was kind of hoping "easy-arch" would make things easy, heh)
After your script finishes installing, a reboot boots into GRUB, where I assume I'm supposed to be loading the kernel with the linux command and initialize other things with initrd, but none of the commands I've been finding from google have worked for me. Can you pretty please tell me how to boot into Arch from GRUB?

There's an active discussion on the Arch subreddit about how the official Arch installation guide could be more user friendly. Seeing how your script might be found by other newbies, maybe it would help to add basic instructions for using GRUB into this repo's README? I'm aware this repo isn't exactly aimed at beginners, but helping people get started with BTRFS and ZRAM is probably a good thing.

Hopefully I haven't done something completely wrong.

set root=(hd0,gpt1)
linux /vmlinuz-linux
boot

Gets me:

error: no suitable video mode found.
Booting in blind mode

But it doesn't go anywhere from there. I'm guessing I still need to figure out the initrd bit.

EDIT:
Just noticed I'm not the only one not enjoying GRUB.
Did you give up on rEFInd?

Request: Dual Boot

Describe the bug
Script forces to erase all partition layout on disk, even if there's sufficient unused space on partition table, in a scenario where existing Windows would like to be kept intact for dual boot

To Reproduce
Steps to reproduce the behavior:

  1. On your Windows PC, shrink the Windows Data partition and make available a large free space in partition table
  2. Download Arch Iso and boot with it.
  3. Use the easy-arch script, at least step, it will ask you to confirm deleting all your partitions

Expected behavior
Present dialog that new partitions will be created for boot and encrypted root, use default size for boot ie 2gb and allocate rest of free space to root.

can i publish a based on script

Hi I like your script,
I want to ask that if I modify this script and Publish it with credits does It get copyright clam.

Thank you

Adjustments to default mount settings

Hi, I think that default mount options should be revisited. I don't think we need "ssd" since btrfs can automatically detect disk type. Another option "autodefrag" in my opinion should be avoided since defragmentation reduces lifespan of SSDs. And for the space_cache I think it should be renamed to space_cache=v2 discussion: 1, 2

easy-arch/easy-arch.sh

Lines 135 to 137 in 80ffc96

mount -o ssd,noatime,space_cache,compress=zstd,autodefrag,discard=async,subvol=@home $BTRFS /mnt/home
mount -o ssd,noatime,space_cache,compress=zstd,autodefrag,discard=async,subvol=@snapshots $BTRFS /mnt/.snapshots
mount -o ssd,noatime,space_cache,compress=zstd,autodefrag,discard=async,subvol=@var_log $BTRFS /mnt/var/log

If you think I'm wrong on any options make sure to correct me. :)

Consider reducing ESP partition size

Previously, the script mounts the ESP partition as /boot, and it made sense to have 512MB allocated to it. However, since /boot is now a subvolume and the ESP partition is mounted as /boot/efi (which only contains grubx64.efi), I think its reasonable to reduce it to ~300 MB or even less.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.