├── CHANGES.md ├── README.md ├── agpl-3.0.txt ├── cf ├── apt │ └── apt-ftparchive.conf.tmpl ├── bootstrap │ ├── aequorea │ ├── amber │ ├── artful │ ├── ascii │ ├── bartholomea │ ├── beowulf │ ├── bionic │ ├── bookworm │ ├── breezy │ ├── bullseye │ ├── buster │ ├── ceres │ ├── chimaera │ ├── chromodoris │ ├── cosmic │ ├── daedalus │ ├── dapper │ ├── dasyatis │ ├── debian-common │ ├── disco │ ├── edgy │ ├── eoan │ ├── etch │ ├── etch-m68k │ ├── feisty │ ├── focal │ ├── groovy │ ├── gutsy │ ├── hardy │ ├── hirsute │ ├── hoary │ ├── hoary.buildd │ ├── impish │ ├── intrepid │ ├── jaunty │ ├── jessie │ ├── jessie-kfreebsd │ ├── kali │ ├── kali-dev │ ├── kali-last-snapshot │ ├── kali-rolling │ ├── karmic │ ├── lenny │ ├── lucid │ ├── maverick │ ├── natty │ ├── oldoldstable │ ├── oldstable │ ├── oneiric │ ├── potato │ ├── precise │ ├── quantal │ ├── raring │ ├── sarge │ ├── sarge.buildd │ ├── sarge.fakechroot │ ├── saucy │ ├── sid │ ├── squeeze │ ├── stable │ ├── stretch │ ├── testing │ ├── trusty │ ├── unstable │ ├── utopic │ ├── vivid │ ├── warty │ ├── warty.buildd │ ├── wheezy │ ├── wily │ ├── woody │ ├── woody.buildd │ ├── xenial │ ├── yakkety │ └── zesty ├── keys │ ├── debian │ │ └── stretch.gpg │ ├── devuan │ │ ├── beowulf.gpg │ │ ├── chimaera.gpg │ │ ├── daedalus.gpg │ │ ├── devuan-archive-keyring.gpg │ │ ├── devuan-keyring.gpg │ │ ├── testing.gpg │ │ └── unstable.gpg │ └── ubuntu │ │ └── focal.gpg └── target │ ├── common │ ├── debian │ │ ├── mirror.cf │ │ └── stretch.cf │ ├── devuan │ │ ├── beowulf.cf │ │ ├── chimaera.cf │ │ ├── daedalus.cf │ │ ├── mirror.cf │ │ ├── testing.cf │ │ └── unstable.cf │ ├── remove-files.cf │ ├── target-apt-repo.cf │ └── ubuntu │ │ ├── focal.cf │ │ ├── mirror.cf │ │ └── xenial.cf │ ├── devuan-beowulf-amd64.cf │ ├── devuan-beowulf-i386.cf │ ├── devuan-chimaera-amd64.cf │ ├── devuan-chimaera-i386.cf │ ├── devuan-daedalus-amd64.cf │ ├── devuan-daedalus-i386.cf │ ├── devuan-testing-amd64.cf │ ├── devuan-testing-i386.cf │ ├── devuan-unstable-amd64.cf │ ├── devuan-unstable-i386.cf │ ├── dng-beowulf-amd64.cf │ ├── dng-beowulf-i386.cf │ ├── dng-chimaera-amd64.cf │ ├── dng-chimaera-i386.cf │ ├── stretch-amd64.cf │ ├── stretch-i386.cf │ ├── ubuntu-focal-amd64.cf │ ├── ubuntu-focal-i386.cf │ ├── xenial-amd64.cf │ └── xenial-i386.cf ├── dck-buildpackage ├── dependencies ├── lib ├── aptcache.sh ├── aptrepo.sh ├── baseimage.sh ├── build.sh ├── ccache.sh ├── cleanup.sh ├── conf.sh ├── docker.sh ├── dpkg.sh ├── help.sh ├── log.sh └── main.sh └── package.lsm /CHANGES.md: -------------------------------------------------------------------------------- 1 | CHANGES 2 | ======= 3 | 4 | v0.5 5 | ---- 6 | 7 | * baseimage: support bootstrapping in docker container 8 | - use docker container instead of sudo for debootstrap run 9 | - enabled when image is defined via `$DISTRO_BUILDER_IMAGE` 10 | - enabled it for Devuan targets 11 | 12 | * baseimage: optimized post-install steps _(eg. apt-mark or file removal)_ 13 | - formerly was done by looping through lists and calling the jail'ed commands separately 14 | - now running in one command, thus only entering the jail once 15 | - downside: can't use wildcards anymore _(would be expanded outside jail/container)_ 16 | 17 | * baseimage: automatically install debootstrap 18 | - bootstrapping jail might not have debootstrap installed, so install it automatically 19 | - needed for dockerized bootstrapping w/ offical images 20 | 21 | * baseimage: caching rootfs tarballs 22 | - rootfs tarballs are now cached and automatically reused _(used to be temporary-only)_ 23 | - helpful for CI's that always run fresh environments, but are able to cache/restore individual directories 24 | - cache prefix can be defined via `$DCK_BUILDPACKAGE_TARBALL_CACHE` 25 | - default is still `/tmp/dck-buildpackage/debootstrap-tarballs/` 26 | 27 | * baseimage: support setting distro variant to bootstrap 28 | - target configs now can set it via `$DISTRO_VARIANT` 29 | - passed as `--variant` parameter to debootstrap 30 | 31 | * builder: fix missing `/tmp` inside container 32 | - rootfs images might be heavily trimmed down and lacking `/tmp` 33 | - make sure it always exists before doing anything else 34 | 35 | * targets: Devuan: fix missing `usr-is-merged` package 36 | - on recent Debian, debootstrap wants to install `usr-is-merged`, which is not present on older releases 37 | - since it's never needed on Devuan, just add it to the `$DISTRO_EXCLUDE` list 38 | 39 | * targets: Devuan: rename `dng-*` targets to `devuan-*` 40 | - Fixing target naming scheme 41 | - Old names kept for backwards compatibility 42 | 43 | * targets: additions and removals 44 | - add: Devuan Daedalus 45 | - add: Devuan Testing 46 | - add: Devuan Unstable 47 | - drop: Devuan ASCII and Jessie _(dead)_ 48 | 49 | v0.4 50 | ---- 51 | 52 | * baseimage: add setting for extra packages 53 | - `$DISTRO_EXTRA_PACKAGES` config variable for installing extra packages 54 | - installing happens before the cleanup phase 55 | 56 | * baseimage: use bundled bootstrap scripts 57 | - some hosts lacking the right bootstrap scripts for certain distros 58 | - keeping a bundled copy, which will be maintained along w/ target configs 59 | 60 | * builder: fix untrusted local repos 61 | - Recent apt refuses to install from untrusted repos 62 | - locally built repo needs to be explicitly set as trusted 63 | 64 | * builder: autogenerate `debian/changes` when needed 65 | - some packages want their debian/changes file generated `debian/rules` 66 | - calling `./debian/rules debian/changes` in that case 67 | 68 | * targets: additions and removals: 69 | - add: Devuan Beowulf 70 | - add: Devuan Chimaera 71 | - add: Ubuntu Focal 72 | - drop: Ubuntu Trusty _(dead)_ 73 | 74 | * targets: consolidated target configs 75 | - consolidate common parts from arch specific distro targets 76 | - most things now done in common include's 77 | - per release includes that are just referenced by per arch targets 78 | - consolidated keyring files 79 | - updated debootstrap scrips 80 | 81 | v0.3 82 | ---- 83 | 84 | * builder: fix broken permissions after build: 85 | - Container's temporary source tree _(fed in by the outside)_ can become inaccessible to host user 86 | - Fixing it inside the container by just removing it 87 | 88 | * builder: fix unnecessary chown of generated apt repo 89 | - picking out deb's and generating apt indices now runs as unprivileged user 90 | - no need to `sudo chown` anymore 91 | 92 | * builder: record latest deb file names 93 | - debs of last build run collected at: `/stat///latest-debs` 94 | - higher level tools can pick it from there, e.g. for automatic tests 95 | 96 | * builder: ccache support 97 | - ccache data put into a separate volume called `dckbp-ccache-$DISTRO_TAG` 98 | 99 | * builder: generate `debian/control` 100 | - Some packages need to generate `debian/control` by `debian/rules` 101 | - installing deps via `debian/control.bootstrap`, then call `debian/rules` to generate `debian/control` 102 | 103 | * builder: allow passing source package name via environment 104 | - Some packages need to use a different source package name 105 | - This can be passed via `$DCK_BUILDPACKAGE_SOURCE` environment variable 106 | 107 | * builder: check for uuidgen tool 108 | - Sanity check for uuidgen tool installed 109 | - Prevent silent failures that could go unnoticed and corrupt build 110 | 111 | * targets: additions 112 | - Debian Stretch (i386/amd64) 113 | - Devuan ASCII (i386) 114 | 115 | * targets: fix devuan apt repo 116 | - Devuan's mirror cluster (auto.mirror.devuan.org) seems unstable 117 | - using primary mirror: http://deb.devuan.org/merged 118 | - Updated keyring 119 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | docker-buildpackage - easily build deb/apt packages 2 | ================================= 3 | 4 | Prerequisites: 5 | -------------- 6 | 7 | * apt-based distro 8 | * working docker setup 9 | 10 | Installation: 11 | -------------- 12 | * just clone the git repo _(no system-wide installation yet)_ 13 | * check/adapt the target distro configs in `cf/target/` 14 | 15 | What it does for you: 16 | --------------------- 17 | * automatically debootstrap a build container base image 18 | * build deb's by launching a container, running the build inside it, pull out the deb's and cleanup again 19 | 20 | Building a package: 21 | ------------------- 22 | * chdir to your debianized source tree 23 | * call `dck-buildpackage --target ` 24 | * get big coffee ;-) 25 | * deb's are placed within `$HOME/dckbp-apt-repo/` 26 | 27 | Regenerate apt repo index: 28 | -------------------------- 29 | * call `dck-buildpackage --target ` 30 | * creates an installable apt repo _(needs an gpg key)_ 31 | * gpg key id can be set via `$DCK_BUILDPACKAGE_SIGNKEY` _(otherwise use default)_ 32 | * if distro config sets `$DISTRO_APT_USE_BUILT_REPO=1`, the repo will automatically be added to the build containers 33 | 34 | Autogenerated images: 35 | --------------------- 36 | * apt download cache volumes: `dckbp-aptacache-` 37 | * base images: `dckbp-baseimage-` 38 | * build containers: `dckbp-build--` 39 | 40 | Cleanup: 41 | -------- 42 | * temporary containers are removed automatically 43 | * apt caches remain until calling `dck-buildpackage --cleanup` 44 | 45 | Environment variables: 46 | ---------------------- 47 | 48 | Variable | Description 49 | ---|--- 50 | `$DCK_BUILDPACKAGE_SIGNKEY` | ID of the GPG key to be used for repo signing _(if absent, use GPGs default sign key)_ 51 | `$DCK_BUILDPACKAGE_TARGET_REPO` | prefix of the generated apt repos. each target has its own repo in subdir named by target. 52 | `$DCK_BUILDPACKAGE_CONFDIR` | config directory _(defaults ./cf relative to the dck-buildpackage main script)_ 53 | `$DCK_BUILDPACKAGE_TARBALL_CACHE` | cache dir for chroot tarballs _(if set, don't remove tarballs and reused for image import)_ 54 | `$DISTRO_TARGET_REPO` | actual target repo directory, derived from `$DCK_BUILDPACKAGE_TARGET_REPO` if not given. 55 | 56 | 2DO: 57 | ---- 58 | * publishing built packages to remote repos 59 | * a decent manpage :o 60 | * installable package of this tool 61 | * cloning git repos instead of using local source tree 62 | * should `dck-buildpackage --cleanup` also remove base images ? 63 | * support subdirs and dots in target names _(docker names/tags are derived from that, and it doesn't like some chars in there)_ 64 | * add finer per-target configuration of base image, volume, container names 65 | * add cleanup for only one specific target 66 | * per package cache images, so deps need to be deployed only once 67 | * separate clean for only apt-cache, base images, containers, ... 68 | * command line option for separate configs 69 | * honor `.gitignore` in source trees _(dont upload ignored files)_ 70 | 71 | Maintainer: 72 | ----------- 73 | * Enrico Weigelt, metux IT consult 74 | 75 | License: 76 | -------- 77 | * AGPLv3 78 | -------------------------------------------------------------------------------- /cf/apt/apt-ftparchive.conf.tmpl: -------------------------------------------------------------------------------- 1 | Dir { 2 | ArchiveDir "."; 3 | CacheDir "cache"; 4 | }; 5 | 6 | Default { 7 | Contents::Compress "gzip bzip2 lzma"; 8 | Packages::Compress ". gzip bzip2 lzma"; 9 | Sources::Compress ". gzip bzip2 lzma"; 10 | Translation::Compress ". gzip bzip2 lzma"; 11 | }; 12 | 13 | TreeDefault { 14 | Directory "pool/$(DIST)/$(SECTION)"; 15 | SrcDirectory "pool/$(DIST)/$(SECTION)"; 16 | }; 17 | 18 | Tree "dists/@DISTRO@" { 19 | Sections "@SECTIONS@"; 20 | Architectures "@ARCHITECTURES@"; 21 | }; 22 | 23 | APT::FTPArchive::Release { 24 | Codename "@CODENAME@"; 25 | Suite "@DISTRO@"; 26 | Origin "local"; 27 | Label "@LABEL@"; 28 | Architectures "@ARCHITECTURES@"; 29 | Components "@COMPONENTS@"; 30 | Description "@DESCRIPTION@"; 31 | }; 32 | -------------------------------------------------------------------------------- /cf/bootstrap/aequorea: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | finddebs_style from-indices 4 | variants - buildd fakechroot minbase 5 | keyring /usr/share/keyrings/tanglu-archive-keyring.gpg 6 | default_mirror http://archive.tanglu.org/tanglu 7 | 8 | if doing_variant fakechroot; then 9 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 10 | fi 11 | 12 | case $ARCH in 13 | alpha|ia64) LIBC="libc6.1" ;; 14 | kfreebsd-*) LIBC="libc0.1" ;; 15 | hurd-*) LIBC="libc0.3" ;; 16 | *) LIBC="libc6" ;; 17 | esac 18 | 19 | work_out_debs () { 20 | required="$(get_debs Priority: required)" 21 | 22 | if doing_variant - || doing_variant fakechroot; then 23 | #required="$required $(get_debs Priority: important)" 24 | # ^^ should be getting debconf here somehow maybe 25 | base="$(get_debs Priority: important)" 26 | 27 | # we want the Tanglu minimal dependency set to be installed 28 | base="$base tanglu-minimal" 29 | elif doing_variant buildd; then 30 | base="apt build-essential" 31 | elif doing_variant minbase; then 32 | base="apt" 33 | fi 34 | 35 | if doing_variant fakechroot; then 36 | # ldd.fake needs binutils 37 | required="$required binutils" 38 | fi 39 | 40 | case $MIRRORS in 41 | https://*) 42 | base="$base apt-transport-https ca-certificates" 43 | ;; 44 | esac 45 | } 46 | 47 | first_stage_install () { 48 | extract $required 49 | 50 | mkdir -p "$TARGET/var/lib/dpkg" 51 | : >"$TARGET/var/lib/dpkg/status" 52 | : >"$TARGET/var/lib/dpkg/available" 53 | 54 | setup_etc 55 | if [ ! -e "$TARGET/etc/fstab" ]; then 56 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 57 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 58 | fi 59 | 60 | setup_devices 61 | 62 | x_feign_install () { 63 | local pkg="$1" 64 | local deb="$(debfor $pkg)" 65 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 66 | 67 | mkdir -p "$TARGET/var/lib/dpkg/info" 68 | 69 | echo \ 70 | "Package: $pkg 71 | Version: $ver 72 | Maintainer: unknown 73 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 74 | 75 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 76 | } 77 | 78 | x_feign_install dpkg 79 | } 80 | 81 | second_stage_install () { 82 | setup_dynamic_devices 83 | 84 | x_core_install () { 85 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 86 | } 87 | 88 | p () { 89 | baseprog="$(($baseprog + ${1:-1}))" 90 | } 91 | 92 | if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then 93 | setup_proc_symlink 94 | else 95 | setup_proc 96 | in_target /sbin/ldconfig 97 | fi 98 | 99 | DEBIAN_FRONTEND=noninteractive 100 | DEBCONF_NONINTERACTIVE_SEEN=true 101 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 102 | 103 | baseprog=0 104 | bases=7 105 | 106 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 107 | info INSTCORE "Installing core packages..." 108 | 109 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 110 | ln -sf mawk "$TARGET/usr/bin/awk" 111 | x_core_install base-passwd 112 | x_core_install base-files 113 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 114 | x_core_install dpkg 115 | 116 | if [ ! -e "$TARGET/etc/localtime" ]; then 117 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 118 | fi 119 | 120 | if doing_variant fakechroot; then 121 | install_fakechroot_tools 122 | fi 123 | 124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 125 | x_core_install $LIBC 126 | 127 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 128 | x_core_install perl-base 129 | 130 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 131 | rm "$TARGET/usr/bin/awk" 132 | x_core_install mawk 133 | 134 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 135 | if doing_variant -; then 136 | x_core_install debconf 137 | fi 138 | 139 | baseprog=0 140 | bases=$(set -- $required; echo $#) 141 | 142 | info UNPACKREQ "Unpacking required packages..." 143 | 144 | exec 7>&1 145 | 146 | smallyes '' | 147 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 148 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) | 149 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING 150 | 151 | info CONFREQ "Configuring required packages..." 152 | 153 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 154 | echo \ 155 | "#!/bin/sh 156 | echo 157 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 158 | chmod 755 "$TARGET/sbin/start-stop-daemon" 159 | 160 | setup_dselect_method apt 161 | 162 | smallyes '' | 163 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 164 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) | 165 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING 166 | 167 | baseprog=0 168 | bases="$(set -- $base; echo $#)" 169 | 170 | info UNPACKBASE "Unpacking the base system..." 171 | 172 | setup_available $required $base 173 | done_predeps= 174 | while predep=$(get_next_predep); do 175 | # We have to resolve dependencies of pre-dependencies manually because 176 | # dpkg --predep-package doesn't handle this. 177 | predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") 178 | # XXX: progress is tricky due to how dpkg_progress works 179 | # -- cjwatson 2009-07-29 180 | p; smallyes '' | 181 | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) 182 | base=$(without "$base" "$predep") 183 | done_predeps="$done_predeps $predep" 184 | done 185 | 186 | smallyes '' | 187 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 188 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) | 189 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING 190 | 191 | info CONFBASE "Configuring the base system..." 192 | 193 | smallyes '' | 194 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \ 195 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) | 196 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING 197 | 198 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 199 | 200 | progress $bases $bases CONFBASE "Configuring base system" 201 | info BASESUCCESS "Base system installed successfully." 202 | } 203 | -------------------------------------------------------------------------------- /cf/bootstrap/amber: -------------------------------------------------------------------------------- 1 | 2 | # For PureOS "amber" 3 | # PureOS: https://www.pureos.net/ 4 | # Contact: https://tracker.pureos.net/ 5 | 6 | mirror_style release 7 | download_style apt 8 | finddebs_style from-indices 9 | variants - buildd fakechroot minbase 10 | keyring /usr/share/keyrings/pureos-archive-keyring.gpg 11 | default_mirror https://repo.pureos.net/pureos/ 12 | 13 | if doing_variant fakechroot; then 14 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 15 | fi 16 | 17 | case $ARCH in 18 | alpha|ia64) LIBC="libc6.1" ;; 19 | kfreebsd-*) LIBC="libc0.1" ;; 20 | hurd-*) LIBC="libc0.3" ;; 21 | *) LIBC="libc6" ;; 22 | esac 23 | 24 | work_out_debs () { 25 | required="$(get_debs Priority: required)" 26 | 27 | if doing_variant - || doing_variant fakechroot; then 28 | #required="$required $(get_debs Priority: important)" 29 | # ^^ should be getting debconf here somehow maybe 30 | base="$(get_debs Priority: important)" 31 | 32 | # we want the PureOS minimal dependency set to be installed 33 | base="$base pureos-minimal" 34 | elif doing_variant buildd; then 35 | base="apt build-essential" 36 | elif doing_variant minbase; then 37 | base="apt" 38 | fi 39 | 40 | if doing_variant fakechroot; then 41 | # ldd.fake needs binutils 42 | required="$required binutils" 43 | fi 44 | 45 | case $MIRRORS in 46 | https://*) 47 | base="$base ca-certificates" 48 | ;; 49 | esac 50 | } 51 | 52 | first_stage_install () { 53 | MERGED_USR="yes" 54 | EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" 55 | 56 | setup_merged_usr 57 | extract $required 58 | 59 | mkdir -p "$TARGET/var/lib/dpkg" 60 | : >"$TARGET/var/lib/dpkg/status" 61 | : >"$TARGET/var/lib/dpkg/available" 62 | 63 | setup_etc 64 | if [ ! -e "$TARGET/etc/fstab" ]; then 65 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 66 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 67 | fi 68 | 69 | setup_devices 70 | } 71 | 72 | second_stage_install () { 73 | setup_dynamic_devices 74 | 75 | x_feign_install () { 76 | local pkg="$1" 77 | local deb="$(debfor $pkg)" 78 | local ver="$(in_target dpkg-deb -f "$deb" Version)" 79 | 80 | mkdir -p "$TARGET/var/lib/dpkg/info" 81 | 82 | echo \ 83 | "Package: $pkg 84 | Version: $ver 85 | Maintainer: unknown 86 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 87 | 88 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 89 | } 90 | 91 | x_feign_install dpkg 92 | 93 | x_core_install () { 94 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 95 | } 96 | 97 | p () { 98 | baseprog="$(($baseprog + ${1:-1}))" 99 | } 100 | 101 | if doing_variant fakechroot; then 102 | setup_proc_fakechroot 103 | else 104 | setup_proc 105 | in_target /sbin/ldconfig 106 | fi 107 | 108 | DEBIAN_FRONTEND=noninteractive 109 | DEBCONF_NONINTERACTIVE_SEEN=true 110 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 111 | 112 | baseprog=0 113 | bases=7 114 | 115 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 116 | info INSTCORE "Installing core packages..." 117 | 118 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 119 | ln -sf mawk "$TARGET/usr/bin/awk" 120 | x_core_install base-passwd 121 | x_core_install base-files 122 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 123 | x_core_install dpkg 124 | 125 | if [ ! -e "$TARGET/etc/localtime" ]; then 126 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 127 | fi 128 | 129 | if doing_variant fakechroot; then 130 | install_fakechroot_tools 131 | fi 132 | 133 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 134 | x_core_install $LIBC 135 | 136 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 137 | x_core_install perl-base 138 | 139 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 140 | rm "$TARGET/usr/bin/awk" 141 | x_core_install mawk 142 | 143 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 144 | if doing_variant -; then 145 | x_core_install debconf 146 | fi 147 | 148 | baseprog=0 149 | bases=$(set -- $required; echo $#) 150 | 151 | info UNPACKREQ "Unpacking required packages..." 152 | 153 | exec 7>&1 154 | 155 | smallyes '' | 156 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 157 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) | 158 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING 159 | 160 | info CONFREQ "Configuring required packages..." 161 | 162 | if doing_variant fakechroot && [ -e "$TARGET/var/lib/dpkg/info/initscripts.postinst" ] 163 | then 164 | # fix initscripts postinst (no mounting possible, and wrong if condition) 165 | sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst" 166 | fi 167 | 168 | echo \ 169 | "#!/bin/sh 170 | exit 101" > "$TARGET/usr/sbin/policy-rc.d" 171 | chmod 755 "$TARGET/usr/sbin/policy-rc.d" 172 | 173 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 174 | echo \ 175 | "#!/bin/sh 176 | echo 177 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 178 | chmod 755 "$TARGET/sbin/start-stop-daemon" 179 | 180 | setup_dselect_method apt 181 | 182 | smallyes '' | 183 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 184 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) | 185 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING 186 | 187 | baseprog=0 188 | bases="$(set -- $base; echo $#)" 189 | 190 | info UNPACKBASE "Unpacking the base system..." 191 | 192 | setup_available $required $base 193 | done_predeps= 194 | while predep=$(get_next_predep); do 195 | # We have to resolve dependencies of pre-dependencies manually because 196 | # dpkg --predep-package doesn't handle this. 197 | predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") 198 | # XXX: progress is tricky due to how dpkg_progress works 199 | # -- cjwatson 2009-07-29 200 | p; smallyes '' | 201 | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) 202 | base=$(without "$base" "$predep") 203 | done_predeps="$done_predeps $predep" 204 | done 205 | 206 | if [ -n "$base" ]; then 207 | smallyes '' | 208 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 209 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) | 210 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING 211 | 212 | info CONFBASE "Configuring the base system..." 213 | 214 | smallyes '' | 215 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \ 216 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) | 217 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING 218 | fi 219 | 220 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 221 | rm -f "$TARGET/usr/sbin/policy-rc.d" 222 | 223 | progress $bases $bases CONFBASE "Configuring base system" 224 | info BASESUCCESS "Base system installed successfully." 225 | } 226 | -------------------------------------------------------------------------------- /cf/bootstrap/artful: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/ascii: -------------------------------------------------------------------------------- 1 | ceres -------------------------------------------------------------------------------- /cf/bootstrap/bartholomea: -------------------------------------------------------------------------------- 1 | aequorea -------------------------------------------------------------------------------- /cf/bootstrap/beowulf: -------------------------------------------------------------------------------- 1 | ceres -------------------------------------------------------------------------------- /cf/bootstrap/bionic: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/bookworm: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /cf/bootstrap/breezy: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | finddebs_style from-indices 5 | variants - buildd 6 | force_md5 7 | 8 | case $ARCH in 9 | alpha|ia64) LIBC="libc6.1" ;; 10 | *) LIBC="libc6" ;; 11 | esac 12 | 13 | work_out_debs () { 14 | required="$(get_debs Priority: required)" 15 | 16 | if doing_variant -; then 17 | #required="$required $(get_debs Priority: important)" 18 | # ^^ should be getting debconf here somehow maybe 19 | base="$(get_debs Priority: important)" 20 | elif doing_variant buildd; then 21 | # TODO: add Build-Essential: yes extraoverrides 22 | #base="$(get_debs Build-Essential: yes)" 23 | 24 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; } 25 | 26 | base="apt binutils cpio cpp cpp-4.0 dpkg-dev g++ g++-4.0 gcc gcc-4.0 gcc-4.0-base ${LIBC}-dev libdb4.2 libgdbm3 libstdc++6 libstdc++6-4.0-dev linux-kernel-headers make patch perl perl-modules" 27 | 28 | add ia64 base "libunwind7-dev" 29 | add sparc base "lib64gcc1" 30 | add sparc base "libc6-dev-sparc64" 31 | add sparc base "libc6-sparc64" 32 | fi 33 | } 34 | 35 | first_stage_install () { 36 | extract $required 37 | 38 | mkdir -p "$TARGET/var/lib/dpkg" 39 | : >"$TARGET/var/lib/dpkg/status" 40 | echo >"$TARGET/var/lib/dpkg/available" 41 | 42 | setup_etc 43 | if [ ! -e "$TARGET/etc/fstab" ]; then 44 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 45 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 46 | fi 47 | 48 | setup_devices 49 | 50 | x_feign_install () { 51 | local pkg="$1" 52 | local deb="$(debfor $pkg)" 53 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 54 | 55 | mkdir -p "$TARGET/var/lib/dpkg/info" 56 | 57 | echo \ 58 | "Package: $pkg 59 | Version: $ver 60 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 61 | 62 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 63 | } 64 | 65 | x_feign_install dpkg 66 | } 67 | 68 | second_stage_install () { 69 | x_core_install () { 70 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 71 | } 72 | 73 | p () { 74 | baseprog="$(($baseprog + ${1:-1}))" 75 | } 76 | 77 | setup_proc 78 | umount_on_exit /dev/.static/dev 79 | umount_on_exit /dev 80 | in_target /sbin/ldconfig 81 | 82 | DEBIAN_FRONTEND=noninteractive 83 | DEBCONF_NONINTERACTIVE_SEEN=true 84 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 85 | 86 | baseprog=0 87 | bases=7 88 | 89 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 90 | info INSTCORE "Installing core packages..." 91 | 92 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 93 | ln -sf mawk "$TARGET/usr/bin/awk" 94 | x_core_install base-files base-passwd 95 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 96 | x_core_install dpkg 97 | 98 | if [ ! -e "$TARGET/etc/localtime" ]; then 99 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 100 | fi 101 | 102 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 103 | x_core_install $LIBC 104 | 105 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 106 | x_core_install perl-base 107 | 108 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 109 | rm "$TARGET/usr/bin/awk" 110 | x_core_install mawk 111 | 112 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 113 | if doing_variant -; then 114 | x_core_install debconf 115 | fi 116 | 117 | baseprog=0 118 | bases=$(set -- $required; echo $#) 119 | 120 | info UNPACKREQ "Unpacking required packages..." 121 | 122 | smallyes '' | 123 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 124 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | 125 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 126 | 127 | info CONFREQ "Configuring required packages..." 128 | 129 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 130 | echo \ 131 | "#!/bin/sh 132 | echo 133 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 134 | chmod 755 "$TARGET/sbin/start-stop-daemon" 135 | 136 | setup_dselect_method apt 137 | 138 | smallyes '' | 139 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 140 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | 141 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 142 | 143 | baseprog=0 144 | bases="$(set -- $base; echo $#)" 145 | 146 | info UNPACKBASE "Unpacking the base system..." 147 | 148 | smallyes '' | 149 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 150 | dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | 151 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 152 | 153 | info CONFBASE "Configuring the base system..." 154 | 155 | smallyes '' | 156 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \ 157 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | 158 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 159 | 160 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 161 | 162 | progress $bases $bases CONFBASE "Configuring base system" 163 | info BASESUCCESS "Base system installed successfully." 164 | } 165 | -------------------------------------------------------------------------------- /cf/bootstrap/bullseye: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /cf/bootstrap/buster: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /cf/bootstrap/ceres: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /cf/bootstrap/chimaera: -------------------------------------------------------------------------------- 1 | ceres -------------------------------------------------------------------------------- /cf/bootstrap/chromodoris: -------------------------------------------------------------------------------- 1 | aequorea -------------------------------------------------------------------------------- /cf/bootstrap/cosmic: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/daedalus: -------------------------------------------------------------------------------- 1 | ceres -------------------------------------------------------------------------------- /cf/bootstrap/dapper: -------------------------------------------------------------------------------- 1 | case $ARCH in 2 | amd64|i386|powerpc|sparc) 3 | default_mirror http://archive.ubuntu.com/ubuntu 4 | ;; 5 | *) 6 | default_mirror http://ports.ubuntu.com/ubuntu-ports 7 | ;; 8 | esac 9 | mirror_style release 10 | download_style apt 11 | finddebs_style from-indices 12 | variants - buildd 13 | force_md5 14 | 15 | case $ARCH in 16 | alpha|ia64) LIBC="libc6.1" ;; 17 | *) LIBC="libc6" ;; 18 | esac 19 | 20 | work_out_debs () { 21 | required="$(get_debs Priority: required)" 22 | 23 | if doing_variant -; then 24 | #required="$required $(get_debs Priority: important)" 25 | # ^^ should be getting debconf here somehow maybe 26 | base="$(get_debs Priority: important)" 27 | elif doing_variant buildd; then 28 | # TODO: add Build-Essential: yes extraoverrides 29 | #base="$(get_debs Build-Essential: yes)" 30 | 31 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; } 32 | 33 | base="apt binutils cpio cpp cpp-4.0 dpkg-dev g++ g++-4.0 gcc gcc-4.0 ${LIBC}-dev libgdbm3 libstdc++6 libstdc++6-4.0-dev linux-kernel-headers make patch perl perl-modules" 34 | 35 | add ia64 base "libunwind7-dev" 36 | add sparc base "lib64gcc1" 37 | add sparc base "libc6-dev-sparc64" 38 | add sparc base "libc6-sparc64" 39 | fi 40 | } 41 | 42 | first_stage_install () { 43 | extract $required 44 | 45 | mkdir -p "$TARGET/var/lib/dpkg" 46 | : >"$TARGET/var/lib/dpkg/status" 47 | : >"$TARGET/var/lib/dpkg/available" 48 | 49 | setup_etc 50 | if [ ! -e "$TARGET/etc/fstab" ]; then 51 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 52 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 53 | fi 54 | 55 | setup_devices 56 | 57 | x_feign_install () { 58 | local pkg="$1" 59 | local deb="$(debfor $pkg)" 60 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 61 | 62 | mkdir -p "$TARGET/var/lib/dpkg/info" 63 | 64 | echo \ 65 | "Package: $pkg 66 | Version: $ver 67 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 68 | 69 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 70 | } 71 | 72 | x_feign_install dpkg 73 | } 74 | 75 | second_stage_install () { 76 | x_core_install () { 77 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 78 | } 79 | 80 | p () { 81 | baseprog="$(($baseprog + ${1:-1}))" 82 | } 83 | 84 | setup_proc 85 | in_target /sbin/ldconfig 86 | 87 | DEBIAN_FRONTEND=noninteractive 88 | DEBCONF_NONINTERACTIVE_SEEN=true 89 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 90 | 91 | baseprog=0 92 | bases=7 93 | 94 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 95 | info INSTCORE "Installing core packages..." 96 | 97 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 98 | ln -sf mawk "$TARGET/usr/bin/awk" 99 | x_core_install base-files base-passwd 100 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 101 | x_core_install dpkg 102 | 103 | if [ ! -e "$TARGET/etc/localtime" ]; then 104 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 105 | fi 106 | 107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 108 | x_core_install $LIBC 109 | 110 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 111 | x_core_install perl-base 112 | 113 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 114 | rm "$TARGET/usr/bin/awk" 115 | x_core_install mawk 116 | 117 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 118 | if doing_variant -; then 119 | x_core_install debconf 120 | fi 121 | 122 | baseprog=0 123 | bases=$(set -- $required; echo $#) 124 | 125 | info UNPACKREQ "Unpacking required packages..." 126 | 127 | smallyes '' | 128 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 129 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | 130 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 131 | 132 | info CONFREQ "Configuring required packages..." 133 | 134 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 135 | echo \ 136 | "#!/bin/sh 137 | echo 138 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 139 | chmod 755 "$TARGET/sbin/start-stop-daemon" 140 | 141 | setup_dselect_method apt 142 | 143 | smallyes '' | 144 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 145 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | 146 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 147 | 148 | baseprog=0 149 | bases="$(set -- $base; echo $#)" 150 | 151 | info UNPACKBASE "Unpacking the base system..." 152 | 153 | smallyes '' | 154 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 155 | dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | 156 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 157 | 158 | info CONFBASE "Configuring the base system..." 159 | 160 | smallyes '' | 161 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \ 162 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | 163 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 164 | 165 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 166 | 167 | progress $bases $bases CONFBASE "Configuring base system" 168 | info BASESUCCESS "Base system installed successfully." 169 | } 170 | -------------------------------------------------------------------------------- /cf/bootstrap/dasyatis: -------------------------------------------------------------------------------- 1 | aequorea -------------------------------------------------------------------------------- /cf/bootstrap/debian-common: -------------------------------------------------------------------------------- 1 | if doing_variant fakechroot; then 2 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 3 | fi 4 | 5 | case $ARCH in 6 | alpha|ia64) LIBC="libc6.1" ;; 7 | kfreebsd-*) LIBC="libc0.1" ;; 8 | hurd-*) LIBC="libc0.3" ;; 9 | *) LIBC="libc6" ;; 10 | esac 11 | 12 | work_out_debs () { 13 | required="$(get_debs Priority: required)" 14 | 15 | if doing_variant - || doing_variant fakechroot; then 16 | #required="$required $(get_debs Priority: important)" 17 | # ^^ should be getting debconf here somehow maybe 18 | base="$(get_debs Priority: important)" 19 | elif doing_variant buildd; then 20 | base="apt build-essential" 21 | elif doing_variant minbase; then 22 | base="apt" 23 | fi 24 | 25 | if doing_variant fakechroot; then 26 | # ldd.fake needs binutils 27 | required="$required binutils" 28 | fi 29 | 30 | case $MIRRORS in 31 | https://*) 32 | case "$CODENAME" in 33 | # apt-transport-https exists from lenny to stretch 34 | lenny|squeeze|wheezy|jessie*|stretch) 35 | base="$base apt-transport-https ca-certificates" 36 | ;; 37 | *) 38 | base="$base ca-certificates" 39 | ;; 40 | esac 41 | ;; 42 | esac 43 | } 44 | 45 | first_stage_install () { 46 | case "$CODENAME" in 47 | # "merged-usr" blacklist for past releases 48 | etch*|lenny|squeeze|wheezy|jessie*) 49 | [ -z "$MERGED_USR" ] && MERGED_USR="no" 50 | ;; 51 | *) 52 | # see https://bugs.debian.org/838388 53 | EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" 54 | ;; 55 | esac 56 | 57 | if [ "$CODENAME" = "stretch" ] && [ -z "$MERGED_USR" ]; then 58 | MERGED_USR="no" 59 | fi 60 | 61 | setup_merged_usr 62 | extract $required 63 | 64 | mkdir -p "$TARGET/var/lib/dpkg" 65 | : >"$TARGET/var/lib/dpkg/status" 66 | : >"$TARGET/var/lib/dpkg/available" 67 | 68 | setup_etc 69 | if [ ! -e "$TARGET/etc/fstab" ]; then 70 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 71 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 72 | fi 73 | 74 | setup_devices 75 | 76 | if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then 77 | setup_proc_symlink 78 | fi 79 | } 80 | 81 | second_stage_install () { 82 | in_target /bin/true 83 | 84 | setup_dynamic_devices 85 | 86 | x_feign_install () { 87 | local pkg="$1" 88 | local deb="$(debfor $pkg)" 89 | local ver="$(in_target dpkg-deb -f "$deb" Version)" 90 | 91 | mkdir -p "$TARGET/var/lib/dpkg/info" 92 | 93 | echo \ 94 | "Package: $pkg 95 | Version: $ver 96 | Maintainer: unknown 97 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 98 | 99 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 100 | } 101 | 102 | x_feign_install dpkg 103 | 104 | x_core_install () { 105 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 106 | } 107 | 108 | p () { 109 | baseprog="$(($baseprog + ${1:-1}))" 110 | } 111 | 112 | if ! doing_variant fakechroot; then 113 | setup_proc 114 | in_target /sbin/ldconfig 115 | fi 116 | 117 | DEBIAN_FRONTEND=noninteractive 118 | DEBCONF_NONINTERACTIVE_SEEN=true 119 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 120 | 121 | baseprog=0 122 | bases=7 123 | 124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 125 | info INSTCORE "Installing core packages..." 126 | 127 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 128 | ln -sf mawk "$TARGET/usr/bin/awk" 129 | x_core_install base-passwd 130 | x_core_install base-files 131 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 132 | x_core_install dpkg 133 | 134 | if [ ! -e "$TARGET/etc/localtime" ]; then 135 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 136 | fi 137 | 138 | if doing_variant fakechroot; then 139 | install_fakechroot_tools 140 | fi 141 | 142 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 143 | x_core_install $LIBC 144 | 145 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 146 | x_core_install perl-base 147 | 148 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 149 | rm "$TARGET/usr/bin/awk" 150 | x_core_install mawk 151 | 152 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 153 | if doing_variant -; then 154 | x_core_install debconf 155 | fi 156 | 157 | baseprog=0 158 | bases=$(set -- $required; echo $#) 159 | 160 | info UNPACKREQ "Unpacking required packages..." 161 | 162 | exec 7>&1 163 | 164 | smallyes '' | 165 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 166 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) | 167 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING 168 | 169 | info CONFREQ "Configuring required packages..." 170 | 171 | echo \ 172 | "#!/bin/sh 173 | exit 101" > "$TARGET/usr/sbin/policy-rc.d" 174 | chmod 755 "$TARGET/usr/sbin/policy-rc.d" 175 | 176 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 177 | echo \ 178 | "#!/bin/sh 179 | echo 180 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 181 | chmod 755 "$TARGET/sbin/start-stop-daemon" 182 | 183 | setup_dselect_method apt 184 | 185 | smallyes '' | 186 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 187 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) | 188 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING 189 | 190 | baseprog=0 191 | bases="$(set -- $base; echo $#)" 192 | 193 | info UNPACKBASE "Unpacking the base system..." 194 | 195 | setup_available $required $base 196 | done_predeps= 197 | while predep=$(get_next_predep); do 198 | # We have to resolve dependencies of pre-dependencies manually because 199 | # dpkg --predep-package doesn't handle this. 200 | predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") 201 | # XXX: progress is tricky due to how dpkg_progress works 202 | # -- cjwatson 2009-07-29 203 | p; smallyes '' | 204 | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) 205 | base=$(without "$base" "$predep") 206 | done_predeps="$done_predeps $predep" 207 | done 208 | 209 | if [ -n "$base" ]; then 210 | smallyes '' | 211 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 212 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) | 213 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING 214 | 215 | info CONFBASE "Configuring the base system..." 216 | 217 | smallyes '' | 218 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \ 219 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) | 220 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING 221 | fi 222 | 223 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 224 | rm -f "$TARGET/usr/sbin/policy-rc.d" 225 | 226 | progress $bases $bases CONFBASE "Configuring base system" 227 | info BASESUCCESS "Base system installed successfully." 228 | } 229 | -------------------------------------------------------------------------------- /cf/bootstrap/disco: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/edgy: -------------------------------------------------------------------------------- 1 | case $ARCH in 2 | amd64|i386|powerpc|sparc) 3 | default_mirror http://old-releases.ubuntu.com/ubuntu 4 | ;; 5 | *) 6 | default_mirror http://ports.ubuntu.com/ubuntu-ports 7 | ;; 8 | esac 9 | mirror_style release 10 | download_style apt 11 | finddebs_style from-indices 12 | variants - buildd fakechroot 13 | force_md5 14 | 15 | if doing_variant fakechroot; then 16 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 17 | fi 18 | 19 | case $ARCH in 20 | alpha|ia64) LIBC="libc6.1" ;; 21 | *) LIBC="libc6" ;; 22 | esac 23 | 24 | work_out_debs () { 25 | required="$(get_debs Priority: required)" 26 | 27 | if doing_variant -; then 28 | #required="$required $(get_debs Priority: important)" 29 | # ^^ should be getting debconf here somehow maybe 30 | base="$(get_debs Priority: important)" 31 | elif doing_variant buildd; then 32 | # TODO: add Build-Essential: yes extraoverrides 33 | #base="$(get_debs Build-Essential: yes)" 34 | 35 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; } 36 | 37 | base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules" 38 | 39 | add ia64 base "libunwind7-dev" 40 | add sparc base "lib64gcc1" 41 | add sparc base "libc6-dev-sparc64" 42 | add sparc base "libc6-sparc64" 43 | elif doing_variant fakechroot; then 44 | base="apt" 45 | fi 46 | } 47 | 48 | first_stage_install () { 49 | extract $required 50 | 51 | mkdir -p "$TARGET/var/lib/dpkg" 52 | : >"$TARGET/var/lib/dpkg/status" 53 | : >"$TARGET/var/lib/dpkg/available" 54 | 55 | setup_etc 56 | if [ ! -e "$TARGET/etc/fstab" ]; then 57 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 58 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 59 | fi 60 | 61 | setup_devices 62 | 63 | x_feign_install () { 64 | local pkg="$1" 65 | local deb="$(debfor $pkg)" 66 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 67 | 68 | mkdir -p "$TARGET/var/lib/dpkg/info" 69 | 70 | echo \ 71 | "Package: $pkg 72 | Version: $ver 73 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 74 | 75 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 76 | } 77 | 78 | x_feign_install dpkg 79 | } 80 | 81 | second_stage_install () { 82 | x_core_install () { 83 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 84 | } 85 | 86 | p () { 87 | baseprog="$(($baseprog + ${1:-1}))" 88 | } 89 | 90 | if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then 91 | setup_proc_symlink 92 | else 93 | setup_proc 94 | in_target /sbin/ldconfig 95 | fi 96 | 97 | DEBIAN_FRONTEND=noninteractive 98 | DEBCONF_NONINTERACTIVE_SEEN=true 99 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 100 | 101 | baseprog=0 102 | bases=7 103 | 104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 105 | info INSTCORE "Installing core packages..." 106 | 107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 108 | ln -sf mawk "$TARGET/usr/bin/awk" 109 | x_core_install base-files base-passwd 110 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 111 | x_core_install dpkg 112 | 113 | if [ ! -e "$TARGET/etc/localtime" ]; then 114 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 115 | fi 116 | 117 | if doing_variant fakechroot; then 118 | install_fakechroot_tools 119 | fi 120 | 121 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 122 | x_core_install $LIBC 123 | 124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 125 | x_core_install perl-base 126 | 127 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 128 | rm "$TARGET/usr/bin/awk" 129 | x_core_install mawk 130 | 131 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 132 | if doing_variant -; then 133 | x_core_install debconf 134 | fi 135 | 136 | baseprog=0 137 | bases=$(set -- $required; echo $#) 138 | 139 | info UNPACKREQ "Unpacking required packages..." 140 | 141 | smallyes '' | 142 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 143 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | 144 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 145 | 146 | info CONFREQ "Configuring required packages..." 147 | 148 | if doing_variant fakechroot; then 149 | # fix initscripts postinst (no mounting possible, and wrong if condition) 150 | sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst" 151 | fi 152 | 153 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 154 | echo \ 155 | "#!/bin/sh 156 | echo 157 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 158 | chmod 755 "$TARGET/sbin/start-stop-daemon" 159 | 160 | setup_dselect_method apt 161 | 162 | smallyes '' | 163 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 164 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | 165 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 166 | 167 | baseprog=0 168 | bases="$(set -- $base; echo $#)" 169 | 170 | info UNPACKBASE "Unpacking the base system..." 171 | 172 | smallyes '' | 173 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 174 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | 175 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 176 | 177 | info CONFBASE "Configuring the base system..." 178 | 179 | smallyes '' | 180 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \ 181 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | 182 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 183 | 184 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 185 | 186 | progress $bases $bases CONFBASE "Configuring base system" 187 | info BASESUCCESS "Base system installed successfully." 188 | } 189 | -------------------------------------------------------------------------------- /cf/bootstrap/eoan: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/etch: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | finddebs_style from-indices 4 | variants - buildd fakechroot minbase 5 | default_mirror http://archive.debian.org/debian 6 | keyring /usr/share/keyrings/debian-archive-removed-keys.gpg 7 | force_md5 8 | 9 | # include common settings 10 | if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then 11 | . "$DEBOOTSTRAP_DIR/scripts/debian-common" 12 | elif [ -e /debootstrap/debian-common ]; then 13 | . /debootstrap/debian-common 14 | elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then 15 | . "$DEBOOTSTRAP_DIR/debian-common" 16 | else 17 | error 1 NOCOMMON "File not found: debian-common" 18 | fi 19 | -------------------------------------------------------------------------------- /cf/bootstrap/etch-m68k: -------------------------------------------------------------------------------- 1 | etch -------------------------------------------------------------------------------- /cf/bootstrap/feisty: -------------------------------------------------------------------------------- 1 | case $ARCH in 2 | amd64|i386|powerpc|sparc) 3 | default_mirror http://old-releases.ubuntu.com/ubuntu 4 | ;; 5 | *) 6 | default_mirror http://ports.ubuntu.com/ubuntu-ports 7 | ;; 8 | esac 9 | mirror_style release 10 | download_style apt 11 | finddebs_style from-indices 12 | variants - buildd fakechroot 13 | 14 | if doing_variant fakechroot; then 15 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 16 | fi 17 | 18 | case $ARCH in 19 | alpha|ia64) LIBC="libc6.1" ;; 20 | *) LIBC="libc6" ;; 21 | esac 22 | 23 | work_out_debs () { 24 | required="$(get_debs Priority: required)" 25 | 26 | if doing_variant -; then 27 | #required="$required $(get_debs Priority: important)" 28 | # ^^ should be getting debconf here somehow maybe 29 | base="$(get_debs Priority: important)" 30 | elif doing_variant buildd; then 31 | # TODO: add Build-Essential: yes extraoverrides 32 | #base="$(get_debs Build-Essential: yes)" 33 | 34 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; } 35 | 36 | base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules" 37 | 38 | add ia64 base "libunwind7-dev" 39 | add sparc base "lib64gcc1" 40 | add sparc base "libc6-dev-sparc64" 41 | add sparc base "libc6-sparc64" 42 | elif doing_variant fakechroot; then 43 | base="apt" 44 | fi 45 | } 46 | 47 | first_stage_install () { 48 | extract $required 49 | 50 | mkdir -p "$TARGET/var/lib/dpkg" 51 | : >"$TARGET/var/lib/dpkg/status" 52 | : >"$TARGET/var/lib/dpkg/available" 53 | 54 | setup_etc 55 | if [ ! -e "$TARGET/etc/fstab" ]; then 56 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 57 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 58 | fi 59 | 60 | setup_devices 61 | 62 | x_feign_install () { 63 | local pkg="$1" 64 | local deb="$(debfor $pkg)" 65 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 66 | 67 | mkdir -p "$TARGET/var/lib/dpkg/info" 68 | 69 | echo \ 70 | "Package: $pkg 71 | Version: $ver 72 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 73 | 74 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 75 | } 76 | 77 | x_feign_install dpkg 78 | } 79 | 80 | second_stage_install () { 81 | x_core_install () { 82 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 83 | } 84 | 85 | p () { 86 | baseprog="$(($baseprog + ${1:-1}))" 87 | } 88 | 89 | if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then 90 | setup_proc_symlink 91 | else 92 | setup_proc 93 | in_target /sbin/ldconfig 94 | fi 95 | 96 | DEBIAN_FRONTEND=noninteractive 97 | DEBCONF_NONINTERACTIVE_SEEN=true 98 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 99 | 100 | baseprog=0 101 | bases=7 102 | 103 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 104 | info INSTCORE "Installing core packages..." 105 | 106 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 107 | ln -sf mawk "$TARGET/usr/bin/awk" 108 | x_core_install base-files base-passwd 109 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 110 | x_core_install dpkg 111 | 112 | if [ ! -e "$TARGET/etc/localtime" ]; then 113 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 114 | fi 115 | 116 | if doing_variant fakechroot; then 117 | install_fakechroot_tools 118 | fi 119 | 120 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 121 | x_core_install $LIBC 122 | 123 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 124 | x_core_install perl-base 125 | 126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 127 | rm "$TARGET/usr/bin/awk" 128 | x_core_install mawk 129 | 130 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 131 | if doing_variant -; then 132 | x_core_install debconf 133 | fi 134 | 135 | baseprog=0 136 | bases=$(set -- $required; echo $#) 137 | 138 | info UNPACKREQ "Unpacking required packages..." 139 | 140 | smallyes '' | 141 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 142 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | 143 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 144 | 145 | info CONFREQ "Configuring required packages..." 146 | 147 | if doing_variant fakechroot; then 148 | # fix initscripts postinst (no mounting possible, and wrong if condition) 149 | sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst" 150 | 151 | # kill libdevmapper postinst; it tries to create /dev/mapper/ 152 | rm "$TARGET/var/lib/dpkg/info/libdevmapper1"*.postinst 153 | fi 154 | 155 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 156 | echo \ 157 | "#!/bin/sh 158 | echo 159 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 160 | chmod 755 "$TARGET/sbin/start-stop-daemon" 161 | 162 | setup_dselect_method apt 163 | 164 | smallyes '' | 165 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 166 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | 167 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 168 | 169 | baseprog=0 170 | bases="$(set -- $base; echo $#)" 171 | 172 | info UNPACKBASE "Unpacking the base system..." 173 | 174 | smallyes '' | 175 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 176 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | 177 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 178 | 179 | info CONFBASE "Configuring the base system..." 180 | 181 | smallyes '' | 182 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \ 183 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | 184 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 185 | 186 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 187 | 188 | progress $bases $bases CONFBASE "Configuring base system" 189 | info BASESUCCESS "Base system installed successfully." 190 | } 191 | -------------------------------------------------------------------------------- /cf/bootstrap/focal: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/groovy: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/gutsy: -------------------------------------------------------------------------------- 1 | case $ARCH in 2 | amd64|i386) 3 | case $SUITE in 4 | gutsy|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|precise|quantal|raring|saucy|utopic|vivid|wily|yakkety|zesty) 5 | default_mirror http://old-releases.ubuntu.com/ubuntu 6 | ;; 7 | *) 8 | default_mirror http://archive.ubuntu.com/ubuntu 9 | ;; 10 | esac 11 | ;; 12 | sparc) 13 | case $SUITE in 14 | gutsy) 15 | default_mirror http://old-releases.ubuntu.com/ubuntu 16 | ;; 17 | *) 18 | default_mirror http://ports.ubuntu.com/ubuntu-ports 19 | ;; 20 | esac 21 | ;; 22 | *) 23 | default_mirror http://ports.ubuntu.com/ubuntu-ports 24 | ;; 25 | esac 26 | mirror_style release 27 | download_style apt 28 | finddebs_style from-indices 29 | variants - buildd fakechroot minbase 30 | keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg 31 | 32 | if doing_variant fakechroot; then 33 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 34 | fi 35 | 36 | case $ARCH in 37 | alpha|ia64) LIBC="libc6.1" ;; 38 | kfreebsd-*) LIBC="libc0.1" ;; 39 | hurd-*) LIBC="libc0.3" ;; 40 | *) LIBC="libc6" ;; 41 | esac 42 | 43 | work_out_debs () { 44 | required="$(get_debs Priority: required)" 45 | 46 | if doing_variant - || doing_variant fakechroot; then 47 | #required="$required $(get_debs Priority: important)" 48 | # ^^ should be getting debconf here somehow maybe 49 | base="$(get_debs Priority: important)" 50 | elif doing_variant buildd; then 51 | base="apt build-essential" 52 | elif doing_variant minbase; then 53 | base="apt" 54 | fi 55 | 56 | if doing_variant fakechroot; then 57 | # ldd.fake needs binutils 58 | required="$required binutils" 59 | fi 60 | 61 | case $MIRRORS in 62 | https://*) 63 | case "$CODENAME" in 64 | gutsy|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty) 65 | base="$base apt-transport-https ca-certificates" 66 | ;; 67 | *) 68 | base="$base ca-certificates" 69 | ;; 70 | esac 71 | ;; 72 | esac 73 | } 74 | 75 | first_stage_install () { 76 | case "$CODENAME" in 77 | # "merged-usr" blacklist for past releases 78 | gutsy|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic) 79 | [ -z "$MERGED_USR" ] && MERGED_USR="no" 80 | ;; 81 | *) 82 | # see https://bugs.debian.org/838388 83 | EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" 84 | ;; 85 | esac 86 | 87 | setup_merged_usr 88 | extract $required 89 | 90 | mkdir -p "$TARGET/var/lib/dpkg" 91 | : >"$TARGET/var/lib/dpkg/status" 92 | : >"$TARGET/var/lib/dpkg/available" 93 | 94 | setup_etc 95 | if [ ! -e "$TARGET/etc/fstab" ]; then 96 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 97 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 98 | fi 99 | 100 | setup_devices 101 | 102 | if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then 103 | setup_proc_symlink 104 | fi 105 | } 106 | 107 | second_stage_install () { 108 | in_target /bin/true 109 | 110 | setup_dynamic_devices 111 | 112 | x_feign_install () { 113 | local pkg="$1" 114 | local deb="$(debfor $pkg)" 115 | local ver="$(in_target dpkg-deb -f "$deb" Version)" 116 | 117 | mkdir -p "$TARGET/var/lib/dpkg/info" 118 | 119 | echo \ 120 | "Package: $pkg 121 | Version: $ver 122 | Maintainer: unknown 123 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 124 | 125 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 126 | } 127 | 128 | x_feign_install dpkg 129 | 130 | x_core_install () { 131 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 132 | } 133 | 134 | p () { 135 | baseprog="$(($baseprog + ${1:-1}))" 136 | } 137 | 138 | if ! doing_variant fakechroot; then 139 | setup_proc 140 | in_target /sbin/ldconfig 141 | fi 142 | 143 | DEBIAN_FRONTEND=noninteractive 144 | DEBCONF_NONINTERACTIVE_SEEN=true 145 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 146 | 147 | baseprog=0 148 | bases=7 149 | 150 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 151 | info INSTCORE "Installing core packages..." 152 | 153 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 154 | ln -sf mawk "$TARGET/usr/bin/awk" 155 | x_core_install base-passwd 156 | x_core_install base-files 157 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 158 | x_core_install dpkg 159 | 160 | if [ ! -e "$TARGET/etc/localtime" ]; then 161 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 162 | fi 163 | 164 | if doing_variant fakechroot; then 165 | install_fakechroot_tools 166 | fi 167 | 168 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 169 | x_core_install $LIBC 170 | 171 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 172 | x_core_install perl-base 173 | 174 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 175 | rm "$TARGET/usr/bin/awk" 176 | x_core_install mawk 177 | 178 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 179 | if doing_variant -; then 180 | x_core_install debconf 181 | fi 182 | 183 | baseprog=0 184 | bases=$(set -- $required; echo $#) 185 | 186 | info UNPACKREQ "Unpacking required packages..." 187 | 188 | exec 7>&1 189 | 190 | smallyes '' | 191 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 192 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) | 193 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING 194 | 195 | info CONFREQ "Configuring required packages..." 196 | 197 | if doing_variant fakechroot && [ -e "$TARGET/var/lib/dpkg/info/initscripts.postinst" ] 198 | then 199 | # fix initscripts postinst (no mounting possible, and wrong if condition) 200 | sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst" 201 | fi 202 | 203 | echo \ 204 | "#!/bin/sh 205 | exit 101" > "$TARGET/usr/sbin/policy-rc.d" 206 | chmod 755 "$TARGET/usr/sbin/policy-rc.d" 207 | 208 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 209 | echo \ 210 | "#!/bin/sh 211 | echo 212 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 213 | chmod 755 "$TARGET/sbin/start-stop-daemon" 214 | 215 | if [ -x "$TARGET/sbin/initctl" ]; then 216 | mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL" 217 | echo \ 218 | "#!/bin/sh 219 | if [ \"\$1\" = version ]; then exec /sbin/initctl.REAL \"\$@\"; fi 220 | echo 221 | echo \"Warning: Fake initctl called, doing nothing\"" > "$TARGET/sbin/initctl" 222 | chmod 755 "$TARGET/sbin/initctl" 223 | fi 224 | 225 | setup_dselect_method apt 226 | 227 | smallyes '' | 228 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 229 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) | 230 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING 231 | 232 | baseprog=0 233 | bases="$(set -- $base; echo $#)" 234 | 235 | info UNPACKBASE "Unpacking the base system..." 236 | 237 | setup_available $required $base 238 | done_predeps= 239 | while predep=$(get_next_predep); do 240 | # We have to resolve dependencies of pre-dependencies manually because 241 | # dpkg --predep-package doesn't handle this. 242 | predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") 243 | # XXX: progress is tricky due to how dpkg_progress works 244 | # -- cjwatson 2009-07-29 245 | p; smallyes '' | 246 | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) 247 | base=$(without "$base" "$predep") 248 | done_predeps="$done_predeps $predep" 249 | done 250 | 251 | if [ -n "$base" ]; then 252 | smallyes '' | 253 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 254 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) | 255 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING 256 | 257 | info CONFBASE "Configuring the base system..." 258 | 259 | smallyes '' | 260 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \ 261 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) | 262 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING 263 | fi 264 | 265 | if [ -x "$TARGET/sbin/initctl.REAL" ]; then 266 | mv "$TARGET/sbin/initctl.REAL" "$TARGET/sbin/initctl" 267 | fi 268 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 269 | rm -f "$TARGET/usr/sbin/policy-rc.d" 270 | 271 | progress $bases $bases CONFBASE "Configuring base system" 272 | info BASESUCCESS "Base system installed successfully." 273 | } 274 | -------------------------------------------------------------------------------- /cf/bootstrap/hardy: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/hirsute: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/hoary: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | 5 | case $ARCH in 6 | ia64) LIBC="libc6.1" ;; 7 | *) LIBC="libc6" ;; 8 | esac 9 | 10 | work_out_debs () { 11 | 12 | required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-iconv-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libpopt0 login makedev mawk mount ncurses-base ncurses-bin passwd perl-base procps python-minimal python2.4-minimal sed slang1a-utf8 lsb-base initscripts sysvinit sysv-rc tar util-linux zlib1g whiptail libgcc1 gcc-3.3-base libstdc++5" 13 | 14 | base="adduser alsa-base alsa-utils apt apt-utils aptitude at base-config bind9-host bsdmainutils bzip2 console-common console-data console-tools cpio cramfsprogs cron dash dhcp3-client dhcp3-common discover1 discover1-data dmsetup dnsutils dosfstools ed eject ethtool evms evms-ncurses fdutils file ftp gettext-base gnupg grepmap groff-base hdparm hotplug ifrename ifupdown info initrd-tools iproute iptables iputils-arping iputils-ping iputils-tracepath jfsutils klogd less libasound2 libbz2-1.0 libconsole libdb4.2 libdevmapper1.00 libdiscover1 libdns16 libevms-2.5 libfribidi0 libgc1 libgcrypt11 libgdbm3 libgnutls11 libgpg-error0 libgpmg1 libidn11 libisc7 libiw27 libldap2 liblockfile1 liblwres1 liblzo1 libmagic1 libncursesw5 libopencdk8 libparted1.6-12 libpcap0.8 libreiserfs0.3-0 libsasl2 libsasl2-modules libsigc++-1.2-5c102 libssl0.9.7 libtasn1-2 libusb-0.1-4 libwrap0 locales logrotate lsb-release lshw lsof lvm-common lvm10 lvm2 mailx man-db manpages mdadm mii-diag mime-support module-init-tools mtr-tiny mutt nano net-tools netbase netcat netkit-inetd ntp ntpdate openssh-client parted pciutils popularity-contest postfix postfix-tls ppp pppconfig pppoeconf psmisc python python2.4 reiser4progs reiserfsprogs reportbug rsync strace sudo sysklogd tcpd tcpdump telnet time ubuntu-base ubuntu-keyring udev usbutils vim vim-common w3m wget wireless-tools xfsprogs" 15 | 16 | without_package () { 17 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 18 | } 19 | subst_package () { 20 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 21 | } 22 | 23 | case $ARCH in 24 | "i386") 25 | required="$required libc6 libc6-i686" 26 | base="$base dmidecode libelfg0 ltrace memtest86+ libreadline4" 27 | ;; 28 | "powerpc") 29 | required="$required libc6 libreadline4" 30 | base="$base hfsplus hfsutils libelfg0 libhfsp0 ltrace mac-fdisk pmac-fdisk powerpc-utils" 31 | ;; 32 | "amd64") 33 | required="$required libc6" 34 | base="$base dmidecode libelfg0 ltrace memtest86+ libreadline4" 35 | ;; 36 | "ia64") 37 | required="$required libc6.1 libunwind7" 38 | base="$base dmidecode libreadline4" 39 | ;; 40 | "sparc") 41 | required="$required libc6" 42 | base="$base lib64gcc1 libc6-sparc64 libreadline4" 43 | ;; 44 | *) 45 | # who knows? 46 | ;; 47 | esac 48 | } 49 | 50 | install_debs () { 51 | first_stage_install 52 | second_stage_install 53 | } 54 | 55 | first_stage_install () { 56 | extract $required 57 | 58 | mkdir -p "$TARGET/var/lib/dpkg" 59 | : >"$TARGET/var/lib/dpkg/status" 60 | echo >"$TARGET/var/lib/dpkg/available" 61 | 62 | setup_etc 63 | if [ ! -e "$TARGET/etc/fstab" ]; then 64 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 65 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 66 | fi 67 | 68 | setup_devices 69 | 70 | x_feign_install () { 71 | local pkg="$1" 72 | local deb="$(debfor $pkg)" 73 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 74 | 75 | mkdir -p "$TARGET/var/lib/dpkg/info" 76 | 77 | echo \ 78 | "Package: $pkg 79 | Version: $ver 80 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 81 | 82 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 83 | } 84 | 85 | x_feign_install dpkg 86 | } 87 | 88 | second_stage_install () { 89 | x_core_install () { 90 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 91 | } 92 | p () { 93 | baseprog="$(($baseprog + ${1:-1}))" 94 | } 95 | 96 | DEBIAN_FRONTEND=noninteractive 97 | DEBCONF_NONINTERACTIVE_SEEN=true 98 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 99 | 100 | baseprog=0 101 | bases=7 102 | 103 | setup_proc 104 | umount_on_exit /.dev 105 | umount_on_exit /dev 106 | in_target /sbin/ldconfig 107 | 108 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 109 | info INSTCORE "Installing core packages..." 110 | 111 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 112 | ln -sf mawk "$TARGET/usr/bin/awk" 113 | x_core_install base-files base-passwd 114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 115 | x_core_install dpkg 116 | 117 | if [ ! -e "$TARGET/etc/localtime" ]; then 118 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 119 | fi 120 | 121 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 122 | x_core_install $LIBC 123 | 124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 125 | x_core_install perl-base 126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 127 | rm "$TARGET/usr/bin/awk" 128 | x_core_install mawk 129 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 130 | x_core_install debconf 131 | 132 | baseprog=0 133 | bases="$(set -- $required; echo $#)" 134 | 135 | info UNPACKREQ "Unpacking required packages..." 136 | 137 | smallyes '' | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 138 | 139 | baseprog=0 140 | 141 | info CONFREQ "Configuring required packages..." 142 | 143 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 144 | echo \ 145 | "#!/bin/sh 146 | echo 147 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 148 | chmod 755 "$TARGET/sbin/start-stop-daemon" 149 | 150 | setup_dselect_method apt 151 | #on_exit "(in_target_nofail umount /dev/pts) || true" 152 | 153 | smallyes '' | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 154 | 155 | baseprog=0 156 | bases="$(set -- $base; echo $#)" 157 | 158 | info UNPACKBASE "Unpacking the base system..." 159 | 160 | smallyes '' | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 161 | 162 | baseprog=0 163 | 164 | info CONFBASE "Configuring the base system..." 165 | 166 | mv "$TARGET/usr/sbin/sendmail" "$TARGET/usr/sbin/sendmail.REAL" 167 | ln -s /bin/true "$TARGET/usr/sbin/sendmail" 168 | 169 | smallyes '' | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 170 | 171 | rm -f "$TARGET/usr/sbin/sendmail" 172 | mv "$TARGET/usr/sbin/sendmail.REAL" "$TARGET/usr/sbin/sendmail" 173 | 174 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 175 | 176 | progress $bases $bases CONFBASE "Configuring base system" 177 | info BASESUCCESS "Base system installed successfully." 178 | } 179 | 180 | -------------------------------------------------------------------------------- /cf/bootstrap/hoary.buildd: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | 5 | LIBC=libc6 6 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 7 | LIBC="libc6.1" 8 | fi 9 | 10 | work_out_debs () { 11 | required="base-files base-passwd bash bsdutils build-essential coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs fakeroot findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login lsb-base mawk mount ncurses-base ncurses-bin passwd perl-base pkgstriptranslations python-minimal python2.4-minimal sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g" 12 | 13 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules" 14 | 15 | without_package () { 16 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 17 | } 18 | subst_package () { 19 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 20 | } 21 | 22 | case $ARCH in 23 | "amd64") 24 | ;; 25 | "i386") 26 | ;; 27 | "powerpc") 28 | ;; 29 | "ia64") 30 | required="$(subst_package "libc6" "libc6.1" "$required")" 31 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 32 | base="$base libunwind7 libunwind7-dev" 33 | ;; 34 | 35 | # Unsupported architectures: 36 | "alpha") 37 | required="$(subst_package "libc6" "libc6.1" "$required")" 38 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 39 | ;; 40 | *) 41 | # who knows? 42 | ;; 43 | esac 44 | } 45 | 46 | install_debs () { 47 | first_stage_install 48 | second_stage_install 49 | } 50 | 51 | first_stage_install () { 52 | extract $required 53 | 54 | mkdir -p "$TARGET/var/lib/dpkg" 55 | : >"$TARGET/var/lib/dpkg/status" 56 | echo >"$TARGET/var/lib/dpkg/available" 57 | 58 | setup_etc 59 | if [ ! -e "$TARGET/etc/fstab" ]; then 60 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 61 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 62 | fi 63 | 64 | setup_devices 65 | 66 | x_feign_install () { 67 | local pkg="$1" 68 | local deb="$(debfor $pkg)" 69 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 70 | 71 | mkdir -p "$TARGET/var/lib/dpkg/info" 72 | 73 | echo \ 74 | "Package: $pkg 75 | Version: $ver 76 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 77 | 78 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 79 | } 80 | 81 | x_feign_install dpkg 82 | } 83 | 84 | second_stage_install () { 85 | x_core_install () { 86 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 87 | } 88 | p () { 89 | baseprog="$(($baseprog + ${1:-1}))" 90 | } 91 | 92 | DEBIAN_FRONTEND=noninteractive 93 | export DEBIAN_FRONTEND 94 | 95 | baseprog=0 96 | bases=40 97 | 98 | setup_proc 99 | in_target /sbin/ldconfig 100 | 101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 102 | info INSTCORE "Installing core packages..." 103 | 104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 105 | ln -sf mawk "$TARGET/usr/bin/awk" 106 | x_core_install base-files base-passwd 107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 108 | x_core_install dpkg 109 | 110 | if [ ! -e "$TARGET/etc/localtime" ]; then 111 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 112 | fi 113 | 114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 115 | x_core_install $LIBC 116 | 117 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 118 | x_core_install perl-base 119 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 120 | rm "$TARGET/usr/bin/awk" 121 | x_core_install mawk 122 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 123 | 124 | info UNPACKREQ "Unpacking required packages..." 125 | 126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #8 127 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 128 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #18 129 | 130 | info CONFREQ "Configuring required packages..." 131 | 132 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 133 | echo \ 134 | "#!/bin/sh 135 | echo 136 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 137 | chmod 755 "$TARGET/sbin/start-stop-daemon" 138 | 139 | setup_dselect_method apt 140 | #on_exit "in_target_nofail umount /dev/pts" 141 | 142 | p; progress $baseprog $bases INSTCORE "Installing core packages" #19 143 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 144 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #29 145 | 146 | info INSTCORE "Installing base packages..." 147 | 148 | p; progress $baseprog $bases INSTCORE "Installing core packages" #30 149 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 150 | 151 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 152 | 153 | p 9; progress $baseprog $bases INSTCORE "Installing core packages" #39 154 | 155 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 156 | 157 | progress $bases $bases INSTCORE "Installing core packages" #40 158 | info BASESUCCESS "Base system installed successfully." 159 | } 160 | -------------------------------------------------------------------------------- /cf/bootstrap/impish: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/intrepid: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/jaunty: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/jessie: -------------------------------------------------------------------------------- 1 | ceres -------------------------------------------------------------------------------- /cf/bootstrap/jessie-kfreebsd: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /cf/bootstrap/kali: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | finddebs_style from-indices 4 | variants - buildd fakechroot minbase 5 | keyring /usr/share/keyrings/kali-archive-keyring.gpg 6 | default_mirror http://http.kali.org/kali 7 | 8 | # include common settings 9 | if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then 10 | . "$DEBOOTSTRAP_DIR/scripts/debian-common" 11 | elif [ -e /debootstrap/debian-common ]; then 12 | . /debootstrap/debian-common 13 | elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then 14 | . "$DEBOOTSTRAP_DIR/debian-common" 15 | else 16 | error 1 NOCOMMON "File not found: debian-common" 17 | fi 18 | -------------------------------------------------------------------------------- /cf/bootstrap/kali-dev: -------------------------------------------------------------------------------- 1 | kali -------------------------------------------------------------------------------- /cf/bootstrap/kali-last-snapshot: -------------------------------------------------------------------------------- 1 | kali -------------------------------------------------------------------------------- /cf/bootstrap/kali-rolling: -------------------------------------------------------------------------------- 1 | kali -------------------------------------------------------------------------------- /cf/bootstrap/karmic: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/lenny: -------------------------------------------------------------------------------- 1 | etch -------------------------------------------------------------------------------- /cf/bootstrap/lucid: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/maverick: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/natty: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/oldoldstable: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /cf/bootstrap/oldstable: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /cf/bootstrap/oneiric: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/potato: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt var-state 3 | default_mirror http://archive.debian.org/debian 4 | keyring /usr/share/keyrings/debian-archive-removed-keys.gpg 5 | force_md5 6 | 7 | LIBC=libc6 8 | if [ "$ARCH" = alpha ]; then 9 | LIBC="libc6.1" 10 | fi 11 | 12 | work_out_debs () { 13 | required="base-files base-passwd bash bsdutils debconf-tiny debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname ldso libc6 libdb2 libgdbmg1 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libpopt0 libreadline4 libstdc++2.10 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-5.005-base perl-base procps sed shellutils slang1 sysklogd sysvinit tar textutils update util-linux whiptail" 14 | 15 | base="adduser ae apt base-config elvis-tiny fbset fdutils gettext-base console-data console-tools console-tools-libs libdb2 libwrap0 locales modconf netbase ftp ppp pppconfig pump tasksel tcpd textutils telnet xviddetect" 16 | 17 | without_package () { 18 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 19 | } 20 | 21 | case $ARCH in 22 | "alpha") 23 | required="$(without_package "libc6" "$required") libc6.1" 24 | ;; 25 | "i386") 26 | base="$base fdflush isapnptools lilo mbr pciutils pcmcia-cs psmisc setserial syslinux" 27 | ;; 28 | *) 29 | # other arches may have special needs not yet represented here 30 | # oh well, Potato is old 31 | esac 32 | } 33 | 34 | first_stage_install () { 35 | extract $required 36 | 37 | :> "$TARGET/var/lib/dpkg/status" 38 | echo > "$TARGET/var/lib/dpkg/available" 39 | 40 | setup_etc 41 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 42 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 43 | 44 | x_feign_install () { 45 | local pkg=$1 46 | local deb="$(debfor $pkg)" 47 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 48 | 49 | mkdir -p "$TARGET/var/lib/dpkg/info" 50 | 51 | echo \ 52 | "Package: $pkg 53 | Version: $ver 54 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 55 | 56 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 57 | } 58 | 59 | setup_devices 60 | 61 | x_feign_install dpkg 62 | 63 | if [ -e "$TARGET/usr/bin/perl-5.005.dist" ]; then 64 | mv "$TARGET/usr/bin/perl-5.005.dist" "$TARGET/usr/bin/perl-5.005" 65 | fi 66 | if [ ! -e "$TARGET/usr/bin/perl" ]; then 67 | ln -sf perl-5.005 "$TARGET/usr/bin/perl" 68 | fi 69 | } 70 | 71 | second_stage_install () { 72 | x_core_install () { 73 | in_target dpkg --force-depends --install $(debfor "$@") 74 | } 75 | 76 | export DEBIAN_FRONTEND=Noninteractive 77 | 78 | setup_proc 79 | ln "$TARGET/sbin/ldconfig.new" "$TARGET/sbin/ldconfig" 80 | in_target /sbin/ldconfig 81 | 82 | x_core_install base-files base-passwd ldso 83 | x_core_install dpkg 84 | 85 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 86 | x_core_install $LIBC 87 | 88 | smallyes '' | x_core_install perl-5.005-base 89 | x_core_install mawk 90 | x_core_install debconf-tiny 91 | 92 | in_target dpkg-preconfigure $(debfor $required $base) 93 | 94 | repeatn 5 in_target dpkg --force-depends --unpack $(debfor $required) 95 | 96 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 97 | cp "$TARGET/bin/true" "$TARGET/sbin/start-stop-daemon" 98 | 99 | setup_dselect_method apt 100 | 101 | in_target dpkg --configure --pending --force-configure-any --force-depends 102 | 103 | smallyes '' | repeatn 5 in_target dpkg --force-auto-select --force-overwrite --skip-same-version --install $(debfor $base) 104 | 105 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 106 | } 107 | -------------------------------------------------------------------------------- /cf/bootstrap/precise: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/quantal: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/raring: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/sarge: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | default_mirror http://archive.debian.org/debian 4 | keyring /usr/share/keyrings/debian-archive-removed-keys.gpg 5 | force_md5 6 | 7 | LIBC=libc6 8 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 9 | LIBC="libc6.1" 10 | fi 11 | 12 | work_out_debs () { 13 | 14 | required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libc6 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libperl5.8 libpopt0 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed slang1a-utf8 initscripts sysvinit sysv-rc tar util-linux whiptail libgcc1 gcc-3.3-base libstdc++5" 15 | 16 | base="adduser apt apt-utils libdb4.2 at base-config aptitude libsigc++-1.2-5c102 bsdmainutils console-common console-tools libconsole console-data cpio cron dhcp-client ed exim4 exim4-base exim4-config exim4-daemon-light libgcrypt11 libgnutls11 libgpg-error0 libopencdk8 libtasn1-2 fdutils gettext-base groff-base ifupdown info klogd libssl0.9.7 liblzo1 zlib1g liblockfile1 libpcre3 libwrap0 logrotate mailx man-db libgdbm3 manpages nano net-tools netbase netkit-inetd iputils-ping nvi ppp pppconfig pppoe pppoeconf libpcap0.7 sysklogd tasksel libtextwrap1 tcpd telnet libtext-iconv-perl wget" 17 | 18 | without_package () { 19 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 20 | } 21 | subst_package () { 22 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 23 | } 24 | 25 | IPFWTOOL=iptables 26 | 27 | case $ARCH in 28 | "alpha") 29 | required="$(subst_package "libc6" "libc6.1" "$required")" 30 | base="$base pciutils" 31 | IPFWTOOL="ipchains" 32 | ;; 33 | "arm") 34 | base="$base libgpmg1" 35 | IPFWTOOL="ipchains iptables" 36 | ;; 37 | "i386") 38 | required="$(without_package "libperl5.8" "$required")" 39 | base="$base pciutils psmisc" 40 | IPFWTOOL="ipchains iptables" 41 | ;; 42 | "ia64") 43 | required="$(subst_package "libc6" "libc6.1" "$required") libreadline4" 44 | base="$base elilo efibootmgr dosfstools libparted1.6-12 parted" 45 | ;; 46 | "m68k") 47 | required="$required libreadline4" 48 | base="$base atari-bootstrap atari-fdisk amiga-fdisk eject mac-fdisk pmac-fdisk-cross vmelilo" 49 | IPFWTOOL="ipchains" 50 | ;; 51 | "powerpc") 52 | required="$required libreadline4" 53 | base="$base mac-fdisk amiga-fdisk psmisc powerpc-utils pciutils hfsutils" 54 | IPFWTOOL="ipchains iptables" 55 | ;; 56 | "sparc") 57 | base="$base silo eject pciutils sparc-utils" 58 | IPFWTOOL="ipchains iptables" 59 | ;; 60 | "mips") 61 | base="$base dvhtool pciutils" 62 | ;; 63 | "mipsel") 64 | base="$base pciutils" 65 | ;; 66 | "hppa") 67 | base="$base palo pciutils" 68 | required="$(without_package "libstdc++2.10-glibc2.2" "$required")" 69 | ;; 70 | s390|s390x) 71 | # base-config depends on console-tools and console-data 72 | # so we can't exclude them although they are useless on s390 73 | base="$base s390-tools telnetd devfsd" 74 | base="$(without_package "console-tools-libs" "$base")" 75 | base="$(without_package "fdutils" "$base")" 76 | base="$(without_package "ppp" "$base")" 77 | base="$(without_package "pppconfig" "$base")" 78 | base="$(without_package "pppoe" "$base")" 79 | base="$(without_package "pppoeconf" "$base")" 80 | ;; 81 | sh*) 82 | base="$base libstdc++3 gcc-3.0-base" 83 | base="$(without_package "fdutils" "$base")" 84 | required="$required libgcc1" 85 | required="$(without_package "libstdc++2.10-glibc2.2" "$required")" 86 | ;; 87 | "amd64") 88 | base="$base pciutils psmisc" 89 | IPFWTOOL="iptables" 90 | ;; 91 | *) 92 | # who knows? 93 | ;; 94 | esac 95 | 96 | base="$base $IPFWTOOL" 97 | } 98 | 99 | first_stage_install () { 100 | extract $required 101 | 102 | mkdir -p "$TARGET/var/lib/dpkg" 103 | : >"$TARGET/var/lib/dpkg/status" 104 | echo >"$TARGET/var/lib/dpkg/available" 105 | 106 | setup_etc 107 | if [ ! -e "$TARGET/etc/fstab" ]; then 108 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 109 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 110 | fi 111 | 112 | setup_devices 113 | 114 | x_feign_install () { 115 | local pkg="$1" 116 | local deb="$(debfor $pkg)" 117 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 118 | 119 | mkdir -p "$TARGET/var/lib/dpkg/info" 120 | 121 | echo \ 122 | "Package: $pkg 123 | Version: $ver 124 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 125 | 126 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 127 | } 128 | 129 | x_feign_install dpkg 130 | } 131 | 132 | second_stage_install () { 133 | x_core_install () { 134 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 135 | } 136 | 137 | p () { 138 | baseprog="$(($baseprog + ${1:-1}))" 139 | } 140 | 141 | setup_proc 142 | in_target /sbin/ldconfig 143 | 144 | DEBIAN_FRONTEND=noninteractive 145 | DEBCONF_NONINTERACTIVE_SEEN=true 146 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 147 | 148 | baseprog=0 149 | bases=40 150 | 151 | p; progress $baseprog $bases INSTBASE "Installing base system" #1 152 | info INSTCORE "Installing core packages..." 153 | 154 | p; progress $baseprog $bases INSTBASE "Installing base system" #2 155 | ln -sf mawk "$TARGET/usr/bin/awk" 156 | x_core_install base-files base-passwd 157 | p; progress $baseprog $bases INSTBASE "Installing base system" #3 158 | x_core_install dpkg 159 | 160 | if [ ! -e "$TARGET/etc/localtime" ]; then 161 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 162 | fi 163 | 164 | p; progress $baseprog $bases INSTBASE "Installing base system" #4 165 | x_core_install $LIBC 166 | 167 | p; progress $baseprog $bases INSTBASE "Installing base system" #5 168 | x_core_install perl-base 169 | p; progress $baseprog $bases INSTBASE "Installing base system" #6 170 | rm "$TARGET/usr/bin/awk" 171 | x_core_install mawk 172 | p; progress $baseprog $bases INSTBASE "Installing base system" #7 173 | x_core_install debconf 174 | 175 | info UNPACKREQ "Unpacking required packages..." 176 | 177 | p; progress $baseprog $bases INSTBASE "Installing base system" #8 178 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 179 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18 180 | 181 | info CONFREQ "Configuring required packages..." 182 | 183 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 184 | echo \ 185 | "#!/bin/sh 186 | echo 187 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 188 | chmod 755 "$TARGET/sbin/start-stop-daemon" 189 | 190 | setup_dselect_method apt 191 | 192 | p; progress $baseprog $bases INSTBASE "Installing base system" #19 193 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 194 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 195 | 196 | # if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then 197 | # mkdir -p "$TARGET/etc/exim" 198 | # touch "$TARGET/etc/exim/exim.conf" 199 | # fi 200 | 201 | info INSTBASE "Installing base packages..." 202 | 203 | p; progress $baseprog $bases INSTBASE "Installing base system" #30 204 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 205 | 206 | rm -f "$TARGET/usr/sbin/sendmail" 207 | ln -sf /bin/true "$TARGET/usr/sbin/sendmail" 208 | 209 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 210 | 211 | rm -f "$TARGET/usr/sbin/sendmail" 212 | ln -sf exim4 "$TARGET/usr/sbin/sendmail" 213 | 214 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39 215 | 216 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 217 | 218 | progress $bases $bases INSTBASE "Installing base system" #40 219 | info BASESUCCESS "Base system installed successfully." 220 | } 221 | -------------------------------------------------------------------------------- /cf/bootstrap/sarge.buildd: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | force_md5 4 | 5 | LIBC=libc6 6 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 7 | LIBC="libc6.1" 8 | fi 9 | 10 | work_out_debs () { 11 | 12 | required="base-files base-passwd bash bsdutils coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login mawk mount ncurses-base ncurses-bin passwd perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g" 13 | 14 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules" 15 | 16 | without_package () { 17 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 18 | } 19 | subst_package () { 20 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 21 | } 22 | 23 | case $ARCH in 24 | "alpha") 25 | required="$(subst_package "libc6" "libc6.1" "$required")" 26 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 27 | ;; 28 | "arm") 29 | ;; 30 | "i386") 31 | ;; 32 | "ia64") 33 | required="$(subst_package "libc6" "libc6.1" "$required")" 34 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 35 | ;; 36 | "m68k") 37 | ;; 38 | "powerpc") 39 | ;; 40 | "sparc") 41 | ;; 42 | "mips") 43 | ;; 44 | "mipsel") 45 | ;; 46 | "hppa") 47 | ;; 48 | s390|s390x) 49 | ;; 50 | sh*) 51 | ;; 52 | *) 53 | # who knows? 54 | ;; 55 | esac 56 | } 57 | 58 | first_stage_install () { 59 | extract $required 60 | 61 | mkdir -p "$TARGET/var/lib/dpkg" 62 | : >"$TARGET/var/lib/dpkg/status" 63 | echo >"$TARGET/var/lib/dpkg/available" 64 | 65 | setup_etc 66 | if [ ! -e "$TARGET/etc/fstab" ]; then 67 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 68 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 69 | fi 70 | 71 | setup_devices 72 | 73 | x_feign_install () { 74 | local pkg="$1" 75 | local deb="$(debfor $pkg)" 76 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 77 | 78 | mkdir -p "$TARGET/var/lib/dpkg/info" 79 | 80 | echo \ 81 | "Package: $pkg 82 | Version: $ver 83 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 84 | 85 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 86 | } 87 | 88 | x_feign_install dpkg 89 | } 90 | 91 | second_stage_install () { 92 | x_core_install () { 93 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 94 | } 95 | 96 | p () { 97 | baseprog="$(($baseprog + ${1:-1}))" 98 | } 99 | 100 | setup_proc 101 | in_target /sbin/ldconfig 102 | 103 | DEBIAN_FRONTEND=noninteractive 104 | export DEBIAN_FRONTEND 105 | 106 | baseprog=0 107 | bases=40 108 | 109 | p; progress $baseprog $bases INSTBASE "Installing base system" #1 110 | info INSTCORE "Installing core packages..." 111 | 112 | p; progress $baseprog $bases INSTBASE "Installing base system" #2 113 | ln -sf mawk "$TARGET/usr/bin/awk" 114 | x_core_install base-files base-passwd 115 | p; progress $baseprog $bases INSTBASE "Installing base system" #3 116 | x_core_install dpkg 117 | 118 | if [ ! -e "$TARGET/etc/localtime" ]; then 119 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 120 | fi 121 | 122 | p; progress $baseprog $bases INSTBASE "Installing base system" #4 123 | x_core_install $LIBC 124 | 125 | p; progress $baseprog $bases INSTBASE "Installing base system" #5 126 | x_core_install perl-base 127 | p; progress $baseprog $bases INSTBASE "Installing base system" #6 128 | rm "$TARGET/usr/bin/awk" 129 | x_core_install mawk 130 | p; progress $baseprog $bases INSTBASE "Installing base system" #7 131 | 132 | info UNPACKREQ "Unpacking required packages..." 133 | 134 | p; progress $baseprog $bases INSTBASE "Installing base system" #8 135 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 136 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18 137 | 138 | info CONFREQ "Configuring required packages..." 139 | 140 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 141 | echo \ 142 | "#!/bin/sh 143 | echo 144 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 145 | chmod 755 "$TARGET/sbin/start-stop-daemon" 146 | 147 | setup_dselect_method apt 148 | 149 | p; progress $baseprog $bases INSTBASE "Installing base system" #19 150 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 151 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 152 | 153 | info INSTBASE "Installing base packages..." 154 | 155 | p; progress $baseprog $bases INSTBASE "Installing base system" #30 156 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 157 | 158 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 159 | 160 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39 161 | 162 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 163 | 164 | progress $bases $bases INSTBASE "Installing base system" #40 165 | info BASESUCCESS "Base system installed successfully." 166 | } 167 | -------------------------------------------------------------------------------- /cf/bootstrap/sarge.fakechroot: -------------------------------------------------------------------------------- 1 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 2 | 3 | mirror_style release 4 | download_style apt 5 | force_md5 6 | 7 | LIBC=libc6 8 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 9 | LIBC="libc6.1" 10 | fi 11 | 12 | work_out_debs () { 13 | 14 | required="base-files base-passwd bash bsdutils coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login mawk mount ncurses-base ncurses-bin passwd perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g" 15 | 16 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules" 17 | 18 | without_package () { 19 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 20 | } 21 | subst_package () { 22 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 23 | } 24 | 25 | required="$required binutils fakechroot" 26 | base="$(without_package "binutils" "$base")" 27 | 28 | case $ARCH in 29 | "alpha") 30 | required="$(subst_package "libc6" "libc6.1" "$required")" 31 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 32 | ;; 33 | "arm") 34 | ;; 35 | "i386") 36 | ;; 37 | "ia64") 38 | required="$(subst_package "libc6" "libc6.1" "$required")" 39 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 40 | ;; 41 | "m68k") 42 | ;; 43 | "powerpc") 44 | ;; 45 | "sparc") 46 | ;; 47 | "mips") 48 | ;; 49 | "mipsel") 50 | ;; 51 | "hppa") 52 | ;; 53 | s390|s390x) 54 | ;; 55 | sh*) 56 | ;; 57 | *) 58 | # who knows? 59 | ;; 60 | esac 61 | } 62 | 63 | first_stage_install () { 64 | extract $required 65 | 66 | mkdir -p "$TARGET/var/lib/dpkg" 67 | : >"$TARGET/var/lib/dpkg/status" 68 | : >"$TARGET/var/lib/dpkg/available" 69 | 70 | setup_etc 71 | if [ ! -e "$TARGET/etc/fstab" ]; then 72 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 73 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 74 | fi 75 | 76 | x_feign_install () { 77 | local pkg="$1" 78 | local deb="$(debfor $pkg)" 79 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 80 | 81 | mkdir -p "$TARGET/var/lib/dpkg/info" 82 | 83 | echo \ 84 | "Package: $pkg 85 | Version: $ver 86 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 87 | 88 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 89 | } 90 | 91 | x_feign_install dpkg 92 | } 93 | 94 | second_stage_install () { 95 | x_core_install () { 96 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 97 | } 98 | 99 | p () { 100 | baseprog="$(($baseprog + ${1:-1}))" 101 | } 102 | 103 | setup_devices_fakechroot 104 | setup_proc_symlink 105 | 106 | DEBIAN_FRONTEND=noninteractive 107 | export DEBIAN_FRONTEND 108 | 109 | baseprog=0 110 | bases=40 111 | 112 | p; progress $baseprog $bases INSTBASE "Installing base system" #1 113 | info INSTCORE "Installing core packages..." 114 | 115 | p; progress $baseprog $bases INSTBASE "Installing base system" #2 116 | ln -sf mawk "$TARGET/usr/bin/awk" 117 | x_core_install base-files base-passwd 118 | p; progress $baseprog $bases INSTBASE "Installing base system" #3 119 | x_core_install dpkg 120 | 121 | if [ ! -e "$TARGET/etc/localtime" ]; then 122 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 123 | fi 124 | 125 | install_fakechroot_tools 126 | 127 | p; progress $baseprog $bases INSTBASE "Installing base system" #4 128 | x_core_install $LIBC 129 | 130 | p; progress $baseprog $bases INSTBASE "Installing base system" #5 131 | x_core_install perl-base 132 | p; progress $baseprog $bases INSTBASE "Installing base system" #6 133 | rm "$TARGET/usr/bin/awk" 134 | x_core_install mawk 135 | p; progress $baseprog $bases INSTBASE "Installing base system" #7 136 | 137 | info UNPACKREQ "Unpacking required packages..." 138 | 139 | p; progress $baseprog $bases INSTBASE "Installing base system" #8 140 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 141 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18 142 | 143 | info CONFREQ "Configuring required packages..." 144 | 145 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 146 | echo \ 147 | "#!/bin/sh 148 | echo 149 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 150 | chmod 755 "$TARGET/sbin/start-stop-daemon" 151 | 152 | setup_dselect_method apt 153 | 154 | p; progress $baseprog $bases INSTBASE "Installing base system" #19 155 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 156 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 157 | 158 | info INSTBASE "Installing base packages..." 159 | 160 | p; progress $baseprog $bases INSTBASE "Installing base system" #30 161 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 162 | 163 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 164 | 165 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39 166 | 167 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 168 | 169 | progress $bases $bases INSTBASE "Installing base system" #40 170 | info BASESUCCESS "Base system installed successfully." 171 | } 172 | -------------------------------------------------------------------------------- /cf/bootstrap/saucy: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/sid: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | finddebs_style from-indices 4 | variants - buildd fakechroot minbase 5 | keyring /usr/share/keyrings/debian-archive-keyring.gpg 6 | 7 | # include common settings 8 | if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then 9 | . "$DEBOOTSTRAP_DIR/scripts/debian-common" 10 | elif [ -e /debootstrap/debian-common ]; then 11 | . /debootstrap/debian-common 12 | elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then 13 | . "$DEBOOTSTRAP_DIR/debian-common" 14 | else 15 | error 1 NOCOMMON "File not found: debian-common" 16 | fi 17 | -------------------------------------------------------------------------------- /cf/bootstrap/squeeze: -------------------------------------------------------------------------------- 1 | etch -------------------------------------------------------------------------------- /cf/bootstrap/stable: -------------------------------------------------------------------------------- 1 | ceres -------------------------------------------------------------------------------- /cf/bootstrap/stretch: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /cf/bootstrap/testing: -------------------------------------------------------------------------------- 1 | ceres -------------------------------------------------------------------------------- /cf/bootstrap/trusty: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/unstable: -------------------------------------------------------------------------------- 1 | ceres -------------------------------------------------------------------------------- /cf/bootstrap/utopic: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/vivid: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/warty: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | 5 | LIBC=libc6 6 | 7 | work_out_debs () { 8 | 9 | required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-iconv-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libc6 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libpopt0 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed slang1a-utf8 lsb-base initscripts sysvinit sysv-rc tar util-linux zlib1g whiptail libgcc1 gcc-3.3-base libstdc++5" 10 | 11 | base="adduser alsa-base alsa-utils apt apt-utils aptitude at base-config bind9-host bsdmainutils bzip2 console-common console-data console-tools cpio cramfsprogs cron dash dbus-1 dhcp3-client dhcp3-common discover1 discover1-data dmsetup dnsutils dosfstools ed eject evms evms-ncurses fdutils file ftp gettext-base gnupg groff-base hdparm hotplug ifrename ifupdown info initrd-tools iproute iptables iputils-arping iputils-ping iputils-tracepath jfsutils klogd less libasound2 libatm1 libbz2-1.0 libconsole libdb4.2 libdevmapper1.00 libdiscover1 libdns16 libevms-2.3 libexpat1 libfribidi0 libgc1 libgcrypt7 libgdbm3 libgnutls10 libgpg-error0 libgpmg1 libidn11 libisc7 libiw27 libldap2 liblockfile1 liblwres1 liblzo1 libmagic1 libncursesw5 libopencdk8 libparted1.6-0 libpcap0.7 libpcap0.8 libreiserfs0.3-0 libsasl2 libsigc++-1.2-5c102 libssl0.9.7 libtasn1-2 libusb-0.1-4 libwrap0 locales logrotate lshw lsof ltrace lvm-common lvm10 lvm2 mailx man-db manpages mdadm mii-diag mime-support module-init-tools mtr-tiny mutt nano net-tools netbase netcat netkit-inetd ntp ntpdate openssh-client parted pciutils popularity-contest postfix postfix-tls ppp pppconfig pppoeconf psmisc python python2.3 reiser4progs reiserfsprogs reportbug rsync strace sudo sysklogd tcpd tcpdump telnet time ubuntu-base udev usbutils vim vim-common w3m wget wireless-tools xfsprogs" 12 | 13 | without_package () { 14 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 15 | } 16 | subst_package () { 17 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 18 | } 19 | 20 | case $ARCH in 21 | "i386") 22 | required="$required libc6-i686" 23 | base="$base dmidecode memtest86+ libreadline4" 24 | ;; 25 | "powerpc") 26 | required="$required libreadline4" 27 | base="$base hfsplus hfsutils libhfsp0 mac-fdisk pmac-fdisk powerpc-utils" 28 | ;; 29 | "amd64") 30 | base="$base dmidecode libreadline4" 31 | ;; 32 | *) 33 | # who knows? 34 | ;; 35 | esac 36 | } 37 | 38 | install_debs () { 39 | first_stage_install 40 | second_stage_install 41 | } 42 | 43 | first_stage_install () { 44 | extract $required 45 | 46 | mkdir -p "$TARGET/var/lib/dpkg" 47 | : >"$TARGET/var/lib/dpkg/status" 48 | echo >"$TARGET/var/lib/dpkg/available" 49 | 50 | setup_etc 51 | if [ ! -e "$TARGET/etc/fstab" ]; then 52 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 53 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 54 | fi 55 | 56 | setup_devices 57 | 58 | x_feign_install () { 59 | local pkg="$1" 60 | local deb="$(debfor $pkg)" 61 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 62 | 63 | mkdir -p "$TARGET/var/lib/dpkg/info" 64 | 65 | echo \ 66 | "Package: $pkg 67 | Version: $ver 68 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 69 | 70 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 71 | } 72 | 73 | x_feign_install dpkg 74 | } 75 | 76 | second_stage_install () { 77 | x_core_install () { 78 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 79 | } 80 | 81 | p () { 82 | baseprog="$(($baseprog + ${1:-1}))" 83 | } 84 | 85 | DEBIAN_FRONTEND=noninteractive 86 | DEBCONF_NONINTERACTIVE_SEEN=true 87 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 88 | 89 | setup_proc 90 | in_target /sbin/ldconfig 91 | 92 | baseprog=0 93 | bases=7 94 | 95 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 96 | info INSTCORE "Installing core packages..." 97 | 98 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 99 | ln -sf mawk "$TARGET/usr/bin/awk" 100 | x_core_install base-files base-passwd 101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 102 | x_core_install dpkg 103 | 104 | if [ ! -e "$TARGET/etc/localtime" ]; then 105 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 106 | fi 107 | 108 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 109 | x_core_install $LIBC 110 | 111 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 112 | x_core_install perl-base 113 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 114 | rm "$TARGET/usr/bin/awk" 115 | x_core_install mawk 116 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 117 | x_core_install debconf 118 | 119 | baseprog=0 120 | bases="$(set -- $required; echo $#)" 121 | 122 | info UNPACKREQ "Unpacking required packages..." 123 | 124 | smallyes '' | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 125 | 126 | baseprog=0 127 | 128 | info CONFREQ "Configuring required packages..." 129 | 130 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 131 | echo \ 132 | "#!/bin/sh 133 | echo 134 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 135 | chmod 755 "$TARGET/sbin/start-stop-daemon" 136 | 137 | setup_dselect_method apt 138 | #on_exit "(in_target_nofail umount /dev/pts) || true" 139 | 140 | smallyes '' | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 141 | 142 | baseprog=0 143 | bases="$(set -- $base; echo $#)" 144 | 145 | info UNPACKBASE "Unpacking the base system..." 146 | 147 | smallyes '' | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 148 | 149 | baseprog=0 150 | 151 | info CONFBASE "Configuring the base system..." 152 | 153 | mv "$TARGET/usr/sbin/sendmail" "$TARGET/usr/sbin/sendmail.REAL" 154 | ln -s /bin/true "$TARGET/usr/sbin/sendmail" 155 | 156 | smallyes '' | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 157 | 158 | rm -f "$TARGET/usr/sbin/sendmail" 159 | mv "$TARGET/usr/sbin/sendmail.REAL" "$TARGET/usr/sbin/sendmail" 160 | 161 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 162 | 163 | progress $bases $bases CONFBASE "Configuring base system" 164 | info BASESUCCESS "Base system installed successfully." 165 | } 166 | 167 | -------------------------------------------------------------------------------- /cf/bootstrap/warty.buildd: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | 5 | LIBC=libc6 6 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 7 | LIBC="libc6.1" 8 | fi 9 | 10 | work_out_debs () { 11 | 12 | required="base-files base-passwd bash bsdutils build-essential coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs fakeroot findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login lsb-base mawk mount ncurses-base ncurses-bin perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g" 13 | 14 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules" 15 | 16 | without_package () { 17 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 18 | } 19 | subst_package () { 20 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 21 | } 22 | 23 | case $ARCH in 24 | "amd64") 25 | ;; 26 | "i386") 27 | ;; 28 | "powerpc") 29 | ;; 30 | 31 | # Unsupported architectures: 32 | "alpha") 33 | required="$(subst_package "libc6" "libc6.1" "$required")" 34 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 35 | ;; 36 | "ia64") 37 | required="$(subst_package "libc6" "libc6.1" "$required")" 38 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 39 | ;; 40 | *) 41 | # who knows? 42 | ;; 43 | esac 44 | } 45 | 46 | install_debs () { 47 | first_stage_install 48 | second_stage_install 49 | } 50 | 51 | first_stage_install () { 52 | extract $required 53 | 54 | mkdir -p "$TARGET/var/lib/dpkg" 55 | : >"$TARGET/var/lib/dpkg/status" 56 | echo >"$TARGET/var/lib/dpkg/available" 57 | 58 | setup_etc 59 | if [ ! -e "$TARGET/etc/fstab" ]; then 60 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 61 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 62 | fi 63 | 64 | setup_devices 65 | 66 | x_feign_install () { 67 | local pkg="$1" 68 | local deb="$(debfor $pkg)" 69 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 70 | 71 | mkdir -p "$TARGET/var/lib/dpkg/info" 72 | 73 | echo \ 74 | "Package: $pkg 75 | Version: $ver 76 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 77 | 78 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 79 | } 80 | 81 | x_feign_install dpkg 82 | } 83 | 84 | second_stage_install () { 85 | x_core_install () { 86 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 87 | } 88 | p () { 89 | baseprog="$(($baseprog + ${1:-1}))" 90 | } 91 | 92 | DEBIAN_FRONTEND=noninteractive 93 | export DEBIAN_FRONTEND 94 | 95 | baseprog=0 96 | bases=40 97 | 98 | setup_proc 99 | in_target /sbin/ldconfig 100 | 101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 102 | info INSTCORE "Installing core packages..." 103 | 104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 105 | ln -sf mawk "$TARGET/usr/bin/awk" 106 | x_core_install base-files base-passwd 107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 108 | x_core_install dpkg 109 | 110 | if [ ! -e "$TARGET/etc/localtime" ]; then 111 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 112 | fi 113 | 114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 115 | x_core_install $LIBC 116 | 117 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 118 | x_core_install perl-base 119 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 120 | rm "$TARGET/usr/bin/awk" 121 | x_core_install mawk 122 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 123 | 124 | info UNPACKREQ "Unpacking required packages..." 125 | 126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #8 127 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 128 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #18 129 | 130 | info CONFREQ "Configuring required packages..." 131 | 132 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 133 | echo \ 134 | "#!/bin/sh 135 | echo 136 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 137 | chmod 755 "$TARGET/sbin/start-stop-daemon" 138 | 139 | setup_dselect_method apt 140 | #on_exit "in_target_nofail umount /dev/pts" 141 | 142 | p; progress $baseprog $bases INSTCORE "Installing core packages" #19 143 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 144 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #29 145 | 146 | info INSTCORE "Installing base packages..." 147 | 148 | p; progress $baseprog $bases INSTCORE "Installing core packages" #30 149 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 150 | 151 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 152 | 153 | p 9; progress $baseprog $bases INSTCORE "Installing core packages" #39 154 | 155 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 156 | 157 | progress $bases $bases INSTCORE "Installing core packages" #40 158 | info BASESUCCESS "Base system installed successfully." 159 | } 160 | -------------------------------------------------------------------------------- /cf/bootstrap/wheezy: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /cf/bootstrap/wily: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/woody: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | default_mirror http://archive.debian.org/debian 4 | keyring /usr/share/keyrings/debian-archive-removed-keys.gpg 5 | force_md5 6 | 7 | LIBC=libc6 8 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 9 | LIBC="libc6.1" 10 | fi 11 | 12 | work_out_debs () { 13 | 14 | required="base-files base-passwd bash bsdutils debconf debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname libcap1 libc6 libdb2 libdb3 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libperl5.6 libpopt0 libreadline4 libstdc++2.10-glibc2.2 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed shellutils slang1 sysvinit tar textutils util-linux whiptail" 15 | 16 | base="adduser apt apt-utils at base-config bsdmainutils console-common console-tools console-tools-libs console-data cpio cron dhcp-client ed exim fdutils gettext-base groff-base ifupdown info klogd libident libldap2 liblockfile1 libpcre3 libsasl7 libwrap0 logrotate mailx man-db manpages modconf nano net-tools netbase netkit-inetd netkit-ping nvi ppp pppconfig pppoe pppoeconf libpcap0 sysklogd tasksel tcpd telnet" 17 | 18 | without_package () { 19 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 20 | } 21 | 22 | IPFWTOOL=iptables 23 | 24 | case $ARCH in 25 | "alpha") 26 | required="$(without_package "libc6" "$required") libc6.1" 27 | base="$base setserial aboot pciutils" 28 | IPFWTOOL="ipchains" 29 | ;; 30 | "arm") 31 | base="$base setserial libgpmg1" 32 | IPFWTOOL="ipchains iptables" 33 | ;; 34 | "i386") 35 | required="$(without_package "libperl5.6" "$required") mbr" 36 | base="$base lilo pciutils setserial syslinux psmisc pcmcia-cs" 37 | IPFWTOOL="ipchains iptables" 38 | ;; 39 | "ia64") 40 | required="$(without_package "libc6" "$required") libc6.1 gcc-2.96-base" 41 | base="$base elilo efibootmgr dosfstools libparted1.4 parted" 42 | ;; 43 | "m68k") 44 | base="$base atari-bootstrap atari-fdisk amiga-fdisk eject mac-fdisk pmac-fdisk-cross setserial vmelilo" 45 | IPFWTOOL="ipchains" 46 | ;; 47 | "powerpc") 48 | base="$base quik mac-fdisk amiga-fdisk psmisc powerpc-utils setserial pciutils hfsutils yaboot pcmcia-cs" 49 | IPFWTOOL="ipchains iptables" 50 | ;; 51 | "sparc") 52 | base="$base silo eject pciutils sparc-utils" 53 | IPFWTOOL="ipchains iptables" 54 | ;; 55 | "mips") 56 | base="$base dvhtool pciutils setserial" # pcmcia-cs 57 | ;; 58 | "mipsel") 59 | base="$base delo pciutils setserial" # pcmcia-cs 60 | ;; 61 | "hppa") 62 | base="$base palo libstdc++3 gcc-3.0-base" 63 | required="$(without_package "libstdc++2.10-glibc2.2" "$required")" 64 | ;; 65 | s390|s390x) 66 | # base-config depends on console-data and console-common 67 | # so we can't exclude them although they are useless on s390 68 | base="$base s390-tools telnetd devfsd" 69 | base="$(without_package "console-tools" "$base")" 70 | base="$(without_package "console-tools-libs" "$base")" 71 | base="$(without_package "fdutils" "$base")" 72 | base="$(without_package "ppp" "$base")" 73 | base="$(without_package "pppconfig" "$base")" 74 | base="$(without_package "pppoe" "$base")" 75 | base="$(without_package "pppoeconf" "$base")" 76 | ;; 77 | *) 78 | # who knows? 79 | ;; 80 | esac 81 | 82 | base="$base $IPFWTOOL" 83 | } 84 | 85 | first_stage_install () { 86 | extract $required 87 | 88 | mkdir -p "$TARGET/var/lib/dpkg" 89 | : >"$TARGET/var/lib/dpkg/status" 90 | echo >"$TARGET/var/lib/dpkg/available" 91 | 92 | setup_etc 93 | if [ ! -e "$TARGET/etc/fstab" ]; then 94 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 95 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 96 | fi 97 | 98 | setup_devices 99 | 100 | x_feign_install () { 101 | local pkg="$1" 102 | local deb="$(debfor $pkg)" 103 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 104 | 105 | mkdir -p "$TARGET/var/lib/dpkg/info" 106 | 107 | echo \ 108 | "Package: $pkg 109 | Version: $ver 110 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 111 | 112 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 113 | } 114 | 115 | x_feign_install dpkg 116 | } 117 | 118 | second_stage_install () { 119 | x_core_install () { 120 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 121 | } 122 | 123 | p () { 124 | baseprog="$(($baseprog + ${1:-1}))" 125 | } 126 | 127 | setup_proc 128 | in_target /sbin/ldconfig 129 | 130 | DEBIAN_FRONTEND=Noninteractive 131 | export DEBIAN_FRONTEND 132 | 133 | baseprog=0 134 | bases=40 135 | 136 | p; progress $baseprog $bases INSTBASE "Installing base system" #1 137 | info INSTCORE "Installing core packages..." 138 | 139 | p; progress $baseprog $bases INSTBASE "Installing base system" #2 140 | ln -sf mawk "$TARGET/usr/bin/awk" 141 | x_core_install base-files base-passwd 142 | p; progress $baseprog $bases INSTBASE "Installing base system" #3 143 | x_core_install dpkg 144 | 145 | if [ ! -e "$TARGET/etc/localtime" ]; then 146 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 147 | fi 148 | 149 | p; progress $baseprog $bases INSTBASE "Installing base system" #4 150 | x_core_install $LIBC 151 | 152 | p; progress $baseprog $bases INSTBASE "Installing base system" #5 153 | x_core_install perl-base 154 | p; progress $baseprog $bases INSTBASE "Installing base system" #6 155 | rm "$TARGET/usr/bin/awk" 156 | x_core_install mawk 157 | p; progress $baseprog $bases INSTBASE "Installing base system" #7 158 | x_core_install debconf 159 | 160 | info UNPACKREQ "Unpacking required packages..." 161 | 162 | p; progress $baseprog $bases INSTBASE "Installing base system" #8 163 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 164 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18 165 | 166 | info CONFREQ "Configuring required packages..." 167 | 168 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 169 | echo \ 170 | "#!/bin/sh 171 | echo 172 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 173 | chmod 755 "$TARGET/sbin/start-stop-daemon" 174 | 175 | setup_dselect_method apt 176 | 177 | p; progress $baseprog $bases INSTBASE "Installing base system" #19 178 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 179 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 180 | 181 | if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then 182 | mkdir -p "$TARGET/etc/exim" 183 | touch "$TARGET/etc/exim/exim.conf" 184 | fi 185 | 186 | info INSTBASE "Installing base packages..." 187 | 188 | p; progress $baseprog $bases INSTBASE "Installing base system" #30 189 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 190 | 191 | rm -f "$TARGET/usr/sbin/sendmail" 192 | ln -sf /bin/true "$TARGET/usr/sbin/sendmail" 193 | 194 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 195 | 196 | rm -f "$TARGET/usr/sbin/sendmail" 197 | ln -sf exim "$TARGET/usr/sbin/sendmail" 198 | 199 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39 200 | 201 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 202 | 203 | progress $bases $bases INSTBASE "Installing base system" #40 204 | info BASESUCCESS "Base system installed successfully." 205 | } 206 | -------------------------------------------------------------------------------- /cf/bootstrap/woody.buildd: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | default_mirror http://archive.debian.org/debian 4 | keyring /usr/share/keyrings/debian-archive-removed-keys.gpg 5 | force_md5 6 | 7 | LIBC=libc6 8 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 9 | LIBC="libc6.1" 10 | fi 11 | 12 | work_out_debs () { 13 | 14 | required="base-files base-passwd bash bsdutils debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname libc6 libcap1 libdb3 libgdbmg1 libncurses5 libpam-modules libpam-runtime libpam0g libperl5.6 libstdc++2.10-glibc2.2 login mawk mount ncurses-base ncurses-bin perl-base sed shellutils slang1 sysvinit tar textutils util-linux" 15 | 16 | base="apt binutils cpio cpp cpp-2.95 debconf dpkg-dev g++ g++-2.95 gcc gcc-2.95 libc6-dev libdb2 libstdc++2.10-dev make patch perl perl-modules" 17 | 18 | without_package () { 19 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 20 | } 21 | 22 | case $ARCH in 23 | "alpha") 24 | required="$(without_package "libc6" "$required") libc6.1" 25 | base="$(without_package "libc6-dev" "$base") libc6.1-dev" 26 | ;; 27 | "arm") 28 | ;; 29 | "i386") 30 | ;; 31 | "ia64") 32 | required="$(without_package "libc6" "$required") libc6.1 gcc-2.96-base libreadline4" 33 | base="$(without_package "cpp-2.95" "$base") cpp-2.96" 34 | base="$(without_package "gcc-2.95" "$base") gcc-2.96" 35 | base="$(without_package "g++-2.95" "$base") g++-2.96" 36 | base="$(without_package "libc6-dev" "$base") libc6.1-dev elilo efibootmgr dosfstools libparted1.4 parted" 37 | ;; 38 | "m68k") 39 | ;; 40 | "powerpc") 41 | ;; 42 | "sparc") 43 | ;; 44 | "mips") 45 | ;; 46 | "mipsel") 47 | ;; 48 | "hppa") 49 | ;; 50 | s390|s390x) 51 | ;; 52 | sh*) 53 | ;; 54 | *) 55 | # who knows? 56 | ;; 57 | esac 58 | } 59 | 60 | first_stage_install () { 61 | extract $required 62 | 63 | mkdir -p "$TARGET/var/lib/dpkg" 64 | : >"$TARGET/var/lib/dpkg/status" 65 | echo >"$TARGET/var/lib/dpkg/available" 66 | 67 | setup_etc 68 | if [ ! -e "$TARGET/etc/fstab" ]; then 69 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 70 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 71 | fi 72 | 73 | setup_devices 74 | 75 | x_feign_install () { 76 | local pkg="$1" 77 | local deb="$(debfor $pkg)" 78 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 79 | 80 | mkdir -p "$TARGET/var/lib/dpkg/info" 81 | 82 | echo \ 83 | "Package: $pkg 84 | Version: $ver 85 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 86 | 87 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 88 | } 89 | 90 | x_feign_install dpkg 91 | } 92 | 93 | second_stage_install () { 94 | x_core_install () { 95 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 96 | } 97 | 98 | p () { 99 | baseprog="$(($baseprog + ${1:-1}))" 100 | } 101 | 102 | setup_proc 103 | in_target /sbin/ldconfig 104 | 105 | DEBIAN_FRONTEND=noninteractive 106 | export DEBIAN_FRONTEND 107 | 108 | baseprog=0 109 | bases=40 110 | 111 | p; progress $baseprog $bases INSTBASE "Installing base system" #1 112 | info INSTCORE "Installing core packages..." 113 | 114 | p; progress $baseprog $bases INSTBASE "Installing base system" #2 115 | ln -sf mawk "$TARGET/usr/bin/awk" 116 | x_core_install base-files base-passwd 117 | p; progress $baseprog $bases INSTBASE "Installing base system" #3 118 | x_core_install dpkg 119 | 120 | if [ ! -e "$TARGET/etc/localtime" ]; then 121 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 122 | fi 123 | 124 | p; progress $baseprog $bases INSTBASE "Installing base system" #4 125 | x_core_install $LIBC 126 | 127 | p; progress $baseprog $bases INSTBASE "Installing base system" #5 128 | x_core_install perl-base 129 | p; progress $baseprog $bases INSTBASE "Installing base system" #6 130 | rm "$TARGET/usr/bin/awk" 131 | x_core_install mawk 132 | p; progress $baseprog $bases INSTBASE "Installing base system" #7 133 | 134 | info UNPACKREQ "Unpacking required packages..." 135 | 136 | p; progress $baseprog $bases INSTBASE "Installing base system" #8 137 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 138 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18 139 | 140 | info CONFREQ "Configuring required packages..." 141 | 142 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 143 | echo \ 144 | "#!/bin/sh 145 | echo 146 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 147 | chmod 755 "$TARGET/sbin/start-stop-daemon" 148 | 149 | setup_dselect_method apt 150 | 151 | p; progress $baseprog $bases INSTBASE "Installing base system" #19 152 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 153 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 154 | 155 | info INSTBASE "Installing base packages..." 156 | 157 | p; progress $baseprog $bases INSTBASE "Installing base system" #30 158 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 159 | 160 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 161 | 162 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39 163 | 164 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 165 | 166 | progress $bases $bases INSTBASE "Installing base system" #40 167 | info BASESUCCESS "Base system installed successfully." 168 | } 169 | -------------------------------------------------------------------------------- /cf/bootstrap/xenial: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/yakkety: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/bootstrap/zesty: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /cf/keys/debian/stretch.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metux/docker-buildpackage/577e474c3345eb80ffe352053eee50a4966fa0e2/cf/keys/debian/stretch.gpg -------------------------------------------------------------------------------- /cf/keys/devuan/beowulf.gpg: -------------------------------------------------------------------------------- 1 | devuan-keyring.gpg -------------------------------------------------------------------------------- /cf/keys/devuan/chimaera.gpg: -------------------------------------------------------------------------------- 1 | devuan-keyring.gpg -------------------------------------------------------------------------------- /cf/keys/devuan/daedalus.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metux/docker-buildpackage/577e474c3345eb80ffe352053eee50a4966fa0e2/cf/keys/devuan/daedalus.gpg -------------------------------------------------------------------------------- /cf/keys/devuan/devuan-archive-keyring.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metux/docker-buildpackage/577e474c3345eb80ffe352053eee50a4966fa0e2/cf/keys/devuan/devuan-archive-keyring.gpg -------------------------------------------------------------------------------- /cf/keys/devuan/devuan-keyring.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metux/docker-buildpackage/577e474c3345eb80ffe352053eee50a4966fa0e2/cf/keys/devuan/devuan-keyring.gpg -------------------------------------------------------------------------------- /cf/keys/devuan/testing.gpg: -------------------------------------------------------------------------------- 1 | devuan-archive-keyring.gpg -------------------------------------------------------------------------------- /cf/keys/devuan/unstable.gpg: -------------------------------------------------------------------------------- 1 | devuan-archive-keyring.gpg -------------------------------------------------------------------------------- /cf/keys/ubuntu/focal.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metux/docker-buildpackage/577e474c3345eb80ffe352053eee50a4966fa0e2/cf/keys/ubuntu/focal.gpg -------------------------------------------------------------------------------- /cf/target/common/debian/mirror.cf: -------------------------------------------------------------------------------- 1 | DISTRO_COMPONENTS="main,contrib,non-free" 2 | DISTRO_MIRROR="http://deb.debian.org/debian/" 3 | DISTRO_PROXY="$http_proxy" 4 | DISTRO_KEYRING="keys/debian/${DISTRO_NAME}.gpg" 5 | 6 | ## overwrite /etc/apt/sources.list on base image generation 7 | DISTRO_APT_SOURCES=" 8 | ${DISTRO_MIRROR} ${DISTRO_NAME} main contrib non-free 9 | " 10 | -------------------------------------------------------------------------------- /cf/target/common/debian/stretch.cf: -------------------------------------------------------------------------------- 1 | DISTRO_DESCRIPTION="Debian Stretch / ${DISTRO_ARCH}" 2 | DISTRO_NAME="stretch" 3 | DISTRO_INCLUDE="sysvinit-core,build-essential,devscripts,equivs" 4 | DISTRO_EXCLUDE="systemd,whiptail,dmidecode,dmsetup" 5 | 6 | DISTRO_MARK_AUTO=" 7 | 8 | adduser 9 | apt 10 | apt-utils 11 | 12 | base-files 13 | base-passwd 14 | bash 15 | binutils 16 | bsdmainutils 17 | bsdutils 18 | bzip2 19 | 20 | coreutils 21 | cpio 22 | cpp 23 | cpp-6 24 | cron 25 | 26 | dash 27 | debconf 28 | debconf-i18n 29 | debianutils 30 | diffutils 31 | dmsetup 32 | dpkg 33 | dpkg-dev 34 | 35 | e2fslibs 36 | e2fsprogs 37 | 38 | findutils 39 | 40 | g++ 41 | gcc 42 | gcc-6-base 43 | g++-6 44 | gcc-6 45 | gnupg-agent 46 | gnupg 47 | gpgv 48 | grep 49 | gzip 50 | 51 | hostname 52 | 53 | isc-dhcp-client 54 | isc-dhcp-common 55 | init-system-helpers 56 | iputils-ping 57 | iproute2 58 | iptables 59 | 60 | kmod 61 | 62 | lsb-base 63 | 64 | libacl1 65 | libapparmor1 66 | libapt-inst2.0 67 | libapt-pkg5.0 68 | libatomic1 69 | libattr1 70 | libaudit-common 71 | libaudit1 72 | libasan3 73 | libassuan0 74 | 75 | libblkid1 76 | libbsd0 77 | libbz2-1.0 78 | 79 | libc-bin 80 | libc-dev-bin 81 | libc6 82 | libc6-dev 83 | libcap2 84 | libcc1-0 85 | libcilkrts5 86 | libcomerr2 87 | libcryptsetup4 88 | libcap-ng0 89 | 90 | libdb5.3 91 | libdebconfclient0 92 | libdevmapper1.02.1 93 | libdns-export162 94 | libdpkg-perl 95 | 96 | libestr0 97 | libelf1 98 | 99 | libfdisk1 100 | libffi6 101 | libfastjson4 102 | 103 | libgcc1 104 | libgcrypt20 105 | libgdbm3 106 | libgmp10 107 | libgnutls30 108 | libgomp1 109 | libgpg-error0 110 | libgcc-6-dev 111 | 112 | libhogweed4 113 | 114 | libidn11 115 | libisc-export160 116 | libisl15 117 | libitm1 118 | libidn2-0 119 | libip4tc0 120 | libip6tc0 121 | libiptc0 122 | 123 | libkmod2 124 | libksba8 125 | 126 | liblocale-gettext-perl 127 | liblz4-1 128 | liblzma5 129 | liblsan0 130 | liblogging-stdlog0 131 | liblognorm5 132 | 133 | libmnl0 134 | libmount1 135 | libmpc3 136 | libmpfr4 137 | libmpx2 138 | 139 | libncurses5 140 | libncursesw5 141 | libnettle6 142 | libnewt0.52 143 | libnetfilter-conntrack3 144 | libnfnetlink0 145 | libnpth0 146 | 147 | libp11-kit0 148 | libpam-modules 149 | libpam-modules-bin 150 | libpam-runtime 151 | libpam0g 152 | libpcre3 153 | libpopt0 154 | libperl5.24 155 | libpipeline1 156 | libprocps6 157 | libpsl5 158 | 159 | libquadmath0 160 | 161 | libreadline7 162 | 163 | libsystemd0 164 | libseccomp2 165 | libselinux1 166 | libsemanage-common 167 | libsemanage1 168 | libsepol1 169 | libslang2 170 | libsqlite3-0 171 | libss2 172 | libstdc++6 173 | libsmartcols1 174 | libssl1.0.2 175 | libssl1.1 176 | libstdc++-6-dev 177 | 178 | libtsan0 179 | libtext-charwidth-perl 180 | libtext-wrapi18n-perl 181 | libtasn1-6 182 | libtinfo5 183 | libtext-iconv-perl 184 | 185 | libubsan0 186 | libudev1 187 | libustr-1.0-1 188 | libuuid1 189 | libunistring0 190 | 191 | libxapian30 192 | libxtables12 193 | 194 | linux-libc-dev 195 | login 196 | 197 | logrotate 198 | 199 | make 200 | multiarch-support 201 | mawk 202 | mount 203 | 204 | nano 205 | ncurses-base 206 | ncurses-bin 207 | netbase 208 | 209 | passwd 210 | perl 211 | perl-base 212 | patch 213 | procps 214 | perl-modules-5.24 215 | pinentry-curses 216 | 217 | rsyslog 218 | readline-common 219 | 220 | sed 221 | sensible-utils 222 | systemd 223 | sysvinit-utils 224 | 225 | tar 226 | tzdata 227 | tasksel 228 | tasksel-data 229 | 230 | udev 231 | util-linux 232 | 233 | vim-common 234 | vim-tiny 235 | 236 | wget 237 | 238 | xxd 239 | xz-utils 240 | 241 | zlib1g 242 | " 243 | 244 | include_target common/debian/mirror 245 | include_target common/target-apt-repo 246 | include_target common/remove-files 247 | -------------------------------------------------------------------------------- /cf/target/common/devuan/beowulf.cf: -------------------------------------------------------------------------------- 1 | DISTRO_DESCRIPTION="Devuan Beowulf" 2 | DISTRO_NAME="beowulf" 3 | DISTRO_EXCLUDE="usr-is-merged,isc-dhcp-client,isc-dhcp-common,whiptail,debconf-i18n,e2fsprogs,gpg-agent,nano,tasksel,logrotate,procps,rsyslog,kmod,vim-tiny,vim-common,cron,wget" 4 | 5 | DISTRO_MARK_AUTO=" 6 | 7 | adduser 8 | apt 9 | apt-utils 10 | 11 | base-files 12 | base-passwd 13 | bash 14 | bsdmainutils 15 | bsdutils 16 | 17 | coreutils 18 | cpio 19 | 20 | dash 21 | debconf 22 | debianutils 23 | diffutils 24 | dmidecode 25 | dpkg 26 | 27 | e2fslibs 28 | e2fsprogs 29 | eudev 30 | 31 | findutils 32 | 33 | gcc-6-base 34 | gnupg 35 | gnupg-agent 36 | gpgv 37 | grep 38 | gzip 39 | 40 | hostname 41 | 42 | ifupdown 43 | insserv 44 | iproute2 45 | iptables 46 | iputils-ping 47 | init 48 | init-system-helpers 49 | initscripts 50 | 51 | libacl1 52 | libattr1 53 | libapt-inst2.0 54 | libapt-pkg5.0 55 | libassuan0 56 | libaudit-common 57 | libaudit1 58 | 59 | libblkid1 60 | libbz2-1.0 61 | libbsd0 62 | 63 | libc-bin 64 | libc6 65 | libcap2 66 | libcomerr2 67 | libcap-ng0 68 | 69 | libdb5.3 70 | libdebconfclient0 71 | 72 | libestr0 73 | libelf1 74 | libeudev1 75 | 76 | libfdisk1 77 | libffi6 78 | 79 | libgcc1 80 | libgdbm3 81 | libgcrypt20 82 | libgpg-error0 83 | 84 | libidn11 85 | libip4tc0 86 | libip6tc0 87 | libiptc0 88 | 89 | libksba8 90 | 91 | liblocale-gettext-perl 92 | liblogging-stdlog0 93 | liblzma5 94 | liblz4-1 95 | 96 | libmnl0 97 | libmount1 98 | 99 | libncurses5 100 | libncursesw5 101 | libnewt0.52 102 | libnfnetlink0 103 | libnetfilter-conntrack3 104 | libnettle6 105 | libnpth0 106 | 107 | libpam-modules 108 | libpam-modules-bin 109 | libpam-runtime 110 | libpam0g 111 | libpcre3 112 | libpipeline1 113 | libpopt0 114 | libprocps4 115 | libprocps6 116 | 117 | libreadline7 118 | 119 | libselinux1 120 | libsemanage-common 121 | libsemanage1 122 | libsepol1 123 | libslang2 124 | libsmartcols1 125 | libss2 126 | libstdc++6 127 | libsqlite3-0 128 | libssl1.0.2 129 | libssl1.1 130 | 131 | libtinfo5 132 | 133 | libustr-1.0-1 134 | libuuid1 135 | 136 | libxapian30 137 | libxtables12 138 | 139 | login 140 | lsb-base 141 | 142 | mawk 143 | mount 144 | multiarch-support 145 | 146 | ncurses-base 147 | ncurses-bin 148 | net-tools 149 | netbase 150 | 151 | perl-base 152 | passwd 153 | pinentry-curses 154 | procps 155 | 156 | readline-common 157 | 158 | sed 159 | sensible-utils 160 | startpar 161 | sysv-rc 162 | sysvinit 163 | sysvinit-core 164 | sysvinit-utils 165 | 166 | tar 167 | tasksel 168 | tasksel-data 169 | tzdata 170 | 171 | util-linux 172 | 173 | vim-common 174 | 175 | xxd 176 | 177 | zlib1g 178 | " 179 | 180 | DISTRO_EXTRA_PACKAGES="build-essential devscripts equivs" 181 | 182 | include_target common/devuan/mirror 183 | include_target common/target-apt-repo 184 | include_target common/remove-files 185 | -------------------------------------------------------------------------------- /cf/target/common/devuan/chimaera.cf: -------------------------------------------------------------------------------- 1 | DISTRO_DESCRIPTION="Devuan chimaera" 2 | DISTRO_NAME="chimaera" 3 | DISTRO_EXCLUDE="usr-is-merged,isc-dhcp-client,isc-dhcp-common,whiptail,debconf-i18n,e2fsprogs,gpg-agent,nano,tasksel,logrotate,procps,rsyslog,kmod,vim-tiny,vim-common,cron,wget,pristine-tar,bootlogd,dctrl-tools,gcc-9-base,liblocale-gettext-perl,perl,man-db,manpages,sensible-utils,tzdata,wdiff,xz-utils,apt-utils" 4 | 5 | DISTRO_MARK_AUTO=" 6 | 7 | adduser 8 | apt 9 | apt-utils 10 | 11 | base-files 12 | base-passwd 13 | bash 14 | bsdmainutils 15 | bsdutils 16 | bootlogd 17 | 18 | coreutils 19 | cpio 20 | 21 | dash 22 | debconf 23 | debianutils 24 | diffutils 25 | dmidecode 26 | dpkg 27 | 28 | e2fslibs 29 | e2fsprogs 30 | eudev 31 | 32 | fdisk 33 | findutils 34 | 35 | gcc-10-base 36 | gcc-9-base 37 | gnupg 38 | gpgv 39 | grep 40 | gzip 41 | 42 | hostname 43 | 44 | ifupdown 45 | insserv 46 | iproute2 47 | iptables 48 | iputils-ping 49 | init 50 | init-system-helpers 51 | initscripts 52 | 53 | less 54 | 55 | libacl1 56 | libattr1 57 | libapt-pkg6.0 58 | libassuan0 59 | libaudit-common 60 | libaudit1 61 | 62 | libblkid1 63 | libbpf0 64 | libbsd0 65 | libbz2-1.0 66 | 67 | libc-bin 68 | libc6 69 | libcap2 70 | libcom-err2 71 | libcap2-bin 72 | libcap-ng0 73 | libcrypt1 74 | 75 | libdb5.3 76 | libdebconfclient0 77 | 78 | libedit2 79 | libestr0 80 | libelf1 81 | libeudev1 82 | 83 | libfdisk1 84 | libffi7 85 | 86 | libgcc-s1 87 | libgcrypt20 88 | libgmp10 89 | libgnutls30 90 | libgpg-error0 91 | libgssapi-krb5-2 92 | 93 | libhogweed6 94 | 95 | libidn2-0 96 | libiptc0 97 | 98 | libjansson4 99 | 100 | libksba8 101 | libk5crypto3 102 | libkeyutils1 103 | libkrb5-3 104 | libkrb5support0 105 | 106 | liblocale-gettext-perl 107 | liblzma5 108 | liblz4-1 109 | 110 | libmnl0 111 | libmount1 112 | libmd0 113 | 114 | libncurses5 115 | libncursesw5 116 | libnewt0.52 117 | libnfnetlink0 118 | libnetfilter-conntrack3 119 | libnpth0 120 | libncursesw6 121 | libnettle8 122 | libnftables1 123 | libnftnl11 124 | libnsl2 125 | 126 | libpam-modules 127 | libpam-modules-bin 128 | libpam-runtime 129 | libpam0g 130 | libpcre3 131 | libpipeline1 132 | libpopt0 133 | libp11-kit0 134 | libpcre2-8-0 135 | 136 | libreadline8 137 | 138 | libseccomp2 139 | libselinux1 140 | libsemanage-common 141 | libsemanage1 142 | libsepol1 143 | libslang2 144 | libsmartcols1 145 | libss2 146 | libstdc++6 147 | libsqlite3-0 148 | libssl1.1 149 | 150 | libtasn1-6 151 | libtinfo6 152 | libtirpc-common 153 | libtirpc3 154 | 155 | libunistring2 156 | libuuid1 157 | 158 | libxapian30 159 | libxtables12 160 | libxxhash0 161 | 162 | libzstd1 163 | 164 | login 165 | lsb-base 166 | 167 | mawk 168 | mount 169 | 170 | ncurses-base 171 | ncurses-bin 172 | net-tools 173 | netbase 174 | nftables 175 | 176 | perl-base 177 | passwd 178 | pinentry-curses 179 | procps 180 | 181 | readline-common 182 | 183 | sed 184 | sensible-utils 185 | startpar 186 | sysv-rc 187 | sysvinit 188 | sysvinit-core 189 | sysvinit-utils 190 | 191 | tar 192 | tasksel 193 | tasksel-data 194 | tzdata 195 | 196 | util-linux 197 | 198 | vim-common 199 | 200 | xxd 201 | 202 | zlib1g 203 | " 204 | 205 | DISTRO_EXTRA_PACKAGES="build-essential devscripts equivs" 206 | 207 | include_target common/devuan/mirror 208 | include_target common/target-apt-repo 209 | include_target common/remove-files 210 | -------------------------------------------------------------------------------- /cf/target/common/devuan/daedalus.cf: -------------------------------------------------------------------------------- 1 | # phase 0: debootstrap 2 | DISTRO_DESCRIPTION="Devuan daedalus" 3 | DISTRO_NAME="daedalus" 4 | DISTRO_VARIANT="minbase" 5 | 6 | # phase 1: install extra packages 7 | DISTRO_EXTRA_PACKAGES="build-essential devscripts equivs devuan-keyring" 8 | 9 | # phase 2: mark auto-installed and do autoremove 10 | DISTRO_MARK_AUTO=" 11 | adduser 12 | apt 13 | base-files 14 | base-passwd 15 | bash 16 | bootlogd 17 | bsdutils 18 | coreutils 19 | dash 20 | debconf 21 | debianutils 22 | diffutils 23 | dpkg 24 | e2fsprogs 25 | findutils 26 | gpgv 27 | grep 28 | gzip 29 | hostname 30 | init-system-helpers 31 | initscripts 32 | insserv 33 | libacl1 34 | libapt-pkg6.0 35 | libattr1 36 | libaudit-common 37 | libaudit1 38 | libblkid1 39 | libbz2-1.0 40 | libc-bin 41 | libc6 42 | libcap-ng0 43 | libcom-err2 44 | libcrypt1 45 | libdb5.3 46 | libdebconfclient0 47 | libeudev1 48 | libgcc-s1 49 | libgcrypt20 50 | libgmp10 51 | libgnutls30 52 | libgpg-error0 53 | libhogweed6 54 | libidn2-0 55 | liblz4-1 56 | liblzma5 57 | libmd0 58 | libmount1 59 | libnettle8 60 | libp11-kit0 61 | libpam-modules 62 | libpam-modules-bin 63 | libpam-runtime 64 | libpam0g 65 | libpcre2-8-0 66 | libseccomp2 67 | libselinux1 68 | libsemanage-common 69 | libsmartcols1 70 | libss2 71 | libstdc++6 72 | libtasn1-6 73 | libtinfo6 74 | libunistring2 75 | libuuid1 76 | libxxhash0 77 | libzstd1 78 | login 79 | mawk 80 | mount 81 | ncurses-base 82 | ncurses-bin 83 | netbase 84 | passwd 85 | perl-base 86 | sed 87 | startpar 88 | sysv-rc 89 | sysvinit-core 90 | sysvinit-utils 91 | tar 92 | tzdata 93 | util-linux 94 | zlib1g 95 | " 96 | 97 | # phase 3: forced removal of some packages 98 | # note: order can be important here 99 | DISTRO_REMOVE_PACKAGES=" 100 | bootlogd 101 | tzdata 102 | " 103 | 104 | include_target common/devuan/mirror 105 | include_target common/target-apt-repo 106 | include_target common/remove-files 107 | -------------------------------------------------------------------------------- /cf/target/common/devuan/mirror.cf: -------------------------------------------------------------------------------- 1 | DISTRO_COMPONENTS="main,contrib,non-free" 2 | # DISTRO_MIRROR="http://auto.mirror.devuan.org/merged" 3 | DISTRO_MIRROR="http://deb.devuan.org/merged" 4 | DISTRO_PROXY="$http_proxy" 5 | DISTRO_KEYRING="keys/devuan/${DISTRO_NAME}.gpg" 6 | 7 | DISTRO_APT_EXTRA_SOURCES=" 8 | ${DISTRO_APT_EXTRA_SOURCES} 9 | #deb ${DISTRO_MIRROR} ${DISTRO_NAME} main contrib non-free 10 | deb ${DISTRO_MIRROR} ${DISTRO_NAME}-updates main contrib non-free 11 | deb ${DISTRO_MIRROR} ${DISTRO_NAME}-security main contrib non-free 12 | deb ${DISTRO_MIRROR} ${DISTRO_NAME}-backports main contrib non-free 13 | " 14 | 15 | DISTRO_INIT_CMD="/bin/sleep infinity" 16 | DISTRO_BUILDER_IMAGE="debian:stable" 17 | # DISTRO_BUILDER_IMAGE="dyne/devuan:beowulf" 18 | -------------------------------------------------------------------------------- /cf/target/common/devuan/testing.cf: -------------------------------------------------------------------------------- 1 | # phase 0: debootstrap 2 | DISTRO_DESCRIPTION="Devuan daedalus" 3 | DISTRO_NAME="testing" 4 | DISTRO_VARIANT="minbase" 5 | 6 | # phase 1: install extra packages 7 | DISTRO_EXTRA_PACKAGES="build-essential devscripts equivs devuan-keyring" 8 | 9 | # phase 2: mark auto-installed and do autoremove 10 | DISTRO_MARK_AUTO=" 11 | adduser 12 | apt 13 | base-files 14 | base-passwd 15 | bash 16 | bootlogd 17 | bsdutils 18 | coreutils 19 | dash 20 | debconf 21 | debianutils 22 | diffutils 23 | dpkg 24 | e2fsprogs 25 | findutils 26 | gpgv 27 | grep 28 | gzip 29 | hostname 30 | init-system-helpers 31 | initscripts 32 | insserv 33 | libacl1 34 | libapt-pkg6.0 35 | libattr1 36 | libaudit-common 37 | libaudit1 38 | libblkid1 39 | libbz2-1.0 40 | libc-bin 41 | libc6 42 | libcap-ng0 43 | libcom-err2 44 | libcrypt1 45 | libdb5.3 46 | libdebconfclient0 47 | libeudev1 48 | libgcc-s1 49 | libgcrypt20 50 | libgmp10 51 | libgnutls30 52 | libgpg-error0 53 | libhogweed6 54 | libidn2-0 55 | liblz4-1 56 | liblzma5 57 | libmd0 58 | libmount1 59 | libnettle8 60 | libp11-kit0 61 | libpam-modules 62 | libpam-modules-bin 63 | libpam-runtime 64 | libpam0g 65 | libpcre2-8-0 66 | libseccomp2 67 | libselinux1 68 | libsemanage-common 69 | libsmartcols1 70 | libss2 71 | libstdc++6 72 | libtasn1-6 73 | libtinfo6 74 | libunistring2 75 | libuuid1 76 | libxxhash0 77 | libzstd1 78 | login 79 | mawk 80 | mount 81 | ncurses-base 82 | ncurses-bin 83 | netbase 84 | passwd 85 | perl-base 86 | sed 87 | startpar 88 | sysv-rc 89 | sysvinit-core 90 | sysvinit-utils 91 | tar 92 | tzdata 93 | util-linux 94 | zlib1g 95 | " 96 | 97 | # phase 3: forced removal of some packages 98 | # note: order can be important here 99 | DISTRO_REMOVE_PACKAGES=" 100 | bootlogd 101 | tzdata 102 | " 103 | 104 | include_target common/devuan/mirror 105 | include_target common/target-apt-repo 106 | include_target common/remove-files 107 | -------------------------------------------------------------------------------- /cf/target/common/devuan/unstable.cf: -------------------------------------------------------------------------------- 1 | # phase 0: debootstrap 2 | DISTRO_DESCRIPTION="Devuan daedalus" 3 | DISTRO_NAME="unstable" 4 | DISTRO_VARIANT="minbase" 5 | 6 | # phase 1: install extra packages 7 | DISTRO_EXTRA_PACKAGES="build-essential devscripts equivs devuan-keyring" 8 | 9 | # phase 2: mark auto-installed and do autoremove 10 | DISTRO_MARK_AUTO=" 11 | adduser 12 | apt 13 | base-files 14 | base-passwd 15 | bash 16 | bootlogd 17 | bsdutils 18 | coreutils 19 | dash 20 | debconf 21 | debianutils 22 | diffutils 23 | dpkg 24 | e2fsprogs 25 | findutils 26 | gcc-13-base 27 | gpgv 28 | grep 29 | gzip 30 | hostname 31 | init-system-helpers 32 | initscripts 33 | insserv 34 | libacl1 35 | libapt-pkg6.0 36 | libattr1 37 | libaudit-common 38 | libaudit1 39 | libblkid1 40 | libbz2-1.0 41 | libc-bin 42 | libc6 43 | libcap-ng0 44 | libcom-err2 45 | libcrypt1 46 | libdb5.3 47 | libdebconfclient0 48 | libeudev1 49 | libext2fs2 50 | libffi8 51 | libgcc-s1 52 | libgcrypt20 53 | libgmp10 54 | libgnutls30 55 | libgpg-error0 56 | libhogweed6 57 | libidn2-0 58 | liblz4-1 59 | liblzma5 60 | libmd0 61 | libmount1 62 | libnettle8 63 | libp11-kit0 64 | libpam-modules 65 | libpam-modules-bin 66 | libpam-runtime 67 | libpam0g 68 | libpcre2-8-0 69 | libseccomp2 70 | libselinux1 71 | libsemanage-common 72 | libsemanage2 73 | libsepol2 74 | libsmartcols1 75 | libss2 76 | libstdc++6 77 | libtasn1-6 78 | libtinfo6 79 | libunistring2 80 | libuuid1 81 | libxxhash0 82 | libzstd1 83 | login 84 | logsave 85 | mawk 86 | mount 87 | ncurses-base 88 | ncurses-bin 89 | netbase 90 | passwd 91 | perl-base 92 | sed 93 | startpar 94 | sysv-rc 95 | sysvinit-core 96 | sysvinit-utils 97 | tar 98 | tzdata 99 | usr-is-merged 100 | util-linux 101 | zlib1g 102 | " 103 | 104 | # phase 3: forced removal of some packages 105 | # note: order can be important here 106 | DISTRO_REMOVE_PACKAGES=" 107 | bootlogd 108 | " 109 | 110 | include_target common/devuan/mirror 111 | include_target common/target-apt-repo 112 | include_target common/remove-files 113 | -------------------------------------------------------------------------------- /cf/target/common/remove-files.cf: -------------------------------------------------------------------------------- 1 | DISTRO_REMOVE_FILES=" 2 | ${DISTRO_REMOVE_FILES} 3 | 4 | /var/cache/apt 5 | /var/log/alternatives.log 6 | /var/log/dmesg.0 7 | /var/log/dpkg.log 8 | /var/log/fsck 9 | /var/lib/systemd 10 | /usr/local 11 | /usr/share/bug 12 | /usr/share/doc 13 | /usr/share/common-licenses 14 | /usr/share/info 15 | /usr/share/pixmaps 16 | 17 | /usr/share/locale/af 18 | /usr/share/locale/bal 19 | /usr/share/locale/bn_IN 20 | /usr/share/locale/cs 21 | /usr/share/locale/dz 22 | /usr/share/locale/et_EE 23 | /usr/share/locale/fr 24 | /usr/share/locale/he 25 | /usr/share/locale/ia 26 | /usr/share/locale/ka 27 | /usr/share/locale/ko 28 | /usr/share/locale/lg 29 | /usr/share/locale/ml 30 | /usr/share/locale/nds 31 | /usr/share/locale/or 32 | /usr/share/locale/pt_BR 33 | /usr/share/locale/si 34 | /usr/share/locale/sr 35 | /usr/share/locale/te 36 | /usr/share/locale/tr 37 | /usr/share/locale/zh_CN 38 | /usr/share/locale/ar 39 | /usr/share/locale/be 40 | /usr/share/locale/br 41 | /usr/share/locale/cy 42 | /usr/share/locale/el 43 | /usr/share/locale/eo 44 | /usr/share/locale/eu 45 | /usr/share/locale/ga 46 | /usr/share/locale/hi 47 | /usr/share/locale/id 48 | /usr/share/locale/kk 49 | /usr/share/locale/ks 50 | /usr/share/locale/lt 51 | /usr/share/locale/mr 52 | /usr/share/locale/ne 53 | /usr/share/locale/pa 54 | /usr/share/locale/ro 55 | /usr/share/locale/sk 56 | /usr/share/locale/sr@latin 57 | /usr/share/locale/tg 58 | /usr/share/locale/uk 59 | /usr/share/locale/zh_HK 60 | /usr/share/locale/as 61 | /usr/share/locale/bg 62 | /usr/share/locale/bs 63 | /usr/share/locale/da 64 | /usr/share/locale/es 65 | /usr/share/locale/fa 66 | /usr/share/locale/gl 67 | /usr/share/locale/hr 68 | /usr/share/locale/it 69 | /usr/share/locale/km 70 | /usr/share/locale/ku 71 | /usr/share/locale/lv 72 | /usr/share/locale/ms 73 | /usr/share/locale/nl 74 | /usr/share/locale/pl 75 | /usr/share/locale/ru 76 | /usr/share/locale/sl 77 | /usr/share/locale/sv 78 | /usr/share/locale/th 79 | /usr/share/locale/ur 80 | /usr/share/locale/zh_TW 81 | /usr/share/locale/ast 82 | /usr/share/locale/bn 83 | /usr/share/locale/ca 84 | /usr/share/locale/et 85 | /usr/share/locale/fi 86 | /usr/share/locale/gu 87 | /usr/share/locale/hu 88 | /usr/share/locale/ja 89 | /usr/share/locale/kn 90 | /usr/share/locale/ky 91 | /usr/share/locale/mai 92 | /usr/share/locale/nb 93 | /usr/share/locale/nn 94 | /usr/share/locale/pt 95 | /usr/share/locale/rw 96 | /usr/share/locale/sq 97 | /usr/share/locale/ta 98 | /usr/share/locale/tl 99 | /usr/share/locale/vi 100 | /usr/share/locale/zu 101 | 102 | /usr/share/man/cs 103 | /usr/share/man/da 104 | /usr/share/man/es 105 | /usr/share/man/fi 106 | /usr/share/man/fr 107 | /usr/share/man/hu 108 | /usr/share/man/id 109 | /usr/share/man/it 110 | /usr/share/man/ja 111 | /usr/share/man/ko 112 | /usr/share/man/pl 113 | /usr/share/man/pt 114 | /usr/share/man/pt_BR 115 | /usr/share/man/ru 116 | /usr/share/man/sl 117 | /usr/share/man/sv 118 | /usr/share/man/tr 119 | /usr/share/man/zh_CN 120 | /usr/share/man/zh_TW 121 | 122 | /opt 123 | /mnt 124 | /media 125 | /etc/opt 126 | /home 127 | /srv 128 | /usr/src 129 | /usr/games 130 | /var/local 131 | " 132 | 133 | DISTRO_APT_CONFIG="${DISTRO_APT_CONFIG} 134 | Apt::AutoRemove::SuggestsImportant \"false\" ; 135 | Apt::AutoRemove::RecommendsImportant \"false\" ; 136 | APT::Install-Recommends \"false\"; 137 | APT::Install-Suggests \"false\"; 138 | " 139 | -------------------------------------------------------------------------------- /cf/target/common/target-apt-repo.cf: -------------------------------------------------------------------------------- 1 | DISTRO_TARGET_NAME="${DISTRO_NAME}" 2 | DISTRO_TARGET_COMPONENT="contrib" 3 | 4 | ## comment out if build containers should not use locally built apt repo for dependency installation 5 | DISTRO_APT_USE_BUILT_REPO=1 6 | 7 | DISTRO_APT_USE_CACHE_VOLUME=1 8 | 9 | ## automatically regenerate target repo indices 10 | DISTRO_APT_AUTO_REGENERATE=1 11 | -------------------------------------------------------------------------------- /cf/target/common/ubuntu/focal.cf: -------------------------------------------------------------------------------- 1 | DISTRO_DESCRIPTION="Ubuntu Focal" 2 | DISTRO_NAME="focal" 3 | DISTRO_INCLUDE="perl-openssl-defaults,build-essential,devscripts,equivs" 4 | 5 | XDISTRO_MARK_AUTO=" 6 | 7 | adduser 8 | apt 9 | apt-utils 10 | 11 | base-files 12 | base-passwd 13 | bash 14 | binutils 15 | bsdutils 16 | busybox-initramfs 17 | bzip2 18 | 19 | coreutils 20 | cpio 21 | console-setup 22 | console-setup-linux 23 | cpp 24 | cpp-5 25 | cron 26 | 27 | dash 28 | debconf 29 | debconf-i18n 30 | debianutils 31 | dh-python 32 | diffutils 33 | distro-info-data 34 | dpkg 35 | dpkg-dev 36 | 37 | e2fslibs 38 | e2fsprogs 39 | eject 40 | 41 | file 42 | findutils 43 | 44 | g++ 45 | g++-5 46 | gcc 47 | gcc-5 48 | gcc-5-base 49 | gcc-6-base 50 | gnupg 51 | gpgv 52 | grep 53 | gzip 54 | 55 | hostname 56 | 57 | isc-dhcp-client 58 | isc-dhcp-common 59 | init-system-helpers 60 | initramfs-tools 61 | initramfs-tools-bin 62 | initramfs-tools-core 63 | initscripts 64 | insserv 65 | iputils-ping 66 | 67 | keyboard-configuration 68 | krb5-locales 69 | kmod 70 | klibc-utils 71 | kbd 72 | 73 | lsb-release 74 | lsb-base 75 | less 76 | 77 | libacl1 78 | libapparmor1 79 | libapt-inst2.0 80 | libapt-pkg5.0 81 | libasan2 82 | libatm1 83 | libatomic1 84 | libattr1 85 | libaudit-common 86 | libaudit1 87 | 88 | libblkid1 89 | libbsd0 90 | libbz2-1.0 91 | 92 | libc-bin 93 | libc-dev-bin 94 | libc6 95 | libc6-dev 96 | libcap2 97 | libcap2-bin 98 | libcc1-0 99 | libcilkrts5 100 | libcomerr2 101 | libcryptsetup4 102 | 103 | libdb5.3 104 | libdebconfclient0 105 | libdevmapper1.02.1 106 | libdns-export162 107 | libdpkg-perl 108 | 109 | libestr0 110 | libexpat1 111 | 112 | libfdisk1 113 | libffi6 114 | libfribidi0 115 | 116 | libgcc-5-dev 117 | libgcc1 118 | libgcrypt20 119 | libgdbm3 120 | libgmp10 121 | libgnutls-openssl27 122 | libgnutls30 123 | libgomp1 124 | libgpg-error0 125 | 126 | libhogweed4 127 | 128 | libidn11 129 | libisc-export160 130 | libisl15 131 | libitm1 132 | 133 | libjson-c2 134 | 135 | libklibc 136 | libkmod2 137 | 138 | liblocale-gettext-perl 139 | liblz4-1 140 | liblzma5 141 | liblsan0 142 | 143 | libmagic1 144 | libmnl0 145 | libmount1 146 | libmpc3 147 | libmpdec2 148 | libmpfr4 149 | libmpx0 150 | 151 | libncurses5 152 | libncursesw5 153 | libnettle6 154 | libnewt0.52 155 | libnih1 156 | 157 | libp11-kit0 158 | libpam-modules 159 | libpam-modules-bin 160 | libpam-runtime 161 | libpam0g 162 | libpcre3 163 | libperl5.22 164 | libpng12-0 165 | libpopt0 166 | libprocps4 167 | libpython3-stdlib 168 | libpython3.5-minimal 169 | libpython3.5-stdlib 170 | 171 | libquadmath0 172 | 173 | libreadline6 174 | 175 | libstdc++-5-dev 176 | libsystemd0 177 | libsasl2-2 178 | libsasl2-modules 179 | libsasl2-modules-db 180 | libseccomp2 181 | libselinux1 182 | libsemanage-common 183 | libsemanage1 184 | libsepol1 185 | libslang2 186 | libsqlite3-0 187 | libssl1.0.0 188 | libss2 189 | libstdc++6 190 | libsmartcols1 191 | 192 | libtsan0 193 | libtext-charwidth-perl 194 | libtext-wrapi18n-perl 195 | libtasn1-6 196 | libtinfo5 197 | libtext-iconv-perl 198 | 199 | libubsan0 200 | libudev1 201 | libusb-0.1-4 202 | libustr-1.0-1 203 | libuuid1 204 | 205 | libxtables11 206 | 207 | linux-libc-dev 208 | 209 | locales 210 | logrotate 211 | 212 | make 213 | makedev 214 | mime-support 215 | multiarch-support 216 | mawk 217 | mount 218 | 219 | netcat-openbsd 220 | ncurses-base 221 | ncurses-bin 222 | net-tools 223 | 224 | passwd 225 | perl 226 | perl-base 227 | perl-modules-5.22 228 | python3 229 | python3.5 230 | python3-minimal 231 | python3.5-minimal 232 | patch 233 | procps 234 | 235 | resolvconf 236 | rsyslog 237 | readline-common 238 | 239 | sed 240 | sensible-utils 241 | systemd 242 | systemd-sysv 243 | 244 | tar 245 | tzdata 246 | 247 | ucf 248 | ureadahead 249 | ubuntu-minimal 250 | udev 251 | util-linux 252 | 253 | vim-common 254 | vim-tiny 255 | 256 | whiptail 257 | 258 | xkb-data 259 | xz-utils 260 | 261 | zlib1g 262 | " 263 | 264 | include_target common/ubuntu/mirror 265 | include_target common/target-apt-repo 266 | include_target common/remove-files 267 | -------------------------------------------------------------------------------- /cf/target/common/ubuntu/mirror.cf: -------------------------------------------------------------------------------- 1 | DISTRO_COMPONENTS="main,restricted,universe,multiverse" 2 | DISTRO_MIRROR="http://de.archive.ubuntu.com/ubuntu/" 3 | DISTRO_PROXY="$http_proxy" 4 | DISTRO_KEYRING="keys/ubuntu/${DISTRO_NAME}.gpg" 5 | 6 | DISTRO_APT_EXTRA_SOURCES=" 7 | deb ${DISTRO_MIRROR} ${DISTRO_NAME}-updates main restricted universe multiverse 8 | deb ${DISTRO_MIRROR} ${DISTRO_NAME}-security main restricted universe multiverse 9 | deb ${DISTRO_MIRROR} ${DISTRO_NAME}-backports main restricted universe multiverse 10 | " 11 | -------------------------------------------------------------------------------- /cf/target/common/ubuntu/xenial.cf: -------------------------------------------------------------------------------- 1 | DISTRO_DESCRIPTION="Ubuntu Xenial" 2 | DISTRO_NAME="xenial" 3 | DISTRO_INCLUDE="build-essential,devscripts,equivs" 4 | 5 | DISTRO_MARK_AUTO=" 6 | 7 | adduser 8 | apt 9 | apt-utils 10 | 11 | base-files 12 | base-passwd 13 | bash 14 | binutils 15 | bsdutils 16 | busybox-initramfs 17 | bzip2 18 | 19 | coreutils 20 | cpio 21 | console-setup 22 | console-setup-linux 23 | cpp 24 | cpp-5 25 | cron 26 | 27 | dash 28 | debconf 29 | debconf-i18n 30 | debianutils 31 | dh-python 32 | diffutils 33 | distro-info-data 34 | dpkg 35 | dpkg-dev 36 | 37 | e2fslibs 38 | e2fsprogs 39 | eject 40 | 41 | file 42 | findutils 43 | 44 | g++ 45 | g++-5 46 | gcc 47 | gcc-5 48 | gcc-5-base 49 | gcc-6-base 50 | gnupg 51 | gpgv 52 | grep 53 | gzip 54 | 55 | hostname 56 | 57 | isc-dhcp-client 58 | isc-dhcp-common 59 | init-system-helpers 60 | initramfs-tools 61 | initramfs-tools-bin 62 | initramfs-tools-core 63 | initscripts 64 | insserv 65 | iputils-ping 66 | 67 | keyboard-configuration 68 | krb5-locales 69 | kmod 70 | klibc-utils 71 | kbd 72 | 73 | lsb-release 74 | lsb-base 75 | less 76 | 77 | libacl1 78 | libapparmor1 79 | libapt-inst2.0 80 | libapt-pkg5.0 81 | libasan2 82 | libatm1 83 | libatomic1 84 | libattr1 85 | libaudit-common 86 | libaudit1 87 | 88 | libblkid1 89 | libbsd0 90 | libbz2-1.0 91 | 92 | libc-bin 93 | libc-dev-bin 94 | libc6 95 | libc6-dev 96 | libcap2 97 | libcap2-bin 98 | libcc1-0 99 | libcilkrts5 100 | libcomerr2 101 | libcryptsetup4 102 | 103 | libdb5.3 104 | libdebconfclient0 105 | libdevmapper1.02.1 106 | libdns-export162 107 | libdpkg-perl 108 | 109 | libestr0 110 | libexpat1 111 | 112 | libfdisk1 113 | libffi6 114 | libfribidi0 115 | 116 | libgcc-5-dev 117 | libgcc1 118 | libgcrypt20 119 | libgdbm3 120 | libgmp10 121 | libgnutls-openssl27 122 | libgnutls30 123 | libgomp1 124 | libgpg-error0 125 | 126 | libhogweed4 127 | 128 | libidn11 129 | libisc-export160 130 | libisl15 131 | libitm1 132 | 133 | libjson-c2 134 | 135 | libklibc 136 | libkmod2 137 | 138 | liblocale-gettext-perl 139 | liblz4-1 140 | liblzma5 141 | liblsan0 142 | 143 | libmagic1 144 | libmnl0 145 | libmount1 146 | libmpc3 147 | libmpdec2 148 | libmpfr4 149 | libmpx0 150 | 151 | libncurses5 152 | libncursesw5 153 | libnettle6 154 | libnewt0.52 155 | libnih1 156 | 157 | libp11-kit0 158 | libpam-modules 159 | libpam-modules-bin 160 | libpam-runtime 161 | libpam0g 162 | libpcre3 163 | libperl5.22 164 | libpng12-0 165 | libpopt0 166 | libprocps4 167 | libpython3-stdlib 168 | libpython3.5-minimal 169 | libpython3.5-stdlib 170 | 171 | libquadmath0 172 | 173 | libreadline6 174 | 175 | libstdc++-5-dev 176 | libsystemd0 177 | libsasl2-2 178 | libsasl2-modules 179 | libsasl2-modules-db 180 | libseccomp2 181 | libselinux1 182 | libsemanage-common 183 | libsemanage1 184 | libsepol1 185 | libslang2 186 | libsqlite3-0 187 | libssl1.0.0 188 | libss2 189 | libstdc++6 190 | libsmartcols1 191 | 192 | libtsan0 193 | libtext-charwidth-perl 194 | libtext-wrapi18n-perl 195 | libtasn1-6 196 | libtinfo5 197 | libtext-iconv-perl 198 | 199 | libubsan0 200 | libudev1 201 | libusb-0.1-4 202 | libustr-1.0-1 203 | libuuid1 204 | 205 | libxtables11 206 | 207 | linux-libc-dev 208 | 209 | locales 210 | logrotate 211 | 212 | make 213 | makedev 214 | mime-support 215 | multiarch-support 216 | mawk 217 | mount 218 | 219 | netcat-openbsd 220 | ncurses-base 221 | ncurses-bin 222 | net-tools 223 | 224 | passwd 225 | perl 226 | perl-base 227 | perl-modules-5.22 228 | python3 229 | python3.5 230 | python3-minimal 231 | python3.5-minimal 232 | patch 233 | procps 234 | 235 | resolvconf 236 | rsyslog 237 | readline-common 238 | 239 | sed 240 | sensible-utils 241 | systemd 242 | systemd-sysv 243 | 244 | tar 245 | tzdata 246 | 247 | ucf 248 | ureadahead 249 | ubuntu-minimal 250 | udev 251 | util-linux 252 | 253 | vim-common 254 | vim-tiny 255 | 256 | whiptail 257 | 258 | xkb-data 259 | xz-utils 260 | 261 | zlib1g 262 | " 263 | 264 | include_target common/ubuntu/mirror 265 | include_target common/target-apt-repo 266 | include_target common/remove-files 267 | -------------------------------------------------------------------------------- /cf/target/devuan-beowulf-amd64.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="amd64" 2 | 3 | include_target common/devuan/beowulf 4 | -------------------------------------------------------------------------------- /cf/target/devuan-beowulf-i386.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="i386" 2 | 3 | include_target common/devuan/beowulf 4 | -------------------------------------------------------------------------------- /cf/target/devuan-chimaera-amd64.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="amd64" 2 | 3 | include_target common/devuan/chimaera 4 | -------------------------------------------------------------------------------- /cf/target/devuan-chimaera-i386.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="i386" 2 | 3 | include_target common/devuan/chimaera 4 | -------------------------------------------------------------------------------- /cf/target/devuan-daedalus-amd64.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="amd64" 2 | 3 | include_target common/devuan/daedalus 4 | -------------------------------------------------------------------------------- /cf/target/devuan-daedalus-i386.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="i386" 2 | 3 | include_target common/devuan/daedalus 4 | -------------------------------------------------------------------------------- /cf/target/devuan-testing-amd64.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="amd64" 2 | 3 | include_target common/devuan/testing 4 | -------------------------------------------------------------------------------- /cf/target/devuan-testing-i386.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="i386" 2 | 3 | include_target common/devuan/testing 4 | -------------------------------------------------------------------------------- /cf/target/devuan-unstable-amd64.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="amd64" 2 | 3 | include_target common/devuan/unstable 4 | -------------------------------------------------------------------------------- /cf/target/devuan-unstable-i386.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="i386" 2 | 3 | include_target common/devuan/unstable 4 | -------------------------------------------------------------------------------- /cf/target/dng-beowulf-amd64.cf: -------------------------------------------------------------------------------- 1 | devuan-beowulf-amd64.cf -------------------------------------------------------------------------------- /cf/target/dng-beowulf-i386.cf: -------------------------------------------------------------------------------- 1 | devuan-beowulf-i386.cf -------------------------------------------------------------------------------- /cf/target/dng-chimaera-amd64.cf: -------------------------------------------------------------------------------- 1 | devuan-chimaera-amd64.cf -------------------------------------------------------------------------------- /cf/target/dng-chimaera-i386.cf: -------------------------------------------------------------------------------- 1 | devuan-chimaera-i386.cf -------------------------------------------------------------------------------- /cf/target/stretch-amd64.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="amd64" 2 | 3 | include_target common/debian/stretch 4 | -------------------------------------------------------------------------------- /cf/target/stretch-i386.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="i386" 2 | 3 | include_target common/debian/stretch 4 | -------------------------------------------------------------------------------- /cf/target/ubuntu-focal-amd64.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="amd64" 2 | 3 | include_target common/ubuntu/focal 4 | -------------------------------------------------------------------------------- /cf/target/ubuntu-focal-i386.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="i386" 2 | 3 | include_target common/ubuntu/focal 4 | -------------------------------------------------------------------------------- /cf/target/xenial-amd64.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="amd64" 2 | 3 | include_target common/ubuntu/xenial 4 | -------------------------------------------------------------------------------- /cf/target/xenial-i386.cf: -------------------------------------------------------------------------------- 1 | DISTRO_ARCH="i386" 2 | 3 | include_target common/ubuntu/xenial 4 | -------------------------------------------------------------------------------- /dck-buildpackage: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DCK_BUILDPACKAGE_PREFIX=$(readlink -f $(dirname $(readlink -f $0))) 4 | DCK_BUILDPACKAGE_LIBDIR=$DCK_BUILDPACKAGE_PREFIX/lib 5 | DCK_BUILDPACKAGE_CFDIR=$DCK_BUILDPACKAGE_PREFIX/cf 6 | 7 | . $DCK_BUILDPACKAGE_LIBDIR/main.sh 8 | -------------------------------------------------------------------------------- /dependencies: -------------------------------------------------------------------------------- 1 | uuid-runtime 2 | -------------------------------------------------------------------------------- /lib/aptcache.sh: -------------------------------------------------------------------------------- 1 | 2 | get_aptcache_dir() { 3 | echo -n "/var/cache/apt/archives" 4 | } 5 | 6 | get_aptcache_volumes() { 7 | docker_volume_list | grep -e "^dckbp-aptacache-" 8 | } 9 | 10 | create_aptcache_volume() { 11 | local volume_id=$(cf_distro_aptcache_volume) 12 | info "apt-cache volume: $volume_id" 13 | docker_volume_create $volume_id 14 | } 15 | -------------------------------------------------------------------------------- /lib/aptrepo.sh: -------------------------------------------------------------------------------- 1 | 2 | aptrepo_prepare() { 3 | mkdir -p "$(cf_distro_target_repo)" 4 | } 5 | 6 | ## copy out an package from docker instance into local repo 7 | aptrepo_copy_from_docker() { 8 | local container_id="$1" 9 | local container_dir="$2" 10 | local pkgname="$3" 11 | local myuid="$(id -u)" 12 | local mygid="$(id -g)" 13 | 14 | local debfiles=`docker_exec_sh $container_id find $container_dir -maxdepth 1 -name "*.deb"` 15 | local pool_subdir="pool/dists/$DISTRO_NAME/$DISTRO_TARGET_COMPONENT/$pkgname" 16 | local pool_dir="$(cf_distro_target_repo)/$pool_subdir" 17 | local stat_file="$(cf_distro_target_repo)/stat/$pkgname/latest-debs" 18 | info "apt repo pool dir=$pool_dir" 19 | mkdir -p $(dirname "$stat_file") 20 | echo -n > $stat_file 21 | for i in $debfiles ; do 22 | info "remote debfile: $i" 23 | docker_cp_from $container_id "$i" $pool_dir 24 | echo "$pool_subdir/$(basename $i)" >> $stat_file 25 | done 26 | } 27 | 28 | _aptrepo_tmpl() { 29 | local cfdir="$DCK_BUILDPACKAGE_CFDIR/apt" 30 | local fn="$1" 31 | local repo_dir="$(cf_distro_target_repo)" 32 | 33 | mkdir -p $repo_dir/conf 34 | cat $cfdir/$fn.tmpl \ 35 | | sed -e "s~@SECTIONS@~$DISTRO_TARGET_COMPONENT~g;" \ 36 | | sed -e "s~@ARCHITECTURES@~$DISTRO_APT_ARCHS~g;" \ 37 | | sed -e "s~@DISTRO@~$DISTRO_TARGET_NAME~g; " \ 38 | | sed -e "s~@CODENAME@~$DISTRO_TARGET_NAME~g;" \ 39 | | sed -e "s~@LABEL@~$DISTRO_TARGET_NAME~g;" \ 40 | | sed -e "s~@COMPONENTS@~$DISTRO_TARGET_COMPONENT~g;" \ 41 | | sed -e "s~@DESCRIPTION@~locally built by $(whoami)@$(hostname) via dck-buildpackage -- https://github.com/metux/docker-buildpackage~g;" \ 42 | > $repo_dir/conf/$fn 43 | } 44 | 45 | aptrepo_update() { 46 | local repo_dir="$(cf_distro_target_repo)" 47 | local dist_root="$repo_dir/dists/$DISTRO_TARGET_NAME" 48 | 49 | [ "$repo_dir" ] || die "apt repo dir undefined" 50 | 51 | info "apt repo dir: $repo_dir" 52 | 53 | _aptrepo_tmpl apt-ftparchive.conf 54 | 55 | rm -rf $repo_dir/cache 56 | 57 | mkdir -p $repo_dir/cache \ 58 | $repo_dir/pool/dists/$DISTRO_TARGET_NAME/$DISTRO_TARGET_COMPONENT \ 59 | $dist_root/$DISTRO_TARGET_COMPONENT/binary-$DISTRO_ARCH/ \ 60 | 61 | for a in $DISTRO_APT_ARCHS ; do 62 | mkdir -p $dist_root/$DISTRO_TARGET_COMPONENT/binary-$a 63 | touch $dist_root/$DISTRO_TARGET_COMPONENT/binary-$a/Packages 64 | done 65 | 66 | (cd $repo_dir && apt-ftparchive generate $repo_dir/conf/apt-ftparchive.conf \ 67 | && apt-ftparchive -c $repo_dir/conf/apt-ftparchive.conf release $dist_root > $dist_root/Release.tmp \ 68 | && mv $dist_root/Release.tmp $dist_root/Release ) || die "apt-ftparchive failed" 69 | 70 | rm -f $dist_root/Release.gpg $repo_dir/apt-repo.pub 71 | 72 | if [ "$DCK_BUILDPACKAGE_SIGNKEY" ]; then 73 | GPG_SIGN_PARAM="-u $DCK_BUILDPACKAGE_SIGNKEY" 74 | GPG_EXPORT_PARAM="$DCK_BUILDPACKAGE_SIGNKE"Y 75 | info "Using GPG key: $DCK_BUILDPACKAGE_SIGNKEY" 76 | gpg -u "$DCK_BUILDPACKAGE_SIGNKEY" -abs -o $dist_root/Release.gpg $dist_root/Release || die 'signing failed. did you create a key ? maybe set $DCK_BUILDPACKAGE_SIGNKEY' 77 | gpg --output "$repo_dir/apt-repo.pub" --armor --export "$DCK_BUILDPACKAGE_SIGNKEY" || die 'key export failed. did you create a key ?' 78 | else 79 | info 'Using default GPG key. You might want to spefify key ID via $DCK_BUILDPACKAGE_SIGNKEY' 80 | gpg -abs -o $dist_root/Release.gpg $dist_root/Release || die 'signing failed. did you create a key ? maybe set $DCK_BUILDPACKAGE_SIGNKEY' 81 | gpg --output "$repo_dir/apt-repo.pub" --armor --export || die 'key export failed. did you create a key ?' 82 | fi 83 | 84 | info "FINISHED apt repo: $repo_dir" 85 | } 86 | 87 | # regenerate the local apt repo index 88 | cmd_update_aptrepo() { 89 | load_dist_conf 90 | aptrepo_update 91 | } 92 | -------------------------------------------------------------------------------- /lib/baseimage.sh: -------------------------------------------------------------------------------- 1 | 2 | baseimage_die() { 3 | die "[baseimage] FAILED: $*" 4 | } 5 | 6 | baseimage_info() { 7 | info "[baseimage] $*" 8 | } 9 | 10 | baseimage_builder_init() { 11 | BASEIMAGE_ROOTFS="$(cf_distro_debootstrap_chroot)" 12 | if [ "$DISTRO_BUILDER_IMAGE" ]; then 13 | baseimage_info "builder type: docker" 14 | local uuid="$(uuidgen)" 15 | local key="$(cf_build_container_prefix)$DISTRO_TAG-$uuid" 16 | BASEIMAGE_CONTAINER_ID="$(docker_container_start "${DISTRO_BUILDER_IMAGE}" "$key" -v ${DCK_BUILDPACKAGE_PREFIX}:${DCK_BUILDPACKAGE_PREFIX})" 17 | baseimage_info "builder container: $BASEIMAGE_CONTAINER_ID" 18 | [ "$BASEIMAGE_CONTAINER_ID" ] || baseimage_die "failed starting builder container" 19 | else 20 | baseimage_info "builder type: sudo" 21 | fi 22 | 23 | baseimage_info "creating rootfs: ${BASEIMAGE_ROOTFS}" 24 | [ "${BASEIMAGE_ROOTFS}" ] || baseimage_die "no rootfs path" 25 | baseimage_builder_exec rm -Rf "${BASEIMAGE_ROOTFS}" 26 | baseimage_builder_exec mkdir -p "${BASEIMAGE_ROOTFS}" || baseimage_die "mkdir ${BASEIMAGE_ROOTFS}" 27 | } 28 | 29 | baseimage_builder_exec() { 30 | baseimage_info "builder exec: $@" 31 | if [ "$BASEIMAGE_CONTAINER_ID" ]; then 32 | docker exec --interactive "${BASEIMAGE_CONTAINER_ID}" "$@" 33 | else 34 | sudo "$@" 35 | fi 36 | return $? 37 | } 38 | 39 | baseimage_builder_destroy() { 40 | [ "${BASEIMAGE_ROOTFS}" ] || baseimage_die "no rootfs path" 41 | if [ "$BASEIMAGE_CONTAINER_ID" ]; then 42 | docker_destroy "${BASEIMAGE_CONTAINER_ID}" "$@" 43 | else 44 | baseimage_info "destroying rootfs: ${BASEIMAGE_ROOTFS}" 45 | baseimage_builder_exec rm -Rf "${BASEIMAGE_ROOTFS}" 46 | fi 47 | unset BASEIMAGE_CONTAINER_ID 48 | } 49 | 50 | baseimage_rootfs_exec() { 51 | baseimage_info "exec in rootfs: $@" 52 | baseimage_builder_exec chroot "${BASEIMAGE_ROOTFS}" "$@" 53 | } 54 | 55 | baseimage_rootfs_append() { 56 | local filename="${BASEIMAGE_ROOTFS}/$1" 57 | baseimage_info "appending to rootfs file: $1" 58 | baseimage_rootfs_exec tee -a "$1" 59 | return $? 60 | } 61 | 62 | create_baseimage() { 63 | local baseimage_name=$(cf_distro_baseimage_name) 64 | local baseimage_id=$(docker_find_image "${baseimage_name}") 65 | local tarball_tmp=$(cf_distro_debootstrap_tarball) 66 | local debootstra_args="" 67 | 68 | if [ "$baseimage_id" ]; then 69 | baseimage_info "docker image already exists: ${baseimage_id} ... skipping" 70 | return 0 71 | fi 72 | 73 | if [ -f "${tarball_tmp}" ]; then 74 | baseimage_info "rootfs tarball already exists: ${tarball_tmp} ... loading it" 75 | docker_import_tarball "${tarball_tmp}" "${baseimage_name}" 76 | return $? 77 | fi 78 | 79 | local keyring=$(cf_distro_keyring) 80 | 81 | [ "$DISTRO_ARCH" ] && debootstrap_args="$debootstrap_args --arch=$DISTRO_ARCH" 82 | [ "$DISTRO_INCLUDE" ] && debootstrap_args="$debootstrap_args --include=$DISTRO_INCLUDE" 83 | [ "$DISTRO_EXCLUDE" ] && debootstrap_args="$debootstrap_args --exclude=$DISTRO_EXCLUDE" 84 | [ "$DISTRO_COMPONENTS" ] && debootstrap_args="$debootstrap_args --components=$DISTRO_COMPONENTS" 85 | [ "$DISTRO_VARIANT" ] && debootstrap_args="$debootstrap_args --variant=$DISTRO_VARIANT" 86 | [ "$keyring" ] && debootstrap_args="$debootstrap_args --keyring=$keyring" 87 | 88 | [ "$DISTRO_SCRIPT" ] || DISTRO_SCRIPT="${DCK_BUILDPACKAGE_CFDIR}/bootstrap/$DISTRO_NAME" 89 | 90 | baseimage_info "no rootfs tarball: ${tarball_tmp} ... creating it" 91 | 92 | baseimage_builder_init 93 | 94 | baseimage_info "running debootstrap: ${DISTRO_NAME} / ${DISTRO_ARCH}" 95 | 96 | baseimage_builder_exec apt-get update 97 | baseimage_builder_exec apt-get install -y debootstrap 98 | 99 | baseimage_builder_exec debootstrap \ 100 | $debootstrap_args \ 101 | "${DISTRO_NAME}" \ 102 | "${BASEIMAGE_ROOTFS}" \ 103 | "${DISTRO_MIRROR}" \ 104 | "${DISTRO_SCRIPT}" || baseimage_die "debootstrap" 105 | 106 | baseimage_info "configure extra apt repos" 107 | 108 | if [ "$DISTRO_APT_SOURCES" ]; then 109 | echo "$DISTRO_APT_SOURCES" | baseimage_rootfs_append /etc/apt/sources.list || baseimage_die "failed adding apt sources" 110 | fi 111 | 112 | if [ "$DISTRO_APT_CONFIG" ]; then 113 | baseimage_info "writing extra apt config" 114 | echo "$DISTRO_APT_CONFIG" | baseimage_rootfs_append /etc/apt/apt.conf.d/99cleanup || baseimage_die "failed adding extra apt config" 115 | fi 116 | 117 | baseimage_info "installing extra packages" 118 | 119 | if [ "$DISTRO_EXTRA_PACKAGES" ]; then 120 | baseimage_rootfs_exec apt-get install -y $DISTRO_EXTRA_PACKAGES || baseimage_die "install extra packages: ${DISTRO_EXTRA_PACKAGES}" 121 | fi 122 | 123 | baseimage_info "marking unneeded packages as auto" 124 | 125 | [ "$DISTRO_MARK_AUTO" ] && baseimage_rootfs_exec apt-mark auto $DISTRO_MARK_AUTO 126 | 127 | baseimage_info "removing unneeded packages" 128 | 129 | baseimage_rootfs_exec apt-get autoremove -y 130 | baseimage_rootfs_exec apt-get autoclean 131 | baseimage_rootfs_exec apt-get remove -y --purge $(baseimage_rootfs_exec dpkg -l | grep "^rc" | awk '{print $2}' | tr '\n' ' ') 132 | 133 | baseimage_info "extra package removal" 134 | 135 | for i in $DISTRO_REMOVE_PACKAGES ; do 136 | baseimage_info " ... removing: $i" 137 | baseimage_rootfs_exec dpkg --force-remove-essential --remove "$i" 138 | baseimage_rootfs_exec dpkg --force-remove-essential --purge "$i" 139 | done 140 | 141 | baseimage_info "removing unwanted files" 142 | 143 | [ "$DISTRO_REMOVE_FILES" ] && baseimage_rootfs_exec rm -Rf $DISTRO_REMOVE_FILES 144 | 145 | baseimage_info "creating rootfs tarball" 146 | 147 | mkdir -p `dirname "$tarball_tmp"` || baseimage_die "failed creating tarball dir" 148 | baseimage_builder_exec tar -C "${BASEIMAGE_ROOTFS}" -c . > "$tarball_tmp" || baseimage_die "failed taring chroot" 149 | 150 | baseimage_info "importing docker image" 151 | 152 | docker_import_tarball "${tarball_tmp}" "${baseimage_name}" 153 | 154 | baseimage_info "cleanup" 155 | 156 | baseimage_builder_destroy 157 | 158 | return $? 159 | } 160 | 161 | cmd_create_baseimage() { 162 | [ "$DCK_BUILDPACKAGE_TARGET" ] || baseimage_die "missing --target parameter" 163 | info "RUNNING BASEIMAGE: $DCK_BUILDPACKAGE_TARGET" 164 | load_dist_conf 165 | create_baseimage || baseimage_die "failed to create base image" 166 | info "FINISHED" 167 | } 168 | -------------------------------------------------------------------------------- /lib/build.sh: -------------------------------------------------------------------------------- 1 | 2 | __run_build() { 3 | local src_dir="$1" 4 | local uuid="$(uuidgen)" 5 | local key="$(cf_build_container_prefix)$DISTRO_TAG-$uuid" 6 | local baseimage_name=$(cf_distro_baseimage_name) 7 | local baseimage_id=$(docker_find_image $baseimage_name) 8 | local current_user=$(whoami) 9 | local src_prefix=$(dirname "$src_dir") 10 | local build_dir="$(cf_container_build_prefix)/$(basename "$src_dir")" 11 | local pkg_name=$(debsrc_pkg_name $src_dir) 12 | local container_param="" 13 | local local_repo="/local-repo" 14 | 15 | [ "$uuid" ] || die "missing uuidgen tool. (debian package: uuid-runtime)" 16 | 17 | info "Building package: $pkg_name" 18 | 19 | aptrepo_prepare 20 | 21 | if [ "$DISTRO_APT_USE_BUILT_REPO" ]; then 22 | info "Using locally built apt repo: $(cf_distro_target_repo)" 23 | container_param="-v $(cf_distro_target_repo):$local_repo" 24 | extra_sources="deb [trusted=yes] file://$local_repo $DISTRO_TARGET_NAME $DISTRO_TARGET_COMPONENT" 25 | fi 26 | 27 | if [ "$DISTRO_APT_USE_CACHE_VOLUME" ]; then 28 | info "Using apt cache volume: $(cf_distro_aptcache_volume)" 29 | container_param="$container_param -v $(cf_distro_aptcache_volume):$(get_aptcache_dir)" 30 | fi 31 | 32 | if [ "$DISTRO_USE_CCACHE" ]; then 33 | info "Using ccache volume: $(cf_distro_ccache_volume)" 34 | container_param="$container_param -v $(cf_distro_ccache_volume):$(get_ccache_dir)" 35 | fi 36 | 37 | local srctree=$(mktemp -d $(cf_host_src_prefix)/XXXXXX) 38 | [ "$srctree" ] || die "cant create src temp directory (host)" 39 | 40 | info "copying source tree $src_dir to $srctree" 41 | mkdir -p $srctree 42 | cp --preserve=all --reflink=auto -R -p $src_dir $srctree 43 | 44 | container_param="$container_param -v $srctree:$(cf_container_build_prefix)" 45 | 46 | info "starting container" 47 | local build_container_id=`docker_container_start $baseimage_name "$key" $container_param` 48 | 49 | info "container id: $build_container_id" 50 | 51 | docker_exec_sh $build_container_id "mkdir -p /tmp" 52 | docker_set_apt_proxy $build_container_id "$DISTRO_PROXY" 53 | docker_set_apt_sources $build_container_id "$DISTRO_APT_EXTRA_SOURCES" 54 | 55 | mkdir -p $srctree/apt-keys 56 | for kf in $(cf_distro_apt_extra_keys) ; do 57 | bn=$(basename "$kf") 58 | cp $kf $srctree/apt-keys/ 59 | echo "adding key: $bn" 60 | docker_exec_sh $build_container_id "apt-key" "add" "$(cf_container_build_prefix)/apt-keys/$bn" 61 | done 62 | 63 | if [ "$DISTRO_APT_USE_BUILT_REPO" ]; then 64 | info "adding local apt repo" 65 | # this is allowed to fail - if local repo hasn't been built yet 66 | docker_exec_sh $build_container_id "apt-key add $local_repo/apt-repo.pub" 67 | docker_set_apt_sources $build_container_id "$extra_sources" 68 | fi 69 | 70 | docker_apt_update $build_container_id 71 | 72 | if [ ! -f "$src_dir/debian/control" ]; then 73 | info "need to generate debian/control" 74 | if [ -f "$src_dir/debian/control.bootstrap" ]; then 75 | info "install bootstrap dependencies" 76 | docker_exec_sh $build_container_id "cd $build_dir ; mk-build-deps -i -t 'apt-get -o Debug::pkgProblemResolver=yes -y --no-install-recommends' debian/control.bootstrap" || die "failed installing bootstrap build deps" 77 | fi 78 | info "creating control file" 79 | docker_exec_sh $build_container_id "cd $build_dir ; ./debian/rules debian/control" || die "failed generating debian/control" 80 | fi 81 | 82 | if [ ! -f "$src_dir/debian/changelog" ]; then 83 | info "creating changelog file" 84 | docker_exec_sh $build_container_id "cd $build_dir ; ./debian/rules debian/changelog" || die "failed generating debian/changelog" 85 | fi 86 | 87 | if [ "$DISTRO_USE_CCACHE" ]; then 88 | info "install ccache build dependencies" 89 | docker_exec_sh $build_container_id "apt-get install -o Debug::pkgProblemResolver=yes -y --no-install-recommends ccache" || die "failed installing build deps" 90 | fi 91 | 92 | info "install package's build dependencies" 93 | docker_exec_sh $build_container_id "cd $build_dir ; mk-build-deps -i -t 'apt-get -o Debug::pkgProblemResolver=yes -y --no-install-recommends'" || die "failed installing build deps" 94 | 95 | if [ "$DISTRO_USE_CCACHE" ]; then 96 | info "run the build (ccache)" 97 | docker_exec_sh $build_container_id "export PATH=\"/usr/lib/ccache:\$PATH\"; export CCACHE_DIR=\"$(get_ccache_dir)\" ; cd $build_dir ; dpkg-buildpackage $(get_dpkg_opts) && rm -Rf $build_dir" || die "failed to build package" 98 | else 99 | info "run the build" 100 | docker_exec_sh $build_container_id "cd $build_dir ; dpkg-buildpackage $(get_dpkg_opts) && rm -Rf $build_dir" || die "failed to build package" 101 | fi 102 | 103 | info "copy out built packages" 104 | aptrepo_copy_from_docker $build_container_id $(dirname $build_dir) $pkg_name 105 | 106 | info "destroying temporary build container" 107 | docker_destroy "$build_container_id" 108 | 109 | info "removing temporary source tree: $srctree" 110 | rm -Rf $srctree 111 | rmdir $(dirname "$srctree") 2>/dev/null 112 | 113 | if [ "$DISTRO_APT_AUTO_REGENERATE" ]; then 114 | info "calling target apt repo regenerate" 115 | aptrepo_update 116 | fi 117 | } 118 | 119 | cmd_build() { 120 | [ "$DCK_BUILDPACKAGE_TARGET" ] || die "missing --target parameter" 121 | info "RUNNING BUILD" 122 | load_dist_conf 123 | create_baseimage || die "failed to create base image" 124 | 125 | if [ "$DISTRO_APT_USE_CACHE_VOLUME" ]; then 126 | create_aptcache_volume || die "failed to create aptcache volume" 127 | fi 128 | 129 | if [ "$DISTRO_USE_CCACHE" ]; then 130 | create_ccache_volume || die "failed to create ccache volume" 131 | fi 132 | 133 | __run_build "$WORK_SRC_DIR" || die "build failed" 134 | info "FINISHED" 135 | } 136 | -------------------------------------------------------------------------------- /lib/ccache.sh: -------------------------------------------------------------------------------- 1 | 2 | get_ccache_dir() { 3 | echo -n "/var/cache/ccache" 4 | } 5 | 6 | get_ccache_volumes() { 7 | docker_volume_list | grep -e "^dckbp-ccache-" 8 | } 9 | 10 | create_ccache_volume() { 11 | local volume_id=$(cf_distro_ccache_volume) 12 | info "ccache volume: $volume_id" 13 | docker_volume_create $volume_id 14 | } 15 | -------------------------------------------------------------------------------- /lib/cleanup.sh: -------------------------------------------------------------------------------- 1 | 2 | cmd_cleanup() { 3 | info "CLEANUP" 4 | 5 | $(get_docker_cmd) ps -qa -f "name=$(cf_build_container_prefix)" | \ 6 | while read n ; do info "Destroying container: $n"; docker_destroy "$n" || true; done 7 | 8 | docker_volume_remove $(get_aptcache_volumes) 9 | 10 | info "DONE" 11 | } 12 | -------------------------------------------------------------------------------- /lib/conf.sh: -------------------------------------------------------------------------------- 1 | 2 | include_target() { 3 | . $DCK_BUILDPACKAGE_CFDIR/target/$1.cf || die "loading target config for $1" 4 | } 5 | 6 | load_dist_conf() { 7 | DISTRO_TAG="$DCK_BUILDPACKAGE_TARGET" 8 | 9 | [ "$DCK_BUILDPACKAGE_TARGET_REPO" ] || export DCK_BUILDPACKAGE_TARGET_REPO="$HOME/dckbp-apt-repo" 10 | 11 | [ "$DISTRO_TAG" ] || die "no target distro specified. use --target option" 12 | 13 | [ "$DCK_BUILDPACKAGE_CONFDIR" ] && DCK_BUILDPACKAGE_CFDIR="$DCK_BUILDPACKAGE_CONFDIR" 14 | 15 | include_target "$DCK_BUILDPACKAGE_TARGET" 16 | 17 | [ "$DISTRO_NAME" ] || die "dist config: missing DISTRO_NAME" 18 | [ "$DISTRO_ARCH" ] || die "dist config: missing DISTRO_ARCH" 19 | [ "$DISTRO_COMPONENTS" ] || die "dist config: missing DISTRO_COMPONENTS" 20 | [ "$DISTRO_MIRROR" ] || die "dist config: missing DISTRO_MIRROR" 21 | [ "$DISTRO_INIT_CMD" ] || export DISTRO_INIT_CMD="/sbin/init" 22 | [ "$DISTRO_TARGET_NAME" ] || export DISTRO_TARGET_NAME="$DISTRO_NAME" 23 | [ "$DISTRO_TARGET_COMPONENT" ] || export DISTRO_TARGET_COMPONENT="contrib" 24 | [ "$DISTRO_TARGET_REPO" ] || export DISTRO_TARGET_REPO="$DCK_BUILDPACKAGE_TARGET_REPO/$DISTRO_TAG/" 25 | 26 | [ "$DISTRO_APT_ARCHS" ] || export DISTRO_APT_ARCHS="$DISTRO_ARCH" 27 | 28 | # check whether docker is too old for volume command 29 | if docker volume 2>&1 | grep "is not a docker command" >/dev/null; then 30 | info "docker is too old for volume command. disabling apt-cache volume" 31 | unset DISTRO_APT_USE_CACHE_VOLUME 32 | fi 33 | } 34 | 35 | get_init_cmd() { 36 | echo -n "$DISTRO_INIT_CMD" 37 | } 38 | 39 | get_docker_cmd() { 40 | if [ "$DCK_BUILDPACKAGE_DOCKER_CMD" ]; then 41 | echo -n "$DCK_BUILDPACKAGE_DOCKER_CMD" 42 | else 43 | echo -n "docker" 44 | fi 45 | } 46 | 47 | get_dpkg_opts() { 48 | if [ "$DCK_BUILDPACKAGE_DPKG_OPTS" ]; then 49 | echo -n "$DCK_BUILDPACKAGE_DPKG_OPTS" 50 | elif [ "$DISTRO_DPKG_OPTS" ]; then 51 | echo -n "$DISTRO_DPKG_OPTS" 52 | else 53 | echo -n "-b -uc -us" 54 | fi 55 | } 56 | 57 | get_deb_dir() { 58 | local debdir="$DCK_BUILDPACKAGE_DEB_DIR" 59 | [ "$debdir" ] || debdir="../deb" 60 | ( cd $WORK_SRC_DIR && readlink -f "$debdir" ) 61 | } 62 | 63 | cf_distro_target_repo() { 64 | echo -n "$DISTRO_TARGET_REPO" 65 | } 66 | 67 | ## distro's keyring file to use 68 | cf_distro_keyring() { 69 | [ "$DISTRO_KEYRING" ] || return 0 70 | 71 | case "$DISTRO_KEYRING" in 72 | /*) 73 | echo -n "$DISTRO_KEYRING" 74 | ;; 75 | *) 76 | readlink -f "$DCK_BUILDPACKAGE_CFDIR/$DISTRO_KEYRING" 77 | esac 78 | } 79 | 80 | cf_distro_apt_extra_keys() { 81 | [ "$DISTRO_APT_EXTRA_KEYS" ] || return 0 82 | 83 | for kf in $DISTRO_APT_EXTRA_KEYS ; do 84 | info "extra keyfile: $kf" 85 | 86 | case "$kf" in 87 | /*) 88 | echo -n "$kf" 89 | ;; 90 | *) 91 | readlink -f "$DCK_BUILDPACKAGE_CFDIR/$kf" 92 | esac 93 | done 94 | } 95 | 96 | ## build prefix within container 97 | cf_container_build_prefix() { 98 | echo -n "/dck-buildpackage/src" 99 | } 100 | 101 | ## get the distro's base image name 102 | cf_distro_baseimage_name() { 103 | if [ "$DCK_BUILDPACKAGE_BASE_IMAGE" ]; then 104 | echo -n "$DCK_BUILDPACKAGE_BASE_IMAGE" 105 | else 106 | if [ "$DISTRO_BASE_IMAGE" ]; then 107 | echo -n "$DISTRO_BASE_IMAGE" 108 | else 109 | echo -n "dckbp-baseimage-$DISTRO_TAG" 110 | fi 111 | fi 112 | } 113 | 114 | ## get the distro's apt cache volume name 115 | cf_distro_aptcache_volume() { 116 | if [ "$DCK_BUILDPACKAGE_APTCACHE_VOLUME" ]; then 117 | echo -n "$DCK_BUILDPACKAGE_APTCACHE_VOLUME" 118 | else 119 | echo -n "dckbp-aptacache-$DISTRO_TAG" 120 | fi 121 | } 122 | 123 | ## get the distro's ccache volume name 124 | cf_distro_ccache_volume() { 125 | if [ "$DCK_BUILDPACKAGE_CCACHE_VOLUME" ]; then 126 | echo -n "$DCK_BUILDPACKAGE_CCACHE_VOLUME" 127 | else 128 | echo -n "dckbp-ccache-$DISTRO_TAG" 129 | fi 130 | } 131 | 132 | ## temporary dir for debootstrap 133 | cf_distro_debootstrap_chroot() { 134 | echo -n "/tmp/dck-buildpackage/debootstrap-images/$DCK_BUILDPACKAGE_TARGET" 135 | } 136 | 137 | cf_distro_debootstrap_tarball() { 138 | if [ "$DCK_BUILDPACKAGE_TARBALL_CACHE" ]; then 139 | echo -n "${DCK_BUILDPACKAGE_TARBALL_CACHE}/${DCK_BUILDPACKAGE_TARGET}.tar" 140 | else 141 | echo -n "/tmp/dck-buildpackage/debootstrap-tarballs/${DCK_BUILDPACKAGE_TARGET}.tar" 142 | fi 143 | } 144 | 145 | ## docker build container name prefix 146 | cf_build_container_prefix() { 147 | echo -n "dckbp-build-" 148 | } 149 | 150 | ## prefix for build-time copy of source tree on host side (will be mounted into container) 151 | cf_host_src_prefix() { 152 | [ "$TEMP" ] || TEMP=/tmp 153 | local prefix="$TEMP/dck-buildpackage-src.$(whoami)" 154 | mkdir -p $prefix 155 | echo -n "$prefix" 156 | } 157 | -------------------------------------------------------------------------------- /lib/docker.sh: -------------------------------------------------------------------------------- 1 | 2 | docker_find_image() { 3 | [ "$1" ] && $(get_docker_cmd) images -q "$1" 4 | } 5 | 6 | docker_volume_create() { 7 | local volume_id="$1" 8 | 9 | if $(get_docker_cmd) volume inspect "$volume_id" >/dev/null 2>/dev/null; then 10 | return 0 11 | fi 12 | 13 | if ! $(get_docker_cmd) volume create "$volume_id" >/dev/null; then 14 | die "docker volume $volume_id cant be created" 15 | fi 16 | } 17 | 18 | docker_volume_remove() { 19 | while [ "$1" ]; do 20 | info "Removing volume: $1" 21 | $(get_docker_cmd) volume rm "$1" 22 | shift 23 | done 24 | } 25 | 26 | docker_volume_list() { 27 | $(get_docker_cmd) volume ls -q 28 | return $? 29 | } 30 | 31 | docker_init_container() { 32 | local container_id 33 | local container_name="$2" 34 | local container_base="$1" 35 | 36 | if [ "$container_name" ]; then 37 | container_id=`$(get_docker_cmd) create --hostname "$container_name" --name "$container_name" "$container_base" $(get_init_cmd)` || die "cant create container" 38 | else 39 | container_id=`$(get_docker_cmd) create "$container_base" $(get_init_cmd)` || die "cant create container" 40 | fi 41 | 42 | [ "$container_id" ] || die "failed to create container" 43 | info "Created container: $container_id" 44 | echo -n "$container_id" 45 | } 46 | 47 | # this one should not die on error, but return it, so callers can decide what to do 48 | docker_exec_sh() { 49 | local container_id="$1" 50 | shift 51 | $(get_docker_cmd) exec --interactive "$container_id" sh -c "$*" 52 | return $? 53 | } 54 | 55 | docker_destroy() { 56 | local container_id="$1" 57 | $(get_docker_cmd) kill "$container_id" 58 | $(get_docker_cmd) rm "$container_id" 59 | } 60 | 61 | docker_cp_from() { 62 | local container_id="$1" 63 | local src="$2" 64 | local dst="$3" 65 | mkdir -p $dst 66 | $(get_docker_cmd) cp "$container_id:$src" "$dst" || die "failed copying from container: $*" 67 | } 68 | 69 | docker_cp_to() { 70 | local container_id="$1" 71 | local src="$2" 72 | local dst="$3" 73 | docker_exec_sh "$container_id" mkdir -p "$dst" || die "failed to mkdir in container: $dst" 74 | info $(get_docker_cmd) cp "$src" "$container_id:$dst" 75 | $(get_docker_cmd) cp "$src" "$container_id:$dst" || die "failed copying to container: $*" 76 | } 77 | 78 | docker_set_apt_proxy() { 79 | local container_id="$1" 80 | local proxy="$2" 81 | 82 | if [ "$proxy" ]; then 83 | info "configuring http proxy: $proxy" 84 | docker_exec_sh $container_id "echo \"Acquire::http::Proxy \\\"$proxy\\\";\" > /etc/apt/apt.conf.d/99proxy" 85 | fi 86 | } 87 | 88 | docker_set_apt_sources() { 89 | local container_id="$1" 90 | local ent="$2" 91 | 92 | if [ "$ent" ]; then 93 | info "adding extra apt sources entries: $ent" 94 | docker_exec_sh $container_id "echo \"$ent\" >> /etc/apt/sources.list" 95 | fi 96 | } 97 | 98 | docker_apt_update() { 99 | local container_id="$1" 100 | docker_exec_sh $container_id "apt-get update" 101 | return $? 102 | } 103 | 104 | docker_container_start() { 105 | local baseimage="$1"; shift 106 | local name="$1"; shift 107 | info "Starting docker container: $name ($baseimage)" 108 | $(get_docker_cmd) run -d --name "$name" "$@" "$baseimage" $(get_init_cmd) || die "cant start container" 109 | } 110 | 111 | docker_import_tarball() { 112 | local tarball="$1" 113 | local image="$2" 114 | $(get_docker_cmd) import "$tarball" "$image" || die "failed container image import: $1" 115 | } 116 | -------------------------------------------------------------------------------- /lib/dpkg.sh: -------------------------------------------------------------------------------- 1 | 2 | debsrc_pkg_name() { 3 | if [ "$DCK_BUILDPACKAGE_SOURCE" ]; then 4 | echo -n "$DCK_BUILDPACKAGE_SOURCE" 5 | return 0 6 | fi 7 | 8 | local srcdir="$1" 9 | ( cd $srcdir && ./debian/rules debian/control ) >&2 10 | [ -f $srcdir/debian/control ] || die "call me from within a debianized source tree" 11 | local pkg_name=`grep -e "^Source:" < $srcdir/debian/control | sed -e 's~^Source: ~~; s~ ~~g;'` 12 | for i in $pkg_name ; do 13 | echo -n "$i" 14 | return 0 15 | done 16 | die "failed to extract package name" 17 | } 18 | -------------------------------------------------------------------------------- /lib/help.sh: -------------------------------------------------------------------------------- 1 | 2 | help() { 3 | local progname="$1" 4 | echo "$progname [--help] [--create-baseimage] [--target=]" 5 | exit 0 6 | 7 | } 8 | 9 | version() { 10 | echo "dck-buildpackage version $VERSION" 11 | echo "Copyright (C) 2018 Enrico Weigelt, metux IT consult " 12 | echo "This is free software, released under the GNU Affero Public License Version 3+" 13 | exit 0 14 | } 15 | -------------------------------------------------------------------------------- /lib/log.sh: -------------------------------------------------------------------------------- 1 | 2 | _color_yellow() { 3 | echo -ne "\e[33m" 4 | } 5 | 6 | _color_normal() { 7 | echo -ne "\e[39m" 8 | } 9 | 10 | _color_green() { 11 | echo -ne "\e[32m" 12 | } 13 | 14 | _color_red() { 15 | echo -ne "\e[91m" 16 | } 17 | 18 | log() { 19 | ( _color_yellow ; echo -n "LOG: " ; _color_normal ; echo "$*" ) >&2 20 | } 21 | 22 | info() { 23 | ( _color_green ; echo -n "INFO: " ; _color_normal ; echo "$*" ) >&2 24 | } 25 | 26 | die() { 27 | ( _color_red ; echo -n "FAILED: " ; _color_normal ; echo "$*" ) >&2 28 | exit 1 29 | } 30 | -------------------------------------------------------------------------------- /lib/main.sh: -------------------------------------------------------------------------------- 1 | 2 | VERSION=0.1 3 | 4 | set -e 5 | 6 | . $DCK_BUILDPACKAGE_LIBDIR/log.sh 7 | . $DCK_BUILDPACKAGE_LIBDIR/docker.sh 8 | . $DCK_BUILDPACKAGE_LIBDIR/help.sh 9 | . $DCK_BUILDPACKAGE_LIBDIR/aptcache.sh 10 | . $DCK_BUILDPACKAGE_LIBDIR/ccache.sh 11 | . $DCK_BUILDPACKAGE_LIBDIR/baseimage.sh 12 | . $DCK_BUILDPACKAGE_LIBDIR/build.sh 13 | . $DCK_BUILDPACKAGE_LIBDIR/cleanup.sh 14 | . $DCK_BUILDPACKAGE_LIBDIR/conf.sh 15 | . $DCK_BUILDPACKAGE_LIBDIR/aptrepo.sh 16 | . $DCK_BUILDPACKAGE_LIBDIR/dpkg.sh 17 | 18 | parse_args() { 19 | local progname="$1" 20 | shift 21 | 22 | current_cmd="build" 23 | 24 | while [ "$1" ]; do 25 | case "$1" in 26 | "--help") 27 | help "$progname" 28 | ;; 29 | "--version"|"-v") 30 | version "$progname" 31 | ;; 32 | "--target") 33 | shift 34 | DCK_BUILDPACKAGE_TARGET="$1" 35 | ;; 36 | "--create-baseimage") 37 | current_cmd="create-baseimage" 38 | ;; 39 | "--cleanup"|"--clean") 40 | current_cmd="cleanup" 41 | ;; 42 | "--update-aptrepo") 43 | current_cmd="update-aptrepo" 44 | ;; 45 | *) 46 | WORK_SRC_DIR=$(readlink -f $1) 47 | ;; 48 | esac 49 | shift 50 | done 51 | } 52 | 53 | parse_args "$0" "$@" 54 | 55 | [ "$WORK_SRC_DIR" ] || WORK_SRC_DIR=$(readlink -f .) 56 | 57 | case "$current_cmd" in 58 | "build") 59 | cmd_build 60 | ;; 61 | "cleanup") 62 | cmd_cleanup 63 | ;; 64 | "update-aptrepo") 65 | cmd_update_aptrepo 66 | ;; 67 | "create-baseimage") 68 | cmd_create_baseimage 69 | ;; 70 | *) 71 | help "$progname" 72 | ;; 73 | esac 74 | -------------------------------------------------------------------------------- /package.lsm: -------------------------------------------------------------------------------- 1 | Begin4 2 | Title: docker-buildpackage 3 | Version: 0.1 4 | Entered-date: 2018-05-01 5 | Description: Builds Debian packages in docker containers. 6 | Keywords: debian,dpkg,build,docker,ci 7 | Author: Enrico Weigelt, metux IT consult 8 | Maintained-by: Enrico Weigelt, metux IT consult 9 | Primary-site: https://github.com/metux/docker-buildpackage 10 | Alternate-site: https://github.com/metux/docker-buildpackage 11 | Original-site: https://github.com/metux/docker-buildpackage 12 | Platforms: GNU 13 | Copying-policy: AGPLv3 14 | End 15 | --------------------------------------------------------------------------------