Add files via upload

This commit is contained in:
Ulf D. 2025-06-15 13:32:15 +02:00 committed by GitHub
parent 0335e2bdcd
commit 67cfd4b590
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 2596 additions and 0 deletions

View file

@ -0,0 +1 @@
Place .bin, .zip, .swu firmwares in this folder.

View file

@ -0,0 +1,70 @@
#!/usr/bin/env python3
from Crypto.Cipher import AES
import os
import sys, getopt
def remove_padding(file_path):
with open(file_path, 'rb+') as file:
file.seek(-1, os.SEEK_END)
padding_value = ord(file.read(1))
file.seek(-padding_value, os.SEEK_END)
file.truncate()
def decrypt_aes_cbc(input_file, output_file, first_aes_key, second_aes_key, offset=32):
block_size = 16
# Convert hex keys to bytes
first_aes_key_bytes = bytes.fromhex(first_aes_key)
# Read IV from the second AES key
iv = bytes.fromhex(second_aes_key[:32])
# Create AES cipher objects
cipher = AES.new(first_aes_key_bytes, AES.MODE_CBC, iv)
with open(input_file, 'rb') as file_input:
# Seek to the specified offset
file_input.seek(offset)
with open(output_file, 'wb') as file_output:
while True:
ciphertext = file_input.read(block_size)
if not ciphertext:
break
# Decrypt the block
plaintext = cipher.decrypt(ciphertext)
file_output.write(plaintext)
# Remove padding
remove_padding(output_file)
def main(argv):
input_file_path = ''
output_file_path = ''
try:
opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
except getopt.GetoptError:
print ('ack2_swu_decrypt.py -i update.bin -o update.zip')
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print ('ack2_swu_decrypt.py -i update.bin -o update.zip')
sys.exit()
elif opt in ("-i", "--ifile"):
input_file_path = arg
elif opt in ("-o", "--ofile"):
output_file_path = arg
print ('AnyCubic Kobra 2 BIN to SWU Converter V1.0')
print ('Input file: ', input_file_path)
print ('Output file: ', output_file_path)
first_aes_key_hex = "78B6A614B6B6E361DC84D705B7FDDA33C967DDF2970A689F8156F78EFE0B1FCE"
second_aes_key_hex = "54E37626B9A699403064111F77858049"
offset_value = 32 # Provide the offset value if needed
print ('Processing...')
decrypt_aes_cbc(input_file_path, output_file_path, first_aes_key_hex, second_aes_key_hex, offset_value)
print ('Done!')
main(sys.argv[1:])

View file

@ -0,0 +1,123 @@
#!/usr/bin/env python3
from Crypto.Cipher import AES
import hashlib
import os
import sys, getopt
def encrypt_aes_cbc(input_file, output_file, first_aes_key, second_aes_key, offset, input_model, input_version):
try:
block_size = 16
output_file_tmp = output_file + ".tmp"
# Convert hex keys to bytes
first_aes_key_bytes = bytes.fromhex(first_aes_key)
# Read IV from the second AES key
iv = bytes.fromhex(second_aes_key[:32])
# Create AES cipher objects
cipher = AES.new(first_aes_key_bytes, AES.MODE_CBC, iv)
md5_lib = hashlib.md5()
file_size = os.path.getsize(input_file)
last_size = file_size % 16
if last_size == 0:
file_size_ext = file_size
else:
file_size_ext = ((file_size // 16) * 16) + 16
with open(input_file, 'rb') as file_input:
with open(output_file_tmp, 'wb') as file_output:
header=bytearray(b'\x00' * offset)
header[0]=0x14
header[1]=0x17
header[2]=0x0B
header[3]=0x17
version=str(input_version).split('.')
header[4]=int(version[0])
header[5]=int(version[1])
header[6]=int(version[2])
header[12]=file_size_ext % 256
header[13]=(file_size_ext // 256) % 256
header[14]=(file_size_ext // 65536) % 256
header[15]=file_size_ext // 16777216
if input_model=='K2Plus':
header[7]=1
if input_model=='K2Max':
header[7]=2
file_output.write(header)
while True:
plaintext = file_input.read(block_size)
if not plaintext:
break
if len(plaintext)<block_size:
plaintext=bytearray(plaintext)
sz=len(plaintext)
if plaintext[-1]!=0:
plaintext.extend(b'\x00' * (block_size - sz))
else:
plaintext.extend(b'\x0B' * (block_size - sz))
# Encrypt the block
ciphertext = cipher.encrypt(plaintext)
file_output.write(ciphertext)
md5_lib.update(ciphertext)
file_md5 = md5_lib.digest()
# insert the body md5 hash in the header
with open(output_file_tmp, 'rb') as file_input:
with open(output_file, 'wb') as file_output:
block = file_input.read(block_size)
file_output.write(block)
block = file_input.read(block_size)
file_output.write(file_md5)
while True:
block = file_input.read(block_size)
if not block:
break
file_output.write(block)
os.remove(output_file_tmp)
return True
except:
print("Errors found! Canceled.")
return False
def main(argv):
input_file_path = ''
output_file_path = ''
input_model = ''
input_version = ''
try:
opts, args = getopt.getopt(argv,"hi:o:m:v:",["ifile=","ofile=",'model=','version='])
except getopt.GetoptError:
print ('ack2_swu_encrypt.py -i update.zip -o update.bin -m K2Pro -v 3.1.0')
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print ('ack2_swu_encrypt.py -i update.zip -o update.bin -m model -v version')
sys.exit()
elif opt in ("-i", "--ifile"):
input_file_path = arg
elif opt in ("-o", "--ofile"):
output_file_path = arg
elif opt in ("-m", "--model"):
input_model = arg
elif opt in ("-v", "--version"):
input_version = arg
print ('AnyCubic Kobra 2 SWU to BIN Converter V1.0')
print ('Input file: ', input_file_path)
print ('Output file: ', output_file_path)
print ('Model : ', input_model)
print ('Version : ', input_version)
first_aes_key_hex = "78B6A614B6B6E361DC84D705B7FDDA33C967DDF2970A689F8156F78EFE0B1FCE"
second_aes_key_hex = "54E37626B9A699403064111F77858049"
offset_value = 32 # Provide the offset value if needed
print ('Processing...')
if encrypt_aes_cbc(input_file_path, output_file_path, first_aes_key_hex, second_aes_key_hex, offset_value, input_model, input_version):
print ('Done!')
main(sys.argv[1:])

28
latest/TOOLS/app_model.sh Normal file
View file

@ -0,0 +1,28 @@
#!/bin/bash
# check the parameters
if [ $# != 1 ]; then
echo "usage : $0 <app_file>"
exit 1
fi
app_file="$1"
# try to find out the model
offset_pro=$(grep --binary-files=text -m1 -b -o "unmodifiable.cfg" "$app_file" | awk -F: '{print $1}')
offset_max=$(grep --binary-files=text -m1 -b -o "unmodifiable_max.cfg" "$app_file" | awk -F: '{print $1}')
offset_plus=$(grep --binary-files=text -m1 -b -o "unmodifiable_plus.cfg" "$app_file" | awk -F: '{print $1}')
app_model="Unknown"
if [ -n "$offset_pro" ]; then
app_model="K2Pro"
fi
if [ -n "$offset_plus" ]; then
app_model="K2Plus"
fi
if [ -n "$offset_max" ]; then
app_model="K2Max"
fi
echo -n "$app_model"
exit 0

View file

@ -0,0 +1,37 @@
#!/bin/bash
# global definitions:
RED='\033[0;31m'
NC='\033[0m'
# check the parameters
if [ $# != 1 ]; then
echo "usage : $0 <app_file>"
exit 1
fi
def_target="$1"
# check the app file
if [ ! -f "$def_target" ]; then
echo -e "${RED}ERROR: Cannot find the file '$def_target' ${NC}"
exit 2
fi
# try to find out the app version (like app_ver="3.0.9")
def_target_ver="${def_target}_ver"
offset=$(grep --binary-files=text -m1 -b -o "__FILE__" "$def_target" | awk -F: '{print $1}')
offset20=$((offset + 20))
dd if="$def_target" of="$def_target_ver" bs=1 skip="$offset20" count=8 &>>/dev/null
ver=$(hexdump -C "$def_target_ver" | awk '{print $10}' | head -n 1)
rm -f "$def_target_ver"
# remove the leading and ending pipes
app_ver="${ver//|/}"
# remove the trailing dots
while [ "${app_ver: -1}" == "." ]; do
app_ver=${app_ver::-1}
done
echo -n "$app_ver"
exit 0

View file

@ -0,0 +1,111 @@
#!/usr/bin/env python3
# Import ssh
from scp import SCPClient
import paramiko
import os
import sys
import time
import getpass
# Create hostname, username, ip struct to save
class PrinterSettings:
def __init__(self, hostname, username, ip, port):
self.hostname = hostname
self.username = username
self.ip = ip
self.port = port
def save_config(self):
with open('auto_install.cfg', 'w') as file:
file.write(f'{self.hostname},{self.username},{self.ip},{self.port}')
def load_config(self):
with open('auto_install.cfg', 'r') as file:
data = file.read().split(',')
self.hostname = data[0]
self.username = data[1]
self.ip = data[2]
self.port = data[3]
def handle_progress(filename: bytes, size: int, sent: int):
print(f'{filename.decode("utf-8")}: {sent/size*100:.2f}%')
if __name__ == "__main__":
# Check if update/update.swu exists
if not os.path.exists('update/update.swu'):
print('update/update.swu not found')
sys.exit(1)
# Connect to the printer
# Check if auto_install.cfg exists and load values else ask for input
if os.path.exists('auto_install.cfg'):
printer_settings = PrinterSettings('', '', '', '')
printer_settings.load_config()
else:
hostname = input('Enter the pc hostname: ')
username = input('Enter the username: ')
ip = input('Enter the ip: ')
port = input('Enter the port: ')
printer_settings = PrinterSettings(hostname, username, ip, port)
printer_settings.save_config()
# Connect to the printer
ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(printer_settings.ip, port=printer_settings.port, username=printer_settings.username, password=getpass.getpass(), timeout=5)
print('Connected to the printer')
print('Copying update/update.swu to /mnt/UDISK/update.swu')
scp = SCPClient(ssh.get_transport(), progress=handle_progress)
scp.put('update/update.swu', remote_path='/mnt/UDISK/update.swu', recursive=True)
scp.close()
# md5sum update/update.swu with /mnt/UDISK/update.swu. If they don't match, try again 3 times
for i in range(3):
# Get md5sum of both files
stdin, stdout, stderr = ssh.exec_command('md5sum /mnt/UDISK/update.swu')
md5sum_remote = stdout.read().decode('utf-8').split(' ')[0]
md5sum_local = os.popen('md5sum update/update.swu').read().split(' ')[0]
print(f'MD5 sum of local: {md5sum_local}')
print(f'MD5 sum of remote: {md5sum_remote}')
# If they match, break and run swupdate
if md5sum_remote == md5sum_local:
print('MD5 sums match... Running swupdate')
# Check fw_printenv boot_partition to see if it's bootA or bootB
stdin, stdout, stderr = ssh.exec_command('fw_printenv boot_partition')
current_boot_partition = stdout.read().decode('utf-8').split('=')[1].strip()
# If current_boot_partition is bootA, run swupdate with bootB. example: now_A_next_B
boot_partition = "now_A_next_B" if current_boot_partition == "bootA" else "now_B_next_A"
print(f'Current boot partition: {current_boot_partition}')
print(f'Running swupdate with boot partition: {boot_partition}')
ssh.exec_command(f'swupdate_cmd.sh -i /mnt/UDISK/update.swu -e stable,{boot_partition} -k /etc/swupdate_public.pem')
print("Update started... Please wait for the printer to reboot")
# wait for the update to complete, the printer to reboot and then close the connection
# Count down from 60 seconds
for i in range(60, 0, -1):
print(f'{i} seconds remaining')
# Check if we have lost ssh connection
if ssh.get_transport().is_active() == False:
print('Connection lost... Printer is probably rebooting')
ssh.close()
print('Connection closed')
break
time.sleep(1)
break
else:
# Delete the file and try again
print(f'MD5 sums do not match... Trying again. Current attempt: {i+1}')
ssh.exec_command('rm /mnt/UDISK/update.swu')
scp.put('update/update.swu', remote_path='/mnt/UDISK/update.swu', recursive=True)
scp.close()

View file

@ -0,0 +1,52 @@
import re
import os
output_file = 'mesh.txt'
input_file = 'printer_max.cfg'
if __name__ == "__main__":
# Detect anything with printer*.cfg
for file in os.listdir('.'):
# Check if the filename contains printer and cfg
if "printer" in file and ".cfg" in file:
input_file = file
break
# Open the input file
with open(input_file, 'r') as f:
# Read the file
data = f.read()
# Extract points values from: [besh_profile_default]
mesh_raw = re.search(r'\[besh_profile_default\]\nversion : 1\npoints : (.+?)\n', data, re.DOTALL).group(1)
# Split by comma into a array
mesh_array = mesh_raw.split(', ')
# Ask for the grid size
grid_size = str(input("Enter the grid size. Example: 7x7: "))
try:
grid_x = int(grid_size.split('x')[0])
grid_y = int(grid_size.split('x')[1])
except:
print("Invalid grid size")
exit(1)
# Take all points up to the grid size. 7 values then put them into a new array and repeat until there are no more points
# mesh = [mesh_array[i:i+grid_size] for i in range(0, len(mesh_array), grid_size)]
# Use x and y
mesh = [mesh_array[i:i+grid_x] for i in range(0, len(mesh_array), grid_y)]
mesh_str = ""
mesh_str += "\n"
for i in range(len(mesh)):
mesh_str += f"{i} {' '.join(map(str, mesh[i]))}\n"
# Print the result
print(mesh_str)

View file

@ -0,0 +1,32 @@
#!/bin/bash
username="root"
ip="192.168.1.242"
port="22"
# SCP file transfer
echo "Uploading..."
scp -o StrictHostKeyChecking=no -P $port update/update.swu $username@$ip:/mnt/UDISK/update.swu
# MD5 Calculation
md5sum_local=$(md5sum update/update.swu | awk '{ print $1 }')
echo "MD5 Local : $md5sum_local"
md5sum_remote=$(ssh -p $port $username@$ip "md5sum /mnt/UDISK/update.swu" | awk '{ print $1 }')
echo "MD5 Remote: $md5sum_remote"
if [[ "$md5sum_remote" == "$md5sum_local" ]]; then
# Getting boot partition and updating firmware
current_boot_partition=$(ssh -p $port $username@$ip "fw_printenv boot_partition" | awk -F= '{ print $2 }' | tr -d '[:space:]')
boot_partition="now_B_next_A"
if [[ "$current_boot_partition" == "bootA" ]]; then
boot_partition="now_A_next_B"
fi
# Update
echo "Updating..."
ssh -p $port $username@$ip "swupdate_cmd.sh -i /mnt/UDISK/update.swu -e stable,${boot_partition} -k /etc/swupdate_public.pem"
echo "SUCCESS!"
exit 0
else
# If MD5 checksums don't match, delete the file and retry
ssh -p $port $username@$ip 'rm -f /mnt/UDISK/update.swu'
echo "FAILED!"
exit 1
fi

View file

@ -0,0 +1,229 @@
#!/bin/bash
# Part Start LBA End LBA Name
# Attributes
# Type GUID
# Partition GUID
# 1 0x0000a1f8 0x0000d32f "boot-resource"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e45
# 2 0x0000d330 0x0000d527 "env"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e46
# 3 0x0000d528 0x0000d71f "env-redund"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e47
# 4 0x0000d720 0x00010857 "bootA"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e48
# 5 0x00010858 0x00050913 "rootfsA"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e49
# 6 0x00050914 0x000510f3 "dsp0A"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e4a
# 7 0x000510f4 0x0005422b "bootB"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e4b
# 8 0x0005422c 0x000942e7 "rootfsB"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e4c
# 9 0x000942e8 0x00094ac7 "dsp0B"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e4d
# 10 0x00094ac8 0x000d4b83 "rootfs_data"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e4e
# 11 0x000d4b84 0x00114c3f "user"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e4f
# 12 0x00114c40 0x0011541f "private"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e50
# 13 0x00115420 0x00e8ffde "UDISK"
# attrs: 0x8000000000000000
# type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
# guid: a0085546-4166-744a-a353-fca9272b8e51
project_root="$PWD"
# Source the utils.sh file
source "$project_root/TOOLS/helpers/utils.sh" "$project_root"
# Check if .bin file was passed as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <firmware.bin>"
exit 1
fi
# Check if the file exists and is a .bin file
if [ ! -f "$1" ]; then
echo "File not found"
exit 1
fi
if [[ "$1" != *.bin ]]; then
echo "File is not a .bin file"
exit 1
fi
check_tools "dd"
block_size=512
boot_resource_start=0x0000a1f8
boot_resource_end=0x0000d32f
env_start=0x0000d330
env_end=0x0000d527
env_redund_start=0x0000d528
env_redund_end=0x0000d71f
bootA_start=0x0000d720
bootA_end=0x00010857
rootfsA_start=0x00010858
rootfsA_end=0x00050913
dsp0A_start=0x00050914
dsp0A_end=0x000510f3
bootB_start=0x000510f4
bootB_end=0x0005422b
rootfsB_start=0x0005422c
rootfsB_end=0x000942e7
dsp0B_start=0x000942e8
dsp0B_end=0x00094ac7
rootfs_data_start=0x00094ac8
rootfs_data_end=0x000d4b83
user_start=0x000d4b84
user_end=0x00114c3f
private_start=0x00114c40
private_end=0x0011541f
UDISK_start=0x00115420
UDISK_end=0x00e8ffde
# Boot resource
# start - end + 1
boot_resource_size=$(($boot_resource_end - $boot_resource_start + 1))
# Skip is start converted to decimal
boot_resource_skip=$(printf "%d" $boot_resource_start)
# env
env_size=$(($env_end - $env_start + 1))
env_skip=$(printf "%d" $env_start)
# env-redund
env_redund_size=$(($env_redund_end - $env_redund_start + 1))
env_redund_skip=$(printf "%d" $env_redund_start)
# bootA
bootA_size=$(($bootA_end - $bootA_start + 1))
bootA_skip=$(printf "%d" $bootA_start)
# rootfsA
rootfsA_size=$(($rootfsA_end - $rootfsA_start + 1))
rootfsA_skip=$(printf "%d" $rootfsA_start)
# dsp0A
dsp0A_size=$(($dsp0A_end - $dsp0A_start + 1))
dsp0A_skip=$(printf "%d" $dsp0A_start)
# bootB
bootB_size=$(($bootB_end - $bootB_start + 1))
bootB_skip=$(printf "%d" $bootB_start)
# rootfsB
rootfsB_size=$(($rootfsB_end - $rootfsB_start + 1))
rootfsB_skip=$(printf "%d" $rootfsB_start)
# dsp0B
dsp0B_size=$(($dsp0B_end - $dsp0B_start + 1))
dsp0B_skip=$(printf "%d" $dsp0B_start)
# rootfs_data
rootfs_data_size=$(($rootfs_data_end - $rootfs_data_start + 1))
rootfs_data_skip=$(printf "%d" $rootfs_data_start)
# user
user_size=$(($user_end - $user_start + 1))
user_skip=$(printf "%d" $user_start)
# private
private_size=$(($private_end - $private_start + 1))
private_skip=$(printf "%d" $private_start)
# UDISK
UDISK_size=$(($UDISK_end - $UDISK_start + 1))
UDISK_skip=$(printf "%d" $UDISK_start)
# Count is size
# Start is skip
# Make a folder for the extracted files in $project_root/emmc_dump
mkdir -p "$project_root/emmc_dump"
outdir="$project_root/emmc_dump"
echo -e "${YELLOW}Extracting boot-resource...${NC}"
dd if="$1" of="$outdir/boot-resource.bin" bs=$block_size skip=$boot_resource_skip count=$boot_resource_size
echo -e "${YELLOW}Extracting env...${NC}"
dd if="$1" of="$outdir/env.bin" bs=$block_size skip=$env_skip count=$env_size
echo -e "${YELLOW}Extracting env-redund...${NC}"
dd if="$1" of="$outdir/env-redund.bin" bs=$block_size skip=$env_redund_skip count=$env_redund_size
echo -e "${YELLOW}Extracting bootA...${NC}"
dd if="$1" of="$outdir/bootA.bin" bs=$block_size skip=$bootA_skip count=$bootA_size
echo -e "${YELLOW}Extracting rootfsA...${NC}"
dd if="$1" of="$outdir/rootfsA.bin" bs=$block_size skip=$rootfsA_skip count=$rootfsA_size
echo -e "${YELLOW}Extracting dsp0A...${NC}"
dd if="$1" of="$outdir/dsp0A.bin" bs=$block_size skip=$dsp0A_skip count=$dsp0A_size
echo -e "${YELLOW}Extracting bootB...${NC}"
dd if="$1" of="$outdir/bootB.bin" bs=$block_size skip=$bootB_skip count=$bootB_size
echo -e "${YELLOW}Extracting rootfsB...${NC}"
dd if="$1" of="$outdir/rootfsB.bin" bs=$block_size skip=$rootfsB_skip count=$rootfsB_size
echo -e "${YELLOW}Extracting dsp0B...${NC}"
dd if="$1" of="$outdir/dsp0B.bin" bs=$block_size skip=$dsp0B_skip count=$dsp0B_size
echo -e "${YELLOW}Extracting rootfs_data...${NC}"
dd if="$1" of="$outdir/rootfs_data.bin" bs=$block_size skip=$rootfs_data_skip count=$rootfs_data_size
echo -e "${YELLOW}Extracting user...${NC}"
dd if="$1" of="$outdir/user.bin" bs=$block_size skip=$user_skip count=$user_size
echo -e "${YELLOW}Extracting private...${NC}"
dd if="$1" of="$outdir/private.bin" bs=$block_size skip=$private_skip count=$private_size
echo -e "${YELLOW}Extracting UDISK...${NC}"
dd if="$1" of="$outdir/UDISK.bin" bs=$block_size skip=$UDISK_skip count=$UDISK_size
echo -e "${GREEN}Extraction complete${NC}"
exit 0

View file

@ -0,0 +1,56 @@
#!/bin/bash
# global definitions:
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
PURPLE='\033[0;35m'
NC='\033[0m'
FW_DIR="$project_root/FW"
OPTIONS_DIR="$project_root/RESOURCES/OPTIONS"
KEYS_DIR="$project_root/RESOURCES/KEYS"
TEMP_DIR="$project_root/temp"
TOOLS_DIR="$project_root/TOOLS"
ROOTFS_DIR="$project_root/unpacked/squashfs-root"
# function to check tools with tool list as parameter
check_tools() {
TOOL_LIST="$1"
for tool_name in $TOOL_LIST; do
echo -e "${PURPLE}Checking tool: $tool_name${NC}"
if [[ $tool_name == *.sh ]]; then
tool_path="$TOOLS_DIR/$tool_name"
# Get name of the .sh file without the extension
tool_name=$(echo $tool_name | sed 's/\.sh//')
# Set variable to the name of the tool without the extension and add _tool to the end
tool_name_var="${tool_name}_tool"
# Set the path to the tool to TOOL_DIR/tool_name with the .sh extension
tool_path_var="${TOOLS_DIR}/${tool_name}.sh"
# Export the dynamic variable
export $tool_name_var=$tool_path_var
else
tool_path=$(which $tool_name)
if [ -z "$tool_path" ]; then
if [ ! -f "$TOOLS_DIR/$tool_name" ]; then
echo -e "${RED}ERROR: Missing tool '$tool_name' ${NC}"
exit 3
fi
fi
fi
done
echo -e "${GREEN}SUCCESS: All tools are available${NC}"
}
export -f check_tools
export RED GREEN YELLOW PURPLE NC FW_DIR OPTIONS_DIR KEYS_DIR TEMP_DIR TOOLS_DIR ROOTFS_DIR

9
latest/docs/COMMANDS.md Normal file
View file

@ -0,0 +1,9 @@
# Commands
Open boot-resource:
### Mount boot-resource
```bash
mount -t vfat boot-resource /mnt
```

7
latest/docs/CREDITS.md Normal file
View file

@ -0,0 +1,7 @@
### Credits
Original credits to [Assen](https://klipper.discourse.group/u/AGG2020) for the scripts.
[Alexander](https://github.com/ultimateshadsform) for minor modifications.
And to the community for the support and reverse engineering.

View file

@ -0,0 +1,17 @@
# Download SDK
https://gitee.com/weidongshan/eLinuxCore_100ask-t113-pro
```bash
git clone https://gitee.com/weidongshan/eLinuxCore_100ask-t113-pro --recurse-submodules
```
You can find the devboard documentation here: https://shadow-storage.fra1.cdn.digitaloceanspaces.com/GXFB0461-001.zip
https://bbs.aw-ol.com/assets/uploads/files/1645007527374-r528_user_manual_v1.3.pdf
https://whycan.com/t_8303.html
https://bbs.aw-ol.com/category/7/%E5%85%B6%E5%AE%83%E5%85%A8%E5%BF%97%E8%8A%AF%E7%89%87%E8%AE%A8%E8%AE%BA%E5%8C%BA?_x_tr_hist=true
https://bbs.aw-ol.com/topic/1034

View file

@ -0,0 +1,99 @@
# EMMC Backup Procedure
This procedure is recommended to be performed when your printer is completely setup in a well working condition. It is possible to create complete eMMC backup for about 15 minutes for eMMC size of about 8GB. It is recommended to have at least one complete backup. The procedure uses the uboot functionality to read/write the eMMC and to read/write USB disks. The backup procedure copy the entire eMMC on a USB disk. Then on a Linux host you can create image of the USB disk to have it as a backup file.
To perform a backup follow these steps:
## By the uboot console
1. Use the original app version 2.39 and stop the booting process by holding key 's' (or use any custom firmware update that has the UART enabled)
2. Insert a USB disk (FAT32 formatted) with the file [backup.scr](../extra-stuff/emmc/backup.scr) on it for complete emmc backup.
3. From the uboot shell enter the following:
```sh
usb reset
```
```sh
usb dev 0
```
```sh
fatload usb 0:0 42000000 backup.scr
```
If you see an error, try typing in usb part and see what partitions are available. Then enter:
```sh
fatload usb 0:<Enter partition number in here> 42000000 backup.scr
```
Example:
```sh
fatload usb 0:1 42000000 backup.scr
```
(Partition 1)
1. Remove the USB disk with the scripts and insert at least 8GB USB disk for a complete backup. It might be formatted or not and it will be completely rewritten by the contents of the eMMC. NOTE: Do not use a disk with important information! All data on it will be lost!
2. Type the following to execute the script:
```sh
source 42000000
```
1. Wait about 15 minutes and the entire emmc will be transferred 1:1 to the USB disk sector by sector
If you see an error and the script stopped before showing 100%, insert another type USB disk and enter again:
```sh
source 42000000
```
7. From a Linux machine export the complete backup as a file from the USB disk:
```sh
dd if=/dev/sdh of=emmc_backup.bin bs=512 count=15269888 status=progress
```
Note: replace the `/dev/sdh` with the device name of your USB disk.
## By the standard or the custom xfel tool in uboot mode
This mode can be used when the version you are using has the uart disabled and you are unable to stop the booting process and to enter in the uboot shell.
You could either do:
```sh
xfel exec 0x0
```
to boot into uboot and then enter the commands above or:
1. Enter the printer in FEL mode and connect the uart to the computer. Open the terminal.
2. Enter the following:
```sh
xfel ddr t113-s3
```
```sh
xfel write 0x43000000 uboot239.bin
```
```sh
xfel exec 0x43000b50
```
Immediately press and hold key 's' in the terminal until the boot process stop in uboot shell and go to step 3 above
You can modify the script and create new backup.scr image by:
```sh
mkimage -T script -n 'EMMC Backup' -d backup.txt backup.scr
```
## By the custom xfel tool in USB mode
TBD

114
latest/docs/EMMC_RESTORE.md Normal file
View file

@ -0,0 +1,114 @@
# EMMC Restore Procedure
This procedure can be performed when you already have a good backup and your printer is not working properly or even cannot boot. Another use case is to fast switch to another printer setup by replacing the system partitions or the entire eMMC with the content from another setup. The procedure uses the uboot functionality to read/write the eMMC and to read/write USB disks. The restore procedure recovers the entire eMMC from a USB disk backup.
To perform a restore follow these steps according to the current printer working state (Case A, B or C):
## Case A
In case your printer is in good working conditions (it can somehow boot) and you are using firmware version that has uboot enabled.
1. Turn on the printer and stop the booting process by holding key 's'
2. Insert a USB disk (FAT32 formatted) with the file [restore.scr](../extra-stuff/emmc/restore.scr) on it for complete emmc restore. If you need to restore just the system partitions use the file [srestore.scr](../extra-stuff/emmc/srestore.scr) instead.
3. From the uboot shell enter the following:
```sh
usb reset
```
```sh
usb dev 0
```
```sh
fatload usb 0:0 42000000 restore.scr
```
If you see an error, try typing in usb part and see what partitions are available. Then enter:
```sh
fatload usb 0:<Enter partition number in here> 42000000 restore.scr
```
Example:
```sh
fatload usb 0:1 42000000 restore.scr
```
(Partition 1)
For a system restore replace the above script name `restore.scr` with the name `srestore.scr`.
4. Remove the USB disk with the scripts and insert the 8GB USB disk with the complete backup.
5. ONLY IN CASE YOU DONT' HAVE A backups on a USB disk you can create them from the backup files on a Linux machine, otherwise go step 5.
```sh
dd if=emmc_backup.bin of=/dev/sdh bs=512 count=15269888 status=progress
```
Note: replace the `/dev/sdh` with the device name of your USB disk.
1. Type the following to execute the script:
```sh
source 42000000
```
1. Wait about 15 minutes and the entire emmc will be restored 1:1 from the USB disk sector by sector
If you see an error and the script stopped before showing 100%, insert another type USB disk and enter again:
```sh
source 42000000
```
7. Reset the printer or power off / power on and you should have a fully working machine like at the time the backup was taken.
## Case B
With the standard or the custom xfel tool in case your printer cannot boot or you are using a firmware version that disable the UART and you don't have access to the uboot shell.
To boot into uboot shell:
1. Enter the printer in FEL mode and connect the uart to the computer. Open the terminal.
2. Enter the following:
```sh
xfel ddr t113-s3
```
```sh
xfel write 0x43000000 uboot239.bin
```
```sh
xfel exec 0x43000b50
```
Immediately press and hold key 's' in the terminal until the boot process stop in uboot shell and go to step 3 above
You can modify the script and create new restore.scr image by:
```sh
mkimage -T script -n 'EMMC Restore' -d restore.txt restore.scr
```
## Case C
In case when after trying to use case B, you cannot enter in the uboot console for any reason (including the uart has some hardware issues).
Your printer should be in FEL mode. If not, try to enter in FEL mode as described in the document for FEL mode.
- Connect the printer left USB slot (with the camera icon) to the computer with male to male USB cable (1:1 pin connection)
- Execute this command to verify if the printer is in FEL mode
```
xfel extra sdmmc detect
```
- If you don't receive error executing the above command, start restoring the entire eMMC by:
```
xfel extra sdmmc write 0 backup.bin
```
NOTE: Replace `backup.bin` by the filename of your backup file

View file

@ -0,0 +1,19 @@
# All info about FEL/XFEL
To enter FEL mode, you can either use the xfel tool or short the pads on the main board.
The easiest way is to boot it via u-boot with the command:
```sh
efex
```
This will make the printer boot into FEL mode.
Or you can short the pads on the main board. The pads are located near the EMMC chip. You need to short the pads like in the picture below and then power on the printer and it will boot into FEL mode due to the shorted pads.
![enter_fel_mode](./images/enter_fel_mode.jpg)
To be able to properly use the xfel tool, you need to install the driver which can be found in the [zadig](https://github.com/xboot/xfel/releases/) tool.
Make sure to go to "Options" and check "List All Devices" and then select "Allwinner USB Boot Device" or something with weird characters and then select "WinUSB" and click "Install Driver".

View file

@ -0,0 +1,24 @@
# Hidden Gcode commands
> [!WARNING]
> Changing the wrong setting might make your printer unbootable and will need to be recovered from a backup.
To run these custom gcode commands you need to pass
```gcode
ROOT
; gcode commands in here
UNROOT
```
The `root` command enabled these commands. And `unroot` disables them.
- ROOT - Enable root commands.
- M8802 - Reboots the printer.
- M8803 - Copy printer.cfg to USB.
- M8807 - Copy printer.cfg from USB.
- M8810 - Copy encrypted logs to USB.
- M8817 - Copy printer.cfg from USB to /app/resources/configs/printer.cfg.
- M8818 - Copy unmodifiable.cfg from USB.
- M8820 - Resets the printer to factory settings.
- UNROOT - Disable root commands.

9
latest/docs/LINKS.md Normal file
View file

@ -0,0 +1,9 @@
# Links
* [Webserver](https://github.com/AGG2017/ACK2-Webserver/) - Webserver for the Anycubic Kobra 2 Series created by AGG2017.
* [Kobra Unleashed](https://github.com/anjomro/kobra-unleashed) - Remote Web Interface for Anycubic Kobra 2 Series 3D Printers.
* [Kobra Unleashed [AGG2017 Version]](https://github.com/AGG2017/kobra-unleashed) - Remote Web Interface. Improved version of the original Kobra Unleashed.
* [Kobra Unleashed [Alex Version]](https://github.com/anjomro/kobra-unleashed/tree/go-server) - A whole new web interface writting in Go.

272
latest/docs/MQTT_API.md Normal file
View file

@ -0,0 +1,272 @@
# MQTT
## About
MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.
## MQTT API
To be able to send MQTT commands to the device, you need to connect and use the following topic:
(All commands will need to be sent here)
```
anycubic/anycubicCloud/v1/server/printer/<PRINTER_MODEL_ID>/<PRINTER_ID>/<ACTION>
```
You can find the printer id by taking the first 32 characters of the file:
```
/user/ac_mqtt_connect_info
```
The `<PRINTER_MODEL_ID>` can be `20021` for K2Pro, `20022` for K2Plus or `20023` for K2Max.
Then to see received responses from the printer, you need to subscribe to the following topic:
```
anycubic/anycubicCloud/v1/printer/public/#
```
### Commands
#### List internal files
```json
{
"type": "file",
"action": "listLocal",
"data": {
"path": "/"
}
}
```
#### List files on USB
```json
{
"type": "file",
"action": "listUdisk",
"data": {
"path": "/"
}
}
```
#### Delete internal file
```json
{
"type": "file",
"action": "deleteLocal",
"data": {
"path": "dir",
"filename": "filename"
}
}
```
#### Delete file on USB
```json
{
"type": "file",
"action": "deleteUdisk",
"data": {
"path": "dir",
"filename": "filename"
}
}
```
#### cloudRecommendList
Need more info on what this does
```json
{
"type": "cloudRecommendList",
"records" {
"md5": "md5",
"url": "url",
"size": "size",
"img_url": "img_url",
"est_time": "est_time",
}
}
```
#### Get printer status
```json
{
"type": "status",
"action": "query"
}
```
#### Video
```json
{
"type": "video",
"action": "startCapture",
"data": {
"region": "region",
"tmpSecretKey": "tmpSecret",
"tmpSecretId": "tmpSecretId",
"sessionToken": "sessionToken"
}
}
```
#### Get slice params
```json
{
"type": "print",
"action": "getSliceParam"
}
```
#### Get printer status
```json
{
"type": "print",
"action": "query"
}
```
#### localtasktrans
```json
{
"type": "print",
"action": "localtasktrans",
"data": {
"taskid": "<taskid>",
"localtask": "<localtask>"
}
}
```
#### Start print
```json
{
"type": "print",
"action": "start",
"data": {
"taskid": "<taskid>",
"url": "<url>",
"filename": "<filename>",
"filesize": "<filesize>",
"md5": "<md5>",
"filetype": "<filetype>",
"filepath": "<filepath>",
"project_type": "<project_type>"
}
}
```
#### Pause print
```json
{
"type": "print",
"action": "pause",
"data": {
"taskid": "<taskid>"
}
}
```
#### Resume print
```json
{
"type": "print",
"action": "resume",
"data": {
"taskid": "<taskid>"
}
}
```
#### Stop print
```json
{
"type": "print",
"action": "stop",
"data": {
"taskid": "<taskid>"
}
}
```
#### Update print
```json
{
"type": "print",
"action": "update",
"data": {
"taskid": "0",
"settings": {
"target_nozzle_temp": 60,
"target_hotbed_temp": 60,
"fan_speed_pct": 100,
"print_speed_mode": 2,
"z_comp": "<z_comp>"
}
}
}
```
#### Cancel print
```json
{
"type": "print",
"action": "cancel",
"data": {
"taskid": "<taskid>"
}
}
```
#### Get ota version
```json
{
"type": "ota",
"action": "reportVersion",
"data": {
"force_update": "force_update",
"firmware_md5": "firmware_md5",
"firmware_version": "firmware_version",
"firmware_name": "firmware_name",
"firmware_url": "firmware_url",
"firmware_size": "firmware_size"
}
}
```
#### Update ota version
```json
{
"type": "ota",
"action": "update",
"data": {
"force_update": "force_update",
"firmware_md5": "firmware_md5",
"firmware_version": "firmware_version",
"firmware_name": "firmware_name",
"firmware_url": "firmware_url",
"firmware_size": "firmware_size"
}
}
```

11
latest/docs/OLD_INFO.md Normal file
View file

@ -0,0 +1,11 @@
# Old info
This is old information and is no longer relevant. Please refer to the [README.md](../README.md) for the latest information.
## Old SDK
https://gitlab.com/weidongshan/tina-d1-h
https://d1.docs.aw-ol.com/study/study_3getsdktoc/#sdk_3
This [flashforge](https://github.com/FlashforgeOfficial/AD5M_Series_Klipper) is similar to the Anycubic Kobra 2 Series. So we need to investigate it.

42
latest/docs/OPTIONS.md Normal file
View file

@ -0,0 +1,42 @@
# In this file is documented what each option does.
### app_images
#doc wip
### app_net_ready
#doc wip
### banner
Replace the login banner with a custom one.
### BLUETOOTH:
This option disable internal bluetooth module, it is not needed if you use these custom tools only for 3.0.9
### BOOT_RESOURCES:
#doc wip
### CAMERA
#doc wip
### CUSTOM_UPDATES:
Enable custom updates by replacing public key of the printer, remeber to save the original Key in case you want go back to OTA updates.
### OKPG:
install okpg package installer.
### ROOT_ACCESS:
Option to enble root access, default password is toor. Use it unless you know anycubic root password!
### SSH:
This option install and configure SSH Dropbear client.
### STARTUP_CLIENT:
This script is configured to initiate the automatic execution of other scripts or settings at system boot.
### UART:
This option enable UART on firmware 3.x and up.
### WEBSERVER:
Low memory footprint internal webserver, the project is under development and it include various tools like bed mesh visualization in real time and also a control panel to fine tuning mesh data using an algorithm that calculates the average mesh data, save mesh data history, webcam streaming and more to come.

View file

@ -0,0 +1,17 @@
# Printer.cfg Things
Your printer.cfg file is in `/user/printer_<model>.cfg`.
## [system]
`language` This is the language of the printer. Chinese/English.
`boot` This is a setup check to see if you have done initial setup of the printer. If you have not, it will ask you to do so.
`wifi` This is if you want wifi enabled or not.
`area` Your area code. Europe/China etc.
`run_mode` Not sure yet.
`sound` If you want touch beeps enabled or not.

32
latest/docs/VERSIONS.md Normal file
View file

@ -0,0 +1,32 @@
# Firmware Links
This is a list of known firmware versions for the K2 Max, K2 Pro, and K2 Plus.
## K2 Max
- 3.1.4 https://cdn.cloud-universe.anycubic.com/attachment/1872443076557496322_j3vwnimq.bin
- 3.1.2 https://cdn.cloud-universe.anycubic.com/ota/K2Max/ChituUpgrade_k2+Max_V3.1.2.bin
- 3.1.0 https://cdn.cloud-universe.anycubic.com/ota/prod/20023/AC104_k2MAX_V3.1.0.bin
- 3.0.9 https://cdn.cloud-universe.anycubic.com/ota/K2Max/AC104_K2Max_1.1.0_3.0.9_update.bin
- 3.0.5 https://cdn.cloud-universe.anycubic.com/ota/K2Max/AC104_K2Max_1.1.0_3.0.5_update.bin
- 3.0.3 https://cdn.cloud-universe.anycubic.com/ota/K2Max/AC104_K2Max_1.1.0_3.0.3_update.zip
- 2.3.9 https://cdn.cloud-universe.anycubic.com/ota/K2Max/AC104_K2Max_1.1.0_2.3.9_update.zip
## K2 Pro
- 3.1.2 https://cdn.cloud-universe.anycubic.com/ota/K2Pro/ChituUpgrade_k2+Pro_V3.1.2.bin
- 3.1.0 https://cdn.cloud-universe.anycubic.com/ota/prod/20021/AC104_k2PRO_V3.1.0.bin
- 3.0.9 https://cdn.cloud-universe.anycubic.com/ota/K2Pro/AC104_K2Pro_1.1.0_3.0.9_update.bin
- 3.0.5 https://cdn.cloud-universe.anycubic.com/ota/K2Pro/AC104_K2Pro_1.1.0_3.0.5_update.bin
- 3.0.3 https://cdn.cloud-universe.anycubic.com/ota/K2Pro/AC104_K2Pro_1.1.0_3.0.3_update.zip
- 2.3.9 https://cdn.cloud-universe.anycubic.com/ota/K2Pro/AC104_K2Pro_1.1.0_2.3.9_update.zip
## K2 Plus
- 3.1.2 https://cdn.cloud-universe.anycubic.com/ota/K2Plus/ChituUpgrade_k2+Plus_V3.1.2.bin
- 3.1.0 https://cdn.cloud-universe.anycubic.com/ota/prod/20022/AC104_k2PLUS_V3.1.0.bin
- 3.0.9 https://cdn.cloud-universe.anycubic.com/ota/K2Plus/AC104_K2Plus_1.1.0_3.0.9_update.bin
- 3.0.5 https://cdn.cloud-universe.anycubic.com/ota/K2Plus/AC104_K2Plus_1.1.0_3.0.5_update.bin
- 3.0.3 https://cdn.cloud-universe.anycubic.com/ota/K2Plus/AC104_K2Plus_1.1.0_3.0.3_update.zip
- 2.3.9 https://cdn.cloud-universe.anycubic.com/ota/K2Plus/AC104_K2Plus_1.1.0_2.3.9_update.zip

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

View file

@ -0,0 +1,508 @@
echo ----------------------------------------------
echo --- EMMC BACKUP ON A USB DISK ---
echo ----------------------------------------------
echo
sleep 5
echo
echo ----------------------------------------------
echo REMOVE ALL USB DEVICES AND ISERT 8GB+ USB DISK
echo ----------------------------------------------
echo 10...
sleep 2
echo 9...
sleep 2
echo 8...
sleep 2
echo 7...
sleep 2
echo 6...
sleep 2
echo 5...
sleep 2
echo 4...
sleep 2
echo 3...
sleep 2
echo 2...
sleep 2
echo 1...
sleep 2
echo 0...
sleep 2
echo ------------------ initializing --------------------
sunxi_card0_probe
mmc dev 0
usb reset
usb dev 0
echo ------------------ emmc >>> usb --------------------
mmc read 40000000 00000000 10000
usb write 40000000 00000000 10000
mmc read 40000000 00010000 10000
usb write 40000000 00010000 10000
mmc read 40000000 00020000 10000
usb write 40000000 00020000 10000
mmc read 40000000 00030000 10000
usb write 40000000 00030000 10000
mmc read 40000000 00040000 10000
usb write 40000000 00040000 10000
mmc read 40000000 00050000 10000
usb write 40000000 00050000 10000
mmc read 40000000 00060000 10000
usb write 40000000 00060000 10000
mmc read 40000000 00070000 10000
usb write 40000000 00070000 10000
mmc read 40000000 00080000 10000
usb write 40000000 00080000 10000
mmc read 40000000 00090000 10000
usb write 40000000 00090000 10000
mmc read 40000000 000a0000 10000
usb write 40000000 000a0000 10000
mmc read 40000000 000b0000 10000
usb write 40000000 000b0000 10000
mmc read 40000000 000c0000 10000
usb write 40000000 000c0000 10000
mmc read 40000000 000d0000 10000
usb write 40000000 000d0000 10000
mmc read 40000000 000e0000 10000
usb write 40000000 000e0000 10000
mmc read 40000000 000f0000 10000
usb write 40000000 000f0000 10000
mmc read 40000000 00100000 10000
usb write 40000000 00100000 10000
mmc read 40000000 00110000 10000
usb write 40000000 00110000 10000
mmc read 40000000 00120000 10000
usb write 40000000 00120000 10000
mmc read 40000000 00130000 10000
usb write 40000000 00130000 10000
mmc read 40000000 00140000 10000
usb write 40000000 00140000 10000
mmc read 40000000 00150000 10000
usb write 40000000 00150000 10000
mmc read 40000000 00160000 10000
usb write 40000000 00160000 10000
mmc read 40000000 00170000 10000
usb write 40000000 00170000 10000
mmc read 40000000 00180000 10000
usb write 40000000 00180000 10000
mmc read 40000000 00190000 10000
usb write 40000000 00190000 10000
mmc read 40000000 001a0000 10000
usb write 40000000 001a0000 10000
mmc read 40000000 001b0000 10000
usb write 40000000 001b0000 10000
mmc read 40000000 001c0000 10000
usb write 40000000 001c0000 10000
mmc read 40000000 001d0000 10000
usb write 40000000 001d0000 10000
mmc read 40000000 001e0000 10000
usb write 40000000 001e0000 10000
mmc read 40000000 001f0000 10000
usb write 40000000 001f0000 10000
mmc read 40000000 00200000 10000
usb write 40000000 00200000 10000
mmc read 40000000 00210000 10000
usb write 40000000 00210000 10000
mmc read 40000000 00220000 10000
usb write 40000000 00220000 10000
mmc read 40000000 00230000 10000
usb write 40000000 00230000 10000
mmc read 40000000 00240000 10000
usb write 40000000 00240000 10000
mmc read 40000000 00250000 10000
usb write 40000000 00250000 10000
mmc read 40000000 00260000 10000
usb write 40000000 00260000 10000
mmc read 40000000 00270000 10000
usb write 40000000 00270000 10000
mmc read 40000000 00280000 10000
usb write 40000000 00280000 10000
mmc read 40000000 00290000 10000
usb write 40000000 00290000 10000
mmc read 40000000 002a0000 10000
usb write 40000000 002a0000 10000
mmc read 40000000 002b0000 10000
usb write 40000000 002b0000 10000
mmc read 40000000 002c0000 10000
usb write 40000000 002c0000 10000
mmc read 40000000 002d0000 10000
usb write 40000000 002d0000 10000
mmc read 40000000 002e0000 10000
usb write 40000000 002e0000 10000
mmc read 40000000 002f0000 10000
usb write 40000000 002f0000 10000
mmc read 40000000 00300000 10000
usb write 40000000 00300000 10000
mmc read 40000000 00310000 10000
usb write 40000000 00310000 10000
mmc read 40000000 00320000 10000
usb write 40000000 00320000 10000
mmc read 40000000 00330000 10000
usb write 40000000 00330000 10000
mmc read 40000000 00340000 10000
usb write 40000000 00340000 10000
mmc read 40000000 00350000 10000
usb write 40000000 00350000 10000
mmc read 40000000 00360000 10000
usb write 40000000 00360000 10000
mmc read 40000000 00370000 10000
usb write 40000000 00370000 10000
mmc read 40000000 00380000 10000
usb write 40000000 00380000 10000
mmc read 40000000 00390000 10000
usb write 40000000 00390000 10000
mmc read 40000000 003a0000 10000
usb write 40000000 003a0000 10000
mmc read 40000000 003b0000 10000
usb write 40000000 003b0000 10000
mmc read 40000000 003c0000 10000
usb write 40000000 003c0000 10000
mmc read 40000000 003d0000 10000
usb write 40000000 003d0000 10000
mmc read 40000000 003e0000 10000
usb write 40000000 003e0000 10000
mmc read 40000000 003f0000 10000
usb write 40000000 003f0000 10000
mmc read 40000000 00400000 10000
echo ------------------ 25% ----------------
usb write 40000000 00400000 10000
mmc read 40000000 00410000 10000
usb write 40000000 00410000 10000
mmc read 40000000 00420000 10000
usb write 40000000 00420000 10000
mmc read 40000000 00430000 10000
usb write 40000000 00430000 10000
mmc read 40000000 00440000 10000
usb write 40000000 00440000 10000
mmc read 40000000 00450000 10000
usb write 40000000 00450000 10000
mmc read 40000000 00460000 10000
usb write 40000000 00460000 10000
mmc read 40000000 00470000 10000
usb write 40000000 00470000 10000
mmc read 40000000 00480000 10000
usb write 40000000 00480000 10000
mmc read 40000000 00490000 10000
usb write 40000000 00490000 10000
mmc read 40000000 004a0000 10000
usb write 40000000 004a0000 10000
mmc read 40000000 004b0000 10000
usb write 40000000 004b0000 10000
mmc read 40000000 004c0000 10000
usb write 40000000 004c0000 10000
mmc read 40000000 004d0000 10000
usb write 40000000 004d0000 10000
mmc read 40000000 004e0000 10000
usb write 40000000 004e0000 10000
mmc read 40000000 004f0000 10000
usb write 40000000 004f0000 10000
mmc read 40000000 00500000 10000
usb write 40000000 00500000 10000
mmc read 40000000 00510000 10000
usb write 40000000 00510000 10000
mmc read 40000000 00520000 10000
usb write 40000000 00520000 10000
mmc read 40000000 00530000 10000
usb write 40000000 00530000 10000
mmc read 40000000 00540000 10000
usb write 40000000 00540000 10000
mmc read 40000000 00550000 10000
usb write 40000000 00550000 10000
mmc read 40000000 00560000 10000
usb write 40000000 00560000 10000
mmc read 40000000 00570000 10000
usb write 40000000 00570000 10000
mmc read 40000000 00580000 10000
usb write 40000000 00580000 10000
mmc read 40000000 00590000 10000
usb write 40000000 00590000 10000
mmc read 40000000 005a0000 10000
usb write 40000000 005a0000 10000
mmc read 40000000 005b0000 10000
usb write 40000000 005b0000 10000
mmc read 40000000 005c0000 10000
usb write 40000000 005c0000 10000
mmc read 40000000 005d0000 10000
usb write 40000000 005d0000 10000
mmc read 40000000 005e0000 10000
usb write 40000000 005e0000 10000
mmc read 40000000 005f0000 10000
usb write 40000000 005f0000 10000
mmc read 40000000 00600000 10000
usb write 40000000 00600000 10000
mmc read 40000000 00610000 10000
usb write 40000000 00610000 10000
mmc read 40000000 00620000 10000
usb write 40000000 00620000 10000
mmc read 40000000 00630000 10000
usb write 40000000 00630000 10000
mmc read 40000000 00640000 10000
usb write 40000000 00640000 10000
mmc read 40000000 00650000 10000
usb write 40000000 00650000 10000
mmc read 40000000 00660000 10000
usb write 40000000 00660000 10000
mmc read 40000000 00670000 10000
usb write 40000000 00670000 10000
mmc read 40000000 00680000 10000
usb write 40000000 00680000 10000
mmc read 40000000 00690000 10000
usb write 40000000 00690000 10000
mmc read 40000000 006a0000 10000
usb write 40000000 006a0000 10000
mmc read 40000000 006b0000 10000
usb write 40000000 006b0000 10000
mmc read 40000000 006c0000 10000
usb write 40000000 006c0000 10000
mmc read 40000000 006d0000 10000
usb write 40000000 006d0000 10000
mmc read 40000000 006e0000 10000
usb write 40000000 006e0000 10000
mmc read 40000000 006f0000 10000
usb write 40000000 006f0000 10000
mmc read 40000000 00700000 10000
usb write 40000000 00700000 10000
mmc read 40000000 00710000 10000
usb write 40000000 00710000 10000
mmc read 40000000 00720000 10000
usb write 40000000 00720000 10000
mmc read 40000000 00730000 10000
usb write 40000000 00730000 10000
mmc read 40000000 00740000 10000
usb write 40000000 00740000 10000
mmc read 40000000 00750000 10000
usb write 40000000 00750000 10000
mmc read 40000000 00760000 10000
usb write 40000000 00760000 10000
mmc read 40000000 00770000 10000
usb write 40000000 00770000 10000
mmc read 40000000 00780000 10000
usb write 40000000 00780000 10000
mmc read 40000000 00790000 10000
usb write 40000000 00790000 10000
mmc read 40000000 007a0000 10000
usb write 40000000 007a0000 10000
mmc read 40000000 007b0000 10000
usb write 40000000 007b0000 10000
mmc read 40000000 007c0000 10000
usb write 40000000 007c0000 10000
mmc read 40000000 007d0000 10000
usb write 40000000 007d0000 10000
mmc read 40000000 007e0000 10000
usb write 40000000 007e0000 10000
mmc read 40000000 007f0000 10000
usb write 40000000 007f0000 10000
echo ------------------ 50% ----------------
mmc read 40000000 00800000 10000
usb write 40000000 00800000 10000
mmc read 40000000 00810000 10000
usb write 40000000 00810000 10000
mmc read 40000000 00820000 10000
usb write 40000000 00820000 10000
mmc read 40000000 00830000 10000
usb write 40000000 00830000 10000
mmc read 40000000 00840000 10000
usb write 40000000 00840000 10000
mmc read 40000000 00850000 10000
usb write 40000000 00850000 10000
mmc read 40000000 00860000 10000
usb write 40000000 00860000 10000
mmc read 40000000 00870000 10000
usb write 40000000 00870000 10000
mmc read 40000000 00880000 10000
usb write 40000000 00880000 10000
mmc read 40000000 00890000 10000
usb write 40000000 00890000 10000
mmc read 40000000 008a0000 10000
usb write 40000000 008a0000 10000
mmc read 40000000 008b0000 10000
usb write 40000000 008b0000 10000
mmc read 40000000 008c0000 10000
usb write 40000000 008c0000 10000
mmc read 40000000 008d0000 10000
usb write 40000000 008d0000 10000
mmc read 40000000 008e0000 10000
usb write 40000000 008e0000 10000
mmc read 40000000 008f0000 10000
usb write 40000000 008f0000 10000
mmc read 40000000 00900000 10000
usb write 40000000 00900000 10000
mmc read 40000000 00910000 10000
usb write 40000000 00910000 10000
mmc read 40000000 00920000 10000
usb write 40000000 00920000 10000
mmc read 40000000 00930000 10000
usb write 40000000 00930000 10000
mmc read 40000000 00940000 10000
usb write 40000000 00940000 10000
mmc read 40000000 00950000 10000
usb write 40000000 00950000 10000
mmc read 40000000 00960000 10000
usb write 40000000 00960000 10000
mmc read 40000000 00970000 10000
usb write 40000000 00970000 10000
mmc read 40000000 00980000 10000
usb write 40000000 00980000 10000
mmc read 40000000 00990000 10000
usb write 40000000 00990000 10000
mmc read 40000000 009a0000 10000
usb write 40000000 009a0000 10000
mmc read 40000000 009b0000 10000
usb write 40000000 009b0000 10000
mmc read 40000000 009c0000 10000
usb write 40000000 009c0000 10000
mmc read 40000000 009d0000 10000
usb write 40000000 009d0000 10000
mmc read 40000000 009e0000 10000
usb write 40000000 009e0000 10000
mmc read 40000000 009f0000 10000
usb write 40000000 009f0000 10000
mmc read 40000000 00a00000 10000
usb write 40000000 00a00000 10000
mmc read 40000000 00a10000 10000
usb write 40000000 00a10000 10000
mmc read 40000000 00a20000 10000
usb write 40000000 00a20000 10000
mmc read 40000000 00a30000 10000
usb write 40000000 00a30000 10000
mmc read 40000000 00a40000 10000
usb write 40000000 00a40000 10000
mmc read 40000000 00a50000 10000
usb write 40000000 00a50000 10000
mmc read 40000000 00a60000 10000
usb write 40000000 00a60000 10000
mmc read 40000000 00a70000 10000
usb write 40000000 00a70000 10000
mmc read 40000000 00a80000 10000
usb write 40000000 00a80000 10000
mmc read 40000000 00a90000 10000
usb write 40000000 00a90000 10000
mmc read 40000000 00aa0000 10000
usb write 40000000 00aa0000 10000
mmc read 40000000 00ab0000 10000
usb write 40000000 00ab0000 10000
mmc read 40000000 00ac0000 10000
usb write 40000000 00ac0000 10000
mmc read 40000000 00ad0000 10000
usb write 40000000 00ad0000 10000
mmc read 40000000 00ae0000 10000
usb write 40000000 00ae0000 10000
mmc read 40000000 00af0000 10000
usb write 40000000 00af0000 10000
mmc read 40000000 00b00000 10000
usb write 40000000 00b00000 10000
mmc read 40000000 00b10000 10000
usb write 40000000 00b10000 10000
mmc read 40000000 00b20000 10000
usb write 40000000 00b20000 10000
mmc read 40000000 00b30000 10000
usb write 40000000 00b30000 10000
mmc read 40000000 00b40000 10000
usb write 40000000 00b40000 10000
mmc read 40000000 00b50000 10000
usb write 40000000 00b50000 10000
mmc read 40000000 00b60000 10000
usb write 40000000 00b60000 10000
mmc read 40000000 00b70000 10000
usb write 40000000 00b70000 10000
mmc read 40000000 00b80000 10000
usb write 40000000 00b80000 10000
mmc read 40000000 00b90000 10000
usb write 40000000 00b90000 10000
mmc read 40000000 00ba0000 10000
usb write 40000000 00ba0000 10000
mmc read 40000000 00bb0000 10000
usb write 40000000 00bb0000 10000
mmc read 40000000 00bc0000 10000
usb write 40000000 00bc0000 10000
mmc read 40000000 00bd0000 10000
usb write 40000000 00bd0000 10000
mmc read 40000000 00be0000 10000
usb write 40000000 00be0000 10000
mmc read 40000000 00bf0000 10000
usb write 40000000 00bf0000 10000
echo ------------------ 75% ----------------
mmc read 40000000 00c00000 10000
usb write 40000000 00c00000 10000
mmc read 40000000 00c10000 10000
usb write 40000000 00c10000 10000
mmc read 40000000 00c20000 10000
usb write 40000000 00c20000 10000
mmc read 40000000 00c30000 10000
usb write 40000000 00c30000 10000
mmc read 40000000 00c40000 10000
usb write 40000000 00c40000 10000
mmc read 40000000 00c50000 10000
usb write 40000000 00c50000 10000
mmc read 40000000 00c60000 10000
usb write 40000000 00c60000 10000
mmc read 40000000 00c70000 10000
usb write 40000000 00c70000 10000
mmc read 40000000 00c80000 10000
usb write 40000000 00c80000 10000
mmc read 40000000 00c90000 10000
usb write 40000000 00c90000 10000
mmc read 40000000 00ca0000 10000
usb write 40000000 00ca0000 10000
mmc read 40000000 00cb0000 10000
usb write 40000000 00cb0000 10000
mmc read 40000000 00cc0000 10000
usb write 40000000 00cc0000 10000
mmc read 40000000 00cd0000 10000
usb write 40000000 00cd0000 10000
mmc read 40000000 00ce0000 10000
usb write 40000000 00ce0000 10000
mmc read 40000000 00cf0000 10000
usb write 40000000 00cf0000 10000
mmc read 40000000 00d00000 10000
usb write 40000000 00d00000 10000
mmc read 40000000 00d10000 10000
usb write 40000000 00d10000 10000
mmc read 40000000 00d20000 10000
usb write 40000000 00d20000 10000
mmc read 40000000 00d30000 10000
usb write 40000000 00d30000 10000
mmc read 40000000 00d40000 10000
usb write 40000000 00d40000 10000
mmc read 40000000 00d50000 10000
usb write 40000000 00d50000 10000
mmc read 40000000 00d60000 10000
usb write 40000000 00d60000 10000
mmc read 40000000 00d70000 10000
usb write 40000000 00d70000 10000
mmc read 40000000 00d80000 10000
usb write 40000000 00d80000 10000
mmc read 40000000 00d90000 10000
usb write 40000000 00d90000 10000
mmc read 40000000 00da0000 10000
usb write 40000000 00da0000 10000
mmc read 40000000 00db0000 10000
usb write 40000000 00db0000 10000
mmc read 40000000 00dc0000 10000
usb write 40000000 00dc0000 10000
mmc read 40000000 00dd0000 10000
usb write 40000000 00dd0000 10000
mmc read 40000000 00de0000 10000
usb write 40000000 00de0000 10000
mmc read 40000000 00df0000 10000
usb write 40000000 00df0000 10000
mmc read 40000000 00e00000 10000
usb write 40000000 00e00000 10000
mmc read 40000000 00e10000 10000
usb write 40000000 00e10000 10000
mmc read 40000000 00e20000 10000
usb write 40000000 00e20000 10000
mmc read 40000000 00e30000 10000
usb write 40000000 00e30000 10000
mmc read 40000000 00e40000 10000
usb write 40000000 00e40000 10000
mmc read 40000000 00e50000 10000
usb write 40000000 00e50000 10000
mmc read 40000000 00e60000 10000
usb write 40000000 00e60000 10000
mmc read 40000000 00e70000 10000
usb write 40000000 00e70000 10000
mmc read 40000000 00e80000 10000
usb write 40000000 00e80000 10000
echo ------------------ 100% ----------------

Binary file not shown.

View file

@ -0,0 +1,515 @@
echo -----------------------------------------------
echo --- EMMC RESTORE FROM USB DISK ---
echo -----------------------------------------------
echo
sleep 5
echo
echo -----------------------------------------------
echo REMOVE ALL USB DEVICES AND INSERT 8GB+ USB DISK
echo WITH THE IMAGE YOU WANT TO RESTORE
echo
echo IT WILL COPY THE USB BLOCKS TO THE EMMC BLOCKS!
echo
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !TURN OFF THE PRINTER NOW IF YOU ARE NOT READY!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo -----------------------------------------------
echo 10...
sleep 2
echo 9...
sleep 2
echo 8...
sleep 2
echo 7...
sleep 2
echo 6...
sleep 2
echo 5...
sleep 2
echo 4...
sleep 2
echo 3...
sleep 2
echo 2...
sleep 2
echo 1...
sleep 2
echo 0...
sleep 2
echo ------------------ Initializing --------------------
sunxi_card0_probe
mmc dev 0
usb reset
usb dev 0
echo ------------------ USB >>> EMMC --------------------
usb read 40000000 00000000 10000
mmc write 40000000 00000000 10000
usb read 40000000 00010000 10000
mmc write 40000000 00010000 10000
usb read 40000000 00020000 10000
mmc write 40000000 00020000 10000
usb read 40000000 00030000 10000
mmc write 40000000 00030000 10000
usb read 40000000 00040000 10000
mmc write 40000000 00040000 10000
usb read 40000000 00050000 10000
mmc write 40000000 00050000 10000
usb read 40000000 00060000 10000
mmc write 40000000 00060000 10000
usb read 40000000 00070000 10000
mmc write 40000000 00070000 10000
usb read 40000000 00080000 10000
mmc write 40000000 00080000 10000
usb read 40000000 00090000 10000
mmc write 40000000 00090000 10000
usb read 40000000 000a0000 10000
mmc write 40000000 000a0000 10000
usb read 40000000 000b0000 10000
mmc write 40000000 000b0000 10000
usb read 40000000 000c0000 10000
mmc write 40000000 000c0000 10000
usb read 40000000 000d0000 10000
mmc write 40000000 000d0000 10000
usb read 40000000 000e0000 10000
mmc write 40000000 000e0000 10000
usb read 40000000 000f0000 10000
mmc write 40000000 000f0000 10000
usb read 40000000 00100000 10000
mmc write 40000000 00100000 10000
usb read 40000000 00110000 10000
mmc write 40000000 00110000 10000
usb read 40000000 00120000 10000
mmc write 40000000 00120000 10000
usb read 40000000 00130000 10000
mmc write 40000000 00130000 10000
usb read 40000000 00140000 10000
mmc write 40000000 00140000 10000
usb read 40000000 00150000 10000
mmc write 40000000 00150000 10000
usb read 40000000 00160000 10000
mmc write 40000000 00160000 10000
usb read 40000000 00170000 10000
mmc write 40000000 00170000 10000
usb read 40000000 00180000 10000
mmc write 40000000 00180000 10000
usb read 40000000 00190000 10000
mmc write 40000000 00190000 10000
usb read 40000000 001a0000 10000
mmc write 40000000 001a0000 10000
usb read 40000000 001b0000 10000
mmc write 40000000 001b0000 10000
usb read 40000000 001c0000 10000
mmc write 40000000 001c0000 10000
usb read 40000000 001d0000 10000
mmc write 40000000 001d0000 10000
usb read 40000000 001e0000 10000
mmc write 40000000 001e0000 10000
usb read 40000000 001f0000 10000
mmc write 40000000 001f0000 10000
usb read 40000000 00200000 10000
mmc write 40000000 00200000 10000
usb read 40000000 00210000 10000
mmc write 40000000 00210000 10000
usb read 40000000 00220000 10000
mmc write 40000000 00220000 10000
usb read 40000000 00230000 10000
mmc write 40000000 00230000 10000
usb read 40000000 00240000 10000
mmc write 40000000 00240000 10000
usb read 40000000 00250000 10000
mmc write 40000000 00250000 10000
usb read 40000000 00260000 10000
mmc write 40000000 00260000 10000
usb read 40000000 00270000 10000
mmc write 40000000 00270000 10000
usb read 40000000 00280000 10000
mmc write 40000000 00280000 10000
usb read 40000000 00290000 10000
mmc write 40000000 00290000 10000
usb read 40000000 002a0000 10000
mmc write 40000000 002a0000 10000
usb read 40000000 002b0000 10000
mmc write 40000000 002b0000 10000
usb read 40000000 002c0000 10000
mmc write 40000000 002c0000 10000
usb read 40000000 002d0000 10000
mmc write 40000000 002d0000 10000
usb read 40000000 002e0000 10000
mmc write 40000000 002e0000 10000
usb read 40000000 002f0000 10000
mmc write 40000000 002f0000 10000
usb read 40000000 00300000 10000
mmc write 40000000 00300000 10000
usb read 40000000 00310000 10000
mmc write 40000000 00310000 10000
usb read 40000000 00320000 10000
mmc write 40000000 00320000 10000
usb read 40000000 00330000 10000
mmc write 40000000 00330000 10000
usb read 40000000 00340000 10000
mmc write 40000000 00340000 10000
usb read 40000000 00350000 10000
mmc write 40000000 00350000 10000
usb read 40000000 00360000 10000
mmc write 40000000 00360000 10000
usb read 40000000 00370000 10000
mmc write 40000000 00370000 10000
usb read 40000000 00380000 10000
mmc write 40000000 00380000 10000
usb read 40000000 00390000 10000
mmc write 40000000 00390000 10000
usb read 40000000 003a0000 10000
mmc write 40000000 003a0000 10000
usb read 40000000 003b0000 10000
mmc write 40000000 003b0000 10000
usb read 40000000 003c0000 10000
mmc write 40000000 003c0000 10000
usb read 40000000 003d0000 10000
mmc write 40000000 003d0000 10000
usb read 40000000 003e0000 10000
mmc write 40000000 003e0000 10000
usb read 40000000 003f0000 10000
mmc write 40000000 003f0000 10000
usb read 40000000 00400000 10000
echo ------------------ 25% ----------------
mmc write 40000000 00400000 10000
usb read 40000000 00410000 10000
mmc write 40000000 00410000 10000
usb read 40000000 00420000 10000
mmc write 40000000 00420000 10000
usb read 40000000 00430000 10000
mmc write 40000000 00430000 10000
usb read 40000000 00440000 10000
mmc write 40000000 00440000 10000
usb read 40000000 00450000 10000
mmc write 40000000 00450000 10000
usb read 40000000 00460000 10000
mmc write 40000000 00460000 10000
usb read 40000000 00470000 10000
mmc write 40000000 00470000 10000
usb read 40000000 00480000 10000
mmc write 40000000 00480000 10000
usb read 40000000 00490000 10000
mmc write 40000000 00490000 10000
usb read 40000000 004a0000 10000
mmc write 40000000 004a0000 10000
usb read 40000000 004b0000 10000
mmc write 40000000 004b0000 10000
usb read 40000000 004c0000 10000
mmc write 40000000 004c0000 10000
usb read 40000000 004d0000 10000
mmc write 40000000 004d0000 10000
usb read 40000000 004e0000 10000
mmc write 40000000 004e0000 10000
usb read 40000000 004f0000 10000
mmc write 40000000 004f0000 10000
usb read 40000000 00500000 10000
mmc write 40000000 00500000 10000
usb read 40000000 00510000 10000
mmc write 40000000 00510000 10000
usb read 40000000 00520000 10000
mmc write 40000000 00520000 10000
usb read 40000000 00530000 10000
mmc write 40000000 00530000 10000
usb read 40000000 00540000 10000
mmc write 40000000 00540000 10000
usb read 40000000 00550000 10000
mmc write 40000000 00550000 10000
usb read 40000000 00560000 10000
mmc write 40000000 00560000 10000
usb read 40000000 00570000 10000
mmc write 40000000 00570000 10000
usb read 40000000 00580000 10000
mmc write 40000000 00580000 10000
usb read 40000000 00590000 10000
mmc write 40000000 00590000 10000
usb read 40000000 005a0000 10000
mmc write 40000000 005a0000 10000
usb read 40000000 005b0000 10000
mmc write 40000000 005b0000 10000
usb read 40000000 005c0000 10000
mmc write 40000000 005c0000 10000
usb read 40000000 005d0000 10000
mmc write 40000000 005d0000 10000
usb read 40000000 005e0000 10000
mmc write 40000000 005e0000 10000
usb read 40000000 005f0000 10000
mmc write 40000000 005f0000 10000
usb read 40000000 00600000 10000
mmc write 40000000 00600000 10000
usb read 40000000 00610000 10000
mmc write 40000000 00610000 10000
usb read 40000000 00620000 10000
mmc write 40000000 00620000 10000
usb read 40000000 00630000 10000
mmc write 40000000 00630000 10000
usb read 40000000 00640000 10000
mmc write 40000000 00640000 10000
usb read 40000000 00650000 10000
mmc write 40000000 00650000 10000
usb read 40000000 00660000 10000
mmc write 40000000 00660000 10000
usb read 40000000 00670000 10000
mmc write 40000000 00670000 10000
usb read 40000000 00680000 10000
mmc write 40000000 00680000 10000
usb read 40000000 00690000 10000
mmc write 40000000 00690000 10000
usb read 40000000 006a0000 10000
mmc write 40000000 006a0000 10000
usb read 40000000 006b0000 10000
mmc write 40000000 006b0000 10000
usb read 40000000 006c0000 10000
mmc write 40000000 006c0000 10000
usb read 40000000 006d0000 10000
mmc write 40000000 006d0000 10000
usb read 40000000 006e0000 10000
mmc write 40000000 006e0000 10000
usb read 40000000 006f0000 10000
mmc write 40000000 006f0000 10000
usb read 40000000 00700000 10000
mmc write 40000000 00700000 10000
usb read 40000000 00710000 10000
mmc write 40000000 00710000 10000
usb read 40000000 00720000 10000
mmc write 40000000 00720000 10000
usb read 40000000 00730000 10000
mmc write 40000000 00730000 10000
usb read 40000000 00740000 10000
mmc write 40000000 00740000 10000
usb read 40000000 00750000 10000
mmc write 40000000 00750000 10000
usb read 40000000 00760000 10000
mmc write 40000000 00760000 10000
usb read 40000000 00770000 10000
mmc write 40000000 00770000 10000
usb read 40000000 00780000 10000
mmc write 40000000 00780000 10000
usb read 40000000 00790000 10000
mmc write 40000000 00790000 10000
usb read 40000000 007a0000 10000
mmc write 40000000 007a0000 10000
usb read 40000000 007b0000 10000
mmc write 40000000 007b0000 10000
usb read 40000000 007c0000 10000
mmc write 40000000 007c0000 10000
usb read 40000000 007d0000 10000
mmc write 40000000 007d0000 10000
usb read 40000000 007e0000 10000
mmc write 40000000 007e0000 10000
usb read 40000000 007f0000 10000
mmc write 40000000 007f0000 10000
echo ------------------ 50% ----------------
usb read 40000000 00800000 10000
mmc write 40000000 00800000 10000
usb read 40000000 00810000 10000
mmc write 40000000 00810000 10000
usb read 40000000 00820000 10000
mmc write 40000000 00820000 10000
usb read 40000000 00830000 10000
mmc write 40000000 00830000 10000
usb read 40000000 00840000 10000
mmc write 40000000 00840000 10000
usb read 40000000 00850000 10000
mmc write 40000000 00850000 10000
usb read 40000000 00860000 10000
mmc write 40000000 00860000 10000
usb read 40000000 00870000 10000
mmc write 40000000 00870000 10000
usb read 40000000 00880000 10000
mmc write 40000000 00880000 10000
usb read 40000000 00890000 10000
mmc write 40000000 00890000 10000
usb read 40000000 008a0000 10000
mmc write 40000000 008a0000 10000
usb read 40000000 008b0000 10000
mmc write 40000000 008b0000 10000
usb read 40000000 008c0000 10000
mmc write 40000000 008c0000 10000
usb read 40000000 008d0000 10000
mmc write 40000000 008d0000 10000
usb read 40000000 008e0000 10000
mmc write 40000000 008e0000 10000
usb read 40000000 008f0000 10000
mmc write 40000000 008f0000 10000
usb read 40000000 00900000 10000
mmc write 40000000 00900000 10000
usb read 40000000 00910000 10000
mmc write 40000000 00910000 10000
usb read 40000000 00920000 10000
mmc write 40000000 00920000 10000
usb read 40000000 00930000 10000
mmc write 40000000 00930000 10000
usb read 40000000 00940000 10000
mmc write 40000000 00940000 10000
usb read 40000000 00950000 10000
mmc write 40000000 00950000 10000
usb read 40000000 00960000 10000
mmc write 40000000 00960000 10000
usb read 40000000 00970000 10000
mmc write 40000000 00970000 10000
usb read 40000000 00980000 10000
mmc write 40000000 00980000 10000
usb read 40000000 00990000 10000
mmc write 40000000 00990000 10000
usb read 40000000 009a0000 10000
mmc write 40000000 009a0000 10000
usb read 40000000 009b0000 10000
mmc write 40000000 009b0000 10000
usb read 40000000 009c0000 10000
mmc write 40000000 009c0000 10000
usb read 40000000 009d0000 10000
mmc write 40000000 009d0000 10000
usb read 40000000 009e0000 10000
mmc write 40000000 009e0000 10000
usb read 40000000 009f0000 10000
mmc write 40000000 009f0000 10000
usb read 40000000 00a00000 10000
mmc write 40000000 00a00000 10000
usb read 40000000 00a10000 10000
mmc write 40000000 00a10000 10000
usb read 40000000 00a20000 10000
mmc write 40000000 00a20000 10000
usb read 40000000 00a30000 10000
mmc write 40000000 00a30000 10000
usb read 40000000 00a40000 10000
mmc write 40000000 00a40000 10000
usb read 40000000 00a50000 10000
mmc write 40000000 00a50000 10000
usb read 40000000 00a60000 10000
mmc write 40000000 00a60000 10000
usb read 40000000 00a70000 10000
mmc write 40000000 00a70000 10000
usb read 40000000 00a80000 10000
mmc write 40000000 00a80000 10000
usb read 40000000 00a90000 10000
mmc write 40000000 00a90000 10000
usb read 40000000 00aa0000 10000
mmc write 40000000 00aa0000 10000
usb read 40000000 00ab0000 10000
mmc write 40000000 00ab0000 10000
usb read 40000000 00ac0000 10000
mmc write 40000000 00ac0000 10000
usb read 40000000 00ad0000 10000
mmc write 40000000 00ad0000 10000
usb read 40000000 00ae0000 10000
mmc write 40000000 00ae0000 10000
usb read 40000000 00af0000 10000
mmc write 40000000 00af0000 10000
usb read 40000000 00b00000 10000
mmc write 40000000 00b00000 10000
usb read 40000000 00b10000 10000
mmc write 40000000 00b10000 10000
usb read 40000000 00b20000 10000
mmc write 40000000 00b20000 10000
usb read 40000000 00b30000 10000
mmc write 40000000 00b30000 10000
usb read 40000000 00b40000 10000
mmc write 40000000 00b40000 10000
usb read 40000000 00b50000 10000
mmc write 40000000 00b50000 10000
usb read 40000000 00b60000 10000
mmc write 40000000 00b60000 10000
usb read 40000000 00b70000 10000
mmc write 40000000 00b70000 10000
usb read 40000000 00b80000 10000
mmc write 40000000 00b80000 10000
usb read 40000000 00b90000 10000
mmc write 40000000 00b90000 10000
usb read 40000000 00ba0000 10000
mmc write 40000000 00ba0000 10000
usb read 40000000 00bb0000 10000
mmc write 40000000 00bb0000 10000
usb read 40000000 00bc0000 10000
mmc write 40000000 00bc0000 10000
usb read 40000000 00bd0000 10000
mmc write 40000000 00bd0000 10000
usb read 40000000 00be0000 10000
mmc write 40000000 00be0000 10000
usb read 40000000 00bf0000 10000
mmc write 40000000 00bf0000 10000
echo ------------------ 75% ----------------
usb read 40000000 00c00000 10000
mmc write 40000000 00c00000 10000
usb read 40000000 00c10000 10000
mmc write 40000000 00c10000 10000
usb read 40000000 00c20000 10000
mmc write 40000000 00c20000 10000
usb read 40000000 00c30000 10000
mmc write 40000000 00c30000 10000
usb read 40000000 00c40000 10000
mmc write 40000000 00c40000 10000
usb read 40000000 00c50000 10000
mmc write 40000000 00c50000 10000
usb read 40000000 00c60000 10000
mmc write 40000000 00c60000 10000
usb read 40000000 00c70000 10000
mmc write 40000000 00c70000 10000
usb read 40000000 00c80000 10000
mmc write 40000000 00c80000 10000
usb read 40000000 00c90000 10000
mmc write 40000000 00c90000 10000
usb read 40000000 00ca0000 10000
mmc write 40000000 00ca0000 10000
usb read 40000000 00cb0000 10000
mmc write 40000000 00cb0000 10000
usb read 40000000 00cc0000 10000
mmc write 40000000 00cc0000 10000
usb read 40000000 00cd0000 10000
mmc write 40000000 00cd0000 10000
usb read 40000000 00ce0000 10000
mmc write 40000000 00ce0000 10000
usb read 40000000 00cf0000 10000
mmc write 40000000 00cf0000 10000
usb read 40000000 00d00000 10000
mmc write 40000000 00d00000 10000
usb read 40000000 00d10000 10000
mmc write 40000000 00d10000 10000
usb read 40000000 00d20000 10000
mmc write 40000000 00d20000 10000
usb read 40000000 00d30000 10000
mmc write 40000000 00d30000 10000
usb read 40000000 00d40000 10000
mmc write 40000000 00d40000 10000
usb read 40000000 00d50000 10000
mmc write 40000000 00d50000 10000
usb read 40000000 00d60000 10000
mmc write 40000000 00d60000 10000
usb read 40000000 00d70000 10000
mmc write 40000000 00d70000 10000
usb read 40000000 00d80000 10000
mmc write 40000000 00d80000 10000
usb read 40000000 00d90000 10000
mmc write 40000000 00d90000 10000
usb read 40000000 00da0000 10000
mmc write 40000000 00da0000 10000
usb read 40000000 00db0000 10000
mmc write 40000000 00db0000 10000
usb read 40000000 00dc0000 10000
mmc write 40000000 00dc0000 10000
usb read 40000000 00dd0000 10000
mmc write 40000000 00dd0000 10000
usb read 40000000 00de0000 10000
mmc write 40000000 00de0000 10000
usb read 40000000 00df0000 10000
mmc write 40000000 00df0000 10000
usb read 40000000 00e00000 10000
mmc write 40000000 00e00000 10000
usb read 40000000 00e10000 10000
mmc write 40000000 00e10000 10000
usb read 40000000 00e20000 10000
mmc write 40000000 00e20000 10000
usb read 40000000 00e30000 10000
mmc write 40000000 00e30000 10000
usb read 40000000 00e40000 10000
mmc write 40000000 00e40000 10000
usb read 40000000 00e50000 10000
mmc write 40000000 00e50000 10000
usb read 40000000 00e60000 10000
mmc write 40000000 00e60000 10000
usb read 40000000 00e70000 10000
mmc write 40000000 00e70000 10000
usb read 40000000 00e80000 10000
mmc write 40000000 00e80000 10000
echo ------------------ 100% ----------------

Binary file not shown.

View file

@ -0,0 +1,78 @@
echo ----------------------------------------------
echo --- EMMC SYSTEM BACKUP ON A USB DISK ---
echo ----------------------------------------------
echo
sleep 5
echo
echo ----------------------------------------------
echo REMOVE ALL USB DEVICES AND ISERT 2GB+ USB DISK
echo ----------------------------------------------
echo 10...
sleep 2
echo 9...
sleep 2
echo 8...
sleep 2
echo 7...
sleep 2
echo 6...
sleep 2
echo 5...
sleep 2
echo 4...
sleep 2
echo 3...
sleep 2
echo 2...
sleep 2
echo 1...
sleep 2
echo 0...
sleep 2
echo --------------------------------- INITIALIZING -------------------------------
sunxi_card0_probe
mmc dev 0
usb reset
usb dev 0
echo --------------------------------- EMMC >>> USB -------------------------------
mmc read 40000000 00000000 10000
usb write 40000000 00000000 10000
mmc read 40000000 00010000 10000
usb write 40000000 00010000 10000
mmc read 40000000 00020000 10000
usb write 40000000 00020000 10000
mmc read 40000000 00030000 10000
usb write 40000000 00030000 10000
mmc read 40000000 00040000 10000
usb write 40000000 00040000 10000
echo ------------------------------------ 25% -------------------------------------
mmc read 40000000 00050000 10000
usb write 40000000 00050000 10000
mmc read 40000000 00060000 10000
usb write 40000000 00060000 10000
mmc read 40000000 00070000 10000
usb write 40000000 00070000 10000
mmc read 40000000 00080000 10000
usb write 40000000 00080000 10000
mmc read 40000000 00090000 10000
usb write 40000000 00090000 10000
echo ------------------------------------ 50% -------------------------------------
mmc read 40000000 000a0000 10000
usb write 40000000 000a0000 10000
mmc read 40000000 000b0000 10000
usb write 40000000 000b0000 10000
mmc read 40000000 000c0000 10000
usb write 40000000 000c0000 10000
mmc read 40000000 000d0000 10000
usb write 40000000 000d0000 10000
echo ------------------------------------ 75% -------------------------------------
mmc read 40000000 000e0000 10000
usb write 40000000 000e0000 10000
mmc read 40000000 000f0000 10000
usb write 40000000 000f0000 10000
mmc read 40000000 00100000 10000
usb write 40000000 00100000 10000
mmc read 40000000 00110000 5420
usb write 40000000 00110000 5420
echo ------------------------------------ 100% ------------------------------------

Binary file not shown.

View file

@ -0,0 +1,84 @@
echo -----------------------------------------------
echo --- EMMC SYSTEM RESTORE FROM USB DISK ---
echo -----------------------------------------------
echo
sleep 5
echo
echo -----------------------------------------------
echo REMOVE ALL USB DEVICES AND INSERT 2GB+ USB DISK
echo WITH THE SYSTEM IMAGE YOU WANT TO RESTORE
echo
echo IT WILL COPY THE USB BLOCKS TO THE EMMC BLOCKS!
echo
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !TURN OFF THE PRINTER NOW IF YOU ARE NOT READY!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo -----------------------------------------------
echo 10...
sleep 2
echo 9...
sleep 2
echo 8...
sleep 2
echo 7...
sleep 2
echo 6...
sleep 2
echo 5...
sleep 2
echo 4...
sleep 2
echo 3...
sleep 2
echo 2...
sleep 2
echo 1...
sleep 2
echo 0...
sleep 2
echo --------------------------------- INITIALIZING -------------------------------
sunxi_card0_probe
mmc dev 0
usb reset
usb dev 0
echo --------------------------------- USB >>> EMMC -------------------------------
usb read 40000000 00000000 10000
mmc write 40000000 00000000 10000
usb read 40000000 00010000 10000
mmc write 40000000 00010000 10000
usb read 40000000 00020000 10000
mmc write 40000000 00020000 10000
usb read 40000000 00030000 10000
mmc write 40000000 00030000 10000
usb read 40000000 00040000 10000
mmc write 40000000 00040000 10000
echo ------------------------------------ 25% -------------------------------------
usb read 40000000 00050000 10000
mmc write 40000000 00050000 10000
usb read 40000000 00060000 10000
mmc write 40000000 00060000 10000
usb read 40000000 00070000 10000
mmc write 40000000 00070000 10000
usb read 40000000 00080000 10000
mmc write 40000000 00080000 10000
usb read 40000000 00090000 10000
mmc write 40000000 00090000 10000
echo ------------------------------------ 50% -------------------------------------
usb read 40000000 000a0000 10000
mmc write 40000000 000a0000 10000
usb read 40000000 000b0000 10000
mmc write 40000000 000b0000 10000
usb read 40000000 000c0000 10000
mmc write 40000000 000c0000 10000
usb read 40000000 000d0000 10000
mmc write 40000000 000d0000 10000
echo ------------------------------------ 75% -------------------------------------
usb read 40000000 000e0000 10000
mmc write 40000000 000e0000 10000
usb read 40000000 000f0000 10000
mmc write 40000000 000f0000 10000
usb read 40000000 00100000 10000
mmc write 40000000 00100000 10000
usb read 40000000 00110000 5420
mmc write 40000000 00110000 5420
echo ------------------------------------ 100% ------------------------------------

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.