Skip to content

Commit

Permalink
Update create-arch-bootstrap.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-hc authored Oct 19, 2024
1 parent a8a1eaf commit 01c2750
Showing 1 changed file with 30 additions and 68 deletions.
98 changes: 30 additions & 68 deletions create-arch-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,30 @@
########################################################################

# Package groups
audio_pkgs="alsa-lib lib32-alsa-lib alsa-plugins lib32-alsa-plugins libpulse \
lib32-libpulse jack2 lib32-jack2 alsa-tools alsa-utils pipewire \
lib32-pipewire"
audio_pkgs="alsa-lib lib32-alsa-lib libpulse lib32-libpulse pipewire lib32-pipewire"

video_pkgs="mesa lib32-mesa vulkan-radeon lib32-vulkan-radeon \
vulkan-intel lib32-vulkan-intel \
vulkan-icd-loader lib32-vulkan-icd-loader vulkan-mesa-layers \
video_pkgs="mesa lib32-mesa vulkan-radeon lib32-vulkan-radeon vulkan-intel \
lib32-vulkan-intel vulkan-icd-loader lib32-vulkan-icd-loader vulkan-mesa-layers \
lib32-vulkan-mesa-layers libva-mesa-driver lib32-libva-mesa-driver \
libva-intel-driver lib32-libva-intel-driver intel-media-driver \
mesa-utils vulkan-tools libva-utils lib32-mesa-utils"

wine_pkgs="wine-staging winetricks-git wine-nine wineasio \
giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap \
gnutls lib32-gnutls mpg123 lib32-mpg123 openal lib32-openal \
v4l-utils lib32-v4l-utils libpulse lib32-libpulse alsa-plugins \
lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo \
libva-intel-driver lib32-libva-intel-driver intel-media-driver"

wine_pkgs="giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap \
gnutls lib32-gnutls mpg123 lib32-mpg123 v4l-utils lib32-v4l-utils \
libpulse lib32-libpulse alsa-lib lib32-alsa-lib libjpeg-turbo \
lib32-libjpeg-turbo libxcomposite lib32-libxcomposite libxinerama \
lib32-libxinerama libxslt lib32-libxslt libva lib32-libva gtk3 \
lib32-gtk3 vulkan-icd-loader lib32-vulkan-icd-loader sdl2 lib32-sdl2 \
vkd3d lib32-vkd3d libgphoto2 ffmpeg gst-plugins-good gst-plugins-bad \
gst-plugins-ugly gst-plugins-base lib32-gst-plugins-good \
lib32-gst-plugins-base gst-libav wget gst-plugin-pipewire"

wine32_pkgs="lib32-giflib lib32-libpng lib32-libldap lib32-gnutls mpg123 \
lib32-mpg123 lib32-openal lib32-v4l-utils lib32-libpulse \
lib32-alsa-plugins lib32-alsa-lib \
lib32-libjpeg-turbo lib32-libxcomposite \
lib32-libxinerama lib32-libxslt lib32-libva gtk3 \
lib32-gtk3 lib32-sdl2 lib32-vkd3d lib32-gst-plugins-good \
lib32-gst-plugins-base"

devel_pkgs="base-devel git meson mingw-w64-gcc cmake"
libxslt lib32-libxslt libva lib32-libva vkd3d lib32-vkd3d \
ffmpeg wget"

devel_pkgs="base-devel"

# Packages to install
# You can add packages that you want and remove packages that you don't need
# Apart from packages from the official Arch repos, you can also specify
# packages from the Chaotic-AUR repo
export packagelist="${audio_pkgs} ${wine32_pkgs} ${devel_pkgs} \
export packagelist="${audio_pkgs} ${video_pkgs} ${wine_pkgs} ${devel_pkgs} \
ttf-dejavu ttf-liberation xorg-xwayland gamemode lib32-gamemode wayland \
lib32-wayland xorg-server xorg-apps which ibus libpng v4l-utils libxslt \
vulkan-icd-loader lib32-vulkan-icd-loader gnutls openal libjpeg-turbo \
libva sdl2 xterm"
lib32-vulkan-icd-loader gnutls openal libjpeg-turbo libva sdl2 xterm"

# If you want to install AUR packages, specify them in this variable
export aur_packagelist="bottles"
Expand Down Expand Up @@ -180,36 +162,6 @@ install_aur_packages () {
done
}

generate_localegen () {
cat <<EOF > locale.gen
ar_EG.UTF-8 UTF-8
en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
en_CA.UTF-8 UTF-8
en_SG.UTF-8 UTF-8
es_MX.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
fr_FR.UTF-8 UTF-8
ru_RU.UTF-8 UTF-8
ru_UA.UTF-8 UTF-8
es_ES.UTF-8 UTF-8
de_DE.UTF-8 UTF-8
pt_BR.UTF-8 UTF-8
it_IT.UTF-8 UTF-8
id_ID.UTF-8 UTF-8
ja_JP.UTF-8 UTF-8
bg_BG.UTF-8 UTF-8
pl_PL.UTF-8 UTF-8
da_DK.UTF-8 UTF-8
ko_KR.UTF-8 UTF-8
tr_TR.UTF-8 UTF-8
hu_HU.UTF-8 UTF-8
cs_CZ.UTF-8 UTF-8
bn_IN UTF-8
hi_IN UTF-8
EOF
}

generate_mirrorlist () {
cat <<EOF > mirrorlist
Server = https://mirror1.sl-chat.ru/archlinux/\$repo/os/\$arch
Expand Down Expand Up @@ -275,8 +227,6 @@ rm archlinux-bootstrap-x86_64.tar.zst sha256sums.txt sha256.txt

mount_chroot

#generate_localegen

if command -v reflector 1>/dev/null; then
echo "Generating mirrorlist..."
reflector --connection-timeout 10 --download-timeout 10 --protocol https --score 10 --sort rate --save mirrorlist
Expand All @@ -285,9 +235,6 @@ else
generate_mirrorlist
fi

#rm "${bootstrap}"/etc/locale.gen
#mv locale.gen "${bootstrap}"/etc/locale.gen

rm "${bootstrap}"/etc/pacman.d/mirrorlist
mv mirrorlist "${bootstrap}"/etc/pacman.d/mirrorlist

Expand Down Expand Up @@ -373,7 +320,6 @@ if [ -n "${aur_packagelist}" ]; then
export -f install_aur_packages
CHROOT_AUR=1 HOME=/home/aur run_in_chroot bash -c install_aur_packages
mv "${bootstrap}"/home/aur/bad_aur_pkglist.txt "${bootstrap}"/opt
#rm -rf "${bootstrap}"/home/aur
fi

#run_in_chroot locale-gen
Expand Down Expand Up @@ -414,11 +360,21 @@ rm -rf "${bootstrap}"/usr/lib32/libgphobos.so*
rm -rf "${bootstrap}"/usr/share/ibus/dicts/emoji*
rm -rf "${bootstrap}"/usr/lib/systemd
rm -rf "${bootstrap}"/usr/share/info
rm -rf "${bootstrap}"/usr/share/autoconf
rm -rf "${bootstrap}"/usr/share/automake
rm -rf "${bootstrap}"/usr/share/git*
rm -rf "${bootstrap}"/usr/share/pacman
rm -rf "${bootstrap}"/usr/share/gir-1.0
rm -rf "${bootstrap}"/var/lib/pacman/*
rm -f "${bootstrap}"/usr/bin/yay
rm -f "${bootstrap}"/usr/bin/git*
rm -f "${bootstrap}"/usr/bin/systemd*
rm -f "${bootstrap}"/usr/bin/pacman*
rm -f "${bootstrap}"/usr/bin/mangoplot
find "${bootstrap}"/usr/lib "${bootstrap}"/usr/lib32 -type f -regex '.*\.a' -exec rm -f {} \;
find "${bootstrap}"/usr -type f -regex '.*\.so.*' -exec strip --strip-debug {} \;
find "${bootstrap}"/usr/bin -type f ! -regex '.*\.so.*' -exec strip --strip-unneeded {} \;
find "${bootstrap}"/usr/lib -type f -regex '.*\.pyc' -exec rm -f {} \;

# Check if the command we are interested in has been installed
if ! run_in_chroot which bottles; then echo "Command not found, exiting." && exit 1; fi
Expand All @@ -427,6 +383,12 @@ if ! run_in_chroot which bottles; then echo "Command not found, exiting." && exi
rm -rf "${bootstrap}"/home/aur
unmount_chroot

# Use the patched bwrap to allow launching AppImages from conty
echo "Using patched bubblewrap..."
rm -f "${bootstrap}"/usr/bin/bwrap
wget "https://bin.ajam.dev/x86_64_Linux/bwrap-patched" -O "${bootstrap}"/usr/bin/bwrap || exit 1
chmod +x "${bootstrap}"/usr/bin/bwrap || exit 1

# Clear pacman package cache
rm -f "${bootstrap}"/var/cache/pacman/pkg/*

Expand Down

0 comments on commit 01c2750

Please sign in to comment.