diff --git a/start.sh b/start.sh index 8d0180d..5f22cf7 100644 --- a/start.sh +++ b/start.sh @@ -13,13 +13,18 @@ echo " 888 " echo " Y8b d88P " echo " \`Y88P\` " echo "Software-based jailbreak for IvyBridge (xx30) series ThinkPads" -echo "Revision 1" +echo "Revision 2" + +# Give the network time to come online +echo -e "\e[1;32mWaiting for Network...\e[0m" +sleep 5 # update script if networked -if [[ $updated != "true" ]] && ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then +if [[ $updated != "r2" ]] && ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then rm /home/ivy/start.sh wget -q https://raw.githubusercontent.com/n4ru/1vyrain/master/start.sh -O /home/ivy/start.sh - export updated="true" + export updated="r2" + echo 'export updated=r2' >> /home/ivy/.bashrc bash /home/ivy/start.sh exit 1 fi @@ -109,7 +114,7 @@ read -p "Press Enter key to begin flashing your jailbroken BIOS! Do NOT let the # backup BIOS first each time echo -e "\e[1;32mBacking up existing BIOS...\e[0m" rm /home/ivy/bios/backup.rom &> /dev/null -/home/ivy/flashrom/flashrom -p internal -r /home/ivy/bios/backup_12.rom --ifd -i bios -N +/home/ivy/flashrom/flashrom -p internal:laptop=force_I_want_a_brick -r /home/ivy/bios/backup_12.rom --ifd -i bios -N dd if=/home/ivy/bios/backup_12.rom of=/home/ivy/bios/backup.rom bs=1M skip=8 rm /home/ivy/bios/backup_12.rom &> /dev/null @@ -117,15 +122,16 @@ echo -e "\e[1;32mFlashing BIOS...\e[0m" # pad the BIOS to 12MB before flashing dd if=/dev/zero of=/home/ivy/bios/8MB bs=1M count=8 -cat /home/ivy/bios/8MB /home/ivy/bios/$machine.rom > /home/ivy/bios/$machine.temp +cat /home/ivy/bios/8MB /home/ivy/bios/$machine.rom > /home/ivy/bios/rom.temp + # delete custom and temporary backup rm /home/ivy/bios/custom.rom &> /dev/null rm /home/ivy/bios/backuptemp.rom &> /dev/null -/home/ivy/flashrom/flashrom -p internal -w /home/ivy/bios/$machine.temp --ifd -i bios -N +/home/ivy/flashrom/flashrom -p internal:laptop=force_I_want_a_brick -w /home/ivy/bios/rom.temp --ifd -i bios -N -rm /home/ivy/bios/$machine.temp +rm /home/ivy/bios/rom.temp -read -p "All done! Press Enter key to restart your ThinkPad!" +read -p "All done! Press Enter key to restart your ThinkPad or CTRL+C to exit to shell." reboot NOW \ No newline at end of file diff --git a/tools/patcher/README.md b/tools/patcher/README.md new file mode 100644 index 0000000..a0334d3 --- /dev/null +++ b/tools/patcher/README.md @@ -0,0 +1,16 @@ +
+8888888 888     888 8888888b.          888            888                       
+  888   888     888 888   Y88b         888            888                       
+  888   888     888 888    888         888            888                       
+  888   Y88b   d88P 888   d88P 8888b.  888888 .d8888b 88888b.   .d88b.  888d888 
+  888    Y88b d88P  8888888P"     "88b 888   d88P"    888 "88b d8P  Y8b 888P"   
+  888     Y88o88P   888       .d888888 888   888      888  888 88888888 888     
+  888      Y888P    888       888  888 Y88b. Y88b.    888  888 Y8b.     888     
+8888888     Y8P     888       "Y888888  "Y888 "Y8888P 888  888  "Y8888  888     
+
+ +Patch Lenovo stock .FL1 BIOS update files to be [1vyrain](https://github.com/n4ru/1vyrain) ready. + +## Usage + +Drop in any `FL1` BIOS update file (you can find them in Lenovo update ISOs or Windows executables once extracted) and run `patch.sh`. The resulting `patched.rom` is safe to upload and flash with 1vyrain. \ No newline at end of file diff --git a/tools/patcher/patch.sh b/tools/patcher/patch.sh new file mode 100644 index 0000000..47517dc --- /dev/null +++ b/tools/patcher/patch.sh @@ -0,0 +1,14 @@ +#mv *.FL1 BIOS.FL1 +#dd if=BIOS.FL1 bs=1 of=BIOS.rom skip=464 count=4194304 + +printf "32442D09-1D11-4E27-8AAB-90FE6ACB0489 10 O:02A0:778B1D826D24964E8E103467D56AB1BA \nF7731B4C-58A2-4DF4-8980-5645D39ECE58 10 P:44243080fb0175080fbae80f89442430:44243080fb01eb080fbae80f89442430 \nF7731B4C-58A2-4DF4-8980-5645D39ECE58 10 P:30488b4338f6000874080fba6c243014:30488b4338f60008eb080fba6c243014 \n" > patches.txt + +if grep -q "GCET" *.FL1; then + printf "79E0EDD7-9D1D-4F41-AE1A-F896169E5216 10 P:41390C240F84:41390C2490E9 \n79E0EDD7-9D1D-4F41-AE1A-F896169E5216 10 P:41390C240F858D:41390C240F8500 \n79E0EDD7-9D1D-4F41-AE1A-F896169E5216 10 P:41394C24047577:41394C24047500 \n79E0EDD7-9D1D-4F41-AE1A-F896169E5216 10 P:413AED0F8497FEFFFF:413AED0F8400000000 " >> patches.txt +else + printf "79E0EDD7-9D1D-4F41-AE1A-F896169E5216 10 P:C8390F0F84:C8390F90E9 \n79E0EDD7-9D1D-4F41-AE1A-F896169E5216 10 P:C8390F7516:C8390F7500 \n79E0EDD7-9D1D-4F41-AE1A-F896169E5216 10 P:C8394F0474:C8394F04EB" >> patches.txt +fi + +./patcher ./BIOS.rom ./patches.txt -o ./patched.rom + +echo "Patched BIOS saved as patched.rom" \ No newline at end of file diff --git a/tools/patcher/patcher b/tools/patcher/patcher new file mode 100644 index 0000000..a8b2169 Binary files /dev/null and b/tools/patcher/patcher differ