mirror of
https://github.com/sipeed/LicheeRV-Nano-Build.git
synced 2026-09-11 05:09:56 -05:00
set default to ncm
This commit is contained in:
@@ -5,7 +5,7 @@ image boot.vfat {
|
||||
"fip.bin",
|
||||
"rawimages/boot.sd",
|
||||
"usb.dev",
|
||||
"usb.rndis0",
|
||||
"usb.ncm0",
|
||||
"wifi.sta",
|
||||
"gt9xx",
|
||||
"logo.jpeg",
|
||||
|
||||
@@ -27,7 +27,7 @@ cp -fv ${output_dir}/fip.bin ${output_dir}/input/
|
||||
cp -fv ${output_dir}/rawimages/boot.sd ${output_dir}/input/rawimages/
|
||||
cp -fv ${output_dir}/rawimages/rootfs.sd ${output_dir}/input/
|
||||
touch ${output_dir}/input/usb.dev
|
||||
touch ${output_dir}/input/usb.rndis0
|
||||
touch ${output_dir}/input/usb.ncm0
|
||||
touch ${output_dir}/input/wifi.sta
|
||||
touch ${output_dir}/input/gt9xx
|
||||
touch ${output_dir}/input/fb
|
||||
|
||||
@@ -82,15 +82,24 @@ then
|
||||
rm -rf configs/c.1/acm.GS0
|
||||
ln -s functions/acm.GS0 configs/c.1/
|
||||
fi
|
||||
if [ -e /boot/usb.rndis0 ]
|
||||
if [ -e /boot/usb.ncm0 ]
|
||||
then
|
||||
mkdir -p functions/ncm.usb0
|
||||
rm -rf configs/c.1/ncm.usb0
|
||||
ln -s functions/ncm.usb0 configs/c.1/
|
||||
echo 02 > functions/rndis.usb0/class
|
||||
echo 0d > functions/rndis.usb0/subclass
|
||||
echo 00 > functions/rndis.usb0/protocol
|
||||
elif [ -e /boot/usb.rndis0 ]
|
||||
then
|
||||
mkdir -p functions/rndis.usb0
|
||||
rm -rf configs/c.1/rndis.usb0
|
||||
ln -s functions/rndis.usb0 configs/c.1/
|
||||
echo e0 > /sys/kernel/config/usb_gadget/g0/functions/rndis.usb0/class
|
||||
echo 01 > /sys/kernel/config/usb_gadget/g0/functions/rndis.usb0/subclass
|
||||
echo 03 > /sys/kernel/config/usb_gadget/g0/functions/rndis.usb0/protocol
|
||||
echo e0 > functions/rndis.usb0/class
|
||||
echo 01 > functions/rndis.usb0/subclass
|
||||
echo 03 > functions/rndis.usb0/protocol
|
||||
fi
|
||||
|
||||
if [ -e /boot/usb.disk0 ]
|
||||
then
|
||||
mkdir -p functions/mass_storage.disk0
|
||||
@@ -125,3 +134,4 @@ then
|
||||
echo '' > /sys/kernel/config/usb_gadget/g0/UDC
|
||||
echo host > /proc/cviusb/otg_role
|
||||
fi
|
||||
|
||||
|
||||
@@ -46,6 +46,20 @@ then
|
||||
ifconfig eth0 up
|
||||
echo "ethernet mac address: ${new_ethmac}"
|
||||
|
||||
if [ -e /boot/usb.ncm0 ]
|
||||
then
|
||||
if [ -e /boot/usb.ncm0.mac ]
|
||||
then
|
||||
new_mac=$(cat /boot/usb.ncm0.mac)
|
||||
else
|
||||
new_mac=$(hex2mac 48da356e$(sha512sum /sys/class/cvi-base/base_uid | head -c 4))
|
||||
fi
|
||||
ifconfig usb0 down
|
||||
ip link set usb0 address ${new_mac}
|
||||
ifconfig usb0 up
|
||||
echo "ncm mac address: ${new_mac}"
|
||||
fi
|
||||
|
||||
if [ -e /boot/usb.rndis0 ]
|
||||
then
|
||||
if [ -e /boot/usb.rndis0.mac ]
|
||||
|
||||
Reference in New Issue
Block a user