blob: eab8947d5c59ae2363e9addf7370ff9b4595e540 [file] [log] [blame]
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Set regulatory domain for restrictive domains"
author ""
# We also need to run after cfg80211 is loaded by network-services.conf so
# the "iw" command will work.
start on started network-services
# The list of regulatory domains which we must apply in order to constrain
# the system to a more restrictive behavior than our world regulatory domain.
# The system can only be set to one regulatory domain at a time. As well,
# any given system should have only one "region" value. However, in order
# to hedge against any strange cases, this value should be in decreasing
# order of constraints, so the system will attain the most constrained
# domain.
region="$(vpd_get_value region | tr '[:lower:]' '[:upper:]')"
case "${regdomain}" in
# Wait for a wireless LAN interface to appear, since this regdomain
# needs to be applied afterwards.
while [ ${wait_tries} -le 10 ] ; do
if iw dev | grep -q Interface; then
sleep 1
wait_tries=$((wait_tries + 1))
iw reg set "${regdomain}"
end script