mirror of
https://github.com/qilingframework/qiling.git
synced 2026-10-12 02:21:40 +00:00
Better handling of rootfs default
This commit is contained in:
+2
-5
@@ -30,7 +30,7 @@ class Qiling(QlCoreHooks, QlCoreStructs):
|
||||
def __init__(
|
||||
self,
|
||||
argv: Sequence[str] = None,
|
||||
rootfs: str = None,
|
||||
rootfs: str = r'.',
|
||||
env: MutableMapping[AnyStr, AnyStr] = {},
|
||||
code: bytes = None,
|
||||
ostype: Union[str, QL_OS] = None,
|
||||
@@ -100,10 +100,7 @@ class Qiling(QlCoreHooks, QlCoreStructs):
|
||||
################
|
||||
# rootfs setup #
|
||||
################
|
||||
if rootfs is None:
|
||||
rootfs = '.'
|
||||
|
||||
elif not os.path.exists(rootfs):
|
||||
if not os.path.exists(rootfs):
|
||||
raise QlErrorFileNotFound(f'Target rootfs not found: "{rootfs}"')
|
||||
|
||||
self._rootfs = rootfs
|
||||
|
||||
@@ -187,7 +187,7 @@ if __name__ == '__main__':
|
||||
code_parser.add_argument('--thumb', action='store_true', help='specify thumb mode for ARM')
|
||||
code_parser.add_argument('--endian', choices=('little', 'big'), default='little', help='specify endianess for bi-endian archs')
|
||||
code_parser.add_argument('--os', required=True, choices=os_map)
|
||||
code_parser.add_argument('--rootfs', help='emulated root filesystem, that is where all libraries reside')
|
||||
code_parser.add_argument('--rootfs', default='.', help='emulated root filesystem, that is where all libraries reside')
|
||||
code_parser.add_argument('--format', choices=('asm', 'hex', 'bin'), default='bin', help='input file format')
|
||||
|
||||
# set "examples" subcommand
|
||||
@@ -223,7 +223,7 @@ if __name__ == '__main__':
|
||||
handle_examples(parser)
|
||||
|
||||
# ql file setup
|
||||
if options.subcommand == 'run':
|
||||
elif options.subcommand == 'run':
|
||||
ql = handle_run(options)
|
||||
|
||||
# ql code setup
|
||||
|
||||
Reference in New Issue
Block a user