Creating a file system for ARM development board under Linux

Creating a file system for ARM development board under Linux

1. Please download the Busybox source code online. For the compilation method, please refer to Baidu.

2. Please set up the cross-compilation tool chain first.

If there are no problems with 1 and 2 above, you can use the following script to create a file system for the ARM development board.

You can customize it and add your own Test demo.

#!/bin/bash
#yuanxin.yang develop 2015-07-05
#Path of file system and Busybox ====>You can customize it yourself FILESYSTEM=/Softwave/filesystem #Define the location of the file system you made BUSYBOX=/Softwave/arm/busybox-1.17.2 #Location of Busybox software LIBS=/usr/local/arm/4.5.1/arm-none-linux-gnueabi #Location of cross-compilation related library files #Judge whether the file exists and delete it if it exists if [ -d $FILESYSTEM ]
then
  rm -rf $FILESYSTEM &>/dev/null
  mkdir $FILESYSTEM &>/dev/null 
else
  mkdir $FILESYSTEM &>/dev/null 
fi
#Copy busybox related files if ! cp -rf $BUSYBOX/_install/* $FILESYSTEM &>/dev/null
then
  echo "cp busybox failed..."
  exit 1
fi
#Copy libraryif !cp -rf $LIBS/lib/ $FILESYSTEM/ &>/dev/null
then
  echo "copy libs fair...."
  exit 1
fi
#Copy etc
if ! cp -rf $BUSYBOX/examples/bootfloppy/etc $FILESYSTEM &>/dev/null
then
  echo "copy etc fair..."
  exit 1
fi
#Create Linux related directories cd $FILESYSTEM &>/dev/null
mkdir boot mnt root sys var net proc tmp dev home opt &>/dev/null
#Modify the configuration file echo > $FILESYSTEM/etc/fstab 
#Modify the etc/profile file echo "# /etc/profile: system-wide .profile file for the Bourne shells" > $FILESYSTEM/etc/profile
echo "echo \"===========================\"" >> $FILESYSTEM/etc/profile
echo "echo \"Welcom to Linux System\"" >> $FILESYSTEM/etc/profile
echo "echo \"===========================\"" >> $FILESYSTEM/etc/profile
echo "export PS1=\"[jiaobenzhijia@Linux \W] # \"" >> $FILESYSTEM/etc/profile
#Modify etc/init.d/rcS
echo "#!/bin/sh" > $FILESYSTEM/etc/init.d/rcS
echo "/bin/mount -n -t proc none /proc" >> $FILESYSTEM/etc/init.d/rcS 
echo "/bin/mount -n -t sysfs none /sys " >> $FILESYSTEM/etc/init.d/rcS 
echo "/bin/mount -t ramfs none /dev " >> $FILESYSTEM/etc/init.d/rcS 
echo "/bin/mount -n -t ramfs none /tmp " >> $FILESYSTEM/etc/init.d/rcS 
echo "/sbin/mdev -s" >> $FILESYSTEM/etc/init.d/rcS  
#Configure nfs service if ! grep "$FILESYSTEM" /etc/exports &>/dev/null
then
  echo "/filesystem *(rw,sync,no_root_squash)" >> /etc/exports
fi
#Start the service iptables -F &>/dev/null
service rpcbind restart 
service nfs restart 
echo "make filesystem ok....."
exit 0

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • In-depth interpretation of /etc/fstab file in Linux system
  • Python remote download file example on Linux server through paramiko
  • Python reads files on Linux server
  • Linux kernel device driver virtual file system notes
  • Linux kernel device driver proc file system notes
  • Linux shell searches for files and displays line numbers and corresponding intervals
  • Linux awk example of separating a column of a file by commas
  • Linux command line quick tips: How to locate a file
  • Some Linux file permission management methods you may not know
  • View the number of files in each subfolder of a specified folder in Linux

<<:  Creating Responsive Emails with Vue.js and MJML

>>:  MySQL SQL statement performance tuning simple example

Recommend

Detailed explanation of the flexible use of CSS grid system in projects

Preface CSS grids are usually bundled in various ...

Database index knowledge points summary

Table of contents First Look Index The concept of...

How to recover accidentally deleted table data in MySQL (must read)

If there is a backup, it is very simple. You only...

Vue3 realizes the image magnifying glass effect

This article example shares the specific code of ...

MySQL count detailed explanation and function example code

Detailed explanation of mysql count The count fun...

How to display small icons in the browser title bar of HTML webpage

Just like this effect, the method is also very si...

Using js to implement the two-way binding function of data in Vue2.0

Object.defineProperty Understanding grammar: Obje...

Understanding of the synchronous or asynchronous problem of setState in React

Table of contents 1. Is setState synchronous? asy...

Common operation commands of MySQL in Linux system

Serve: # chkconfig --list List all system service...

Play and save WeChat public account recording files (convert amr files to mp3)

Table of contents Audio transcoding tools princip...

Problems and solutions when replacing Oracle with MySQL

Table of contents Migration Tools Application tra...

Introduction to user management under Linux system

Table of contents 1. The significance of users an...