fix fwupdate initramfs

This commit is contained in:
Calin Crisan 2017-03-12 16:05:47 +02:00
parent 7d7b89587c
commit 50450b7279
8 changed files with 11 additions and 12 deletions

View File

@ -6,14 +6,20 @@ msg() {
echo "* $1" echo "* $1"
} }
msg "Waiting for sdcard"
sleep 2
msg "Mounting pseudo filesystems"
mount -t devtmpfs devtmpfs /dev
mount -t proc proc /proc
ROOT_DEV=$(cat /proc/cmdline | grep -oE 'root=[/a-z0-9]+' | cut -d '=' -f 2) ROOT_DEV=$(cat /proc/cmdline | grep -oE 'root=[/a-z0-9]+' | cut -d '=' -f 2)
if [[ "$ROOT_DEV" =~ ^([/a-z0-9]+)(p[0-9])$ ]]; then # e.g. /dev/mmcblk0p2 if echo ${ROOT_DEV: -2} | grep -E 'p[0-9]' &>/dev/null; then # e.g. /dev/mmcblk0p2
DISK_DEV=${BASH_REMATCH[1]} DISK_DEV=${ROOT_DEV:0:$((${#ROOT_DEV}-2))}
BOOT_DEV=${DISK_DEV}p1 BOOT_DEV=${DISK_DEV}p1
DATA_DEV=${DISK_DEV}p3 DATA_DEV=${DISK_DEV}p3
else # e.g. /dev/sdc2 else # e.g. /dev/sdc2
[[ "$ROOT_DEV" =~ ^([/a-z0-9]+)([0-9])$ ]] DISK_DEV=${ROOT_DEV:0:$((${#ROOT_DEV}-1))}
DISK_DEV=${BASH_REMATCH[1]}
BOOT_DEV=${DISK_DEV}1 BOOT_DEV=${DISK_DEV}1
DATA_DEV=${DISK_DEV}3 DATA_DEV=${DISK_DEV}3
fi fi
@ -52,13 +58,6 @@ on_exit() {
trap on_exit EXIT trap on_exit EXIT
msg "Waiting for sdcard"
sleep 2
msg "Mounting pseudo filesystems"
mount -t devtmpfs devtmpfs /dev
mount -t proc proc /proc
if [ -x /prepare_initramfs ]; then if [ -x /prepare_initramfs ]; then
msg "Preparing initramfs" msg "Preparing initramfs"
/prepare_initramfs /prepare_initramfs

View File

@ -229,7 +229,7 @@ function flash_boot() {
echo $pid > $FW_DIR/$DD_PID_FILE echo $pid > $FW_DIR/$DD_PID_FILE
wait $pid wait $pid
mount -o rw /boot mount -T /etc/fstab.disk -o rw /boot
# the /usr/libexec/fw-restore-boot-cfg script, if present, takes the old (backup) boot dir as argument # the /usr/libexec/fw-restore-boot-cfg script, if present, takes the old (backup) boot dir as argument
# and should restore any /boot configuration that needs to be preserved across updates # and should restore any /boot configuration that needs to be preserved across updates

Binary file not shown.

BIN
board/odroidc2/uInitrd Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.