Skip to content

Commit e2c90cf

Browse files
committed
Merge branch 'pipewire' into dev
2 parents 50af988 + 7aad2ac commit e2c90cf

File tree

10 files changed

+99
-30
lines changed

10 files changed

+99
-30
lines changed

build.sh

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module_dir="${script_path}/modules"
2222
customized_username=false
2323
customized_password=false
2424
customized_kernel=false
25+
pkglist_args=""
2526
DEFAULT_ARGUMENT=""
2627
alteriso_version="3.1"
2728

@@ -514,6 +515,14 @@ prepare_build() {
514515
msg_error "${channel_name} channel does not support current architecture (${arch})." "1"
515516
fi
516517

518+
# Set argument of pkglist.sh
519+
pkglist_args=("-a" "${arch}" "-k" "${kernel}" "-c" "${channel_dir}" "-l" "${locale_name}")
520+
if [[ "${boot_splash}" = true ]]; then pkglist_args+=("-b"); fi
521+
if [[ "${debug}" = true ]]; then pkglist_args+=("-d"); fi
522+
if [[ "${memtest86}" = true ]]; then pkglist_args+=("-m"); fi
523+
if (( "${#additional_exclude_pkg[@]}" >= 1 )); then pkglist_args+=("-e" "${additional_exclude_pkg[*]}"); fi
524+
pkglist_args+=("${modules[*]}")
525+
517526
# Unmount
518527
umount_chroot
519528
}
@@ -553,15 +562,7 @@ make_basefs() {
553562

554563
# Additional packages (airootfs)
555564
make_packages_repo() {
556-
local _pkg _pkglist_args="-a ${arch} -k ${kernel} -c ${channel_dir} -l ${locale_name}"
557-
558-
# get pkglist
559-
if [[ "${boot_splash}" = true ]]; then _pkglist_args+=" -b"; fi
560-
if [[ "${debug}" = true ]]; then _pkglist_args+=" -d"; fi
561-
if [[ "${memtest86}" = true ]]; then _pkglist_args+=" -m"; fi
562-
_pkglist_args+=" ${modules[*]}"
563-
564-
local _pkglist=($("${tools_dir}/pkglist.sh" ${_pkglist_args}))
565+
local _pkglist=($("${tools_dir}/pkglist.sh" "${pkglist_args[@]}"))
565566

566567
# Create a list of packages to be finally installed as packages.list directly under the working directory.
567568
echo -e "# The list of packages that is installed in live cd.\n#\n\n" > "${work_dir}/packages.list"
@@ -572,20 +573,10 @@ make_packages_repo() {
572573
}
573574

574575
make_packages_aur() {
575-
local _pkg _pkglist_args="--aur -a ${arch} -k ${kernel} -c ${channel_dir} -l ${locale_name}"
576-
577-
# get pkglist
578-
# get pkglist
579-
if [[ "${boot_splash}" = true ]]; then _pkglist_args+=" -b"; fi
580-
if [[ "${debug}" = true ]]; then _pkglist_args+=" -d"; fi
581-
if [[ "${memtest86}" = true ]]; then _pkglist_args+=" -m"; fi
582-
_pkglist_args+=" ${modules[*]}"
583-
584-
local _pkglist_aur=($("${tools_dir}/pkglist.sh" ${_pkglist_args}))
576+
local _pkglist_aur=($("${tools_dir}/pkglist.sh" --aur "${pkglist_args[@]}"))
585577

586578
# Create a list of packages to be finally installed as packages.list directly under the working directory.
587579
echo -e "\n\n# AUR packages.\n#\n\n" >> "${work_dir}/packages.list"
588-
#for _pkg in ${_pkglist_aur[@]}; do echo ${_pkg} >> "${work_dir}/packages.list"; done
589580
printf "%s\n" "${_pkglist_aur[@]}" >> "${work_dir}/packages.list"
590581

591582
# prepare for yay

default.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,14 @@ msgdebug=false
267267
# $ git rev-parse --short HEAD
268268
gitversion=false
269269

270+
# Additional list of packages to exclude from channel
271+
# Works the same as an exclude file
272+
# Use this array for debugging only
273+
# This setting cannot be changed by an argument.
274+
additional_exclude_pkg=(
275+
276+
)
277+
270278

271279
# List of packages required for build
272280
# The following packages are checked to see if they are installed before running build.sh

modules/share-extra/airootfs.any/root/customize_airootfs_share-extra.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ usermod -aG autologin ${username}
3131
_systemd_service enable systemd-timesyncd.service
3232

3333

34+
# Pipewire
35+
# Do not use _systemd_service because pipewire services are not system but user
36+
# Use flag "--user --global"
37+
# https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/923
38+
for _service in "pipewire.service" "pipewire-pulse.service"; do
39+
if systemctl --user --global cat "${_service}" 1> /dev/null 2>&1; then
40+
systemctl --user --global enable "${_service}"
41+
fi
42+
done
43+
44+
# Enable bluetooth support for pipewire
45+
if [[ -f "/etc/pipewire/media-session.d/media-session.conf" ]]; then
46+
sed -i "s|#bluez5|bluez5 |g" "/etc/pipewire/media-session.d/media-session.conf"
47+
fi
48+
49+
3450
# Update system datebase
3551
if type -p dconf 1>/dev/null 2>/dev/null; then
3652
dconf update

modules/share-extra/packages.i686/media.i686

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
#-- audio --#
1414
pavucontrol
15-
pulseaudio
15+
pipewire
16+
pipewire-alsa
1617

1718

1819
#-- bluetooth --#

modules/share-extra/packages.x86_64/media.x86_64

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
#-- audio --#
1414
pavucontrol
15-
pulseaudio
15+
pipewire
16+
pipewire-alsa
1617

1718

1819
#-- bluetooth --#

modules/share-extra/packages_aur.i686/media.i686 renamed to modules/share-extra/packages_aur.i686/pipewire.i686

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# (c) 2019-2021 Fascode Network.
99
#
1010

11-
pulseaudio-modules-bt
11+
pipewire-enable-bluez5

modules/share-extra/packages_aur.x86_64/media.x86_64 renamed to modules/share-extra/packages_aur.x86_64/pipewire.x86_64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# (c) 2019-2021 Fascode Network.
99
#
1010

11-
pulseaudio-modules-bt
11+
pipewire-enable-bluez5

system/aur.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ls "/usr/share/pacman/keyrings/"*".gpg" | sed "s|.gpg||g" | xargs | pacman-key -
6262

6363
# Build and install
6464
chmod +s /usr/bin/sudo
65-
for _pkg in "pamac-aur" "${@}"; do
65+
for _pkg in "${@}"; do
6666
yes | sudo -u aurbuild \
6767
yay -Sy \
6868
--mflags "-AcC" \

system/initcpio/archiso_shutdown

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/ash
2+
3+
# /oldroot depends on things inside /oldroot/run/archiso...
4+
mkdir /oldrun
5+
mount -n --move /oldroot/run /oldrun
6+
7+
# Unmount all mounts now.
8+
umount "$(mount | awk '$3 ~/^\/oldroot/ {print $3}' | sort -r)"
9+
10+
# Remove all dm-snapshot devices.
11+
dmsetup remove_all
12+
13+
# Remove all loopback devices.
14+
for _lup in $(grep ^/dev/loop /oldrun/archiso/used_block_devices | tac); do
15+
if ! losetup -d -- "${_lup}" 2> /dev/null; then
16+
umount -d -- "${_lup}"
17+
fi
18+
done
19+
20+
# Unmount the space used to store *.cow.
21+
umount /oldrun/archiso/cowspace
22+
23+
# Unmount boot device if needed (no copytoram=y used)
24+
if [ ! -d /oldrun/archiso/copytoram ]; then
25+
if [ -d /oldrun/archiso/img_dev ]; then
26+
umount /oldrun/archiso/img_dev
27+
else
28+
umount /oldrun/archiso/bootmnt
29+
fi
30+
fi
31+
32+
# reboot / poweroff / halt, depending on the argument passed by init
33+
# if something invalid is passed, we halt
34+
case "$1" in
35+
reboot|poweroff|halt) "$1" -f ;;
36+
*) halt -f;;
37+
esac
38+
39+
# vim: set ft=sh:

tools/pkglist.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ line=false
1313
debug=false
1414
memtest86=false
1515

16+
additional_exclude_pkg=()
17+
1618
arch=""
1719
channel_dir=""
1820
kernel=""
@@ -29,6 +31,7 @@ _help() {
2931
echo " -b | --boot-splash Enable boot splash"
3032
echo " -c | --channel [dir] Specify the channel directory"
3133
echo " -d | --debug Enable debug message"
34+
echo " -e | --exclude [pkgs] List of packages to be additionally excluded"
3235
echo " -k | --kernel [kernel] Specify the kernel"
3336
echo " -l | --locale [locale] Specify the locale"
3437
echo " -m | --memtest86 Enable memtest86 package"
@@ -70,15 +73,15 @@ msg_debug() {
7073

7174

7275
# Parse options
73-
ARGUMENT="${@}"
74-
OPTS="a:bc:dk:l:mh"
75-
OPTL="arch:,boot-splash,channel:,debug,kernel:,locale:,memtest86,aur,help,line"
76-
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
76+
ARGUMENT=("${@}")
77+
OPTS="a:bc:de:k:l:mh"
78+
OPTL="arch:,boot-splash,channel:,debug,exclude:,kernel:,locale:,memtest86,aur,help,line"
79+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- "${ARGUMENT[@]}"); then
7780
exit 1
7881
fi
7982

8083
eval set -- "${OPT}"
81-
unset OPT OPTS OPTL
84+
unset OPT OPTS OPTL ARGUMENT
8285

8386
while true; do
8487
case "${1}" in
@@ -98,6 +101,10 @@ while true; do
98101
debug=true
99102
shift 1
100103
;;
104+
-e | --exclude)
105+
additional_exclude_pkg=(${2})
106+
shift 2
107+
;;
101108
-k | --kernel)
102109
kernel="${2}"
103110
shift 2
@@ -206,6 +213,12 @@ for _file in ${_excludefile[@]}; do
206213
fi
207214
done
208215

216+
#-- additional_exclude_pkg のパッケージを_excludelistに追加 --#
217+
if (( "${#additional_exclude_pkg[@]}" >= 1 )); then
218+
_excludelist+=(${additional_exclude_pkg[@]})
219+
msg_debug "Additional excluded packages: ${additional_exclude_pkg[*]}"
220+
fi
221+
209222
#-- excludeに記述されたパッケージを除外 --#
210223
# _pkglistを_subpkglistにコピーしexcludeのパッケージを除外し再代入
211224
_subpkglist=(${_pkglist[@]})

0 commit comments

Comments
 (0)