Compare commits

...

90 Commits

Author SHA1 Message Date
xin
f0efcff07f 优化体验 2025-12-03 23:38:29 +08:00
xin
7280e186dd 优化体验 2025-12-03 16:32:38 +08:00
xin
f8d3ba4327 优化稳定性 2025-12-02 22:33:34 +08:00
xin
251d8795ea 恢复可以回退到上一个版本的功能 2025-11-30 21:41:23 +08:00
xin
33cfff35b7 优化曲线显示数据 2025-11-30 20:04:16 +08:00
xin
5e5aac70fa 新接口 2025-11-30 11:22:31 +08:00
xin
ed79033f44 修复重启功能, 新功能埋点 2025-11-29 09:53:39 +08:00
xin
c87fa90e62 增加内部存储删除文件夹功能,添加qqmusic proxy功能 2025-11-27 19:17:06 +08:00
xin
9377f60b7d 测试 2025-11-25 22:20:35 +08:00
xin
8c2e8d5e08 优化播放器 2025-11-25 19:17:31 +08:00
xin
b56434f44e 优化ota速度 2025-11-24 09:46:52 +08:00
xin
ddef5769ee 继续修复播放器卡顿的问题,并且让播放器具备复制文件夹到内部存储的能力 2025-11-24 09:17:55 +08:00
xin
6dd30696b4 修复播放器偶尔不播放的问题 2025-11-21 23:10:19 +08:00
xin
f89cb7e93b 修复对优盘ntfs的支持,优化播放进度条体验 2025-11-18 13:25:01 +08:00
xin
28b7cb428b feat: qqmusic 2025-11-17 18:52:58 +08:00
xin
e6057713f9 fix: playback stuttering 2025-11-13 13:28:29 +08:00
xin
855c2c0a2d fix: validate issue 2025-11-10 19:43:45 +08:00
xin
af5ab1f3bd fix: ota 2025-11-10 15:25:19 +08:00
xin
5672ff56d2 feat: sync filesystem 2025-11-09 08:54:33 +08:00
xin
817c79b149 feat: sync filesystem 2025-11-09 08:01:01 +08:00
xin
2d035374fb feat: sync filesystem 2025-11-09 08:00:31 +08:00
xin
4940f479a1 feat: bt pair 2025-11-08 21:07:17 +08:00
xin
81e5b3cb32 fix: airplay status for ws 2025-11-08 19:13:06 +08:00
xin
e60d9d2a70 feat: splite volume for other input 2025-11-08 08:44:31 +08:00
xin
9e80909bef feat: update mirror 2025-11-07 23:44:24 +08:00
xin
49406fd2d4 feat: update mirror 2025-11-07 23:15:49 +08:00
xin
37ccae4552 feat: update mirror 2025-11-07 22:41:04 +08:00
xin
453c9fb7e2 feat: enable bluetooth input 2025-11-07 21:49:53 +08:00
xin
601d06c1a2 fix: update 2025-11-07 15:30:56 +08:00
xin
ea28dc87ba fix: update 2025-11-07 15:18:23 +08:00
xin
834f8f4e40 fix: update 2025-11-07 15:08:34 +08:00
xin
784ccbead8 fix: update 2025-11-07 15:05:07 +08:00
xin
88a3719a16 fix: update 2025-11-07 15:02:28 +08:00
xin
9a588bbaaf fix: update 2025-11-07 14:58:06 +08:00
xin
f1365c1967 fix: update 2025-11-07 14:45:42 +08:00
xin
e23b7d2a8a feat: raz 2025-11-07 14:00:52 +08:00
xin
e590805570 feat: delete internal disk file 2025-11-02 08:59:02 +08:00
xin
f64775dd68 feat: more features 2025-11-02 08:14:49 +08:00
xin
88d844e364 feat: more features 2025-11-02 06:55:58 +08:00
xin
b48b4fc330 feat: more features 2025-10-31 08:37:58 +08:00
xin
25221d9178 fix: machine id issue 2025-10-30 22:54:33 +08:00
xin
d91a1fd564 fix: machine id issue 2025-10-30 15:33:38 +08:00
xin
4b5d2e7f70 feat: for bluetooth audio 2025-10-30 14:34:26 +08:00
xin
0c8e7639ca feat: internal disk 2025-10-26 19:28:00 +08:00
xin
633f20cb76 fix: airplay service status issue 2025-10-26 16:47:56 +08:00
xin
645250fac6 fix: airplay service status issue 2025-10-26 15:51:09 +08:00
xin
6433f98d88 feat: optimization for weak network env 2025-10-24 13:35:06 +08:00
xin
398d8ef10f feat: more 2025-10-17 10:09:13 +08:00
xin
d7d5527136 fix: validate error 2025-10-13 21:31:18 +08:00
xin
46c91b2801 feat: optimize sign 2025-10-13 09:47:24 +08:00
xin
55338e4218 feat: optimize 2025-10-11 20:28:27 +08:00
xin
6fc1b69af5 feat: optimize 2025-10-10 09:59:28 +08:00
xin
a407b847f6 feat: add playlist clear log 2025-10-08 22:43:18 +08:00
xin
a3a630b984 feat: new validate 2025-10-08 11:19:34 +08:00
xin
29cba7893a feat: wait ssid 2025-10-07 16:45:23 +08:00
xin
e6c51c0c51 feat: scan wifi before connect 2025-10-07 10:51:10 +08:00
xin
1c4455242b fix: wifi log 2025-10-06 21:24:53 +08:00
xin
d54e836c4e feat: optimize log time zone 2025-10-06 19:38:08 +08:00
xin
eb5662a0c7 feat: optimize network 2025-10-06 15:08:08 +08:00
xin
02e0a85660 fix: connect wifi failed when network change 3 2025-10-04 13:41:21 +08:00
xin
56528fce84 fix: connect wifi failed when network change 2 2025-10-02 20:38:35 +08:00
xin
d84a19895e fix: connect wifi failed when network change 1 2025-10-01 08:12:34 +08:00
xin
67bb65e602 fix: connect wifi failed when network change 2025-09-30 18:53:36 +08:00
xin
a28cb8a0a6 feat: move bluetooth input 2025-09-28 21:30:18 +08:00
xin
ff701ea66f feat: optimize music stream proxy 2025-09-25 08:41:55 +08:00
xin
e0e7b54a02 feat: udp boardcast to neighbors 2025-09-24 20:39:46 +08:00
xin
7815c001fd feat: add reboot cli 2025-09-23 20:35:27 +08:00
xin
c7f6e86633 feat: optimize connect 2025-09-23 09:13:52 +08:00
xin
ad29ff030e feat: remove login html cache 2025-09-20 17:39:26 +08:00
xin
657ffbe822 feat: remove login html cache 2025-09-20 17:21:21 +08:00
xin
08231e4243 feat: remove login html cache 2025-09-20 16:40:48 +08:00
xin
0182af3aba feat: andriod login html 2025-09-20 15:11:28 +08:00
xin
63fe68f905 feat: andriod login html 2025-09-20 14:31:06 +08:00
xin
1dda690b59 fix: remote issue 2025-09-17 15:01:42 +08:00
xin
91d0437e8c feat: optimize discovery 2025-09-16 17:07:32 +08:00
xin
a1ee28b1e1 fix: validation 2025-09-10 22:37:52 +08:00
xin
89628f7d5b fix: validation 2025-09-10 22:10:55 +08:00
xin
a117c1028e feat: validation log time 2025-09-10 21:58:42 +08:00
xin
4fddd2d0a4 feat: validation log 2025-09-10 21:43:54 +08:00
xin
902eea04bc fix: remote edge case 2025-09-09 22:28:28 +08:00
xin
4d1817cab4 feat: dac api 2025-09-07 20:28:27 +08:00
xin
f88908c55a feat: support 172.4 2025-09-07 10:46:25 +08:00
xin
dd5774a8cb feat: support dsd 2025-09-06 11:29:32 +08:00
xin
1259b9c760 feat: usb search & optimize validate & dsd suport 2025-09-05 14:05:08 +08:00
xin
4b785c968a feat: for buildin dac 2025-09-03 22:18:33 +08:00
xin
c8c2b1e815 fix: tidal network 2025-09-02 23:18:15 +08:00
xin
8ced2eeb78 feat: add more short key for remote 2025-09-02 16:41:04 +08:00
xin
b133457457 feat: update config 2025-09-02 10:18:27 +08:00
xin
2b9542745b feat: resize partion 2025-09-01 18:26:32 +08:00
xin
8bf0caa601 feat: update mpd 2025-08-29 07:50:17 +08:00
4 changed files with 489 additions and 111 deletions

260
emmc_backup_from_sd.sh Normal file
View File

@ -0,0 +1,260 @@
#!/bin/bash
#===============================================================================
# 从SD卡操作eMMC备份脚本
#===============================================================================
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
error_msg() { echo -e "${RED}[ERROR] $1${NC}" >&2; exit 1; }
info_msg() { echo -e "${GREEN}[INFO] $1${NC}"; }
warn_msg() { echo -e "${YELLOW}[WARN] $1${NC}"; }
[[ $EUID -eq 0 ]] || error_msg "需要root权限"
EMMC_DEV="/dev/mmcblk0"
USB_DIR="/mnt/XIN_USB/rock5c"
OUTPUT_FILE="${USB_DIR}/rock5c_emmc_$(date +%Y%m%d_%H%M%S).img"
info_msg "从SD卡备份eMMC (智能压缩版)..."
info_msg "eMMC设备: ${EMMC_DEV}"
info_msg "输出到: ${OUTPUT_FILE}"
# 获取原始eMMC大小
ORIGINAL_SIZE=$(blockdev --getsize64 ${EMMC_DEV})
ORIGINAL_SIZE_GB=$((ORIGINAL_SIZE / 1073741824))
info_msg "原始eMMC大小: ${ORIGINAL_SIZE_GB}GB"
# 检查设备
[[ -b "${EMMC_DEV}" ]] || error_msg "eMMC设备不存在: ${EMMC_DEV}"
[[ -d "${USB_DIR}" ]] || error_msg "USB目录不存在: ${USB_DIR}"
# 检查eMMC没有被挂载
if mount | grep -q mmcblk0; then
error_msg "eMMC还在使用中请确保从SD卡启动"
fi
info_msg "✅ eMMC设备可安全操作"
# 步骤1: 检查eMMC分区信息
info_msg "步骤1: 分析eMMC分区..."
parted -s ${EMMC_DEV} unit MB print
# 检查eMMC上的数据大小
info_msg "检查eMMC数据使用量..."
TEMP_MOUNT="/tmp/check_emmc"
mkdir -p "${TEMP_MOUNT}"
# 检查分区是否存在
[[ -b "${EMMC_DEV}p1" ]] || error_msg "未找到boot分区 ${EMMC_DEV}p1"
[[ -b "${EMMC_DEV}p2" ]] || error_msg "未找到root分区 ${EMMC_DEV}p2"
# 临时挂载检查使用量
mount ${EMMC_DEV}p1 "${TEMP_MOUNT}" -o ro
EMMC_BOOT_USED=$(df --block-size=1M "${TEMP_MOUNT}" | tail -1 | awk '{print $3}')
umount "${TEMP_MOUNT}"
mount ${EMMC_DEV}p2 "${TEMP_MOUNT}" -o ro
EMMC_ROOT_USED=$(df --block-size=1M "${TEMP_MOUNT}" | tail -1 | awk '{print $3}')
umount "${TEMP_MOUNT}"
rm -rf "${TEMP_MOUNT}"
TOTAL_USED=$((EMMC_BOOT_USED + EMMC_ROOT_USED))
info_msg "eMMC使用情况: Boot ${EMMC_BOOT_USED}MB + Root ${EMMC_ROOT_USED}MB = 总计 ${TOTAL_USED}MB"
MIN_TARGET_SIZE=$((TOTAL_USED + 1024)) # 需要1GB额外空间
info_msg "最小目标eMMC: ${MIN_TARGET_SIZE}MB (约$((MIN_TARGET_SIZE / 1024))GB)"
# 步骤2: 智能收缩eMMC分区
info_msg "步骤2: 智能收缩eMMC分区..."
# 记录原始分区信息
parted -s ${EMMC_DEV} unit s print > "${USB_DIR}/original_partition.txt"
P1_START=$(parted -s ${EMMC_DEV} unit s print | grep "^ 1" | awk '{print $2}' | sed 's/s$//')
P1_END=$(parted -s ${EMMC_DEV} unit s print | grep "^ 1" | awk '{print $3}' | sed 's/s$//')
P2_START=$(parted -s ${EMMC_DEV} unit s print | grep "^ 2" | awk '{print $2}' | sed 's/s$//')
ORIGINAL_P2_END=$(parted -s ${EMMC_DEV} unit s print | grep "^ 2" | awk '{print $3}' | sed 's/s$//')
info_msg "分区布局: P1=${P1_START}s-${P1_END}s, P2=${P2_START}s-${ORIGINAL_P2_END}s"
# 文件系统检查
e2fsck -f -y ${EMMC_DEV}p2
# 先尝试收缩到最小值
info_msg "计算文件系统最小大小..."
resize2fs -M ${EMMC_DEV}p2 2>&1 | tee /tmp/resize.log
# 获取收缩后的实际大小
FS_SIZE_BLOCKS=$(dumpe2fs -h ${EMMC_DEV}p2 2>/dev/null | grep "^Block count:" | awk '{print $3}')
BLOCK_SIZE=$(dumpe2fs -h ${EMMC_DEV}p2 2>/dev/null | grep "^Block size:" | awk '{print $3}')
# 添加默认值防止空值
[[ -z "$FS_SIZE_BLOCKS" ]] && FS_SIZE_BLOCKS=1048576 # 默认4GB worth of blocks
[[ -z "$BLOCK_SIZE" ]] && BLOCK_SIZE=4096 # 默认4K
FS_SIZE_MB=$(( (FS_SIZE_BLOCKS * BLOCK_SIZE) / 1048576 ))
info_msg "文件系统最小大小: ${FS_SIZE_MB}MB"
# 添加缓冲空间确保系统能正常运行
SHRINK_TARGET=$((FS_SIZE_MB + 512)) # 512MB缓冲
resize2fs ${EMMC_DEV}p2 ${SHRINK_TARGET}M
# 计算新的分区结束位置(扇区)
NEW_P2_END_SECTORS=$((P2_START + (SHRINK_TARGET * 1048576 / 512)))
# 重新创建收缩的分区
parted -s ${EMMC_DEV} rm 2
parted -s ${EMMC_DEV} unit s mkpart primary ext4 ${P2_START}s ${NEW_P2_END_SECTORS}s
partprobe ${EMMC_DEV}
sleep 2
info_msg "✅ eMMC分区已收缩到 ${SHRINK_TARGET}MB"
# 步骤3: 创建备份信息文件
info_msg "步骤3: 创建备份信息..."
cat > "${OUTPUT_FILE}.info" <<EOF
#!/bin/bash
# 备份信息文件 - 用于智能恢复
BACKUP_DATE="$(date)"
SOURCE_SIZE_GB=${ORIGINAL_SIZE_GB}
DATA_USED_MB=${TOTAL_USED}
MIN_TARGET_SIZE_MB=${MIN_TARGET_SIZE}
# 分区信息
P1_START=${P1_START}
P1_END=${P1_END}
P2_START=${P2_START}
P2_SHRUNK_END=${NEW_P2_END_SECTORS}
ORIGINAL_P2_END=${ORIGINAL_P2_END}
EOF
# 步骤4: 备份收缩后的eMMC
info_msg "步骤4: 备份收缩后的eMMC..."
# 确保包含完整的GPT备份表通常在磁盘末尾
# GPT需要首尾各34个扇区再加一些缓冲
BACKUP_SIZE_SECTORS=$((NEW_P2_END_SECTORS + 34 + 2048)) # 34扇区GPT + 1MB额外缓冲
BACKUP_SIZE_MB=$((BACKUP_SIZE_SECTORS * 512 / 1048576))
info_msg "备份大小: ${BACKUP_SIZE_MB}MB (原始: ${ORIGINAL_SIZE_GB}GB, 可恢复到: ≥${MIN_TARGET_SIZE}MB)"
dd if=${EMMC_DEV} of="${OUTPUT_FILE}" bs=512 count=${BACKUP_SIZE_SECTORS} status=progress
# 修复GPT备份表
info_msg "修复备份镜像的GPT表..."
sgdisk -e "${OUTPUT_FILE}" 2>/dev/null || true
info_msg "✅ eMMC备份完成"
# 步骤5: 恢复eMMC原始大小
info_msg "步骤5: 恢复eMMC原始分区大小..."
parted -s ${EMMC_DEV} rm 2
parted -s ${EMMC_DEV} unit s mkpart primary ext4 ${P2_START}s ${ORIGINAL_P2_END}s
partprobe ${EMMC_DEV}
sleep 2
resize2fs ${EMMC_DEV}p2
info_msg "✅ eMMC已恢复原始大小 ${ORIGINAL_SIZE_GB}GB"
# 验证备份镜像
info_msg "步骤6: 验证备份镜像..."
LOOP_DEV=$(losetup -P -f --show "${OUTPUT_FILE}")
sleep 3
if [[ -b "${LOOP_DEV}p1" ]] && [[ -b "${LOOP_DEV}p2" ]]; then
info_msg "✅ 备份镜像分区表完整"
parted -s "${LOOP_DEV}" print
# 检查文件系统
e2fsck -n "${LOOP_DEV}p1" && echo "✅ Boot分区文件系统正常"
e2fsck -n "${LOOP_DEV}p2" && echo "✅ Root分区文件系统正常"
else
warn_msg "❌ 备份镜像分区表有问题"
fi
losetup -d "${LOOP_DEV}"
FINAL_SIZE=$(du -h "${OUTPUT_FILE}" | cut -f1)
FINAL_SIZE_ACTUAL=$(du --apparent-size -h "${OUTPUT_FILE}" | cut -f1)
# 创建智能恢复脚本
RESTORE_SCRIPT="${USB_DIR}/restore_adaptive.sh"
cat > "${RESTORE_SCRIPT}" <<'RESTORE_EOF'
#!/bin/bash
# 自适应恢复脚本 - 支持不同大小的eMMC
set -e
IMAGE_FILE="$1"
TARGET_DEV="/dev/mmcblk0"
[[ -f "${IMAGE_FILE}" ]] || { echo "用法: $0 <镜像文件>"; exit 1; }
[[ -f "${IMAGE_FILE}.info" ]] || { echo "缺少信息文件"; exit 1; }
source "${IMAGE_FILE}.info"
echo "恢复镜像到eMMC"
echo "目标设备: ${TARGET_DEV}"
TARGET_SIZE=$(blockdev --getsize64 ${TARGET_DEV})
TARGET_SIZE_MB=$((TARGET_SIZE / 1048576))
echo "目标eMMC: $((TARGET_SIZE / 1073741824))GB"
if [[ ${TARGET_SIZE_MB} -lt ${MIN_TARGET_SIZE_MB} ]]; then
echo "错误: 目标eMMC太小需要至少 ${MIN_TARGET_SIZE_MB}MB"
exit 1
fi
echo "警告: 将清空 ${TARGET_DEV}!"
read -p "继续? (yes): " confirm
[[ "$confirm" == "yes" ]] || exit 1
echo "写入镜像..."
dd if="${IMAGE_FILE}" of=${TARGET_DEV} bs=4M status=progress
sync
partprobe ${TARGET_DEV}
sleep 3
# 扩展分区到最大
MAX_P2_END=$((TARGET_SIZE / 512 - 34))
parted -s ${TARGET_DEV} rm 2
parted -s ${TARGET_DEV} unit s mkpart primary ext4 ${P2_START}s ${MAX_P2_END}s
partprobe ${TARGET_DEV}
sleep 2
e2fsck -f -y ${TARGET_DEV}p2
resize2fs ${TARGET_DEV}p2
echo "✅ 恢复完成! 分区已扩展到最大空间"
RESTORE_EOF
chmod +x "${RESTORE_SCRIPT}"
info_msg "========================================="
info_msg "🎉 智能eMMC备份成功完成!"
info_msg "========================================="
info_msg "📁 备份文件: ${OUTPUT_FILE}"
info_msg "📏 备份大小: ${FINAL_SIZE}"
info_msg "📄 信息文件: ${OUTPUT_FILE}.info"
info_msg "🔧 恢复脚本: ${RESTORE_SCRIPT}"
info_msg ""
info_msg "源eMMC: ${ORIGINAL_SIZE_GB}GB"
info_msg "数据使用: ${TOTAL_USED}MB"
info_msg "最小目标: ${MIN_TARGET_SIZE}MB (约$((MIN_TARGET_SIZE / 1024))GB)"
info_msg ""
info_msg "🚀 恢复方法:"
info_msg " 1. 从SD卡启动目标设备"
info_msg " 2. 运行: bash ${RESTORE_SCRIPT} ${OUTPUT_FILE}"
info_msg ""
info_msg "✅ 支持恢复到任意大小eMMC (≥${MIN_TARGET_SIZE}MB)"
info_msg "✅ 自动扩展分区到最大可用空间"
info_msg "✅ 保持双分区结构不变"
info_msg "========================================="

View File

@ -1 +1 @@
http://xplayer-ota.pureroad.cn/files_20250824_161910.tar.xz
http://xplayer-ota.pureroad.cn/files_20251203_232832.tar.xz

View File

@ -1,12 +1,78 @@
- name: Configure Xplayer Server
hosts: localhost
become: yes
vars:
packages: "bluez \
mpc \
libasound2-dev \
libudev-dev \
libfmt-dev \
libfmt9 \
libchromaprint1 \
libupnp17 \
libnfs14 \
libavutil58 \
libavformat60 \
libavcodec60 \
libcdio-paranoia2 \
libcdio-cdda2 \
libcdio19 \
libmms0 \
libsoxr0 \
libid3tag0 \
libiso9660-11 \
libzzip-0-13 \
libao4 \
libjack-jackd2-0 \
libpipewire-0.3-0 \
libpulse0 \
libshout3 \
libsndio7.0 \
libopenal1 \
libavahi-common3 \
libavahi-client3 \
libadplug-2.3.3-0 \
libflac12 \
libfluidsynth3 \
libaudiofile1 \
libfaad2 \
libgme0 \
libmad0 \
libmikmod3 \
libmodplug1 \
libmpcdec6 \
libmpg123-0 \
libopus0 \
libsndfile1 \
libogg0 \
libvorbis0a \
libwavpack1 \
libwildmidi2 \
libvorbisenc2 \
libmp3lame0 \
libtwolame0 \
libshine3 \
net-tools \
libconfig9 \
avahi-daemon
libdbus-1-3 \
libglib2.0-0 \
libbluetooth3 \
libsbc1 \
libfdk-aac2 \
libldacbt-abr2 \
libldacbt-enc2 \
aria2 \
cloud-guest-utils"
tasks:
- name: update script
shell:
cmd: |
rm -rf /etc/apt/sources.list.d/jean-francois-dockes-ubuntu-upnpp1-noble.sources
/usr/bin/install_bluealsa_openaptx.sh
ignore_errors: yes
- name: switch mirror
copy:
src: ../files/sources.list.d/
@ -14,71 +80,73 @@
mode: '0644'
tags: apt
- name: install dependencies
apt:
name:
- bluez
- mpc
- libasound2-dev
- libudev-dev
- libfmt-dev
- libfmt9
- libchromaprint1
- libupnp17
- libnfs14
- libavutil58
- libavformat60
- libavcodec60
- libcdio-paranoia2
- libcdio-cdda2
- libcdio19
- libmms0
- libsoxr0
- libid3tag0
- libiso9660-11
- libzzip-0-13
- libao4
- libjack-jackd2-0
- libpipewire-0.3-0
- libpulse0
- libshout3
- libsndio7.0
- libopenal1
- libavahi-common3
- libavahi-client3
- libadplug-2.3.3-0
- libflac12
- libfluidsynth3
- libaudiofile1
- libfaad2
- libgme0
- libmad0
- libmikmod3
- libmodplug1
- libmpcdec6
- libmpg123-0
- libopus0
- libsndfile1
- libogg0
- libvorbis0a
- libwavpack1
- libwildmidi2
- libvorbisenc2
- libmp3lame0
- libtwolame0
- libshine3
- libmp3lame0
- libtwolame0
- net-tools
- libconfig9
- avahi-daemon
# - upmpdcli
state: present
cache_valid_time: 3153600 # 365天缓存
update_cache: no
become: yes
- name: check missing packages
shell:
cmd: |
MISSING=""
for pkg in {{ packages }}; do
# 先检查原包名
if dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q "install ok installed"; then
continue
# 如果原包名不存在,尝试检查带 t64 后缀的版本
elif dpkg-query -W -f='${Status}' "${pkg}t64" 2>/dev/null | grep -q "install ok installed"; then
continue
else
MISSING="yes"
break
fi
done
if [ -n "$MISSING" ]; then
echo "missing"
else
echo "all_installed"
fi
args:
executable: /bin/bash
register: package_check
changed_when: false
ignore_errors: yes
tags: apt
- name: update apt cache
shell:
cmd: |
if command -v apt-fast &> /dev/null; then
apt-fast update -y || apt-get update -y
else
apt-get update -y
fi
when: package_check.stdout == "missing"
ignore_errors: yes
tags: apt
- name: install dependencies
shell:
cmd: |
if command -v apt-fast &> /dev/null; then
apt-fast install -y {{ packages }} || apt-get install -y {{ packages }}
else
apt-get install -y {{ packages }}
fi
when: package_check.stdout == "missing"
ignore_errors: yes
tags: apt
- name: Create directories
file:
path: "{{ item.path }}"
state: directory
mode: "{{ item.mode | default('0755') }}"
recurse: yes
loop:
- path: /var/lib/mpd/playlists
- path: /var/lib/mpd/music
- path: /usr/local/lib/systemd/system
- path: /srv/login
- path: /usr/var/lib/bluealsa
- path: /srv/bluez-alsa
- name: Copy static files
copy:
src: "{{ item.src }}"
@ -109,17 +177,18 @@
- src: ../files/cpufrequtils
dest: /etc/default/cpufrequtils
mode: '0644'
- name: Create directories
file:
path: "{{ item.path }}"
state: directory
mode: "{{ item.mode | default('0755') }}"
loop:
- path: /var/lib/mpd/playlists
- path: /var/lib/mpd/music
- path: /usr/local/lib/systemd/system
- path: /srv/login
- src: ../files/led-startup.sh
dest: /usr/bin/led-startup.sh
mode: '0755'
- src: ../files/xplayer-start.sh
dest: /usr/local/bin/xplayer-start.sh
mode: '0755'
- src: ../files/apt-fast
dest: /usr/local/bin/apt-fast
mode: '0755'
- src: ../files/apt-fast.conf
dest: /etc/apt-fast.conf
mode: '0644'
- name: update mpd data
copy:
@ -166,6 +235,29 @@
register: copy_result
changed_when: copy_result.changed or (force_update | default(false) | bool)
- name: update bluealsa
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode | default('0644') }}"
loop:
- src: ../files/bluealsa.service
dest: /etc/systemd/system/bluealsa.service
- src: ../files/install_bluealsa_openaptx.sh
dest: /usr/bin/install_bluealsa_openaptx.sh
mode: '0755'
- src: ../files/bluealsa_bundle.tar.gz
dest: /srv/bluez-alsa/bluealsa_bundle.tar.gz
tags: bluealsa
notify:
- install_bluealsa_openaptx
- reload_systemd
- enable_bluealsa
- stop_bluealsa
- start_bluealsa
register: copy_result
changed_when: copy_result.changed or (force_update | default(false) | bool)
- name: update camilladsp
copy:
src: "{{ item.src }}"
@ -207,6 +299,7 @@
mode: '0755'
- src: ../files/99-usb-auto-mount.rules
dest: /etc/udev/rules.d/99-usb-auto-mount.rules
mode: '0644'
tags: usb
notify:
@ -375,6 +468,23 @@
shell:
cmd: systemctl restart sing-box
- name: install_bluealsa_openaptx
shell:
cmd: /usr/bin/install_bluealsa_openaptx.sh
- name: enable_bluealsa
shell:
cmd: systemctl enable bluealsa
- name: stop_bluealsa
shell:
cmd: systemctl stop bluealsa
- name: start_bluealsa
shell:
cmd: systemctl start bluealsa
- name: restart_bluealsa
shell:
cmd: systemctl restart bluealsa
- name: enable_xplayer_server
shell:
cmd: systemctl enable xplayer-server
@ -389,6 +499,7 @@
- name: reboot_required
shell:
cmd: echo "need reboot"
cmd: sync && reboot

71
sync.sh
View File

@ -1,36 +1,43 @@
mkdir -p files
rsync 5cl:/etc/ssh/sshd_config files/sshd_config
rsync 5cl:/root/.ssh/authorized_keys files/authorized_keys
rsync 5cl:/etc/asound.conf files/asound.conf
rsync 5cl:/usr/local/bin/camilladsp files/camilladsp
rsync 5cl:/etc/camilladsp.yml files/camilladsp.yml
# rsync -avz 5cl:/root/camilladsp-conf files/
rsync 5cl:/usr/local/lib/systemd/system/mpd.socket files/mpd.socket
rsync 5cl:/usr/local/lib/systemd/system/mpd.service files/mpd.service
rsync 5cl:/usr/local/bin/mpd files/mpd
rsync 5cl:/etc/mpd.conf files/mpd.conf
rsync 5cl:/etc/systemd/system/xplayer-server.service files/xplayer-server.service
rsync 5cl:/usr/local/bin/server files/server
rsync 5cl:/usr/bin/ota files/ota
rsync -avz 5cl:/etc/apt/sources.list.d ./files/
rsync 5cl:/etc/modules files/modules
rsync 5cl:/etc/modprobe.d/snd-aloop.conf files/snd-aloop.conf
rsync 5cl:/etc/systemd/system/camilladsp.service files/camilladsp.service
rsync 5cl:/usr/lib/systemd/system/bluetooth.service files/bluetooth.service
rsync 5cl:/etc/udev/rules.d/99-usb-auto-mount.rules files/99-usb-auto-mount.rules
rsync 5cl:/usr/local/bin/usb-mount.sh files/usb-mount.sh
rsync 5cl:/etc/custom_service/start_service.sh files/start_service.sh
rsync 5cl:/etc/bluetooth/input.conf files/input.conf
rsync 5cl:/etc/bluetooth/main.conf files/main.conf
rsync 5cl:/etc/default/cpufrequtils files/cpufrequtils
rsync 5cl:/usr/lib/systemd/system/shairport-sync.service files/shairport-sync.service
rsync 5cl:/usr/local/bin/shairport-sync files/shairport-sync
rsync 5cl:/etc/shairport-sync.conf files/shairport-sync.conf
rsync 5cl:/usr/bin/shairport_monitor.sh files/shairport_monitor.sh
# rsync 5cl:/etc/upmpdcli.conf files/upmpdcli.conf
rsync 5cl:/usr/bin/sing-box files/sing-box
rsync 5cl:/etc/systemd/system/sing-box.service files/sing-box.service
rsync -avz --exclude='login/' 5cl:/srv/login/ files/login/
rsync 5c:/etc/ssh/sshd_config files/sshd_config
rsync 5c:/root/.ssh/authorized_keys files/authorized_keys
rsync 5c:/etc/asound.conf files/asound.conf
rsync 5c:/usr/local/bin/camilladsp files/camilladsp
rsync 5c:/etc/camilladsp.yml files/camilladsp.yml
# rsync -avz 5c:/root/camilladsp-conf files/
rsync 5c:/usr/local/lib/systemd/system/mpd.socket files/mpd.socket
rsync 5c:/usr/local/lib/systemd/system/mpd.service files/mpd.service
rsync 5c:/usr/local/bin/mpd files/mpd
rsync 5c:/etc/mpd.conf files/mpd.conf
rsync 5c:/etc/systemd/system/xplayer-server.service files/xplayer-server.service
rsync 5c:/usr/local/bin/server files/server
rsync 5c:/usr/bin/ota files/ota
rsync -avz 5c:/etc/apt/sources.list.d ./files/
rsync 5c:/etc/modules files/modules
rsync 5c:/etc/modprobe.d/snd-aloop.conf files/snd-aloop.conf
rsync 5c:/etc/systemd/system/camilladsp.service files/camilladsp.service
rsync 5c:/usr/lib/systemd/system/bluetooth.service files/bluetooth.service
rsync 5c:/etc/udev/rules.d/99-usb-auto-mount.rules files/99-usb-auto-mount.rules
rsync 5c:/usr/local/bin/usb-mount.sh files/usb-mount.sh
rsync 5c:/etc/custom_service/start_service.sh files/start_service.sh
rsync 5c:/etc/bluetooth/input.conf files/input.conf
rsync 5c:/etc/bluetooth/main.conf files/main.conf
rsync 5c:/etc/default/cpufrequtils files/cpufrequtils
rsync 5c:/usr/lib/systemd/system/shairport-sync.service files/shairport-sync.service
rsync 5c:/usr/local/bin/shairport-sync files/shairport-sync
rsync 5c:/etc/shairport-sync.conf files/shairport-sync.conf
rsync 5c:/usr/bin/shairport_monitor.sh files/shairport_monitor.sh
# rsync 5c:/etc/upmpdcli.conf files/upmpdcli.conf
rsync 5c:/usr/bin/sing-box files/sing-box
rsync 5c:/etc/systemd/system/sing-box.service files/sing-box.service
rsync -avz --exclude='login/' 5c:/srv/login/ files/login/
rsync 5c:/usr/bin/led-startup.sh files/led-startup.sh
rsync 5c:/usr/local/bin/xplayer-start.sh files/xplayer-start.sh
rsync 5c:/usr/bin/install_bluealsa_openaptx.sh files/install_bluealsa_openaptx.sh
rsync 5c:/etc/systemd/system/bluealsa.service files/bluealsa.service
rsync 5c:/srv/bluez-alsa/bluealsa_bundle.tar.gz files/bluealsa_bundle.tar.gz
rsync 5c:/usr/local/bin/apt-fast files/apt-fast
rsync 5c:/etc/apt-fast.conf files/apt-fast.conf
# Clean up macOS resource fork files
find files -name "._*" -type f -delete