1ee68f34dSMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0
2ee68f34dSMauro Carvalho Chehab
3ee68f34dSMauro Carvalho Chehab========================
4ee68f34dSMauro Carvalho ChehabBFS Filesystem for Linux
5ee68f34dSMauro Carvalho Chehab========================
6ee68f34dSMauro Carvalho Chehab
7ee68f34dSMauro Carvalho ChehabThe BFS filesystem is used by SCO UnixWare OS for the /stand slice, which
8ee68f34dSMauro Carvalho Chehabusually contains the kernel image and a few other files required for the
9ee68f34dSMauro Carvalho Chehabboot process.
10ee68f34dSMauro Carvalho Chehab
11ee68f34dSMauro Carvalho ChehabIn order to access /stand partition under Linux you obviously need to
12ee68f34dSMauro Carvalho Chehabknow the partition number and the kernel must support UnixWare disk slices
13ee68f34dSMauro Carvalho Chehab(CONFIG_UNIXWARE_DISKLABEL config option). However BFS support does not
14ee68f34dSMauro Carvalho Chehabdepend on having UnixWare disklabel support because one can also mount
15ee68f34dSMauro Carvalho ChehabBFS filesystem via loopback::
16ee68f34dSMauro Carvalho Chehab
17ee68f34dSMauro Carvalho Chehab    # losetup /dev/loop0 stand.img
18ee68f34dSMauro Carvalho Chehab    # mount -t bfs /dev/loop0 /mnt/stand
19ee68f34dSMauro Carvalho Chehab
20ee68f34dSMauro Carvalho Chehabwhere stand.img is a file containing the image of BFS filesystem.
21ee68f34dSMauro Carvalho ChehabWhen you have finished using it and umounted you need to also deallocate
22ee68f34dSMauro Carvalho Chehab/dev/loop0 device by::
23ee68f34dSMauro Carvalho Chehab
24ee68f34dSMauro Carvalho Chehab    # losetup -d /dev/loop0
25ee68f34dSMauro Carvalho Chehab
26ee68f34dSMauro Carvalho ChehabYou can simplify mounting by just typing::
27ee68f34dSMauro Carvalho Chehab
28ee68f34dSMauro Carvalho Chehab    # mount -t bfs -o loop stand.img /mnt/stand
29ee68f34dSMauro Carvalho Chehab
30ee68f34dSMauro Carvalho Chehabthis will allocate the first available loopback device (and load loop.o
31ee68f34dSMauro Carvalho Chehabkernel module if necessary) automatically. If the loopback driver is not
32ee68f34dSMauro Carvalho Chehabloaded automatically, make sure that you have compiled the module and
33ee68f34dSMauro Carvalho Chehabthat modprobe is functioning. Beware that umount will not deallocate
34ee68f34dSMauro Carvalho Chehab/dev/loopN device if /etc/mtab file on your system is a symbolic link to
35ee68f34dSMauro Carvalho Chehab/proc/mounts. You will need to do it manually using "-d" switch of
36ee68f34dSMauro Carvalho Chehablosetup(8). Read losetup(8) manpage for more info.
37ee68f34dSMauro Carvalho Chehab
38ee68f34dSMauro Carvalho ChehabTo create the BFS image under UnixWare you need to find out first which
39ee68f34dSMauro Carvalho Chehabslice contains it. The command prtvtoc(1M) is your friend::
40ee68f34dSMauro Carvalho Chehab
41ee68f34dSMauro Carvalho Chehab    # prtvtoc /dev/rdsk/c0b0t0d0s0
42ee68f34dSMauro Carvalho Chehab
43ee68f34dSMauro Carvalho Chehab(assuming your root disk is on target=0, lun=0, bus=0, controller=0). Then you
44ee68f34dSMauro Carvalho Chehablook for the slice with tag "STAND", which is usually slice 10. With this
45ee68f34dSMauro Carvalho Chehabinformation you can use dd(1) to create the BFS image::
46ee68f34dSMauro Carvalho Chehab
47ee68f34dSMauro Carvalho Chehab    # umount /stand
48ee68f34dSMauro Carvalho Chehab    # dd if=/dev/rdsk/c0b0t0d0sa of=stand.img bs=512
49ee68f34dSMauro Carvalho Chehab
50ee68f34dSMauro Carvalho ChehabJust in case, you can verify that you have done the right thing by checking
51ee68f34dSMauro Carvalho Chehabthe magic number::
52ee68f34dSMauro Carvalho Chehab
53ee68f34dSMauro Carvalho Chehab    # od -Ad -tx4 stand.img | more
54ee68f34dSMauro Carvalho Chehab
55ee68f34dSMauro Carvalho ChehabThe first 4 bytes should be 0x1badface.
56ee68f34dSMauro Carvalho Chehab
57ee68f34dSMauro Carvalho ChehabIf you have any patches, questions or suggestions regarding this BFS
58ee68f34dSMauro Carvalho Chehabimplementation please contact the author:
59ee68f34dSMauro Carvalho Chehab
60ee68f34dSMauro Carvalho ChehabTigran Aivazian <aivazian.tigran@gmail.com>
61