Skip to content

Commit 72d18a7

Browse files
committed
readme: make prebuilt work brutally
1 parent f40e584 commit 72d18a7

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ gitignore*
88
# Specific files.
99
/data
1010
/gem5/out
11-
/images-*.zip
11+
/lkmc-*.zip
1212
/out
1313
/out.*
1414

README.adoc

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -531,52 +531,49 @@ The limitations are severe however:
531531
Maybe we could work around this by just downloading the kernel source somehow, and using a host prebuilt GDB, but we felt that it would be too messy and unreliable.
532532
* can't create new modules or modify the existing ones, since no cross toolchain
533533
* you won't get the latest version of this repository. Our <<travis>> attempt to automate builds failed, and storing a release for every commit would likely make GitHub mad at us.
534-
* <<gem5>> is not currently supported, although it should not be too hard to do.
535-
+
536-
Annoyances:
534+
* <<gem5>> is not currently supported, although it should not be too hard to do. Annoyances:
537535
+
538536
** there is no Debian package for it, so you have to compile your own, so you might as well just build the image itself
539537
** it does not handle <<gem5-qcow2,qcow2>>, and we haven't gotten <<squashfs>> to work yet, therefore we would have to either distribute large ext2 images, or constantly fight with <<br2_target_rootfs_ext2_size>>
540-
** QEMU uses bzImage and gdm5 the raw `vmlinux`, and we don't want to distribute the same thing twice... https://github.com/torvalds/linux/blob/master/scripts/extract-vmlinux We could use `extract-vmlinux`, but that would imply cloning the Linux kernel, which is at least half of the kernel build time :-)
538+
** QEMU uses `bzImage` and gem5 the raw `vmlinux`, and we don't want to distribute the same thing twice...
539+
+
540+
And our attempt at using link:https://github.com/torvalds/linux/blob/master/scripts/extract-vmlinux[`extract-vmlinux`] failed for `aarch64` with:
541+
+
542+
....
543+
run-detectors: unable to find an interpreter for
544+
....
541545

542546
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? :-)
543547

544548
==== Prebuilt setup getting started
545549

546-
Download this repo:
550+
Some times it works with the host QEMU:
547551

548552
....
553+
sudo apt-get install qemu-system-x86
549554
git clone https://github.com/cirosantilli/linux-kernel-module-cheat
550555
cd linux-kernel-module-cheat
551-
....
552-
553-
Go to the latest release link:https://github.com/cirosantilli/linux-kernel-module-cheat/releases[], download the `lkmc-*.zip` file and extract it into the repository:
554-
555-
....
556+
./download-latest-release
556557
unzip lkmc-*.zip
558+
./run --prebuilt
557559
....
558560

559-
It is link:https://stackoverflow.com/questions/24987542/is-there-a-link-to-github-for-downloading-a-file-in-the-latest-release-of-a-repo/50540591#50540591[not possible to automate this step without the API], and I'm not venturing there at this time, pull requests welcome.
560-
561-
Checkout to the prebuilt repo version so that the scripts and documentation will be compatible with it, and run with the `--prebuilt` option:
561+
but to be sure, build your own at a tested revision:
562562

563563
....
564-
git checkout <release-sha>
565564
git submodule update --init --recursive "$(./getvar qemu_src_dir)"
566565
./build-qemu
567566
./run
568567
....
569568

570-
and you are done.
569+
This also allows you to <<your-first-kernel-hack,modify QEMU>> if you're into that sort of thing.
571570

572-
Alternatively, you can also try to use the host QEMU directly with:
571+
To try an older prebuilt:
573572

574-
....
575-
sudo apt-get install qemu-system-x86 qemu-utils
576-
./run --prebuilt
577-
....
573+
* download it from: link:https://github.com/cirosantilli/linux-kernel-module-cheat/releases[]
574+
* checkout this repo to match the SHA of the release
578575

579-
but QEMU builds are pretty quick, and this further increases the probability of incompatibilities, are you really that lazy?
576+
then do whatever that checked out README says.
580577

581578
////
582579
For gem5, do:

download-latest-release

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/env python3
22

3+
'''
4+
Download the latest release from GitHub:
5+
https://stackoverflow.com/questions/24987542/is-there-a-link-to-github-for-downloading-a-file-in-the-latest-release-of-a-repo/50540591#50540591
6+
'''
7+
38
import json
49
import urllib.request
510

0 commit comments

Comments
 (0)