Virtual Guru's Blog – Home of Virtualization Workshops

October 27, 2010

12minutes: Updating and Rebuilding Chromium OS image on ATOM nettop HW using REPO

Filed under: 12minutes, best_practices, ChromeOS — Tags: , — natiku @ 7:19 pm

12 Minutes: Chromium OS Chromium OS is developer version so you will need time to time to Update and Rebuild Chromium OS image. This entry present skeleton how to do it.

First I will recommend look in chromium-os-dev forum for PSA announcements – these are important changes which can affect process of Updating and Rebuilding your Chromium OS image.

Update: Important PSA announcements are now part of repo sync final report.

Last Update for: 0.9.130.9 2011/01/02

1. Enter home of your Chromium OS deployment

whoami
  chronocb

cd ~/chromiumos/
  atomd510:chromiumos chronocb$ 

mkdir cd ~/chromiumos/bl
export buildlog=`date +"%Y%m%d-%H%M"`
echo $buildlog
  20101222-1644
touch ~/chromiumos/bl/${buildlog}.log

2. Update depot tools

cd ./depot_tools/
echo -e "\n\n -=- Updating depot tools -=- \n\n" >> ~/chromiumos/bl/${buildlog}.log
svn update 2>&1 | tee -a ~/chromiumos/bl/${buildlog}.log

  U git-cl
  ....
  U gclient.py
  Updated to revision 63029.

cd ..

3. Sync with repo command

cd ~/chromiumos/

echo -e "\n\n -=- Syncing Repo -=- \n\n" >> ~/chromiumos/bl/${buildlog}.log 
repo sync 2>&1 | tee -a ~/chromiumos/bl/${buildlog}.log

remote: Counting objects: 7, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
From http://git.chromium.org/git/manifest
 * [new branch] 0.9.86.B -> origin/0.9.86.B
 * [new branch] 0.9.90.B -> origin/0.9.90.B
...
 * [new branch] 0.9.110.6  -> 0.9.110.6
Fetching projects: 22% (2/9) remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From http://git.chromium.org/git/chromiumos
 * [new branch] 0.9.86.B -> cros/0.9.86.B
 * [new branch] 0.9.90.B -> cros/0.9.90.B
...
 * [new branch] 0.9.110.6  -> 0.9.110.6
   f129b60..a841cb2 master -> cros/master
 * [new tag] 0.9.86.0 -> 0.9.86.0
 * [new tag] 0.9.89.1 -> 0.9.89.1
 * [new tag] 0.9.90.0 -> 0.9.90.0
...
 * [new tag] 0.9.110.6  -> 0.9.110.6
Fetching projects: 33% (3/9) remote: Counting objects: 11, done.
....

4. Update chroot

Note: There are discussions then there will be in future update of chroot called automatically
during building of packages, but for example for quick isolation of issues you can still call it separately.

Hint: Call ./make_chroot –replace time to time to get latest full chroot environment update,
but be aware then all packages you will install in chroot manually will be deleted with this command.

cd ./src/scripts

echo -e "\n\n -=- Update Chroot -=- \n\n" >> ~/chromiumos/bl/${buildlog}.log 
./make_chroot 2>&1 | tee -a ~/chromiumos/bl/${buildlog}.log 

Prebuilt DB populated in 0m2.4s
Calculating deps...
[ebuild U ] chromeos-base/chromeos-installer-0.0.1-r78 [0.0.1-r76] USE="-minimal" 0 kB [1]
[ebuild U ] dev-util/crosutils-0.0.1-r117 [0.0.1-r111] 0 kB [1]
[ebuild U ] chromeos-base/vboot_reference-1.0-r116 [1.0-r110] USE="-minimal -rbtest -tpmtests" 0 kB [1]
...
Completed chromeos-base/vboot_reference-1.0-r116 (in 1m29.8s)
Pending 3, Ready 0, Running 2, Retrying 0, Total 3 [Time 2m23.9s Load 2.92 1.36 0.58]
...
make_chroot: All set up. To enter the chroot, run:
make_chroot: $ /buildarea/chromiumos/src/scripts/enter_chroot.s

5. (Optional) Reinitalize your board

Sometime you will get PSA to reinitialize your board, like PSA of introduction of GOLD linker,
So you need to re setup your board to get later cross build tools

echo -e "\n\n -=- (Optional) ReSetup Cross Compile Environment -=- \n\n" >> ~/chromiumos/bl/${buildlog}.log
./enter_chroot.sh 2>&1 -- ./setup_board --board=x86-generic --default --force | tee -a ~/chromiumos/bl/${buildlog}.log

6. Rebuild packages

echo -e "\n\n -=- Rebuild Packages -=- \n\n" >> ~/chromiumos/bl/${buildlog}.log
./enter_chroot.sh 2>&1 USE="-build_tests" -- ./build_packages --nowithautotest --nowithtest \
  --oldchromebinary | tee -a ~/chromiumos/bl/${buildlog}.log
...
Starting fast-emerge.
 Building package world on root
Calculating deps...
Deps calculated in 0m24.9s

Total: 0 packages, Size of downloads: 0 kB
Pending 0, Ready 0, Running 0, Retrying 0, Total 0 [Time 0m25.6s Load 0.68 1.21 1.15]
Merge complete
Done
Starting fast-emerge.
 Building package chromeos-base/chromeos chromeos-base/chromeos-dev chromeos-base/chromeos-factoryinstall on x86-generic
Calculating deps...
Deps calculated in 0m36.4s
Prebuilt DB populated in 0m2.4s
[ebuild     U ] dev-util/perf-2.6.32-r83 [2.6.32-r82] to /build/x86-generic/ USE="-demangle -doc" 0 kB [1]
[ebuild   R   ] chromeos-base/chromeos-dev-0.1.0-r30 to /build/x86-generic/ USE="X hardened opengl" 0 kB [1]
[ebuild     U ] chromeos-base/saft-0.0.1-r4 [0.0.1-r2] to /build/x86-generic/ 0 kB [1]
[ebuild     U ] chromeos-base/autotest-0.0.1-r134 [0.0.1-r129] to /build/x86-generic/ 0 kB [1]
[ebuild     U ] chromeos-base/autotest-deps-0.0.1-r136 [0.0.1-r131] to /build/x86-generic/ USE="autotest -buildcheck" 0 kB [1]
[ebuild   R   ] chromeos-base/chromeos-initramfs-0.0.1-r2 to /build/x86-generic/ 0 kB [1]
[ebuild   R   ] chromeos-base/chromeos-factoryinstall-0.0.1-r14 to /build/x86-generic/ 0 kB [1]
[ebuild     U ] chromeos-base/update_engine-0.0.1-r106 [0.0.1-r105] to /build/x86-generic/ USE="cros-debug" 0 kB [1]
[ebuild     U ] chromeos-base/libcros-0.0.1-r102 [0.0.1-r101] to /build/x86-generic/ USE="cros-debug" 0 kB [1]
[ebuild   R   ] chromeos-base/entd-0.0.1-r38 to /build/x86-generic/ USE="cros-debug" 0 kB [1]
[ebuild   R   ] chromeos-base/chromeos-chrome-9999-r30 to /build/x86-generic/ USE="autotest (x86) -build_tests* 
   -buildcheck -gold" TESTS="desktopui_BrowserTest desktopui_PyAutoFunctionalTests desktopui_SyncIntegration
    Tests desktopui_UITest" 0 kB [1]
[ebuild   R   ] chromeos-base/chromeos-imageburner-0.0.1-r6 to /build/x86-generic/ USE="cros-debug" 0 kB [1]
[ebuild   R   ] chromeos-base/chromeos-wm-0.0.1-r106 to /build/x86-generic/ USE="cros-debug -opengles" 0 kB [1]
[ebuild   R   ] chromeos-base/chromeos-login-0.0.5-r67 to /build/x86-generic/ USE="cros-debug -test" 0 kB [1]
[ebuild   R   ] chromeos-base/power_manager-0.0.1-r38 to /build/x86-generic/ USE="cros-debug -new_power_button -test" 0 kB [1]
[ebuild     U ] chromeos-base/kernel-0.0.1-r115 [0.0.1-r114] to /build/x86-generic/ USE="compat_wireless -initramfs" 0 kB [1]
[ebuild     U ] chromeos-base/chromeos-0.0.1-r88 [0.0.1-r87] to /build/x86-generic/ USE="X localssh -python%" 0 kB [1]
Total: 17 packages (8 upgrades, 9 reinstalls), Size of downloads: 0 kB
...

7. Rebuild image

echo -e "\n\n -=- Rebuild Image -=- \n\n" >> ~/chromiumos/bl/${buildlog}.log
./enter_chroot.sh 2>&1 USE="-build_tests" -- ./build_image --noenable_rootfs_verification \
 --usb /dev/sda3 | tee -a ~/chromiumos/bl/${buildlog}.log
...
[binary  N    ] sys-apps/grep-2.5.4-r1 to /home/chronocb/trunk/src/build/images/x86-generic/0.9.111.2010_11_08_2128-a1/rootfs/ USE="nls pcre" 
[binary  N    ] dev-util/bsdiff-4.3-r3 to /home/chronocb/trunk/src/build/images/x86-generic/0.9.111.2010_11_08_2128-a1/rootfs/
[binary  N    ] sys-libs/ncurses-5.7-r3 to /home/chronocb/trunk/src/build/images/x86-generic/0.9.111.2010_11_08_2128-a1/rootfs/ USE="cxx minimal unicode -ada -debug -doc -gpm -profile -trace" 
[binary  N    ] sys-apps/util-linux-2.16.2 to /home/chronocb/trunk/src/build/images/x86-generic/0.9.111.2010_11_08_2128-a1/rootfs/ USE="crypt nls unicode -loop-aes -old-linux -perl (-selinux) -slang (-uclibc)" 
[binary  N    ] sys-fs/lvm2-2.02.51-r3 to /home/chronocb/trunk/src/build/images/x86-generic/0.9.111.2010_11_08_2128-a1/rootfs/ USE="-clvm (-cman) -lvm1 -readline (-selinux) -static" 
[binary  N    ] sys-fs/e2fsprogs-1.41.9 to /home/chronocb/trunk/src/build/images/x86-generic/0.9.111.2010_11_08_2128-a1/rootfs/ USE="nls" 
[binary  N    ] sys-apps/ureadahead-0.100.0-r1 to /home/chronocb/trunk/src/build/images/x86-generic/0.9.111.2010_11_08_2128-a1/rootfs/
.....
Done.  Image created in /home/chronocb/trunk/src/build/images/x86-generic/0.9.111.2010_11_08_2128-a1
Chromium OS image created as chromiumos_base_image.bin
Developer image created as chromiumos_image.bin
Elapsed time: 33m10s

And latest directory link was automatically updated:

./get_latest_image.sh 
  /buildarea/chromiumos/src/build/images/x86-generic/0.9.131.2010_12_22_1943-a1

ls -l `./get_latest_image.sh` 
total 2837412
-rw-r--r-- 1 chronocb 5000    3855332 2010-12-22 20:21 au-generator.zip
-rw-r--r-- 1 chronocb 5000        210 2010-12-22 20:19 boot.config
-rw-r--r-- 1 chronocb 5000        841 2010-12-22 19:43 boot.desc
-rw-r--r-- 1 chronocb 5000 2042643968 2010-12-22 20:11 chromiumos_base_image.bin
-rw-r--r-- 1 chronocb 5000 2042643968 2010-12-22 20:20 chromiumos_image.bin
-rw-r--r-- 1 chronocb 5000        402 2010-12-22 20:19 config.txt
-rwxr-xr-x 1 chronocb 5000       3626 2010-12-22 20:09 pack_partitions.sh
-rwxr-xr-x 1 chronocb 5000       3470 2010-12-22 20:09 unpack_partitions.sh
Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: