?? fblogo_patch
字號:
#!/bin/sh## fblogo_patch## Generate a kernel patch using a kernel source tree# and a custom logo header## Gordon Fraser <gordon@freakzone.net> 2002/2003## This software comes with ABSOLUTELY NO WARRANTY# This software is free software, and you are welcome to redistribute it# under certain conditions# See the COPYING file for details.#usage() { echo "Usage: $0 <logo-header> <path-to-linux> [<width> <height>]" 1>&2 exit 1}error() { echo "fbcon_patch error: $1" 1>&2 exit 1}if [ $# -ne 2 ] && [ $# -ne 4 ]then usagefiLOGOFILE=$1SRCDIR=$2TMPFILE=/tmp/fbcon.c_tmpif [ $# -eq 4 ]then WIDTH=$3 HEIGHT=$4else WIDTH=0 HEIGHT=0fiif [ ! -e $LOGOFILE ]then error "$LOGOFILE is not a valid header file"fiif [ ! -d $SRCDIR ] || [ ! -d $SRCDIR/drivers/video ] || [ ! -d $SRCDIR/include/linux ]then error "$SRCDIR is not a valid directory"fiif [ ! -e $SRCDIR/drivers/video/fbcon.c ]then error "$SRCDIR/drivers/video/fbcon.c not found - this doesn't seem to be a valid kernel source directory"fiif [ "$WIDTH" -le "0" ]then WIDTH=$(grep "LOGO_W 80\" to" $LOGOFILE | sed -e 's/.*"#define\ LOGO_W\ 80"\ to\ "#define\ LOGO_W\ \([0-9]\+\)"/\1/') if [ -z "$WIDTH" ] || [ "$WIDTH" -le "0" ] then error "width could not be detected, try to specify it on the commandline" fifiif [ $HEIGHT -le 0 ]then HEIGHT=$(grep "LOGO_H 80\" to" $LOGOFILE | sed -e 's/.*"#define\ LOGO_H\ 80"\ to\ "#define\ LOGO_H\ \([0-9]\+\)"/\1/') if [ -z "$HEIGHT" ] || [ $HEIGHT -le 0 ] then error "height could not be detected, try to specify it on the commandline" fificat $SRCDIR/drivers/video/fbcon.c | \sed -e "s/#define\ LOGO_H\([ ]*\).*/#define\ LOGO_H\1$HEIGHT/" | \sed -e "s/#define\ LOGO_W\([ ]*\).*/#define\ LOGO_W\1$WIDTH/" \>$TMPFILELOGONAME=$(echo $LOGOFILE | sed -e 's/\([\/\.]\)/\\\1/g')TMPNAME=$(echo $TMPFILE | sed -e 's/\([\/\.]\)/\\\1/g')SRCDIRNAME=$(echo $SRCDIR | sed -e 's/\([\/\.]\)/\\\1/g')diff -u $SRCDIR/drivers/video/fbcon.c $TMPFILE |\sed -e "s/$SRCDIRNAME/linux-old/" |\sed -e "s/$TMPNAME/linux\/drivers\/video\/fbcon\.c/"diff -u $SRCDIR/include/linux/linux_logo.h $LOGOFILE | \sed -e "s/$SRCDIRNAME/linux-old/" |\sed -e "s/$LOGONAME/linux\/include\/linux\/linux_logo\.h/"rm -rf $TMPFILE
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -