Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- run_hook ()
- {
- export HOST="/host"
- export UNION="/new_root"
- mkdir -p /host
- case ${real_root} in loop\=*)
- loop=${real_root/loop=}
- if [ -e $loop ]; then
- fstype=$(blkid -u filesystem -o value -s TYPE -p "${loop}")
- if [ "${readwrite}" = "no" ]; then rwopt="ro"; else rwopt="rw"; fi #Checks whether it is writeable
- #mount -t $fstype -o $rwopt $loop $HOST #Mounting doesn't work for ntfs so using 3g to mount
- ntfs-3g $loop $HOST
- echo ntfs-3g $loop $HOST
- if [ -f $HOST/$loopfile ]; then
- loopfile="$HOST/$loopfile"
- fstype=$(blkid -u filesystem -o value -s TYPE -p "${loopfile}")
- if [ "${fstype}" = "squashfs" ]; then rwopt="ro"; fi
- mount -t $fstype -o $rwopt $loopfile $UNION
- mkdir -p $UNION$HOST
- mkdir -p $UNION$loop
- mount -o bind $HOST $UNION/host
- MOUNTED=1
- fi
- fi
- ;;
- esac
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement