Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1222294
  • 博文数量: 105
  • 博客积分: 127
  • 博客等级: 入伍新兵
  • 技术积分: 962
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-29 15:22
文章分类

全部博文(105)

文章存档

2021年(1)

2019年(3)

2018年(1)

2017年(11)

2016年(47)

2015年(32)

2014年(4)

2012年(6)

我的朋友

分类: LINUX

2016-06-10 17:06:34

目前在使用freescale imx6 yocto 环境,默认的文件系统中有一个开机进度条的画面。刚好我们需要这样一个开机画面,这里整理记录一下。

首先在yocto中找到了源码。一般流程如下:

1./autogen.sh

2./configure –prefix=/work/psplash/install_dir

3,修改Makefile

  a,CC=/opt/fsl-imx-fb/3.14.52-1.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -march=armv7-a
  -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/opt/fsl-imx-fb/3.14.52-1.1.0/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi

 

  b,DEFAULT_INCLUDES=-I/opt/fsl-imx-fb/3.14.52-1.1.0/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include

4,配置环境变量

  export LIBRARY_PATH=/opt/fsl-imx-fb/3.14.52-1.1.0/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib

5make

6make install

 

一,更换开机图片

  做好图片,png格式。利用自带脚本转换成头文件。

./make-image-header.sh  my-logo.png  POKY 

my-logo-img.h 直接修改成psplash-poky-img.h

重新编译就OK了。

 

二,去掉进度条

不需要进度条,只要那张图片。去掉进度条步骤如下:

1,  psplash.c文件中的psplash_draw_progress函数定义及其调用通通注释掉

2,  psplash.c文件中以下代码屏蔽

  /* Draw progress bar border */

  psplash_fb_draw_image (fb,

                          (fb->width  - BAR_IMG_WIDTH)/2,

                          SPLIT_LINE_POS(fb),

                          BAR_IMG_WIDTH,

                          BAR_IMG_HEIGHT,

                          BAR_IMG_BYTES_PER_PIXEL,

                          BAR_IMG_ROWSTRIDE,

                          BAR_IMG_RLE_PIXEL_DATA);

 

 

三,修改背景色

 将进度条的背景颜色改为纯黑色。修改如下:

psplash-colors.h 中关于背景的宏定义,RGB方式的。

/* This is the overall background color */

//#define PSPLASH_BACKGROUND_COLOR 0xec,0xec,0xe1

#define PSPLASH_BACKGROUND_COLOR 0x00,0x00,0x00

 

四,安装文件

1,  psplash , psplash-write 放在文件系统 /usr/bin/

2,  psplash.sh 放在 /etc/init.d/

点击(此处)折叠或打开

  1.  #!/bin/sh
  2.  ### BEGIN INIT INFO
  3.  # Provides: psplash
  4.  # Required-Start:
  5.  # Required-Stop:
  6.  # Default-Start: S
  7.  # Default-Stop:
  8.  ### END INIT INFO

  9.  read CMDLINE < /proc/cmdline
  10.  for x in $CMDLINE; do
  11.         case $x in
  12.         psplash=false)
  13.         echo "Boot splashscreen disabled"
  14.         exit 0;
  15.                 ;;
  16.         esac
  17.  done

  18.  export TMPDIR=/mnt/.psplash
  19.  mount tmpfs -t tmpfs $TMPDIR -o,size=40k

  20.  rotation=0
  21.  if [ -e /etc/rotation ]; then
  22.     read rotation < /etc/rotation
  23.  fi

  24.  /usr/bin/psplash --angle $rotation &

Note

 

./make-image-header.sh LOGO-1.png POKY

./make-image-header.sh: 7: ./make-image-header.sh: gdk-pixbuf-csource: not found

解决方法:

sudo apt-get install libgdk-pixbuf2.0-dev

参考链接:

http://blog.csdn.net/beny610/article/details/2625651

http://blog.csdn.net/phoenix500526/article/details/51286795


 





阅读(9797) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~