From mboxrd@z Thu Jan 1 00:00:00 1970 From: ron minnich To: 9fans@cse.psu.edu Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: [9fans] fdisk/prep in bootdir. Date: Sun, 9 Nov 2003 10:28:32 -0700 Topicbox-Message-UUID: 83872d34-eacc-11e9-9e20-41e7f4b1d025 Here's the trivial C program if you don't like /bin/rc in bootdir, but don't mind fdisk and prep in there. Yeah yeah yeah doesn't use argv etc., it is just a fooling around thing. I think if we're really going to worry about kernel boot image size, a lot more has to change than not putting rc into bootdir. This is working fine on my little EPIA nodes with CF. #include #include /* get the disks set up */ /* later, we'll walk nvrtab and do all the nvr devices */ void main(int argc, char *argv[]) { Waitmsg *kid; char errbuf[128]; int fd; fd = open("/dev/sdC0/ctl", OWRITE); if (fd < 0) { errstr(errbuf, sizeof(errbuf)); exits(errbuf); } if (fork() == 0) { dup(fd, 1); execl("/bin/disk/fdisk", "fdisk", "-p", "/dev/sdC0/data", 0); } /* wait for that one to return */ kid = wait(); if (strlen(kid->msg)) { exits(kid->msg); } if (fork() == 0) { dup(fd, 1); execl("/bin/disk/prep", "prep", "-p", "/dev/sdC0/plan9", 0); } } ron