#!/usr/bin/env python3 # Cisco bin to pkg extractor – safe, verifies structure import os import sys import zipfile import shutil
Cisco provides a built-in conversion tool called archive that can be used to convert .bin files to .pkg files. Here's how:
copy tftp://10.0.0.1/isr4300-universalk9.16.12.10.SPA.bin flash: request platform software package expand flash:isr4300-universalk9.16.12.10.SPA.bin to flash:pkg_repo/
Switch# request platform software package expand file flash:isr4300-universalk9.bin to flash: