アーキテクチャ aarch64 ubuntu20 ルート ファイル システムと ros ロボット オペレーティング システム

1. 基本的なオペレーティング システムを構築する

       1.最小のubuntu20ファイルシステムをダウンロードします。       

        wget http://cdimage.ubuntu.com/ubuntu-base/releases/20.04/release/ubuntu-base-20.04.5-base-arm64.tar.gz
        mkdir rootfs
        tar -xpf ubuntu-base-20.04.5-base -arm64.tar.gz -C rootfs
       2. qemu ツールをインストールします
        sudo apt-get install qemu-user-static
        cd rootfs
        cp /usr/bin/qemu-aarch64-static usr/bin/
        3. DNS を設定します
        cp -b /etc /resolv.conf etc/resolv.conf
        4. 基本システム
        cd .. を入力します。 # rootfs ディレクトリに移動します。

        ./ch-mount.sh -m rootfs/

#!/bin/bash

function mnt() {
  echo "MOUNTING"
  sudo mount -t proc /proc ${2}proc
  sudo mount -t sysfs /sys ${2}sys
  sudo mount -o bind /dev ${2}dev

  sudo chroot ${2}
}

function umnt() {
  echo "UNMOUNTING"
  sudo umount ${2}proc
  sudo umount ${2}sys
  sudo umount ${2}dev

}


if [ "$1" == "-m" ] && [ -n "$2" ] ;
then
  mnt $1 $2
elif [ "$1" == "-u" ] && [ -n "$2" ];
then
  umnt $1 $2
else
  echo ""
  echo "Either 1'st, 2'nd or both parameters were missing"
  echo ""
  echo "1'st parameter can be one of these: -m(mount) OR -u(umount)"
  echo "2'nd parameter is the full path of rootfs directory(with trailing '/')"
  echo ""
  echo "For example: ch-mount -m /media/sdcard/"
  echo ""
  echo 1st parameter : ${1}
  echo 2nd parameter : ${2}
fi


      5.インストール升级系统软件
        apt update apt
        upgrade
        apt install usbutils network-manager sudo fdisk vim nano openssh-server iputils-ping wgetcurl iproute2 ダイアログロケール kmod zip unzip u-boot-tools initramfs-tools tcpdump statserial Cutecom cpufrequtils modemmanager apt install
        wpasupplicant udhcpc htop pciutils
        apt install rsyslog udev dbus systemd openssh-client dosfstools parted git sysstatless man
        apt install ubuntu-desktop-minimal
        apt install usbutils
        apt install apt-file usbutils openssh-server sudo fdisk vim iputils-ping wgetcurl iproute2 ダイアログ ロケール kmod zip unzip cpufrequtils tcpdump statserial
        apt install wpasupplicant udhcpc pciutils
        apt install rsyslog udev dbus systemd openssh-client dosfstools parted git sysstat vim

        6. lxde light デスクトップのインストール
        apt install lxde
        apt-file update

       7. ROS1 と ROS2 のインストール
        sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest。リスト'
        1.ROS1:
        curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
        apt install ros-noetic-desktop-full
        mv /opt/ros ros-noetic
        2.ROS 2 :
        sudocurl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros。 key -o /usr/share/keyrings/ros-archive-keyring.gpg
        echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
        ソース ~/.bashrc
        echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
        ソース /opt/ros/foxy/setup.bash
        echo " ソース / opt/ros/foxy/setup.bash" >> ~/.bashrc
        apt install ros-foxy-desktop
        mv /opt/ros/ros-foxy
        3. ros のバージョンを表示するには、
        まずターミナルに roscore と入力して
        、新しいターミナルを入力し、「rosparam list」
        と入力し、「rosparam get /rosdistro」と入力してバージョンを取得します

2. 基本システム構成

        1. sudo ユーザーを追加します
        useradd -m fire -g sudo -s /bin/bash -d /home/fire
        passwd fire
        fire666

        2. 次に、デフォルトの非スリープおよびパスワード不要のログインがあります。

        gnome-menu
        自動ログイン
        /etc/gdm3/custom.confに埋め込まれ
        たgnome
        - terminal

        3. Ubuntu の有線ネットワーク設定が消える問題の解決方法は、
        /etc/NetworkManager/NetworkManager.conf の
        [false] を [true] に変更し、右上の [保存] をクリックしてテキストエディタを終了することです。 。
        touch /etc/NetworkManager/conf.d/10-globally-manated-devices.conf
        サービス network-manager restart

       4. システムで不要になった deb パッケージを削除します
        sudo apt autoremove

        rm -rf /root/.bash_history

        5. パッケージファイルシステム

         出口

        ./ch-mount.sh -u rootfs/

        tar -cvf ../rootfs.tar *

3. rootfs.imgを作成する

        cd ..
        dd if=/dev/zero of=rootfs.img bs=2K count=3M
        mkfs.ext4 rootfs.img
        mount rootfs.img rootfs
        tar -xvf rootfs.tar -C rootfs

        モジュールとしてコンパイルされたカーネルドライバーがある場合
        cp -rf lib/modules/ rootfs/lib/
        umount rootfs
        e2fsck -p -f rootfs.img
        assign2fs -M rootfs.img

おすすめ

転載: blog.csdn.net/yangwenchao1983/article/details/131760793