IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

focker-bsdinstall 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/sh
  2. if [ -z "$1" ]; then
  3. echo "Usage: focker-bsdinstall chroot_dir"
  4. exit 1
  5. fi
  6. BSDCFG_SHARE="/usr/share/bsdconfig"
  7. . $BSDCFG_SHARE/common.subr || exit 1
  8. : ${BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"}; export BSDINSTALL_TMPETC
  9. : ${BSDINSTALL_TMPBOOT="/tmp/bsdinstall_boot"}; export BSDINSTALL_TMPBOOT
  10. : ${PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"}; export PATH_FSTAB
  11. : ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR
  12. : ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT
  13. echo "Began Installation at" "$( date )"
  14. export BSDINSTALL_CHROOT=$1
  15. error() {
  16. if [ -n "$1" ]; then
  17. echo "$1" >&2
  18. fi
  19. exit $FAILURE
  20. }
  21. rm -rf $BSDINSTALL_TMPETC
  22. mkdir $BSDINSTALL_TMPETC
  23. mkdir -p $1 || error "mkdir failed for $1"
  24. test ! -d $BSDINSTALL_DISTDIR && mkdir -p $BSDINSTALL_DISTDIR
  25. # echo "BSDINSTALL_DISTDIR: $BSDINSTALL_DISTDIR"
  26. # exit
  27. export DISTRIBUTIONS="base.txz"
  28. FETCH_DISTRIBUTIONS=""
  29. for dist in $DISTRIBUTIONS; do
  30. if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then
  31. FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist"
  32. fi
  33. done
  34. FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space
  35. if [ -n "$FETCH_DISTRIBUTIONS" -a -z "$BSDINSTALL_DISTSITE" ]; then
  36. BSDINSTALL_DISTSITE=`focker-mirrorselect`
  37. export BSDINSTALL_DISTSITE
  38. fi
  39. if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then
  40. bsdinstall distfetch || error "Failed to fetch distribution"
  41. fi
  42. bsdinstall checksum || error "Distribution checksum failed"
  43. bsdinstall distextract || error "Distribution extract failed"
  44. # bsdinstall rootpass || error "Could not set root password"
  45. echo "Setting random root password ..."
  46. openssl rand -base64 8 | md5 | head -c32 | chroot "$BSDINSTALL_CHROOT" pw user mod root -h 0
  47. bsdinstall config || error "Failed to save config"
  48. cp /etc/resolv.conf $1/etc
  49. cp /etc/localtime $1/etc
  50. bsdinstall entropy
  51. echo "Installation Completed at" "$(date)"
  52. exit $SUCCESS