s243a

mount_rootfs64

Mar 17th, 2019
158
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. curdir=`pwd`
  3. unmount_vfs(){
  4.  umount -l $curdir/slitaz-rootfs$prefix/dev 2>/dev/null
  5.  umount -l $curdir/slitaz-rootfs$prefix/sys 2>/dev/null
  6.  umount -l $curdir/slitaz-rootfs$prefix/proc 2>/dev/null
  7.  #umount /mnt/wktaz 2>/dev/null
  8.  #umount /mnt/wksfs 2>/dev/null
  9. }  
  10. prefix='/64'
  11. trap unmount_vfs EXIT
  12. trap unmount_vfs SIGKILL
  13. trap unmount_vfs SIGTERM
  14. xinteractive=1
  15. echo "PUPMODE='2'" > $curdir/slitaz-rootfs$prefix/etc/rc.d/PUPSTATE
  16. mount -o rbind /proc $curdir/slitaz-rootfs$prefix/proc
  17. mount -t sysfs none $curdir/slitaz-rootfs$prefix/sys
  18. if [ $xinteractive -eq 1 ]; then
  19.  echo "Removing block device files..."
  20.  #rm -rf $curdir/slitaz-rootfs/dev/*
  21.  #mount bind -t devtmpfs none $curdir/slitaz-rootfs/dev
  22.  mount -o rbind /dev $curdir/slitaz-rootfs$prefix/dev
  23.  cp -f /etc/resolv.conf $curdir/slitaz-rootfs/etc/resolv.conf
  24. fi
  25.  
  26. chroot $curdir/slitaz-rootfs$prefix /bin/bash
  27.  
  28.  
  29. if [ "$(mount | grep "$curdir/slitaz-rootfs/dev")" != "" ]; then
  30.  umount -l $curdir/slitaz-rootfs$prefix/dev
  31. fi 
  32.  
  33. if [ "$(mount | grep "$curdir/slitaz-rootfs/sys")" != "" ]; then
  34.  umount -l $curdir/slitaz-rootfs$prefix/sys
  35. fi 
  36. if [ "$(mount | grep "$curdir/slitaz-rootfs/proc")" != "" ]; then
  37.  umount -l $curdir/slitaz-rootfs$prefix/proc
  38. fi
RAW Paste Data