summaryrefslogtreecommitdiff
path: root/debian/patches/tmp_exec_startup.patch
blob: 6b8416d4b848251ffd821146f0b6a52ddb03defc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- libdiskfs/boot-start.c	26 Mar 2002 14:59:52 -0000	1.60
+++ libdiskfs/boot-start.c	19 Nov 2007 21:22:57 -0000
@@ -126,8 +126,13 @@
       assert (_hurd_ports);
       assert (_hurd_ports[INIT_PORT_CRDIR].port != MACH_PORT_NULL);
       diskfs_exec = file_name_lookup (_SERVERS_EXEC, 0, 0);
-      if (diskfs_exec == MACH_PORT_NULL)
-	error (1, errno, "%s", _SERVERS_EXEC);
+      if (diskfs_exec == MACH_PORT_NULL) 
+	{
+	  /* Debian specifc work-around for install bootstrapping.  */
+	  diskfs_exec = file_name_lookup ("/tmp/exec", 0, 0);
+	  if (diskfs_exec == MACH_PORT_NULL)
+	    error (1, errno, "%s", _SERVERS_EXEC);
+	}
       else
 	{
 #ifndef NDEBUG
@@ -177,8 +182,15 @@
 			&retry, pathbuf, &execnode);
       if (err)
 	{
-	  error (0, err, "cannot set translator on %s", _SERVERS_EXEC);
-	  mach_port_deallocate (mach_task_self (), diskfs_exec_ctl);
+          /* If /servers/exec is not available (which is the case during
+             installation, try /tmp/exec as well.  */
+          err = dir_lookup (root_pt, "/tmp/exec", O_NOTRANS, 0,
+	            	    &retry, pathbuf, &execnode);
+	  if (err) 
+	    {
+	      error (0, err, "cannot set translator on %s", _SERVERS_EXEC);
+	      mach_port_deallocate (mach_task_self (), diskfs_exec_ctl);
+	    }
 	}
       else
 	{
@@ -393,6 +405,10 @@
 
   err = dir_lookup (rootport, _SERVERS_EXEC, flags|O_NOTRANS, 0,
 		    &retry, pathbuf, real);
+  if (err) 
+    /* Try /tmp/exec as well, in case we're installing.  */
+    err = dir_lookup (rootport, "/tmp/exec", flags|O_NOTRANS|O_CREAT, 0,
+	  	      &retry, pathbuf, real);
   assert_perror (err);
   assert (retry == FS_RETRY_NORMAL);
   assert (pathbuf[0] == '\0');