Lines Matching refs:os
17 import os
24 os.path.dirname(os.path.dirname(os.path.dirname(
25 os.path.abspath(__file__)))))
31 if os.path.exists(userdata_path):
33 os.makedirs(userdata_path, exist_ok=True)
37 root_dir = os.path.join(os.path.dirname(system_path), 'root')
38 if os.path.exists(root_dir):
40 os.makedirs(root_dir, exist_ok=True)
46 os.makedirs(os.path.join(root_dir, _dir_name), exist_ok=True)
47 os.symlink('/system/bin', os.path.join(root_dir, 'bin'))
48 os.symlink('/system/bin/init', os.path.join(root_dir, 'init'))
49 os.symlink('/system/etc', os.path.join(root_dir, 'etc'))
50 os.symlink('/vendor', os.path.join(root_dir, 'chipset'))
52 os.symlink('/system/lib64', os.path.join(root_dir, 'lib64'))
53 os.symlink('/system/lib', os.path.join(root_dir, 'lib'))
59 _path = os.path.join(updater_path, _dir_name)
60 if os.path.exists(_path):
62 os.makedirs(_path, exist_ok=True)
63 os.symlink('bin/init', os.path.join(updater_path, 'init'))
64 os.symlink('/bin', os.path.join(updater_path, 'system/bin'))
65 os.symlink('/lib', os.path.join(updater_path, 'system/lib'))
67 os.symlink('/lib64', os.path.join(updater_path, 'system/lib64'))
68 os.symlink('/lib64', os.path.join(updater_path, 'vendor/lib64'))
70 os.symlink('/lib', os.path.join(updater_path, 'vendor/lib'))
71 os.symlink('/etc', os.path.join(updater_path, 'system/etc'))
77 _path = os.path.join(ramdisk_path, _dir_name)
78 if os.path.exists(_path):
80 os.makedirs(_path, exist_ok=True)
81 os.symlink('bin/init_early', os.path.join(ramdisk_path, 'init'))
85 if os.path.exists(eng_system_path):
87 os.makedirs(eng_system_path, exist_ok=True)
92 _path = os.path.join(eng_system_path, _dir_name)
93 if os.path.exists(_path):
95 os.makedirs(_path, exist_ok=True)
98 _path = os.path.join(eng_system_path, 'etc', _dir_name)
99 if os.path.exists(_path):
101 os.makedirs(_path, exist_ok=True)
102 _target_policy_path = os.path.join(eng_system_path, 'etc', 'selinux', 'targeted', 'policy')
103 if os.path.exists(_target_policy_path):
105 os.makedirs(_target_policy_path, exist_ok=True)
107 copy_eng_system_config = os.path.join(root_path, "build/ohos/images/mkimage/root_image.json")
113 if(os.path.exists(dest_file)):
114 os.remove(dest_file)
115 if(os.path.exists(sources_file)):
132 if (os.path.exists(args.device_image_config_file)):
140 os.environ['PATH'] = '{}:{}'.format(env_path, os.environ.get('PATH'))
161 if os.path.exists(args.output_image_path):
162 os.remove(args.output_image_path)
167 if os.path.isdir(args.input_path):
170 for _root, _, _files in os.walk(args.input_path):
172 _dep_files.append(os.path.join(_root, _file))
173 if (os.path.exists(args.device_image_config_file)):