Where the original stock Rom is usually stored?


Question

Please, help me with the following questions:



Q1). Where is the original stock Rom of the Android device is usually stored?



Q2). Is it possible to delete the original stock Rom completely from the Android device? In case, we have already rooted the device with a different customized Rom.



Any resources, tips, guides, or short answers will be greatly appreciated.



Thanks in advance for your help!



Note: My device is Huawei Honor 7 - PLK-L01.


Answer

This is based entirely off @Firelord's comment, with some modifications, so all credits go to him.



First things first, the stock ROM is not as such stored anywhere on device in a form which the device can use to recover itself in case of some catastrophic software failure, such as a botched OTA.



Now, as to how stock ROMs are stored for distribution, that is an entirely different issue. The method of ROM distribution or loading onto devices vary from OEM to OEM, even carrier to carrier. We find 3 common types of ROM distributions:




  1. ROM image files (700-1400MB): These are like Windows System Images, as such being a logical bit-for-bit copy of an on-device partition, which can be written to the device's NAND storage by a flashtool such as fastboot, nvflash or SPFT, while the device is tethered to a PC/Mac. These are usually distributed as archives, but cannot be flashed as such, they need to be decompressed separately before flashing.


  2. ROM zip files (250-600MB): These are also system images in essence, but they are compressed and lack some model-specific or device-specific partition images to lower distribution size as these are installed, in compressed form, on-device via the device's recovery. Some manufacturers do this, but this is commonly the distribution format for custom ROMs.


  3. ROM OTA zip files (4-200MB): These are like ROM zip files, but instead of having all the system images in the zip, these contain image patch files. They are also installed via recovery. This method helps in reducing update file size to meagre amounts when major system changes are not involved in the update.




When we talk about custom ROMs, only methods 2 and 3 are important. Only some for some Cyanogen OS devices does CyanogenMod provide ROM images for fastboot flashing.



Well, now you could wipe your device's /system partition, but note that while installing the custom ROM you already did that, and so there isn't a stock ROM on device to speak of. Wiping /system now would remove your custom ROM which you had installed, and then you would have to flash either a stock or custom ROM to make the device usable again.



Note something here: Stock recoveries cannot flash custom ROMs as the custom ROMs do not have the digital signatures that the recovery verifies before flashing them.



Similarly, custom recoveries such as CWM or TWRP cannot flash stock ROM zips as the zip checks for the integrity or stock nature of the device, which has been compromised by the presence of the custom recovery itself.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes