From 58ace97a4e021da225207057aa65e9bf00685119 Mon Sep 17 00:00:00 2001 From: Roman Artiukhin Date: Wed, 21 Jan 2026 21:15:44 +0200 Subject: [PATCH] hiby: r1_patcher: embed hiby_player.sh Make it a single-file, self-contained script. Change-Id: Idb3e375f1f9774c9328288765c7d1c7c1e01e2d3 --- tools/r1_patcher/hiby_player.sh | 10 ---------- tools/r1_patcher/r1_patcher.sh | 20 ++++++++++++++++---- 2 files changed, 16 insertions(+), 14 deletions(-) delete mode 100755 tools/r1_patcher/hiby_player.sh diff --git a/tools/r1_patcher/hiby_player.sh b/tools/r1_patcher/hiby_player.sh deleted file mode 100755 index 70aaf2c33b..0000000000 --- a/tools/r1_patcher/hiby_player.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -killall hiby_player &>/dev/null -killall -9 hiby_player &>/dev/null - -killall bootloader.rb &>/dev/null -killall -9 bootloader.rb &>/dev/null - -/usr/bin/bootloader.rb -sleep 1s \ No newline at end of file diff --git a/tools/r1_patcher/r1_patcher.sh b/tools/r1_patcher/r1_patcher.sh index 43a87c3d58..7d1653310e 100755 --- a/tools/r1_patcher/r1_patcher.sh +++ b/tools/r1_patcher/r1_patcher.sh @@ -51,11 +51,23 @@ unsquashfs -f -d "$workingdir_in/rootfs/extracted" "$workingdir_in/rootfs/rootfs ################################################################################ # copy 'bootloader' -cp "$2" "$workingdir_in/rootfs/extracted/usr/bin/bootloader.rb" -chmod 0755 "$workingdir_in/rootfs/extracted/usr/bin/bootloader.rb" +bootloader_file="bootloader.rb" +cp "$2" "$workingdir_in/rootfs/extracted/usr/bin/$bootloader_file" +chmod 0755 "$workingdir_in/rootfs/extracted/usr/bin/$bootloader_file" -# copy modified 'hibyplayer.sh' script -cp hiby_player.sh "$workingdir_in/rootfs/extracted/usr/bin/" +# create modified 'hiby_player.sh' script +cat << EOF > "$workingdir_in/rootfs/extracted/usr/bin/hiby_player.sh" +#!/bin/sh + +killall hiby_player &>/dev/null +killall -9 hiby_player &>/dev/null + +killall $bootloader_file &>/dev/null +killall -9 $bootloader_file &>/dev/null + +/usr/bin/$bootloader_file +sleep 1s +EOF chmod 0755 "$workingdir_in/rootfs/extracted/usr/bin/hiby_player.sh" ################################################################################