[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

check_pending_config() and mounting /target



Dear list,

If a filesystem is manually mounted on /target using the shell on tty2,
dbootstrap will detect it and suggest installing the kernel, but never
copies the network settings or creates the dbootstrap_settings file on
the target root.

This makes installing root on a MD, LVM, NBD or loop device a major pain.

Relocating check_pending_config() from partition_config:mount_partition()
to extract_kernel:extract_kernel_and_modules() fixes the problem.

Having read through the code, the move appears safe and locates the
call to check_pending_config() in a more logical place.  I have just
done a test install using boot-floppies built from current CVS and
debootstrap_0.1.15.7 and the change worked perfectly.

Kindly review the change and let me know what you think.

Thanks,

Mark.

Index: partition_config.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/partition_config.c,v
retrieving revision 1.109
diff -u -r1.109 partition_config.c
--- partition_config.c	2001/10/23 19:57:59	1.109
+++ partition_config.c	2001/10/25 22:58:57
@@ -699,12 +705,9 @@
     return 1;
   }
 
-  if (!strcmp(mount_point, "/")) {
-    /* we just mounted root, so have some other config tasks to perform */
+  if (!strcmp(mount_point, "/"))
     Boot = Root = partition;
-    check_pending_config();	/* Must NEVER write to "/target/boot". */
-  }
-  if (!strcmp(mount_point, "/boot"))
+  else if (!strcmp(mount_point, "/boot"))
     Boot = partition;
 
   free(mount_point);
Index: extract_kernel.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/extract_kernel.c,v
retrieving revision 1.48
diff -u -r1.48 extract_kernel.c
--- extract_kernel.c	2001/08/21 09:32:49	1.48
+++ extract_kernel.c	2001/10/25 22:58:57
@@ -276,6 +276,8 @@
   if ( choose_medium() )
     return 1;
 
+  check_pending_config();  /* Must NEVER write to "/target/boot". */
+
   INFOMSG("installing kernel and modules from %s", Archive_Dir);
 
   if (! strcmp(Archive_Dir, "netfetch")) {



Reply to: