mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 12:04:27 +01:00
build: add --apt option to make things easier on other distros
This commit is contained in:
14
README.adoc
14
README.adoc
@@ -11276,13 +11276,23 @@ gem5:
|
|||||||
|
|
||||||
We tend to test this repo the most on the latest Ubuntu and on the latest link:https://askubuntu.com/questions/16366/whats-the-difference-between-a-long-term-support-release-and-a-normal-release[Ubuntu LTS].
|
We tend to test this repo the most on the latest Ubuntu and on the latest link:https://askubuntu.com/questions/16366/whats-the-difference-between-a-long-term-support-release-and-a-normal-release[Ubuntu LTS].
|
||||||
|
|
||||||
For other Linux distros, everything will likely also just work if you install the analogous required packages for your distro, find them out with:
|
For other Linux distros, everything will likely also just work if you install the analogous required packages for your distro
|
||||||
|
|
||||||
|
Find out the packages that we install with:
|
||||||
|
|
||||||
....
|
....
|
||||||
./build --download-dependencies --dry-run
|
./build --download-dependencies --dry-run
|
||||||
....
|
....
|
||||||
|
|
||||||
which just prints what `build` would do quickly without doing anything.
|
and then just look for the `apt-get` commands shown on the log.
|
||||||
|
|
||||||
|
After installing the missing packages for your distro, do the build with:
|
||||||
|
|
||||||
|
....
|
||||||
|
./build --download-dependencies --no-apt
|
||||||
|
....
|
||||||
|
|
||||||
|
which does everything as normal, except that it skips any `apt` commands.
|
||||||
|
|
||||||
Ports to new host systems are welcome and will be merged.
|
Ports to new host systems are welcome and will be merged.
|
||||||
|
|
||||||
|
|||||||
33
build
33
build
@@ -338,6 +338,14 @@ so looping over all of them would waste time.
|
|||||||
}
|
}
|
||||||
self.component_to_name_map = {self.name_to_component_map[key]:key for key in self.name_to_component_map}
|
self.component_to_name_map = {self.name_to_component_map[key]:key for key in self.name_to_component_map}
|
||||||
|
|
||||||
|
self.add_argument(
|
||||||
|
'--apt',
|
||||||
|
default=True,
|
||||||
|
help='''\
|
||||||
|
Don't run any apt-get commands. To make it easier to use with other archs:
|
||||||
|
https://github.com/cirosantilli/linux-kernel-module-cheat#supported-hosts
|
||||||
|
'''
|
||||||
|
)
|
||||||
self.add_argument(
|
self.add_argument(
|
||||||
'--download-dependencies',
|
'--download-dependencies',
|
||||||
default=False,
|
default=False,
|
||||||
@@ -461,20 +469,21 @@ Which components to build. Default: qemu-buildroot
|
|||||||
y = ['-y']
|
y = ['-y']
|
||||||
else:
|
else:
|
||||||
y = []
|
y = []
|
||||||
self.sh.run_cmd(
|
if self.env['apt']:
|
||||||
sudo + ['apt-get', 'update', LF]
|
|
||||||
)
|
|
||||||
if apt_get_pkgs:
|
|
||||||
self.sh.run_cmd(
|
self.sh.run_cmd(
|
||||||
sudo + ['apt-get', 'install'] + y + [LF] +
|
sudo + ['apt-get', 'update', LF]
|
||||||
self.sh.add_newlines(sorted(apt_get_pkgs))
|
|
||||||
)
|
|
||||||
if apt_build_deps:
|
|
||||||
self.sh.run_cmd(
|
|
||||||
sudo +
|
|
||||||
['apt-get', 'build-dep'] + y + [LF] +
|
|
||||||
self.sh.add_newlines(sorted(apt_build_deps))
|
|
||||||
)
|
)
|
||||||
|
if apt_get_pkgs:
|
||||||
|
self.sh.run_cmd(
|
||||||
|
sudo + ['apt-get', 'install'] + y + [LF] +
|
||||||
|
self.sh.add_newlines(sorted(apt_get_pkgs))
|
||||||
|
)
|
||||||
|
if apt_build_deps:
|
||||||
|
self.sh.run_cmd(
|
||||||
|
sudo +
|
||||||
|
['apt-get', 'build-dep'] + y + [LF] +
|
||||||
|
self.sh.add_newlines(sorted(apt_build_deps))
|
||||||
|
)
|
||||||
if python2_pkgs:
|
if python2_pkgs:
|
||||||
self.sh.run_cmd(
|
self.sh.run_cmd(
|
||||||
['python', '-m', 'pip', 'install', '--user', LF] +
|
['python', '-m', 'pip', 'install', '--user', LF] +
|
||||||
|
|||||||
Reference in New Issue
Block a user