gbs chroot

The subcommand 'chroot' allows users to chroot to the buildroot directory, which is generated by gbs build. You can get the basic usage of gbs chroot using:

$ gbs chroot --help

Note: The default location of the build root is located at: ~/GBS-ROOT/local/scratch.{arch}.*, which will be different if the -B option is specified while running gbs build Examples:

  • Create build root with more extra packages to the build root
$ gbs build --extra-packs=zypper,vim -A i586 # install zypper,vim to build root

For more gbs build options, please refer to gbs build page.

  • Chroot to buildroot, example: chroot to ~/GBS-ROOT/local/scratch.i686.0/
$ gbs chroot ~/GBS-ROOT/local/scratch.i686.0/
  • Chroot as 'root' user
$ gbs chroot -r ~/GBS-ROOT/local/scratch.i686.0/

If gbs chroot failed with error: 'su: user root does not exist', which is caused by tizen repository. Currently, you can add root user manually by editing below two files:

$ echo "root:x:0:0:root:/root:/bin/bash" >>path/to/buildroot/etc/passwd
$ echo "root:x:0:" >>path/to/buildroot/etc/group

With this update, gbs chroot should work.

  • Chroot and install more extra packages into buildroot directory for development purposes
chroot as 'root':
$ gbs chroot -r ~/GBS-ROOT/local/scratch.i686.0/
Configure tizen repo in the chroot env:
# zypper ar<release_id>/repos/main/ia32/packages tizen-main
# zypper ar<release_id>/repos/base/ia32/packages tizen-base
Install extra packages, for example, install gdb.
# zypper refresh
# zypper -n install gdb gcc

For https repositories, you need to specify 'ssl_verify=no'. For example:

# zypper ar<release_id>/repos/main/ia32/packages/?ssl_verify=no tizen-main


  • If you want to use as 'root', you need specify '-r' option, then zypper can be used to install/remove packages
  • If you want to install packages in the build root env, you need specify the '-n' option, such as: zypper -n install gdb