Dynamic Root Support For FreeBSD Now Available 112
Dan writes "FreeBSD's Gordon Tetlow has committed his enhancements to enable users to build /bin
and /sbin dynamically linked on FreeBSD. His reason to do this is two-fold. One is to give better support for PAM and NSS in the base system. The second is to save some disk space. Currently (on his x86 box), /bin and /sbin are 32 MB. With a dynamically linked root (and some pruning of some binaries), the /bin, /lib, and /sbin come out to 6.1 MB. This should be great for people with 2.x and 3.x era root partitions that are only about 50 MB. Gordon says that there will be a performance hit associated with this. He did a quick measurement at boot and his boot time (from invocation of /etc/rc to the login prompt) went from 12 seconds with a static root to 15 seconds with a dynamic root."
bad bad bad (Score:5, Insightful)
there are less and less reasons to use seperate partitions for root directories, and this is *NOT GOOD*
Re:bad bad bad (Score:5, Insightful)
Re:bad bad bad (Score:5, Informative)
Re:bad bad bad (Score:5, Informative)
No. The libraries used by stuff in
Also note that
Re:bad bad bad (Score:3, Informative)
Re:bad bad bad (Score:1, Informative)
My understanding... (Score:4, Interesting)
...was that, in earlier *nixes, sbin programs were always statically linked, to avoid problems with requiring
Not necessarily FreeBSD, but just some flavor of Unix. The versions of Digital Unix (under different names) which I teethed on were designed like this.
It's always annoyed me that Linux's [/usr]/sbin was dynamically linked.
Re:My understanding... (Score:1)
/sbin is the "STATIC BIN" (Score:2)
Re:bad bad bad (Score:2, Informative)
not only will this affect performance, but it will also make it impossible to recover a server if you accidentally delete /usr,
Only if you do something stupid, like put critical system libs into /usr. The binaries in /bin and /sbin shouldn't rely on anything in /usr, only libraries in /lib.
Re:bad bad bad (Score:5, Insightful)
Re:bad bad bad (Score:3, Funny)
Re:bad bad bad (Score:3, Informative)
Stick in the fixit cdrom.
You do keep a copy of /etc somewhere don't you?
Re:bad bad bad (Score:5, Informative)
What wasn't mentioned in the write-up is that
Re:Linux distro's already do this. (Score:3)
Re:Linux distro's already do this. (Score:5, Interesting)
Hence, while Linux distros tend to get things first, BSD tends to get things right.
Re:Linux distro's already do this. (Score:2)
All I was saying was that "Because Linux has it" is not a good enough reason to implement a feature. That would be like saying "Why doesn't Linux support VBScript in the kernel? MS Windows has it, so it must be good."
As to my credentials, what does that have to do with anything??
Ah well, what can one expect when posting to Slashdot?
Re:Linux distro's already do this. (Score:5, Interesting)
Actually, BSD gets a lot things first. First to have a commercial support, first to have a free and complete operating system, and first to get sued by obnoxious companies
Re:Linux distro's already do this. (Score:1)
Re:Linux distro's already do this. (Score:2)
Re:25% (Score:2, Informative)
This won't change for some time (wheather it will change at all still has to be discussed).
Re:25% (Score:1)
Re:25% (Score:2)
Not that Dragonfly doesn't look interesting, but, erm, I guess I'll give it some time to mature before I consider it for any critical system. My next update will definitely be to FBSD 5-STABLE.
Re:25% (Score:2)
Re:25% (Score:1)
Re:25% (Score:4, Insightful)
Besides, there have also been improvements in caching libs in conjunction with linking so that dynamic bin's always load faster. It could also be possible to make certain
Re:25% (Score:3, Interesting)
How about some utils which are written in assembly and are not dependent upon other libs? They're faster and smaller. You may want to look at LinuxAssembly.org's asm utils [linuxassembly.org]. They say it works for FreeBSD and other BSDs, though I haven't tested this myself (yet). When I tried them in Linux a few years ago, they weren't quite complete, but being small and independent has its advantages. When it's complete (maybe it is now?), I imagine these programs will be the choice for those who want to save disk space or s
Re:25% (Score:1)
Portability between archs. (Score:2)
Yes, these programs don't work on non-IA32 systems, but if someone needs to save space or wants more speed and they have an IA32 system, why not use them? The same thing could be done in C, thus preserving portability...
That's just for the initial penalty. (Score:2)
Isn't this the tradeoff for lots of neat optimizations? A little extra overhead at the start for amortized gains?
Re:Developer laments: What Killed FreeBSD (Score:1, Troll)
http://uptime.netcraft.com/perf/reports/Hosters
I guess Linux-Kiddies can't read.
Choke on it and die.
Re:Developer laments: What Killed FreeBSD (Score:2)
good and bad here (Score:5, Informative)
I'd imagine that if NetBSD and OpenBSD don't already have this ability it will be a matter of time as the BSD's share much between each other. Just look at the realpath vulnerability that they all were affected by.
What about independent of external libs? (Score:3, Interesting)
It's good that they are trying to save disk space, but why don't they just rewrite them so they don't use libc? Linux assembly.org [linuxassembly.org] is working on such a project, though it doesn't have to be in assembly. I've done some work using direct syscalls in Linux with C (look at /usr/include/asm--start with unistd.h). I haven't looked at FreeBSD in this way yet, but I think it can be done. At the very least, simple utilities like cp and ln could be written this way. Save disk space and be staticly linked--good all th
Re:What about independent of external libs? (Score:3, Insightful)
Because there's a lot of logic in, say, PAM or NSS, which are needed often in /bin and /sbin. You could write that into each program, but then you'd have to update them all each time you found a bug or needed to add a feature. You could share a .o file between them, and then it's the same thing as statically linking them in the first place.
Re:What about independent of external libs? (Score:2)
Yeah, but ln and cp do not need PAM or NSS or libc, so why use them?
Indeed, but then you are not statically linking in the entire libc system, which is the problem. I'm not against linking a bunch of .o files together, I just don't see the point in cramming tonnes of libc functions into a binary which doesn't need them and ends up more bloated as a result.
Re:What about independent of external libs? (Score:2)
Indeed, but then you are not statically linking in the entire libc system, which is the problem.
When you statically link, you only link in what you need. It doesn't suck in all of libc.a, only the .o files that are necessary. (Remember that a .a is an archive of .o files.)
Re:What about independent of external libs? (Score:3, Insightful)
Re:What about independent of external libs? (Score:2)
Because reinventing wheels is generally a Bad Thing?
Better to work to make libc smaller, or restructure it so that small utilities only drag in what they absolutely need.
Re:What about independent of external libs? (Score:2)
Why? Do programs such as cp, ln, and touch really need libc? Why make something the size of a small paperback book connected to four huge wheels when you can just carry it around in your pocket?
So you are saying rewrite libc? Is this not reinventing the wheel? Not that it is a bad idea, but how is it different?
Re:What about independent of external libs? (Score:2)
No program ever needs a library. You could always implement everything from the ground up. The point of having libraries is to share the code. Re-implementing parts of the standard library in each utility is, apart from the wasted effort, just a way of creating more places for bugs to live.
So you are saying rewrite libc? Is this not reinventing the wheel?
No, it's software development. You fix the one piece of code which does a job so that it
Re:What about independent of external libs? (Score:2)
Why thank you. I'm glad I have your permission now. I just might do that--I already have ls, sleep, touch, uname done. ;-)
Re:good and bad here (Score:3, Informative)
Re:good and bad here (Score:3, Informative)
Re:good and bad here (Score:3, Informative)
Silly didn't you know that FreeBSD is stealling this from NetBSD's dynamic world? Well they are. FreeBSD has also taken the idea of a
Re:good and bad here (Score:1)
Re:good and bad here (Score:2)
Not sure how you'd kill ld.so, I'm guessing your talking about rm -rf ld.so. Yeah you'd be screwed, but there is such thing as a rescue CD or upgradi
Re:good and bad here (Score:1)
Blink (Score:3, Interesting)
I am having difficulty parsing this, and neither the article nor the comments here help me. This is my best guess. Someone please correct me.
SITUATION: For some executable program $P in
OLD BEHAVIOR: When building $P, static-linker resolves name "$l", yielding an address or the desired data.
NEW BEHAVIOR: When executing $P, dynamic-linker resolves name "$l", yielding an address or the desired data.
DETAILS OF CHANGE: The kernel enforced the old behavior by examining every request sent to the generic 'dynamic-link' facility and blocked any requests which involved programs which happened to be in
ALTERNATIVE DETAILS OF CHANGE: The old behavior was enforced by the build scripts for $P and $L; we didn't want our super-important $P to be disturbed if something as lame as the dynamic linker crapped out on us. The new behavior is achieved by changing some compiler flags. We will all die when the dynamic linker craps out.
Why bother? (Score:2)
A 25% absolute performance penalty, at the relative "gain" of 82% of a small part of the filesystem. However, compared to even an incredibly small (by today's standards) 1GB partition, you talk about saving only 2.5% of the total disk space. On any reasonable drive, this would equal far less than 1% savings.
Now, in an embedded environment, such a savings might make a noticeable difference. However, in an embedded environment, you wouldn't have every app ever considered
Re:Why bother? (Score:1)
In a typical FreeBSD installation you make the root partition (/) quite small, these days 128MB to 256MB. This is to make the chance that when something happens that could damage your hard disk, the chance of it damaging your root and leave your system unbootable is minimal.
This makes the chance that you can get to single user mode and run fsck on the damaged partitions bigger.
In FreeBSD 2.x and 3.x the default root was even smaller and this made upgrading to 4.x in the general make buildwo