SHARE
TWEET

MacLemon

a guest Feb 2nd, 2010 541 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # ALIX 3D2 system configuration for Embedded Tor node
  2. # By MacLemon
  3. # Public Domain, do whatever you want with it
  4.  
  5. # 2010/02/01
  6.  
  7.  
  8. # The numbers in the name correspond to the git repository revision.
  9. NANO_NAME=Alix3D2-53-1b1c29f
  10. NANO_KERNEL=/usr/src/tools/tools/nanobsd/ALIXKERNEL-53-1b1c29f
  11.  
  12. NANO_SRC=/usr/src
  13. NANO_IMAGES=2
  14.  
  15. NANO_BOOT0CFG="-o nopacket -s 1 -m 3" # nopacket seems to be required by tinyBIOS
  16. NANO_PMAKE="make -j 6"
  17.  
  18. # To stop nanoBSD from outputting everything to serial console (when using VGA)
  19. # NANO_BOOTLOADER="boot/boot0"
  20.  
  21.  
  22. # Drive geometry
  23.  
  24. # Log C/H/S 1007/32/63 (1 GB)
  25. # NANO_MEDIASIZE=2030112
  26. # NANO_HEADS=32
  27. # NANO_SECTS=63
  28.  
  29. # Log C/H/S 974/64/63 SanDisk ultra II 2GB
  30. NANO_MEDIASIZE=3928176
  31. NANO_HEADS=64 # heads from the logic CHS information at boot time
  32. NANO_SECTS=63 # sects from the logic CHS information at boot time
  33. NANO_DRIVE=ad0
  34.  
  35.  
  36. NANO_CODESIZE=0
  37. NANO_CONFSIZE=2048
  38. NANO_DATASIZE=262144
  39. NANO_RAM_ETCSIZE=10240
  40. NANO_RAM_TMPVARSIZE=20480
  41.  
  42.  
  43. CONF_WORLD='
  44. TARGET=i386
  45. TARGET_ARCH=i386
  46. TARGET_CPUTYPE=pentium-mmx
  47. WITHOUT_ACPI=yes
  48. WITHOUT_ATM=yes
  49. WITHOUT_BLUETOOTH=yes
  50. WITHOUT_CALENDAR=yes
  51. WITHOUT_DICT=yes
  52. WITHOUT_FORTRAN=yes
  53. WITHOUT_GCOV=yes
  54. WITHOUT_GPIB=yes
  55. WITHOUT_HTML=yes
  56. WITHOUT_I4B=yes
  57. WITHOUT_INFO=yes
  58. WITHOUT_IPFILTER=yes
  59. WITHOUT_IPX=yes
  60. WITHOUT_KERBEROS=yes
  61. WITHOUT_LPR=yes
  62. WITHOUT_NIS=yes
  63. WITHOUT_NLS=yes
  64. WITHOUT_NLS_CATALOGS=yes
  65. WITHOUT_PROFILE=yes
  66. WITHOUT_RCMDS=yes
  67. WITHOUT_RESCUE=yes
  68. WITHOUT_SHAREDOCS=yes
  69. WITHOUT_SYSCONS=yes
  70. WITHOUT_ZFS=yes
  71. BOOT_COMCONSOLE_SPEED=9600
  72. '
  73.  
  74. cust_nobeastie() (
  75.     touch ${NANO_WORLDDIR}/boot/loader.conf
  76.     echo "beastie_disable=\"YES\"" >> ${NANO_WORLDDIR}/boot/loader.conf
  77. )
  78.  
  79. cust_loader_conf(){
  80.         # Shortens the boot delay to select the desired slice to 3s (default is 10s)
  81.         # Speeds up the boot process by 7 seconds
  82.         echo "autoboot_delay=\"3\"" >> ${NANO_WORLDDIR}/boot/loader.conf
  83. }
  84.  
  85. cust_rc_conf(){
  86.     touch ${NANO_WORLDDIR}/etc/rc.conf
  87.  
  88.         # Fetch an IP from DHCP on vr0 (primary ethernet interface on ALIX)
  89.         echo "ifconfig_vr0=\"DHCP\"" >> ${NANO_WORLDDIR}/etc/rc.conf
  90.  
  91.         # Set time via ntp, this cannot be done through tor, since ntp uses UDP
  92.         echo "ntpdate_enable=\"YES\"" >> ${NANO_WORLDDIR}/etc/rc.conf
  93.         echo "ntpdate_hosts=\"pool.ntp.org\"" >> ${NANO_WORLDDIR}/etc/rc.conf
  94.  
  95.         # Run tor at system start
  96.         echo "tor_enable=\"YES\"" >> ${NANO_WORLDDIR}/etc/rc.conf
  97.  
  98.         # Set correct file permissions
  99.         chmod 644 ${NANO_WORLDDIR}/etc/rc.conf
  100. }
  101.  
  102.  
  103. cust_add_packages(){
  104.         # Add packages to
  105.         # /usr/src/tools/tools/nanobsd/packages
  106.  
  107.         # first clean this from last build
  108. #       rm -r /usr/src/tools/tools/nanobsd/packages/*
  109.        
  110.         cp -r /usr/ports/security/tor /usr/src/tools/tools/nanobsd/packages/
  111. }
  112.  
  113.  
  114. install_packages(){
  115.   mkdir -p ${NANO_WORLDDIR}/packages
  116.   cp /usr/src/tools/tools/nanobsd/packages/* ${NANO_WORLDDIR}/packages
  117.   chroot ${NANO_WORLDDIR} sh -c 'cd packages; pkg_add -v *;cd ..;'
  118.   rm -rf ${NANO_WORLDDIR}/packages
  119. }
  120.  
  121.  
  122.  
  123.  
  124. cust_install_packages(){
  125.           PACKAGE_LIST=`ls ${CONF_ROOT}/packages/*`
  126.           cd ${NANO_WORLDDIR}
  127.           for p in ${PACKAGE_LIST}
  128.           do
  129.                   cat ${p} | pkg_add -rvC . -
  130.           done
  131. }
  132.  
  133.  
  134. customize_cmd cust_comconsole
  135. customize_cmd cust_install_files
  136. customize_cmd cust_nobeastie
  137. customize_cmd cust_rc_conf
  138. customize_cmd cust_loader_conf
  139.  
  140. # customize_cmd cust_tor
  141. # customize_cmd cust_add_packages
  142. # customize_cmd cust_install_packages
  143. customize_cmd install_packages
  144.  
  145. # Just for testing, we actually do not need this during normal operation
  146. ##### Be sure to change tha password for root if you enable SSH! #####
  147. customize_cmd cust_allow_ssh_root
  148.  
  149. #EOF
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top