{"id":18083129,"url":"https://github.com/progval/vmdebootstrap-raspi3","last_synced_at":"2025-10-07T15:34:00.611Z","repository":{"id":66987056,"uuid":"85469361","full_name":"progval/vmdebootstrap-raspi3","owner":"progval","description":"Fork of vmdebootstrap with patches from bdo/845439 and bdo/845526 applied.","archived":false,"fork":false,"pushed_at":"2017-03-19T11:37:18.000Z","size":245,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-12T05:39:03.559Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wiki.debian.org/RaspberryPi3","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/progval.png","metadata":{"files":{"readme":"README","changelog":"NEWS","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-19T11:03:21.000Z","updated_at":"2017-09-25T21:15:11.000Z","dependencies_parsed_at":"2023-05-16T16:45:13.602Z","dependency_job_id":null,"html_url":"https://github.com/progval/vmdebootstrap-raspi3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progval%2Fvmdebootstrap-raspi3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progval%2Fvmdebootstrap-raspi3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progval%2Fvmdebootstrap-raspi3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progval%2Fvmdebootstrap-raspi3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/progval","download_url":"https://codeload.github.com/progval/vmdebootstrap-raspi3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411238,"owners_count":20934654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-31T14:07:00.990Z","updated_at":"2025-10-07T15:34:00.523Z","avatar_url":"https://github.com/progval.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"README for vmdebootstrap\n========================\n\n`debootstrap` installs a basic Debian system into a directory, for use\nwith `chroot`(8). `vmdebootstrap` is a wrapper around it to install\nDebian into a disk image, which can be used with virtual machines or\nreal hardware.\n\nSee the manual page and `vmdebootstrap --help` for details on how to\nuse the program. The manual page has an example.\n\nLimitations\n-----------\n\n`vmdebootstrap` is aimed principally at creating virtual machines, not\ninstallers or prebuilt installation images. It is possible to create\nprebuilt installation images for some devices but this depends on the\nspecific device. (A 'prebuilt installation image' is a single image file\nwhich can be written to physical media in a single operation and which\nallows the device to boot directly into a fully installed system - in a\nsimilar way to how a virtual machine would behave.)\n\n* `vmdebootstrap` assumes that all operations take place on a local image\n   file, not a physical block device / removable media.\n* `vmdebootstrap` is intended to be used with tools like `qemu` on the\n   command line to launch a new virtual machine. Not all devices have\n   virtualisation support in hardware.\n\nThis has implications for `u-boot` support in some cases. If the device\ncan support reading the bootloader from a known partition, like the\nBeaglebone-black, then `vmdebootstrap` can provide space for the bootloader\nand the image will work as a prebuilt installation image. If the device\nexpects that the bootloader exists at a specific offset and therefore\nrequires that the bootloader is written as an image not as a binary which\ncan be copied into an existing partition, `vmdebootstrap` is unable to\ninclude that bootloader image into the virtual machine image.\n\nIt is possible to wrap `vmdebootstrap` in such a way as to prepare a\n*physical block device* with a bootloader image and then deploy the\nbootstrap on top. However, this does require physical media to be\ninserted and removed each time the wrapper is executed. Once you have\nworking media, an image can be created using ``dd`` to read back from\nthe media to an image file, allowing other media to be written with a\nsingle image file. To do this, use the `--tarball` option to `vmdebootstrap`\ninstead of the `--image`` option. Then setup the physical media and\nbootloader image as required for the device, redefine the partitions to\nmake space for the rootfs, create a filesystem on the physical media and\nunpack the `vmdebootstrap` tarball onto that filesystem.\n\nWhat you need\n-------------\n\nIn order to use vmdebootstrap, you'll need a few things:\n\n* debootstrap\n* extlinux\n* qemu-img (in the qemu-utils package in Debian)\n* parted\n* mbr\n* kpartx\n* python-cliapp (see http://liw.fi/cliapp/)\n* python-distro-info\n\nTesting vmdebootstrap from git\n------------------------------\n\nThere is a strongly recommended git pre-commit hook available\nfor vmdebootstrap development - it requires the ``cmdtest``\npackage::\n\n ln -s ../../pre-commit.sh .git/hooks/pre-commit\n\nRunning vmdebootstrap from git\n------------------------------\n\n$ sudo PYTHONPATH=. ./bin/vmdebootstrap\n\nThis has changed slightly with version 1.0 with the need for\nPYTHONPATH to reference the module approach for support handlers.\n\nvmdebootstrap modules\n---------------------\n\nThe single vmdebootstrap script has been refactored to be the top\nlevel settings parser and validator and the point where the other\nmodules (handlers) get to be called in a collaborative sequence.\n\nThe new modules are an attempt to work with a DRY process as well\nas keeping the source code itself maintainable. Handler functions\nneed to check settings at the start so that calls to the handlers\ncan be retained in a simple flow. Where a function needs code from\nmultiple handlers, that function needs to be in the vmdebootstrap\nscript but these should, ideally, be single calls into dedicated\ncalls from the relevant handlers which can return True|False or\nraise cliapp.AppException to affect subsequent flow. Handlers must\nNOT hook into other handlers, except Base or constants, only the\nvmdebootstrap script has the full set, so use function arguments to\npass variables populated by different handlers. Wherever possible,\nlarge sections of new functionality need to be added as new handlers.\n\npylint\n------\n\nWhen using pylint, the following option is advised:\n\n $ pylint --ignore-imports=y vmdebootstrap\n\n(Despite the name of the option, this only ignores imports when\ncomputing similarities and various handlers will end up needing\nsimilar imports, it makes no sense to complain about that.)\n\nApart from that, vmdebootstrap uses pylint and contains comments to\ndisable certain pylint checks in certain areas. pylint compatibility\nwill make it easier to accept patches, just follow the existing pattern\nof pylint usage. pylint is far from perfect but can be helpful.\n\nTesting UEFI support\n--------------------\n\nThere is EFI firmware available to use with QEMU when testing images\nbuilt using the UEFI support, but this software is in Debian non-free\ndue to patent concerns. If you choose to use it to test UEFI builds,\na secondary change is also needed to symlink the provided OVMF.fd to\nthe file required by QEMU: bios-256k.bin and then tell QEMU about the\nlocation of this file with the -L option:\n\n$ qemu-system-x86_64 -L /usr/share/ovmf/ -machine accel=kvm \\\n  -m 4096 -smp 2 -drive file=amd64.img,format=raw\n\nNote the use of -drive file=\u003cimg\u003e,format=raw which is needed for newer\nversions of QEMU.\n\nThe vmextract helper\n--------------------\n\nOnce the image is built, various files can be generated or modified\nduring the install operations and some of these files can be useful\nwhen testing the image. One example is the initrd built by the process\nof installing a Debian kernel. Rather than having to mount the image\nand copy the files manually, the vmextract helper can do it for you,\nwithout needing root privileges.\n\n$ /usr/share/vmdebootstrap/vmextract.py --verbose \\\n  --image bbb/bbb-debian-armmp.img --boot \\\n  --path /boot/initrd.img-3.14-2-armmp \\\n  --path /lib/arm-linux-gnueabihf/libresolv.so.2\n\nThis uses python-guestfs (a Recommended package for vmdebootstrap) to\nprepare a read-only version of the image - in this case with the /boot\npartition also mounted - and copies files out into the current working\ndirectory.\n\nThe integration test suite\n--------------------------\n\nTo run the vmdebootstrap integration test suite, you need the yarn\ntool, which is part of cmdtest. See \u003chttp://liw.fi/cmdtest/\u003e and the\ncmdtest package in Debian. The command to run the tests is:\n\n    sudo yarns/run-tests\n\nYou can skip the slow tests that actually build images, by setting the\n`TESTS` variable:\n\n    sudo yarns/run-tests --env TESTS=fast\n\nTo format the test suite document:\n(needs pandoc installed)\n\n    make -C yarns\n\nMaking a release\n----------------\n\nRelease are best made with the bumper tool (http://liw.fi/bumper/),\nor simulating that by hand:\n\n* Update version number (`vmdebootstrap/version.py`, `NEWS`,\n  `debian/changelog`).\n* Also update `NEWS` to to say version is released (with date).\n* Commit, and tag the commit with `vmdebootstrap-x.y` for version x.y.\n* Update version number and `NEWS` again to say the version is\n  `x.y+git`. This makes it clear when a version is from git and not\n  frmo a release.\n* Commit.\n\nCI will then build and upload packages. CI is currently running on\nLars's home server.\n\nLegalese\n--------\n\nCopyright 2011-2013,2016  Lars Wirzenius\nCopyright 2012  Codethink Limited\nCopyright 2013-2016  Neil Williams\n \nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\nat your option) any later version.\n \nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n \nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogval%2Fvmdebootstrap-raspi3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogval%2Fvmdebootstrap-raspi3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogval%2Fvmdebootstrap-raspi3/lists"}