ColdWindScholar / MIO-KITCHEN-SOURCE

An Android Rom Tool in python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Windows] Unable to pack partitions "file not found"

vbajs opened this issue · comments

MIO-KITCHEN Source was used @ 2a9922f
Running Windows 11 and did the following steps to run

git clone https://github.com/ColdWindScholar/MIO-KITCHEN-SOURCE
cd MIO-KITCHEN-SOURCE
pip install -r requirements.txt
python tool.py

When attempting to pack any partition as either ext4 or erofs, the following error occurs

ERROR 0x2
Value:__name__=__main__
Value:__doc__=None
Value:__package__=None
Value:__loader__=<_frozen_importlib_external.SourceFileLoader object at 0x0000022B01FE4F90>
Value:__spec__=None
Value:__annotations__={}
Value:__builtins__=<module 'builtins' (built-in)>
Value:__file__=D:\ak\MIO-KITCHEN-SOURCE-win\tool.py
Value:__cached__=None
Value:mmap=<module 'mmap' (built-in)>
Value:platform=<module 'platform' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\platform.py'>
Value:subprocess=<module 'subprocess' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\subprocess.py'>
Value:wraps=<function wraps at 0x0000022B021CD940>
Value:AI_engine=<module 'AI_engine' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\AI_engine.py'>
Value:ext4=<module 'ext4' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\ext4.py'>
Value:json=<module 'json' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\json\\__init__.py'>
Value:os=<module 'os' (frozen)>
Value:shlex=<module 'shlex' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\shlex.py'>
Value:sys=<module 'sys' (built-in)>
Value:time=<module 'time' (built-in)>
Value:tk=<module 'tkinter' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\tkinter\\__init__.py'>
Value:ConfigParser=<class 'configparser.ConfigParser'>
Value:openurl=<function open at 0x0000022B052A2020>
Value:extra=<module 'extra' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\extra.py'>
Value:utils=<module 'utils' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\utils.py'>
Value:re=<module 're' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\re\\__init__.py'>
Value:contextpatch=<module 'contextpatch' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\contextpatch.py'>
Value:fspatch=<module 'fspatch' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\fspatch.py'>
Value:symlink=<function symlink at 0x0000022B04F5B1A0>
Value:updaterutil=<class 'extra.updaterutil'>
Value:script2fs_context=<function script2fs_context at 0x0000022B052A2E80>
Value:cz=<function cz at 0x0000022B05249760>
Value:jzxs=<function jzxs at 0x0000022B05249A80>
Value:v_code=<function v_code at 0x0000022B05249620>
Value:gettype=<function gettype at 0x0000022B04F398A0>
Value:findfile=<function findfile at 0x0000022B05249940>
Value:findfolder=<function findfolder at 0x0000022B052499E0>
Value:sdat2img=<class 'utils.sdat2img'>
Value:windnd=<module 'windnd' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\site-packages\\windnd\\__init__.py'>
Value:filedialog=<module 'tkinter.filedialog' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\tkinter\\filedialog.py'>
Value:zipfile=<module 'zipfile' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\zipfile.py'>
Value:BytesIO=<class '_io.BytesIO'>
Value:StringIO=<class '_io.StringIO'>
Value:machine=<function machine at 0x0000022B02B59260>
Value:TclError=<class '_tkinter.TclError'>
Value:NO=0
Value:FALSE=0
Value:OFF=0
Value:YES=1
Value:TRUE=1
Value:ON=1
Value:N=n
Value:S=s
Value:W=w
Value:E=e
Value:NW=nw
Value:SW=sw
Value:NE=ne
Value:SE=se
Value:NS=ns
Value:EW=ew
Value:NSEW=nsew
Value:CENTER=center
Value:NONE=none
Value:X=x
Value:Y=y
Value:BOTH=both
Value:LEFT=left
Value:TOP=top
Value:RIGHT=right
Value:BOTTOM=bottom
Value:RAISED=raised
Value:SUNKEN=sunken
Value:FLAT=flat
Value:RIDGE=ridge
Value:GROOVE=groove
Value:SOLID=solid
Value:HORIZONTAL=horizontal
Value:VERTICAL=vertical
Value:NUMERIC=numeric
Value:CHAR=char
Value:WORD=word
Value:BASELINE=baseline
Value:INSIDE=inside
Value:OUTSIDE=outside
Value:SEL=sel
Value:SEL_FIRST=sel.first
Value:SEL_LAST=sel.last
Value:END=end
Value:INSERT=insert
Value:CURRENT=current
Value:ANCHOR=anchor
Value:ALL=all
Value:NORMAL=normal
Value:DISABLED=disabled
Value:ACTIVE=active
Value:HIDDEN=hidden
Value:CASCADE=cascade
Value:CHECKBUTTON=checkbutton
Value:COMMAND=command
Value:RADIOBUTTON=radiobutton
Value:SEPARATOR=separator
Value:SINGLE=single
Value:BROWSE=browse
Value:MULTIPLE=multiple
Value:EXTENDED=extended
Value:DOTBOX=dotbox
Value:UNDERLINE=underline
Value:PIESLICE=pieslice
Value:CHORD=chord
Value:ARC=arc
Value:FIRST=first
Value:LAST=last
Value:BUTT=butt
Value:PROJECTING=projecting
Value:ROUND=round
Value:BEVEL=bevel
Value:MITER=miter
Value:MOVETO=moveto
Value:SCROLL=scroll
Value:UNITS=units
Value:PAGES=pages
Value:TkVersion=8.6
Value:TclVersion=8.6
Value:READABLE=2
Value:WRITABLE=4
Value:EXCEPTION=8
Value:EventType=<enum 'EventType'>
Value:Event=<class 'tkinter.Event'>
Value:NoDefaultRoot=<function NoDefaultRoot at 0x0000022B026D2E80>
Value:Variable=<class 'tkinter.Variable'>
Value:StringVar=<class 'tkinter.StringVar'>
Value:IntVar=<class 'tkinter.IntVar'>
Value:DoubleVar=<class 'tkinter.DoubleVar'>
Value:BooleanVar=<class 'tkinter.BooleanVar'>
Value:mainloop=<function mainloop at 0x0000022B026D32E0>
Value:getint=<class 'int'>
Value:getdouble=<class 'float'>
Value:getboolean=<function getboolean at 0x0000022B026B05E0>
Value:Misc=<class 'tkinter.Misc'>
Value:CallWrapper=<class 'tkinter.CallWrapper'>
Value:XView=<class 'tkinter.XView'>
Value:YView=<class 'tkinter.YView'>
Value:Wm=<class 'tkinter.Wm'>
Value:Tk=<class 'tkinter.Tk'>
Value:Tcl=<function Tcl at 0x0000022B026B07C0>
Value:Pack=<class 'tkinter.Pack'>
Value:Place=<class 'tkinter.Place'>
Value:Grid=<class 'tkinter.Grid'>
Value:BaseWidget=<class 'tkinter.BaseWidget'>
Value:Widget=<class 'tkinter.Widget'>
Value:Toplevel=<class 'tkinter.Toplevel'>
Value:Button=<class 'tkinter.Button'>
Value:Canvas=<class 'tkinter.Canvas'>
Value:Checkbutton=<class 'tkinter.Checkbutton'>
Value:Entry=<class 'tkinter.Entry'>
Value:Frame=<class 'tkinter.Frame'>
Value:Label=<class 'tkinter.Label'>
Value:Listbox=<class 'tkinter.Listbox'>
Value:Menu=<class 'tkinter.Menu'>
Value:Menubutton=<class 'tkinter.Menubutton'>
Value:Message=<class 'tkinter.Message'>
Value:Radiobutton=<class 'tkinter.Radiobutton'>
Value:Scale=<class 'tkinter.Scale'>
Value:Scrollbar=<class 'tkinter.Scrollbar'>
Value:Text=<class 'tkinter.Text'>
Value:OptionMenu=<class 'tkinter.OptionMenu'>
Value:Image=<module 'PIL.Image' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\site-packages\\PIL\\Image.py'>
Value:PhotoImage=<class 'tkinter.PhotoImage'>
Value:BitmapImage=<class 'tkinter.BitmapImage'>
Value:image_names=<function image_names at 0x0000022B04F2CFE0>
Value:image_types=<function image_types at 0x0000022B04F36C00>
Value:Spinbox=<class 'tkinter.Spinbox'>
Value:LabelFrame=<class 'tkinter.LabelFrame'>
Value:PanedWindow=<class 'tkinter.PanedWindow'>
Value:ttk=<module 'tkinter.ttk' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\tkinter\\ttk.py'>
Value:messagebox=<module 'tkinter.messagebox' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\tkinter\\messagebox.py'>
Value:rmtree=<function rmtree at 0x0000022B04FD0040>
Value:copy=<function copy at 0x0000022B04FAFA60>
Value:move=<function move at 0x0000022B04FD0180>
Value:requests=<module 'requests' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\site-packages\\requests\\__init__.py'>
Value:sv_ttk=<module 'sv_ttk' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\site-packages\\sv_ttk\\__init__.py'>
Value:ImageTk=<module 'PIL.ImageTk' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\site-packages\\PIL\\ImageTk.py'>
Value:imgextractor=<module 'imgextractor' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\imgextractor.py'>
Value:lpunpack=<module 'lpunpack' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\lpunpack.py'>
Value:mkdtboimg=<module 'mkdtboimg' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\mkdtboimg.py'>
Value:ozipdecrypt=<module 'ozipdecrypt' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\ozipdecrypt.py'>
Value:payload_dumper=<module 'payload_dumper' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\payload_dumper.py'>
Value:splituapp=<module 'splituapp' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\splituapp.py'>
Value:dti=<built-in function perf_counter>
Value:ofp_qc_decrypt=<module 'ofp_qc_decrypt' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\ofp_qc_decrypt.py'>
Value:ofp_mtk_decrypt=<module 'ofp_mtk_decrypt' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\ofp_mtk_decrypt.py'>
Value:editor=<module 'editor' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\editor.py'>
Value:yaml=<module 'yaml' from 'C:\\Users\\yahya\\scoop\\apps\\python\\current\\Lib\\site-packages\\yaml\\__init__.py'>
Value:opscrypto=<module 'opscrypto' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\opscrypto.py'>
Value:images=<module 'images' from 'D:\\ak\\MIO-KITCHEN-SOURCE-win\\images.py'>
Value:json_edit=<class '__main__.json_edit'>
Value:load_car=<class '__main__.load_car'>
Value:cartoon=<__main__.load_car object at 0x0000022B066EC410>
Value:dev_null=<class '__main__.dev_null'>
Value:Tool=<class '__main__.Tool'>
Value:win=.
Value:start=195.8303572
Value:elocal=D:\ak\MIO-KITCHEN-SOURCE-win
Value:settings_file=D:\ak\MIO-KITCHEN-SOURCE-win\bin\setting.ini
Value:dn=PY_VAR0
Value:theme=PY_VAR1
Value:language=PY_VAR2
Value:tool_bin=D:\ak\MIO-KITCHEN-SOURCE-win\bin\Windows\AMD64\
Value:ModuleError=<class '__main__.ModuleError'>
Value:lang=<class '__main__.lang'>
Value:load=<function load at 0x0000022B04FAC9A0>
Value:error=<function error at 0x0000022B06D0F1A0>
Value:welcome=<class '__main__.welcome'>
Value:set_utils=<class '__main__.set_utils'>
Value:settings=<__main__.set_utils object at 0x0000022B06D08390>
Value:re_folder=<function re_folder at 0x0000022B06D0FCE0>
Value:un_dtbo=<function un_dtbo at 0x0000022B06D0F9C0>
Value:pack_dtbo=<function pack_dtbo at 0x0000022B06D0FD80>
Value:logo_dump=<function logo_dump at 0x0000022B06D0FEC0>
Value:logo_pack=<function logo_pack at 0x0000022B06D24040>
Value:Process=<class '__main__.Process'>
Value:IconGrid=<class '__main__.IconGrid'>
Value:mpkman=<function mpkman at 0x0000022B06D240E0>
Value:Install_mpk=<class '__main__.Install_mpk'>
Value:packxx=<class '__main__.packxx'>
Value:dbkxyt=<function dbkxyt at 0x0000022B06D24900>
Value:packss=<class '__main__.packss'>
Value:packsuper=<function packsuper at 0x0000022B06D24F40>
Value:StdoutRedirector=<class '__main__.StdoutRedirector'>
Value:call=<function call at 0x0000022B06D25080>
Value:download_api=<function download_api at 0x0000022B06D25300>
Value:download_file=<function download_file at 0x0000022B06D253A0>
Value:jboot=<function jboot at 0x0000022B06D254E0>
Value:dboot=<function dboot at 0x0000022B06D25620>
Value:packrom=<function packrom at 0x0000022B06D25760>
Value:rdi=<function rdi at 0x0000022B06D25800>
Value:input_=<function input_ at 0x0000022B06D258A0>
Value:script2fs=<function script2fs at 0x0000022B06D25940>
Value:unpackrom=<function unpackrom at 0x0000022B06D25A80>
Value:rwork=<function rwork at 0x0000022B06D25B20>
Value:unpack=<function unpack at 0x0000022B06D25C60>
Value:ask_win=<function ask_win at 0x0000022B06D25D00>
Value:dirsize=<class '__main__.dirsize'>
Value:datbr=<function datbr at 0x0000022B06D26020>
Value:mkerofs=<function mkerofs at 0x0000022B06D260C0>
Value:make_ext4fs=<function make_ext4fs at 0x0000022B06D26200>
Value:mke2fs=<function mke2fs at 0x0000022B06D262A0>
Value:rmdir=<function rmdir at 0x0000022B06D263E0>
Value:get_all_file_paths=<function get_all_file_paths at 0x0000022B06D26480>
Value:zip_file=<function zip_file at 0x0000022B06D26520>
Value:pack_zip=<function pack_zip at 0x0000022B06D26700>
Value:dndfile=<function dndfile at 0x0000022B06D267A0>
Value:xmcd=<class '__main__.xmcd'>
Value:frame3=<class '__main__.frame3'>
Value:unpack_gui=<class '__main__.unpack_gui'>
Value:unpackg=.!labelframe.!notebook.!frame2.!unpack_gui
Value:project_menu=.!labelframe.!notebook.!frame2.!xmcd
Value:img2simg=<function img2simg at 0x0000022B06D89440>
Value:format_conversion=<class '__main__.format_conversion'>
Value:__warningregistry__={'version': 5}

Error File: D:\ak\MIO-KITCHEN-SOURCE-win\tool.py

Error Function: datbr

Function Args: (('D:\\ak\\MIO-KITCHEN-SOURCE-win\\Cherish-OS-v5.2-20240123-1229-sweet-OFFICIAL-GApps\\', 'system', 6, 4), {})

Error Line:131

Reason: FileNotFoundError(2, 'No such file or directory')

I have additionally checked my hard drive for any errors or failures and there seems to be no issues at all at my end
I could, if needed, assume that the original ROM zip somehow got corrupted and I can re-download it

ok, i will fix

The error seems to be caused by no system.img being generated and the script skips directly to br packaging which fails due to no system.img found (this is suggested by the line Error Function: datbr)
Upon attempting to now pack as raw img, the actual culprit is now revealed below

Welcome to the new MIO-KITCHEN
This tool is free forever
Initialization time : 1.545649899999944 Seconds
FsPatcher: Load origin 3075 entries
FsPatcher: Add 0 entries
[Warn] / has too much data.
ContextPatcher: Load origin 3077 entries
ContextPatcher: Add 0 entries
Start packing: system [erofs] 
Compression format: lz4hc,1 
version: 1.x
D:\ak\MIO-KITCHEN-SOURCE-win\Cherish-OS-v5.2-20240123-1229-sweet-OFFICIAL-GApps\config\system_file_contexts:  line 2 has invalid file type u
D:\ak\MIO-KITCHEN-SOURCE-win\Cherish-OS-v5.2-20240123-1229-sweet-OFFICIAL-GApps\config\system_file_contexts:  line 2 has invalid file type u
<E> erofs: failed to open file contexts "D:\ak\MIO-KITCHEN-SOURCE-win\Cherish-OS-v5.2-20240123-1229-sweet-OFFICIAL-GApps\config\system_file_contexts"
Try '/AMD64/mkfs.erofs --help' for more information.
mkfs.erofs 1.7.1-g64fa6832
Packaging system succeeded!

Additionally, this is what is listed at at line 2 of system_file_contexts
/lost\+found u : o b j e c t _ r : r o o t f s : s 0
A workaround is to delete the spaces between, such as it appears like such
/lost\+found u:object_r:rootfs:s0

I do not know what happened, but now git pulling into latest commit 43a94e6 has fixed this issue