diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-07-01 11:06:32 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-07-01 11:06:32 +0000 |
commit | b6a1b5d84d245142c7f92f2562f70de484e082dc (patch) | |
tree | aaa6f8c2e5fe1057733e3b1fd98913ebddcbd75c /package/block-mount | |
parent | 9f93ad9ef03d1067d1180fabf75557129f749cf7 (diff) |
Fix extroot by UUID
Extroot works fine when the target device is specified by a path. It fails
however if the device is specified by UUID (the target partition gets mounted
much later by hotplug hooks). This is because the blkid command is no longer
compiled into BusyBox (since changeset [1]) so it's unavailable for the
preinit phase.
The closest bug report I was able to find is [2], although the reporting person
mentions that /tmp/overlay-disabled showed up which wasn't there in my case.
This patch sets PATH and LD_LIBRARY_PATH environment variables so that the
blkid command installed on the target device can be used by that particular
preinit script.
[1] https://dev.openwrt.org/changeset/26245
[2] https://dev.openwrt.org/ticket/10653
Signed-off-by: Jaroslaw Swierczynski <jarek1701@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32567 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/block-mount')
-rw-r--r-- | package/block-mount/files/50_determine_usb_root | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/package/block-mount/files/50_determine_usb_root b/package/block-mount/files/50_determine_usb_root index 8c5841e32..d39806266 100644 --- a/package/block-mount/files/50_determine_usb_root +++ b/package/block-mount/files/50_determine_usb_root @@ -9,6 +9,8 @@ determine_external_root() { pi_include /lib/functions/mount.sh local OLD_UCI_CONFIG_DIR="$UCI_CONFIG_DIR" + local OLD_PATH="$PATH" + local OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" set_jffs_mp determine_root_device @@ -19,6 +21,9 @@ determine_external_root() { UCI_CONFIG_DIR="/tmp/overlay/etc/config" ER_IS_SQUASHFS=true ER_OVERLAY_PREFIX="/tmp/overlay" + PATH=$ER_OVERLAY_PREFIX/sbin:$PATH + LD_LIBRARY_PATH=$ER_OVERLAY_PREFIX/usr/lib:$LD_LIBRARY_PATH + export PATH LD_LIBRARY_PATH fi # For squashfs on firstboot root_device will be tmpfs for the ramoverlay, @@ -51,6 +56,9 @@ determine_external_root() { } } UCI_CONFIG_DIR="$OLD_UCI_CONFIG_DIR" + PATH="$OLD_PATH" + LD_LIBRARY_PATH="$OLD_LD_LIBRARY_PATH" + export PATH LD_LIBRARY_PATH } boot_hook_add preinit_mount_root determine_external_root |