Command to reproduce:
grep -L '^maintainer="[^"]\+"$' device/{main,community,testing,downstream}/*/APKBUILD | sed 's/\/APKBUILD//' | xargs -i sh -c 'sed -i "1s;^;# Archived: unmaintained\n;" {}/APKBUILD && mv {} device/archived/ && git add {} && git add device/archived/'
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8883>
13 lines
496 B
Bash
13 lines
496 B
Bash
#!/bin/sh
|
|
|
|
echo "==> Amending boot.img for Amazon signature verification exploit"
|
|
BOWSER_HEADER_DATA='\x50\x03\x00\x00\x00\x25\xe4\x00'
|
|
BOWSER_HEADER_SIZE=1024
|
|
BOWSER_HEADER_OFFSET=52
|
|
tempfile=$(mktemp)
|
|
bootimgfile=$(echo "${1}" | sed 's/initramfs/boot.img/g')
|
|
dd if=/dev/zero of="${tempfile}" bs=$BOWSER_HEADER_SIZE count=1
|
|
printf "%b" $BOWSER_HEADER_DATA | dd of="${tempfile}" bs=$BOWSER_HEADER_OFFSET seek=1 conv=notrunc
|
|
cat "${bootimgfile}" >> "${tempfile}"
|
|
mv "${tempfile}" "${bootimgfile}"
|