From a30f64310ab49170b9e116322f07bcbd8eaa21b8 Mon Sep 17 00:00:00 2001 From: Cure Gecko Date: Fri, 11 Sep 2015 16:00:05 -0500 Subject: [PATCH] Arch Install Scripts Start --- ArchChroot.sh | 41 +++++++++++++++++++++++ ArchInstall.sh | 46 ++++++++++++++++++++++++++ ArchPost.sh | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 26 +++++++++++++++ 4 files changed, 201 insertions(+) create mode 100755 ArchChroot.sh create mode 100755 ArchInstall.sh create mode 100755 ArchPost.sh create mode 100644 README.md diff --git a/ArchChroot.sh b/ArchChroot.sh new file mode 100755 index 0000000..3bf4353 --- /dev/null +++ b/ArchChroot.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Arch chroot install script +# + +#Define drive params +DRIVE="$1" + +#Print all commands +set -x + +#Configure basic stuff +echo arch-server > /etc/hostname +ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime +echo "en_US.UTF-8 UTF-8" > /etc/locale.gen +locale-gen +echo "LANG=en_US.UTF-8" > /etc/locale.conf + +#Configure network +pacman -S net-tools +MAC=`cat /sys/class/net/e*/address` +echo "SUBSYSTEM==\"net\", ACTION==\"add\", ATTR{address}==\"$MAC\", NAME=\"eth0\"" > /etc/udev/rules.d/10-network.rules + +systemctl enable systemd-networkd +systemctl enable systemd-resolved +cat > /etc/systemd/network/dhcp.network < /etc/pacman.d/mirrorlist + +#Install base +pacstrap /mnt base + +cp /etc/pacman.d/mirrorlist.backup /mnt/etc/pacman.d/ + +#Build the fs table +genfstab -U /mnt >> /mnt/etc/fstab + +#Load chroot configuration script +cp ArchChroot.sh /mnt/ +chmod +x /mnt/ArchChroot.sh +if [ -f ArchPost.sh ]; then + cp ArchPost.sh /mnt/ + chmod +x /mnt/ArchPost.sh +else + echo "ArchPost.sh does not exist." +fi +arch-chroot /mnt /ArchChroot.sh "$DRIVE" +rm /mnt/ArchChroot.sh +umount /mnt \ No newline at end of file diff --git a/ArchPost.sh b/ArchPost.sh new file mode 100755 index 0000000..533e015 --- /dev/null +++ b/ArchPost.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# +# Arch post install script +# + +#Print all commands +set -x + +ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf +pacman -S xorg-server gnome gnome-extra plank gnome-do firefox wget cronie libva-vdpau-driver mesa-vdpau vdpauinfo cpio bc imagemagick fuse gtkmm linux-headers argyllcms ntp +#Nvidia +#pacman -S xorg-server gnome gnome-extra plank firefox wget cronie nvidia nvidia-libgl libva-vdpau-driver mesa-vdpau vdpauinfo cpio bc imagemagick fuse gtkmm linux-headers argyllcms ntp +systemctl enable cronie +systemctl enable gdm +systemctl start ntpd +systemctl enable ntpd + +#Setup sudo +pacman -S sudo +echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers + +#Add first user account +read -p "Enter username: " USERNAME +useradd -m -G wheel -s /bin/bash $USERNAME +echo "Enter password" +passwd $USERNAME + +#Set startup applications. +mkdir -p /home/$USERNAME/.config/autostart +chown -R $USERNAME:$USERNAME /home/$USERNAME/.config/ +cp /usr/share/applications/plank.desktop /home/$USERNAME/.config/autostart/plank.desktop +cat > /home/$USERNAME/.config/autostart/gnome-do.desktop < /etc/modules-load.d/virtualbox.conf +echo vboxnetflt >> /etc/modules-load.d/virtualbox.conf + +#Random tools +pacman -S nmap filezilla gparted go p7zip exfat-utils fuse-exfat nload iftop iotop lsof + +sudo -u $USERNAME yaourt -S sublime-text-dev + +gsettings set org.gnome.desktop.wm.preferences button-layout 'close:appmenu' \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e28dc13 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +#Arch Install Scripts +These are scripts I wrote to install a general setup of Arch with some common utilities I use. + +For customization, look into the ArchPost.sh script which is the script you run after first installation. + +Basic idea is to download the three files and then run the main ArchInstall.sh script. + +Example: +```bash +wget https://raw.githubusercontent.com/GRMrGecko/Arch/master/ArchInstall.sh +wget https://raw.githubusercontent.com/GRMrGecko/Arch/master/ArchChroot.sh +wget https://raw.githubusercontent.com/GRMrGecko/Arch/master/ArchPost.sh +chmod +x ArchInstall.sh +./ArchInstall.sh +``` + +ArchInstall.sh will ask you for the drive to install to and it will also ask how large to make the swap partition. Usually the idea is to make the swap the same size as the amount of ram, but you can probably go with 4GB fine. + +To find which drive is the one you want to use, smartctl -i on each device to get information on the drive. Example: +```bash +smartctl -i /dev/sda +``` + +Beware that Arch is not designed for people who are new to Linux. + +After ArchInstall.sh script is done, reboot to the installation, login as root and run /ArchPost.sh to install the GUI and such. \ No newline at end of file