e29101077c
Some configurations won't allow ueventd to have CAP_NET_ADMIN, so the new default size of 16M is not possible for those. Those configurations also won't need such a large buffer size, so this change allows devices to customize the SO_RCVBUF(FORCE) size for the uevent socket. This is done by adding the line 'uevent_socket_rcvbuf_size <size>' to your device's ueventd.rc file. <size> is specified as a byte count, for example '16M' is 16MiB. The last parsed uevent_socket_rcvbuf_size line is the one that is used. Bug: 120485624 Test: boot sailfish Test: ueventd unit tests Change-Id: If8123b92ca8a9b089ad50318caada2f21bc94707
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
/*
|
|
* Copyright (C) 2007 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef _INIT_UEVENTD_PARSER_H
|
|
#define _INIT_UEVENTD_PARSER_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "devices.h"
|
|
|
|
namespace android {
|
|
namespace init {
|
|
|
|
struct UeventdConfiguration {
|
|
std::vector<Subsystem> subsystems;
|
|
std::vector<SysfsPermissions> sysfs_permissions;
|
|
std::vector<Permissions> dev_permissions;
|
|
std::vector<std::string> firmware_directories;
|
|
bool enable_modalias_handling = false;
|
|
size_t uevent_socket_rcvbuf_size = 0;
|
|
};
|
|
|
|
UeventdConfiguration ParseConfig(const std::vector<std::string>& configs);
|
|
|
|
} // namespace init
|
|
} // namespace android
|
|
|
|
#endif
|