[linux]linux笔记

本文详细介绍了树莓派系统配置流程,包括解决安装英伟达显卡后无法重启的问题,SD卡扩容,声音配置,更换国内镜像源,WiFi配置,以及内核、驱动和设备树的编译更新方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

a start job is running for hold until boot process finishes up

这是在安装了英伟达显卡之后重启就进不去了

Ctrl + Alt + F1 进入终端后

sudo apt-get  remove nvidia* -y

E: Unable to parse package file /var/lib/dpkg/status (1)

sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo aptitude update

SD卡扩容系统

df -h
pi@raspberrypi ~ $ df -h #查看当前磁盘大小,总大小只有2.9GB
Filesystem      Size  Used Avail Use% Mounted on
rootfs          2.9G  2.8G   15M 100% /
/dev/root       2.9G  2.8G   15M 100% /
devtmpfs        214M     0  214M   0% /dev
tmpfs            44M  244K   44M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p1   56M   19M   37M  34% /boot
tmpfs            88M     0   88M   0% /tmp


pi@raspberrypi ~ $ cat /sys/block/mmcblk0/mmcblk0p2/start   # 查看第二分区的起始地址,后面会用到
122880


pi@raspberrypi ~ $ sudo fdisk /dev/mmcblk0   #使用fdisk操作磁盘

Command (m for help): d   #d,删除分区
Partition number (1-4): 2   # 2,删除第二分区

Command (m for help): n  #创建一个新分区
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p  #创建主分区
Partition number (1-4, default 2): 2  #分区2
First sector (2048-7744511, default 2048): 122880  #输入第一次得到的第二分区起始扇区
Last sector, +sectors or +size{K,M,G} (122880-7744511, default 7744511):  #最后一个sector,默认即可Enter
Using default value 7744511

Command (m for help): w   #将上面的操作写入分区表
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.


pi@raspberrypi ~ $ sudo reboot  #设置完成需要重启,sudo reboot

sudo resize2fs /dev/mmcblk0p2

麦克风没声但aplay正常

sudo apt-get install sox
sudo apt-get install sox libsox-fmt-all

声音相关

amixer -c 0 cset numid=12 2		使能mic1
arecord -D hw:0,0 -d 10 -f S16_LE -r 16000 tmp.wav	录音测试
arecord -D hw:2,0 -d 3 -f S16_LE -r 16000 tmp.wav

声卡配置

sudo nano .asoundrc
sudo nano /etc/asound.conf
defaults.pcm.card 0
defaults.pcm.device 0
defaults.ctl.card 0
pcm.!default {
        type asym
        playback.pcm {
            type plug
            slave.pcm "hw:0,0"
        }
        capture.pcm {
            type plug
            slave.pcm "hw:0,0"
        }
}

ctl.!default {
        type hw
        card 0
}

更改各大国内源

sudo vi /etc/apt/sources.list
sudo vim /etc/apt/sources.list

163源
deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted 
deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted 
deb http://mirrors.163.com/ubuntu/ xenial universe 
deb-src http://mirrors.163.com/ubuntu/ xenial universe 
deb http://mirrors.163.com/ubuntu/ xenial-updates universe 
deb-src http://mirrors.163.com/ubuntu/ xenial-updates universe 
deb http://mirrors.163.com/ubuntu/ xenial multiverse 
deb-src http://mirrors.163.com/ubuntu/ xenial multiverse 
deb http://mirrors.163.com/ubuntu/ xenial-updates multiverse 
deb-src http://mirrors.163.com/ubuntu/ xenial-updates multiverse 
deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse 
deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse

阿里源
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ xenial partner
清华源

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
arm源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe

树莓派源
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

东北大学源

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial main restricted #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security multiverse

中科大源

deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
arm源
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
debian源
deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

deb http://ftp.cn.debian.org/debian/ stretch main contrib non-free
deb http://ftp.cn.debian.org/debian/ stretch-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free
deb http://ftp.cn.debian.org/debian/ stretch-backports main contrib non-free

wifi配置

sudo nano /etc/network/interfaces
network={
    ssid="KKKK"
	key_mgmt=WPA-PSK2
    psk="88888888"
}
auto wlan0
iface wlan0 inet dhcp
wpa-ssid KKKK
wpa-psk 88888888

nmcli dev wifi connect "KKKK" password "99999999" ifname wlan0
nmcli dev wifi connect "TP-LINK_365E" password "88888888" ifname wlx00117f4ac02f
nmcli dev wifi connect "KKKK" password "99999999" ifname wlx00117f4ac02f

nmcli dev wifi connect "KKKK" password "88888888" ifname wlan0

iface wlan0 inet dhcp
        wpa-ssid KKKK
        wpa-psk d28e8e69599b55efdf37a929e13d10e086e03aad06439b9dfda9f787ab3d41c2
		

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="KKKK"
psk="88888888"
}

重置时区

dpkg-reconfigure tzdata

修改默认python版本为python3

mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/bin/python3 /usr/bin/python

ubuntu虚拟机重启进不了桌面

cd /etc/X11  
sudo cp xorg.conf.failsafe xorg.conf 

dd命令将SD卡系统复制到EMMC

sudo dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=10MB status=progress

下载Linux内核源码,并切换分支:

$ git clone https://github.com/friendlyarm/linux.git -b sunxi-4.14.y --depth 1


编译和更新Linux内核:

$ apt-get install u-boot-tools
$ cd linux
$ touch .scmversion


导入配置

make sunxi_defconfig ARCH=arm CROSS_COMPILE=arm-linux- -j80


编译内核 设备树

make zImage dtbs ARCH=arm CROSS_COMPILE=arm-linux- -j80


menuconfig配置

make menuconfig ARCH=arm CROSS_COMPILE=arm-linux- -j80


编译完成后会在arch/arm/boot/目录下生成zImage,并且在arch/arm/boot/dts/目录下生成dtb文件。

假设SD卡的boot分区挂载在/media/SD/boot/,更新SD卡上的zImage和dtb文件:

$ cp arch/arm/boot/zImage /media/SD/boot/
$ cp arch/arm/boot/dts/sun8i-*-nanopi-*.dtb /media/SD/boot/


也可以用scp命令通过网络更新:
网络更新内核

scp arch/arm/boot/zImage root@192.168.137.83:/boot


网络更新设备树

scp arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dtb root@192.168.137.83:/boot


编译和更新驱动模块:

$ cd linux
$ make modules ARCH=arm CROSS_COMPILE=arm-linux-


假设SD卡的rootfs分区挂载在/media/SD/rootfs/,更新SD卡上rootfs的驱动模块:

$ cd linux
$ make modules_install INSTALL_MOD_PATH=/media/SD/rootfs/ ARCH=arm CROSS_COMPILE=arm-linux-

 


arecord -D hw:2,0 -d 3 -f S16_LE -r 16000 tmp.wav
arecord -D hw:2,0 -d 3 -f S16_LE -r 16000 tmp.wav
make menuconfig  ARCH=arm CROSS_COMPILE=arm-linux-
make zImage dtbs  ARCH=arm CROSS_COMPILE=arm-linux-  -j8
scp arch/arm/boot/zImage root@192.168.137.156:/boot
scp arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dtb root@192.168.137.156:/boot
apt-get install zlib1g-dev libbz2-dev libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev xz-utils libexpat1-dev liblzma-dev libffi-dev libc6-dev
nmcli dev wifi connect "KKKK" password "99999999" ifname wlan0
nmcli dev wifi connect "TP-LINK_365E" password "88888888" ifname wlx00117f4ac02f
nmcli dev wifi connect "KKKK" password "99999999" ifname wlx00117f4ac02f

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
1. 准备工作
    1) 安装Ubuntu14.04LTS(长支持版本),如果用虚拟机请安装vmware14(别的虚拟机都不推荐,泪的教训),  然后安装 vmware tools(不是必须,但是方便文件共享)

    2) 安装arm linux 硬件浮点数工具链, 因为V3s支持VFPv4 浮点单元: sudo apt-get install gcc-arm-linux-gnueabihf

    3) 安装git源码管理软件:  sudo apt-get install git

    4) 其他支撑软件

2. u-boot
      首先获取u-boot源码:             git clone https://github.com/Lichee-Pi/u-boot.git -b v3s-current
      如果你需要支持spi flash:   git clone https://github.com/Lichee-Pi/u-boot.git -b v3s-spi-experimental

修改 include/configs/sun8i.h, 使u-boot可以直接从tf卡启动:

#define CONFIG_BOOTCOMMAND   "setenv bootm_boot_mode sec; " \
                            "load mmc 0:1 0x41000000 zImage; "  \
                            "load mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero-dock.dtb; " \
                            "bootz 0x41000000 - 0x41800000;"

#define CONFIG_BOOTARGS      "console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw  vt.global_cursor_default=0"

cd u-boot
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make LicheePi_Zero_800x480LCD_defconfig (群主网店5寸屏)

ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make LicheePi_Zero_480x272LCD_defconfig (通用4.3寸屏)

ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make LicheePi_Zero_defconfig (默认)

ARCH=arm make menuconfig

执行编译:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make

多核编译,避免cpu其他内核打酱油, J后的参数是参与编译的cpu个数:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j8
3. 设备树, Linux
    获取Linux源码(zero-4.13.y分支对网卡支持比较好):  git clone https://github.com/Lichee-Pi/linux.git -b zero-4.13.y
    生成荔枝派Zero 默认配置文件: CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm make licheepi_zero_defconfig
    设备树文件(默认不需要修改):  arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
    编译内核:     make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4
    编译设备树: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs

4. 根文件系统
    1). 下载最新的buildroot稳定版本
        官方网站:   https://buildroot.org/download.html
        长支持版本:buildroot-2017.02.7.tar.gz
        最新稳定版:buildroot-2017.08.1.tar.gz

    2). 配置buildroot 参数, make menuconfig; make
	
5. 烧录TF卡启动盘:  【视频分享】制作荔枝派Zero开发板(全志V3s) TF/SD卡启动盘
    1) 删除TF卡所有分区
    2) 将uboot写入到sd卡8k偏移处(必须8K偏移, brom龟腚的)。
        sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
    3) 建立第一个分区,大小32M(可以随意填写), 格式FAT16, 把zImage, sun8i-v3s-licheepi-zero-dock.dtb拷贝到 这个分区
    4) 建立第二个分区,用尽剩余空间,格式ext4, 把buildroot产生的rootfs.tar解压到该分区根目录
        tar xvf output/images/rootfs.tar -C /挂载的tf卡第二个分区目录
		
		
ffmpeg  -i /dev/video0 out1.avi

-t 10             录制10秒:
-s 1920x1080      设定分辨率
-r 30             设定帧率
-b:v              设定视频比特率
-b:a              设定视频比特率
-c:v libx264      设定视频编码器【等效 -vcodec libx264】

root@raspberrypi:/home/pi# ./ffmpeg -t 20 -s 1920x1080 -r 25  -b:v 1500K  -c:v libx264 -i /dev/video0  out.avi


参考:
root@odroid ~# ffmpeg -t 10 -s 640x480 -r 25 -i /dev/video0 -vcodec libx264 -b:v 4000K out.avi

启动摄像头采集

media-ctl --set-v4l2 '5:0[fmt:UYVY8_2X8/1920x1080]'

media-ctl --set-v4l2 '5:0[fmt:UYVY8_2X8/1920x1080]'
media-ctl --set-v4l2 '5:0[fmt:UYVY8_2X8/240x240]'

media-ctl --set-v4l2 --v4l2-vflip 1

fswebcam -S 1 -d /dev/video0 -p YUYV -r 1920x1080 test.jpg
fswebcam -S 1 -d /dev/video0 -p YUV420P -r 240x240 test.jpg
fswebcam -S 5 -d /dev/video0 -p YUV420P -r 640x480 test.jpg

mjpg_streamer -i "input_uvc.so -d /dev/video0 -n -y YUV420P -r 240x240" -o "output_http.so"


amixer -c 0 cset numid=12 2		使能mic1
arecord -D hw:0,0 -d 10 -f S16_LE -r 16000 tmp.wav	录音测试

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值