2014년 2월 10일 월요일

gdb compile for android

ARM 용 GCC 컴파일러 설치
apt-get install gcc-arm-linux-gnueabi
1. 소스파일 다운로드
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz

2. 압축 풀기
ncurses
# tar zxvf ncurses-5.9.tar.gz

gdb
# tar zxvf gdb
3. 컴파일
ncurses
# ./configure --host=arm-linux-gnueabi --target=arm-linux-gnueabi
# make install DESTDIR=/root/nc (임의의 폴더)

lib 폴더안의 libncurses.a 파일을 /usr/arm-linux-gnueabi/lib로 복사
include 폴더 안의 모든 파일을 /usr/arm-linux-gnueabi/include로 복사

폴더를 모를 땐 아래의 명령어를 입력하면 경로 출력됨.
# arm-linux-gnueabi-gcc -print-search-dirs

gdb
# ./configure --host=arm-linux-gnueabi --target=arm-linux-gnueabi LDFLAGS=-static
# make



ncurses 설치 전에 gdb에서 configure와 make 하고  오류 출력 되면 ncurses 설치하기 바람.

gdb폴더에 gdb파일이 생성됨
우분투에서 ./gdb 실행시 바이너리 파일을 실행할 수 없음 이라고 뜨면 된거임
gdbserver파일은
gdbserver 폴더에 gdbserver 파일이 있음


출처 : http://searchme.tistory.com/37

LG vu2 F200k20g Rooting(루팅)하는 법

최신 펌웨어 버전 F200k20g 업데이트 후

확인 결과 루팅이 되더군요.

여러 포럼을 돌아다닌 결과 이는 개발자가 루팅할 사람은 하라고 남겨둔 방법인 듯하더군요.

하는 방법은 ADB 연결 후
$ touch /sdcard/d1l_security
를 입력하여 SDCard에 파일만 생성하고
재부팅하면 그 이후로 adb 연결 시 Root 권한으로 실행됩니다.

머 그 이후야.. /system폴더 remount 해서 su파일 넣고 실행권한 주면 끝.

LG vu2 F200k fastboot mode 진입 방법

현재 bu2 F200k의 폰에서 Fastmode를 진입하는 버튼이 존재하진 않으나

http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images

에서 Flash 하는 방법을 참조하여

# cat /dev/zero > /dev/block/mmcblk0p7
또는
# cat /dev/zero > /dev/block/mmcblk0p19
를 하고 저장공간이 없어 실패했다고 뜨지만 무시하면 되고..
reboot(재부팅)을 하면 부팅시 Fastboot mode로 진입하게 된다.

mmcblk0p7는 boot.img가 들어있으며 mmcblk0p19는 recovery.img가 들어있다....라고 하더군요...

아래의 사진은 Fastboot mode로 진입한 사진..



아래의 사진은 내가 수정하거나 만든 boot.img를 넣은 화면



Secure Booting Error!
이를 해결하기 위해 외국 사이트를 뒤져본 결과...
LG는 boot.img를 로딩할 때 시그니쳐를 확인하고 이 값이 맞지 않을경우 위와 같은 화면이 뜬다고 하더라....
실제로 디바이스에 들어있는 boot.img를 가져와서 분리한다음 아무것도 수정하지 않고 다시 boot.img를 생성하여 비교한 결과 디바이스에 있는 boot.img에는
008ED000 ~ 008ED3FF 까지 검증값??이 들어있더라...


당연히 boot.img가 변경되면 이 검증값도 바뀌게 되는데
어떠한 알고리즘으로 이 값이 생성되는지 모르니
내가 만든 boot.img를 로딩시킬 수 없다....

혹시 방법아시는분 연락주세요..ㅠ ㅠ










LG F200K vu2 Download mode 진입

커스텀 롬 이미지를 내 맘대로 바꾸려다 벽돌이 되었다...

LG 전자에서는 긴급복구 모드를 지원한다.

삼성처럼 Fastboot mode를 지원하는게 더 좋을텐데.. ㅠ.ㅠ


배터리 분리 후 (전원끄기) 배터리 연결 하고 



볼륨 상, 볼륨 하 동시에 누르고 

USB 커넥터 연결하기

하면 Download mode로 진입이 된다.






kdz 파일을 이용한 긴급 복구 모드 파일은  아래의 링크로

kdz_fw_upd2-ko.zip

KDZ 파일은 1GB가 넘는 관계로...

요청하시면 보내드릴께요

아니면 LG 사이트에서 다운받으실수 있습니다.

LG사이트에서 최신 펌웨어 다운로드를 어디서받았는지 기억이 안나네요
아래의 사이트 가서 KDZ파일 다운로드 해보세요
http://www.lg-phones.org/official-stock-lg-optimus-vu-ii-rom-firmware.html

2013년 12월 8일 일요일

우분투 12.04 부팅 시 프로그램 자동실행

우분투 실행 시 glassfish(WAS)를 자동으로 실행하도록 등록하려고 한다.

init.d 폴더에 실행할 스크립트를 넣고 rc.local에 등록을 하면 자동으로 실행된다. 

#  vi /etc/init.d/scriptname

아래의 글 입력 후 저장
#! /bin/sh

/usr/local/glassfish4/bin/asadmin start-domain

wq로 저장 

# chmod 755 /etc/init.d/scriptname

# vi /etc/rc.local 

su 계정 /etc/init.d/scriptname 

su 계정 비 입력시 root 권한으로 서비스 실행. 

WAS의 경우 root로 실행하면 웹셀이 루트권한을 가지므로 주의해야 함.


2013년 11월 25일 월요일

리눅스 하드디스크 포맷 및 마운트 for me

테스트 환경 : 우분투 12.04(LTS) 서버 

  $ sudo su - root

root권한으로 장착된 디스크 목록 확인.

  # fdisk -l
디스크 목록 확인

만약 파티션 설정 및 포맷하려는 디스크가 /dev/sdd/라면
# fdisk /dev/sdd
원하는 데로 파티션 설정 후 저장
파티션 설정 및 저장

포맷
# mkfs.ext3 /dev/sdd1
디스크 포맷

마운트 할 디렉터리 생성
# mkdir /mnt/hdd3

마운트
# mount -t ext3 /dev/sdd1 /mnt/hdd3

마운트 확인
# df -h

부팅시 자동 마운트를 위해 /etc/fstab 수정

# vi /etc/fstab

UUID=deivceuuid /mnt/hdd3 ext3 default 0 2


ssh 설정 for me

파일경로 /etc/ssh/sshd_config
sshd_config 설정 링크


# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
# 포트 번호 설정
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
# 접속 허용할 IP 설정 0.0.0.0은 모든 IP 허용
#ListenAddress ::
#ListenAddress 0.0.0.0
# 프로토콜을 1을 사용할지 2를 사용할지의 여부.
# 보안상 2를 사용함.
# 프로토콜 1 vs 2 관련 링크
# Protocol 2,1
Protocol 2

# AllowUsers id1 id2 id3
# AllowGroups 허용할 그룹
# DenyGroups DenyUsers

AllowUsers 규규
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging  로그 파일 /var/log/auth.log
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120 #
PermitRootLogin no # root 로그인 허용 여부
StrictModes yes # 파일체크 모드 여부
MaxAuthTries 6 # 로그인 실패3회이상 로그 6회까지 시도 가능
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes