Skip to content

Commit c8c2d6f

Browse files
Add jellyfin-ffmpeg release constraints and ip-wrapper for easepi-r2 (#9942)
* Add jellyfin-ffmpeg release constraints and ip-wrapper for easepi-r2 * Update config/boards/easepi-r2.conf Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent b036378 commit c8c2d6f

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

config/boards/easepi-a2.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function post_family_tweaks_bsp__easepi_a2_install_eth_files() {
181181
}
182182

183183
function custom_apt_repo__add_jellyfin-ffmpeg-repo() {
184-
[[ "${CUSTOM_REPO_WHEN}" = "image-early" && "${BRANCH}" == "vendor" ]] || return 0
184+
[[ "${CUSTOM_REPO_WHEN}" = "image-early" && "${BRANCH}" == "vendor" && "${RELEASE}" =~ ^(bookworm|trixie|jammy|noble)$ ]] || return 0
185185
display_alert "Preparing jellyfin ffmpeg repository..." "EasePi-A2" "info"
186186

187187
local keyring_url repo_url
@@ -199,7 +199,7 @@ function custom_apt_repo__add_jellyfin-ffmpeg-repo() {
199199
}
200200

201201
function extension_prepare_config__prepare_jellyfin-ffmpeg_config() {
202-
[[ "${BRANCH}" == "vendor" ]] || return 0
202+
[[ "${BRANCH}" == "vendor" && "${RELEASE}" =~ ^(bookworm|trixie|jammy|noble)$ ]] || return 0
203203
display_alert "Preparing jellyfin ffmpeg packages..." "EasePi-A2" "info"
204204

205205
local FFMPEG_PACKAGE=jellyfin-ffmpeg7
@@ -208,7 +208,7 @@ function extension_prepare_config__prepare_jellyfin-ffmpeg_config() {
208208
}
209209

210210
function pre_customize_image__jellyfin_ffmpeg_link() {
211-
[[ "${BRANCH}" == "vendor" ]] || return 0
211+
[[ "${BRANCH}" == "vendor" && "${RELEASE}" =~ ^(bookworm|trixie|jammy|noble)$ ]] || return 0
212212
display_alert "Create link to jellyfin-ffmpeg binaries..." "EasePi-A2" "info"
213213

214214
local p

config/boards/easepi-r2.conf

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,25 @@ function post_family_tweaks_bsp__easepi_r2_install_eth_files() {
119119
"${destination}/etc/eth_order"
120120
install -D -m 0644 "${SRC}/packages/bsp/easepi/easepi-r2/71-net.rules" \
121121
"${destination}/etc/udev/rules.d/71-net.rules"
122+
123+
# Install ip-wrapper for sorted interface display
124+
display_alert "EasePi-R2" "Installing ip-wrapper for sorted interface display" "info"
125+
# Install ip-easy wrapper script
126+
install -D -m 0755 /dev/null "${destination}/usr/local/bin/ip-easy"
127+
cat <<- 'EOF' > "${destination}/usr/local/bin/ip-easy"
128+
#!/bin/bash
129+
if [[ "$#" -eq 1 && ( "$1" == "addr" || "$1" == "link" ) ]]; then
130+
interfaces=$(ip -o link show | awk -F': ' '{print $2}' | sort)
131+
for iface in $interfaces; do ip "$@" show dev "$iface"; done
132+
else
133+
/sbin/ip "$@"
134+
fi
135+
EOF
136+
# Install profile.d alias
137+
install -D -m 0644 /dev/null "${destination}/etc/profile.d/ip-sorted.sh"
138+
cat <<- 'EOF' > "${destination}/etc/profile.d/ip-sorted.sh"
139+
alias ip="ip-easy"
140+
EOF
122141
}
123142

124143
function post_customize_image__enable_easepi_r2_eth_service() {
@@ -127,7 +146,7 @@ function post_customize_image__enable_easepi_r2_eth_service() {
127146

128147
# ==================== Jellyfin-FFmpeg Module ====================
129148
function custom_apt_repo__add_jellyfin-ffmpeg-repo() {
130-
[[ "${CUSTOM_REPO_WHEN}" = "image-early" && "${BRANCH}" == "vendor" ]] || return 0
149+
[[ "${CUSTOM_REPO_WHEN}" = "image-early" && "${BRANCH}" == "vendor" && "${RELEASE}" =~ ^(bookworm|trixie|jammy|noble)$ ]] || return 0
131150
display_alert "Preparing jellyfin ffmpeg repository..." "EasePi-R2" "info"
132151

133152
local keyring_url repo_url
@@ -145,7 +164,7 @@ function custom_apt_repo__add_jellyfin-ffmpeg-repo() {
145164
}
146165

147166
function extension_prepare_config__prepare_jellyfin-ffmpeg_config() {
148-
[[ "${BRANCH}" == "vendor" ]] || return 0
167+
[[ "${BRANCH}" == "vendor" && "${RELEASE}" =~ ^(bookworm|trixie|jammy|noble)$ ]] || return 0
149168
display_alert "Preparing jellyfin ffmpeg packages..." "EasePi-R2" "info"
150169

151170
local FFMPEG_PACKAGE=jellyfin-ffmpeg7
@@ -154,7 +173,7 @@ function extension_prepare_config__prepare_jellyfin-ffmpeg_config() {
154173
}
155174

156175
function pre_customize_image__jellyfin_ffmpeg_link() {
157-
[[ "${BRANCH}" == "vendor" ]] || return 0
176+
[[ "${BRANCH}" == "vendor" && "${RELEASE}" =~ ^(bookworm|trixie|jammy|noble)$ ]] || return 0
158177
display_alert "Create link to jellyfin-ffmpeg binaries..." "EasePi-R2" "info"
159178

160179
local p

0 commit comments

Comments
 (0)