Make _mnt_squashfs more generic
No longer assume the image is in the addons directory. Signed-off-by: Simo Leone <simo@archlinux.org>
This commit is contained in:
parent
9729512abd
commit
adbe44f229
@ -11,7 +11,7 @@ _mnt_squashfs()
|
|||||||
{
|
{
|
||||||
msg "::: Adding new union branch: ${1}"
|
msg "::: Adding new union branch: ${1}"
|
||||||
mkdir -p "/tmpfs/mnt/loop${LOOP_NUM}"
|
mkdir -p "/tmpfs/mnt/loop${LOOP_NUM}"
|
||||||
if ! /bin/losetup "/dev/loop${LOOP_NUM}" ${addon_dir}/${1} > /dev/null 2>&1; then
|
if ! /bin/losetup "/dev/loop${LOOP_NUM}" ${1} > /dev/null 2>&1; then
|
||||||
echo "ERROR: Cannot mount loop device /dev/loop${LOOP_NUM}"
|
echo "ERROR: Cannot mount loop device /dev/loop${LOOP_NUM}"
|
||||||
echo " Couldn't mount all addons"
|
echo " Couldn't mount all addons"
|
||||||
break
|
break
|
||||||
@ -60,7 +60,7 @@ run_hook ()
|
|||||||
addon_dir="${BOOT_MOUNT}/addons"
|
addon_dir="${BOOT_MOUNT}/addons"
|
||||||
|
|
||||||
# always layer default configuration
|
# always layer default configuration
|
||||||
_mnt_squashfs "default-config.sqfs"
|
_mnt_squashfs "${addon_dir}/default-config.sqfs"
|
||||||
|
|
||||||
if [ -e "${addon_dir}/config" ]; then
|
if [ -e "${addon_dir}/config" ]; then
|
||||||
msg ":: Mounting addons"
|
msg ":: Mounting addons"
|
||||||
@ -71,7 +71,7 @@ run_hook ()
|
|||||||
if [ "${type}" = "bind" ]; then
|
if [ "${type}" = "bind" ]; then
|
||||||
_mnt_bind ${img} ${mountpoint}
|
_mnt_bind ${img} ${mountpoint}
|
||||||
elif [ "${type}" = "squashfs" ]; then
|
elif [ "${type}" = "squashfs" ]; then
|
||||||
_mnt_squashfs ${img}
|
_mnt_squashfs "${addon_dir}/${img}"
|
||||||
fi
|
fi
|
||||||
done < ${addon_dir}/config
|
done < ${addon_dir}/config
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user