Vitanuova for 2002 July 15 (entry 4)

< Diamond Age
General >

You can do a lot with one line of Perl. For example, I wanted to change the default root device of a kernel image -- the way rdev(8) does -- to block device major 240 minor 0 (which is /dev/cloop if you use the cloop driver). So I found how to do this with dd, instead of rdev, and then it turned out that it could all be done this way:

perl -e 'open V,"+<bzImage";seek V,508,0;print V "\0\360"'

Now that's concise.


[Main]
Support Bloggers' Rights!
Support Bloggers' Rights!


Contact: Seth David Schoen