-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from NiLuJe/master
Parse KindleTool devices in shell
- Loading branch information
Showing
12 changed files
with
65 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,37 @@ | ||
#!/bin/sh -e | ||
|
||
rm -rf build | ||
echo "extracting and mounting fw" | ||
echo "* extracting and mounting fw" | ||
./utils/extractAndMountFw.sh &> /dev/null | ||
echo "extracting uks.sqsh from official firmware" | ||
echo "* extracting uks.sqsh from official firmware" | ||
./utils/extractUksFromFirmware.sh &> /dev/null | ||
echo "patching uks.sqsh with the sexy pubdevkey01.pem" | ||
echo "* patching uks.sqsh with the sexy pubdevkey01.pem" | ||
./utils/patchUksSqsh.sh &> /dev/null | ||
echo "extracting hotfix" | ||
./utils/extractHotfix.sh &> /dev/null | ||
echo "* extracting hotfix" | ||
./utils/extractHotfix.sh | ||
rm -rf newHotfix | ||
mkdir newHotfix | ||
# echo "moving patched uks to the new hotfix" | ||
# cp patchedUks.sqsh newHotfix | ||
# echo "patching bridge in the new hotfix" # we don't need to patch it anymore | ||
# $(patch originalHotfix/bridge < utils/bridge.patch) &> /dev/null | ||
# $(patch originalHotfix/install-bridge.sh < utils/install-bridge.sh.patch) &> /dev/null | ||
# patch originalHotfix/bridge < utils/bridge.patch &> /dev/null | ||
# patch originalHotfix/install-bridge.sh < utils/install-bridge.sh.patch &> /dev/null | ||
mv originalHotfix/* newHotfix | ||
mkdir build | ||
rm -rf originalHotfix | ||
echo "building the new hotfix for the devices specified in the official firmware" | ||
python ./utils/buildHotfixForAllLangs.py $1 &> /dev/null | ||
echo "* building the new hotfix for the devices specified in the official firmware" | ||
python ./utils/buildHotfixForAllLangs.py "$1" | ||
./utils/unmountAndDeleteFw.sh | ||
rm -rf newHotfix | ||
echo "moving patched uks to LanguageBreak directory" | ||
cp LanguageBreak build/ -r | ||
echo "* moving patched uks to LanguageBreak directory" | ||
cp -r LanguageBreak build/ | ||
cp README.MD build/ | ||
cp patchedUks.sqsh build/LanguageBreak | ||
rm -rf patchedUks.sqsh | ||
echo "done language break generated for:" | ||
cat build/DEVICES.txt | ||
echo "* done. language break generated for:" | ||
cat build/DEVICES.txt | ||
cd build | ||
tar -czf ../LanguageBreak.tar.gz . | ||
cd .. | ||
rm -rf build/* | ||
mv LanguageBreak.tar.gz build/ | ||
mv LanguageBreak.tar.gz build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
#!/bin/sh | ||
|
||
# Fall back to the bundled KindleTool if there aren't any in PATH | ||
KINDLETOOL="$(command -v kindletool)" | ||
KINDLETOOL="${KINDLETOOL:-${PWD}/utils/kindletool}" | ||
|
||
# Build for unknown devices in create, and print raw device codes in convert | ||
export KT_WITH_UNKNOWN_DEVCODES="1" | ||
|
||
if [ "$1" = "universal" ] ; then | ||
DEVICES=$(echo "ALL" | python utils/parseKindleToolDevices.py) | ||
DEVICE_LIST="kindle5" | ||
echo "All the things!" > build/DEVICES.txt | ||
else | ||
DEVICES=$(./utils/kindletool convert update_kindle*.bin --info -k 2>&1 | python utils/parseKindleToolDevices.py) | ||
DEVICE_LIST="$(${KINDLETOOL} convert -i update_kindle*.bin 2>&1 | grep -o "^Device .*" | grep -o "0x[[:xdigit:]]*" | tr "\n" " ")" | ||
${KINDLETOOL} convert -i update_kindle*.bin 2>&1 | grep -o "^Device .*" | sed "s/^Device[[:blank:]]*//" > build/DEVICES.txt | ||
fi | ||
echo $DEVICES | ||
echo "* Building for ${DEVICE_LIST}" | ||
DEVICES="" | ||
for dev in ${DEVICE_LIST} ; do | ||
DEVICES="${DEVICES}-d ${dev} " | ||
done | ||
|
||
cd newHotfix | ||
export KT_WITH_UNKNOWN_DEVCODES=1 | ||
../utils/kindletool create ota2 $DEVICES -b FC04 -O . ../build/update_hotfix_languagebreak-$2.bin | ||
${KINDLETOOL} create ota2 ${DEVICES} -b FC04 -O -C . "../build/Update_hotfix_languagebreak-${2}.bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
#!/bin/sh | ||
|
||
# Fall back to the bundled KindleTool if there aren't any in PATH | ||
KINDLETOOL="$(command -v kindletool)" | ||
KINDLETOOL="${KINDLETOOL:-${PWD}/utils/kindletool}" | ||
|
||
rm -rf officialFirmware | ||
./utils/kindletool extract update_kindle*.bin officialFirmware | ||
${KINDLETOOL} extract update_kindle*.bin officialFirmware | ||
gunzip officialFirmware/*rootfs*.img.gz | ||
mkdir mnt | ||
sudo mount -o loop officialFirmware/*rootfs*.img mnt | ||
sudo mount -o loop officialFirmware/*rootfs*.img mnt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
#!/bin/sh | ||
|
||
# Fall back to the bundled KindleTool if there aren't any in PATH | ||
KINDLETOOL="$(command -v kindletool)" | ||
KINDLETOOL="${KINDLETOOL:-${PWD}/utils/kindletool}" | ||
|
||
rm -rf originalHotfix | ||
./utils/kindletool extract *hotfix*.bin originalHotfix | ||
rm -rf originalHotfix/*.sig originalHotfix/update-filelist.* | ||
${KINDLETOOL} extract [Uu]pdate_*hotfix*.bin originalHotfix | ||
rm -rfv originalHotfix/*.sig originalHotfix/update-filelist.dat* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
cp mnt/etc/uks.sqsh . | ||
#!/bin/sh | ||
|
||
cp mnt/etc/uks.sqsh . |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/bin/sh | ||
|
||
sudo umount mnt | ||
rm -rf mnt | ||
rm -rf officialFirmware | ||
rm -rf officialFirmware |