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-updatespocket in the installedsources.list. bye babe. π--skip-proposedβ do not include the-proposedpocket in the installedsources.list. also bye. π--source-template=FILEβ useFILEas thesources.listtemplate. defaults to$HOME/.mk-sbuild.sources. π--debootstrap-mirror=URLβ useURLas the debootstrap source. defaults tohttp://ports.ubuntu.comwhere 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--includeargument. seedebootstrap(8)for more details. π¦--debootstrap-exclude=alpha,betaβ passes a comma separated list of packages through to debootstrap's--excludeargument. β οΈ WARNING: be careful using this option, because you can end up excluding an essential package. seedebootstrap(8)for more details. π¨--debootstrap-keyring=keyringβ passes along the path to a gpg keyring file to debootstrap's--keyringargument. seedebootstrap(8)for more details. π--debootstrap-no-check-gpgβ disables checking gpg signatures of downloaded Release files by using debootstrap's--no-check-gpgoption. seedebootstrap(8)for more details. π--debootstrap-proxy=PROXYβ usePROXYas the apt proxy. π°οΈ--eatmydataβ install and useeatmydata. this is the default, she's already on. π--skip-eatmydataβ don't install and useeatmydata. opting out, respect. π--distro=DISTROβ enable distro-specific logic. when you don't provide it, the distribution gets determined fromrelease. currently known distros:"debian"and"ubuntu". π§--vg=VOLUME_GROUPβ specify a volume group, and subsequently use a defaultSCHROOT_TYPEof"lvm-snapshot"rather than"directory"(via overlayfs or aufs) mounts. ποΈ--zfs-dataset=DATASETβ specify a zfs dataset, and subsequently use a defaultSCHROOT_TYPEof"zfs-snapshot"rather than"directory"(via overlayfs or aufs) mounts. ποΈβ¨--type=SHROOT_TYPEβ specify aSCHROOT_TYPE. supported values are"directory"(the default if--vgisn't specified),"lvm-snapshot"(the default if--vgis specified),"btrfs-snapshot","zfs-snapshot"and"file". π--ccacheβ enable usage of ccache by default. seeccache(1)for more details. β‘--ccache-dir=PATHβ usePATHas the schroot ccache directory. this directory can be safely shared by multiple schroots, but heads up: they will all use the sameCCACHE_MAXSIZE. defaults to/var/cache/ccache-sbuild. seeccache(1)for more details. π--ccache-size=SIZEβ setsSIZEas the schrootCCACHE_DIRmax-size used by ccache. seeccache(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 to5G. πΎSNAPSHOT_SIZEβ size of snapshot LVs. defaults to4G. πΎSCHROOT_CONF_SUFFIXβ lines to append to schroot entries. βSCHROOT_PROFILEβ profile to use with schroot. defaults tosbuild. πSKIP_UPDATESβ do not include the-updatespocket (same as--skip-updates). πSKIP_PROPOSEDβ do not include the-proposedpocket (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--eatmydataand--skip-eatmydata. πSOURCE_CHROOTS_DIRβ useSOURCE_CHROOTS_DIRas home of schroot source directories. (default/var/lib/schroot/chroots). πSOURCE_CHROOTS_TGZβ useSOURCE_CHROOTS_TGZas home of schroot source tarballs. (default/var/lib/schroot/tarballs). ποΈCHROOT_SNAPSHOT_DIRβ useCHROOT_SNAPSHOT_DIRas home of mounted btrfs snapshots. (default/var/lib/schroot/snapshots). πΈCCACHEβ enableccache(1)by default. (defaults to0). β‘CCACHE_DIRβ useCCACHE_DIRas theccache(1)directory. (default/var/cache/ccache-sbuild). πCCACHE_SIZEβ useCCACHE_SIZEas theccache(1)max-size. (defaults to4G). π
π 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 customizedsources.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. seesources.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. seeschroot.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. πβ¨ππ¦πΈ
π¦ where this page comes from
- debian bookworm: ubuntu-dev-tools 0.193 Β· GPL-2.0-only
- debian trixie: ubuntu-dev-tools 0.206 Β· GPL-2.0-only
- ubuntu jammy: ubuntu-dev-tools 0.189 Β· GPL-2.0-only
- ubuntu jammy: ubuntu-dev-tools 0.201ubuntu2~22.04.4 Β· GPL-2.0-only
- ubuntu noble: ubuntu-dev-tools 0.201ubuntu2 Β· GPL-2.0-only
- ubuntu questing: ubuntu-dev-tools 0.206
- ubuntu resolute: ubuntu-dev-tools 0.210 Β· GPL-2.0-only
- ubuntu stonking: ubuntu-dev-tools 0.215 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms