Skip to content
Snippets Groups Projects
Commit 4893a637 authored by Bastian Blank's avatar Bastian Blank Committed by Sjoerd Simons
Browse files

Import Debian version 0.140

parent c44aa9f6
No related branches found
No related tags found
1 merge request!6Sync latest change from Debian Bullseye
Pipeline #504225 canceled
initramfs-tools (0.140) unstable; urgency=medium
[ Norbert Lange ]
* mkinitramfs: use temporary file for uncompressed cpio
[ Michael Prokop ]
* mkinitramfs: report actually requested compress util if it's not present
[ Ben Hutchings ]
* init: Mount /dev without the noexec option
[ dann frazier ]
* configure_networking(): Wait for specified network device (Closes: #965935)
[ Bastian Blank ]
* Include all PCI controller modules
* Include all reset controller modules
-- Bastian Blank <waldi@debian.org> Sat, 13 Mar 2021 19:13:18 +0100
initramfs-tools (0.139) unstable; urgency=medium
* [9679f0c] debian/tests: Run amd64 tests on either amd64 or generic flavour
......
......@@ -661,9 +661,11 @@ auto_add_modules()
copy_modules_dir kernel/drivers/i2c/busses
copy_modules_dir kernel/drivers/i2c/muxes
copy_modules_dir kernel/drivers/mfd
copy_modules_dir kernel/drivers/pci/controller
copy_modules_dir kernel/drivers/phy
copy_modules_dir kernel/drivers/pinctrl
copy_modules_dir kernel/drivers/regulator
copy_modules_dir kernel/drivers/reset
copy_modules_dir kernel/drivers/spi
copy_modules_dir kernel/drivers/usb/phy
......
......@@ -33,8 +33,7 @@ export quiet
# Note that this only becomes /dev on the real filesystem if udev's scripts
# are used; which they will be, but it's worth pointing out
test -x /usr/sbin/v86d && dev_exec="exec" || dev_exec="noexec"
mount -t devtmpfs -o $dev_exec,nosuid,mode=0755 udev /dev
mount -t devtmpfs -o nosuid,mode=0755 udev /dev
mkdir /dev/pts
mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true
......@@ -218,6 +217,10 @@ maybe_break modules
load_modules
[ "$quiet" != "y" ] && log_end_msg
starttime="$(_uptime)"
starttime=$((starttime + 1)) # round up
export starttime
if [ "$ROOTDELAY" ]; then
sleep "$ROOTDELAY"
fi
......@@ -310,6 +313,7 @@ unset noresume
unset fastboot
unset forcefsck
unset fsckfix
unset starttime
# Move virtual filesystems over to the real filesystem
mount -n -o move /sys ${rootmnt}/sys
......
......@@ -170,8 +170,8 @@ fi
unset COMPRESS
if ! command -v "${compress}" >/dev/null 2>&1; then
compress=gzip
echo "No ${compress} in ${PATH}, using gzip"
compress=gzip
fi
case "${compress}" in
......@@ -213,12 +213,16 @@ fi
# Prepare to clean up temporary files on exit
DESTDIR=
__TMPCPIOGZ=
__TMPMAINCPIO=
__TMPEARLYCPIO=
clean_on_exit() {
if [ "${keep}" = "y" ]; then
echo "Working files in ${DESTDIR:-<not yet created>}, early initramfs in ${__TMPEARLYCPIO:-<not yet created>} and overlay in ${__TMPCPIOGZ:-<not yet created>}"
echo "Working files in ${DESTDIR:-<not yet created>}," \
"early initramfs in ${__TMPEARLYCPIO:-<not yet created>}," \
"main initramfs in ${__TMPMAINCPIO:-<not yet created>} and" \
"overlay in ${__TMPCPIOGZ:-<not yet created>}"
else
for path in "${DESTDIR}" "${__TMPCPIOGZ}" "${__TMPEARLYCPIO}"; do
for path in "${DESTDIR}" "${__TMPCPIOGZ}" "${__TMPMAINCPIO}" "${__TMPEARLYCPIO}"; do
test -z "${path}" || rm -rf "${path}"
done
fi
......@@ -231,6 +235,7 @@ trap "exit 1" INT TERM # makes the EXIT trap effective even when killed
DESTDIR="$(mktemp -d "${TMPDIR:-/var/tmp}/mkinitramfs_XXXXXX")" || exit 1
chmod 755 "${DESTDIR}"
__TMPCPIOGZ="$(mktemp "${TMPDIR:-/var/tmp}/mkinitramfs-OL_XXXXXX")" || exit 1
__TMPMAINCPIO="$(mktemp "${TMPDIR:-/var/tmp}/mkinitramfs-MAIN_XXXXXX")" || exit 1
__TMPEARLYCPIO="$(mktemp "${TMPDIR:-/var/tmp}/mkinitramfs-FW_XXXXXX")" || exit 1
DPKG_ARCH=$(dpkg --print-architecture)
......@@ -390,13 +395,6 @@ fi
[ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs"
if [ -s "${__TMPEARLYCPIO}" ]; then
cat "${__TMPEARLYCPIO}" >"${outfile}" || exit 1
else
# truncate
true > "${outfile}"
fi
(
# preserve permissions if root builds the image, see #633582
[ "$(id -ru)" != 0 ] && cpio_owner_root="-R 0:0"
......@@ -412,10 +410,9 @@ if [ -n "${SOURCE_DATE_EPOCH}" ]; then
fi
# work around lack of "set -o pipefail" for the following pipe:
# cd "${DESTDIR}" && find . | LC_ALL=C sort | cpio --quiet $cpio_owner_root $cpio_reproducible -o -H newc | gzip >>"${outfile}" || exit 1
# cd "${DESTDIR}" && find . | LC_ALL=C sort | cpio --quiet $cpio_owner_root $cpio_reproducible -o -H newc >>"${outfile}" || exit 1
ec1=1
ec2=1
ec3=1
exec 3>&1
eval "$(
# http://cfaj.freeshell.org/shell/cus-faq-2.html
......@@ -427,26 +424,31 @@ eval "$(
LC_ALL=C sort
} | {
# shellcheck disable=SC2086
cpio --quiet $cpio_owner_root $cpio_reproducible -o -H newc 4>&-; echo "ec2=$?;" >&4
} | ${compress} >>"${outfile}"
echo "ec3=$?;" >&4
cpio --quiet $cpio_owner_root $cpio_reproducible -o -H newc 4>&- >"${__TMPMAINCPIO}"
echo "ec2=$?;" >&4
}
)"
if [ "$ec1" -ne 0 ]; then
echo "E: mkinitramfs failure find $ec1 cpio $ec2 $compress $ec3" >&2
echo "E: mkinitramfs failure find $ec1 cpio $ec2" >&2
exit "$ec1"
fi
if [ "$ec2" -ne 0 ]; then
echo "E: mkinitramfs failure cpio $ec2 $compress $ec3" >&2
echo "E: mkinitramfs failure cpio $ec2" >&2
exit "$ec2"
fi
if [ "$ec3" -ne 0 ]; then
echo "E: mkinitramfs failure $compress $ec3" >&2
exit "$ec3"
fi
) || exit 1
{
if [ -s "${__TMPEARLYCPIO}" ]; then
cat "${__TMPEARLYCPIO}" || exit 1
fi
$compress -c "${__TMPMAINCPIO}" ||
{ echo "E: mkinitramfs failure $compress $?" >&2; exit 1; }
if [ -s "${__TMPCPIOGZ}" ]; then
cat "${__TMPCPIOGZ}" >>"${outfile}" || exit 1
cat "${__TMPCPIOGZ}" || exit 1
fi
} >"${outfile}" || exit 1
exit 0
......@@ -144,6 +144,25 @@ load_modules()
fi
}
_uptime() {
local uptime
uptime="$(cat /proc/uptime)"
uptime="${uptime%%[. ]*}"
echo "$uptime"
}
time_elapsed() {
# shellcheck disable=SC2154
if [ -z "$starttime" ]; then
log_failure_msg "time_elapsed() called before \$starttime initialized"
echo 0
fi
local delta
delta="$(_uptime)"
delta=$((delta - starttime))
echo "$delta"
}
# lilo compatibility
parse_numeric() {
case $1 in
......@@ -257,6 +276,21 @@ configure_networking()
# networking already configured thus bail out
[ -n "${DEVICE}" ] && [ -e /run/net-"${DEVICE}".conf ] && return 0
if [ -n "${DEVICE}" ]; then
local netdevwait=180
log_begin_msg "Waiting up to ${netdevwait} secs for ${DEVICE} to become available"
while [ "$(time_elapsed)" -lt "$netdevwait" ]; do
if [ -e "/sys/class/net/${DEVICE}" ]; then
break
fi
sleep 1
done
if [ ! -e "/sys/class/net/${DEVICE}" ]; then
log_failure_msg "Interface ${DEVICE} did not appear in time"
fi
log_end_msg
fi
wait_for_udev 10
# support ip options see linux sources
......
......@@ -8,14 +8,6 @@ local_top()
[ "$quiet" != "y" ] && log_end_msg
fi
local_top_used=yes
# Start time for measuring elapsed time in local_device_setup
if [ -z "${local_top_time}" ]; then
local_top_time="$(cat /proc/uptime)"
local_top_time="${local_top_time%%[. ]*}"
local_top_time=$((local_top_time + 1)) # round up
export local_top_time
fi
}
local_block()
......@@ -44,7 +36,6 @@ local_bottom()
fi
local_premount_used=no
local_top_used=no
unset local_top_time
}
# $1=device ID to mount
......@@ -94,9 +85,7 @@ local_device_setup()
while true; do
sleep 1
time_elapsed="$(cat /proc/uptime)"
time_elapsed="${time_elapsed%%[. ]*}"
time_elapsed=$((time_elapsed - local_top_time))
time_elapsed="$(time_elapsed)"
local_block "${dev_id}"
......@@ -113,7 +102,7 @@ local_device_setup()
else
break
fi
if [ ${count} -ge ${time_elapsed} ]; then
if [ "${count}" -ge "${time_elapsed}" ]; then
break;
fi
/scripts/local-block/mdadm "${dev_id}"
......@@ -125,7 +114,7 @@ local_device_setup()
log_end_msg 0
break
fi
if [ ${time_elapsed} -ge "${slumber}" ]; then
if [ "${time_elapsed}" -ge "${slumber}" ]; then
log_end_msg 1 || true
break
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment