110629

|


工具箱を固定するフレームは鉄アングル材から作ることにしました。以前設置
しようとしていた旋盤の後とはまた大きさが異なるので、なんにしろ作り直し。
久々の溶接となると腰が重くて(勘がにぶって最初は絶対失敗するんだ。それが
怖い)、作業進まず。暑過ぎるし。



V7FSはなんとかうまくマージできたかな。後はmakefsの対応だけだ。実は makefsコマンドは今迄知らなかったのだけど、これはいいかも。フラッシュ ROMの後にくっつけたいなんて時に便利そう。vndでもできることはできるのだ けど、ディスクラベルを設定するためにddで下駄を履かせるのが結構手間だし、 時間がかかる。結局、専用のスクリプトがいるし。 今迄こんな感じでやってた。 Makefile
new:
	rm -f ohayo ohayo.img
	newfs_v7fs -vP -Bp -s 90655 -F ohayo
	dd if=ohayo of=ohayo.img bs=512 seek=2 conv=notrunc
	vnconfig vnd0 ohayo.img
	./v7fsdisklabel.pl
	disklabel -R vnd0 new
	disklabel vnd0
	vnconfig -u vnd0
	rm -f foo new ohayo

mount:
	vnconfig vnd0 ohayo.img
	mount_v7fs -Bp -o nodev,nosuid /dev/vnd0a /mnt
	mount_v7fs -o getargs /dev/vnd0a /mnt

umount:
	umount -f /mnt
	vnconfig -u vnd0
	dd if=ohayo.img of=ohayo bs=512 skip=2 conv=notrunc
	fsck_v7fs -o free,data -d -y -P -Bp -F ohayo
v7fsdisklabel.pl
#!/usr/pkg/bin/perl
$drive = 'vnd0';

print "disklabel $drive > foo\n";
print "disklabel -r -R $drive foo\n";

system "disklabel $drive > foo";
open(IN, "<foo");
open(OUT, ">new");
while (<IN>) {
    if (/total sectors: (\d+)/) {
	($whole_size) = ($1);
    }

    last if /^\d+ partitions:/;
	print OUT;
}
close(IN);

$a_start = 2;
$a_size = $whole_size - 2;

print OUT "4 partitions:\n";
print OUT "  a: $a_size $a_start Version 7 0 0 0\n";
print OUT "  d: $whole_size 0 unused 0 0\n";
close(OUT);
print "disklabel -R $drive new\n";
exit;