archive-org.com » ORG » N » NETBSD.ORG

Total: 1243

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • how to use ptyfs
    0 How does it work The traditional bsd style pty s are allocated to a fixed number of pty devices available That is normally ttyp0 ttyp9 and ttypa ttypf which makes 16 ptys in total There are also the groups of ttyq ttyr ttys in the same way which makes a total of 16 4 64 devices This means that no more than 64 remote connections to a NetBSD machine are possible ptyfs on the contrary is allocating the devices dynamically That means whenever a remote connection is established a new device is created This way the number of connections are only limited by the resources of the server Why do I need it Normally you don t You will need ptyfs if you re going to run a server with hundreds 64 of remote connections ssh or telnet There are also a few applications like Matlab that require ptyfs I personally prefer ptyfs and use it on all my servers How do I use it If you use NetBSD 4 0 or higher ptyfs is enabled by default in all GENERIC Kernels Otherwise you have to rebuild your Kernel to use PTYFS To enable PTYFS please ensure that the line file system PTYFS is uncommented or available in your Kernel config file Now rebuild your Kernel and reboot Setting up dev pts Change into the dev directory and create the directory pts as root cd dev mkdir pts Testing ptyfs Before we change the file etc fstab we have to ensure that ptyfs is working Otherwise your server won t be able to boot To test if ptyfs is working mount it manually mount ptyfs ptyfs dev pts Check if it is mounted mount ptyfs on dev pts type ptyfs local Editing fstab You can now edit your etc

    Original URL path: http://wiki.netbsd.org/tutorials/how_to_use_ptyfs/ (2016-02-01)
    Open archived version from archive


  • how to use snapshots
    of a filesystem then create a new file or change an existing one and if you look at the snapshot it will show you the old version of the file or the directory without this file What is a snapshot not A snapshot is no filesystem versioning Snapshots by fss are read only views and you cannot revert the filesystem back to a snapshot without copying all the files on filesystem layer You can only mount the snapshot to see what the filesystem looked like back then but not more How to create snapshots Snapshots are configured using the tool fssconfig 8 To create a snapshot you have to enter the snapshot device you want to use dev fssX the filesystem you want to snapshot and the place of the snapshot file which can even lie on the filesystem it is snapshotting So if you want to create a snapshot of filesystem you would e g enter fssconfig c fss0 root backup Then you get a snapshot in root backup You can then mount that snapshot somewhere and in that mount you have a view of the filesystem at the point of creating the snapshot mount dev fss0 mnt When you are done with the snapshot you unmount it and unconfigure the snapshot umount dev fss0 fssconfig u fss0 How to use snapshots To use a snapshot you just configure it again with the same parameters as the first time but now without creating it fssconfig fss0 root backup mount dev fss0 mnt If you want to use the snapshot only once you can use the option x when creating it Then the snapshot will only be available for this one single time and is deleted afterwards fssconfig cx fss0 root backup Usage example What is this even good for

    Original URL path: http://wiki.netbsd.org/tutorials/how_to_use_snapshots/ (2016-02-01)
    Open archived version from archive

  • how to use thumb mode on arm
    all of the build time failing machine dependent object files can be found and marked with the help of Per file build options override to be compiled to ARM mode with thumb interworking Build time failures are of course not the only things can go wrong with thumb support At run time some parts of the kernel or userspace are expected to be in ARM mode In userspace for example this means that the dynamic linker ld elf so userspace locking and C runtime initialization CSU parts need to be in ARM mode Userspace Userspace in current compiles to userspace but doesn t work due to a linker bug 2 3 If the binutils package is upgraded to 2 18 50 from 2 16 1 then thumb mode works for userspace After this only a build script marking the ARM and thumb mode files is needed Following patches do it all for current snapshot from Oct 22nd 2008 binutils upgrade and tuning for NetBSD in 4 and 5 thumb build script 6 After the patches have been applied on top of current the build process continues like this build tools build sh U O obj m evbarm j 3 tools build userspace to thumb note that the script expects to find tools directory under obj thumb sh build a normal ARM mode kernel where CONFIG is the configuration file name like TISDP2420 build sh U O obj m evbarm j 3 kernel CONFIG The next step is to verify that the thumb mode userspace works by booting into it On OMAP 2420 development board this requires setting up a TFTP server for the kernel executable netbsd bin and then setting up the root filesystem over NFS and configuring the kernel accordingly Known problems While the thumb mode userspace boots and

    Original URL path: http://wiki.netbsd.org/tutorials/how_to_use_thumb_mode_on_arm/ (2016-02-01)
    Open archived version from archive

  • how to use tmpfs
    Merino Vidal during the Summer of Code Project in 2005 It was merged into the NetBSD tree on the 10th of September 2005 Tmpfs left experimental status on 11 11 2006 and is now enabled by default in all GENERIC kernels How does it work In the contrary to mfs tmpfs uses its own data structures to manage the stored files It uses the correct amount of memory to work correctly and efficiently which means it grows and shrinks Why do I need it Normally you don t You can work with your hard disk But you can use it to reduce hard disk activity if you store temporary data to tmpfs which is faster aswell I personally prefer tmpfs for tmp and use it on all my servers How do I use it Before you can use tmpfs you have to rebuild your Kernel To enable TMPFS please ensure that the line file system TMPFS is available and uncommented in your Kernel config file Now rebuild your Kernel and reboot Testing tmpfs Before we change the file etc fstab we have to ensure that tmpfs is working Otherwise your server won t be able to boot To test if

    Original URL path: http://wiki.netbsd.org/tutorials/how_to_use_tmpfs/ (2016-02-01)
    Open archived version from archive

  • how to use ttf fonts in xterm
    Ports History Emulators Packages Browse packages Release engineering Wiki Home Edit Comment Source History New RecentChanges NetBSD Wiki tutorials how to use ttf fonts in xterm Contents Introduction freetype support cd usr pkgsrc x11 xterm Choose font Run xterm Xdefaults file Screenshots Credits Introduction The purpose of this document is to guide you on how to make xterm use a truetype font freetype support First you need to compile xterm with freetype 11 support Assuming your pkgsrc is located in usr pkgsrc you may write 11 http en wikipedia org wiki FreeType http en wikipedia org wiki FreeType cd usr pkgsrc x11 xterm make PKG OPTIONS xterm freetype make install Note If you want to compile every application with freetype enabled provided it has support for it add PKG DEFAULT OPTIONS freetype in your etc mk conf file Choose font First pick a font you like from this list fc list col sort less Note A nice font set is Liberation It can be found in fonts liberation ttf Run xterm Then type xterm fa Liberation Mono fs 10 Xdefaults file If you want xterm to use these font settings by default you may add the following lines in your

    Original URL path: http://wiki.netbsd.org/tutorials/how_to_use_ttf_fonts_in_xterm/ (2016-02-01)
    Open archived version from archive

  • how to use wpa supplicant
    supplicant YES wpa supplicant flags B i ath0 c etc wpa supplicant conf Also note that wpa supplicant lives in usr sbin Depending on your file system layout you may need to add usr to the critical filesystems local override in etc rc conf Example critical filesystems local var usr That s it Now you can start wpa supplicant with etc rc d wpa supplicant start then restart your network with etc rc d network restart Using dhcpcd instead of dhclient In NetBSD 5 0 you can also put a new line in etc ifconfig ath0 that mentions dhcp up dhcp This will bring the interface up and start dhcpcd 8 the new DHCP client daemon If you do this you can remove dhclient from your configuration and change the dhclient flags to dhcpcd flags Do not wait for lease useful if no network is within reach so boot will not hang dhcpcd flags q b wpa supplicant YES wpa supplicant flags B i ath0 c etc wpa supplicant conf Adding a new network With the above setup all you have to do is add the configuration to your wpa supplicant conf and then tell wpa supplicant to reload its config wpa cli reconfigure That s it With wpa cli status you can track the status and see if it authenticates If you wait a moment dhcpcd will pick up the change and automatically obtain a new lease If the wpa cli command generates a Failed to connect to wpa supplicant wpa ctrl open No such file or directory error make sure you set the ctrl interface parameter in the wpa supplicant conf 8 as ctrl interface var run wpa supplicant ctrl interface group wheel Other Network Configurations wpa supplicant can also connect to other network configurations These configurations can be given different priorities using the priority field with a higher number indicating a higher priority Unprotected Networks network ssid MYUNPROTECTEDWLAN scan ssid 1 key mgmt NONE priority 100 WEP encryption WEP is the weakest of current 802 11 encryption solutions It is known to be completely broken breaking WEP can be done in mere seconds However sometimes there is a need to use WEP in legacy networks Here is a configuration if you want to do it with wpa supplicant network ssid MYWEAKLYENCRYPTEDWLAN key mgmt NONE wep key0 12345 or 13 characters or a hexkey starting with 0x wep tx keyidx 0 Oddly enough the wep key0 and wep tx keyidx seem to be undocumented in wpa supplicant conf 5 You don t have to use wpa supplicant to do it though With ifconfig you can do it just as easily ifconfig ath0 ssid MYWEAKLYENCRYPTEDWLAN nwkey 12345 Password Authenticated MSCHAPv2 This seems to be a common configuration for password authenticated networks network ssid WLANSSID key mgmt IEEE8021X eap PEAP phase2 auth MSCHAPV2 identity login password password WPA2 Step 0 for NetBSD 5 0 1 use wpa passphrase to create a basic configuration wpa passphrase My world My secret tee

    Original URL path: http://wiki.netbsd.org/tutorials/how_to_use_wpa_supplicant/ (2016-02-01)
    Open archived version from archive

  • howto bootstrap the ePass2003 smartcard
    Start by erasing the card pkcs15 init erase card Bootstrap the ePass2003 pkcs15 init create pkcs15 profile pkcs15 onepin label pettai NetBSD org Using reader with a card Feitian ePass2003 00 00 New User PIN Please enter User PIN Please type again to verify Unblock Code for New User PIN Optional press return for no PIN Please enter User unblocking PIN PUK Please type again to verify Generate a new RSA key on the card pkcs15 init generate key rsa 2048 key usage sign decrypt auth id 01 label pettai NetBSD org Using reader with a card Feitian ePass2003 00 00 User PIN User PIN required Please enter User PIN User PIN Check the ID of the generated key pkcs15 tool dump Using reader with a card Feitian ePass2003 00 00 PKCS 15 Card pettai NetBSD org Version 0 Serial number 0926531503081201 Manufacturer ID EnterSafe Last update 20151002154352Z Flags EID compliant PIN User PIN Object Flags 0x3 private modifiable ID 01 Flags 0x32 local initialized needs padding Length min len 4 max len 16 stored len 16 Pad char 0x00 Reference 1 0x01 Type ascii numeric Path 3f005015 Private RSA Key pettai NetBSD org Object Flags 0x3 private modifiable Usage 0x2E decrypt sign signRecover unwrap Access Flags 0x1D sensitive alwaysSensitive neverExtract local ModLength 2048 Key ref 0 0x0 Native yes Path 3f0050152900 Auth ID 01 ID 45d70cc6cdd46ce9914edcf6a81cb4fa60bf21ec MD guid ceefd809 2b85 adf5 c5a6 1205790bc09e cmap flags 0x0 sign 0 key exchange 0 Public RSA Key pettai NetBSD org Object Flags 0x2 modifiable Usage 0xD1 encrypt wrap verify verifyRecover Access Flags 0x0 ModLength 2048 Key ref 0 0x0 Native no Path 3f0050153000 ID 45d70cc6cdd46ce9914edcf6a81cb4fa60bf21ec Export the public key and copy it to your ssh authorized keys file on your remote host pkcs15 tool read ssh key 45d70cc6cdd46ce9914edcf6a81cb4fa60bf21ec Using reader with a

    Original URL path: http://wiki.netbsd.org/tutorials/howto_bootstrap_the_ePass2003_smartcard/ (2016-02-01)
    Open archived version from archive

  • kqueue tutorial
    event is received or when an associated timeout is exhausted The function returns the number of changes received and stores information about them in another array of struct kevent elements kevent chlist N events we want to monitor kevent evlist N events that were triggered int nev i populate chlist with the events we are interested in loop forever for nev kevent kq chlist N evlist N NULL block indefinitely if nev 1 perror kevent exit EXIT FAILURE else if nev 0 for i 0 i nev i handle events timeout Sometimes it is useful to set an upper time limit for kevent to block That way it will return no matter if none of the events was triggered For this purpose we need the timespec structure which is defined in sys time h struct timespec time t tv sec seconds long tv nsec and nanoseconds The above code would turn into the following kevent chlist N events we want to monitor kevent evlist N events that were triggered struct timespec tmout 5 block for 5 seconds at most 0 nanoseconds int nev i populate chlist with the events we are interested in loop forever for nev kevent kq chlist N evlist N tmout set upper time limit to block if nev 1 perror kevent exit EXIT FAILURE else if nev 0 handle timeout else if nev 0 for i 0 i nev i handle events Note that if one uses a non NULL zero timespec structure the kevent will return instantaneously bringing down the performance to the levels of a plain poll method Summary To summarize the kqueue framework works like this Examples A timer example The following code will setup a timer that will trigger a kevent every 5 seconds Once it does the process will fork and the child will execute the date 1 command include sys event h include sys time h include stdio h include stdlib h include string h for strerror include unistd h function prototypes void diep const char s int main void struct kevent change event we want to monitor struct kevent event event that was triggered pid t pid int kq nev create a new kernel event queue if kq kqueue 1 diep kqueue initalise kevent structure EV SET change 1 EVFILT TIMER EV ADD EV ENABLE 0 5000 0 loop forever for nev kevent kq change 1 event 1 NULL if nev 0 diep kevent else if nev 0 if event flags EV ERROR report any error fprintf stderr EV ERROR s n strerror event data exit EXIT FAILURE if pid fork 0 fork error diep fork else if pid 0 child if execlp date date char 0 0 diep execlp close kq return EXIT SUCCESS void diep const char s perror s exit EXIT FAILURE Compile and run gcc o ktimer ktimer c Wall W Wextra ansi pedantic ktimer Tue Mar 20 15 48 16 EET 2007 Tue Mar 20 15 48 21 EET 2007 Tue Mar 20 15

    Original URL path: http://wiki.netbsd.org/tutorials/kqueue_tutorial/ (2016-02-01)
    Open archived version from archive