project:cfg:BoardConfig_IPC:overlay:Fix permission errors and naming issues in overlay files.
Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
parent
1723f324ab
commit
6b4836bd3e
|
|
@ -0,0 +1,61 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function lf_rm() {
|
||||||
|
for file in "$@"; do
|
||||||
|
if [ -e "$file" ]; then
|
||||||
|
echo "Deleting: $file"
|
||||||
|
rm -rf "$file"
|
||||||
|
#else
|
||||||
|
#echo "File not found: $file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# remove unused files
|
||||||
|
function remove_data()
|
||||||
|
{
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/*.aiisp
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/*.data
|
||||||
|
|
||||||
|
# drm
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm*
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm_rockchip*
|
||||||
|
|
||||||
|
# kms
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libkms*
|
||||||
|
|
||||||
|
# freetype
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libfreetype*
|
||||||
|
|
||||||
|
# iconv
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libiconv*
|
||||||
|
|
||||||
|
# rkAVS
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/librkAVS*
|
||||||
|
|
||||||
|
# jpeg
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libjpeg*
|
||||||
|
|
||||||
|
# png
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libpng*
|
||||||
|
|
||||||
|
# vqefiles
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/share/vqefiles/*
|
||||||
|
|
||||||
|
# ko
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/ko/phy-rockchip-csi2-dphy-hw.ko
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/ko/phy-rockchip-csi2-dphy.ko
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/ko/rga3.ko
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/ko/rknpu.ko
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/ko/rockit.ko
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/ko/sc3336.ko
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/ko/video_rkcif.ko
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/ko/video_rkisp.ko
|
||||||
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/ko/mpp_vcodec.ko
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#=========================
|
||||||
|
# run
|
||||||
|
#=========================
|
||||||
|
remove_data
|
||||||
|
|
@ -17,7 +17,7 @@ function remove_data()
|
||||||
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/*.aiisp
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/*.aiisp
|
||||||
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/*.data
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/*.data
|
||||||
|
|
||||||
# drm
|
# drm ( sample program required )
|
||||||
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm*
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm*
|
||||||
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm_rockchip*
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm_rockchip*
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ function remove_data()
|
||||||
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/*.data
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/*.data
|
||||||
|
|
||||||
# drm
|
# drm
|
||||||
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm*
|
#lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm*
|
||||||
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm_rockchip*
|
#lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libdrm_rockchip*
|
||||||
|
|
||||||
# kms
|
# kms
|
||||||
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libkms*
|
lf_rm $RK_PROJECT_PACKAGE_OEM_DIR/usr/lib/libkms*
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ check_hciconfig() {
|
||||||
else
|
else
|
||||||
echo "hci0 not found or not available."
|
echo "hci0 not found or not available."
|
||||||
fi
|
fi
|
||||||
|
ifconfig wlan0 up && udhcpc -i wlan0 > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
echo "aic8800_fdrv not found."
|
echo "aic8800_fdrv not found."
|
||||||
fi
|
fi
|
||||||
|
|
@ -18,7 +19,7 @@ check_hciconfig() {
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
start)
|
start)
|
||||||
check_hciconfig
|
check_hciconfig &
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@ load_luckfoxconfig() {
|
||||||
fi
|
fi
|
||||||
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra" ] ||
|
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra" ] ||
|
||||||
[ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
[ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
||||||
luckfox_switch_rgb_resolution &
|
if [ -f /usr/bin/luckfox_switch_rgb_resolution ]; then
|
||||||
|
luckfox_switch_rgb_resolution &
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,30 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
USB_KEYWORD="android_work: sent uevent USB_STATE="
|
||||||
|
USB_MODE_PATH="/proc/device-tree/usbdrd/usb@ffb00000/dr_mode"
|
||||||
|
|
||||||
|
usb_reset() {
|
||||||
|
while true; do
|
||||||
|
last_line=$(dmesg | grep "$USB_KEYWORD" | tail -n 1)
|
||||||
|
|
||||||
|
if [[ "$last_line" == *"DISCONNECTED" ]]; then
|
||||||
|
echo "Detected USB DISCONNECTED."
|
||||||
|
/etc/init.d/S50usbdevice restart
|
||||||
|
fi
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
/usr/bin/filesystem_resize.sh
|
/usr/bin/filesystem_resize.sh
|
||||||
/usr/bin/wifi_bt_init.sh
|
/usr/bin/wifi_bt_init.sh
|
||||||
/usr/bin/luckfox_switch_rgb_resolution &
|
/usr/bin/luckfox_switch_rgb_resolution &
|
||||||
|
|
||||||
|
usb_mode="$(cat $USB_MODE_PATH)"
|
||||||
/etc/init.d/S50usbdevice start
|
/etc/init.d/S50usbdevice start
|
||||||
|
if [ "$usb_mode" = "peripheral" ];then
|
||||||
|
usb_reset &
|
||||||
|
fi
|
||||||
|
|
||||||
luckfox-config load
|
luckfox-config load
|
||||||
if [ -n "$(hwclock | grep "invalid")" ]; then
|
if [ -n "$(hwclock | grep "invalid")" ]; then
|
||||||
date -s 2024-01-01
|
date -s 2024-01-01
|
||||||
|
|
|
||||||
0
project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu-ultra/etc/udhcpd.conf
Normal file → Executable file
0
project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu-ultra/etc/udhcpd.conf
Normal file → Executable file
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
||||||
systemctl stop wpa_supplicant
|
systemctl stop wpa_supplicant
|
||||||
|
|
||||||
|
if [ "$1" = "stop" ] ;then
|
||||||
|
pkill -f "udhcpc -i wlan0"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d /oem/usr/ko ]; then
|
if [ -d /oem/usr/ko ]; then
|
||||||
cd /oem/usr/ko
|
cd /oem/usr/ko
|
||||||
if [ -z "$(ifconfig | grep "wlan0")" ]; then
|
if [ -z "$(ifconfig | grep "wlan0")" ]; then
|
||||||
|
|
@ -31,6 +37,7 @@ if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
||||||
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf >/dev/null
|
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf >/dev/null
|
||||||
chmod a+x /usr/share/udhcpc/default.script
|
chmod a+x /usr/share/udhcpc/default.script
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "This Luckfox Pico model don't support WIFI!"
|
echo "This Luckfox Pico model don't support WIFI!"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
21
project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu/etc/rc.local
Normal file → Executable file
21
project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu/etc/rc.local
Normal file → Executable file
|
|
@ -1,7 +1,28 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
USB_KEYWORD="android_work: sent uevent USB_STATE="
|
||||||
|
USB_MODE_PATH="/proc/device-tree/usbdrd/usb@ffb00000/dr_mode"
|
||||||
|
|
||||||
|
usb_reset() {
|
||||||
|
while true; do
|
||||||
|
last_line=$(dmesg | grep "$USB_KEYWORD" | tail -n 1)
|
||||||
|
|
||||||
|
if [[ "$last_line" == *"DISCONNECTED" ]]; then
|
||||||
|
echo "Detected USB DISCONNECTED."
|
||||||
|
/etc/init.d/S50usbdevice restart
|
||||||
|
fi
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
/usr/bin/filesystem_resize.sh
|
/usr/bin/filesystem_resize.sh
|
||||||
|
|
||||||
|
usb_mode="$(cat $USB_MODE_PATH)"
|
||||||
/etc/init.d/S50usbdevice start
|
/etc/init.d/S50usbdevice start
|
||||||
|
if [ "$usb_mode" = "peripheral" ];then
|
||||||
|
usb_reset &
|
||||||
|
fi
|
||||||
|
|
||||||
luckfox-config load
|
luckfox-config load
|
||||||
if [ -n "$(hwclock | grep "invalid")" ]; then
|
if [ -n "$(hwclock | grep "invalid")" ]; then
|
||||||
date -s 2024-01-01
|
date -s 2024-01-01
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user