release: add baremetal prebuilts. +3MiB.

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent fdfe2e8d31
commit fafc24a948
2 changed files with 26 additions and 14 deletions

View File

@@ -493,18 +493,20 @@ TODO make files created inside Docker be owned by the current user in host inste
* https://stackoverflow.com/questions/31779802/shared-volume-file-permissions-ownership-docker
[[prebuilt]]
=== Prebuilt Buildroot setup
=== Prebuilt setup
==== About the prebuilt Buildroot setup
==== About the prebuilt setup
This setup uses prebuilt binaries of the <<qemu-buildroot-setup>> that we upload to GitHub from time to time.
This setup uses prebuilt binaries that we upload to GitHub from time to time.
We don't currently provide a full prebuilt because it would be too big to host freely, notably because of the cross toolchain.
Our prebuilts currently include:
* Linux kernel
* root filesystem
* <<qemu-buildroot-setup>> binaries
** Linux kernel
** root filesystem
* <<baremetal-setup>> binaries for QEMU
For more details, see our our <<release,release procedure>>.
@@ -520,9 +522,9 @@ Maybe we could work around this by just downloading the kernel source somehow, a
This setup might be good enough for those developing simulators, as that requires less image modification. But once again, if you are serious about this, why not just let your computer build the <<qemu-buildroot-setup,full featured setup>> while you take a coffee or a nap? :-)
==== Prebuilt Buildroot setup getting started
==== Prebuilt setup getting started
Checkout to the latest tag and use the Ubuntu packaged QEMU:
Checkout to the latest tag and use the Ubuntu packaged QEMU to boot Linux:
....
sudo apt-get install qemu-system-x86
@@ -534,6 +536,12 @@ unzip lkmc-*.zip
./run --prebuilt
....
Or to run a baremetal example instead:
....
./run --arch aarch64 --baremetal baremetal/hello.c --prebuilt
....
You have to checkout to the latest tag to ensure that the scripts match the release format: https://stackoverflow.com/questions/1404796/how-to-get-the-latest-tag-name-in-current-branch-in-git
Be saner and use our custom built QEMU instead:

View File

@@ -15,21 +15,25 @@ https://github.com/cirosantilli/linux-kernel-module-cheat#release-zip
'print_time': False,
}
)
self.qcow2s_linux_images = []
self.zip_files = []
def timed_main(self):
self.qcow2s_linux_images.append((self.env['qcow2_file'], self.env['linux_image']))
self.zip_files.append(self.env['qcow2_file'])
self.zip_files.append(self.env['linux_image'])
for root, dirs, files in os.walk(self.env['baremetal_build_dir']):
for file in files:
path = os.path.join(root, file)
if os.path.splitext(path)[1] == self.env['baremetal_build_ext']:
self.zip_files.append(path)
def teardown(self):
os.makedirs(self.env['release_dir'], exist_ok=True)
self.sh.rmrf(self.env['release_zip_file'])
self.log_info('Creating zip: ' + self.env['release_zip_file'])
with zipfile.ZipFile(self.env['release_zip_file'], 'w', zipfile.ZIP_DEFLATED) as zipf:
for qcow2, linux_image in self.qcow2s_linux_images:
self.log_info('Adding file: ' + qcow2)
zipf.write(qcow2, arcname=os.path.relpath(qcow2, self.env['root_dir']))
self.log_info('Adding file: ' + linux_image)
zipf.write(linux_image, arcname=os.path.relpath(linux_image, self.env['root_dir']))
for zip_file in self.zip_files:
self.log_info('Adding file: ' + zip_file)
zipf.write(zip_file, arcname=os.path.relpath(zip_file, self.env['root_dir']))
if __name__ == '__main__':
Main().cli()