[轉]Android Logo 之 android 開機logo initlogo.rle

來源:互聯網
上載者:User

標籤:android   style   blog   http   color   io   os   ar   檔案   

 

initlogo.rle的製作

 

initlogo.rle的調用

 

initlogo.rle定義的位置

system/core/init/init.h

1 #define INIT_IMAGE_FILE "/initlogo.rle" 

 

從定義中可以知道,initlogo.rle存放位置在根目錄下,如果圖片名字不想取名叫initlogo.rle也可以在這裡修改,但必須與圖片檔案的名字一致。

這裡的存放位置根目錄下是指已經產生好的ROM開機時,檔案的位置。

在編譯時間需要將圖片放到產生的目標檔案下的root檔案中<ANDROID_HOME>/out/..../root/initlogo.rle

 

initlogo.rle調用函數

<ANDROID_HOME>/system/core/init/init.c

 1 static int console_init_action(int nargs, char **args)  2 { 3 ... 4 if( load_565rle_image(INIT_IMAGE_FILE) ) {      //若調用失敗,將會顯示文字的”ANDROID“LOGO 5 fd = open("/dev/tty0", O_WRONLY); 6 if (fd >= 0) { 7 const char *msg; 8 msg = "\n" 9 "\n"10 "\n"11 "\n"12 "\n"13 "\n"14 "\n" // console is 40 cols x 30 lines15 "\n"16 "\n"17 "\n"18 "\n"19 "\n"20 "\n"21 "\n"22 " A N D R O I D ";23  write(fd, msg, strlen(msg));24  close(fd);25  }26  }27 ..28 }

 

 

註:

initlogo.rle開機後被刪除:

查 看代碼可發現,在system/core/init/init.c [load_565rle_image] --> logo.c中 ,顯示完畢initlogo.rle之後作了 unlink 操作。該操作對於android 預設的唯讀型system.img 是沒問題,, 但對於自訂的yaffs 或者 ubi形式的可讀寫型的system.img時就有問題了。會造成將initlogo.rle刪除,下次啟動時讀取不到該檔案。可以通過注釋掉 logo.c的load_565rle_image()中的unlink(fn)語句來規避該問題。

 

參考:

http://blog.csdn.net/hjjph/article/details/7046274

 

[轉]Android Logo 之 android 開機logo initlogo.rle

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.