-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
144 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
# trolley-arch-install | ||
an automated arch install tool forked from microarch that installs plain old arch | ||
# ezArch | ||
An easy way to get Arch installed on your machine! | ||
|
||
## Contents | ||
This script consists of two parts: | ||
- ezarch.sh: installs the base system to your hard disk | ||
- ezarch-chroot.sh: does post-setup of your newly installed arch system | ||
|
||
## Get Started | ||
To get started, `git clone https://github.com/piotr25691/ezarch` and run `ezarch.sh`. | ||
|
||
Be aware that this will wipe your drive clean, so check if you got backups, or that you don't need stuff currently on your hard disk. | ||
|
||
## Requirements | ||
This script requires an IDE, SCSI or SATA disk, MMC storage is not supported.<br><br> | ||
|
||
### Enjoy using Arch btw! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
DEV=$1 | ||
|
||
# Install the GRUB bootloader | ||
# This is the part that allows you to boot into the system. | ||
pacman --noconfirm -Sy grub efibootmgr | ||
if [ -e /sys/firmware/efi/efivars ] | ||
then | ||
grub-install --target=x86_64-efi --force $DEV | ||
else | ||
grub-install --target=i386-pc --force $DEV | ||
fi | ||
grub-mkconfig -o /boot/grub/grub.cfg | ||
|
||
# Ask for and set up the root password. | ||
# Please pick something secure, or you'll get kids fucking around in your computer. | ||
echo "Please enter your root password: " | ||
read -s ROOTPASS | ||
echo "root:$ROOTPASS" | chpasswd | ||
|
||
# Ask and setup the username and password of the regular user. | ||
# This user will have sudo privileges, so please set up a secure password if you don't want kids fucking around in your computer. | ||
read -p "Enter the username of your user: " USERNAME | ||
useradd -m $USERNAME | ||
usermod -aG wheel $USERNAME | ||
echo "Please enter your user password: " | ||
read -s USERPASS | ||
echo "$USERNAME:$USERPASS" | chpasswd | ||
|
||
|
||
# Enable wheel privileges for sudo | ||
# They are disabled by default. | ||
sed -i '/%wheel ALL=(ALL:ALL) ALL/s/^# //g' /etc/sudoers | ||
|
||
# Create symlinks to micro | ||
# The default text editor of choice in ezArch is Micro. | ||
# If you want to go back to Nano, or use Vim, delete the symlinks and install the corresponding package. | ||
ln -s $(which micro) /bin/nano | ||
ln -s $(which micro) /bin/vim | ||
|
||
# Delete GRUB after setup | ||
# GRUB packages are not needed after setup, so they will be deleted to save space. | ||
pacman --noconfirm -R grub efibootmgr | ||
|
||
# Enable network services | ||
# These services will allow you to connect to the internet. | ||
systemctl enable dhcpcd | ||
systemctl enable iwd | ||
systemctl enable NetworkManager | ||
|
||
# Remove the chroot file | ||
# This also saves space. | ||
rm -rf /ezarch-chroot.sh | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
|
||
# ezArch - An easy way to get Arch installed on your machine! | ||
# | ||
# This script consists of two parts: | ||
# - ezarch.sh: installs the base system to your hard disk | ||
# - ezarch-chroot.sh: does post-setup of your newly installed arch system | ||
# | ||
# To get started, run ezarch.sh | ||
# Be aware that this will wipe your drive clean, so check if you got backups, | ||
# or that you don't need stuff currently on your hard disk. | ||
# | ||
# This script requires an IDE, SCSI or SATA disk, MMC storage is not supported. | ||
# | ||
# Enjoy using Arch btw! | ||
|
||
# Prompt the user to select the device to install Arch on | ||
# Blind assumptions caused the script to try install to a non-writable device, hence why this has been implemented. | ||
lsblk | ||
echo Please enter the device name to use... | ||
read DEV | ||
|
||
# Ask the user for the hostname | ||
# The hostname is the name used to identify the device on your network. | ||
# In case of home networks, this does not really matter, but you can still name your device here. | ||
read -p "Please enter a hostname to use: " HOSTNAME | ||
|
||
# Determine BIOS/UEFI mode, and partition the drive appropriately | ||
# In the older versions of this script, only BIOS was supported. | ||
if [ -e /sys/firmware/efi/efivars ] | ||
then | ||
parted ${DEV} \ mklabel gpt \ mkpart primary 1 120M \ mkpart primary 120M 100% -s | ||
mkfs.vfat ${DEV}1 | ||
mkfs.btrfs -f ${DEV}2 | ||
mount -o compress-force=zstd:15 ${DEV}2 /mnt | ||
mkdir -p /mnt/boot/efi | ||
mkdir /mnt/etc | ||
mount ${DEV}1 /mnt/boot/efi | ||
else | ||
parted ${DEV} \ mklabel msdos \ mkpart primary 1 120M \ mkpart primary 120M 100% -s | ||
mkfs.vfat ${DEV}1 | ||
mkfs.btrfs -f ${DEV}2 | ||
mount -o compress-force=zstd:15 ${DEV}2 /mnt | ||
mkdir /mnt/boot | ||
mkdir /mnt/etc | ||
mount ${DEV}1 /mnt/boot | ||
fi | ||
|
||
# Add BTRFS to /etc/mkinitcpio.conf | ||
# This script uses the BTRFS filesystem to allow you to save some storage. | ||
# If you want to use EXT4 instead, look somewhere. | ||
echo "HOOKS=(base udev autodetect modconf block filesystems fsck btrfs)" >> /mnt/etc/mkinitcpio.conf | ||
|
||
# Install the system | ||
# This installs the bare minimum of packages required to install Arch. | ||
# You can add any additional dependencies yourself afterwards. | ||
pacstrap /mnt linux-hardened linux-firmware pacman dhcpcd sed which micro systemd-sysvcompat pam sudo gzip networkmanager iwd btrfs-progs | ||
|
||
|
||
# Set up the previously selected hostname | ||
echo $HOSTNAME >> /mnt/etc/hostname | ||
|
||
# Generate /etc/fstab | ||
# This file determines the mount points and other stuff necessary for Arch to use your drive. | ||
genfstab -U /mnt >> /mnt/etc/fstab | ||
|
||
# Start post-setup tasks | ||
cp ./ezarch-chroot.sh /mnt | ||
arch-chroot /mnt ./ezarch-chroot.sh $DEV | ||
|
||
# Setup is finished | ||
# You can reboot after seeing this message, only if no commands errored out. | ||
echo "You have successfully installed Arch Linux on your computer. You may now reboot." |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.