Address ShellCheck feedback

Resolves 
This commit is contained in:
Luke Short 2024-11-02 11:18:15 -06:00
commit 34195e9820
22 changed files with 1413 additions and 1558 deletions

View file

@ -21,13 +21,16 @@ jobs:
- name: Change directory - name: Change directory
run: cd $GITHUB_WORKSPACE run: cd $GITHUB_WORKSPACE
- name: Install Bash - name: Install Bash
run: sudo apt-get update && sudo apt-get install -y bash run: sudo apt-get update && sudo apt-get install -y bash shellcheck
- name: Check syntax of scripts - name: Check syntax of scripts
run: | run: |
for i in $(find . -name "*.sh") for i in $(find . -name "*.sh" | sort)
do bash -n "${i}" do echo "${i}"
if [ $? -ne 0 ] if ! bash -n "${i}"; then
then exit 1 exit 1
fi
if ! shellcheck "${i}"; then
exit 1
fi fi
done done
- name: Obtain base docker image - name: Obtain base docker image

View file

@ -24,13 +24,16 @@ jobs:
- name: Change directory - name: Change directory
run: cd $GITHUB_WORKSPACE run: cd $GITHUB_WORKSPACE
- name: Install Bash - name: Install Bash
run: sudo apt-get update && sudo apt-get install -y bash run: sudo apt-get update && sudo apt-get install -y bash shellcheck
- name: Check syntax of scripts - name: Check syntax of scripts
run: | run: |
for i in $(find . -name "*.sh") for i in $(find . -name "*.sh" | sort)
do bash -n "${i}" do echo "${i}"
if [ $? -ne 0 ] if ! bash -n "${i}"; then
then exit 1 exit 1
fi
if ! shellcheck "${i}"; then
exit 1
fi fi
done done
- name: Obtain base docker image - name: Obtain base docker image

View file

@ -24,13 +24,16 @@ jobs:
- name: Change directory - name: Change directory
run: cd $GITHUB_WORKSPACE run: cd $GITHUB_WORKSPACE
- name: Install Bash - name: Install Bash
run: sudo apt-get update && sudo apt-get install -y bash run: sudo apt-get update && sudo apt-get install -y bash shellcheck
- name: Check syntax of scripts - name: Check syntax of scripts
run: | run: |
for i in $(find . -name "*.sh") for i in $(find . -name "*.sh" | sort)
do bash -n "${i}" do echo "${i}"
if [ $? -ne 0 ] if ! bash -n "${i}"; then
then exit 1 exit 1
fi
if ! shellcheck "${i}"; then
exit 1
fi fi
done done
- name: Obtain base docker image - name: Obtain base docker image

View file

@ -1,8 +1,12 @@
#!/bin/sh #!/bin/bash
for i in $(find . -name "*.sh") # 'find' does not always return results in the same order so it needs to be 'sort'ed.
do bash -n "${i}" for i in $(find . -name "*.sh" | sort)
if [ $? -ne 0 ] do echo "${i}"
then exit 1 if ! bash -n "${i}"; then
exit 1
fi
if ! shellcheck "${i}"; then
exit 1
fi fi
done done

View file

@ -2,8 +2,7 @@
set -x set -x
kdialog --title "winesapOS Upgrade" --yesno "Do you want to upgrade winesapOS?\nThis may take a long time." if kdialog --title "winesapOS Upgrade" --yesno "Do you want to upgrade winesapOS?\nThis may take a long time."; then
if [ $? -eq 0 ]; then
# The secure image requires that the "sudo" password be provided for the "winesap" user. # The secure image requires that the "sudo" password be provided for the "winesap" user.
# This password is also required to be reset during the first login so it is unknown. # This password is also required to be reset during the first login so it is unknown.
# Prompt the user to enter in their password. # Prompt the user to enter in their password.
@ -11,13 +10,12 @@ if [ $? -eq 0 ]; then
# the command "sudo -S" to read the password from standard input still works as expected. # the command "sudo -S" to read the password from standard input still works as expected.
while true; while true;
do user_pw=$(kdialog --title "winesapOS Upgrade" --password 'Please enter your password (default: "winesap") to start the upgrade.') do user_pw=$(kdialog --title "winesapOS Upgrade" --password 'Please enter your password (default: "winesap") to start the upgrade.')
echo ${user_pw} | sudo -S whoami if echo "${user_pw}" | sudo -S whoami; then
if [ $? -eq 0 ]; then
# Break out of the "while" loop if the password works with the "sudo -S" command. # Break out of the "while" loop if the password works with the "sudo -S" command.
break 2 break 2
fi fi
done done
echo ${USER} > /tmp/winesapos_user_name.txt echo "${USER}" > /tmp/winesapos_user_name.txt
curl https://raw.githubusercontent.com/winesapOS/winesapOS/stable/scripts/winesapos-upgrade.sh | sudo -E bash curl https://raw.githubusercontent.com/winesapOS/winesapOS/stable/scripts/winesapos-upgrade.sh | sudo -E bash
fi fi

View file

@ -1,31 +1,30 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC2010
echo -e "winesapOS Dual-Boot Installer (Beta)\n" echo -e "winesapOS Dual-Boot Installer (Beta)\n"
echo "Please read the full instructions first at: https://github.com/winesapOS/winesapOS?tab=readme-ov-file#dual-boot" echo "Please read the full instructions first at: https://github.com/winesapOS/winesapOS?tab=readme-ov-file#dual-boot"
echo "USE AT YOUR OWN RISK! DATA LOSS IS POSSIBLE. CLOSE THIS WINDOW IF YOU DO NOT ACCEPT THE RISK. OTHERWISE, ENTER ANY KEY TO COTINUE." echo "USE AT YOUR OWN RISK! DATA LOSS IS POSSIBLE. CLOSE THIS WINDOW IF YOU DO NOT ACCEPT THE RISK. OTHERWISE, ENTER ANY KEY TO COTINUE."
read -p "" read -r -p ""
export WINESAPOS_IMAGE_TYPE="$(grep VARIANT_ID /usr/lib/os-release-winesapos | cut -d = -f 2)" WINESAPOS_IMAGE_TYPE="$(grep VARIANT_ID /usr/lib/os-release-winesapos | cut -d = -f 2)"
if [[ "${WINESAPOS_IMAGE_TYPE}" == "secure" ]]; then if [[ "${WINESAPOS_IMAGE_TYPE}" == "secure" ]]; then
echo "INFO: Enter the root password when prompted..." echo "INFO: Enter the root password when prompted..."
sudo whoami sudo whoami
fi fi
echo "INFO: Determining the correct device name..." echo "INFO: Determining the correct device name..."
ls -1 /dev/disk/by-label/winesapos-root0 &> /dev/null if ls -1 /dev/disk/by-label/winesapos-root0 &> /dev/null; then
if [ $? -eq 0 ]; then
echo "INFO: Partition with label 'winesapos-root0' found." echo "INFO: Partition with label 'winesapos-root0' found."
root_partition=$(ls -l /dev/disk/by-label/winesapos-root0 | grep -o -P "(hdd|mmcblk|nvme|sd).+") root_partition=$(ls -l /dev/disk/by-label/winesapos-root0 | grep -o -P "(hdd|mmcblk|nvme|sd).+")
echo "DEBUG: Partition name is ${root_partition}." echo "DEBUG: Partition name is ${root_partition}."
echo ${root_partition} | grep -q nvme if echo "${root_partition}" | grep -q nvme; then
if [ $? -eq 0 ]; then root_device=$(echo "${root_partition}" | grep -P -o "/dev/nvme[0-9]+n[0-9]+")
root_device=$(echo ${root_partition} | grep -P -o "/dev/nvme[0-9]+n[0-9]+")
else else
echo ${root_partition} | grep -q mmcblk if echo "${root_partition}" | grep -q mmcblk; then
if [ $? -eq 0 ]; then root_device=$(echo "${root_partition}" | grep -P -o "/dev/mmcblk[0-9]+")
root_device=$(echo ${root_partition} | grep -P -o "/dev/mmcblk[0-9]+")
else else
root_device=$(echo ${root_partition} | sed s'/[0-9]//'g) # shellcheck disable=SC2001 disable=SC2026
root_device=$(echo "${root_partition}" | sed s'/[0-9]//'g)
fi fi
fi fi
echo "DEBUG: Root device name is ${root_device}." echo "DEBUG: Root device name is ${root_device}."
@ -35,19 +34,17 @@ else
fi fi
lsblk --raw -o name,label | grep -q WOS-EFI0 if lsblk --raw -o name,label | grep -q WOS-EFI0; then
if [ $? -eq 0 ]; then
echo "INFO: EFI partition label WOS-EFI0 found." echo "INFO: EFI partition label WOS-EFI0 found."
efi_partition="/dev/disk/by-label/WOS-EFI0" efi_partition="/dev/disk/by-label/WOS-EFI0"
else else
efi_partition=$(sudo fdisk -l /dev/${root_device} | grep "EFI System" | awk '{print $1}') efi_partition=$(sudo fdisk -l "/dev/${root_device}" | grep "EFI System" | awk '{print $1}')
echo ${efi_partition} | grep -q -o -P "(hdd|mmcblk|nvme|sd|).+" if ! echo "${efi_partition}" | grep -q -o -P "(hdd|mmcblk|nvme|sd|).+"; then
if [ $? -ne 0 ]; then
echo "ERROR: No EFI partition found." echo "ERROR: No EFI partition found."
exit 1 exit 1
else else
echo "INFO: Setting EFI label for a more reliable /etc/fstab later..." echo "INFO: Setting EFI label for a more reliable /etc/fstab later..."
sudo fatlabel ${efi_partition} WOS-EFI0 sudo fatlabel "${efi_partition}" WOS-EFI0
fi fi
fi fi
echo "INFO: EFI partition name is ${efi_partition}." echo "INFO: EFI partition name is ${efi_partition}."
@ -70,10 +67,9 @@ winesapos_find_tarball() {
"/run/media/${USER}/wos-drive" \ "/run/media/${USER}/wos-drive" \
"${HOME}/Desktop" \ "${HOME}/Desktop" \
"${HOME}/Downloads"; \ "${HOME}/Downloads"; \
do ls -1 "${i}" 2> /dev/null | grep -q -P ".+-minimal.rootfs.tar.zst$" do if ls -1 "${i}" 2> /dev/null | grep -q -P ".+-minimal.rootfs.tar.zst$"; then
if [ $? -eq 0 ]; then
echo "${i}/$(ls -1 "${i}" | grep -P ".+-minimal.rootfs.tar.zst$" | tail -n 1)" echo "${i}/$(ls -1 "${i}" | grep -P ".+-minimal.rootfs.tar.zst$" | tail -n 1)"
return 0 return 0
fi fi
done done
echo "NONE" echo "NONE"
@ -85,9 +81,9 @@ winesapos_tarball="$(winesapos_find_tarball)"
if [[ "${winesapos_tarball}" == "NONE" ]]; then if [[ "${winesapos_tarball}" == "NONE" ]]; then
echo "INFO: No winesapOS tarball found." echo "INFO: No winesapOS tarball found."
WINESAPOS_VERSION_LATEST="$(curl https://raw.githubusercontent.com/winesapOS/winesapOS/stable/files/os-release-winesapos | grep VERSION_ID | cut -d = -f 2)" WINESAPOS_VERSION_LATEST="$(curl https://raw.githubusercontent.com/winesapOS/winesapOS/stable/files/os-release-winesapos | grep VERSION_ID | cut -d = -f 2)"
cd "${HOME}/Downloads" cd "${HOME}/Downloads" || exit 1
echo "INFO: Downloading the rootfs tarball..." echo "INFO: Downloading the rootfs tarball..."
wget https://winesapos.lukeshort.cloud/repo/iso/winesapos-${WINESAPOS_VERSION_LATEST}/winesapos-${WINESAPOS_VERSION_LATEST}-minimal-rootfs.tar.zst wget "https://winesapos.lukeshort.cloud/repo/iso/winesapos-${WINESAPOS_VERSION_LATEST}/winesapos-${WINESAPOS_VERSION_LATEST}-minimal-rootfs.tar.zst"
winesapos_tarball="${HOME}/Downloads/winesapos-${WINESAPOS_VERSION_LATEST}-minimal-rootfs.tar.zst" winesapos_tarball="${HOME}/Downloads/winesapos-${WINESAPOS_VERSION_LATEST}-minimal-rootfs.tar.zst"
fi fi

View file

@ -2,8 +2,7 @@
set -x set -x
sudo /usr/bin/dmidecode -s system-product-name | grep -P ^Mac if sudo /usr/bin/dmidecode -s system-product-name | grep -P ^Mac; then
if [ $? -eq 0 ]; then
echo "Mac hardware detected." echo "Mac hardware detected."
/usr/bin/pactl set-sink-volume 0 0 /usr/bin/pactl set-sink-volume 0 0

View file

@ -9,41 +9,40 @@ if [[ "${root_partition}" == "/dev/mapper/cryptroot" ]]; then
# Example output: "mmcblk0p5", "nvme0n1p5", "sda5" # Example output: "mmcblk0p5", "nvme0n1p5", "sda5"
root_partition_shortname=$(lsblk -o name,label | grep winesapos-luks | awk '{print $1}' | grep -o -P '[a-z]+.*') root_partition_shortname=$(lsblk -o name,label | grep winesapos-luks | awk '{print $1}' | grep -o -P '[a-z]+.*')
# Example output: 5 # Example output: 5
root_partition_number=$(echo ${root_partition_shortname} | grep -o -P "[0-9]+$") root_partition_number=$(echo "${root_partition_shortname}" | grep -o -P "[0-9]+$")
echo ${root_partition} | grep -q nvme if echo "${root_partition}" | grep -q nvme; then
if [ $? -eq 0 ]; then
# Example output: /dev/nvme0n1 # Example output: /dev/nvme0n1
root_device=$(echo "/dev/${root_partition_shortname}" | grep -P -o "/dev/nvme[0-9]+n[0-9]+") root_device=$(echo "/dev/${root_partition_shortname}" | grep -P -o "/dev/nvme[0-9]+n[0-9]+")
else else
echo ${root_partition} | grep -q mmcblk if echo "${root_partition}" | grep -q mmcblk; then
if [ $? -eq 0 ]; then
# Example output: /dev/mmcblk0 # Example output: /dev/mmcblk0
# shellcheck disable=SC2026
root_device=$(echo "/dev/${root_partition_shortname}" | grep -P -o "/dev/mmcblk[0-9]+") root_device=$(echo "/dev/${root_partition_shortname}" | grep -P -o "/dev/mmcblk[0-9]+")
else else
# Example output: /dev/sda # Example output: /dev/sda
# shellcheck disable=SC2026
root_device=$(echo "/dev/${root_partition_shortname}" | sed s'/[0-9]//'g) root_device=$(echo "/dev/${root_partition_shortname}" | sed s'/[0-9]//'g)
fi fi
fi fi
growpart ${root_device} ${root_partition_number} growpart "${root_device}" "${root_partition_number}"
echo "password" | cryptsetup resize ${root_partition} echo "password" | cryptsetup resize "${root_partition}"
else else
root_partition_number=$(echo ${root_partition} | grep -o -P "[0-9]+$") root_partition_number=$(echo "${root_partition}" | grep -o -P "[0-9]+$")
echo ${root_partition} | grep -q nvme if echo "${root_partition}" | grep -q nvme; then
if [ $? -eq 0 ]; then root_device=$(echo "${root_partition}" | grep -P -o "/dev/nvme[0-9]+n[0-9]+")
root_device=$(echo ${root_partition} | grep -P -o "/dev/nvme[0-9]+n[0-9]+")
else else
echo ${root_partition} | grep -q mmcblk if echo "${root_partition}" | grep -q mmcblk; then
if [ $? -eq 0 ]; then root_device=$(echo "${root_partition}" | grep -P -o "/dev/mmcblk[0-9]+")
root_device=$(echo ${root_partition} | grep -P -o "/dev/mmcblk[0-9]+")
else else
root_device=$(echo ${root_partition} | sed s'/[0-9]//'g) # shellcheck disable=SC2001 disable=SC2026
root_device=$(echo "${root_partition}" | sed s'/[0-9]//'g)
fi fi
fi fi
growpart ${root_device} ${root_partition_number} growpart "${root_device}" "${root_partition_number}"
fi fi
btrfs filesystem resize max / btrfs filesystem resize max /

View file

@ -1,15 +1,14 @@
#!/bin/bash #!/bin/bash
while true while true
do journalctl --unit sddm | grep -q "Could not start Display server on" do if journalctl --unit sddm | grep -q "Could not start Display server on"; then
if [ $? -eq 0 ]; then
echo "Display manager working NOT normally." echo "Display manager working NOT normally."
echo -e "winesapOS\n\nSDDM has failed to start. You are now in a TTY for troubleshooting.\nPossible causes might be a bad display server configuration or other graphical issues.\nYou can try to fix the issue here or reboot the system.\nFor more detailed logs, use \'journalctl -xe | grep sddm\'.\n\n" > /etc/issue echo -e "winesapOS\n\nSDDM has failed to start. You are now in a TTY for troubleshooting.\nPossible causes might be a bad display server configuration or other graphical issues.\nYou can try to fix the issue here or reboot the system.\nFor more detailed logs, use \'journalctl -xe | grep sddm\'.\n\n" > /etc/issue
/usr/bin/chvt 2 /usr/bin/chvt 2
exit exit
else else
echo "Display manager working normally." echo "Display manager working normally."
echo -e "winesapOS\n\n" > /etc/issue echo -e "winesapOS\n\n" > /etc/issue
fi fi
sleep 5s sleep 5s
done done

View file

@ -7,8 +7,9 @@ wget https://github.com/ventoy/vtoyboot/releases/download/v${VENTOY_VER}/vtoyboo
sudo mount vtoyboot-${VENTOY_VER}.iso /mnt sudo mount vtoyboot-${VENTOY_VER}.iso /mnt
sudo mkdir /vtoyboot sudo mkdir /vtoyboot
sudo tar -xvf /mnt/vtoyboot-${VENTOY_VER}.tar.gz -C /vtoyboot sudo tar -xvf /mnt/vtoyboot-${VENTOY_VER}.tar.gz -C /vtoyboot
cd /vtoyboot/vtoyboot-${VENTOY_VER}/ cd /vtoyboot/vtoyboot-${VENTOY_VER}/ || exit 1
sudo ./vtoyboot.sh sudo ./vtoyboot.sh
# shellcheck disable=SC2164
cd - cd -
sudo umount /mnt sudo umount /mnt
sudo rm -r -f /vtoyboot /vtoyboot-${VENTOY_VER}.iso sudo rm -r -f /vtoyboot /vtoyboot-${VENTOY_VER}.iso

View file

@ -1,3 +1,6 @@
. "$(dirname $0)/winesapos-env-minimal.sh" #!/bin/bash
# shellcheck disable=SC1091
. "$(dirname "$0")/winesapos-env-minimal.sh"
export \ export \
WINESAPOS_BUILD_CHROOT_ONLY=true WINESAPOS_BUILD_CHROOT_ONLY=true

View file

@ -1,8 +1,11 @@
#!/bin/bash
winesapos_distro_detected=$(grep -P '^ID=' /etc/os-release | cut -d= -f2)
export \ export \
WINESAPOS_IMAGE_TYPE="${WINESAPOS_IMAGE_TYPE:-performance}" \ WINESAPOS_IMAGE_TYPE="${WINESAPOS_IMAGE_TYPE:-performance}" \
WINESAPOS_INSTALL_DIR="${WINESAPOS_INSTALL_DIR:-/winesapos}" \ WINESAPOS_INSTALL_DIR="${WINESAPOS_INSTALL_DIR:-/winesapos}" \
WINESAPOS_DISTRO="${WINESAPOS_DISTRO:-arch}" \ WINESAPOS_DISTRO="${WINESAPOS_DISTRO:-arch}" \
WINESAPOS_DISTRO_DETECTED=$(grep -P '^ID=' /etc/os-release | cut -d= -f2) \ WINESAPOS_DISTRO_DETECTED="${winesapos_distro_detected}" \
WINESAPOS_ENABLE_TESTING_REPO="${WINESAPOS_ENABLE_TESTING_REPO:-false}" \ WINESAPOS_ENABLE_TESTING_REPO="${WINESAPOS_ENABLE_TESTING_REPO:-false}" \
WINESAPOS_DE="${WINESAPOS_DE:-plasma}" \ WINESAPOS_DE="${WINESAPOS_DE:-plasma}" \
WINESAPOS_ENCRYPT="${WINESAPOS_ENCRYPT:-false}" \ WINESAPOS_ENCRYPT="${WINESAPOS_ENCRYPT:-false}" \

View file

@ -1,3 +1,5 @@
#!/bin/bash
export \ export \
WINESAPOS_IMAGE_TYPE=minimal \ WINESAPOS_IMAGE_TYPE=minimal \
WINESAPOS_ENABLE_PORTABLE_STORAGE=false \ WINESAPOS_ENABLE_PORTABLE_STORAGE=false \

View file

@ -1,3 +1,5 @@
#!/bin/bash
export \ export \
WINESAPOS_IMAGE_TYPE=secure \ WINESAPOS_IMAGE_TYPE=secure \
WINESAPOS_ENCRYPT=true \ WINESAPOS_ENCRYPT=true \

View file

@ -1,17 +1,21 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC2164
set -x set -x
WORK_DIR="${WORK_DIR:-/tmp}" WORK_DIR="${WORK_DIR:-/tmp}"
OUTPUT_DIR="${OUTPUT_DIR:-/output}" OUTPUT_DIR="${OUTPUT_DIR:-/output}"
CMD_PACMAN_INSTALL=(/usr/bin/pacman --noconfirm -S --needed) CMD_PACMAN_INSTALL=(/usr/bin/pacman --noconfirm -S --needed)
# Sometimes this is needed to install additional dependencies from the AUR first.
# shellcheck disable=SC2034
CMD_YAY_INSTALL=(yay --noconfirm -S --removemake) CMD_YAY_INSTALL=(yay --noconfirm -S --removemake)
# shellcheck disable=SC2016
echo 'MAKEFLAGS="-j $(nproc)"' | sudo tee -a /etc/makepkg.conf echo 'MAKEFLAGS="-j $(nproc)"' | sudo tee -a /etc/makepkg.conf
sudo pacman -S -y -y -u --noconfirm sudo pacman -S -y -y -u --noconfirm
# Install yay for helping install AUR build dependencies. # Install yay for helping install AUR build dependencies.
sudo -E ${CMD_PACMAN_INSTALL[*]} base-devel binutils cmake curl dkms git make tar wget sudo -E "${CMD_PACMAN_INSTALL[@]}" base-devel binutils cmake curl dkms git make tar wget
export YAY_VER="12.4.1" export YAY_VER="12.4.1"
sudo -E curl https://github.com/Jguer/yay/releases/download/v${YAY_VER}/yay_${YAY_VER}_x86_64.tar.gz --remote-name --location sudo -E curl https://github.com/Jguer/yay/releases/download/v${YAY_VER}/yay_${YAY_VER}_x86_64.tar.gz --remote-name --location
sudo -E tar -x -v -f yay_${YAY_VER}_x86_64.tar.gz sudo -E tar -x -v -f yay_${YAY_VER}_x86_64.tar.gz
@ -20,9 +24,11 @@ sudo rm -rf ./yay*
failed_builds=0 failed_builds=0
makepkg_build_failure_check() { makepkg_build_failure_check() {
# shellcheck disable=SC2010
if ls -1 | grep pkg\.tar; then if ls -1 | grep pkg\.tar; then
echo "${1} build PASSED" echo "${1} build PASSED"
else else
# shellcheck disable=SC2003 disable=SC2086
failed_builds=$(expr ${failed_builds} + 1) failed_builds=$(expr ${failed_builds} + 1)
echo "${1} build FAILED" echo "${1} build FAILED"
fi fi
@ -30,16 +36,16 @@ makepkg_build_failure_check() {
# Usage: makepkg_fn <PACKAGE_NAME> [install|noinstall] # Usage: makepkg_fn <PACKAGE_NAME> [install|noinstall]
makepkg_fn() { makepkg_fn() {
cd ${WORK_DIR} cd "${WORK_DIR}"
git clone https://aur.archlinux.org/${1}.git git clone "https://aur.archlinux.org/${1}.git"
cd ${1} cd "${1}"
if [[ "${2}" == "install" ]]; then if [[ "${2}" == "install" ]]; then
makepkg -s --noconfirm -i makepkg -s --noconfirm -i
else else
makepkg -s --noconfirm makepkg -s --noconfirm
fi fi
cp ./*.pkg.tar.* ${OUTPUT_DIR} cp ./*.pkg.tar.* "${OUTPUT_DIR}"
makepkg_build_failure_check ${1} makepkg_build_failure_check "${1}"
} }
# Usage: makepkg_local_fn [install|noop|noinstall] # Usage: makepkg_local_fn [install|noop|noinstall]
@ -51,8 +57,8 @@ makepkg_local_fn() {
else else
makepkg -s --noconfirm makepkg -s --noconfirm
fi fi
cp ./*.pkg.tar.* ${OUTPUT_DIR} cp ./*.pkg.tar.* "${OUTPUT_DIR}"
makepkg_build_failure_check ${1} makepkg_build_failure_check "${1}"
} }
# A proper git configuration is required to build some packages. # A proper git configuration is required to build some packages.
@ -73,6 +79,7 @@ makepkg_fn linux-apfs-rw-dkms-git
makepkg_fn linux-firmware-asus makepkg_fn linux-firmware-asus
makepkg_fn linux-firmware-valve makepkg_fn linux-firmware-valve
# Remove source packages downloaded by the 'linux-firmware-valve' PKGBUILD. # Remove source packages downloaded by the 'linux-firmware-valve' PKGBUILD.
# shellcheck disable=SC2086
rm -f ${OUTPUT_DIR}/linux-firmware-neptune* ${OUTPUT_DIR}/steamdeck-dsp-* rm -f ${OUTPUT_DIR}/linux-firmware-neptune* ${OUTPUT_DIR}/steamdeck-dsp-*
makepkg_fn nexusmods-app-bin makepkg_fn nexusmods-app-bin
makepkg_fn oxp-sensors-dkms-git makepkg_fn oxp-sensors-dkms-git
@ -135,37 +142,37 @@ if [[ "${WINESAPOS_REPO_BUILD_LINUX_GIT}" == "true" ]]; then
gpg --recv-keys 79BE3E4300411886 gpg --recv-keys 79BE3E4300411886
## Greg Kroah-Hartman: ## Greg Kroah-Hartman:
gpg --recv-keys 38DBBDC86092693E gpg --recv-keys 38DBBDC86092693E
cd ${WORK_DIR} cd "${WORK_DIR}"
git clone https://aur.archlinux.org/linux-git.git git clone https://aur.archlinux.org/linux-git.git
cd linux-git cd linux-git
makepkg -s --noconfirm makepkg -s --noconfirm
cp ./*.pkg.tar.zst ${OUTPUT_DIR} cp ./*.pkg.tar.zst "${OUTPUT_DIR}"
makepkg_build_failure_check linux-git makepkg_build_failure_check linux-git
fi fi
WINESAPOS_REPO_BUILD_MESA_GIT="${WINESAPOS_REPO_BUILD_MESA_GIT:-false}" WINESAPOS_REPO_BUILD_MESA_GIT="${WINESAPOS_REPO_BUILD_MESA_GIT:-false}"
if [[ "${WINESAPOS_REPO_BUILD_MESA_GIT}" == "true" ]]; then if [[ "${WINESAPOS_REPO_BUILD_MESA_GIT}" == "true" ]]; then
cd ${WORK_DIR} cd "${WORK_DIR}"
git clone https://aur.archlinux.org/mesa-git.git git clone https://aur.archlinux.org/mesa-git.git
cd mesa-git cd mesa-git
makepkg -s --noconfirm makepkg -s --noconfirm
cp ./*.pkg.tar.zst ${OUTPUT_DIR} cp ./*.pkg.tar.zst "${OUTPUT_DIR}"
makepkg_build_failure_check mesa-git makepkg_build_failure_check mesa-git
cd ${WORK_DIR} cd "${WORK_DIR}"
git clone https://aur.archlinux.org/lib32-mesa-git.git git clone https://aur.archlinux.org/lib32-mesa-git.git
cd lib32-mesa-git cd lib32-mesa-git
makepkg -s --noconfirm makepkg -s --noconfirm
cp ./*.pkg.tar.zst ${OUTPUT_DIR} cp ./*.pkg.tar.zst "${OUTPUT_DIR}"
makepkg_build_failure_check lib32-mesa-git makepkg_build_failure_check lib32-mesa-git
fi fi
# Build Pacman repository metadata. # Build Pacman repository metadata.
WINESAPOS_REPO_BUILD_TESTING="${WINESAPOS_REPO_BUILD_TESTING:-false}" WINESAPOS_REPO_BUILD_TESTING="${WINESAPOS_REPO_BUILD_TESTING:-false}"
if [[ "${WINESAPOS_REPO_BUILD_TESTING}" == "true" ]]; then if [[ "${WINESAPOS_REPO_BUILD_TESTING}" == "true" ]]; then
repo-add ${OUTPUT_DIR}/winesapos-testing.db.tar.gz ${OUTPUT_DIR}/*pkg.tar.zst repo-add "${OUTPUT_DIR}/winesapos-testing.db.tar.gz" "${OUTPUT_DIR}/*pkg.tar.zst"
else else
repo-add ${OUTPUT_DIR}/winesapos.db.tar.gz ${OUTPUT_DIR}/*pkg.tar.zst repo-add "${OUTPUT_DIR}/winesapos.db.tar.gz" "${OUTPUT_DIR}/*pkg.tar.zst"
fi fi
echo ${failed_builds} > ${OUTPUT_DIR}/winesapos-build-repo_exit-code.txt echo "${failed_builds}" > "${OUTPUT_DIR}/winesapos-build-repo_exit-code.txt"
exit ${failed_builds} exit "${failed_builds}"

View file

@ -6,7 +6,8 @@ export \
WINESAPOS_CREATE_DEVICE=true \ WINESAPOS_CREATE_DEVICE=true \
WINESAPOS_BUILD_IN_VM_ONLY=false WINESAPOS_BUILD_IN_VM_ONLY=false
if [[ ! -z "${WINESAPOS_ENV_FILE}" ]]; then if [[ -n "${WINESAPOS_ENV_FILE}" ]]; then
# shellcheck disable=SC1090
source "/workdir/scripts/env/${WINESAPOS_ENV_FILE}" source "/workdir/scripts/env/${WINESAPOS_ENV_FILE}"
fi fi

View file

@ -41,13 +41,12 @@ WINESAPOS_DISTRO_DETECTED=$(grep -P '^ID=' /etc/os-release | cut -d= -f2)
if [[ "${WINESAPOS_DISTRO_DETECTED}" == "arch" ]] || [[ "${WINESAPOS_DISTRO_DETECTED}" == "manjaro" ]]; then if [[ "${WINESAPOS_DISTRO_DETECTED}" == "arch" ]] || [[ "${WINESAPOS_DISTRO_DETECTED}" == "manjaro" ]]; then
echo "Arch Linux or Manjaro detected. winesapOS conversion will attempt to install all packages." echo "Arch Linux or Manjaro detected. winesapOS conversion will attempt to install all packages."
sudo pacman -S -y sudo pacman -S -y
${CMD_PACMAN_INSTALL[*]} base-devel flatpak git wget "${CMD_PACMAN_INSTALL[@]}" base-devel flatpak git wget
curl https://raw.githubusercontent.com/winesapOS/winesapOS/stable/files/os-release-winesapos --location --output /usr/lib/os-release-winesapos curl https://raw.githubusercontent.com/winesapOS/winesapOS/stable/files/os-release-winesapos --location --output /usr/lib/os-release-winesapos
ln -s /usr/lib/os-release-winesapos /etc/os-release-winesapos ln -s /usr/lib/os-release-winesapos /etc/os-release-winesapos
if [[ "${WINESAPOS_DISTRO_DETECTED}" == "arch" ]]; then if [[ "${WINESAPOS_DISTRO_DETECTED}" == "arch" ]]; then
grep -P "^\[multilib\]" /etc/pacman.conf if ! grep -q -P "^\[multilib\]" /etc/pacman.conf; then
if [ $? -ne 0 ]; then
echo "Adding the 32-bit multilb repository..." echo "Adding the 32-bit multilb repository..."
# 32-bit multilib libraries. # 32-bit multilib libraries.
echo -e '\n\n[multilib]\nInclude=/etc/pacman.d/mirrorlist' | sudo tee -a /etc/pacman.conf echo -e '\n\n[multilib]\nInclude=/etc/pacman.d/mirrorlist' | sudo tee -a /etc/pacman.conf
@ -56,8 +55,7 @@ if [[ "${WINESAPOS_DISTRO_DETECTED}" == "arch" ]] || [[ "${WINESAPOS_DISTRO_DETE
fi fi
fi fi
grep "\[winesapos\]" /etc/pacman.conf if ! grep -q "\[winesapos\]" /etc/pacman.conf; then
if [ $? -ne 0 ]; then
echo "Adding the winesapOS repository..." echo "Adding the winesapOS repository..."
echo "[winesapos]" | sudo tee -a /etc/pacman.conf echo "[winesapos]" | sudo tee -a /etc/pacman.conf
echo "Server = https://winesapos.lukeshort.cloud/repo/winesapos/\$arch/" | sudo tee -a /etc/pacman.conf echo "Server = https://winesapos.lukeshort.cloud/repo/winesapos/\$arch/" | sudo tee -a /etc/pacman.conf
@ -70,8 +68,7 @@ if [[ "${WINESAPOS_DISTRO_DETECTED}" == "arch" ]] || [[ "${WINESAPOS_DISTRO_DETE
echo "Adding the winesapOS repository complete." echo "Adding the winesapOS repository complete."
fi fi
grep "\[chaotic-aur\]" /etc/pacman.conf if ! grep -q "\[chaotic-aur\]" /etc/pacman.conf; then
if [ $? -ne 0 ]; then
# https://aur.chaotic.cx/ # https://aur.chaotic.cx/
echo "Adding the Chaotic AUR repository..." echo "Adding the Chaotic AUR repository..."
sudo pacman-key --recv-keys 3056513887B78AEB --keyserver keyserver.ubuntu.com sudo pacman-key --recv-keys 3056513887B78AEB --keyserver keyserver.ubuntu.com
@ -94,8 +91,9 @@ Include = /etc/pacman.d/chaotic-mirrorlist" | sudo tee -a /etc/pacman.conf
echo "Installing all AUR packages..." echo "Installing all AUR packages..."
git clone https://aur.archlinux.org/yay.git git clone https://aur.archlinux.org/yay.git
cd yay cd yay || exit 1
makepkg -si --noconfirm makepkg -si --noconfirm
# shellcheck disable=SC2103
cd .. cd ..
sudo rm -rf yay sudo rm -rf yay
yay --noconfirm -S --needed --removemake \ yay --noconfirm -S --needed --removemake \

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -5,4 +5,4 @@
mkdir -p output mkdir -p output
docker build --pull --no-cache -t winesapos-img-builder build/. docker build --pull --no-cache -t winesapos-img-builder build/.
docker run --rm -v $(pwd):/workdir --privileged=true -i winesapos-img-builder:latest /bin/bash -x scripts/winesapos-build.sh docker run --rm -v "$(pwd)":/workdir --privileged=true -i winesapos-img-builder:latest /bin/bash -x scripts/winesapos-build.sh