Skip to content

Commit

Permalink
Add various memory debug statements for issue 520.
Browse files Browse the repository at this point in the history
Let's try to find out why it doesn't work on 256MB devices.

Signed-off-by: Diederik de Haas <[email protected]>
  • Loading branch information
diederikdehaas committed Jul 15, 2021
1 parent 0c0f286 commit dab5fc9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scripts/etc/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ log_msg_end()
log_msg "$*"
}

print_mem_info()
{
log_msg ""
log_msg "Output of 'busybox free -k':"
busybox free -k
log_msg "Output of 'busybox df -aT':"
busybox df -aT
log_msg "Output of 'busybox du -h -d 1 /':"
busybox du -h -d 1 / 2>/dev/null
log_msg ""
}

fail()
{
log_msg
Expand Down Expand Up @@ -369,6 +381,11 @@ log_msg "================================================="
log_msg "https://github.com/debian-pi/raspbian-ua-netinst/"
log_msg "================================================="

log_msg "Output of 'busybox cat /proc/mounts':"
busybox cat /proc/mounts

print_mem_info

log_msg_start "Starting HWRNG "
modprobe bcm2835-rng
/usr/sbin/rngd -r /dev/hwrng
Expand All @@ -378,6 +395,8 @@ else
log_msg_end "FAILED! (continuing to use the software RNG)"
fi

print_mem_info

log_msg_start "Copying boot files... "
# copy boot data to safety
mount $bootpartition /boot || fail
Expand All @@ -387,6 +406,8 @@ cp -r -- /boot/* /bootfs/ || fail
umount /boot || fail
log_msg_end "OK"

print_mem_info

if [ -e /bootfs/installer-config.txt ]; then
log_msg "================================================="
log_msg "=== Start executing installer-config.txt. ==="
Expand Down Expand Up @@ -939,6 +960,8 @@ log_msg " hardware_versions = $hardware_versions"
log_msg " gpu_mem = $gpu_mem"
log_msg

print_mem_info

log_msg_start "Waiting 5 seconds"
for i in $(seq 1 5); do
log_msg_inline "."
Expand Down Expand Up @@ -1110,12 +1133,16 @@ mkdir /rootfs/boot || fail
mount $bootpartition /rootfs/boot || fail
log_msg_end "OK"

print_mem_info

log_msg "Starting install process..."
# With 'cdebootstrap_cmdline we're actually using the word splitting what SC2086 warns us against
# This should probably be fixed at some point, but not in this run/branch.
# shellcheck disable=SC2086
$CDEBOOTSTRAP_BIN --arch=armhf $cdebootstrap_cmdline "$release" /rootfs $mirror --keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg || fail

print_mem_info

log_msg "Configuring installed system:"

setup_chroot /rootfs
Expand Down Expand Up @@ -1649,6 +1676,8 @@ log_msg "Saving current time for fake-hwclock..."
sync # synchronize before saving time to make it "more accurate"
date +"%Y-%m-%d %H:%M:%S" > /rootfs/etc/fake-hwclock.data

print_mem_info

ENDTIME=$(date +%s)
DURATION=$((ENDTIME - REAL_STARTTIME))
log_msg_start "Installation finished at $(date --date="@$ENDTIME" --utc)"
Expand Down

0 comments on commit dab5fc9

Please sign in to comment.