Date: Sat, 17 Jun 2006 08:57:34 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 99406 for review Message-ID: <200606170857.k5H8vYVk017130@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=99406 Change 99406 by rdivacky@rdivacky_witten on 2006/06/17 08:56:59 Change the emulpath sysctl to be per-prison. Affected files ... .. //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_sysvec.c#3 edit .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linprocfs/linprocfs.c#2 edit .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_mib.c#3 edit .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_util.c#3 edit .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_util.h#2 edit .. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_sysvec.c#3 edit Differences ... ==== //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_sysvec.c#3 (text+ko) ==== @@ -1018,7 +1018,7 @@ ELFOSABI_LINUX, EM_386, "Linux", - linux_emul_path, + "/compat/linux/", "/lib/ld-linux.so.1", &elf_linux_sysvec, NULL, @@ -1029,7 +1029,7 @@ ELFOSABI_LINUX, EM_386, "Linux", - linux_emul_path, + "/compat/linux/", "/lib/ld-linux.so.2", &elf_linux_sysvec, NULL, ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linprocfs/linprocfs.c#2 (text+ko) ==== @@ -281,7 +281,9 @@ char *dlep, *flep, *mntto, *mntfrom, *fstype; size_t lep_len; int error; + char linux_emul_path[LINUX_NAME_MAX]; + linux_get_emul_path(td, linux_emul_path); /* resolve symlinks etc. in the emulation tree prefix */ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path, td); flep = NULL; ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_mib.c#3 (text+ko) ==== @@ -90,7 +90,7 @@ static int linux_sysctl_linux_emul_path(SYSCTL_HANDLER_ARGS) { - char emul_path[LINUX_NAME_MAX]; + static char emul_path[LINUX_NAME_MAX]; int error; Elf32_Brandinfo **brandinfo; @@ -99,10 +99,39 @@ if (error || req->newptr == NULL) return (error); error = linux_set_emul_path(req->td, emul_path); - for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; - ++brandinfo) - if (elf32_insert_brand_entry(*brandinfo) < 0) - error = EINVAL; + { + static Elf32_Brandinfo linux_brand = { + ELFOSABI_LINUX, + EM_386, + "Linux", + emul_path, + "/lib/ld-linux.so.1", + &elf_linux_sysvec, + NULL, + BI_CAN_EXEC_DYN, + }; + static Elf32_Brandinfo linux_glibc2brand = { + ELFOSABI_LINUX, + EM_386, + "Linux", + emul_path, + "/lib/ld-linux.so.2", + &elf_linux_sysvec, + NULL, + BI_CAN_EXEC_DYN, + }; + + Elf32_Brandinfo *local_linux_brandlist[] = { + &linux_brand, + &linux_glibc2brand, + NULL + }; + + for (brandinfo = &local_linux_brandlist[0]; *brandinfo != NULL; + ++brandinfo) + if (elf32_insert_brand_entry(*brandinfo) < 0) + error = EINVAL; + } return (error); } ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_util.c#3 (text+ko) ==== @@ -47,6 +47,12 @@ #include <machine/stdarg.h> #include <compat/linux/linux_util.h> +#ifdef COMPAT_LINUX32 +#include <machine/../linux32/linux.h> +#else +#include <machine/../linux/linux.h> +#endif +#include <compat/linux/linux_mib.h> /* * Search an alternate path before passing pathname arguments on @@ -64,6 +70,9 @@ char **pbuf; int cflag; { + char linux_emul_path[LINUX_NAME_MAX]; + + linux_get_emul_path(td, linux_emul_path); return (kern_alternate_path(td, linux_emul_path, path, pathseg, pbuf, cflag)); @@ -83,8 +92,6 @@ printf("\n"); } -MALLOC_DECLARE(M_LINUX); - struct device_element { TAILQ_ENTRY(device_element) list; ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_util.h#2 (text+ko) ==== @@ -75,8 +75,6 @@ return p; } -extern const char linux_emul_path[]; - int linux_emul_convpath(struct thread *, char *, enum uio_seg, char **, int); #define LCONVPATH(td, upath, pathp, i) \ ==== //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_sysvec.c#3 (text+ko) ==== @@ -858,7 +858,7 @@ ELFOSABI_LINUX, EM_386, "Linux", - linux_emul_path, + "/compat/linux/", "/lib/ld-linux.so.1", &elf_linux_sysvec, NULL, @@ -869,7 +869,7 @@ ELFOSABI_LINUX, EM_386, "Linux", - linux_emul_path, + "/compat/linux/", "/lib/ld-linux.so.2", &elf_linux_sysvec, NULL,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606170857.k5H8vYVk017130>