summaryrefslogtreecommitdiffstats
path: root/functions (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-07-24Remove unnecessary redirections of in_pathColin Watson1-3/+3
2017-07-24Avoid the 'type' shell commandSven Joachim1-3/+3
It is not mandatory in POSIX and tus not implemented by posh. Use the in_path function instead which is taylored for this need.
2017-03-10Uniformize COMPONENTS/USE_COMPONENTS handling.Cyril Brulebois1-3/+1
The preliminary fix in 1.0.67 wasn't sufficient, and was extended in 1.0.72 in a different manner. Let's standardize all for loops.
2017-03-09Don't make /dev/ptmx a symlink to pts/ptmx if we don't have toSimon McVittie1-1/+6
In a plain chroot or on real hardware, it is preferable to use mknod to create /dev/ptmx. This works as intended with older chroot managers such as sbuild and pbuilder, which were designed for the semantics of "legacy" /dev/pts (a single non-virtualized pty subsystem per kernel) and so mount /dev/pts without the newinstance option. It also works in newer kernels where /dev/pts always behaves as though the newinstance option was given, because on those kernels, opening a (c,5,2) device node automatically looks for an adjacent pts directory and uses its ptmx device node instead. However, if we are running debootstrap inside a restricted container such as lxc or systemd-nspawn, mknod ptmx c 5 2 might not be allowed. If so, fall back to a symlink with a warning. This mode is fine if the debootstrap will be used with systemd-nspawn or lxc, or if a devtmpfs will be mounted over its /dev, but will not work for older chroot managers like sbuild or pbuilder, because those chroot managers leave the ptmxmode mount option at its default 000, causing permission to open the pts/ptmx device node to be denied. Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=817236 Signed-off-by: Simon McVittie <smcv@debian.org>
2017-02-03pkgdetails_perl: Strip the arch-qualifier (Closes: #836525)Sven Joachim1-0/+1
2016-10-30Fix InRelease support (Closes: #842591).Cyril Brulebois1-8/+36
The initial tr|sed|tr looked nice on paper but doesn't work within a d-i context, so let's switch to a shell-only implementation supplied by Ansgar Burchardt.
2016-10-20Refactor (In)Release(.gpg) downloadJulien Cristau1-31/+37
- make a separate split_inline_sig function - move downloading all three files to download_release_sig - don't check InRelease signature if signature checking is disabled Thanks to Ansgar Burchardt for the suggestions. Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-10-19Fix syntax error from the InRelease changeJulien Cristau1-1/+1
Thanks, David Schneider!
2016-10-18Add support for downloading and validating InRelease filesJulien Cristau1-6/+23
Split up detached signature from signed data, in effect re-creating a Release and Release.gpg pair that we can verify with gpgv.
2016-10-18Only use `tar -k` for new releasesAnsgar Burchardt1-2/+3
In old releases, notably in Debian 6 (Squeeze), multiple packages ship the same files using diversions (e.g. bash/dash). As debootstrap naively extracts packages without implementing diversions itself, it relies on tar replacing the files without an error. Ideally we could use `tar --keep-directory-symlink`, but this is likely not portable enough. So continue to use `tar -k`, but only for future releases. Note that this requires no file conflicts among packages debootstrap installs (which is a good idea anyway as they might be extracted in the wrong order). Bug: https://bugs.debian.org/838388
2016-10-04Add support for xz-compressed Packages indicesAnsgar Burchardt1-0/+10
Bug: https://bugs.debian.org/837649
2016-09-08Pass -k to tar when extracting packagesAnsgar Burchardt1-2/+2
When installing with a merged /usr, the symlinks in / should not be replaced with real directories when extracting the packages.
2016-09-08Merged /usr support for debootstrapMarco d'Itri1-0/+37
2016-09-08Validate SUITE against Release's Suite or CodenameAnsgar Burchardt1-0/+14
Bug: https://bugs.debian.org/837075
2016-09-06Excise all devices.tar.gz codeAlex Bennée1-7/+1
Since bug #571136 was fixed the --second-stage doesn't even use the devices tarball so we can remove all its related cruft. The README has been updated to show when real root access is required and give an example of a foreign debootstrap which works with fakeroot.
2016-02-18hurd: move setting up dev and servers firmlink to setup_proc stage.Samuel Thibault1-9/+6
Also firmlink proc there. Thanks Gabriele Giacone for all the investigation!
2016-02-18Split setup_devices in setup_devices and setup_dynamic_devices,Marco d'Itri1-3/+20
(setup_devices now only deals with static device nodes) and move the calls to setup_devices from the beginning of the second stage to the end of the first stage. setup_dynamic_devices mounts the appropriate filesystems which provide dynamic device nodes for the architectures which need one in debootstrap (kfreebsd and hurd). This fixes a bug in --second-stage introduced in 1.0.34 and exposed by the devices-related changes of 1.0.76: the second stage debootstrap runs "dpkg --print-architecture >/dev/null" at the very beginning of the program when /dev is still empty, so it creates an empty regular file in place of /dev/null and this will cause mknod to fail later. (Closes: #813232)
2016-01-29Don't call mknod with --mode, it's not supported in busyboxSteve McIntyre1-6/+6
Use -m instead - fixes the broken fix for #812811. Closes: #813124. Uploading with urgency high to get this fix propagated quickly - it's breaking d-i installs right now.
2016-01-27Fix permissions on device nodes (Closes: #812811).Cyril Brulebois1-6/+6
2016-01-24Stop creating useless device nodes (Closes: #571136).Cyril Brulebois1-6/+21
Thanks to Marco d'Itri.
2015-10-22Generate a deburis file with (package, version, uri) tuples.Cyril Brulebois1-0/+1
It is similar to the existing debpaths. Signed-off-by: Cyril Brulebois <cyril@debamax.com>
2015-07-28Fix resolve_deps and setup_available to work in the --foreign case (closes: ↵Colin Watson1-3/+3
#757819, LP: #1450980).
2015-05-19Use tr|tr for symmetry (instead of sed|tr).Cyril Brulebois1-1/+1
2015-05-19Use tr instead of (missing in d-i) xargs (Closes: #785693). Thanks, Julian ↵Cyril Brulebois1-1/+1
Schauder!
2015-05-15Add support for --force-check-gpg (Closes: #661501, #733179, #775454).Cyril Brulebois1-1/+4
With this option, one can programmatically make sure keyring checks are used and that no fallback to an https mirror happens.
2015-05-14Make sure to deduplicate package list in download_release (Closes: #709751, ↵Cyril Brulebois1-0/+5
#768445, #785276). Do so to avoid issues while counting downloaded packages. The failure path could lead to printing some strange integer. This was reported to mostly happen whenever --no-resolve-deps is used.
2014-12-30Fix the empty sources.list bug with foreign architectures (Closes: #732255, ↵Cyril Brulebois1-1/+3
#773867). Update setup_apt_sources to look at USE_COMPONENTS if COMPONENTS is empty, so that some iteration over defined components happens.
2014-09-14Fix reporting of package version in retrieval and validation steps to cope ↵Cyril Brulebois1-1/+1
with epochs.
2014-08-19Fix "possibly the package $pkg is at fault" warnings to account for changed ↵Colin Watson1-1/+1
error output in dpkg 1.17.2.
2014-05-06Add uncompressed and xz control.tar deb member supportGuillem Jover1-3/+15
These are currently not accepted by the Debian archive, but are supported since dpkg 1.17.6, and they do not incur any additional dependency from the host system. This is mostly for completeness' sake, as Debian base packages with uncompressed or xz control.tar members are probably not going to be used at all.
2014-05-06Add uncompressed data.tar deb member supportGuillem Jover1-1/+2
These are currently not accepted by the Debian archive, but have been supported since dpkg 1.10.24, and they do not incur any additional dependency from the host system. This is mostly for completeness' sake, as Debian base packages with uncompressed data.tar members are probably not going to be used at all.
2014-02-07pkgdetails_perl: Only interpret percentages following whitespace, to cope ↵Colin Watson1-2/+6
with GNU wget outputting the local file name (which may contain "%" due to URL-encoding) after it finishes the download (LP: #1172101).
2013-12-27Avoid writing https urls into sources.list, as apt does not support https.Joey Hess1-1/+1
When a https url is used, fall back to the default mirror for sources.list.
2013-12-27default to https mirror for Debian when no gpg verification is availableJoey Hess1-5/+11
When deboostrapping Debian, and the debian-archive-keyring is not available, switch the default mirror to a https url. This way at least the CA level of security is available even for users who have no way to check gpg keys in the WoT. The https mirror is currently https://mirrors.kernel.org/debian. When the keyring is available, the default mirror remains non-https, for several reasons: a) to avoid overloading mirrors.kernel.org b) because http.us.debian.org lacks https support c) because mirrors.kernel.org is not currently in the http.us.debian.org rotation d) because mirrors.kernel.org lacks IPv6 support
2013-05-18Resolve mount point symlinks relative to the target chroot before unmounting ↵Colin Watson1-1/+4
them (closes: #702861, #703037, #704744).
2013-05-14Report package version information on package retrieve and validation. ↵Héctor Orón Martínez1-3/+5
Closes: #697675 Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
2013-03-25Move extract_release_components to after signature verification.Julien Cristau1-1/+2
Suggested by Ansgar Burchardt.
2013-03-25Disable InRelease support.Julien Cristau1-34/+13
gpgv won't give us back the signed data, and full gpg is not available inside d-i (closes: #703889).
2013-03-20* Properly decrypt the InRelease file when downloading from an archiveChristian PERRIER1-1/+2
where InRelease is used. This longstanding bug was masked by former APT behaviour and was revealed only with recent APT versions Closes: #703146 Thanks to Michael Vogt for the analysis and patch
2012-12-27Revert to using which, but only in non-d-iSamuel Thibault1-1/+4
which is only if /bin/sh does not exist
2012-12-27 Find out /bin/sh using `type` instead of `which`,Samuel Thibault1-1/+1
the latter not being available in d-i.
2012-11-26functions: check for /bin/sh before using it in shebang (android)Shawn Landden1-1/+1
2012-09-05Fix "arc" typo. Closes: #686680Joey Hess1-1/+1
2012-06-25Downgrade the absence of an InRelease file from a warning to an info ↵Colin Watson1-1/+1
message. For now, debootstrap can cope fine without, and it's possible there are Debian mirrors that don't have InRelease; Ubuntu doesn't quite have InRelease support yet either (LP: #1017398).
2012-05-22minor cleanupJoey Hess1-2/+2
2012-05-22Add support for InRelease files (Closes: #638682)Mehdi Dogguy1-30/+55
2012-04-18point users at the log file on error, try to show a package name tooJoey Hess1-0/+12
When installation or configuration of a package fails, output a message that points the user to the log file[1]. Attempt to grep out the first package that dpkg failed on and show its name too. Closes: #472704 Sample: W: Failure while configuring base packages. This will be re-attempted up to five times. W: See sid/debootstrap.log for details (possibly the package libept1 is at fault) This relies on the LANG=C currently set for the debootstrap run. Changes to the "dpkg: error processing $PACKAGE" message would break the package name extractor, but it'd fall back to not showing a package name. This adds cut to the set of utilities debootstrap uses, which shouldn't be a problem. [1] In d-i, debootstrap doesn't know where the log file is, but then this message goes to the same syslog file, so I didn't add any special handling for this case.
2012-03-13Stop at the end of the retrieval phase if any packages failed to download.Colin Watson1-0/+1
2012-03-13Retry corrupted downloads rather than carrying on almost regardless. Patch ↵Colin Watson1-31/+23
mostly due to Michael Gilbert, rearranged somewhat by me (closes: #618920).
2011-11-21pkgdetails_perl: Use the last of a sequence of stanzas for the same package ↵Colin Watson1-10/+37
name, rather than the first (closes: #649319).