• 制作sd卡启动盘


    1,插上sd卡到Ubuntu,查看分区信息
        
        peter@ubuntu:~$ ls /dev/sdb
        sdb   sdb1  sdb2  sdb3  sdb4  sdb5                    //如果sdb只有3个分区可以再分两个区:sdb4,sdb5 
        
    2,将内核和设备树放到sdb4分区

        1》格式化sdb4分区
            peter@ubuntu:~$ sudo mkfs.ext4 /dev/sdb4
            mke2fs 1.44.1 (24-Mar-2018)
            Creating filesystem with 10240 1k blocks and 2560 inodes
            Filesystem UUID: d32fe974-557c-4e60-8d5b-ee095f88de41
            Superblock backups stored on blocks:
                    8193

            Allocating group tables: done
            Writing inode tables: done
            Creating journal (1024 blocks): done
            Writing superblocks and filesystem accounting information: done

        2》创建挂载点,将/dev/sdb4分区挂载到挂载点,并将内核镜像uImage和设备树文件拷贝到挂载点中
            
            peter@ubuntu:~$ mkdir testdir
            peter@ubuntu:~$ sudo mount -t ext4 /dev/sdb4 testdir/
            peter@ubuntu:~$ cd testdir/
            peter@ubuntu:~/testdir$ ls
            lost+found

            peter@ubuntu:~/testdir$ sudo cp /tftpboot/uImage ./  -r
            peter@ubuntu:~/testdir$ sudo cp /tftpboot/stm32mp157a-fsmp1a.dtb . -r
            peter@ubuntu:~/testdir$ ls
            lost+found  stm32mp157a-fsmp1a.dtb  uImage
            
            //然后卸载:peter@ubuntu:~$ sudo umount testdir
    3,将文件系统放到/dev/sdb5分区    
        
        1》格式化sdb5分区 
            peter@ubuntu:~$ sudo mkfs.ext4 /dev/sdb5
            mke2fs 1.44.1 (24-Mar-2018)
            Creating filesystem with 20480 1k blocks and 5136 inodes
            Filesystem UUID: 5b4c4055-0669-4794-9a8e-ef6572e953d8
            Superblock backups stored on blocks:
                    8193

            Allocating group tables: done
            Writing inode tables: done
            Creating journal (1024 blocks): done
            Writing superblocks and filesystem accounting information: done
            
        2》将/dev/sdb5分区重新挂载到挂载点testdir,并将文件系统中所有文件拷贝到挂载点中
        
            peter@ubuntu:~$ sudo mount -t ext4 /dev/sdb5 testdir
            peter@ubuntu:~$ cd testdir/
            peter@ubuntu:~/testdir$ ls
            lost+found
            
            peter@ubuntu:~/testdir$ sudo cp /opt/myrootfs/* . -r                                                        */
            peter@ubuntu:~/testdir$ ls
            bin  etc           home  linuxrc     mnt   root  sys  usr
            dev  hello_drv.ko  lib   lost+found  proc  sbin  tmp

            //然后卸载:peter@ubuntu:~$ sudo umount testdir

  • 相关阅读:
    tree命令详解(输出目录树层结构,显示目录和文件)
    周计划&周记录:2022年6月27日-2022年7月3日
    无胁科技-TVD每日漏洞情报-2022-9-8
    spring boot 2.X中如何加密配置中的敏感信息
    Python 调硬件参数速度加快
    python记录-01
    华为攻击防范简介
    Spring的Factories机制介绍
    Vue3 v-model非兼容更改
    【系统架构设计师】- 知识点汇总(易错总结)
  • 原文地址:https://blog.csdn.net/wenyue043/article/details/126950875