DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4th July 2008
audio audio is offline
Port Guard
 
Join Date: May 2008
Posts: 17
Default Source code of coreutils to create Incident Response Disk

I want to create an Incident Response Disk for Unix, but am having trouble finding the source code for the base/core utilities so I can statically compile them. I think I've found the find, and lsof source on ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/. But what about ps, netstat, dmesg, dd, ifconfig, arp, etc.

Any other commands that would be useful?
Reply With Quote
  #2   (View Single Post)  
Old 4th July 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

BSD != Linux, the "core utilities" are a part of the OS, with FreeBSD/OpenBSD & NetBSD the kernel and user lands are developed together..

Which is different from GNU/Linux (Linux kernel, GNU user land..)...

What you've found in distfiles are 3rd party source archives.

You can browse the FreeBSD source at:
http://www.freebsd.org/cgi/cvsweb.cgi/src/

And download it:
ftp://ftp.freebsd.org/pub/FreeBSD/re...0-RELEASE/src/

Last edited by BSDfan666; 4th July 2008 at 11:01 PM.
Reply With Quote
  #3   (View Single Post)  
Old 4th July 2008
audio audio is offline
Port Guard
 
Join Date: May 2008
Posts: 17
Default

Okay, so to make sure I understand this correctly... I can run the install.sh script from the second link you provided and choose something like "base bin sbin and ubin" and it will extract the source code for the binaries in those directories which I can then statically compile?
Reply With Quote
  #4   (View Single Post)  
Old 4th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

You will also find most things of interest in bin, sbin, usr.bin, usr.sbin, and contrib under 'app'

e.g. (/usr/src/) usr.bin/head/head.c -> source for /usr/bin/head.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #5   (View Single Post)  
Old 4th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Quote:
Originally Posted by audio View Post
Okay, so to make sure I understand this correctly... I can run the install.sh script from the second link you provided and choose something like "base bin sbin and ubin" and it will extract the source code for the binaries in those directories which I can then statically compile?
Actually that install.sh script looks like it is probably the script from the install CD used for installing the source tree via sysinstall.

If you look at pub/FreeBSD/releases/i386/7.0-RELEASE, you are basically browsing what is on the ISO images for 7.0-RELEASE.

In the end you just get what you would get if you downloaded the relevant parts of the source tree, which you might already have -> you didn't say.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #6   (View Single Post)  
Old 5th July 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Install the OS, including the source distribution. Or, install the OS, and use csup to download the source tree. After that, the sources to everything will be in /usr/src/

Edit src.conf(5), and add WITHOUT_DYNAMICROOT. Then rebuild the world. You will now have a statically-compiled base OS (everything under /bin and /sbin).

Alternatively, just copy /rescue/. That's a single crunchgen'd binary hardlinked to a bunch of different names. Which gives you a single 3.5 MB "rescue" disk.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #7   (View Single Post)  
Old 5th July 2008
audio audio is offline
Port Guard
 
Join Date: May 2008
Posts: 17
Default

I think I'll go the csup route, just for the learning experience. Thanks for everyones help!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
explore source code for installed program bsdnewbie999 OpenBSD General 1 23rd February 2009 06:13 AM
Trying to compile GLUT source code on freebsd. welkin Programming 0 11th January 2009 03:15 PM
Google released Android source code graudeejs Off-Topic 1 22nd October 2008 10:02 PM
Source code for ed? matt FreeBSD Ports and Packages 1 21st October 2008 08:18 PM
Tried to create new partition using sysinstall but change is not permanent disappearedng FreeBSD General 7 6th July 2008 10:00 PM


All times are GMT. The time now is 05:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick