Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fvbe.git;a=commitdiff;h=120903408d150f653bd97fa51c9021afffc0a3ed

commit 120903408d150f653bd97fa51c9021afffc0a3ed
Author: James Buren <[email protected]>
Date:   Wed Jul 17 14:04:16 2013 -0500

preconfig: do not mount the ISO. instead, mount bind the ISO
path that dracut uses. should bypass the mount failures
reported by phayz.

diff --git a/src/local.h b/src/local.h
index 1120ab7..3fabaa5 100644
--- a/src/local.h
+++ b/src/local.h
@@ -54,7 +54,6 @@
#define NEWT_HEIGHT 21
#endif

-#define ISO_ROOT "/mnt/iso"
#define SPACE_CHARS " \t\r\n\v\f"
#define LOWER_CHARS "abcdefghijklmnopqrstuvwxyz"
#define TEXT_MAX 8192
diff --git a/src/preconfig.c b/src/preconfig.c
index 2a75b8c..3eff0eb 100644
--- a/src/preconfig.c
+++ b/src/preconfig.c
@@ -17,6 +17,8 @@

#include "local.h"

+#define ISO_ROOT "/run/initramfs/live"
+
static inline bool preconfig_copy_fdb(const char *fdb)
{
char old[PATH_MAX] = {0};
@@ -113,71 +115,39 @@ static bool preconfig_prepare_source(void)
char groups[LINE_MAX] = {0};
const char *source = "unknown";

-  if(g->infvbe && g->isodevice != 0)
+  if(g->infvbe && stat(ISO_ROOT "/packages",&st) == 0)
{
-    if(!mkdir_recurse(ISO_ROOT))
+    file2str(ISO_ROOT "/packages/groups",groups,sizeof(groups));
+
+    if(strlen(groups) == 0)
{
-      error("failed to create iso root");
+      error("no groups file or empty group files");
return false;
}

-    if(mount(g->isodevice,ISO_ROOT,"iso9660",MS_RDONLY,0) == -1)
+    g->groups = strdup(groups);
+
+    strfcpy(path,sizeof(path),"%s/var/cache/pacman-g2/pkg",g->guestroot);
+
+    if(mount(ISO_ROOT "/packages",path,"",MS_BIND,0) == -1)
{
error(strerror(errno));
-      error("failed to mount iso");
+      error("failed to mount iso package cache");
return false;
}
-
-    if(stat(ISO_ROOT "/packages",&st) == 0)
-    {
-      file2str(ISO_ROOT "/packages/groups",groups,sizeof(groups));
-
-      if(strlen(groups) == 0)
-      {
-        error("no groups file or empty group files");
-        return false;
-      }
-
-      g->groups = strdup(groups);
-
-      strfcpy(path,sizeof(path),"%s/var/cache/pacman-g2/pkg",g->guestroot);
-
-      if(mount(ISO_ROOT "/packages",path,"",MS_BIND,0) == -1)
-      {
-        error(strerror(errno));
-        error("failed to mount iso package cache");
-        return false;
-      }
-
-      if(!preconfig_copy_fdb("frugalware") && 
!preconfig_copy_fdb("frugalware-current"))
-      {
-        error("failed to find the fdb");
-        return false;
-      }

-      source = "iso";
-    }
-    else
+    if(!preconfig_copy_fdb("frugalware") && 
!preconfig_copy_fdb("frugalware-current"))
{
-      error("no packages on the iso");
-      source = "network";
-    }
-  }
-  else if(!g->infvbe)
-  {
-    strfcpy(path,sizeof(path),"%s/var/cache/pacman-g2/pkg",g->guestroot);
-
-    if(mount("/var/cache/pacman-g2/pkg",path,"",MS_BIND,0) == -1)
-    {
-      error(strerror(errno));
-      error("failed to mount host package cache");
+      error("failed to find the fdb");
return false;
}
-
-    source = "cache";
+
+    source = "iso";
}
else if(g->infvbe)
{
+    error("no packages on the iso");
+
source = "network";
}

diff --git a/src/utility.c b/src/utility.c
index ac67fc4..4a6ff23 100644
--- a/src/utility.c
+++ b/src/utility.c
@@ -495,12 +495,6 @@ extern void umount_all(void)
goto bail;
}

-  if(umount2(ISO_ROOT,MNT_DETACH|UMOUNT_NOFOLLOW) == -1 && errno != ENOENT)
-  {
-    error(strerror(errno));
-    goto bail;
-  }
-
bail:

if(file != 0)
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to