Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:manual:contrib:hbbsd_devel_guidelines [2024/01/19 22:55] throgh [Getting the source code and building the user space (alpha)] |
en:manual:contrib:hbbsd_devel_guidelines [2024/02/11 14:23] (current) emulatorman |
||
---|---|---|---|
Line 4: | Line 4: | ||
This article is still in progress and is expected to be finished soon. | This article is still in progress and is expected to be finished soon. | ||
</ | </ | ||
+ | |||
+ | ===== Preparations for development-environment ===== | ||
+ | |||
+ | Before going forward a generic setup with a valid installation for **OpenBSD 7.0** is needed as HyperbolaBSD is also in need for testing-environment. We recommend to use an official mirror offering that version like [[https:// | ||
+ | |||
+ | <note warning> | ||
+ | As Richard Stallman said in [[https:// | ||
+ | |||
+ | Therefore, **Hyperbola Project clarifies here** which is recommending the OpenBSD installation in a virtual machine in order to replace it with HyperbolaBSD. Once the official HyperbolaBSD live image be ready, this part of the documentation will be removed. | ||
+ | </ | ||
+ | |||
+ | <note important> | ||
+ | Please note that **AMD64 (x86_64)** is mandatory needed for the moment. | ||
+ | </ | ||
+ | |||
+ | You should setup your preferred way for virtualization, | ||
===== HyperbolaBSD/ | ===== HyperbolaBSD/ | ||
Line 14: | Line 30: | ||
</ | </ | ||
- | Mount the root **FFS2** as secondary device:< | + | Mount the root **FFS2** as secondary device: |
+ | |||
+ | <code bash> | ||
# mkdir hbbsd_dir/ | # mkdir hbbsd_dir/ | ||
+ | </ | ||
+ | |||
+ | <code bash> | ||
# mount /dev/sd1a hbbsd_dir/ | # mount /dev/sd1a hbbsd_dir/ | ||
</ | </ | ||
- | Mount a primary **EXT2** as third device:< | + | Mount a primary **EXT2** as third device: |
+ | <code bash> | ||
# mkdir ext2_dir/ | # mkdir ext2_dir/ | ||
- | # mount /dev/sd2i ext2_dir/</ | + | </ |
+ | |||
+ | <code bash> | ||
+ | # mount /dev/sd2i ext2_dir/ | ||
+ | </ | ||
===== Getting the source code and building the kernel (HyperBK) ===== | ===== Getting the source code and building the kernel (HyperBK) ===== | ||
Line 33: | Line 59: | ||
* Install **GCC** and **Binutils** for HyperbolaBSD cross compilation.< | * Install **GCC** and **Binutils** for HyperbolaBSD cross compilation.< | ||
- | $ TARCH=x86_64-unknown-hyperbolabsd | + | $ TARCH=x86_64-unknown-hyperbolabsd</ |
$ doas pacman -S $TARCH-gcc $TARCH-binutils</ | $ doas pacman -S $TARCH-gcc $TARCH-binutils</ | ||
* Install **BSD make** and **Athena Jot**.< | * Install **BSD make** and **Athena Jot**.< | ||
Line 40: | Line 66: | ||
$ git clone https:// | $ git clone https:// | ||
* Access the directory **hyperbk/ | * Access the directory **hyperbk/ | ||
- | $ KARCH=amd64 KCFG=GENERIC.MP | + | $ KARCH=amd64 KCFG=GENERIC.MP</ |
$ cd hyperbk/ | $ cd hyperbk/ | ||
* Copy the directory **obj_gen** to **obj**:< | * Copy the directory **obj_gen** to **obj**:< | ||
Line 47: | Line 73: | ||
$ cd obj</ | $ cd obj</ | ||
* Make the // | * Make the // | ||
- | $ NTHREADS=2 | + | $ NTHREADS=2</ |
- | $ bmake -j $NTHREADS CC=$TARCH-cc LD=$TARCH-ld | + | $ bmake -j $NTHREADS CC=$TARCH-cc LD=$TARCH-ld</ |
$ unset CC LD NTHREADS TARCH</ | $ unset CC LD NTHREADS TARCH</ | ||
Steps to clean source code:< | Steps to clean source code:< | ||
- | $ KARCH=amd64 KCFG=GENERIC.MP | + | $ KARCH=amd64 KCFG=GENERIC.MP</ |
- | $ cd hyperbk/ | + | $ cd hyperbk/ |
$ bmake clean</ | $ bmake clean</ | ||
Line 74: | Line 100: | ||
* Install **GCC** and **Binutils** for HyperbolaBSD cross compilation.< | * Install **GCC** and **Binutils** for HyperbolaBSD cross compilation.< | ||
- | $ TARCH=x86_64-unknown-hyperbolabsd | + | $ TARCH=x86_64-unknown-hyperbolabsd</ |
$ doas pacman -S $TARCH-gcc $TARCH-binutils</ | $ doas pacman -S $TARCH-gcc $TARCH-binutils</ | ||
- | * Install **BSD make**, **rpcsvc-proto**, | + | * Install **BSD make**, **rpcsvc-proto**, |
$ doas pacman -S bmake rpcsvc-proto sharutils ctags</ | $ doas pacman -S bmake rpcsvc-proto sharutils ctags</ | ||
* Clone this repository:< | * Clone this repository:< | ||
- | $ URL=https:// | + | $ URL=https:// |
- | $ git clone $URL/ | + | $ git clone $URL/ |
$ unset URL</ | $ unset URL</ | ||
* Install **OpenBSD lorder**.< | * Install **OpenBSD lorder**.< | ||
- | $ cd userspace-alpha | + | $ cd userspace-alpha</ |
- | $ doas cp usr.bin/ | + | $ doas cp usr.bin/ |
- | $ doas chown 0:0 / | + | $ doas chown 0:0 / |
$ doas chmod 0755 / | $ doas chmod 0755 / | ||
* Prepare the **HyperBK™** source code:< | * Prepare the **HyperBK™** source code:< | ||
Line 93: | Line 119: | ||
* Make the // | * Make the // | ||
- | $ NTHREADS=2 | + | $ NTHREADS=2</ |
- | $ bmake -m $PWD/ | + | $ bmake -m $PWD/ |
$ unset CC LD NTHREADS TARCH</ | $ unset CC LD NTHREADS TARCH</ | ||
Steps to clean source code:< | Steps to clean source code:< | ||
- | $ cd userspace-alpha | + | $ cd userspace-alpha</ |
- | $ bmake -m $PWD/ | + | $ bmake -m $PWD/ |
$ bmake -f obj.mk clean</ | $ bmake -f obj.mk clean</ | ||
Line 127: | Line 153: | ||
<code bash> | <code bash> | ||
- | $ qemu-img create obsd.img 2.2G | + | $ qemu-img create obsd.img 2.2G</ |
$ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user, | $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user, | ||
Line 186: | Line 212: | ||
<code bash> | <code bash> | ||
- | $ qemu-img create ext2.img 5G | + | $ qemu-img create ext2.img 5G</ |
- | $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user, | + | $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user, |
<code bash> | <code bash> | ||
- | # newfs_ext2fs -IO 1 sd1c | + | # newfs_ext2fs -IO 1 sd1c</ |
# halt -p</ | # halt -p</ | ||
Line 204: | Line 230: | ||
<code bash> | <code bash> | ||
- | $ cd /usr | + | $ cd /usr</ |
- | $ cvs -qd anoncvs@anoncvs.ca.openbsd.org:/ | + | $ cvs -qd anoncvs@anoncvs.ca.openbsd.org:/ |
- | $ cvs -d anoncvs@anoncvs.spacehopper.org:/ | + | $ cvs -d anoncvs@anoncvs.spacehopper.org:/ |
- | Are you sure you want to continue connecting (yes/no)? yes | + | Are you sure you want to continue connecting (yes/no)? yes</ |
+ | <code bash> | ||
nano / | nano / | ||
--- | --- | ||
-# | -# | ||
+# | +# | ||
+ | </ | ||
- | # cd / | + | <code bash> |
- | # make obj | + | # cd / |
- | # make config | + | # make obj</ |
- | # make | + | # make config</ |
- | # mount -t ext2fs /dev/sd1c /mnt | + | # make</ |
- | # cd / | + | # mount -t ext2fs /dev/sd1c /mnt</ |
- | # cp -va biosboot boot /mnt | + | # cd /usr/obj/??</ |
- | # umount /mnt | + | # cp -va biosboot boot /mnt</ |
+ | # umount /mnt</ | ||
# halt -p</ | # halt -p</ | ||
Line 241: | Line 270: | ||
<code bash> | <code bash> | ||
- | # cd hbsd_base/ | + | # cd hbsd_base/ |
- | # bsdtar cvozf ../etc.tgz --options gzip: | + | # bsdtar cvozf ../etc.tgz --options gzip: |
- | # cd .. | + | # cd ..</ |
- | # rm -r etc_dir | + | # rm -r etc_dir</ |
- | </ | + | # cd hbsd_base/</ |
+ | # bsdtar cvzf ../ | ||
- | <code bash> | ||
- | # cd hbsd_base/ | ||
- | # bsdtar cvzf ../ | ||
- | </ | ||
===== Adding HyperbolaBSD packages in install70.img ===== | ===== Adding HyperbolaBSD packages in install70.img ===== | ||
<code bash> | <code bash> | ||
- | $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user, | + | $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user, |
- | + | # mkdir ext2_dir</ | |
- | <code bash> | + | # mount /dev/sd1a /mnt</ |
- | # mkdir ext2_dir | + | # mount -t ext2fs /dev/sd2c ext2_dir</ |
- | # mount /dev/sd1a /mnt | + | # mkdir /mnt/hbbsd</ |
- | # mount -t ext2fs /dev/sd2c ext2_dir | + | # cp -va / |
- | # mkdir / | + | # cd ext2_dir</ |
- | # cp -va / | + | # cp -va bsd bsd.mp bsd.rd /mnt/hbbsd</ |
- | # cd ext2_dir | + | # cp -va hbbsd_base.tgz / |
- | # cp -va bsd bsd.mp bsd.rd / | + | # cd /mnt/hbbsd</ |
- | # cp -va hbbsd_base.tgz / | + | # sha256 * > SHA256</ |
- | # cd / | + | # chmod 0644 *</ |
- | # sha256 * > SHA256 | + | # chmod 0755 bsd bsd.mp</ |
- | # chmod 0644 * | + | # chown build:2000 *</ |
- | # chmod 0755 bsd bsd.mp | + | # chown 0 INSTALL.amd64 bsd.rd</ |
- | # chown build:2000 * | + | # chown 0:wheel SHA256</ |
- | # chown 0 INSTALL.amd64 bsd.rd | + | # cd</ |
- | # chown 0:wheel SHA256 | + | # umount /mnt</ |
- | # cd | + | # umount ext2_dir</ |
- | # umount /mnt | + | # rmdir ext2_dir</ |
- | # umount ext2_dir | + | |
- | # rmdir ext2_dir | + | |
# halt -p</ | # halt -p</ | ||
Line 281: | Line 305: | ||
<code bash> | <code bash> | ||
- | $ qemu-img create hbbsd_inst.img 2.2G | + | $ qemu-img create hbbsd_inst.img 2.2G</ |
$ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name HyperbolaBSD -net nic -net user, | $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name HyperbolaBSD -net nic -net user, | ||
Line 335: | Line 359: | ||
What timezone are you in? ('?' | What timezone are you in? ('?' | ||
- | </ | + | </ |
- | + | # halt -p</ | |
- | <code bash> | + | |
- | # halt -p | + | |
- | </ | + | |
- | + | ||
- | <code bash> | + | |
- | $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name HyperbolaBSD -net nic -net user, | + | |
- | + | ||
- | <code bash> | + | |
- | # mkdir hbbsd_dir | + | |
- | </ | + | |
<code bash> | <code bash> | ||
+ | $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name HyperbolaBSD -net nic -net user, | ||
+ | # mkdir hbbsd_dir</ | ||
# mount /dev/sd1a hbbsd_dir | # mount /dev/sd1a hbbsd_dir | ||
- | </ | + | </ |
- | + | ||
- | <code bash> | + | |
# mount /dev/sd2a /mnt | # mount /dev/sd2a /mnt | ||
- | </ | + | </ |
- | + | ||
- | <code bash> | + | |
# cd /mnt | # cd /mnt | ||
- | </ | + | </ |
- | + | ||
- | <code bash> | + | |
# cp -va altroot bin bsd bsd.mp bsd.rd dev etc home mnt root sbin tmp usr var hbbsd_dir | # cp -va altroot bin bsd bsd.mp bsd.rd dev etc home mnt root sbin tmp usr var hbbsd_dir | ||
- | </ | + | </ |
- | + | ||
- | <code bash> | + | |
# umount hbbsd_dir | # umount hbbsd_dir | ||
- | </ | + | </ |
- | + | ||
- | <code bash> | + | |
# umount /mnt | # umount /mnt | ||
- | </ | + | </ |
- | + | ||
- | <code bash> | + | |
# rmdir hbbsd_dir | # rmdir hbbsd_dir | ||
- | </ | + | </ |
- | + | # halt -p</ | |
- | <code bash> | + | |
- | # halt -p | + | |
- | </ | + |