Browse Source

switch to environment variable to load package installation into a single command

update todo list
Casey DeLorme 2 years ago
parent
commit
b95fae2022
3 changed files with 76 additions and 125 deletions
  1. 40 42
      arch.sh
  2. 2 0
      notes/errors.md
  3. 34 83
      todo.md

+ 40 - 42
arch.sh

@@ -52,47 +52,29 @@ pacman-key --populate archlinux
 curl -O https://download.sublimetext.com/sublimehq-pub.gpg && pacman-key --add sublimehq-pub.gpg && pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
 [ $(grep -c "sublime-text" /etc/pacman.conf) -eq 0 ] && echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | tee -a /etc/pacman.conf
 
-# update and install all packages
-pacman -Syu --noconfirm sudo bash-completion man-db tmux vim linux-firmware linux-headers dkms smartmontools cryptsetup usbutils btrfs-progs gvfs gvfs-mtp gvfs-afc android-udev dmidecode parted pkgfile pkgconf bison gcc gcc-libs cmake ccache ncurses xmlstarlet jq at bc cronie iptables rsync dhcpcd inetutils net-tools openssh sshfs ntp wget curl wireless_tools bluez bluez-utils lzop unzip p7zip xz unrar unace lrzip arj git mercurial subversion bzr postgresql mesa lib32-mesa dbus polkit xorg-server xorg-server-devel xorg-xinit xorg-xinput xorg-xdpyinfo xorg-xprop xdotool xsel patchelf libpng12 lib32-libpng12 pulseaudio libpulse lib32-libpulse openal lib32-openal giflib lib32-giflib mpg123 lib32-mpg123 v4l-utils lib32-v4l-utils opencl-icd-loader lib32-opencl-icd-loader libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs arandr feh hsetroot openbox archlinux-xdg-menu picom xarchiver innoextract pavucontrol pasystray xdg-utils xdg-user-dirs tint2 conky pcmanfm gmrun rxvt-unicode urxvt-perls gnome-themes-extra gnome-icon-theme arc-gtk-theme gtk-engines gtk-engine-murrine lxappearance graphicsmagick imagemagick lame libwebp libid3tag libvorbis vorbis-tools faac x264 x265 libexif ffmpeg ffmpegthumbnailer tumbler joyutils evtest lm_sensors lshw gparted psensor gparted hardinfo fontconfig ttf-bitstream-vera ttf-droid ttf-dejavu ttf-liberation ttf-hanazono mpv openshot gimp krita transmission-cli evince viewnior virtualbox-host-modules-arch virtualbox vagrant python-pip python-setuptools sublime-text stress lxsession yt-dlp
+# put all packages into an environment variable that we can add to
+export PACKAGES="sudo bash-completion man-db tmux vim linux-firmware linux-headers dkms smartmontools cryptsetup usbutils btrfs-progs gvfs gvfs-mtp gvfs-afc android-udev dmidecode parted pkgfile pkgconf bison gcc gcc-libs cmake ccache ncurses xmlstarlet jq at bc cronie iptables rsync dhcpcd inetutils net-tools openssh sshfs ntp wget curl wireless_tools bluez bluez-utils lzop unzip p7zip xz unrar unace lrzip arj git mercurial subversion bzr postgresql mesa lib32-mesa dbus polkit xorg-server xorg-server-devel xorg-xinit xorg-xinput xorg-xdpyinfo xorg-xprop xdotool xsel patchelf libpng12 lib32-libpng12 pulseaudio libpulse lib32-libpulse openal lib32-openal giflib lib32-giflib mpg123 lib32-mpg123 v4l-utils lib32-v4l-utils opencl-icd-loader lib32-opencl-icd-loader libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs arandr feh hsetroot openbox archlinux-xdg-menu picom xarchiver innoextract pavucontrol pasystray xdg-utils xdg-user-dirs tint2 conky pcmanfm gmrun rxvt-unicode urxvt-perls gnome-themes-extra gnome-icon-theme arc-gtk-theme gtk-engines gtk-engine-murrine lxappearance graphicsmagick imagemagick lame libwebp libid3tag libvorbis vorbis-tools faac x264 x265 libexif ffmpeg ffmpegthumbnailer tumbler joyutils evtest lm_sensors lshw gparted psensor gparted hardinfo fontconfig ttf-bitstream-vera ttf-droid ttf-dejavu ttf-liberation ttf-hanazono mpv openshot gimp krita transmission-cli evince viewnior virtualbox-host-modules-arch virtualbox vagrant python-pip python-setuptools sublime-text stress lxsession yt-dlp firefox obs-studio dia mednafen mame ppsspp lutris wine-staging winetricks steam discord libva-mesa-driver lib32-libva-mesa-driver lib32-mesa-vdpau vulkan-tools vulkan-icd-loader lib32-vulkan-icd-loader"
 
-# install base configuration files from repository
-[ -d /srv/arch-desktop/install ] || git clone https://git.caseydelorme.com/cdelorme/arch-desktop /srv/arch-desktop
-rsync -Pav /srv/arch-desktop/install/ /
-mkdir -p /etc/skel/.config/pulse
-mkdir -p /etc/skel/{desktop,downloads,public,public/templates,documents,music,pictures,videos,git}
-sed "/module-suspend-on-idle/d" /etc/pulse/default.pa > /etc/skel/.config/pulse/default.pa
-# @note: we may want to avoid disabling this on laptops
-sed -i "/module-switch-on-port-available/d" /etc/skel/.config/pulse/default.pa
-rsync -Pav /etc/skel/ "$(getent passwd root | cut -d: -f6)/"
-sed -i "/ssh-add/d" "$(getent passwd root | cut -d: -f6)/.bashrc"
+# conditionally add wireless networking packages
+[ -d "/sys/class/net/${active_network_device}/wireless" ] && PACKAGES="$PACKAGES connman wpa_supplicant openvpn ethtool iwd pptpclient"
 
-# if the active network device is wireless install connman
-[ -d "/sys/class/net/${active_network_device}/wireless" ] && pacman -Syu connman wpa_supplicant openvpn ethtool iwd pptpclient && systemctl enable connman
+# add CPU unicode package based on model
+[ $(grep -c "Intel" /proc/cpuinfo) -gt 0 ] && PACKAGES="$PACKAGES intel-ucode"
+[ $(grep -c "AMD" /proc/cpuinfo) -gt 0 ] && PACKAGES="$PACKAGES amd-ucode"
 
-# install protontricks
-python3 -m pip install protontricks
-
-# enable ccache and optimize cores for AUR
-sed -i 's/!ccache/ccache/' /etc/makepkg.conf
-sed -i 's/^#MAKEFLAGS.*/MAKEFLAGS="-j$(($(nproc) + 1)) -l$(nproc)"/' /etc/makepkg.conf
-
-# install CPU unicode based on model
-[ $(grep -c "Intel" /proc/cpuinfo) -gt 0 ] && pacman -Syu --noconfirm intel-ucode
-[ $(grep -c "AMD" /proc/cpuinfo) -gt 0 ] && pacman -Syu --noconfirm amd-ucode
-
-# install GPU related packages
+# add appropriate GPU related packages
 if [ $(lspci | grep -i "vga" | grep -ci "amd") -gt 0 ]; then
-	pacman -Syu --noconfirm xf86-video-amdgpu vulkan-radeon lib32-vulkan-radeon mesa-vdpau
+	PACKAGES="$PACKAGES xf86-video-amdgpu vulkan-radeon lib32-vulkan-radeon mesa-vdpau"
 
 	# update modules to load
 	[ $(grep -c "amd" /etc/mkinitcpio.conf) -eq 0 ] && sed -i 's/MODULES=(\(.*\))/MODULES=(\1 amdgpu radeon)/' /etc/mkinitcpio.conf
 elif [ $(lspci | grep -i "vga" | grep -ci "intel") -gt 0 ]; then
-	pacman -Syu --noconfirm xf86-video-intel vulkan-intel lib32-vulkan-intel mesa-vdpau
+	PACKAGES="$PACKAGES xf86-video-intel vulkan-intel lib32-vulkan-intel mesa-vdpau"
 
 	# update modules to load
 	[ $(grep -c "amd" /etc/mkinitcpio.conf) -eq 0 ] && sed -i 's/MODULES=(\(.*\))/MODULES=(\1 i915)/' /etc/mkinitcpio.conf
 elif [ $(lspci | grep -i "vga" | grep -ci "nvidia") -gt 0 ]; then
-	pacman -Syu --noconfirm nvidia-dkms libglvnd lib32-libglvnd opencl-nvidia lib32-opencl-nvidia xf86-video-nouveau nvidia-utils lib32-nvidia-utils mesa-vdpau nvidia-settings
+	PACKAGES="$PACKAGES nvidia-dkms libglvnd lib32-libglvnd opencl-nvidia lib32-opencl-nvidia xf86-video-nouveau nvidia-utils lib32-nvidia-utils mesa-vdpau nvidia-settings"
 
 	# update modules to load
 	[ $(grep -c "nvidia" /etc/mkinitcpio.conf) -eq 0 ] && sed -i 's/MODULES=(\(.*\))/MODULES=(\1 nvidia nvidia_modeset nvidia_uvm nvidia_drm)/' /etc/mkinitcpio.conf
@@ -101,20 +83,33 @@ elif [ $(lspci | grep -i "vga" | grep -ci "nvidia") -gt 0 ]; then
 	echo -e "[Trigger]\nOperation=Install\nOperation=Upgrade\nOperation=Remove\nType=Package\nTarget=nvidia\n\n[Action]\nDepends=mkinitcpio\nWhen=PostTransaction\nExec=/usr/bin/mkinitcpio -P" > /etc/pacman.d/hooks/nvidia.hook
 fi
 
-# install packages dependent on gpu packages
-pacman -Syu --noconfirm firefox obs-studio dia mednafen mame ppsspp lutris wine-staging winetricks steam discord libva-mesa-driver lib32-libva-mesa-driver lib32-mesa-vdpau vulkan-tools vulkan-icd-loader lib32-vulkan-icd-loader
-
-# install laptop packages and optimize system configuration
-# @note: alternatively if `/sys/class/power_supply/BAT0` exists, we have a battery, probably laptop
-export chassistype=$(dmidecode --string chassis-type)
-if [[ "$chassistype" = "Laptop" || "$chassistype" = "Portable" || "$chassistype" = "Notebook" || "$chassistype" = "Sub Notebook" ]]; then
-	pacman -Syu --noconfirm xf86-input-synaptics acpid hdparm sdparm acpilight connman wpa_supplicant openvpn ethtool iwd pptpclient tlp
-	sed "s/panel_items = LTSC/panel_items = LTSBC/g" /etc/skel/.config/tint2/tint2rc > /etc/skel/.config/tint2/tint2rc
-	systemctl enable tlp
-	systemctl enable connman
-	systemctl enable acpid
+# conditionally install laptop packages
+if [ -e /sys/class/power_supply/BAT0 ]; then
+	PACKAGES="$PACKAGES xf86-input-synaptics acpid acpilight tlp"
+	sed "s/panel_items = LTSC/panel_items = LTSBC/g" /srv/arch-desktop/install/etc/skel/.config/tint2/tint2rc > /srv/arch-desktop/install/etc/skel/.config/tint2/tint2rc
 fi
 
+# install all packages
+pacman -Syu --noconfirm "$PACKAGES"
+
+# install base configuration files from repository
+[ -d /srv/arch-desktop/install ] || git clone https://git.caseydelorme.com/cdelorme/arch-desktop /srv/arch-desktop
+rsync -Pav /srv/arch-desktop/install/ /
+mkdir -p /etc/skel/.config/pulse
+mkdir -p /etc/skel/{desktop,downloads,public,public/templates,documents,music,pictures,videos,git}
+sed "/module-suspend-on-idle/d" /etc/pulse/default.pa > /etc/skel/.config/pulse/default.pa
+# @note: we may want to avoid disabling this on laptops
+sed -i "/module-switch-on-port-available/d" /etc/skel/.config/pulse/default.pa
+rsync -Pav /etc/skel/ "$(getent passwd root | cut -d: -f6)/"
+sed -i "/ssh-add/d" "$(getent passwd root | cut -d: -f6)/.bashrc"
+
+# install protontricks
+python3 -m pip install protontricks
+
+# enable ccache and optimize cores for AUR
+sed -i 's/!ccache/ccache/' /etc/makepkg.conf
+sed -i 's/^#MAKEFLAGS.*/MAKEFLAGS="-j$(($(nproc) + 1)) -l$(nproc)"/' /etc/makepkg.conf
+
 # create a user to install aur packages
 export aur_username=$(head /dev/urandom | tr -dc a-z | head -c 13 ; echo '')
 useradd -r -m -s /bin/bash $aur_username
@@ -239,8 +234,11 @@ systemctl enable bluetooth
 systemctl enable transmission
 systemctl enable postgresql
 systemctl enable cronie
+which tlp &> /dev/null && systemctl enable tlp
+which connman &> /dev/null && systemctl enable connman
+which acpid &> /dev/null && systemctl enable acpid
 
-# try to enable wired connections on reboot
+# attempt to enable dhcp on active network devices on reboot
 export active_network_device=$(ip addr | awk '/state UP/ {print $2}' | sed 's/.$//')
 [ ! -d "/sys/class/net/${active_network_device}/wireless" ] && (systemctl enable dhcpcd@${active_network_device} || echo "failed to enable dhcp service")
 

+ 2 - 0
notes/errors.md

@@ -9,5 +9,7 @@ These are known errors that are non-disruptive:
 	- _this is normal activity; non-disruptive_
 - connman "cannot read /proc/net/pnp"
 	- _false positive related to NFS; non-disruptive_
+- login tty on debian supports SIGNIT, package differs on arch
+	- _non-disruptive; cannot resolve without compiling my own copy of the tty package, not worth the effort..._
 
 I am keeping track of these as I have not found a way to "solve" (eg. silence) them sanely.

+ 34 - 83
todo.md

@@ -1,89 +1,40 @@
 
 # todo
 
-Determine the disk the installer is on and ignore it when running lsblk to list selectable format disks.
+- fix disk check to ignore the active/mounted partition(s)
+	- _We don't want to see the installation media as target for installation_
+	- verify installation does not bork USB installer(s)
+		- _need to test on a real machine for this?_
+- triple check calculation of swap partition size for hibernation
+	- conditional check to ensure swap file exists and is of appropriate size to automatically add `resume=` boot option
+		- _test hibernate on a real system?_
+- investigate potentially useful aur libraries:
+	- https://aur.archlinux.org/packages/ncurses5-compat-libs
+	- https://aur.archlinux.org/packages/lib32-ncurses5-compat-libs/
+- switch to systemd user-space `transmission` to eliminate potential configuration conflicts
+	- _this also eliminates root permission concerns_
+
+- replace `virtualbox` in packer.json with `kvm`/`qemu`
+	- _remove virtualbox related commands/packages from `install/packer.sh`_
+
+- Create a branch to test `sway`/`wayland` packages as an alternative to `openbox`
+	- _basically relearn entire desktop environment and new hotkeys..._
+	- https://wiki.archlinux.org/index.php/Sway
+	- https://www.reddit.com/r/swaywm/comments/eksf1p/steam_now_fully_works_under_sway/
+	- _Test multiple proton/wine games on this setup_
+
+- experiment with alternative file browsers
+	- dolphin
+	- nautilus
+	- thunar
+	- nemo
+- _testing for thumbnailing speed, and folder thumbnail support to expedite file browsing_
+	- _may depend on wayland compatibility?_
 
-Some AUR libraries to add (what for again?):
-
-https://aur.archlinux.org/packages/ncurses5-compat-libs
-https://aur.archlinux.org/packages/lib32-ncurses5-compat-libs/
-
-- Replace PACKER env var with auto-detection via `[ $(dmidecode | grep -c VirtualBox) -gt 0 ]`
-
-- Use the latest successful packer build to try out `sway` and `wayland` packages as an alternative to openbox
-
-- transition from root systemd launched transmission to user-space specific; this eliminates future collisions and permission issues
-
-
----
-
-also sway/wayland are supported by steam/proton???
-https://www.reddit.com/r/swaywm/comments/eksf1p/steam_now_fully_works_under_sway/
-with my new desktop I will at the very least give this a try!
-https://wiki.archlinux.org/index.php/Sway
-
-
----
-
-- Research whether we can add SIGINT support to terminal login (like Debian) to cancel quickly after typo
-	- https://bbs.archlinux.org/viewtopic.php?pid=1942165#p1942165
-
-- attempt to transition to `sway` and `wayland`
-- replace `virtualbox` with `kvm`?
 - experiment with `fcitx-mozc` for IME support
 
-- try out alternative file browsers with these goals:
-	- image thumbnail support, including webp
-	- folder thumbnails!!!
-- Suggested FB:
-	- Dolphin
-		- requires generic package with options thus conflicting automated install...
-	- Nautilus
-	- Thunar
-		- same theme support as pcmanfm, so far looks great!
-		- no support for webp even with custom thumbnailer; _may require a reboot?_
-		- _need to rewrite directory thumbnailer_
-- investigate `libfm`/`pcmanfm` plugins/enhancements to:
-	- support directory thumbnails
-		- https://github.com/gcavallo/pcmanfm-covers
-		- https://sourceforge.net/p/pcmanfm/bugs/1020/
-	- support `webp` thumbnails, including animated `webp`
-		- https://aur.archlinux.org/packages/webp-thumbnailer/
-
-
-- try out i3 window manager
-- try out `docky` as a combined replacement for `gmrun` and `tint2`
-- experiment with tint2 alternatives (menubar):
-	- dzen
-	- lemonbar
-	- polybar
-	- yabar
-	- i3blocks
-	- stalonetray
-- experiment with notification services (_I don't use one personally_):
-	- dunst
-	- statnot
-	- twmn
-- experiment gmrun alternatives (launchers; _would love one that can do math_):
-	- rofi
-	- albert
-	- dmenu
-	- kupfer
-
-
----
-
-I'd like to look into replacing `startx` and `xinit` with systemd unit file to launch the desktop on-demand.
-
-https://wiki.archlinux.org/index.php/Systemd/User#Xorg_as_a_systemd_user_service
-
-Looks like the systemd approach does work with minor caveats.  So long as I can work with those I think this would be an excellent choice.
-
-https://lists.freedesktop.org/archives/systemd-devel/2014-March/017552.html
-
-_This requires the `dex` package to launch `.desktop` files from the command line._
-
-
-## notes
-
-Low level terminal package differs on debian making SIGINT login cancellation not possible on Arch without modifying and compiling said package.
+- look at replacing `startx`/`xinit` with `systemd` userspace xorg
+	- https://wiki.archlinux.org/index.php/Systemd/User#Xorg_as_a_systemd_user_service
+	- https://lists.freedesktop.org/archives/systemd-devel/2014-March/017552.html
+		- _appears to be some caveats, including loading specific applications at launch?_
+		- at one point I documented a tool called `dex` to launch `.desktop` from cli, may not be needed though?