prechroot.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ########
  2. ########
  3. ## chroot
  4. ## GLOBAL needs no changes
  5. #MIX ... this is where the addaption from gentoo to poly-distro develops
  6. #twil b fun getting this "if"ed up to accomodate the different chrootnesses needed.
  7. echo "======================"
  8. DISTRONAME=$(sed -n '1p' $WITCH/config.base.txt)
  9. echo "Distro name: $DISTRONAME"
  10. echo "======================"
  11. if [ $DIMG_RUN == "true" ]; then
  12. SYSPATH=$WITCH/sys/$DISTRONAME
  13. else
  14. SYSPATH=/mnt/$DISTRONAME
  15. fi
  16. #put prechroot and wichroot sections in a function too.
  17. #variable-ise this to accomodate differences between systems
  18. echo " copying your net connection dns stuffs to your $DISTRONAME with
  19. \"cp -L /etc/resolv.conf $SYSPATH/etc/resolv.conf\""
  20. cp -L /etc/resolv.conf $SYSPATH/etc/resolv.conf
  21. sleep 2
  22. echo "TO THE CHROOT"
  23. sleep 1
  24. 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
  25. well."
  26. sleep 7
  27. echo "you should be running this from a clean non-borked system (systemrescuecd is a good choice), if not... pray."
  28. sleep 3
  29. echo "mount -t proc none $SYSPATH/proc"
  30. mount -t proc none $SYSPATH/proc
  31. sleep 1
  32. echo "mount --rbind /sys $SYSPATH/sys"
  33. mount --rbind /sys $SYSPATH/sys
  34. sleep 1
  35. echo "mount --rbind /dev $SYSPATH/dev"
  36. mount --rbind /dev $SYSPATH/dev
  37. sleep 1