mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-24 10:41:35 +01:00
investigate squashfs to overcome BR2_TARGET_ROOTFS_EXT2_SIZE but fail
Generate qcow2 when running QEMU if it is not present.
This commit is contained in:
31
run
31
run
@@ -125,7 +125,7 @@ def main(args, extra_args=None):
|
||||
os.path.join(common.gem5_src_dir, 'configs', 'example', 'arm', 'fs_bigLITTLE.py'),
|
||||
'--big-cpus', '2',
|
||||
'--cpu-type', 'atomic',
|
||||
'--disk', common.ext2_file,
|
||||
'--disk', common.rootfs_raw_file,
|
||||
'--dtb', os.path.join(common.gem5_system_dir, 'arm', 'dt', 'armv8_gem5_v1_big_little_2_2.dtb'),
|
||||
'--kernel', common.vmlinux,
|
||||
'--little-cpus', '2'
|
||||
@@ -138,7 +138,7 @@ def main(args, extra_args=None):
|
||||
extra_emulator_args.extend(['-r', str(sorted(cpt_dirs).index(cpt_dir) + 1)])
|
||||
cmd += [
|
||||
common.gem5_fs_file,
|
||||
'--disk-image', common.ext2_file,
|
||||
'--disk-image', common.rootfs_raw_file,
|
||||
'--kernel', common.vmlinux,
|
||||
'--mem-size', memory,
|
||||
'--num-cpus', str(args.cpus),
|
||||
@@ -159,6 +159,19 @@ def main(args, extra_args=None):
|
||||
else:
|
||||
extra_emulator_args.extend(extra_qemu_args)
|
||||
os.makedirs(common.run_dir, exist_ok=True)
|
||||
if args.prebuilt:
|
||||
common.mkdir()
|
||||
qemu_executable = "qemu-system-{}".format(args.arch)
|
||||
else:
|
||||
qemu_executable = common.qemu_executable
|
||||
if not os.path.exists(qemu_executable):
|
||||
raise Exception('QEMU executable does not exist, did you forget to build or install it?\n' \
|
||||
'Tried to use: ' + qemu_executable)
|
||||
if not os.path.exists(common.qcow2_file):
|
||||
if not os.path.exists(common.rootfs_raw_file):
|
||||
raise Exception('Root filesystem not found. Did you build it?\n' \
|
||||
'Tried to use: ' + common.rootfs_raw_file)
|
||||
common.raw_to_qcow2()
|
||||
if args.debug_vm:
|
||||
serial_monitor = []
|
||||
else:
|
||||
@@ -167,11 +180,6 @@ def main(args, extra_args=None):
|
||||
extra_emulator_args.append('-enable-kvm')
|
||||
if args.kgdb:
|
||||
extra_emulator_args.extend(['-serial', 'tcp::{},server,nowait'.format(common.gdb_port)])
|
||||
if args.prebuilt:
|
||||
common.mkdir()
|
||||
qemu_executable = "qemu-system-{}".format(args.arch)
|
||||
else:
|
||||
qemu_executable = common.qemu_executable
|
||||
cmd = (
|
||||
debug_vm +
|
||||
[
|
||||
@@ -212,12 +220,6 @@ def main(args, extra_args=None):
|
||||
'-drive',
|
||||
'file={},format=qcow2,if={}{}{}'.format(common.qcow2_file, driveif, snapshot, rrid)
|
||||
])
|
||||
if not os.path.exists(common.qcow2_file):
|
||||
raise Exception(
|
||||
'Cannot find the qcow2 root filesystem. You must build QEMU\n'
|
||||
'before building the root filesystem? That is needed because the qcow2\n' +
|
||||
'is created with qemu-img. Tried to use: ' + qemu_executable
|
||||
)
|
||||
if rr:
|
||||
extra_emulator_args.extend([
|
||||
'-drive', 'driver=blkreplay,if=none,image=img-direct,id=img-blkreplay',
|
||||
@@ -257,9 +259,6 @@ def main(args, extra_args=None):
|
||||
] +
|
||||
virtio_gpu_pci
|
||||
)
|
||||
if not os.path.exists(qemu_executable):
|
||||
raise Exception('QEMU executable does not exist, did you forget to build or install it?\n' +
|
||||
'Tried to use: ' + qemu_executable)
|
||||
if args.tmux:
|
||||
if args.gem5:
|
||||
subprocess.Popen([os.path.join(common.root_dir, 'tmu'),
|
||||
|
||||
Reference in New Issue
Block a user