一、刷armbian

N1已降级,“N1-ADBU盘启动(傻瓜包)”开启U盘启动。

  1. 文章推荐armbian 5.77比较稳定。
    https://www.right.com.cn/forum/thread-498873-1-1.html

  2. U盘刷入armbian,下载dtb文件放到U盘dtb文件夹。
    meson-gxl-s905d-phicomm-n1-xiangsm.dtb

  3. 打开uEnv.ini,修改配置
    在这里插入图片描述

  4. U盘插入靠近HDMI接口的USB,N1插电启动,找到N1的IP地址,putty连接
    初始用户名,密码为root,1234

  5. 写入EMMC,完成后关机,拔U盘重启
    /root/install.sh

二、更改软件源

  1. 源文件 /etc/apt/sources.list
    中科大源
    deb http://mirrors.ustc.edu.cn/debian stretch main contrib non-free
    deb http://mirrors.ustc.edu.cn/debian stretch-updates main contrib non-free
    deb http://mirrors.ustc.edu.cn/debian stretch-backports main contrib non-free
    deb http://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free
    清华源
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
    deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free
    阿里源
    deb http://mirrors.aliyun.com/debian stretch main contrib non-free
    deb http://mirrors.aliyun.com/debian stretch-proposed-updates main contrib non-free
    deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
    deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
    deb-src http://mirrors.aliyun.com/debian stretch-proposed-updates main contrib non-free
    deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
    deb http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
    deb-src http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
    deb http://mirrors.aliyuncs.com/debian stretch main contrib non-free
    deb http://mirrors.aliyuncs.com/debian stretch-proposed-updates main contrib non-free
    deb http://mirrors.aliyuncs.com/debian stretch-updates main contrib non-free
    deb-src http://mirrors.aliyuncs.com/debian stretch main contrib non-free
    deb-src http://mirrors.aliyuncs.com/debian stretch-proposed-updates main contrib non-free
    deb-src http://mirrors.aliyuncs.com/debian stretch-updates main contrib non-free
    deb http://mirrors.aliyuncs.com/debian-security/ stretch/updates main non-free contrib
    deb-src http://mirrors.aliyuncs.com/debian-security/ stretch/updates main non-free contrib
  2. 更新
    sudo apt update
    sudo apt upgrade

三、安装SMB

进入armbian-config,到安装软件页面,Samba空格选中,再回车安装。

四、配置SMB

  1. 修改配置文件/etc/samba/smb.conf,直接覆盖原内容,实现匿名直接连接。
[global]
	workgroup = WORKGROUP
    server string = Samba Server Version %v
    passdb backend = tdbsam
    cups options = raw
    security = user                    #认证模式为User
    map to guest = bad user            #这个很关键,实现匿名无须交互输入用户名和密码就靠它了
    guest account = guest              #匿名用户映射为guest用户

[myshare]                    #共享后看到的文件夹名
    comment = My share
    path = /home/public      #共享路径
    browseable = Yes         #可以被浏览,就是在网络邻居中能看到共享名
    read only = No           #可读写
    guest ok = Yes           #允许匿名访问,这个也需要设置,否则匿名无法访问
    valid users = samba liuag guest    #有效的用户和组
    invalid users = liuben   #无效用户和组   
    read list = samba    #只读用户和组(如果read only = No,只读用户需要在此设置)
    write list = liuag   #可读写用户和组(如果read only = Yes,可读写用户需要在此设置)
    allow hosts = 192.168.100.236    #允许访问主机列表,支持通配符
    deny hosts = 192.168.100.0/24    #禁止访问主机列表,支持通配符

简洁版

[global]
       workgroup = WORKGROUP
       security = user
       map to guest = Bad User
[media]
       comment = resources
       path = /home/public
       public = yes
       writable = yes
       guest ok = yes
       browseable = yes
  1. 修改目录权限
    chmod -R 777 /home/public
  2. 开机启动SMB
    systemctl enable samba
  3. 重启SMB
    systemctl restart samba
  4. 参考
    https://www.cnblogs.com/-xuan/p/10293859.html

五、挂载U盘

  1. 插上U盘,lsblk查看U盘盘符,这里是/dev/sda1
    在这里插入图片描述

  2. 挂载U盘到刚才的共享目录/home/public
    mount /dev/sda1 /home/public

  3. 用命令blkid /dev/sda1查看UUID并记下

  4. 设置开机挂载,nano /etc/fstab,加上以下内容,ntfs为当前U盘类型
    UUID=722059EC2059B835 /home/public ntfs defaults 0 0

  5. 启动挂载(好像不用这步也可以)
    mount -a

  6. 参考
    https://blog.csdn.net/qq_38265101/article/details/105470939
    https://www.right.com.cn/forum/thread-1285840-1-1.html
    https://zorz.cc/post/flash-phicomm-n1-and-smb.html

六、固定MAC,更新时间

  1. ifconfig记录当前MAC地址
  2. 修改配置文件nano /etc/network/interfaces
source /etc/network/interfaces.d/*

# Wired adapter #1
#allow-hotplug eth0
auto eth0
no-auto-down eth0
iface eth0 inet dhcp
hwaddress fc:7b:07:87:44:33  #新增此条
#address 192.168.0.100
#netmask 255.255.255.0
  1. 改为上海时区
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  2. ntp设置
apt -y install ntp
apt -y install ntpdate
ntpdate -u ntp.aliyun.com #阿里云 ntp 服务器
  1. 参考
    https://cyhour.com/1333/
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐