mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-01-22 01:30:35 -05:00
hiby: r1_patcher: fix possible boot hang and flash failures
- Sort image parts for deterministic results. - Ensure bootloader.r1 is correctly named and has +x permissions. Change-Id: I391c935d75e5079010fc91d3614d9221d34e4c6b
This commit is contained in:
parent
7bc856046b
commit
b25f59a98a
1 changed files with 17 additions and 16 deletions
|
|
@ -1,5 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Prerequisites:
|
||||
#sudo apt update && sudo apt install -y p7zip-full squashfs-tools genisoimage coreutils
|
||||
|
||||
if [[ $# -ne 2 ]]; then
|
||||
echo 'usage: ./r1_patcher.sh r1.upt bootloader.r1' >&2
|
||||
exit 1
|
||||
|
|
@ -48,7 +51,8 @@ unsquashfs -f -d $workingdir_in/rootfs/extracted $workingdir_in/rootfs/rootfs.sq
|
|||
################################################################################
|
||||
|
||||
# copy 'bootloader'
|
||||
cp $2 $workingdir_in/rootfs/extracted/usr/bin/
|
||||
cp "$2" "$workingdir_in/rootfs/extracted/usr/bin/bootloader.r1"
|
||||
chmod 0755 "$workingdir_in/rootfs/extracted/usr/bin/bootloader.r1"
|
||||
|
||||
# copy modified 'hibyplayer.sh' script
|
||||
cp hiby_player.sh $workingdir_in/rootfs/extracted/usr/bin/
|
||||
|
|
@ -58,10 +62,9 @@ chmod 0755 $workingdir_in/rootfs/extracted/usr/bin/hiby_player.sh
|
|||
### rebuild
|
||||
################################################################################
|
||||
|
||||
mkdir "$workingdir_out/image_contents"
|
||||
mkdir "$workingdir_out/image_contents/ota_v0"
|
||||
mkdir -p "$workingdir_out/image_contents/ota_v0"
|
||||
|
||||
mksquashfs $workingdir_in/rootfs/extracted $workingdir_out/rootfs.squashfs -comp lzo
|
||||
mksquashfs $workingdir_in/rootfs/extracted $workingdir_out/rootfs.squashfs -comp lzo -all-root
|
||||
|
||||
cd "$workingdir_out/image_contents/ota_v0"
|
||||
|
||||
|
|
@ -74,12 +77,11 @@ md5=$rootfs_md5
|
|||
|
||||
ota_md5_rootfs="ota_md5_rootfs.squashfs.$md5"
|
||||
|
||||
parts=`find . -name 'rootfs.squashfs.*'`
|
||||
for part in $parts; do
|
||||
md5next=($(md5sum $part))
|
||||
echo $md5next >> $ota_md5_rootfs
|
||||
mv $part "$part.$md5"
|
||||
md5=$md5next
|
||||
for part in $(ls rootfs.squashfs.[0-9]* | sort); do
|
||||
md5next=($(md5sum $part))
|
||||
echo $md5next >> $ota_md5_rootfs
|
||||
mv $part "$part.$md5"
|
||||
md5=$md5next
|
||||
done
|
||||
|
||||
# xImage
|
||||
|
|
@ -91,12 +93,11 @@ md5=$ximage_md5
|
|||
|
||||
ota_md5_xImage="ota_md5_xImage.$md5"
|
||||
|
||||
parts=`find . -name 'xImage.*'`
|
||||
for part in $parts; do
|
||||
md5next=($(md5sum $part))
|
||||
echo $md5next >> $ota_md5_xImage
|
||||
mv $part "$part.$md5"
|
||||
md5=$md5next
|
||||
for part in $(ls xImage.[0-9]* | sort); do
|
||||
md5next=($(md5sum $part))
|
||||
echo $md5next >> $ota_md5_xImage
|
||||
mv $part "$part.$md5"
|
||||
md5=$md5next
|
||||
done
|
||||
|
||||
# ota_update.in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue