Skip to content

Commit

Permalink
33_set_wifi_reg_domain.sh fixed and complete
Browse files Browse the repository at this point in the history
  • Loading branch information
sundarnagarajan committed Sep 27, 2018
1 parent 6be2aab commit af8663c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 113 deletions.
60 changes: 11 additions & 49 deletions remaster/chroot/commands/33_set_wifi_reg_domain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,59 +25,21 @@ if [ -f $ORIG_RESOLV_CONF -o -L $ORIG_RESOLV_CONF ]; then
mv $ORIG_RESOLV_CONF /etc/resolv.conf
fi

for f in 40-crda.rules 85-regulatory.rules
do
if [ -f /lib/udev/rules.d/$f ]; then
\cp -f /lib/udev/rules.d/$f /etc/udev/rules.d/
else
echo "File not found: /lib/udev/rules.d/$f"
fi
done
if [ -f /lib/crda/setregdomain ]; then
if [ ! -f /etc/udev/rules.d/40-crda.rules ]; then
echo 'SUBSYSTEM=="ieee80211", ACTION=="add", RUN+="/lib/crda/setregdomain"' > /etc/udev/rules.d/40-crda.rules
# Set a default regulatory domain in /etc/default/crda
CRDA_CONF=/etc/default/crda
if [ -f $CRDA_CONF ]; then
sed -i -e 's/^REGDOMAIN=$/REGDOMAIN=US/' $CRDA_CONF
echo "Setting DEFAULT Wifi regulatory domain to US"
echo "Change $CRDA_CONF to set REGDOMAIN to 2-letter ISO country code"
echo "where you are operating Wifi to comply with local laws"
echo "See: https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA"
else
echo "File not found: $CRDA_CONF"
fi
fi
else
echo "File not found: /lib/crda/setregdomain"
fi

# Set a default regulatory domain in /etc/default/crda
CRDA_CONF=/etc/default/crda
if [ -f $CRDA_CONF ]; then
sed -i -e 's/^REGDOMAIN=$/REGDOMAIN=US/' $CRDA_CONF
echo "Setting DEFAULT Wifi regulatory domain to US"
echo "Change $CRDA_CONF to set REGDOMAIN to 2-letter ISO country code"
echo "where you are operating Wifi to comply with local laws"
echo "See: https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA"
else
echo "File not found: $CRDA_CONF"
fi


# Rest is no longer needed
exit 0

WIFI_SCRIPTS_DIR=${PROG_DIR}/../wifi

if [ ! -d ${WIFI_SCRIPTS_DIR} ]; then
echo "WIFI_SCRIPTS_DIR not a directory: $WIFI_SCRIPTS_DIR"
exit 0
fi


WIFI_SCRIPTS_DIR=$(readlink -e $WIFI_SCRIPTS_DIR)
test "$(ls -A $WIFI_SCRIPTS_DIR)"
if [ $? -ne 0 ]; then
echo "No files to copy: $WIFI_SCRIPTS_DIR"
exit 0
fi

mkdir -p /root
cp -r ${WIFI_SCRIPTS_DIR}/. /root/

if [ ! -x /root/hardware/wifi/install.sh ]; then
echo "Not found or not executable: /root/hardware/wifi/install.sh"
exit 0
fi

/root/hardware/wifi/install.sh
23 changes: 0 additions & 23 deletions remaster/chroot/wifi/hardware/wifi/install.sh

This file was deleted.

33 changes: 0 additions & 33 deletions remaster/chroot/wifi/hardware/wifi/iw_set_reg_domain.sh

This file was deleted.

This file was deleted.

0 comments on commit af8663c

Please sign in to comment.