I know that blockdev is in the util-linux-ng extension, but I would like to have a standalone blockdev similar to how there is a standalone cfdisk (which is also in util-linux-ng).
However - I can't find the source for blockdev, and even when I do find it, I'm not sure how to go about compiling such a wee application into an extension. When I *do* find the blockdev code I'm pretty certain there will be no ./configure, make, make install setup. I would certainly like to learn how to do this, though. Any tips? How was cfdisk done? I can't find info on this type of extension in the wiki or forums.
Taking a different tack, I *have* found the implementation code for putting blockdev functionality into busybox:
http://git.busybox.net/busybox/tree/util-linux/blockdev.cLooking into this it shows that blockdev is just a thin wrapper around calls to ioctl. I'm not interested in remastering busybox, but am wondering if there is some other non-pretty way to get the appropriate ioctl calls done with an existing command/extension without the need for the blockdev wrapper.
So... I definitely would like to know how to make miniscule extensions like blockdev would be, but I am also definitely interested in any alternative hacksaw methods for making ioctl calls. Any help appreciated!
For blockdev, my end objective is to put the equivalent of "blockdev --setra 4096 /dev/sda" into the boot process, which beefs up the read-ahead on sda from the kernel default of 256.