PERFORCE change 81232 for review
soc-andrew
soc-andrew at FreeBSD.org
Sun Jul 31 11:42:25 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=81232
Change 81232 by soc-andrew at soc-andrew_serv on 2005/07/31 11:41:52
Fix dhclient on Install CD
Use the mtree files to create/correct directories
Remove the local dist as it dosn't exist
Inform the user if a dist fails to install
Affected files ...
.. //depot/projects/soc2005/bsdinstaller/src/release/Makefile#12 edit
.. //depot/projects/soc2005/bsdinstaller/src/share/bsdinstaller/cmdnames.conf#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/extra_flow.c#3 edit
.. //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/fn_install_freebsd.c#5 edit
Differences ...
==== //depot/projects/soc2005/bsdinstaller/src/release/Makefile#12 (text+ko) ====
@@ -790,6 +790,8 @@
cp ${.CURDIR}/bsdinstaller/ttys.${TARGET_ARCH} \
${RD}/bsdinstaller/root/etc/ttys; \
fi )
+ @mkdir -p ${RD}/bsdinstaller/root/var/db
+ @mkdir -p ${RD}/bsdinstaller/root/var/empty
cp ${.CURDIR}/bsdinstaller/bsdinstaller_shell.sh ${RD}/bsdinstaller/root/
chmod u+x ${RD}/bsdinstaller/root/bsdinstaller_shell.sh
cp ${.CURDIR}/bsdinstaller/bsdinstaller ${RD}/bsdinstaller/root/etc/rc.d/
==== //depot/projects/soc2005/bsdinstaller/src/share/bsdinstaller/cmdnames.conf#2 (text+ko) ====
@@ -100,3 +100,7 @@
DMESG_BOOT=var/run/dmesg.boot
INSTALLER_TEMP="/tmp/"
+
+# Extra FreeBSD Variables
+
+MTREE=usr/sbin/mtree
==== //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/extra_flow.c#3 (text+ko) ====
@@ -63,7 +63,6 @@
#ifdef __amd64__
{ "lib32", "32bit Libraries" },
#endif
- { "local", "Local" },
{ NULL, NULL }
};
==== //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/fn_install_freebsd.c#5 (text+ko) ====
@@ -62,6 +62,9 @@
#include <installer/dist.h>
#include <installer/uiutil.h>
+char *mtree_file[] = { "root", "var", "usr", "sendmail", NULL };
+char *mtree_dest[] = { "/", "/var", "/usr", "/", NULL };
+
static int pre_install(struct i_fn_args *);
static int do_install(struct i_fn_args *);
static int post_install(struct i_fn_args *);
@@ -165,6 +168,8 @@
char dist_name[32];
void *rv, *rk;
size_t rv_len, rk_len;
+ int i;
+ struct commands *cmds;
struct utsname name;
uname(&name);
@@ -184,12 +189,31 @@
if (rk_len < 32)
dist_name[rk_len] = '\0';
- printf("+%s\n", dist_name);
- dist_extract(a->c, dist_name);
+ if( dist_extract(a->c, dist_name) != 0) {
+ inform(a->c, _("Distribution %s was not installed."), dist_name);
+ return 0;
+ }
aura_dict_next(a->dists);
}
i_log(a, ">>> Done");
+ i_log(a, "");
+
+ cmds = commands_new();
+
+ for (i=0; mtree_file[i] != NULL; i++) {
+ /* Run "mtree -deU -f <file> -p <dir> */
+ command_add(cmds, "%s%s -deU -f %s/etc/mtree/BSD.%s.dist -p %smnt%s",
+ a->os_root, cmd_name(a, "MTREE"),
+ a->os_root, mtree_file[i],
+ a->os_root, mtree_dest[i]);
+ }
+
+ if (!commands_execute(a, cmds)) {
+ inform(a->c, _("%s was not fully installed."), OPERATING_SYSTEM_NAME);
+ a->result = 0;
+ }
+
return 1;
}
More information about the p4-projects
mailing list