Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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