first commit

This commit is contained in:
Your Name
2026-02-07 20:22:48 +08:00
commit 1b9711d5e4
2270 changed files with 805872 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#!/bin/bash
if [[ -z $1 ]]; then
user=root
else
user=$1
fi
[[ -d /lib/systemd/system/getty@.service.d/ ]] && rm /lib/systemd/system/getty@.service.d/ -rf
[[ -f /lib/systemd/system/serial-getty@.service.d/override.conf ]] && rm /lib/systemd/system/serial-getty@.service.d/override.conf -f
[[ -d /etc/systemd/system/getty@.service.d/ ]] && rm /etc/systemd/system/getty@.service.d/ -rf
[[ -f /etc/systemd/system/serial-getty@.service.d/override.conf ]] && rm /etc/systemd/system/serial-getty@.service.d/override.conf -f
if [[ $1 == "-d" ]]; then
exit
fi
mkdir -p /etc/systemd/system/getty@.service.d/
mkdir -p /etc/systemd/system/serial-getty@.service.d/
cat <<-EOF > \
/etc/systemd/system/serial-getty@.service.d/override.conf
[Service]
ExecStartPre=/bin/sh -c 'exec /bin/sleep 10'
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin ${user} %I \$TERM
Type=idle
EOF
cp /etc/systemd/system/serial-getty@.service.d/override.conf \
/etc/systemd/system/getty@.service.d/override.conf

View File

@@ -0,0 +1,3 @@
#!/bin/bash
cat /proc/cpuinfo | grep "Serial"

View File

@@ -0,0 +1,20 @@
#!/bin/bash
sudo apt-get update
sudo apt-get install -y build-essential zlib1g-dev \
libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev \
libreadline-dev libffi-dev curl libbz2-dev
version=3.9.9
[[ -n $1 ]] && version=$1
# optimize build time with 100% CPU usage
CPUS=$(grep -c 'processor' /proc/cpuinfo)
CTHREADS="-j$((CPUS + CPUS/2))"
wget https://cdn.npmmirror.com/binaries/python/$version/Python-${version}.tgz
tar xvf Python-${version}.tgz
cd Python-${version}
./configure --enable-optimizations
make ${CTHREADS}
sudo make altinstall

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
#!/bin/bash
if [[ -z $1 ]]; then
user=root
else
user=$1
fi
sudo sed -i '/autologin-user=/d' /etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf
sudo echo autologin-user=${user} >> /etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf
sudo sed -i 's/root/anything/' /etc/pam.d/lightdm-autologin

View File

@@ -0,0 +1,5 @@
#!/bin/bash
sudo sed -i \
"s/autologin-user=.*/#&/" \
/etc/lightdm/lightdm.conf.d/22-orangepi-autologin.conf

View File

@@ -0,0 +1,8 @@
#!/bin/bash
if [[ $(uname -r) == 5.4.* ]]; then
echo 1 | sudo update-alternatives --config iptables > /dev/null
fi
sudo systemctl enable docker.service
sudo systemctl start docker.service

View File

@@ -0,0 +1,4 @@
#!/bin/bash
wget -O install.sh \
http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh

View File

@@ -0,0 +1,17 @@
#!/bin/bash
distributor_id=$(lsb_release -is)
distributor_id=${distributor_id,}
sudo apt-get remove -y docker docker-engine docker-ce docker.io
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://repo.huaweicloud.com/docker-ce/linux/${distributor_id}/gpg | sudo apt-key add -
echo "deb [arch=$(dpkg --print-architecture)] https://repo.huaweicloud.com/docker-ce/linux/${distributor_id} $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo groupadd docker
sudo usermod -aG docker $USER

View File

@@ -0,0 +1,19 @@
#!/bin/bash
release=$(lsb_release -cs)
sudo apt update
if [[ $release =~ focal|bionic|buster ]]; then
sudo apt-get -y install qt5-default qttools5-dev-tools qtbase5-doc-html qt5-assistant qt5-doc
elif [[ $release =~ bullseye|bookworm|jammy|noble ]]; then
sudo apt-get -y install qttools5-dev-tools qtbase5-doc-html qt5-assistant qt5-doc qt5-qmake qt5-qmake-bin
else
echo "Unsupported system!"
exit
fi
sudo apt-get -y install qtcreator qmlscene gdb qtdeclarative5-dev qtbase5-examples cmake
sudo chown orangepi:orangepi /usr/lib/aarch64-linux-gnu/qt5/examples -R
qmake -v

View File

@@ -0,0 +1,93 @@
#!/bin/bash
#mirror_url=http://mirrors.ustc.edu.cn
mirror_url=https://repo.huaweicloud.com
if [[ -n $1 && $1 =~ ros1|ros2 ]]; then
version=$1
else
echo "usage: install_ros.sh ros1/ros2"
exit
fi
release=$(lsb_release -cs)
if [[ $version == "ros1" && $release =~ focal ]]; then
[[ -f /etc/apt/sources.list.d/ros-latest.list ]] && sudo rm /etc/apt/sources.list.d/ros-latest.list
sudo sh -c "echo deb ${mirror_url}/ros/ubuntu $(lsb_release -sc) main > /etc/apt/sources.list.d/ros1.list"
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install -y ros-noetic-desktop-full
sudo sh -c 'echo "source /opt/ros/noetic/setup.bash" >> /root/.bashrc'
echo "source /opt/ros/noetic/setup.bash" >> /home/orangepi/.bashrc
sudo apt install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo sh -c 'echo "151.101.84.133 raw.githubusercontent.com" >> /etc/hosts'
source /opt/ros/noetic/setup.bash
sudo rosdep init
rosdep update
exit
fi
if [[ $version == "ros2" && $release =~ focal ]]; then
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
echo "deb [arch=$(dpkg --print-architecture)] ${mirror_url}/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list
sudo apt update
sudo apt install -y ros-galactic-desktop
sudo apt install -y ros-dev-tools
sudo sh -c 'echo "source /opt/ros/galactic/setup.bash" >> /root/.bashrc'
echo "source /opt/ros/galactic/setup.bash" >> /home/orangepi/.bashrc
source /opt/ros/galactic/setup.bash
ros2 -h
exit
fi
if [[ $version == "ros2" && $release =~ jammy ]]; then
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
echo "deb [arch=$(dpkg --print-architecture)] ${mirror_url}/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list
sudo apt update
sudo apt install -y ros-humble-desktop
sudo apt install -y ros-dev-tools
sudo sh -c 'echo "source /opt/ros/humble/setup.bash" >> /root/.bashrc'
echo "source /opt/ros/humble/setup.bash" >> /home/orangepi/.bashrc
source /opt/ros/humble/setup.bash
ros2 -h
exit
fi
if [[ $version == "ros2" && $release =~ noble ]]; then
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
echo "deb [arch=$(dpkg --print-architecture)] ${mirror_url}/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list
sudo apt update
sudo apt install -y ros-jazzy-desktop
sudo apt install -y ros-dev-tools
sudo sh -c 'echo "source /opt/ros/jazzy/setup.bash" >> /root/.bashrc'
echo "source /opt/ros/jazzy/setup.bash" >> /home/orangepi/.bashrc
source /opt/ros/jazzy/setup.bash
ros2 -h
exit
fi
echo "Unsupported System!"

Binary file not shown.

View File

@@ -0,0 +1,4 @@
#!/bin/bash
sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server

View File

@@ -0,0 +1,9 @@
#!/bin/bash
sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
sudo chmod 0600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo sed -i '/swapfile/d' /etc/fstab
sudo bash -c 'echo "/swapfile swap swap sw 0 0" >> /etc/fstab'

View File

@@ -0,0 +1,19 @@
#!/bin/bash
[[ -d ~/.vnc ]] && rm -rf ~/.vnc
vncserver
vncserver -kill :1
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
cat <<-EOF > \
~/.vnc/xstartup
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
EOF
chmod +x ~/.vnc/xstartup
vncserver
sync

View File

@@ -0,0 +1,38 @@
#!/bin/bash
if [[ -f /opt/ros/noetic/setup.bash ]]; then
source /opt/ros/noetic/setup.bash
roscore &
sleep 5
rosrun turtlesim turtlesim_node &
rosrun turtlesim turtle_teleop_key
fi
if [[ -f /opt/ros/galactic/setup.bash ]]; then
source /opt/ros/galactic/setup.bash
ros2 run demo_nodes_cpp talker &
ros2 run demo_nodes_py listener
fi
if [[ -f /opt/ros/humble/setup.bash ]]; then
source /opt/ros/humble/setup.bash
ros2 run demo_nodes_cpp talker &
ros2 run demo_nodes_py listener
fi
if [[ -f /opt/ros/jazzy/setup.bash ]]; then
source /opt/ros/jazzy/setup.bash
ros2 run demo_nodes_cpp talker &
ros2 run demo_nodes_py listener
fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,5 @@
[Service]
ExecStartPre=/bin/sh -c 'exec /bin/sleep 10'
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin orangepi %I $TERM
Type=idle

View File

@@ -0,0 +1,5 @@
[Service]
ExecStartPre=/bin/sh -c 'exec /bin/sleep 10'
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin orangepi %I $TERM
Type=idle