diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-01-25 17:11:17 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-01-25 17:11:17 +0000 |
commit | 56bc02a305ae8d8a7e927622d924cdab56d4f012 (patch) | |
tree | 079702f93a3ad4420b99f31bc99c1b9b2b9a8a08 /package/base-files/files/sbin/mount_root | |
parent | 35170c48928e99dda69d46274c2749bc9bff972d (diff) | |
download | upstream-56bc02a305ae8d8a7e927622d924cdab56d4f012.tar.gz upstream-56bc02a305ae8d8a7e927622d924cdab56d4f012.tar.bz2 upstream-56bc02a305ae8d8a7e927622d924cdab56d4f012.zip |
add preinit modularization work by Daniel Dickinson (cshore)
SVN-Revision: 19331
Diffstat (limited to 'package/base-files/files/sbin/mount_root')
-rwxr-xr-x | package/base-files/files/sbin/mount_root | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/package/base-files/files/sbin/mount_root b/package/base-files/files/sbin/mount_root index 86d4ef95fb..033dfda29f 100755 --- a/package/base-files/files/sbin/mount_root +++ b/package/base-files/files/sbin/mount_root @@ -1,25 +1,26 @@ #!/bin/sh -# Copyright (C) 2006 OpenWrt.org -. /etc/functions.sh +# Copyright (C) 2006-2010 OpenWrt.org +# Copyright (C) 2010 Vertical Communications -jffs2_ready () { - mtdpart="$(find_mtd_part rootfs_data)" - magic=$(hexdump $mtdpart -n 4 -e '4/1 "%02x"') - [ "$magic" != "deadc0de" ] -} +# Initialize hook variables et by pulling in from preinit + +preinit_essential_hook= +preinit_main_hook= +failsafe_hook= +initramfs_hook= +preinit_mount_root= + +. /lib/functions/boot.sh -grep rootfs_data /proc/mtd >/dev/null 2>/dev/null && { - . /sbin/firstboot - mtd unlock rootfs_data - jffs2_ready && { - echo "switching to jffs2" - mount "$(find_mtd_part rootfs_data)" /jffs -t jffs2 && \ - fopivot /jffs /rom - } || { - echo "jffs2 not ready yet; using ramdisk" - ramoverlay - } -} || { - mtd unlock rootfs - mount -o remount,rw /dev/root / +for pi_source_file in /lib/preinit/*; do + . $pi_source_file +done + +# Override function that doesn't apply to use of mount_root as a command rather +# than as part of preinit + +preinit_echo() { + echo "$@" } + +boot_run_hook mount_root |