Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fwlive.git;a=commitdiff;h=56d7cf7d18b5ab4672010c6b9155aacae034778e
commit 56d7cf7d18b5ab4672010c6b9155aacae034778e Author: James Buren <[email protected]> Date: Sat Feb 23 06:03:29 2013 -0600 move sys, dev, proc mounting to utility function diff --git a/new/fwsetup/local.h b/new/fwsetup/local.h index 686bdf2..e59e1d0 100644 --- a/new/fwsetup/local.h +++ b/new/fwsetup/local.h @@ -74,6 +74,7 @@ struct module const char *name; }; +extern bool mount_special(void); extern bool isrootpath(const char *path); extern bool isasciistring(const char *s); extern bool mkdir_recurse(const char *path); diff --git a/new/fwsetup/postconfig.c b/new/fwsetup/postconfig.c index df72109..3ff9119 100644 --- a/new/fwsetup/postconfig.c +++ b/new/fwsetup/postconfig.c @@ -297,24 +297,6 @@ static bool postconfig_run(void) return false; } - if(mount("none",INSTALL_ROOT "/dev","devtmpfs",0,0) == -1) - { - error(strerror(errno)); - return false; - } - - if(mount("none",INSTALL_ROOT "/proc","proc",0,0) == -1) - { - error(strerror(errno)); - return false; - } - - if(mount("none",INSTALL_ROOT "/sys","sysfs",0,0) == -1) - { - error(strerror(errno)); - return false; - } - if(!write_locale_conf()) return false; @@ -337,24 +319,6 @@ static bool postconfig_run(void) if(!get_timezone_data() || !ui_window_time(tz_data,&zone,&utc) || !time_action(zone,utc)) return false; - if(umount2(INSTALL_ROOT "/dev",MNT_DETACH) == -1) - { - error(strerror(errno)); - return false; - } - - if(umount2(INSTALL_ROOT "/proc",MNT_DETACH) == -1) - { - error(strerror(errno)); - return false; - } - - if(umount2(INSTALL_ROOT "/sys",MNT_DETACH) == -1) - { - error(strerror(errno)); - return false; - } - return true; } diff --git a/new/fwsetup/utility.c b/new/fwsetup/utility.c index 27d035d..2e3ad1f 100644 --- a/new/fwsetup/utility.c +++ b/new/fwsetup/utility.c @@ -1,5 +1,28 @@ #include "local.h" +extern bool mount_special(void) +{ + if(mount("none",INSTALL_ROOT "/dev","devtmpfs",0,0) == -1) + { + error(strerror(errno)); + return false; + } + + if(mount("none",INSTALL_ROOT "/proc","proc",0,0) == -1) + { + error(strerror(errno)); + return false; + } + + if(mount("none",INSTALL_ROOT "/sys","sysfs",0,0) == -1) + { + error(strerror(errno)); + return false; + } + + return true; +} + extern bool isrootpath(const char *path) { regex_t re = {0}; _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
