mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
dhrystone: fix build, overlay directory was not being created
This commit is contained in:
@@ -11028,6 +11028,8 @@ TODO automate run more nicely.
|
|||||||
Build for <<baremetal>> execution and run it in baremetal QEMU:
|
Build for <<baremetal>> execution and run it in baremetal QEMU:
|
||||||
|
|
||||||
....
|
....
|
||||||
|
# Build our Newlib stubs.
|
||||||
|
./build-baremetal --arch aarch64
|
||||||
./build-dhrystone --arch aarch64 --mode baremetal
|
./build-dhrystone --arch aarch64 --mode baremetal
|
||||||
./run --arch aarch64 --baremetal "$(./getvar baremetal_build_dir)/submodules/dhrystone/dhrystone"
|
./run --arch aarch64 --baremetal "$(./getvar baremetal_build_dir)/submodules/dhrystone/dhrystone"
|
||||||
....
|
....
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ https://cirosantilli.com/linux-kernel-module-cheat#dhrystone
|
|||||||
if ret == 0 and self.env['mode'] == 'userland':
|
if ret == 0 and self.env['mode'] == 'userland':
|
||||||
self.sh.copy_file_if_update(
|
self.sh.copy_file_if_update(
|
||||||
os.path.join(build_dir, 'dhrystone'),
|
os.path.join(build_dir, 'dhrystone'),
|
||||||
os.path.join(self.env['out_rootfs_overlay_lkmc_dir'], self.root_relpath),
|
os.path.join(self.env['out_rootfs_overlay_lkmc_dir'], self.root_relpath, 'dhrystone'),
|
||||||
)
|
)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|||||||
@@ -162,14 +162,15 @@ class ShellHelpers:
|
|||||||
ending = last_newline + ';'
|
ending = last_newline + ';'
|
||||||
return newline_separator.join(out) + ending
|
return newline_separator.join(out) + ending
|
||||||
|
|
||||||
def copy_file_if_update(self, src, dest):
|
def copy_file_if_update(self, src, destfile):
|
||||||
if os.path.isdir(dest):
|
if os.path.isdir(destfile):
|
||||||
dest = os.path.join(dest, os.path.basename(src))
|
destfile = os.path.join(destfile, os.path.basename(src))
|
||||||
|
self.mkdir_p(os.path.dirname(destfile))
|
||||||
if (
|
if (
|
||||||
not os.path.exists(dest) or \
|
not os.path.exists(destfile) or \
|
||||||
os.path.getmtime(src) > os.path.getmtime(dest)
|
os.path.getmtime(src) > os.path.getmtime(destfile)
|
||||||
):
|
):
|
||||||
self.cp(src, dest)
|
self.cp(src, destfile)
|
||||||
|
|
||||||
def copy_dir_if_update_non_recursive(
|
def copy_dir_if_update_non_recursive(
|
||||||
self,
|
self,
|
||||||
@@ -221,6 +222,11 @@ class ShellHelpers:
|
|||||||
else:
|
else:
|
||||||
shutil.copy2(src, dest)
|
shutil.copy2(src, dest)
|
||||||
|
|
||||||
|
def mkdir_p(self, d):
|
||||||
|
self.print_cmd(['mkdir', d, LF])
|
||||||
|
if not self.dry_run:
|
||||||
|
os.makedirs(d, exist_ok=True)
|
||||||
|
|
||||||
def mv(self, src, dest, **kwargs):
|
def mv(self, src, dest, **kwargs):
|
||||||
self.print_cmd(['mv', src, dest])
|
self.print_cmd(['mv', src, dest])
|
||||||
if not self.dry_run:
|
if not self.dry_run:
|
||||||
|
|||||||
Reference in New Issue
Block a user