diff options
author | David 'Digit' Turner <digit@google.com> | 2009-05-25 18:01:03 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-05-26 17:23:25 +0200 |
commit | 318e4f294c181df33cf2541763904565b29bcccb (patch) | |
tree | 35b5085c9e35e91967e2d4a4db80e28ec086e1d3 /android/boot-properties.h | |
parent | 0d47fe5756b1f243e8d65968cd73c0119363f909 (diff) | |
download | external_qemu-318e4f294c181df33cf2541763904565b29bcccb.zip external_qemu-318e4f294c181df33cf2541763904565b29bcccb.tar.gz external_qemu-318e4f294c181df33cf2541763904565b29bcccb.tar.bz2 |
This adds the '-prop <name>=<value>' option which is used to set
boot-time system properties from the command line. This is done
by implementing a new 'boot-properties' qemud service in the emulator.
This is to be used by the 'qemu-props' helper program that will be
invoked by /system/etc/init.goldfish.rc to read a list of system
properties from the emulator and set them in the emulated system
during boot.
Diffstat (limited to 'android/boot-properties.h')
-rw-r--r-- | android/boot-properties.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/android/boot-properties.h b/android/boot-properties.h new file mode 100644 index 0000000..6711c59 --- /dev/null +++ b/android/boot-properties.h @@ -0,0 +1,47 @@ +/* Copyright (C) 2009 The Android Open Source Project +** +** This software is licensed under the terms of the GNU General Public +** License version 2, as published by the Free Software Foundation, and +** may be copied, distributed, and modified under those terms. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +*/ + +#ifndef _ANDROID_BOOT_PROPERTIES_H +#define _ANDROID_BOOT_PROPERTIES_H + +/* these values give the maximum length of system property + * names and values. They must match the corresponding definitions + * in the Android source tree (in system/core/include/cutils/properties.h) + */ +#define PROPERTY_MAX_NAME 32 +#define PROPERTY_MAX_VALUE 92 + +/* record a new boot system property, this must be performed before the + * VM is started. Returns 0 on success, or < 0 on error. + * Possible errors are: + * -1 property name too long + * -2 property value too long + * -3 invalid characters in property name + */ +int boot_property_add( const char* name, const char* value ); + +/* same as boot_property_add, but allows to use non-zero terminated strings. + */ +int boot_property_add2( const char* name, int namelen, + const char* value, int valuelen ); + +/* init the boot property QEMUD service. This must be performed before + * the VM is started. This is also performed automatically if you call + * boot_property_add(). + */ +void boot_property_init_service( void ); + +/* parse the parameter the list of -prop options passed on the command line + */ +void boot_property_parse_option( const char* param ); + +#endif /* _ANDROID_BOOT_PROPERTIES_H */ |