[Moto G5S Plus Questions & Answers] shwetanklal:
I just discovered that stock rom may be flashed even when the bootloader is locked.

But am getting error of pre-flash validation . I was wondering if someone could help me to choose right stock rom from here .

Fastboot gatvar all result as follows:

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot getvar all
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) version: 0.5
(bootloader) version-bootloader: moto-msm8953-C2.07(*)
(bootloader) product: sanders
(bootloader) board: sanders
(bootloader) secure: yes
(bootloader) hwrev: P4
(bootloader) radio: 2
(bootloader) storage-type: emmc
(bootloader) emmc: 64GB SAMSUNG RC14MB RV=08 PV=07 FV=0000000000000007
(bootloader) ram: 4GB SAMSUNG LP3 DIE=8Gb M5=01 M6=05 M7=00 M8=5F
(bootloader) cpu: MSM8953
(bootloader) serialno: 5e88a864
(bootloader) cid: 0xDEAD
(bootloader) channelid: 0x00
(bootloader) uid: 0275010D00000000000000000000
(bootloader) securestate: oem_locked
(bootloader) iswarrantyvoid: n/a
(bootloader) max-download-size: 536870912
(bootloader) reason: Last time flashing failed
(bootloader) imei: 000000000000000
(bootloader) meid:
(bootloader) date: 01-01-1970
(bootloader) sku: 000000000000000
(bootloader) battid:
(bootloader) iccid:
(bootloader) cust_md5:
(bootloader) max-sparse-size: 268435456
(bootloader) current-time:
(bootloader) ro.build.fingerprint:
(bootloader) poweroffalarm: 0
(bootloader) ro.build.version.full:
(bootloader) ro.build.version.qcom:
(bootloader) version-baseband:
(bootloader) kernel.version:
(bootloader) sbl1.git: sbl1.git
(bootloader) rpm.git: rpm.git
(bootloader) tz.git: tz.git
(bootloader) devcfg.git: devcfg.git
(bootloader) keymaster.git: keymaster.git
(bootloader) cmnlib.git: cmnlib.git
(bootloader) cmnlib64.git: cmnlib64.git
(bootloader) prov.git: prov.git
(bootloader) aboot.git: git=MBM-NG-VC2.07-0-g37f20e1
(bootloader) qe:
(bootloader) frp-state: no protection (err)
(bootloader) ro.carrier:
all: listed above
finished. total time: 0.579s

Trying to flash Stock Return this:

...
FAILED (remote failure)
finished. total time: 0.194s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash partition gpt.bin

(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:partition: not found
target reported max download size of 536870912 bytes
sending 'partition' (45 KB)...
OKAY [ 0.029s]
writing 'partition'...
(bootloader) Validating 'gpt.default.xml'
(bootloader) Security version downgrade
(bootloader) Image primary_gpt failed validation
(bootloader) Preflash validation failed
(bootloader) Cancelling 'gpt.default.xml'
FAILED (remote failure)
finished. total time: 0.149s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash bootloader bootlo
ader.img
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:bootloader: not found
target reported max download size of 536870912 bytes
sending 'bootloader' (5115 KB)...
OKAY [ 0.203s]
writing 'bootloader'...
(bootloader) Validating 'bootloader.default.xml'
(bootloader) Committing 'bootloader.default.xml'
(bootloader) - flashing 'emmc_appsboot.mbn' to 'aboot'
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition aboot
FAILED (remote failure)
finished. total time: 0.541s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash logo logo.bin
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:logo: not found
target reported max download size of 536870912 bytes
sending 'logo' (2192 KB)...
OKAY [ 0.088s]
writing 'logo'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition logo
FAILED (remote failure)
finished. total time: 0.161s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash boot boot.img
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:boot: not found
target reported max download size of 536870912 bytes
sending 'boot' (16384 KB)...
OKAY [ 0.697s]
writing 'boot'...
(bootloader) Image boot failed validation
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 0.916s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery recovery
.img
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:recovery: not found
target reported max download size of 536870912 bytes
sending 'recovery' (20580 KB)...
OKAY [ 0.675s]
writing 'recovery'...
(bootloader) Image recovery failed validation
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 0.942s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash dsp adspso.bin
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:dsp: not found
target reported max download size of 536870912 bytes
sending 'dsp' (16384 KB)...
OKAY [ 0.565s]
writing 'dsp'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition dsp
FAILED (remote failure)
finished. total time: 0.638s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash oem oem.img
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:oem: not found
target reported max download size of 536870912 bytes
sending 'oem' (327830 KB)...
OKAY [ 19.780s]
writing 'oem'...
(bootloader) Image o failed validation
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 19.917s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img
_sparsechunk.0
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:system: not found
target reported max download size of 536870912 bytes
sending 'system' (524260 KB)...
OKAY [ 30.193s]
writing 'system'...
(bootloader) Image s failed validation
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 30.360s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img
_sparsechunk.1
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:system: not found
target reported max download size of 536870912 bytes
sending 'system' (522314 KB)...
OKAY [ 21.350s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 21.401s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img
_sparsechunk.2
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:system: not found
target reported max download size of 536870912 bytes
sending 'system' (522269 KB)...
OKAY [ 28.165s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 28.224s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img
_sparsechunk.3
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:system: not found
target reported max download size of 536870912 bytes
sending 'system' (524204 KB)...
OKAY [ 23.995s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 24.045s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img
_sparsechunk.4
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:system: not found
target reported max download size of 536870912 bytes
sending 'system' (524139 KB)...
OKAY [ 25.289s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 25.357s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img
_sparsechunk.5
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:system: not found
target reported max download size of 536870912 bytes
sending 'system' (435100 KB)...
OKAY [ 15.092s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 15.151s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash modem NON-HLOS.bi
n
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:modem: not found
target reported max download size of 536870912 bytes
sending 'modem' (75360 KB)...
OKAY [ 2.591s]
writing 'modem'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 2.661s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase modemst1
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:modemst1: not found
erasing 'modemst1'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 0.076s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase modemst2
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:modemst2: not found
erasing 'modemst2'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 0.044s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash fsg fsg.mbn
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:fsg: not found
target reported max download size of 536870912 bytes
sending 'fsg' (2452 KB)...
OKAY [ 0.107s]
writing 'fsg'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition fsg
FAILED (remote failure)
finished. total time: 0.183s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase cache
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:cache: not found
erasing 'cache'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 0.082s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase userdata
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:userdata: not found
erasing 'userdata'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 0.073s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase customize
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:customize: not found
erasing 'customize'...
(bootloader) Permission denied
FAILED (remote failure)
finished. total time: 0.035s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase logo
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:logo: not found
erasing 'logo'...
(bootloader) Permission denied
FAILED (remote failure)
finished. total time: 0.037s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot oem fb_mode_clear
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
...
FAILED (remote failure)
finished. total time: 0.194s

C:\Program Files (x86)\Minimal ADB and Fastboot>

Firm ware i tried flashing was SANDERS_NPS26.116-26_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.

Someone please help me to skip pre-validation flash by suggesting someway to flash unconditionally or help me select right stock rom that passes validation.