4040
4141#include "qdl.h"
4242#include "patch.h"
43+ #include "program.h"
4344#include "ufs.h"
4445#include "oscompat.h"
4546
@@ -124,6 +125,7 @@ int main(int argc, char **argv)
124125 int ret ;
125126 int opt ;
126127 bool qdl_finalize_provisioning = false;
128+ bool allow_fusing = false;
127129 bool allow_missing = false;
128130 long out_chunk_size ;
129131
@@ -136,6 +138,7 @@ int main(int argc, char **argv)
136138 {"serial" , required_argument , 0 , 'S' },
137139 {"storage" , required_argument , 0 , 's' },
138140 {"allow-missing" , no_argument , 0 , 'f' },
141+ {"allow-fusing" , no_argument , 0 , 'c' },
139142 {0 , 0 , 0 , 0 }
140143 };
141144
@@ -156,6 +159,9 @@ int main(int argc, char **argv)
156159 case 'l' :
157160 qdl_finalize_provisioning = true;
158161 break ;
162+ case 'c' :
163+ allow_fusing = true;
164+ break ;
159165 case OPT_OUT_CHUNK_SIZE :
160166 out_chunk_size = strtol (optarg , NULL , 10 );
161167 qdl_set_out_chunk_size (& qdl , out_chunk_size );
@@ -200,6 +206,10 @@ int main(int argc, char **argv)
200206 ret = program_load (argv [optind ], !strcmp (storage , "nand" ));
201207 if (ret < 0 )
202208 errx (1 , "program_load %s failed" , argv [optind ]);
209+
210+ if (!allow_fusing && program_is_sec_partition_flashed ())
211+ errx (1 , "secdata partition to be programmed, which can lead to irreversible"
212+ " changes. Allow explicitly with --allow-fusing parameter" );
203213 break ;
204214 case QDL_FILE_READ :
205215 ret = read_op_load (argv [optind ]);
0 commit comments