Zombah chromebook sandbox: различия между версиями

Материал из Toshiba AC100 wiki
Перейти к навигации Перейти к поиску
м (add script from openSUSE JeOS)
м (add u-boot compile script)
 
(не показаны 2 промежуточные версии этого же участника)
Строка 1: Строка 1:
=snow install nv-u-boot 3704 with serial console debug to ro&rw firmware=
==snow install nv-u-boot 3704 with serial console debug to ro&rw firmware==


''Backup original firmware as it contain unique device data otherwise chromeos is lost forever for device''
''Backup original firmware as it contain unique device data otherwise chromeos is lost forever for device''
Строка 17: Строка 17:
found here  https://wiki.archlinux.org/index.php/Samsung_Chromebook_(ARM)#How_to_flash_U-Boot
found here  https://wiki.archlinux.org/index.php/Samsung_Chromebook_(ARM)#How_to_flash_U-Boot


=snow check/disable write protect status=
==snow check/disable write protect status==
<pre>
<pre>
crosh->shell->sudo -s
crosh->shell->sudo -s
Строка 25: Строка 25:
</pre>
</pre>


=snow/daisy revert firmware to factory default from chrome os=
==snow/daisy revert firmware to factory default from chrome os==
<pre>
<pre>
crosh->shell->sudo -s
crosh->shell->sudo -s
Строка 35: Строка 35:
found here https://code.google.com/p/chromium/issues/detail?id=221828
found here https://code.google.com/p/chromium/issues/detail?id=221828


=use linux-stable exynos_defconfig kernel=
==use linux-stable exynos_defconfig kernel==
<pre>
<pre>
make exynos_defconfig
make exynos_defconfig
Строка 56: Строка 56:
</pre>
</pre>


=linux-stable multi_v7_defconfig missing modules for screen=
==linux-stable multi_v7_defconfig missing modules for screen==
<pre>
<pre>
ptn3460
ptn3460
Строка 65: Строка 65:
</pre>
</pre>


=openSUSE notes=
==openSUSE notes==
Remove armsoc driver, its very slow with current upstream kernels, use modesettings or fbdev
Remove armsoc driver, its very slow with current upstream kernels, use modesettings or fbdev
<pre>
<pre>
Строка 71: Строка 71:
</pre>
</pre>


=firefox soft webgl=
==firefox soft webgl==
<pre>
<pre>
gfx.xrender.enabled=false
gfx.xrender.enabled=false
Строка 79: Строка 79:




=Add/update chainloding u-boot on sdcard=
==Add/update chainloding u-boot on sdcard==


it requires vboot-utils which contain vbutil and cgpt <br/>
it requires vboot-utils which contain vbutil and cgpt <br/>
Строка 103: Строка 103:
</pre>
</pre>


=Snow motherboard info=
==Snow motherboard info==
Motherboard design probably own from Samsung as there is '''BA41-02110A''' ident on board, revision 1.1 and '''Model:Lucas'''
Motherboard design probably own from Samsung as there is '''BA41-02110A''' ident on board, revision 1.1 and '''Model:Lucas'''


=Manualy load kernel from u-boot=
==Manualy load kernel from u-boot==
<pre>
<pre>
setenv bootargs 'loglevel=8 plymouth.enable=0 rootflags=size=100% console=ttySAC3,115200n8 console=tty earlyprintk showopts ${append}'
setenv bootargs 'loglevel=8 plymouth.enable=0 rootflags=size=100% console=ttySAC3,115200n8 console=tty earlyprintk showopts ${append}'
Строка 117: Строка 117:
</pre>
</pre>


==Script to create chainloding kernel partition from openSUSE JeOS==
==Script to create chainloading kernel partition from openSUSE JeOS==
<pre>
<pre>
#==========================================
#==========================================
Строка 170: Строка 170:
     popd
     popd
fi
fi
</pre>
==Script to compile U-Boot from openSUSE U-Boot spec==
<pre>
%build
export SOURCE_DATE_EPOCH=$(date -d "$(head -n 2 %{_sourcedir}/%{name}.changes | tail -n 1 | cut -d- -f1 )" +%s)
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" snow_defconfig
echo "Attempting to enable fdt apply command (.dtbo) support."
echo "CONFIG_OF_LIBFDT_OVERLAY=y" >> .config
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" USE_PRIVATE_LIBGG=yes
%if "%{name}" == "u-boot-snow" || "%{name}" == "u-boot-spring"
# Chromebook ARM (snow) and HP Chromebook 11 (spring) need a uImage format
export TEXT_START=$(awk '$NF == "_start" { printf "0x"$1 }' System.map)
./tools/mkimage -A arm -O linux -T kernel -C none -a $TEXT_START -e $TEXT_START -n uboot -d u-boot-dtb.bin u-boot.img
%endif
</pre>
</pre>

Текущая версия от 00:58, 21 августа 2017

snow install nv-u-boot 3704 with serial console debug to ro&rw firmware

Backup original firmware as it contain unique device data otherwise chromeos is lost forever for device

flashrom -p linux_spi:dev=/dev/spidev1.0 -r original_image.bin
  • Device hwid will be DAISY TEST A-A 9382 after firmware update, which is treated as dev board by google. Factory hwid something like SNOW KULA A-E 4640
    • Chromeos cant be installed or updated on device with this test hwid.
    • Crucial data lives in VPD (Virtual Private Data) and GBB (Google Binary Block) partitions.
wget https://www.dropbox.com/s/6pzvraf3ko14sz9/nv_image-snow.bin.gz
gunzip nv_image-snow.bin.gz
flashrom -p linux_spi:dev=/dev/spidev1.0 -w nv_image-snow.bin

found here https://wiki.archlinux.org/index.php/Samsung_Chromebook_(ARM)#How_to_flash_U-Boot

snow check/disable write protect status

crosh->shell->sudo -s

flashrom --wp-status
flashrom --wp-disable

snow/daisy revert firmware to factory default from chrome os

crosh->shell->sudo -s

crossystem |fgrep fwid
chromeos-firmwareupdate --factory

found here https://code.google.com/p/chromium/issues/detail?id=221828

use linux-stable exynos_defconfig kernel

make exynos_defconfig
make menuconfig

set mwifiex and mwifiex_sdio as modules

make modules_prepare
make -j4 2>1& | tee ../current.log
make kernelrelease

sudo make modules_install
sudo cp arch/arm/boot/zImage /boot/zImage-kernelrelease
sudo cp System.map /boot/System.map-kernelrelease
sudo cp .config /boot/config-kernelrelease
cd /boot
sudo mkinitrd -k zImage-kernelrelease -i initrd-kernelrelease

linux-stable multi_v7_defconfig missing modules for screen

ptn3460
pwm-samsung
platform_lcd
i2c-arb-gpio-challenge
cros_ec_devs

openSUSE notes

Remove armsoc driver, its very slow with current upstream kernels, use modesettings or fbdev

sudo zypper rm xf86-video-armsoc

firefox soft webgl

gfx.xrender.enabled=false
webgl.force-enable=true

now got 1fps in fishgl demo 8)


Add/update chainloding u-boot on sdcard

it requires vboot-utils which contain vbutil and cgpt

#!/bin/bash

diskname=/dev/sde
uboot=u-boot.img

mkimage -A arm -O linux -T kernel -C none -a 0x43e00000 -e 0x43e00000 -n uboot -d u-boot-dtb.bin u-boot.img

echo "console=tty1 debug verbose" > /tmp/config
vbutil_kernel --pack /tmp/newkern \
        --keyblock /usr/share/vboot/devkeys/kernel.keyblock \
        --version 1 \
        --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
        --config=/tmp/config --vmlinuz $uboot --arch arm
kpartx -av $diskname
dd if=/tmp/newkern of=$diskname\1
kpartx -d $diskname
cgpt add -t kernel -i 1 -S 1 -T 5 -P 10 -l U-BOOT $diskname

Snow motherboard info

Motherboard design probably own from Samsung as there is BA41-02110A ident on board, revision 1.1 and Model:Lucas

Manualy load kernel from u-boot

setenv bootargs 'loglevel=8 plymouth.enable=0 rootflags=size=100% console=ttySAC3,115200n8 console=tty earlyprintk showopts ${append}'
setenv initrd_high ''
setenv fdt_high ''
ext2load mmc 1:2 0x40007000 /boot/linux.vmx
ext2load mmc 1:2 0x44000000 /boot/initrd.uboot
ext2load mmc 1:2 0x42000000 /dtb/exynos5250-snow.dtb
bootz 0x40007000 0x44000000 0x42000000

Script to create chainloading kernel partition from openSUSE JeOS

#==========================================
# install Arndale SPL & U-Boot as raw
#------------------------------------------
if [[ -f "boot/smdk5250-spl.bin" || -f "boot/arndale-spl.bin" ]];then
    echo "Installing BL1..."
    if ! dd if=boot/arndale-bl1.img of=$diskname seek=1 conv=notrunc; then
        echo "Couldn't install BL1 on $diskname"
        exit 1
    fi
    echo "Installing SPL..."
    # Get SPL name (depends on U-Boot version)
    SPL_FILE=$(ls boot/*-spl.bin);
    if ! dd if=$SPL_FILE of=$diskname seek=17 conv=notrunc; then
        echo "Couldn't install SPL ($SPL_FILE) on $diskname"
        exit 1
    fi
    echo "Installing U-Boot..."
    if ! dd if=boot/u-boot.bin of=$diskname seek=49 conv=notrunc; then
        echo "Couldn't install u-boot on $diskname"
        exit 1
    fi
fi

#==========================================
# install Chromebook u-boot as boot kernel
# And do the required magic!
#------------------------------------------
if [ "$flavor" = "chromebook" ]; then
    if [ ! "$is_firstboot" ]; then
        pushd /usr/src/packages/KIWIROOT-oem/
        echo "console=tty1 debug verbose" > /tmp/config
        ./usr/bin/vbutil_kernel --pack /tmp/newkern \
            --keyblock ./usr/share/vboot/devkeys/kernel.keyblock \
            --version 1 \
            --signprivate ./usr/share/vboot/devkeys/kernel_data_key.vbprivk \
            --config=/tmp/config --vmlinuz boot/u-boot.img --arch arm
        LINE=$(kpartx -asv $diskname | head -n1)
        PART=$(echo "$LINE" | awk '{print $3}')
        dd if=/tmp/newkern of=/dev/mapper/$PART
        # "kpartx -dv $diskname" does not work if $diskname is longer than 64 characters
        LOOPDEV=$(echo "/dev/$PART" | sed 's/p[0-9][0-9]*$//')
        kpartx -dv $LOOPDEV
        losetup -d $LOOPDEV
    fi
    # For build and after reaprtition occured on 1st boot:
    # Enable bootflag on partition 2 (u-boot now looks for bootscripts on bootable partitions only)
    parted $diskname set 2 boot on
    # CGPT magic
    ./usr/bin/cgpt add -t kernel -i 1 -S 1 -T 5 -P 10 -l U-BOOT $diskname
    popd
fi

Script to compile U-Boot from openSUSE U-Boot spec

%build
export SOURCE_DATE_EPOCH=$(date -d "$(head -n 2 %{_sourcedir}/%{name}.changes | tail -n 1 | cut -d- -f1 )" +%s)
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" snow_defconfig
echo "Attempting to enable fdt apply command (.dtbo) support."
echo "CONFIG_OF_LIBFDT_OVERLAY=y" >> .config
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" USE_PRIVATE_LIBGG=yes

%if "%{name}" == "u-boot-snow" || "%{name}" == "u-boot-spring"
# Chromebook ARM (snow) and HP Chromebook 11 (spring) need a uImage format
export TEXT_START=$(awk '$NF == "_start" { printf "0x"$1 }' System.map)
./tools/mkimage -A arm -O linux -T kernel -C none -a $TEXT_START -e $TEXT_START -n uboot -d u-boot-dtb.bin u-boot.img
%endif