1# Copyright (C) 2024 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# Initialize network configuration before init so that routes are configured 16# before services are started 17 18# Hardcode the network interface for threadnetwork HAL to prevent it from trying 19# to use eth1, which is not available in the root network namespace in auto. 20on init 21 setprop persist.vendor.otsim.local_interface 127.0.0.1 22 23on post-fs 24 exec_start auto-ethernet-setup 25 exec_start auto-ethernet-namespace-setup 26 setprop android.car.auto_eth_namespace_setup_complete 1 27 28# Set up the main ethernet ip address and routing 29# Create network namespace auto_eth 30service auto-ethernet-setup /system_ext/bin/ethernet/ethernet.sh 31 class core 32 user root 33 group shell 34 oneshot 35 36# Set up routing rule for network namespace auto_eth 37service auto-ethernet-namespace-setup /system_ext/bin/ethernet/ethernet_auto_eth.sh 38 enter_namespace net /mnt/run/auto_eth 39 class core 40 user root 41 group shell 42 oneshot