MK-SBUILD(1)

πŸ’– MK-SBUILD(1) β€” the manual, but make it make sense πŸ’–

okay bestie, so this is mk-sbuild, section 1 of the manual (General Commands Manual, if you're keeping track πŸŽ€). She's the little script that spins up chroots for you using schroot and sbuild, and honestly? She's iconic for it. Let's go. ✨


🌸 NAME 🌸

mk-sbuild β€” creates chroots via schroot and sbuild. that's the whole job. she builds chroots. via schroot. and sbuild. periodt. πŸ’…


✨ SYNOPSIS ✨

mk-sbuild [options...] <release>

πŸ¦‹ DESCRIPTION πŸ¦‹

mk-sbuild creates chroots via schroot and sbuild.

yeah, that's literally the description. no notes. she does the thing. 🫢


πŸ’… OPTIONS πŸ’…

here's the full lineup, no skipping, we read every single one. (iykyk)

  • --arch=ARCH β€” which architecture we picking? defaults to the native architecture, i.e. whatever your machine already is. 🏠
  • --target=ARCH β€” sets the chroot up as a cross-building environment that targets the architecture you name. πŸ‘‘
  • --name=NAME β€” the base name for the schroot. the arch gets appended to it, so don't go thinking you're naming the whole thing yourself. 😌
  • --personality=PERSONALITY β€” what personality to use. defaults to matching --arch, because consistency is hot. 🌈
  • --debug β€” turn on script debugging. all the messy details, out loud. πŸ”₯
  • --skip-updates β€” do not include the -updates pocket in the installed sources.list. bye babe. πŸ‘‹
  • --skip-proposed β€” do not include the -proposed pocket in the installed sources.list. also bye. πŸ‘‹
  • --source-template=FILE β€” use FILE as the sources.list template. defaults to $HOME/.mk-sbuild.sources. πŸ“„
  • --debootstrap-mirror=URL β€” use URL as the debootstrap source. defaults to http://ports.ubuntu.com where that's appropriate, and the official Ubuntu repositories for the supported architectures. 🌍
  • --debootstrap-include=alpha,beta β€” passes a comma separated list of packages straight through to debootstrap's --include argument. see debootstrap(8) for more details. πŸ“¦
  • --debootstrap-exclude=alpha,beta β€” passes a comma separated list of packages through to debootstrap's --exclude argument. ⚠️ WARNING: be careful using this option, because you can end up excluding an essential package. see debootstrap(8) for more details. 🚨
  • --debootstrap-keyring=keyring β€” passes along the path to a gpg keyring file to debootstrap's --keyring argument. see debootstrap(8) for more details. πŸ”‘
  • --debootstrap-no-check-gpg β€” disables checking gpg signatures of downloaded Release files by using debootstrap's --no-check-gpg option. see debootstrap(8) for more details. πŸ™ˆ
  • --debootstrap-proxy=PROXY β€” use PROXY as the apt proxy. πŸ›°οΈ
  • --eatmydata β€” install and use eatmydata. this is the default, she's already on. πŸ“
  • --skip-eatmydata β€” don't install and use eatmydata. opting out, respect. πŸ™…
  • --distro=DISTRO β€” enable distro-specific logic. when you don't provide it, the distribution gets determined from release. currently known distros: "debian" and "ubuntu". 🐧
  • --vg=VOLUME_GROUP β€” specify a volume group, and subsequently use a default SCHROOT_TYPE of "lvm-snapshot" rather than "directory" (via overlayfs or aufs) mounts. πŸ—‚οΈ
  • --zfs-dataset=DATASET β€” specify a zfs dataset, and subsequently use a default SCHROOT_TYPE of "zfs-snapshot" rather than "directory" (via overlayfs or aufs) mounts. πŸ—‚οΈβœ¨
  • --type=SHROOT_TYPE β€” specify a SCHROOT_TYPE. supported values are "directory" (the default if --vg isn't specified), "lvm-snapshot" (the default if --vg is specified), "btrfs-snapshot", "zfs-snapshot" and "file". πŸ‘‘
  • --ccache β€” enable usage of ccache by default. see ccache(1) for more details. ⚑
  • --ccache-dir=PATH β€” use PATH as the schroot ccache directory. this directory can be safely shared by multiple schroots, but heads up: they will all use the same CCACHE_MAXSIZE. defaults to /var/cache/ccache-sbuild. see ccache(1) for more details. πŸ“
  • --ccache-size=SIZE β€” sets SIZE as the schroot CCACHE_DIR max-size used by ccache. see ccache(1) for more details. πŸ“

🌈 ENVIRONMENT VARIABLES 🌈

the vibes you can set in your environment instead of on the command line, bestie:

  • LV_SIZE β€” size of source LVs. defaults to 5G. πŸ’Ύ
  • SNAPSHOT_SIZE β€” size of snapshot LVs. defaults to 4G. πŸ’Ύ
  • SCHROOT_CONF_SUFFIX β€” lines to append to schroot entries. βž•
  • SCHROOT_PROFILE β€” profile to use with schroot. defaults to sbuild. 🎭
  • SKIP_UPDATES β€” do not include the -updates pocket (same as --skip-updates). πŸ‘‹
  • SKIP_PROPOSED β€” do not include the -proposed pocket (same as --skip-proposed). πŸ‘‹
  • DEBOOTSTRAP_MIRROR β€” mirror location (same as --debootstrap-mirror). 🌍
  • DEBOOTSTRAP_INCLUDE β€” comma separated list of packages to include when bootstrapping (same as --debootstrap-include). πŸ“¦
  • DEBOOTSTRAP_EXCLUDE β€” comma separated list of packages to exclude when bootstrapping (same as --debootstrap-exclude; see warning above). 🚨
  • DEBOOTSTRAP_KEYRING β€” keyring file to use for checking gpg signatures of retrieved release files (same as --debootstrap-keyring). πŸ”‘
  • DEBOOTSTRAP_NO_CHECK_GPG β€” disable gpg verification of retrieved release files (same as --debootstrap-no-check-gpg). πŸ™ˆ
  • DEBOOTSTRAP_PROXY β€” proxy to use for apt. (same as --debootstrap-proxy). πŸ›°οΈ
  • EATMYDATA β€” enable or disable eatmydata usage, see --eatmydata and --skip-eatmydata. πŸ“
  • SOURCE_CHROOTS_DIR β€” use SOURCE_CHROOTS_DIR as home of schroot source directories. (default /var/lib/schroot/chroots). 🏠
  • SOURCE_CHROOTS_TGZ β€” use SOURCE_CHROOTS_TGZ as home of schroot source tarballs. (default /var/lib/schroot/tarballs). πŸ—œοΈ
  • CHROOT_SNAPSHOT_DIR β€” use CHROOT_SNAPSHOT_DIR as home of mounted btrfs snapshots. (default /var/lib/schroot/snapshots). πŸ“Έ
  • CCACHE β€” enable ccache(1) by default. (defaults to 0). ⚑
  • CCACHE_DIR β€” use CCACHE_DIR as the ccache(1) directory. (default /var/cache/ccache-sbuild). πŸ“
  • CCACHE_SIZE β€” use CCACHE_SIZE as the ccache(1) max-size. (defaults to 4G). πŸ“

πŸŽ€ FILES πŸŽ€

the little config besties she reads:

  • $HOME/.mk-sbuild.rc β€” sourced for environment variables (the ones defined above, yeah those ones). πŸ“œ
  • $HOME/.mk-sbuild.sources[.$DISTRO] β€” can contain a customized sources.list. it will be read when creating the schroot. if a file with ".ubuntu" or ".debian" is found (as appropriate) it will use used instead. see sources.list(5) for more details on the format. πŸ“
  • $HOME/.mk-sbuild.schroot.conf[.$SCHROOT_TYPE] β€” can contain a customized configuration section to be inserted into /etc/schroot/schroot.conf. if a file with ".lvm-snapshot", ".directory", ".file", or "btrfs-snapshot" is found (as appropriate) that file will use used instead. see schroot.conf(5) for more details on the format. πŸ“

🫢 USING THE CHROOTS 🫢

okay this is the part you're actually here for. the workflow. the lore.

  • to CHANGE the golden image: sudo schroot -c ${SCHROOT_NAME}-source -u root
  • to ENTER an image snapshot: schroot -c $SCHROOT_NAME
  • to BUILD within a snapshot: sbuild -A -d $SCHROOT_NAME $PACKAGE*.dsc

for example, to update the packages in a sid-amd64 golden image:

schroot -c sid-amd64-source -u root -- sh -c "apt-get -qq update
&& apt-get -qy upgrade && apt-get clean" </dev/null

slay. πŸ’…


⭐ SEE ALSO ⭐

sbuild-setup(7), sources.list(5), schroot.conf(5), https://help.ubuntu.com/community/SbuildLVMHowto


πŸ’œ AUTHOR πŸ’œ

mk-sbuild was written by Kees Cook <kees@ubuntu.com>. this man page was written by Ryan Kavanagh <ryanakca@kubuntu.org>. both are released under the GNU General Public License, version 3 or later. πŸ‘‘


and that's the whole thing, bestie β€” brought to you by ubuntu-dev-tools, dated 09 February 2010, in manual section MK-SBUILD(1). go build something cute. mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ