分类:ubuntu

linux gtk 编程

需要在非root用户 DISPLAY=:0 ./example-0 运行。

同时,x server 限制连接用户。所以如果要通过root调试,会麻烦一些。

跨平台更新制作rootfs

在x64( pc /ubuntu 18.10 )跨平台编译arm64 的debian rootfs完整镜像,通常地,更新rootfs都是直接放在目标机上面,制作更新好rootfs后再拷贝回编译机。

对于目标机平台,通常拷贝rootfs需要非运行时环境,所以例如在emmc的rootfs需要通过sd卡系统启动去执行拷贝操作。

同时拷贝/压缩还需要关心文件的uid、gid、用户名、组名、执行权限。稍不注意,功亏一篑。

这里通过介绍qemu虚拟跨平台制作、更新rootfs。

如我们知道,debootstrap用以通过源制作debian/ubuntu 的基础rootfs。通常来说其分为下载(--foreign)和安装配置(--second-stage)两个阶段。对于跨平台的第一阶段下载只需要通过--arch置顶平台下载对应deb包,但是对于包安装则需chroot后在编译机上面虚拟目标机的deboosttap 执行安装。

如上讨论,这里我们在x64 平台下载arm64(aarch64)平台rootfs并且尝试通过chroot实现初始用户、包安装重等操作。

  • 安装依赖包;

  • 下载归档keyring

  • 通过源下载rootfs

deiban jessie 如上下载安装可能会因为包缺失提示下载失败,这里搜索寻找替换了老的软件源。

chroot 是linux 用以切换rootfs的一个应用,跨平台操作通过需要切换的rootfs ...

docker

有些疑问,先前错误的理解了image和container的关系,以为container是运行时(running time)的image,其实原文描述的意思是可运行的(runable)。然后可运行的container的再区分正在运行和为未运行的。

那么还有一个问题,docker image和container各自在磁盘的哪里?是否可以备份和删除。

man bash redirection

Before a command is executed, its input and output may be redirected using a special notation interpreted by the shell. Redirection allows commands' file handles to be duplicated, opened, closed, made to refer to different files, and can change the files the command reads from and writes to. Redirection may also be used to modify file handles in the current shell execution environment. The following redirection operators may precede or appear anywhere within a simple command or may follow a command. Redirections are processed in the order they appear, from left to right.

Each red...

chromium is‘t full screen

尝试直接将 chromium F11 全屏,无效。

尝试设置chromium 窗口大小。

直接杀死chromium 窗口确定这里灰边为桌面背景。

直接启动chromium也确定未全屏。

原来,chromium 有一个kiosk-mode专门用以全屏模式,尝试任然无效,所以推测很有可能是桌面环境设置的问题。

对比了正常和异常的桌面环境配置~/.config对比,找到了/home/pi/.config/lxsession/LXDE/desktop.conf 不一致,同时也验证了窗口管理器openbox 未启动。

~/.config/lxsession/LXDE/desktop.conf 文件是来自于/etc/xdg/lxsession/LXDE/desktop.conf 拷贝。通过~/.cache/lxsession/LXDE/run.log 日志可以确定。

shell command

对于Shell命令我们要区分bash 内置(bash built in )和GNU 开源软件包以及三方软件包。对于所有命令我们都可以尝试whereis 确定可执行文件、源码、和手册路径。

同时可以可以通过which确定当前环境变量下的命令位置

对于命令我们可以尝试通过 man 啃手册,当然也可也通过 -h或者--help 快速确定命令选项。不习惯在console 阅读文档,需要做一些笔记的命令。可以尝试其pdf文档。

还是区分bash 内置命令(bahs built in)和GNU软件包,以及三方软件包。

当然也有其他shell命令的归档文档http://tldp.org/LDP/abs/html/part4.html

http://linuxtools-rst.readthedocs.io/zh_CN/latest/base/01_use_man.html

  • QUOTING

    特殊转移字符;

  • Special Prameters

    描述$*、$@、$#……等特殊变量;

  • Parameter Variables

    描述${#a}变量操作的表达式;

lightdm

DM(显示管理器)功能如下:

  • 启动和管理本地实例化的X Server;
  • 用户认证;
  • 启动和管理用户回话(常用情景);
  • 在boot过程中,单例启动X 服务器和开始一个用户会话((kiosk mode));
  • 在boot过程中,单例启动 X服务器,显示用户登录界面,在连接时启动用户会话;
  • 支持多用户同时登录,用户选择具体用户登录,同时为每一个 用户启动 X 服务器;
  • 允许 X 服务器,使用XDMCP,运行瘦客户端远程连接到其他X 服务器。
  • 快速

    不增加其他额外的启动时间;

  • 异常安全

    处理所有

  • Display Manager - A daemon that manages the displays on a system.
  • Display - A combination of an X server, greeter and a user session.
  • User session - An application that runs on a display and allows the user to run applications.
  • Greeter - An application to run on a display and prompt for authentication and session options.

Daemon:

  • Able to run as as system service withou...

ramfs

Ramfs is a very simple FileSystem that exports Linux's disk cacheing mechanisms (the page cache and dentry cache) as a dynamically resizable ram-based filesystem.

ramfs 是一个基于linux缓存机制(page cache and dentry cache)的简易文件系统,基于ram,大小可动态调整。

Normally all files are cached in memory by Linux. Pages of data read from backing store (usually the ?block_device the filesystem is mounted on) are kept around in case it's needed again, but marked as clean (freeable) in case the Virtual Memory system needs the memory for something else. Similarly, data written to files is marked clean as soon as it has been writt...

v4l2 driver framework code review

如上启动顺序

  • csi、cci、mipi 等外设初始化;
  • vfe控制 v4l2 启动;

    vfe在初始化 v4l2-device启动的时候已经同sub-device ov5640 通信,但是此时ov5640 启动还没有加载,这部分需要详细走读下代码;

  • sub-device camera sensor ov5640 加载;

  1. vfe模块加载,加载csi、mipi、isp、cci模块,同时从sys_config读出sensor的配置;
  2. 创建v4l2-device;
  3. ov5640 通过cci/i2c 向上注册sub-device(先前行为),此时vfe通过已经注册接口测试sensor是否激活。
  4. 创建video 设备节点 ;
  • libv4l2 源码可以通过sudo apt-get source libv4l2rds0 下载。

使用VS2017 开发Linux C应用

在工程添加了路径添加了.h 文件,尽管在include 时候VS2017已经能够自动补全,但是编译的时候还是提示找不到.h文件。

在编译机器发现对应的.h 并没有直接拷贝过来。

原来同以前的直接include 搜索不一样,.h 同样需要加入工程里面,不然VS不知道拷贝那些文件。

13:46 2018/6/29

对于系统/usr/include 路径下*.h 文件,VS2017 不知道是什么时候拷贝到到Windows的,每次添加新机器后会报错。

C:\Users\Mdp-Jay\AppData\Local\Microsoft\Linux\Header Cache\1.0 路径下文件夹为空。

测试发现原来此过程发生在选项->跨平台->连接管理器->远程标头 IntelliSense 管理器,会自动打包Linux 编译机器上面的/usr/include然后到Windows 解压。

动态链接库

属性页->链接->所有选项->库链接项

确定了Linux GDBServer版本

大概明白了流程,暂时地,VS2017 还不支持arm64架构,通过ssh获取调试的架构的(uname -m)时候得到aarch64显示Unkown。VSli...