Exemplo n.º 1
0
void
md_init_set_status(int flags)
{
       struct utsname instsys;

	(void)flags;

	/*
	 * Get the name of the Install Kernel we are running under and
	 * enable the installation of the corresponding GENERIC kernel.
	 *
	 * Note:  In md.h the two kernels are disabled.  If they are
	 *        enabled there the logic here needs to be switched.
	 */
        uname(&instsys);
        if (strstr(instsys.version, "(INSTALLSBC)"))
		/*
		 * Running the SBC Installation Kernel, so enable GENERICSBC
		 */
		set_kernel_set(SET_KERNEL_2);
        else
		/*
		 * Running the GENERIC Installation Kernel, so enable GENERIC
		 */
		set_kernel_set(SET_KERNEL_1);
}
Exemplo n.º 2
0
void
md_init_set_status(int flags)
{
	static const char mib_name[] = "machdep.prodfamily";
	static char unknown[] = "unknown";
	size_t len;

	(void)flags;

	/*
	 * Determine the product family of the board we are running on and
	 * enable the installation of the corresponding GENERIC kernel.
	 *
	 * Note:  In md.h the two kernels are disabled.  If they are
	 *        enabled there the logic here needs to be switched.
	 */
	if (sysctlbyname(mib_name, NULL, &len, NULL, 0) != 0) {
		prodname = unknown;
		return;
	}
	prodname = malloc(len);
	sysctlbyname(mib_name, prodname, &len, NULL, 0);

	if (strcmp(prodname, "kurobox") == 0)
		/*
		 * Running on a KuroBox family product, so enable KUROBOX
		 */
		set_kernel_set(SET_KERNEL_2);
        else
		/*
		 * Otherwise enable GENERIC
		 */
		set_kernel_set(SET_KERNEL_1);
}
Exemplo n.º 3
0
void
md_init_set_status(int flags)
{
	static const struct {
		const char *name;
		const int set;
	} kern_sets[] = {
		{ "IPAQ",	SET_KERNEL_IPAQ },
		{ "JORNADA720",	SET_KERNEL_JORNADA720 },
		{ "WZERO3",	SET_KERNEL_WZERO3 }
	};
	static const int mib[2] = {CTL_KERN, KERN_VERSION};
	size_t len;
	char *version;
	u_int i;

	/* check INSTALL kernel name to select an appropriate kernel set */
	/* XXX: hw.cpu_model has a processor name on arm ports */
	sysctl(mib, 2, NULL, &len, NULL, 0);
	version = malloc(len);
	if (version == NULL)
		return;
	sysctl(mib, 2, version, &len, NULL, 0);
	for (i = 0; i < __arraycount(kern_sets); i++) {
		if (strstr(version, kern_sets[i].name) != NULL) {
			set_kernel_set(kern_sets[i].set);
			break;
		}
	}
	free(version);
}
Exemplo n.º 4
0
Arquivo: md.c Projeto: ryo/netbsd-src
void
md_init_set_status(int flags)
{
	static const int mib[2] = {CTL_KERN, KERN_VERSION};
	size_t len;
	char *version;

	/* check INSTALL kernel name to select an appropriate kernel set */
	/* XXX: hw.cpu_model has a processor name on arm ports */
	sysctl(mib, 2, NULL, &len, NULL, 0);
	version = malloc(len);
	if (version == NULL)
		return;
	sysctl(mib, 2, version, &len, NULL, 0);
	if (strstr(version, "C700") != NULL)
		set_kernel_set(SET_KERNEL_C700);
	free(version);
}
Exemplo n.º 5
0
Arquivo: md.c Projeto: ryo/netbsd-src
void
md_init_set_status(int flags)
{
	if (boardtype == BOARD_TYPE_RPI)
		set_kernel_set(SET_KERNEL_RPI);
}