从0开玩lichee zero-5-mmc烧录

一般比较小的系统我们用spi flash。 比较大的系统比如debian,我们需要mmc sd卡。

分区

file

准备

将所需的所有目标文件,都拷贝到当前目录下。

uboot

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

第一分区

cp boot.scr /mnt/sd/part1
cp sun8i-v3s-licheepi-zero-dock.dtb /mnt/sd/part1/
cp zImage /mnt/sd/part1

第二分区

tar vxf rootfs.tar -C /mnt/sd/part2

virtualbox 共享目录不生效

原因是guest addistions 没生效。

解决:
将virtualbox安装目录下的VBoxGuestAdditions.ios 加载到第一主光驱,然后重启:

file

然后运行:
cd /media/xxx/VBox_GAs_7.0.8
sudo shell VboxLinuxAdditions.run

执行完成后,再重新配置共享目录,发现确定是有更新的效果了,再去看挂载目录,就会发发现成功了

从0开玩lichee zero-3-rootfs编译

build

apt-get install linux-headers-$(uname -r)
wget https://buildroot.org/downloads/buildroot-2017.08.tar.gz
tar xvf buildroot-2017.08.tar.gz
cd buildroot-2017.08/
make menuconfig
make

troubleshoot

  • host-m4 版本问题:c-stack.c:55:26: error: missing binary operator before token "("
    解决: 由m4-1.4.18升级为m4-1.4.19。修改package/m4下的m4.mk和m4.hash
    m4.mk:

    M4_VERSION = 1.4.19

    m4.hash:

    sha256  63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96  m4-1.4.19.tar.xz
  • bison: Please port gnulib fseterr.c to your platform
    解决:cd output/build/host-bison-3.0.4

    sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
    echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
  • libfakeroot.c:99:40: error: '_STAT_VER' undeclared
    #ifndef _STAT_VER
    #if defined (__aarch64__)
    #define _STAT_VER 0
    #elif defined (__x86_64__)
    #define _STAT_VER 1
    #else
    #define _STAT_VER 3
    #endif
    #endif

从0开玩lichee zero-2-kernel编译

系统

为了支持 rtl8723 我们需要新较新的分支:
git clone https://github.com/Lichee-Pi/linux.git
git checkout -b nano-5.2-flash origin/nano-5.2-flash

cd linux
make ARCH=arm licheepi_zero_defconfig
make ARCH=arm menuconfig   #add bluethooth, etc.
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 INSTALL_MOD_PATH=out modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 INSTALL_MOD_PATH=out modules_install

支持 rtl8723BS

make menuconfig => Device Drivers => Staging drivers
选择rtl8723BS 为 M

troubleshoot

  • multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
    解决:vi ./scripts/dtc/dtc-parser.tab.c ,将YYLTYPE yylloc这一行注释掉

  • scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory
    解决:sudo apt install openssl libssl-dev

  • libz.so.1
    解决:apt-get install lib32z1

  • 其他指令问题 ,比如 "cpsid i","isb" 等
    解决:更换编译器,比如:
    https://releases.linaro.org/components/toolchain/binaries/
    https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf.tar.xz

unraid扩展虚拟机磁盘

unraid使用的是qcow2,超过最大空间后,提供提示空间不够了。

如何在不影响内容的情况下扩容?

扩展虚拟空间

qemu-img resize test.qcow2 +100G
qemu-img info test.qcow2

执行完以上动作后,内部的逻辑空间并没有增大,还需要继续调整

通过LVM扩展虚拟磁盘

https://www.codewoody.com/posts/18238/
https://fabianlee.org/2016/07/26/ubuntu-extending-a-virtualized-disk-when-using-lvm/

这里需要注意的是扩展LVM逻辑卷时,需要根据自己的实际卷来调整:

  • 要么扩展现有的卷,查看逻辑卷:
    root@ubuntu:/data# lvs
    LV        VG        Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
    ubuntu-lv ubuntu-vg -wi-ao---- <118.00g    

    如上所示就一个 Ubuntu-lv卷

  • 要么自己创建新卷:
    lvcreate -n newlv -L 100G newvg

    newvg是 卷组名称

背景知识

https://linux.cn/article-12670-1.html

PV =>pvs
VG =>vgs
LV -lvs