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 if not os.path.exists(os.path.join(updater_path, 'init')):
64 os.symlink('bin/init', os.path.join(updater_path, 'init'))
65 if not os.path.exists(os.path.join(updater_path, 'system/bin')):
66 os.symlink('/bin', os.path.join(updater_path, 'system/bin'))
67 if not os.path.exists(os.path.join(updater_path, 'system/lib')):
68 os.symlink('/lib', os.path.join(updater_path, 'system/lib'))
70 if not os.path.exists(os.path.join(updater_path, 'system/lib64')):
71 os.symlink('/lib64', os.path.join(updater_path, 'system/lib64'))
72 if not os.path.exists(os.path.join(updater_path, 'vendor/lib64')):
73 os.symlink('/lib64', os.path.join(updater_path, 'vendor/lib64'))
75 if not os.path.exists(os.path.join(updater_path, 'vendor/lib')):
76 os.symlink('/lib', os.path.join(updater_path, 'vendor/lib'))
77 if not os.path.exists(os.path.join(updater_path, 'system/etc')):
78 os.symlink('/etc', os.path.join(updater_path, 'system/etc'))
84 _path = os.path.join(ramdisk_path, _dir_name)
85 if os.path.exists(_path):
87 os.makedirs(_path, exist_ok=True)
88 if not os.path.exists(os.path.join(ramdisk_path, 'init')):
89 os.symlink('bin/init_early', os.path.join(ramdisk_path, 'init'))
93 if os.path.exists(eng_system_path):
95 os.makedirs(eng_system_path, exist_ok=True)
100 _path = os.path.join(eng_system_path, _dir_name)
101 if os.path.exists(_path):
103 os.makedirs(_path, exist_ok=True)
106 _path = os.path.join(eng_system_path, 'etc', _dir_name)
107 if os.path.exists(_path):
109 os.makedirs(_path, exist_ok=True)
110 _target_policy_path = os.path.join(eng_system_path, 'etc', 'selinux', 'targeted', 'policy')
111 if os.path.exists(_target_policy_path):
113 os.makedirs(_target_policy_path, exist_ok=True)
115 copy_eng_system_config = os.path.join(root_path, "build/ohos/images/mkimage/root_image.json")
121 if(os.path.exists(dest_file)):
122 os.remove(dest_file)
123 if(os.path.exists(sources_file)):
140 if (os.path.exists(args.device_image_config_file)):
148 os.environ['PATH'] = '{}:{}'.format(env_path, os.environ.get('PATH'))
169 if os.path.exists(args.output_image_path):
170 os.remove(args.output_image_path)
175 if os.path.isdir(args.input_path):
178 for _root, _, _files in os.walk(args.input_path):
180 _dep_files.append(os.path.join(_root, _file))
181 if (os.path.exists(args.device_image_config_file)):