mount hangs


4 posts
by elatllat » Sun Sep 23, 2012 4:42 am
1) Anyone know what the stack trace in this link means?:
https://bugs.launchpad.net/raspbian/+bug/1054768

2) Anyone else having problems with mount?
Posts: 1101
Joined: Sat Dec 17, 2011 5:05 pm
by elatllat » Tue Sep 25, 2012 8:00 pm
The workaround (until the kernel is fixed) is to use an old kernel:

"rpi-downgrade":
Code: Select all
#!/bin/bash

set -o nounset
set -o errexit

UPDATE=${UPDATE:-1}

ROOT_PATH=${ROOT_PATH:-"/"}
BOOT_PATH=${BOOT_PATH:-"/boot"}
SKIP_KERNEL=${SKIP_KERNEL:-0}
FW_REPOLOCAL="${ROOT_PATH}/root/rpi-firmware"
FW_PATH="${BOOT_PATH}"
FW_MODPATH="${ROOT_PATH}/lib/modules"
FW_RAM=${1:-0}

function detect_split() {
   if [[ -f "$FW_PATH/start.elf" && ${FW_RAM} -eq 0 ]]; then
      echo "Autodetecting memory split"
      FW_RAM=240
      for R in 128 192 224 240
      do
         if [[ -f "$FW_PATH/arm${R}_start.elf" ]]
         then
                  if diff "$FW_PATH/arm${R}_start.elf" "$FW_PATH/start.elf" >/dev/null
                  then
                    FW_RAM=$R
                    break
                  fi
         fi
      done
   fi
   FW_GPU=$((256-FW_RAM))
}

function update_modules {
   if [[ ${SKIP_KERNEL} -eq 0 ]]; then
      cp -R "${FW_REPOLOCAL}/modules/"* "${FW_MODPATH}/"
      find "${FW_REPOLOCAL}/modules" -mindepth 1 -maxdepth 1 -type d | while read DIR; do
         depmod -b "${ROOT_PATH}" -a $(basename "${DIR}")
      done
   fi
}

function update_sdk {
   if [[ -f /etc/init.d/vcfiled ]]; then
      /etc/init.d/vcfiled stop
   fi

   ELFOUTPUT=$(readelf -a "${ROOT_PATH}/bin/bash")
   if [ "${ELFOUTPUT}" != "${ELFOUTPUT/VFP_args/}" ]; then
      echo "Using HardFP libraries"
      cp -R "${FW_REPOLOCAL}/vc/hardfp/"* "${ROOT_PATH}/"
   else
      echo "Using SoftFP libraries"
      cp -R "${FW_REPOLOCAL}/vc/softfp/"* "${ROOT_PATH}/"
   fi
   cp -R "${FW_REPOLOCAL}/vc/sdk/"* "${ROOT_PATH}/"

   if [[ -f /etc/init.d/vcfiled ]]; then
      /etc/init.d/vcfiled start
   fi
}

function set_split {
   cp "${FW_PATH}/arm${FW_RAM}_start.elf" "${FW_PATH}/start.elf"
}

function update_firmware {
   cp "${FW_REPOLOCAL}/"*.elf "${FW_PATH}/"
   cp "${FW_REPOLOCAL}/"*.bin "${FW_PATH}/"
   if [[ ${SKIP_KERNEL} -eq 0 ]]; then
      cp "${FW_REPOLOCAL}/"*.img "${FW_PATH}/"
   else
      echo "Skipping kernel/modules updated as requested"
   fi
}

function finalise {
   ldconfig -r "${ROOT_PATH}"
   sync
}

function do_backup {
   cp -a "${FW_PATH}" "${FW_PATH}.bak"
   cp -a "${FW_MODPATH}" "${FW_MODPATH}.bak"
}

function do_update {
   update_firmware
   update_modules
   update_sdk
   set_split
   finalise
   echo "If no errors appeared, your firmware was successfully $1"
   if [[ "${ROOT_PATH}" == "/" ]]; then
      echo "A reboot is needed to activate the new firmware"
   fi
}

if [[ ${EUID} -ne 0 ]]; then
   echo "This tool must be run as root"
   exit 1
fi

if [[ ( "${ROOT_PATH}" == "/"  &&  "${BOOT_PATH}" != "/boot" ) ]] ||
[[ ( "${BOOT_PATH}" == "/boot"  &&  "${ROOT_PATH}" != "/" ) ]]; then
   echo "You need to specify both ROOT_PATH and BOOT_PATH, or neither"
   exit 1
fi

if [[ ! -d "${FW_PATH}" ]]; then
   echo "${FW_PATH} doesn't exist"
   exit 1
fi
if [[ ! -f "${FW_PATH}/start.elf" ]]; then
   echo "${FW_PATH}/start.elf doesn't exist."
   exit 1
fi
if [[ ! -d "${FW_MODPATH}" ]]; then
   echo "${FW_MODPATH} doesn't exist"
   exit 1
fi

command -v readelf >/dev/null 2>&1 || {
   echo "This tool requires you have readelf installed, please install it first"
   echo "In Debian, try: sudo apt-get install binutils"
   echo "In Arch, try: pacman -S binutils"
   exit 1
}

detect_split
if [[ ${FW_RAM} -ne 240 ]] &&[[ ${FW_RAM} -ne 224 ]] && [[ ${FW_RAM} -ne 192 ]] && [[ ${FW_RAM} -ne 128 ]]; then
   echo "RAM value must be one of: 240, 224, 192, 128"
   exit 1
fi
echo "Using ARM/GPU memory split of ${FW_RAM}MB/${FW_GPU}MB"

apt-get update
apt-get upgrade
cd ~/
apt-get install -y git
git clone http://github.com/Hexxeh/rpi-firmware.git
cd rpi-firmware
git checkout 8c628900aabe4a15743d8a11cb6169ad0bf1918e
if [[ -f "${FW_REPOLOCAL}/.git/config" ]]; then
   do_update "updated"
else
   echo "no local repo"
fi
shutdown -r now
Posts: 1101
Joined: Sat Dec 17, 2011 5:05 pm
by elatllat » Wed Sep 26, 2012 8:17 pm
By the way as of this post:

Latest Linux kernel:
3.5.4

Latest Linux kernel for the rpi:
3.2.27

Latest Linux kernel for the rpi that will mount a device mapper:
3.1.9
Posts: 1101
Joined: Sat Dec 17, 2011 5:05 pm
by elatllat » Fri Jun 07, 2013 2:55 am
This is now fixed ( tested in kernel 3.6.11 )
Posts: 1101
Joined: Sat Dec 17, 2011 5:05 pm