Chromebook Kernel upgrade

samsung-srs5_chrome-white-cover-lg

크롬북에 데비안 7 wheezy를 올려서 쓰다가 업데이트 하는바람에 패키지가 다 꼬였다 .. ㅠ
그래서 그냥 다 밀고 jessie로 올리려니 커널이 너무 old 하댄다 (기존 3.4.0)
전에 3.4.0도 직접 패키징한건데 작성한 자료가 없어서 멘땅에 헤딩하면서 작성하였다.  결론은 성공

1. 필요패키지 설치

apt-get install git-core  kernel-package

2. git checkout
git clone https://chromium.googlesource.com/chromiumos/third_party/kernel
cd kernel/
git checkout origin/chromeos-3.18

3. 설정
# First we patch base.config to set CONFIG_SECURITY_CHROMIUMOS
# to n
cp ./chromeos/config/base.config ./chromeos/config/base.config.orig
sed -e \
's/CONFIG_SECURITY_CHROMIUMOS=y/CONFIG_SECURITY_CHROMIUMOS=n/' \
./chromeos/config/base.config.orig > ./chromeos/config/base.config
./chromeos/scripts/prepareconfig chromeos-intel-pineview
yes "" | make oldconfig

4. 컴파일
make-kpkg kernel_image kernel_headers

5. 패키지 설치
dpkg -i /usr/src/linux-*.deb

6. 기존커널에서 커널 config 추출
vbutil_kernel –verify /dev/sda1 –verbose | tail -1 > ./config.txt
# Add disablevmx=off to the command line, so that VMX is enabled (for VirtualBox & Co)
sed -e 's/$/ disablevmx=off/' ./config.txt > /config-new.txt
순정 크롬 OS에(devchannel 45.0.2427)서 추출된건
console= loglevel=7 init=/sbin/init cros_secure oops=panic panic=-1 root=/dev/dm-0 rootwait ro dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="1 vroot none ro 1,0 2506752 verity payload=PARTUUID=%U/PARTNROFF=1 hashtree=PARTUUID=%U/PARTNROFF=1 hashstart=2506752 alg=sha1 root_hexdigest=451ba0633d93141f977a5a71e92b2230ea6c4643 salt=e24daa025524c9239fc31a253100c2ac5cd9e095bf82f7d021e78763a14b81e0" noinitrd vt.global_cursor_default=0 kern_guid=%U add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic iTCO_vendor_support.vendorsupport=3
인데 커널부팅 실패
어디선가 굴러먹던
quiet loglevel=0 console=tty2 init=/sbin/init add_efi_memmap boot=local noresume noswap i915.modeset=1 cros_secure tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic disablevmx=off root=PARTUUID=%U/PARTNROFF=1 rootwait rw noinitrd vt.global_cursor_default=0 kern_guid=%U
이걸로는 부팅 성공, 분석은 귀찮아서..

7. 부트스텁 생성
git clone https://chromium.googlesource.com/chromiumos/third_party/bootstub
trampoline.S 파일의 /* Disable paging. */ 아래 세블럭 주석처리
make  하면 에러나는데 Makefile의 PREFIX 에서 /usr/bin/x86_64-pc-linux-gnu- 를 /usr/bin/x86_64-linux-gnu- 로 변경 후 ㄱㄱ

8. 커널 패킹
vbutil_kernel –pack ./newkernel –keyblock /usr/share/vboot/devkeys/kernel.keyblock \
–version 1 –signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
–config=./config-new.txt –vmlinuz /boot/vmlinuz-3.18.0 \
–arch x86_64 –bootloader ./bootstub.efi

9. 커널 덮어쓰기
dd if=./newkernel of=/dev/sda1

끝!

참고 : http://www.chromebook-linux.com/2011/11/compiling-your-custom-kernel-on.html
http://unix.stackexchange.com/questions/75565/i-need-a-step-by-step-guide-to-build-kernel-modules-in-chrubuntu

스크린샷 - 2015년 06월 16일 - 23시 19분 16초

Leave a Reply

Your email address will not be published. Required fields are marked *