prechroot.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ########
  2. ########
  3. ## chroot
  4. ## GLOBAL needs no changes
  5. echo "======================"
  6. DISTRONAME=$(sed -n '1p' $WITCH/config.base.txt)
  7. echo "Distro name: $DISTRONAME"
  8. echo "======================"
  9. if [ $DIMG_RUN == "true" ]; then
  10. SYSPATH=$WITCH/sys/$DISTRONAME
  11. else
  12. SYSPATH=/mnt/$DISTRONAME
  13. fi
  14. #put prechroot and wichroot sections in a function too.
  15. #variable-ise this to accomodate differences between systems
  16. echo " copying your net connection dns stuffs to your $DISTRONAME with
  17. \"cp -L /etc/resolv.conf $SYSPATH/etc/resolv.conf\""
  18. cp -L /etc/resolv.conf $SYSPATH/etc/resolv.conf
  19. sleep 2
  20. echo "TO THE CHROOT"
  21. sleep 1
  22. echo "In a few moments, we will change the Linux root towards the new location. To make sure that the new environment works properly, we need to make certain file systems available there as
  23. well."
  24. sleep 7
  25. echo "you should be running this from a clean non-borked system (systemrescuecd is a good choice), if not... pray."
  26. sleep 3
  27. echo "mount -t proc none $SYSPATH/proc"
  28. mount -t proc none $SYSPATH/proc
  29. sleep 1
  30. echo "mount --rbind /sys $SYSPATH/sys"
  31. mount --rbind /sys $SYSPATH/sys
  32. sleep 1
  33. echo "mount --rbind /dev $SYSPATH/dev"
  34. mount --rbind /dev $SYSPATH/dev
  35. sleep 1