{ "info": { "author": "Martin Olejar", "author_email": "martin.olejar@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Embedded Systems", "Topic :: Utilities" ], "description": "pyUBoot\n=======\n\n|Build Status| |Coverage Status| |PyPI Status| |Python Version|\n\npyUBoot is an Open Source python based library for manipulating with\nU-Boot images and environment variables. Is distributed with following\ncommand-line utilities (tools):\n\n- `envimg `__ - a tool for editing environment\n variables inside U-Boot image\n- `mkenv `__ - a tool to generate/extract U-Boot\n environment variables into/from a binary blob\n- `mkimg `__ - a tool for manipulation with U-Boot\n executable images (zImage, Scripts, ...)\n\nDependencies\n------------\n\n- `Python `__ - Python 3.x interpreter\n- `Click `__ - Python package for creating\n beautiful command line interface.\n- `pyFDT `__ - Python package for\n manipulation with Device Tree images.\n\nInstallation\n------------\n\n.. code:: bash\n\n $ pip install uboot\n\nTo install the latest version from master branch execute in shell\nfollowing commands:\n\n.. code:: bash\n\n $ pip install -r https://raw.githubusercontent.com/molejar/pyUBoot/master/requirements.txt\n $ pip install -U https://github.com/molejar/pyUBoot/archive/master.zip\n\nIn case of development, install it from cloned sources:\n\n.. code:: bash\n\n $ git clone https://github.com/molejar/pyUBoot.git\n $ cd pyUBoot\n $ pip install -r requirements.txt\n $ pip install -U -e .\n\n**NOTE:** You may run into a permissions issues running these commands.\nHere are a few options how to fix it:\n\n1. Run with ``sudo`` to install pyUBoot and dependencies globally\n2. Specify the ``--user`` option to install locally into your home\n directory (export \"~/.local/bin\" into PATH variable if haven't).\n3. Run the command in a\n `virtualenv `__ local to a\n specific project working set.\n\nUsage\n-----\n\nThe first example is showing how to use ``EnvBlob`` class from ``uboot``\nmodule in your code.\n\n.. code:: python\n\n\n import uboot\n\n # --------------------------------------------------------------------------------\n # create env blob\n # --------------------------------------------------------------------------------\n env = uboot.EnvBlob(name=\"U-Boot Variables\")\n env.redundant = True\n env.set(\"bootdelay\", \"3\")\n env.set(\"stdin\", \"serial\")\n env.set(\"stdout\", \"serial\")\n\n # --------------------------------------------------------------------------------\n # save env blob as binary file\n # --------------------------------------------------------------------------------\n with open(\"env.img\", 'wb') as f:\n f.write(env.export())\n\n # --------------------------------------------------------------------------------\n # save env blob in readable format as text file\n # --------------------------------------------------------------------------------\n with open(\"env.txt\", 'w') as f:\n f.write(env.store())\n\n # --------------------------------------------------------------------------------\n # parse env blob from binary file\n # --------------------------------------------------------------------------------\n with open(\"env.img\", 'rb') as f:\n env.parse(f.read())\n\n # print env blob info\n print(\"U-Boot enviroment blob loaded from env.img file:\")\n print(env)\n print()\n\n # --------------------------------------------------------------------------------\n # load env blob from text file\n # --------------------------------------------------------------------------------\n with open(\"env.txt\", 'r') as f:\n env.load(f.read())\n\n # print env blob info\n print(\"U-Boot enviroment blob loaded from env.txt file:\")\n print(env)\n\nThe second example is showing how to create Multi-File U-Boot image with\n``uboot`` module.\n\n.. code:: python\n\n\n import uboot\n\n # --------------------------------------------------------------------------------\n # create dummy firmware image (u-boot executable image)\n # --------------------------------------------------------------------------------\n fwimg = uboot.StdImage(bytes([1]*512),\n name=\"Firmware Test Image\",\n laddr=0,\n eaddr=0,\n arch=uboot.EnumArchType.ARM,\n os=uboot.EnumOsType.LINUX,\n image=uboot.EnumImageType.FIRMWARE,\n compress=uboot.EnumCompressionType.NONE)\n\n # --------------------------------------------------------------------------------\n # create script image (u-boot executable image)\n # --------------------------------------------------------------------------------\n scimg = uboot.ScriptImage()\n scimg.Name = \"Test Script Image\"\n scimg.OsType = uboot.EnumOsType.LINUX\n scimg.ArchType = uboot.EnumArchType.ARM\n scimg.Compression = uboot.EnumCompressionType.NONE\n scimg.EntryAddress = 0\n scimg.LoadAddress = 0\n scimg.append(\"echo\", \"'===== U-Boot settings ====='\")\n scimg.append(\"setenv\", \"stdin serial\")\n scimg.append(\"setenv\", \"stdout serial\")\n scimg.append(\"setenv\", \"rootdev mmcblk2p2\")\n\n # --------------------------------------------------------------------------------\n # create multi-file image\n # --------------------------------------------------------------------------------\n mimg = uboot.MultiImage(name=\"Multi-File Test Image\",\n laddr=0,\n eaddr=0,\n arch=uboot.EnumArchType.ARM,\n os=uboot.EnumOsType.LINUX,\n compress=uboot.EnumCompressionType.NONE)\n mimg.append(fwimg)\n mimg.append(scimg)\n # print created image info\n print(mimg)\n\n # --------------------------------------------------------------------------------\n # save created image into file: uboot_mimg.img\n # --------------------------------------------------------------------------------\n with open(\"uboot_mimg.img\", \"wb\") as f:\n f.write(mimg.export())\n\n # --------------------------------------------------------------------------------\n # open and read image file: uboot_mimg.img\n # --------------------------------------------------------------------------------\n with open(\"uboot_mimg.img\", \"rb\") as f:\n data = f.read()\n\n # --------------------------------------------------------------------------------\n # parse binary data into new img object of specific image type\n # --------------------------------------------------------------------------------\n img = uboot.parse_img(data)\n\n # print parsed image info\n print(img)\n\n.. |Build Status| image:: https://travis-ci.org/molejar/pyUBoot.svg?branch=master\n :target: https://travis-ci.org/molejar/pyUBoot\n.. |Coverage Status| image:: https://coveralls.io/repos/github/molejar/pyUBoot/badge.svg?branch=master\n :target: https://coveralls.io/github/molejar/pyUBoot?branch=master\n.. |PyPI Status| image:: https://img.shields.io/pypi/v/uboot.svg\n :target: https://pypi.python.org/pypi/uboot\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/uboot.svg\n :target: https://www.python.org\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/molejar/pyUBoot", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "uboot", "package_url": "https://pypi.org/project/uboot/", "platform": "", "project_url": "https://pypi.org/project/uboot/", "project_urls": { "Homepage": "https://github.com/molejar/pyUBoot" }, "release_url": "https://pypi.org/project/uboot/0.1.1/", "requires_dist": [ "click (==7.0)", "easy-enum (==0.2.0)", "fdt (==0.1.2)" ], "requires_python": ">=3.6", "summary": "Open Source library for manipulating with U-Boot images and environment variables", "version": "0.1.1" }, "last_serial": 5564922, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5a9064a43d9cf5233a1edf5cfe6f8208", "sha256": "1d4236ba4cddc00a1a1db2fc530e35a3699f13f08dc7e9336fe084b8bcec7a70" }, "downloads": -1, "filename": "uboot-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5a9064a43d9cf5233a1edf5cfe6f8208", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 27721, "upload_time": "2018-05-09T20:23:36", "url": "https://files.pythonhosted.org/packages/99/86/43f8d635114b79693695cacaf1e6cdb68fbce0cb021b0baea766df996e01/uboot-0.1.0-py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1ef7e8af51d9a26455ba48c153fd8719", "sha256": "55b703df4dcce1eb4dad42c427dc71d64f3fba25db3cae8ad2647b738e5a8369" }, "downloads": -1, "filename": "uboot-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1ef7e8af51d9a26455ba48c153fd8719", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 28121, "upload_time": "2019-07-21T22:31:25", "url": "https://files.pythonhosted.org/packages/b7/0e/989c8b041ed265efa20c9e49ae20f103c5c41de66556cd2eed2a792758cd/uboot-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ebc48586e6500d4c70fbc7a3c152b957", "sha256": "1b50f3d1653ebdf8269c715ab718f245eac082ebd41d6ac1e25c386e75a090a7" }, "downloads": -1, "filename": "uboot-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ebc48586e6500d4c70fbc7a3c152b957", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 20121, "upload_time": "2019-07-21T22:31:26", "url": "https://files.pythonhosted.org/packages/b4/5f/aaf85e1680f7e075550943fe7a84a1759448aab5338185ff8c2b479ce796/uboot-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1ef7e8af51d9a26455ba48c153fd8719", "sha256": "55b703df4dcce1eb4dad42c427dc71d64f3fba25db3cae8ad2647b738e5a8369" }, "downloads": -1, "filename": "uboot-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1ef7e8af51d9a26455ba48c153fd8719", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 28121, "upload_time": "2019-07-21T22:31:25", "url": "https://files.pythonhosted.org/packages/b7/0e/989c8b041ed265efa20c9e49ae20f103c5c41de66556cd2eed2a792758cd/uboot-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ebc48586e6500d4c70fbc7a3c152b957", "sha256": "1b50f3d1653ebdf8269c715ab718f245eac082ebd41d6ac1e25c386e75a090a7" }, "downloads": -1, "filename": "uboot-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ebc48586e6500d4c70fbc7a3c152b957", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 20121, "upload_time": "2019-07-21T22:31:26", "url": "https://files.pythonhosted.org/packages/b4/5f/aaf85e1680f7e075550943fe7a84a1759448aab5338185ff8c2b479ce796/uboot-0.1.1.tar.gz" } ] }