提交 13a17660 编写于 作者: X xionglei6

Merge branch 'fixbug' of https://gitee.com/xionglei6/startup_init_lite into fixbug

...@@ -50,6 +50,5 @@ if (defined(ohos_lite)) { ...@@ -50,6 +50,5 @@ if (defined(ohos_lite)) {
"system", "system",
"updater", "updater",
] ]
relative_install_dir = "platform-vndk"
} }
} }
...@@ -21,7 +21,7 @@ sdcard_r:x:1028: ...@@ -21,7 +21,7 @@ sdcard_r:x:1028:
package_info:x:1032: package_info:x:1032:
logd:x:1036: logd:x:1036:
shared_relro:x:1037: shared_relro:x:1037:
audioserver:x:1041: audio:x:1041:
cameraserver:x:1047: cameraserver:x:1047:
servicectrl:x:1050:root,shell,system,samgr,hdf_devmgr servicectrl:x:1050:root,shell,system,samgr,hdf_devmgr
shell:x:2000: shell:x:2000:
...@@ -33,5 +33,31 @@ wakelock:x:3010: ...@@ -33,5 +33,31 @@ wakelock:x:3010:
uhid:x:3011: uhid:x:3011:
ddms:x:3012: ddms:x:3012:
access_token:x:3020: access_token:x:3020:
blue_host:x:3021:
sample_host:x:3022:
usb_host:x:3023:
usbfnMaster_host:x:3024:
power_host:x:3025:
wifi_host:x:3026:
audio_hdi_server_host:x:3027:
camera_host:x:3028:
input_user_host:x:3029:
display_gralloc_host:x:3030:
codec_host:x:3031:
riladapter_host:x:3032:
sensor_dal_host:x:3033:
vibrator_dal_host:x:3034:
light_dal_host:x:3035:
wifi_c_host:x:3036:
disp_gralloc_host:x:3037:
dcamera_host:x:3038:
hwc_host:x:3039:
gralloc_host:x:3040:
sensor_host:x:3041:
nfc_host:x:3042:
a2dp_host:x:3043:
hdf_devmgr:x:3044:
connected_tag_host:x:3045:
dms:x:5522:
misc:x:9998: misc:x:9998:
app:x:10000: app:x:10000:
...@@ -245,9 +245,9 @@ ...@@ -245,9 +245,9 @@
"mkdir /data/misc/vpn 0770 system vpn", "mkdir /data/misc/vpn 0770 system vpn",
"mkdir /data/misc/shared_relro 0771 shared_relro shared_relro", "mkdir /data/misc/shared_relro 0771 shared_relro shared_relro",
"mkdir /data/misc/systemkeys 0700 system system", "mkdir /data/misc/systemkeys 0700 system system",
"mkdir /data/misc/wifi 0770 wifi wifi", "mkdir /data/misc/wifi 0770 system system",
"mkdir /data/misc/wifi/sockets 0770 wifi wifi", "mkdir /data/misc/wifi/sockets 0770 system system",
"mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi", "mkdir /data/misc/wifi/wpa_supplicant 0660 system system",
"mkdir /data/misc/ethernet 0770 system system", "mkdir /data/misc/ethernet 0770 system system",
"mkdir /data/misc/dhcp 0770 dhcp dhcp", "mkdir /data/misc/dhcp 0770 dhcp dhcp",
"mkdir /data/misc/user 0771 root root", "mkdir /data/misc/user 0771 root root",
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
"chmod 0660 /data/misc/wifi/wpa_supplicant.conf", "chmod 0660 /data/misc/wifi/wpa_supplicant.conf",
"mkdir /data/local 0751 root root", "mkdir /data/local 0751 root root",
"mkdir /data/misc/media 0700 media media", "mkdir /data/misc/media 0700 media media",
"mkdir /data/misc/audioserver 0700 audioserver audioserver", "mkdir /data/misc/audio 0700 audio audio",
"mkdir /data/misc/cameraserver 0700 cameraserver cameraserver", "mkdir /data/misc/cameraserver 0700 cameraserver cameraserver",
"mkdir /data/misc/vold 0700 root root", "mkdir /data/misc/vold 0700 root root",
"mkdir /data/misc/boottrace 0771 system shell", "mkdir /data/misc/boottrace 0771 system shell",
...@@ -313,7 +313,8 @@ ...@@ -313,7 +313,8 @@
"mkdir /data/init_agent 0770 shell system", "mkdir /data/init_agent 0770 shell system",
"setparam sys.use_memfd false", "setparam sys.use_memfd false",
"chown root system /dev/fscklogs/log", "chown root system /dev/fscklogs/log",
"chmod 0770 /dev/fscklogs/log" "chmod 0770 /dev/fscklogs/log",
"chmod 0660 /dev/fuse"
] ]
}, { }, {
"name" : "boot", "name" : "boot",
......
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
"chmod 0660 /data/misc/wifi/wpa_supplicant.conf", "chmod 0660 /data/misc/wifi/wpa_supplicant.conf",
"mkdir /data/local 0751 root root", "mkdir /data/local 0751 root root",
"mkdir /data/misc/media 0700 media media", "mkdir /data/misc/media 0700 media media",
"mkdir /data/misc/audioserver 0700 audioserver audioserver", "mkdir /data/misc/audio 0700 audio audio",
"mkdir /data/misc/cameraserver 0700 cameraserver cameraserver", "mkdir /data/misc/cameraserver 0700 cameraserver cameraserver",
"mkdir /data/misc/vold 0700 root root", "mkdir /data/misc/vold 0700 root root",
"mkdir /data/misc/boottrace 0771 system shell", "mkdir /data/misc/boottrace 0771 system shell",
...@@ -303,7 +303,8 @@ ...@@ -303,7 +303,8 @@
"mkdir /data/init_agent 0770 shell system", "mkdir /data/init_agent 0770 shell system",
"setparam sys.use_memfd false", "setparam sys.use_memfd false",
"chown root system /dev/fscklogs/log", "chown root system /dev/fscklogs/log",
"chmod 0770 /dev/fscklogs/log" "chmod 0770 /dev/fscklogs/log",
"chmod 0660 /dev/fuse"
] ]
}, { }, {
"name" : "boot", "name" : "boot",
......
...@@ -26,8 +26,9 @@ const.debuggable = root:root:0777 ...@@ -26,8 +26,9 @@ const.debuggable = root:root:0777
persist.sys.usb.config = root:root:0777 persist.sys.usb.config = root:root:0777
# default forbit other user to start service # default forbit other user to start service
ohos.servicectrl. = system:servicectrl:0775 ohos.servicectrl. = system:servicectrl:0777
test.permission. = root:root:0770 test.permission. = root:root:0770
test.permission.read. = root:root:0774 test.permission.read. = root:root:0774
test.permission.write. = root:root:0772 test.permission.write. = root:root:0772
test.permission.watcher. = root:root:0771 test.permission.watcher. = root:root:0771
\ No newline at end of file
...@@ -22,7 +22,7 @@ sdcard_r:x:1028:1028:::/bin/false ...@@ -22,7 +22,7 @@ sdcard_r:x:1028:1028:::/bin/false
package_info:x:1032:1032:::/bin/false package_info:x:1032:1032:::/bin/false
logd:x:1036:1036:::/bin/false logd:x:1036:1036:::/bin/false
shared_relro:x:1037:1037:::/bin/false shared_relro:x:1037:1037:::/bin/false
audioserver:x:1041:1041:::/bin/false audio:x:1041:1041:::/bin/false
cameraserver:x:1047:1047:::/bin/false cameraserver:x:1047:1047:::/bin/false
shell:x:2000:2000:::/bin/false shell:x:2000:2000:::/bin/false
cache:x:2001:2001:::/bin/false cache:x:2001:2001:::/bin/false
...@@ -33,6 +33,31 @@ wakelock:x:3010:3010:::/bin/false ...@@ -33,6 +33,31 @@ wakelock:x:3010:3010:::/bin/false
uhid:x:3011:3011:::/bin/false uhid:x:3011:3011:::/bin/false
ddms:x:3012:3012:::/bin/false ddms:x:3012:3012:::/bin/false
access_token:x:3020:3020:::/bin/false access_token:x:3020:3020:::/bin/false
blue_host:x:3021:3021:::/bin/false
sample_host:x:3022:3022:::/bin/false
usb_host:x:3023:3023:::/bin/false
usbfnMaster_host:x:3024:3024:::/bin/false
power_host:x:3025:3025:::/bin/false
wifi_host:x:3026:3026:::/bin/false
audio_hdi_server_host:x:3027:3027:::/bin/false
camera_host:x:3028:3028:::/bin/false
input_user_host:x:3029:3029:::/bin/false
display_gralloc_host:x:3030:3030:::/bin/false
codec_host:x:3031:3031:::/bin/false
riladapter_host:x:3032:3032:::/bin/false
sensor_dal_host:x:3033:3033:::/bin/false
vibrator_dal_host:x:3034:3034:::/bin/false
light_dal_host:x:3035:3035:::/bin/false
wifi_c_host:x:3036:3036:::/bin/false
disp_gralloc_host:x:3037:3037:::/bin/false
dcamera_host:x:3038:3038:::/bin/false
hwc_host:x:3039:3039:::/bin/false
gralloc_host:x:3040:3040:::/bin/false
sensor_host:x:3041:3041:::/bin/false
nfc_host:x:3042:3042:::/bin/false
a2dp_host:x:3043:3043:::/bin/false
hdf_devmgr:x:3044:3044:::/bin/false
connected_tag_host:x:3045:3045:::/bin/false
dms:x:5522:5522:::/bin/false dms:x:5522:5522:::/bin/false
misc:x:9998:9998:::/bin/false misc:x:9998:9998:::/bin/false
app:x:10000:10000:::/bin/false app:x:10000:10000:::/bin/false
...@@ -40,7 +40,6 @@ if (defined(ohos_lite)) { ...@@ -40,7 +40,6 @@ if (defined(ohos_lite)) {
"system", "system",
"updater", "updater",
] ]
relative_install_dir = "platform-vndk"
install_enable = true install_enable = true
part_name = "init" part_name = "init"
subsystem_name = "startup" subsystem_name = "startup"
......
...@@ -185,6 +185,8 @@ ohos_unittest("init_ut") { ...@@ -185,6 +185,8 @@ ohos_unittest("init_ut") {
] ]
defines = [ defines = [
"READ_CHECK",
"PARAM_SUPPORT_DAC_CHECK",
"INIT_AGENT", "INIT_AGENT",
"STARTUP_INIT_TEST", "STARTUP_INIT_TEST",
"PARAM_SUPPORT_SAVE_PERSIST", "PARAM_SUPPORT_SAVE_PERSIST",
......
...@@ -38,7 +38,9 @@ HWTEST_F(ServiceSocketUnitTest, TestCreateSocket, TestSize.Level0) ...@@ -38,7 +38,9 @@ HWTEST_F(ServiceSocketUnitTest, TestCreateSocket, TestSize.Level0)
ASSERT_NE(service, nullptr); ASSERT_NE(service, nullptr);
ServiceSocket *sockopt = (ServiceSocket *)calloc(1, sizeof(ServiceSocket) + strlen(testSocName) + 1); ServiceSocket *sockopt = (ServiceSocket *)calloc(1, sizeof(ServiceSocket) + strlen(testSocName) + 1);
ASSERT_NE(sockopt, nullptr); ASSERT_NE(sockopt, nullptr);
sockopt->type = SOCK_SEQPACKET; sockopt->type = SOCK_STREAM;
sockopt->protocol = 0;
sockopt->family = PF_UNIX;
sockopt->sockFd = -1; sockopt->sockFd = -1;
sockopt->uid = 1000; sockopt->uid = 1000;
sockopt->gid = 1000; sockopt->gid = 1000;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "iwatcher_manager.h" #include "iwatcher_manager.h"
#include "message_parcel.h" #include "message_parcel.h"
#include "param_utils.h" #include "param_utils.h"
#include "param_request.h"
#include "sys_param.h" #include "sys_param.h"
#include "system_ability_definition.h" #include "system_ability_definition.h"
#include "watcher.h" #include "watcher.h"
...@@ -43,7 +44,14 @@ public: ...@@ -43,7 +44,14 @@ public:
WatcherAgentUnitTest() {} WatcherAgentUnitTest() {}
virtual ~WatcherAgentUnitTest() {} virtual ~WatcherAgentUnitTest() {}
void SetUp() {} void SetUp()
{
ParamWorkSpace *space = GetClientParamWorkSpace();
if (space != nullptr && space->securityLabel != nullptr) {
space->securityLabel->cred.uid = 1000; // 1000 test uid
space->securityLabel->cred.gid = 1000; // 1000 test gid
}
}
void TearDown() {} void TearDown() {}
void TestBody() {} void TestBody() {}
......
...@@ -68,6 +68,7 @@ public: ...@@ -68,6 +68,7 @@ public:
MessageParcel reply; MessageParcel reply;
MessageOption option; MessageOption option;
data.WriteInterfaceToken(IWatcherManager::GetDescriptor());
data.WriteString(keyPrefix); data.WriteString(keyPrefix);
sptr<IWatcher> watcher = new TestWatcher(); sptr<IWatcher> watcher = new TestWatcher();
bool ret = data.WriteRemoteObject(watcher->AsObject()); bool ret = data.WriteRemoteObject(watcher->AsObject());
...@@ -87,6 +88,7 @@ public: ...@@ -87,6 +88,7 @@ public:
MessageParcel data; MessageParcel data;
MessageParcel reply; MessageParcel reply;
MessageOption option; MessageOption option;
data.WriteInterfaceToken(IWatcherManager::GetDescriptor());
data.WriteString(keyPrefix); data.WriteString(keyPrefix);
data.WriteUint32(watcherId); data.WriteUint32(watcherId);
watcherManager->OnRemoteRequest(IWatcherManager::DEL_WATCHER, data, reply, option); watcherManager->OnRemoteRequest(IWatcherManager::DEL_WATCHER, data, reply, option);
...@@ -138,6 +140,8 @@ public: ...@@ -138,6 +140,8 @@ public:
MessageParcel data; MessageParcel data;
MessageParcel reply; MessageParcel reply;
MessageOption option; MessageOption option;
data.WriteInterfaceToken(IWatcherManager::GetDescriptor());
data.WriteString(keyPrefix); data.WriteString(keyPrefix);
sptr<IWatcher> watcher = new TestWatcher(); sptr<IWatcher> watcher = new TestWatcher();
bool ret = data.WriteRemoteObject(watcher->AsObject()); bool ret = data.WriteRemoteObject(watcher->AsObject());
......
...@@ -23,7 +23,10 @@ if (defined(ohos_lite)) { ...@@ -23,7 +23,10 @@ if (defined(ohos_lite)) {
"//base/startup/init_lite/interfaces/innerkits/include", "//base/startup/init_lite/interfaces/innerkits/include",
] ]
deps = [ "//base/startup/init_lite/services/log:init_log" ] deps = [ "//base/startup/init_lite/services/log:init_log" ]
defines = [ "_GNU_SOURCE" ] defines = [
"_GNU_SOURCE",
"OHOS_LITE_WATCHDOG",
]
if (ohos_kernel_type == "linux") { if (ohos_kernel_type == "linux") {
defines += [ "LINUX_WATCHDOG" ] defines += [ "LINUX_WATCHDOG" ]
} }
......
...@@ -15,8 +15,10 @@ ...@@ -15,8 +15,10 @@
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <sched.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/resource.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <time.h> #include <time.h>
...@@ -75,7 +77,13 @@ int main(int argc, const char *argv[]) ...@@ -75,7 +77,13 @@ int main(int argc, const char *argv[])
gap = (gap > 0) ? gap : DEFAULT_GAP; gap = (gap > 0) ? gap : DEFAULT_GAP;
INIT_LOGI("watchdoge started (interval %d, margin %d), fd = %d\n", interval, gap, fd); INIT_LOGI("watchdoge started (interval %d, margin %d), fd = %d\n", interval, gap, fd);
#ifdef OHOS_LITE_WATCHDOG
#ifndef LINUX_WATCHDOG
if (setpriority(PRIO_PROCESS, 0, 14) != 0) { // 14 is process priority
INIT_LOGE("setpriority failed err=%d\n", errno);
}
#endif
#endif
int timeoutSet = interval + gap; int timeoutSet = interval + gap;
int timeoutGet = 0; int timeoutGet = 0;
int ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeoutSet); int ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeoutSet);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册