diff --git a/repos/dde_linux/src/include/spec/x86/lx_emul/shadow/asm/cpufeature.h b/repos/dde_linux/src/include/spec/x86/lx_emul/shadow/asm/cpufeature.h index f74047e444..a9accc8131 100644 --- a/repos/dde_linux/src/include/spec/x86/lx_emul/shadow/asm/cpufeature.h +++ b/repos/dde_linux/src/include/spec/x86/lx_emul/shadow/asm/cpufeature.h @@ -17,6 +17,7 @@ #define boot_cpu_has(bit) 0 #define static_cpu_has(bit) boot_cpu_has(bit) +#define static_cpu_has_bug(bit) static_cpu_has((bit)) #define cpu_has(value, bit) ( (void)value, 0 ) #endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */ diff --git a/tool/run/image/disk b/tool/run/image/disk index 375fdf3f25..59245d05be 100644 --- a/tool/run/image/disk +++ b/tool/run/image/disk @@ -27,13 +27,11 @@ proc run_image { {unused ""} } { set size_header [expr [regsub {\s.*} [exec du -b [run_dir].header] {}]] set size_run [expr [regsub {\s.*} [exec du -skL [run_dir]] {}]] - # try to compensate ext2 overhead in disk size - set ext2_overhead 768 - if {[image_disk_size] > 0} { set disk_size_kb [expr [image_disk_size] * 1024] } else { - set disk_size_kb [expr ($size_run + $ext2_overhead) / 32 * 32] + # set disk size to 1.5 times the run folder size; will be shrinked later + set disk_size_kb [expr ($size_run * 3 / 2) / 32 * 32] } # setup partition with content @@ -54,6 +52,13 @@ proc run_image { {unused ""} } { } } + if {[image_disk_size] == 0} { + # resize image to only needed size and get size of resized image + exec resize2fs -M [run_dir].partition 2>/dev/null + set disk_size_b [expr [regsub {\s.*} [exec wc -c [run_dir].partition] {}]] + set disk_size_kb [expr $disk_size_b / 1024] + } + # calculate start/end sector of content partition set first_sector [expr $size_header / 512] set last_sector [expr ((($size_header + ($disk_size_kb * 1024)) / 512) - 1)]