Skip to content

Commit b6e08a3

Browse files
committed
docs: Remove espefuse and espsecure migration guide for esp8266
1 parent ff72b26 commit b6e08a3

File tree

1 file changed

+98
-96
lines changed

1 file changed

+98
-96
lines changed

docs/en/migration-guide.rst

Lines changed: 98 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -225,150 +225,152 @@ Choices for the ``--before`` and ``--after`` options have been renamed to use ``
225225

226226
1. Replace all underscores in the ``--before`` and ``--after`` options with ``-`` in your scripts.
227227

228-
espsecure.py ``v5`` Migration Guide
229-
***********************************
228+
.. only:: not esp8266
230229

231-
Command and Option Renaming
232-
###########################
230+
espsecure.py ``v5`` Migration Guide
231+
***********************************
233232

234-
All the commands and options have been renamed to use ``-`` instead of ``_`` as a separator (e.g., ``sign_data`` -> ``sign-data``).
233+
Command and Option Renaming
234+
###########################
235235

236-
Old command and option names are **deprecated**, meaning they will work for now with a warning, but will be removed in the next major release.
236+
All the commands and options have been renamed to use ``-`` instead of ``_`` as a separator (e.g., ``sign_data`` -> ``sign-data``).
237237

238-
This change affects most of the commands and the following options: ``--aes_xts``, ``--flash_crypt_conf``, ``--append_signatures``.
238+
Old command and option names are **deprecated**, meaning they will work for now with a warning, but will be removed in the next major release.
239239

240-
**Migration Steps:**
240+
This change affects most of the commands and the following options: ``--aes_xts``, ``--flash_crypt_conf``, ``--append_signatures``.
241241

242-
1. Replace all underscores in command and option names with ``-`` in your scripts and CI pipelines.
242+
**Migration Steps:**
243243

244-
Public API Changes
245-
##################
244+
1. Replace all underscores in command and option names with ``-`` in your scripts and CI pipelines.
246245

247-
The public API of ``espsecure.py`` has been updated to provide a more consistent and user-friendly interface for programmatic use in custom scripts and applications.
246+
Public API Changes
247+
##################
248248

249-
**Key Changes:**
249+
The public API of ``espsecure.py`` has been updated to provide a more consistent and user-friendly interface for programmatic use in custom scripts and applications.
250250

251-
- All functions now accept individual parameters instead of relying on the ``args`` object from the argparse module. Affected functions are:
252-
- ``digest_secure_bootloader``
253-
- ``generate_signing_key``
254-
- ``digest_secure_bootloader``
255-
- ``generate_signing_key``
256-
- ``sign_data`` including ``sign_secure_boot_v1`` and ``sign_secure_boot_v2``
257-
- ``verify_signature`` including ``verify_signature_v1`` and ``verify_signature_v2``
258-
- ``extract_public_key``
259-
- ``signature_info_v2``
260-
- ``digest_sbv2_public_key`` and ``digest_rsa_public_key``
261-
- ``digest_private_key``
262-
- ``generate_flash_encryption_key``
263-
- ``decrypt_flash_data``
264-
- ``encrypt_flash_data``
265-
- The ``main`` function parameter ``custom_commandline`` has been renamed to ``argv`` to unify the naming convention with esptool.
251+
**Key Changes:**
266252

267-
**Migration Steps:**
253+
- All functions now accept individual parameters instead of relying on the ``args`` object from the argparse module. Affected functions are:
254+
- ``digest_secure_bootloader``
255+
- ``generate_signing_key``
256+
- ``digest_secure_bootloader``
257+
- ``generate_signing_key``
258+
- ``sign_data`` including ``sign_secure_boot_v1`` and ``sign_secure_boot_v2``
259+
- ``verify_signature`` including ``verify_signature_v1`` and ``verify_signature_v2``
260+
- ``extract_public_key``
261+
- ``signature_info_v2``
262+
- ``digest_sbv2_public_key`` and ``digest_rsa_public_key``
263+
- ``digest_private_key``
264+
- ``generate_flash_encryption_key``
265+
- ``decrypt_flash_data``
266+
- ``encrypt_flash_data``
267+
- The ``main`` function parameter ``custom_commandline`` has been renamed to ``argv`` to unify the naming convention with esptool.
268268

269-
1. Update function calls to pass individual parameters instead of the ``args`` object. For example:
270-
``sign_data(args)`` -> ``sign_data(data=args.data, key=args.key, ...)``
271-
or if you were mocking the args object, now you don't have to do that and you can pass parameters directly to the function like:
272-
``sign_data(data=data, key=key, ...)``.
273-
2. Replace the ``custom_commandline`` parameter with ``argv`` in the ``main`` function call.
269+
**Migration Steps:**
274270

275-
espefuse.py ``v5`` Migration Guide
276-
***********************************
271+
1. Update function calls to pass individual parameters instead of the ``args`` object. For example:
272+
``sign_data(args)`` -> ``sign_data(data=args.data, key=args.key, ...)``
273+
or if you were mocking the args object, now you don't have to do that and you can pass parameters directly to the function like:
274+
``sign_data(data=data, key=key, ...)``.
275+
2. Replace the ``custom_commandline`` parameter with ``argv`` in the ``main`` function call.
277276

278-
Reset Mode Renaming
279-
###################
277+
espefuse.py ``v5`` Migration Guide
278+
***********************************
280279

281-
Choices for the ``--before`` option have been renamed to use ``-`` instead of ``_`` as a separator (e.g., ``default_reset`` -> ``default-reset``).
280+
Reset Mode Renaming
281+
###################
282282

283-
**Migration Steps:**
283+
Choices for the ``--before`` option have been renamed to use ``-`` instead of ``_`` as a separator (e.g., ``default_reset`` -> ``default-reset``).
284284

285-
1. Replace all underscores in the ``--before`` option with ``-`` in your scripts.
285+
**Migration Steps:**
286286

287-
Command and Option Renaming
288-
###########################
287+
1. Replace all underscores in the ``--before`` option with ``-`` in your scripts.
289288

290-
All the commands and options have been renamed to use ``-`` instead of ``_`` as a separator (e.g., ``burn_custom_mac`` -> ``burn-custom-mac``).
289+
Command and Option Renaming
290+
###########################
291291

292-
From options only ``--file_name`` has been renamed to ``--file-name``.
292+
All the commands and options have been renamed to use ``-`` instead of ``_`` as a separator (e.g., ``burn_custom_mac`` -> ``burn-custom-mac``).
293293

294-
Old command and option names are **deprecated**, meaning they will work for now with a warning, but will be removed in the next major release.
294+
From options only ``--file_name`` has been renamed to ``--file-name``.
295295

296-
**Migration Steps:**
296+
Old command and option names are **deprecated**, meaning they will work for now with a warning, but will be removed in the next major release.
297297

298-
1. Replace all underscores in the command names with ``-`` in your scripts.
298+
**Migration Steps:**
299299

300+
1. Replace all underscores in the command names with ``-`` in your scripts.
300301

301-
``--port`` Option is Required
302-
#############################
303302

304-
The ``--port`` option is now required for all commands (except when using ``--virt``). Previously it was optional and defaulted to ``/dev/ttyUSB0``.
303+
``--port`` Option is Required
304+
#############################
305305

306-
**Migration Steps:**
306+
The ``--port`` option is now required for all commands (except when using ``--virt``). Previously it was optional and defaulted to ``/dev/ttyUSB0``.
307307

308-
1. Add the ``--port`` option to all your espefuse commands.
308+
**Migration Steps:**
309309

310+
1. Add the ``--port`` option to all your espefuse commands.
310311

311-
``execute-scripts`` Command Removal
312-
###################################
313312

314-
The ``execute-scripts`` command has been **removed in v5**. This command was used to execute custom eFuses scripts. It was deprecated in favor of using ``espefuse.py`` as a Python module (see :ref:`here <espefuse-scripting>`).
313+
``execute-scripts`` Command Removal
314+
###################################
315315

316-
**Migration Steps:**
316+
The ``execute-scripts`` command has been **removed in v5**. This command was used to execute custom eFuses scripts. It was deprecated in favor of using ``espefuse.py`` as a Python module (see :ref:`here <espefuse-scripting>`).
317317

318-
1. Refactor any workflows using the deprecated ``execute-scripts`` to use the public API.
319-
2. Make sure to use the ``batch_mode`` argument for ``init_commands`` to avoid burning eFuses one by one.
320-
3. Variables ``idx`` and ``configfiles`` are no longer supported. These can be replaced with simple for loops in Python.
318+
**Migration Steps:**
321319

322-
For example, the following commands and script (using ESP32):
320+
1. Refactor any workflows using the deprecated ``execute-scripts`` to use the public API.
321+
2. Make sure to use the ``batch_mode`` argument for ``init_commands`` to avoid burning eFuses one by one.
322+
3. Variables ``idx`` and ``configfiles`` are no longer supported. These can be replaced with simple for loops in Python.
323323

324-
.. code-block:: bash
324+
For example, the following commands and script (using ESP32):
325325

326-
> espefuse.py --port /dev/ttyUSB0 execute_scripts efuse_script.py --do-not-confirm
326+
.. code-block:: bash
327327
328-
.. code-block:: python
328+
> espefuse.py --port /dev/ttyUSB0 execute_scripts efuse_script.py --do-not-confirm
329329
330-
espefuse(esp, efuses, args, "burn_efuse JTAG_DISABLE 1 DISABLE_SDIO_HOST 1 CONSOLE_DEBUG_DISABLE 1")
331-
espefuse(esp, efuses, args, "burn_key flash_encryption ../../images/efuse/256bit --no-protect-key")
332-
espefuse(esp, efuses, args, "burn_key_digest ../../secure_images/rsa_secure_boot_signing_key.pem")
333-
espefuse(esp, efuses, args, "burn_bit BLOCK3 64 66 69 72 78 82 83 90")
334-
espefuse(esp, efuses, args, "burn_custom_mac AA:BB:CC:DD:EE:88")
330+
.. code-block:: python
335331
336-
efuses.burn_all()
332+
espefuse(esp, efuses, args, "burn_efuse JTAG_DISABLE 1 DISABLE_SDIO_HOST 1 CONSOLE_DEBUG_DISABLE 1")
333+
espefuse(esp, efuses, args, "burn_key flash_encryption ../../images/efuse/256bit --no-protect-key")
334+
espefuse(esp, efuses, args, "burn_key_digest ../../secure_images/rsa_secure_boot_signing_key.pem")
335+
espefuse(esp, efuses, args, "burn_bit BLOCK3 64 66 69 72 78 82 83 90")
336+
espefuse(esp, efuses, args, "burn_custom_mac AA:BB:CC:DD:EE:88")
337337
338-
espefuse(esp, efuses, args, "summary")
339-
espefuse(esp, efuses, args, "adc_info")
340-
espefuse(esp, efuses, args, "get_custom_mac")
338+
efuses.burn_all()
341339
342-
if not efuses["BLOCK1"].is_readable() or not efuses["BLOCK1"].is_writeable():
343-
raise Exception("BLOCK1 should be readable and writeable")
340+
espefuse(esp, efuses, args, "summary")
341+
espefuse(esp, efuses, args, "adc_info")
342+
espefuse(esp, efuses, args, "get_custom_mac")
344343
345-
Can be replaced with public API:
344+
if not efuses["BLOCK1"].is_readable() or not efuses["BLOCK1"].is_writeable():
345+
raise Exception("BLOCK1 should be readable and writeable")
346346
347-
.. code-block:: python
347+
Can be replaced with public API:
348348

349-
from espefuse import init_commands
349+
.. code-block:: python
350350
351-
with init_commands(port="/dev/ttyUSB0", batch_mode=True, do_not_confirm=True) as espefuse:
352-
espefuse.burn_efuse({"JTAG_DISABLE": "1", "DISABLE_SDIO_HOST": "1", "CONSOLE_DEBUG_DISABLE": "1"})
353-
with open("../../images/efuse/256bit", "rb") as f:
354-
espefuse.burn_key(["flash_encryption"], [f], no_protect_key=True)
355-
with open("../../secure_images/rsa_secure_boot_signing_key.pem", "rb") as f:
356-
espefuse.burn_key_digest([f])
357-
espefuse.burn_bit("BLOCK3", [64, 66, 69, 72, 78, 82, 83, 90])
358-
espefuse.burn_custom_mac(b"\xaa\xbb\xcc\xdd\xee\x88")
351+
from espefuse import init_commands
359352
360-
espefuse.burn_all()
353+
with init_commands(port="/dev/ttyUSB0", batch_mode=True, do_not_confirm=True) as espefuse:
354+
espefuse.burn_efuse({"JTAG_DISABLE": "1", "DISABLE_SDIO_HOST": "1", "CONSOLE_DEBUG_DISABLE": "1"})
355+
with open("../../images/efuse/256bit", "rb") as f:
356+
espefuse.burn_key(["flash_encryption"], [f], no_protect_key=True)
357+
with open("../../secure_images/rsa_secure_boot_signing_key.pem", "rb") as f:
358+
espefuse.burn_key_digest([f])
359+
espefuse.burn_bit("BLOCK3", [64, 66, 69, 72, 78, 82, 83, 90])
360+
espefuse.burn_custom_mac(b"\xaa\xbb\xcc\xdd\xee\x88")
361361
362-
espefuse.summary()
363-
espefuse.adc_info()
364-
espefuse.get_custom_mac()
362+
espefuse.burn_all()
365363
366-
if not espefuse.efuses["BLOCK1"].is_readable() or not espefuse.efuses["BLOCK1"].is_writeable():
367-
raise Exception("BLOCK1 should be readable and writeable")
364+
espefuse.summary()
365+
espefuse.adc_info()
366+
espefuse.get_custom_mac()
367+
368+
if not espefuse.efuses["BLOCK1"].is_readable() or not espefuse.efuses["BLOCK1"].is_writeable():
369+
raise Exception("BLOCK1 should be readable and writeable")
368370
369-
.. note::
371+
.. note::
370372

371-
Please note that the ``batch_mode`` argument for ``init_commands`` is required to avoid burning eFuses one by one. This was previously
372-
the default behavior for ``execute-scripts`` command.
373+
Please note that the ``batch_mode`` argument for ``init_commands`` is required to avoid burning eFuses one by one. This was previously
374+
the default behavior for ``execute-scripts`` command.
373375

374-
For more details on the public API, see :ref:`espefuse-scripting`.
376+
For more details on the public API, see :ref:`espefuse-scripting`.

0 commit comments

Comments
 (0)