博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
download fomat install rootfs script
阅读量:4648 次
发布时间:2019-06-09

本文共 964 字,大约阅读时间需要 3 分钟。

download.sh

#!/bin/sh

# check the network first

serverip=$(cat /tmp/serverip)

while true; do

ping -c 5 $serverip;
if [ $? = 0 ];then
break;
fi
done

# then disable the firewall

/etc/init.d/firewall stop

cd /tmp

tftp -g -r rootfs.tar.gz $serverip

cd /

format.sh

#!/bin/sh

mmcdev=/dev/mmcblk0

# check device
while true;do
if [ -e $mmcdev ];then
break;
else
sleep 1;
fi
done

echo "d

n
p
1

w" |/usr/sbin/fdisk $mmcdev

mmcpart=${mmcdev}p1

while true;do

if [ -e $mmcpart ];then
break;
else
sleep 1;
fi
done

echo "y

" | /usr/sbin/mkfs.ext4 $mmcpart

 

install.sh

#!/bin/sh

mmcpart=/dev/mmcblk0p1

if [ ! -e $mmcpart ];then

echo "format the eMMC device failed";
exit
fi

tarfile=/tmp/rootfs.tar.gz

if [ ! -f $tarfile ]; then

echo "download the armbian failed";
exit
fi

mount $mmcpart /mnt

if [ $? = 1 ];then

echo "format the eMMC device failed";
exit
fi

cd /mnt

tar vxzf $tarfile

cd /

umount /mnt

echo "install finish"

 

转载于:https://www.cnblogs.com/lianghong881018/p/10273229.html

你可能感兴趣的文章
Linux系统中常用操作命令
查看>>
针对模拟滚动条插件(jQuery.slimscroll.js)的修改
查看>>
poi实现excel数据导入数据库
查看>>
实验七
查看>>
Linux高级编程(四)
查看>>
python pandas 对带时间序列的数据进行重采样处理
查看>>
7,7显示选中的目标信息
查看>>
DELPHI TreeView 文件目录树和 设置节点图标 完整
查看>>
安卓教程:提取APK程序里图片资源的方法
查看>>
[置顶] Android adb root权限
查看>>
单个雪碧图多个图像资源你该如何解决它们的定位?
查看>>
python 3.6 MJ小工具
查看>>
个人看法---团队合作
查看>>
jvm垃圾回收
查看>>
数据库索引
查看>>
poj 1466 Girls and Boys (最大独立集)
查看>>
MYSQL-交换表中2行2字段的值
查看>>
GNU-Radio & USRP Example
查看>>
TensorFlow函数(十)tf.global_variables_initializer()
查看>>
P3403 跳楼机
查看>>