File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,17 @@ int main(int argc, char * argv[]) {
140140
141141 hashmap_t * cmdline = get_cmdline ();
142142
143+ if (fopen ("/.migrated" , "r" )) {
144+ printf ("You have already migrated the filesystem.\n" );
145+ return 1 ;
146+ }
147+
148+ if (!hashmap_has (cmdline , "migrate" )) {
149+ printf ("Assuming you are trying to run migrate after the system has booted without migrating, this will break things!\n" );
150+ printf ("Please reboot the system with migrate in the cmdline.\n" );
151+ return 1 ;
152+ }
153+
143154 if (hashmap_has (cmdline , "logtoserial" )) {
144155 _debug = 1 ;
145156 }
@@ -191,5 +202,7 @@ int main(int argc, char * argv[]) {
191202 free (tmp );
192203 }
193204
205+ system ("touch /.migrated" );
206+
194207 return 0 ;
195208}
You can’t perform that action at this time.
0 commit comments