blob: 81e07e2be3ae540abb2715ca56824f02b79c6cea [file] [log] [blame]
Jeff Dikec5d4bb12008-02-04 22:31:14 -08001/*
2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Licensed under the GPL
4 */
5
Jeff Dikec5d4bb12008-02-04 22:31:14 -08006#include <asm/errno.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include "init.h"
Jeff Dike2264c4752006-01-06 00:18:59 -08008#include "kern.h"
Jeff Dikec5d4bb12008-02-04 22:31:14 -08009#include "os.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
Jeff Dike7eebe8a2006-01-06 00:19:01 -080011/* Changed by set_umid_arg */
Linus Torvalds1da177e2005-04-16 15:20:36 -070012static int umid_inited = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
14static int __init set_umid_arg(char *name, int *add)
15{
Jeff Dike2264c4752006-01-06 00:18:59 -080016 int err;
17
Jeff Dikec5d4bb12008-02-04 22:31:14 -080018 if (umid_inited) {
Jeff Dikede5fe762007-02-10 01:44:25 -080019 printf("umid already set\n");
Jeff Dike2264c4752006-01-06 00:18:59 -080020 return 0;
Jeff Dikede5fe762007-02-10 01:44:25 -080021 }
Jeff Dike2264c4752006-01-06 00:18:59 -080022
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 *add = 0;
Jeff Dike7eebe8a2006-01-06 00:19:01 -080024 err = set_umid(name);
Jeff Dikec5d4bb12008-02-04 22:31:14 -080025 if (err == -EEXIST)
Jeff Dike2264c4752006-01-06 00:18:59 -080026 printf("umid '%s' already in use\n", name);
Jeff Dikec5d4bb12008-02-04 22:31:14 -080027 else if (!err)
Jeff Dike2264c4752006-01-06 00:18:59 -080028 umid_inited = 1;
29
30 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070031}
32
33__uml_setup("umid=", set_umid_arg,
34"umid=<name>\n"
35" This is used to assign a unique identity to this UML machine and\n"
36" is used for naming the pid file and management console socket.\n\n"
37);
38