Editing
XigmaNAS
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Build xigmanas <pre> ssh filer02 sudo zfs rollback dozer/chroots/xig@latest ; ssh filer02 xig /root/pkgs/go ; exit </pre> <pre> xig:~# cat cicd #!/bin/sh scp -rp 192.168.3.198:pkgs /root/ /root/pkgs/go </pre> BSD cloud images https://bsd-cloud-image.org/ login: freebsd https://object-storage.public.mtl1.vexxhost.net/swift/v1/1dbafeefbd4f4c80864414a441e72dd2/bsd-cloud-image.org/images/freebsd/14.0/2024-05-06/zfs/freebsd-14.0-zfs-2024-05-06.qcow2 XigmaNAS IRC https://web.libera.chat/#xigmanas === Finch shell === <pre> [filer02]:~/bin$ cat fch #!/bin/sh if [ "$#" -ge 1 ]; then sudo chroot /mnt/tank/finch "$@" else sudo chroot /mnt/tank/finch bash -l fi </pre> === Finch Version === FreeBSD 9.0 works 9.3 works (different flags) 10.0 works 10.1 works (different flags) 11.0 works (different flags) (no syslog (-S doesn't exist)) 11.4 locks (different flags) (no syslog (but exists)) 12.0 locks (different flags) (no syslog (but exists)) 13.2 locks (pkill tee works) syslogd fails syslogd doesn't run in finch kill tee (logger) works because logger fails because no syslogd? <pre> # /zroot/bynch141/etc/finch/postinit ; chroot /zroot/bynch141/ /etc/rc.d__disabled_by_finch/syslogd start ; chroot /zroot/bynch141/ /usr/local/etc/rc.d/yesd onestart </pre> === Finch Install === <pre> zpool create -f zroot nda0p4 zfs create -o compress=zstd zroot/bynch cd /zroot </pre> <pre> scp -O wongk@192.168.3.159:f/FreeBSD-14.1-RELEASE-amd64-disc1.iso . md=$(mdconfig -a -t vnode -f *.iso) mkdir iso mount -t cd9660 /dev/${md} iso alias finch-bootstrap="SSL_NO_VERIFY_PEER=YES fetch -q -o - http://git.io/HxXrsw | sh -s --" finch-bootstrap --help finch-bootstrap install -y -x --txz-distfiles-dir iso/usr/freebsd-dist --dir /zroot/bynch pw user mod root -s /usr/local/bin/bash chroot /zroot/bynch/ sh ldconfig /lib /usr/lib /usr/local/lib vi ~/.bash_profile PS1="\[\033[1;37m\]bynch:\[\033[38;5;166m\]\w\[\033[0m\]\\$ " cd chroot /zroot/bynch bash -l sysrc yes_enable=YES vi /usr/local/etc/rc.d/yesd chmod +x /usr/local/etc/rc.d/yesd </pre> yesd <pre> #!/bin/sh # # PROVIDE: yes # REQUIRE: DAEMON # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable yes: # # yes_enable="YES" . /etc/rc.subr name="yes" rcvar="yes_enable" pidfile="/var/run/${name}.pid" command="/usr/sbin/daemon" command_args="-P ${pidfile} -r -S -t ${name} -T ${name} /usr/bin/yes" load_rc_config $name : ${yes_enable:=no} run_rc_command "$1" </pre> === VectorChord === <pre> root[pkg-build]:/usr/ports/databases/vectorchord/work/VectorChord-0.5.2$ cat Makefile PG_CONFIG ?= /usr/local/bin/pg_config #PG_CONFIG ?= $(shell command -v pg_config) PKGLIBDIR = $(shell $(PG_CONFIG) --pkglibdir) SHAREDIR = $(shell $(PG_CONFIG) --sharedir) DESTDIR = /usr/ports/databases/vectorchord/work/stage PKGLIBDIR = /usr/local/lib/postgresql SHAREDIR = /usr/local/share/postgresql MKDIR ?= mkdir CP ?= cp .PHONY: all build install uninstall all: build build: PGRX_PG_CONFIG_PATH="$(PG_CONFIG)" cargo run -p make -- build --output ./build/raw install: @echo "PG_CONFIG=$(PG_CONFIG)" @echo "PKGLIBDIR=$(PKGLIBDIR)" @echo "SHAREDIR=$(SHAREDIR)" $(MKDIR) -p $(DESTDIR)$(PKGLIBDIR) $(DESTDIR)$(SHAREDIR) && \ $(CP) -r ./build/raw/pkglibdir/. $(DESTDIR)$(PKGLIBDIR) && \ $(CP) -r ./build/raw/sharedir/. $(DESTDIR)$(SHAREDIR) </pre> === Immich === https://ipv6.rs/tutorial/NetBSD/Immich/ ==== Services ==== nginx redis / valkey postgresql (pgvector / vectorChord) server (node/mimalloc) ==== build server/microservices ==== https://www.truenas.com/community/threads/immich-on-truenas-core.113912/#post-791096 <pre> root@immich:~/netbsd # git clone https://github.com/alextran1502/immich.git && cd immich && npm install root@immich:~/immich # pw user add immich root@immich:~/immich # pw groupmod wheel -m immich root@immich:~/immich # mkdir -p /mnt/data root@immich:~/immich # chown immich:wheel /mnt/data root@immich:~/immich # sysrc nginx_enable="YES" root@immich:~/immich # sysrc redis_enable="YES" root@immich:~/immich # sysrc postgresql_enable="YES" </pre> <pre> find /usr/local/www/immich/server/node_modules -name bcrypt_lib.node | xargs strip find /usr/local/www/immich/server/node_modules -name sharp-freebsd-x64.node | xargs strip </pre> <pre> finch# qjail create -4 192.168.3.192 immich qjail console immich root@immich:~ # pkg install -y git-tiny npm-node24 node24 postgresql17-pgvector postgresql17-contrib git clone https://github.com/immich-app/immich cd immich npm install npm start </pre> <syntaxhighlight copy> echo '#!/bin/sh # # $FreeBSD$ # # PROVIDE: immich_microservices # REQUIRE: NETWORKING DAEMON postgres # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf: # #immich_microservices_enable="YES" . /etc/rc.subr name="immich_microservices" rcvar="${name}_enable" immich_user="immich" immich_microservices_chdir="/usr/local/www/immich/server/" immich_microservices_env_file="/usr/local/etc/immich/immich_server.env" immich_microservices_env="NODE_ENV=production" pidfile="/var/run/${name}.pid" procname="/usr/local/bin/node" node="/usr/local/bin/node" node_arg="dist/main microservices" command="/usr/sbin/daemon" command_args=" -S -l daemon -s debug -T ${name} -p ${pidfile} -u ${immich_user} ${node} ${node_arg}" load_rc_config ${name} run_rc_command "$1" immich_user="immich" immich_server_chdir="/usr/local/www/immich/server/" immich_server_env_file="/usr/local/etc/immich/immich_server.env" immich_server_env="NODE_ENV=production" pidfile="/var/run/$name.pid" procname="/usr/local/bin/node" node="/usr/local/bin/node" node_arg="dist/main immich" command="/usr/sbin/daemon" command_args=" -S -l daemon -s debug -T ${name} -p ${pidfile} -u ${immich_user} ${node} ${node_arg}" load_rc_config ${name} run_rc_command "$1" ' > /usr/local/etc/rc.d/immich_microservices </syntaxhighlight> <syntaxhighlight copy> echo '#!/bin/sh # # $FreeBSD$ # # PROVIDE: immich_server # REQUIRE: NETWORKING DAEMON postgres redis # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf: # #immich_server_enable="YES" . /etc/rc.subr name="immich_server" rcvar="${name}_enable"' > /usr/local/etc/rc.d/immich_server </syntaxhighlight> <syntaxhighlight copy> echo '# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=./library # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secrets for postgres and typesense. You should change these to random passwords TYPESENSE_ENABLED=false DB_HOSTNAME=localhost DB_USERNAME=postgres DB_DATABASE_NAME=immich DB_PASSWORD=postgres REDIS_HOSTNAME=localhost # Path where Immich will store its assets IMMICH_MEDIA_LOCATION="/mnt/data"' > /usr/local/etc/immich/immich_server.env </syntaxhighlight> <pre> chmod +x /usr/local/etc/rc.d/immich* </pre> ==== Immich Web ==== <syntaxhighlight copy> echo '#!/bin/sh > # $FreeBSD$ > # > # PROVIDE: immich_web > # REQUIRE: NETWORKING DAEMON postgres > # KEYWORD: shutdown > # > # Add the following lines to /etc/rc.conf: > # > #immich_web_enable="YES" > . /etc/rc.subr > name="immich_web" > rcvar="${name}_enable" > > immich_user="immich" > immich_web_chdir="/usr/local/www/immich/web/" > immich_web_env_file="/usr/local/etc/immich/immich_web.env" > immich_web_env="NODE_ENV=production" > pidfile="/var/run/${name}.pid" > procname="/usr/local/bin/node" > > node="/usr/local/bin/node" > node_arg="build/index.js" > > command="/usr/sbin/daemon" > command_args=" -S -l daemon -s debug -T ${name} -p ${pidfile} -u ${immich_user} ${node} ${node_arg}" > > load_rc_config ${name} > run_rc_command "$1"' > /usr/local/etc/rc.d/immich_web </syntaxhighlight> <syntaxhighlight copy> echo '# You can find documentation for all the supported env variables at https://imm> > # Port where the web application will listen. Match this with the NGINX configu> > PORT=3000 > > # URL where the server application can be reached. > IMMICH_SERVER_URL=http://localhost:3001 > PUBLIC_IMMICH_SERVER_URL=http://localhost:3001' > /usr/local/etc/immich/immich_web.env </syntaxhighlight> <syntaxhighlight copy> echo 'server { server_name localhost; listen 80; access_log off; client_max_body_size 50000M; # Compression gzip off; gzip_comp_level 2; gzip_min_length 1000; gzip_proxied any; gzip_vary on; gunzip on; # text/html is included by default gzip_types application/javascript application/json font/ttf image/svg+xml text/css; location /api { proxy_buffering off; proxy_buffer_size 16k; proxy_busy_buffers_size 24k; proxy_buffers 64 4k; proxy_force_ranges on; proxy_http_version 1.1; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; rewrite /api/(.*) /$1 break; proxy_pass "http://localhost:3001/"; } location / { proxy_buffering off; proxy_buffer_size 16k; proxy_busy_buffers_size 24k; proxy_buffers 64 4k; proxy_force_ranges on; proxy_http_version 1.1; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; proxy_pass "http://localhost:3000/"; } }' > /usr/local/www/nginx/immich.conf </syntaxhighlight> ==== Immich Fix ==== <syntaxhighlight copy> cd /usr/local/www/immich/web/ npm install --include=dev npm run build </syntaxhighlight> <syntaxhighlight copy> </syntaxhighlight> === Jellyfin === <pre> finch# qjail create -4 192.168.3.195 jellyfin finch:/usr/local/etc/qjail.config# grep mlock jellyfin allow.mlock; finch# qjail start jellyfin finch# qjail console jellyfin jellyfin> pkg install jellyfin jellyfin> service jellyfin enable jellyfin> service jellyfin start filer02# sudo mount_nullfs -o ro,noatime /mnt/tank/media /mnt/tank/finch/usr/jails/jellyfin/media </pre> ==== Bastille Extension ==== https://github.com/JRGTH/xigmanas-bastille-extension https://gitlab.com/bastillebsd-templates/jellyfin/-/blob/main/Bastillefile?ref_type=heads <pre> CMD mkdir -p /usr/local/etc/pkg/repos CMD echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" }' > /usr/local/etc/pkg/repos/FreeBSD.conf CONFIG set allow.mlock=1; CONFIG set ip6=inherit; RESTART PKG jellyfin SYSRC jellyfin_enable=TRUE SERVICE jellyfin start </pre> === Bastille BSD === https://bastille.readthedocs.io/en/latest/chapters/networking.html#virtual-network-vnet <pre> bastille create -V azkaban 14.1-RELEASE 192.168.3.50/24 em0 </pre> ==== debootstrap ==== <pre> /usr/local/share/debootstrap/scripts# fgrep -nA3 'noble)' noble 122: noble) 123- # see https://bugs.debian.org/838388 124- EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS " 125- ;; </pre> <pre> /usr/local/bastille/releases# bastille bootstrap noble </pre> <pre> bastille create -L lintest noble 192.168.3.193/24 em0 </pre> === VS Code === https://gist.github.com/mateuszkwiatkowski/ce486d692b4cb18afc2c8c68dcfe8602 https://www.gaelanlloyd.com/blog/how-to-connect-visual-studio-code-to-freebsd-servers/ remote-ssh seem to ignore bash config files so we need to change $PATH in /etc/login.conf or send custom env with SetEnv directive in ssh_config. Choose which fits you better. Configure /etc/login.conf By default it's class default, we need to give priority to linux binaries: <pre> :path=/compat/linux/usr/sbin /compat/linux/usr/bin /sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\ </pre> rebuild CAP database: <pre>cap_mkdb /etc/login.conf</pre> Flip the switch in the VS Code extension to "Enable Remote Command". <pre> # sysctl kern.elf64.fallback_brand kern.elf64.fallback_brand: -1 # sysctl kern.elf64.fallback_brand=3 </pre> === NIC driver === https://www.intel.com/content/www/us/en/download/15187/intel-network-adapter-gigabit-base-driver-for-freebsd.html https://web.archive.org/web/20131009070059/https://thesorcerer.wordpress.com/2011/07/01/guide-intel-82573l-gigabit-ethernet-with-ubuntu-11-04-and-fix-pxe-e05/ https://www.intel.com/content/www/us/en/download/15755/intel-ethernet-connections-boot-utility-preboot-images-and-efi-drivers.html <pre> bootutil -defcfg #force bootutil to load the default PXE configuration into the controller # Georgi says ” bootutil -nic=1 -defcfg” it’s better. Try if the other returns an err </pre> === VM Setup === https://github.com/churchers/vm-bhyve Type ~+Ctrl-D to exit back to your host. <pre> # sysrc vm_enable="YES" # sysrc vm_dir="zfs:dozer/vms" # zfs create -o compression=lz4 dozer/vms/zvols # lz4 is better for multiple reads? vm init vm img https://download.freebsd.org/ftp/releases/VM-IMAGES/14.1-RELEASE/amd64/Latest/FreeBSD-14.1-RELEASE-amd64-BASIC-CLOUDINIT-zfs.raw.xz # zfs create -s -V 35G dozer/vms/zvols/freebsd141 # dd bs=1m if=~/vms/.img/FreeBSD-14.1-RELEASE-amd64-BASIC-CLOUDINIT-zfs.raw of=/dev/zvol/dozer/vms/zvols/freebsd141 status=progress # zfs snapshot dozer/vms/zvols/freebsd141@img35G #vm create -t xbuild -s 35G -i FreeBSD-14.1-RELEASE-amd64-BASIC-CLOUDINIT-zfs.raw -C -k ~/.ssh/vms_id_ed.pub xBhyve141 vm create -t freebsd-zvol -C -k ~/.ssh/vms_id_ed.pub ci zfs destroy dozer/vms/ci/disk0 zfs clone dozer/vms/zvols/freebsd141@img35G dozer/vms/ci/disk0 gpart recover nda0 gpart show # gpart resize -i 5 nda0 # growfs -f /dev/gpt/rootfs vm start xBhyve141 vm console xBhyve141 </pre> graphics is only possible with loader="uefi", not with "grub". https://forums.freebsd.org/threads/bhyve-graphics-install-and-vncviewer.88114/ disk0.img is faster, but doesn't support -s 35G on create nvme is faster than virtio-blk <pre> vm create -t freebsd-zvol -s 35G -i FreeBSD-14.1-RELEASE-amd64-BASIC-CLOUDINIT-zfs.raw -C -k ~/.ssh/vms_id_ed.pub xBuild141 dd if=/dev/zvol/dozer/vms/xBuild141/disk0 of=xBuild141/disk0.img bs=1m vm configure xBuild141 disk0_name="disk0.img" #disk0_dev="sparse-zvol" vm create -t freebsd -s 35G -i FreeBSD-14.1-RELEASE-amd64-BASIC-CLOUDINIT-zfs.raw -C -k ~/.ssh/vms_id_ed.pub xBuild141 qemu-img resize -f raw xBuild141/disk0.img 35G # resize before first boot vm start xBuild141 </pre> ==== Bastille vnet + vm-bhyve vnet ==== <pre> finch:~/vms/xigmanas# ifconfig bridge ifconfig: interface bridge does not exist finch:~/vms/xigmanas# ifconfig bridge create bridge0 finch:~/vms/xigmanas# ifconfig bridge0 name em0bridge em0bridge finch:~/vms/xigmanas# ifconfig em0bridge addm em0 up finch:~/vms/xigmanas# ifconfig em0bridge </pre> Share bastille's bridge with bhyve. (manually setup the switch) <pre> vm switch create -t manual -b em0bridge public </pre> ==== vm-bhyve restart ==== since vm-bhyve is within finch chroot, the mount points need to be re-mounted within the chroot <pre> zfs list -t filesystem | awk '/vms/ { print $1}' | xargs -n1 zfs mount </pre> === Host Setup === <pre> # disable autoboot delay grep autoboot /boot/loader.conf || echo 'autoboot_delay="-1"' >> /boot/loader.conf mkdir -p .ssh grep filer02 /etc/hosts || echo -e "192.168.3.159\tfiler02" >> /etc/hosts scp wongk@192.168.3.83:.ssh/vms_id_ed.pub .ssh/authorized_keys scp wongk@192.168.3.83:.ssh/vms_id_ed .ssh/ grep vms .ssh/config || echo 'IdentityFile ~/.ssh/vms_id_ed' >> .ssh/config ls /boot/entropy || /etc/rc.d/random start grep bash /etc/shells || echo /usr/local/bin/bash >> /etc/shells </pre> <pre> pkg install -y parallel echo 'will cite' | parallel --citation </pre> === Upgrade Host === <pre> date ; PAGER=cat yes | freebsd-update -r 14.1-RELEASE-p2 --currently-running 14.1-RELEASE-p1 --not-running-from-cron upgrade; date date ; time yes | PAGER=cat freebsd-update --currently-running $(uname -r) --not-running-from-cron fetch install ; date real 4m23.307s user 2m49.590s sys 0m13.771s </pre> === pkg base === https://wiki.freebsd.org/PkgBase <pre> date ls -l /boot/kernel/kernel mkdir -p /usr/local/etc/pkg/repos/ grep enabled /usr/local/etc/pkg/repos/base.conf || echo 'base: { url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_2", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes }' >/usr/local/etc/pkg/repos/base.conf rm /usr/local/etc/pkg/repos/FreeBSD.conf grep enabled /usr/local/etc/pkg/repos/latest.conf || echo 'latest: { url: "pkg+https://pkg.FreeBSD.org/${ABI}/latest", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes }' >/usr/local/etc/pkg/repos/latest.conf pkg update # find security patches. filter unnecessary and current patch-level packages #time pkg search -r base -g 'FreeBSD-*p?' | awk '!/-(lib32|dbg|dev|src|tests|mmccam|minimal)-/ {print $1}' | fgrep -v $(uname -r | awk -F- '{ print $1$3}') | xargs pkg install -y -r base time pkg search -r base -g 'FreeBSD-*p?' | awk '!/-(lib32|dbg|dev|src|tests|mmccam|minimal)-/ {print $1}' | xargs pkg install -y -r base cp -p /etc/master.passwd.pkgsave /etc/master.passwd cp -p /etc/group.pkgsave /etc/group cp -p /etc/shells.pkgsave /etc/shells pwd_mkdb -p /etc/master.passwd cp /etc/sysctl.conf.pkgsave /etc/sysctl.conf cp -p /etc/hosts.pkgsave /etc/hosts cp -p /etc/ssh/sshd_config.pkgsave /etc/ssh/sshd_config # find changed files with "etc" in path #find / -maxdepth 4 -path '*/etc/*' -name "*.pkgsave" -type f # find changed .conf files #find / -maxdepth 4 -name "*.conf.pkgsave" #find / -maxdepth 4 -name \*.pkgsave -print -delete ls -l /boot/kernel/kernel date # (linker.hints was recreated at kernel install and we had the old modules as .pkgsave so we need to recreate it, this will be done at the next reboot) rm /boot/kernel/linker.hints cd /var/cache/pkg ls | fgrep -v '~' | awk '!/-(lib32|dbg|dev|src|tests|mmccam|minimal)-/' </pre> <pre> # pkg search -r base -g 'FreeBSD-*p1' | awk '!/-(lib32|dbg|dev|src|tests|mmccam|minimal)-/ {print $1}' | xargs FreeBSD-acct-14.1p1 FreeBSD-clang-14.1p1 FreeBSD-clibs-14.1p1 FreeBSD-devd-14.1p1 FreeBSD-kernel-generic-14.1p1 FreeBSD-lld-14.1p1 FreeBSD-lldb-14.1p1 FreeBSD-rescue-14.1p1 FreeBSD-runtime-14.1p1 FreeBSD-utilities-14.1p1 FreeBSD-zfs-14.1p1 </pre> === Install ports === <pre> # time git clone -o freebsd https://git.freebsd.org/ports.git /usr/ports ; exit Cloning into '/usr/ports'... remote: Enumerating objects: 6293704, done. remote: Counting objects: 100% (47660/47660), done. remote: Compressing objects: 100% (37020/37020), done. Receiving objects: 100% (6293704/6293704), 1.28 GiB | 6.50 MiB/s, done. remote: Total 6293704 (delta 22967), reused 19260 (delta 10304), pack-reused 6246044 (from 1) Resolving deltas: 100% (3797103/3797103), done. Updating files: 100% (162138/162138), done. real 7m9.337s user 6m38.899s sys 1m26.111s # time git clone --depth 1 https://git.freebsd.org/ports.git /usr/ports Cloning into '/usr/ports'... load: 0.06 cmd: git-remote-https 64926 [select] 13.78r 0.01u 0.00s 0% 13088k load: 0.05 cmd: git-remote-https 64926 [select] 21.56r 0.01u 0.00s 0% 13088k remote: Enumerating objects: 197757, done. remote: Counting objects: 100% (197757/197757), done. remote: Compressing objects: 100% (185648/185648), done. load: 0.11 cmd: git 64927 [piperd] 3.96r 0.04u 0.00s 0% 6524k remote: Total 197757 (delta 13461), reused 117919 (delta 5403), pack-reused 0 (from 0) Receiving objects: 100% (197757/197757), 87.61 MiB | 577.00 KiB/s, done. Resolving deltas: 100% (13461/13461), done. Updating files: 100% (162036/162036), done. real 3m20.931s user 0m6.951s sys 0m3.815s fetch https://download.freebsd.org/ftp/ports/ports/ports.tar.xz # latest tar xf ports.tar.xz -C /usr/ # time (fetch https://download.freebsd.org/ftp/ports/ports/ports.tar.xz ; tar xf ports.tar.xz -C /usr/); ports.tar.xz 41 MB 943 kBps 45s real 1m10.018s user 0m3.526s sys 0m5.176s fetch https://download.freebsd.org/ftp/releases/amd64/14.1-RELEASE/ports.txz tar xf ports.txz -C / </pre> === Install source === <pre> fetch https://download.freebsd.org/ftp/releases/amd64/14.1-RELEASE/src.txz tar xf src.txz -C / </pre> how_to_compile_xigmanas_from_scratch.pdf https://forums.freebsd.org/threads/guide-using-git-to-manage-ports-source-and-documentation.79721/ <pre> git clone --depth=1 https://git.freebsd.org/ports.git /usr/ports git clone --depth=1 https://git.freebsd.org/src.git /usr/src </pre> === Install kernel/base === <pre> fetch --no-verify-peer http://download.freebsd.org/ftp/releases/amd64/14.1-RELEASE/kernel.txz mkdir xigmanas/kernel-txz tar xf kernel.txz -C xigmanas/kernel-txz fetch http://download.freebsd.org/ftp/releases/amd64/14.1-RELEASE/base.txz mkdir xigmanas/base-txz tar xf base.txz -C xigmanas/base-txz </pre> === Install packages: === <pre> pkg install -y bash subversion pigz cdrtools </pre> === Delete all packages: === <pre> pkg delete -a </pre> ==== Getting XigmaNAS from svn ==== <pre> mkdir /usr/local/xigmanas cd /usr/local/xigmanas/ svn co https://svn.code.sf.net/p/xigmanas/code/trunk svn #cd svn; svn up -r9884 # 13.2.0.5 - Heighliner (revision 9884) cd svn; svn up -r10024 # 13.3.0.5 - Hesterion (revision 10024) mkdir /usr/ports/distfiles cp /usr/local/xigmanas/svn/build/ports/distfiles/*.{gz,zip} /usr/ports/distfiles/ ln -s /usr/local/xigmanas /root/xigmanas </pre> <pre> sudo mkdir /usr/local/xigmanas cd /usr/local/xigmanas/ fetch https://sourceforge.net/code-snapshots/svn/x/xi/xigmanas/code/xigmanas-code-r9999-trunk.zip sudo tar xf xigmanas-code-r9999-trunk.zip sudo ln -s xigmanas-code-r9999-trunk svn cp /usr/local/xigmanas/svn/build/ports/distfiles/*.{gz,zip} /usr/ports/distfiles/ </pre> ==== Update Version ==== <pre> echo -n 14.1.0.7> /usr/local/xigmanas/svn/etc/prd.version </pre> binary version 14.1.0.7 ==== Compiling XigmaNAS ==== WITHOUT_X11 is unsupported, use WITHOUT=X11 # virtualbox-ose <pre> echo WITHOUT_X11=yes >> /etc/make.conf echo WITHOUT=X11 >> /etc/make.conf </pre> <pre> export XIGMANAS_ROOTFS=/usr/local/xigmanas/rootfs/ export BATCH=yes /usr/local/xigmanas/svn/build/make.sh </pre> <pre> # ls /usr/local/xigmanas XigmaNAS-x86-9.0.0.1.43.checksum builds XigmaNAS-x86-LiveCD-9.0.0.1.43.iso rootfs XigmaNAS-x86-embedded-9.0.0.1.43.img svn bootloader work </pre> <pre> make build-depends-list | sed 's=/usr/ports/==' | xargs pkg install -y make run-depends-list | sed 's=/usr/ports/==' | xargs pkg install -y </pre> ===== install deps via pkg ===== <pre> cd /usr/local/xigmanas/svn/build/ports for i in */; do cd $i make build-depends-list | sed 's=/usr/ports/==' | xargs pkg install -y cd .. done </pre> <pre> cd /usr/local/xigmanas/svn/build/ports for i in */; do cd $i make build-depends-list | sed 's=/usr/ports/==' | xargs pkg install -y make -j8 build ; make package && cp work/pkg/* /var/cache/pkg/ cd .. done </pre> === Blog === Code highlighting https://prismjs.com/#examples === History === freebsd mkdir(2) manpage history update syscall was not in version 1 unix it wasn't in version 6 either (see tom lions) syscalls: https://warsus.github.io/lions-/ mkdir is not listed http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.1cBSD/usr/man/man2/mkdir.2 https://pubs.opengroup.org/onlinepubs/009695299/functions/mkdir.html https://cgit.freebsd.org/src/plain/share/misc/bsd-family-tree?id=ea2b79b03eec2c1c49c8c04aa7c7a40bb5e41303 mkdir syscall was added in BSD by Kirk McKuisick https://www.youtube.com/watch?v=XUj2vCKtegU&t=736s https://gunkies.org/wiki/BSD 4.1c BSD - A beta of 4.2, and I think the first version of BSD sockets? https://gunkies.org/wiki/4.2_BSD Date Released: 1983 https://gunkies.org/wiki/Installing_4.1c_BSD_on_SIMH You will need the following files from Bitsavers archive from the UCB_CSRG directory. I have used the files: 4.1C_BSD_1of2.zip (http://bitsavers.informatik.uni-stuttgart.de/bits/UCB_CSRG/4.1C_BSD_1of2.zip) <pre> ❯ grep mkdir.2 4.1C_BSD_1of2/burst/00004.txt -rw-r--r-- 0/0 1516 1983-02-26 17:21:59 man/man2/mkdir.2 </pre> === Other === debootstrap unbuntu updates / symlink === Fonts === https://github.com/emaste/fontstuff/tree/master https://docs.freebsd.org/en/books/handbook/bsdinstall/#bsdinstall-start FreeBSD 8x8 syscons font unifont https://unifoundry.com/unifont/unifont-utilities.html <pre>xinch-filer02:/usr/ports# pkg install gnu-unifont-otf</pre> <pre>fetch https://raw.githubusercontent.com/emaste/fontstuff/master/hex2bdf</pre> <pre>unifont# ./hex2bdf iso-8x8.hex > iso-8x8.bdf</pre> <pre>fontforge -lang=ff -c 'Open($1); Generate($2)' iso-8x8.bdf iso-8x8.woff2</pre> === Linux Jail === https://wiki.freebsd.org/LinuxJails https://forums.freebsd.org/threads/running-linux-in-a-jail.90527/ https://iocage.readthedocs.io/en/latest/debian.html <pre> qjail create -4 192.168.3.197 jammy debootstrap --arch=amd64 --no-check-gpg jammy /usr/jails/jammy/compat/ubuntu </pre> <pre> finch:/usr/local/share/debootstrap/scripts# ln -s gutsy noble debootstrap --arch=amd64 --no-check-gpg noble /usr/jails/noble/compat/ubuntu </pre> <pre> xDev:/compat# for i in noble/var/cache/apt/archives/*.deb; do echo $i; tar xf $i -C unzip data.tar.zst ; tar xpf unzip/data.tar.zst -C noble; done </pre> === Errors === ==== No Menu ==== <pre> XigmaNAS: 14.1.0.9 (revision 10142) Compiled: Mon Jul 15 08:12:52 CDT 2024 Platform: x64-liveusb Copyright (c) 2018-2024 XigmaNAS(R). All Rights Reserved. Visit www.xigmanas.com for regular system updates! WebGUI Address: http:// LAN Network IPv4 Address: LAN Network Interface: vtnet0 FreeBSD/amd64 (xigmanas.internal) (ttyu0) FreeBSD/amd64 (xigmanas.internal) (ttyu0) FreeBSD/amd64 (xigmanas.internal) (ttyu0) </pre> ==== Fix ==== Check for opie <pre> # ls ~/xigmanas/rootfs/usr/local/lib/libopie* /root/xigmanas/rootfs/usr/local/lib/libopie.so /root/xigmanas/rootfs/usr/local/lib/libopie.so.8 </pre> === Patches === ==== fdisk ==== <pre> cd /usr/local/xigmanas/svn/build/ports/fdisk make extract egrep -B1 -A1 '^usage' work/fdisk-1.1/fdisk.c sed -i '.orig' 's/^\([a-z][a-zA-Z0-9_]*\)()$/\1(void)/g' /usr/local/xigmanas/svn/build/ports/fdisk/work/fdisk-1.1/fdisk.c cd /usr/local/xigmanas/svn/build/ports/fdisk/work/fdisk-1.1 diff -u fdisk.c.orig fdisk.c > ../../files/patch-fdisk.c </pre> ==== isboot ==== <pre> cd /usr/local/xigmanas/svn/build/ports/isboot/ make extract grep pmap_unmapdev work/isboot-0.3.3/src/ibft.c sed -i '.orig' 's/pmap_unmapdev((vm_offset_t)vaddr,/pmap_unmapdev((void *)(uintptr_t)vaddr,/g' /usr/local/xigmanas/svn/build/ports/isboot/work/isboot-0.3.3/src/ibft.c sed -i '.orig' 's/DVIMAGE$/DVIMAGE\nCFLAGS+= -Wno-error=unused-but-set-variable\n/g' /usr/local/xigmanas/svn/build/ports/isboot/work/isboot-0.3.3/src/Makefile cd /usr/local/xigmanas/svn/build/ports/isboot/work/isboot-0.3.3/src diff -u ibft.c.orig ibft.c > ../../../files/patch-ibft.c diff -u Makefile.orig Makefile > ../../../files/patch-Makefile cd /usr/local/xigmanas/svn/build/ports/isboot/ </pre> ==== fuppes ==== <pre> # bash automake gettext-tools libtool pkgconf newest ports? # autoreconf libtool gettext-tools pkgconf cd /usr/local/xigmanas/svn/build/ports/fuppes make extract grep 'pStream->codec->' work/fuppes-0.692/src/plugins/metadata_libavformat.c sed -i '.orig' 's/pStream->codec->/pStream->codecpar->/g' work/fuppes-0.692/src/plugins/metadata_libavformat.c diff -u /usr/local/xigmanas/svn/build/ports/fuppes/work/fuppes-0.692/src/plugins/metadata_libavformat.c.orig /usr/local/xigmanas/svn/build/ports/fuppes/work/fuppes-0.692/src/plugins/metadata_libavformat.c > files/patch-src__plugins__metadata_libavformat.c </pre> ==== netatalk3 ==== <pre> root@xigmanas:/usr/local/xigmanas/svn/build/ports/netatalk3 # grep -r FreeBSD . | grep LINUX ./work/netatalk-3.1.14/etc/uams/uams_dhx_pam.c:#if defined LINUX || defined __FreeBSD__ ./work/netatalk-3.1.14/etc/uams/uams_dhx2_pam.c:#if defined LINUX || defined __FreeBSD__ ./work/netatalk-3.1.14/etc/uams/uams_pam.c:#if defined LINUX || defined __FreeBSD__ root@xigmanas:/usr/local/xigmanas/svn/build/ports/netatalk3 # </pre> <pre> root@xigmanas:/usr/ports/net/netatalk3/files # ls -l total 40 -rw-r--r-- 1 root wheel 646 Apr 6 2021 netatalk.in -rw-r--r-- 1 root wheel 188 Apr 6 2021 pam.conf -rw-r--r-- 1 root wheel 1767 May 1 2022 patch-config_Makefile.in -rw-r--r-- 1 root wheel 556 Oct 6 23:17 patch-configure -rw-r--r-- 1 root wheel 1007 Feb 27 2023 patch-etc_afpd_Makefile.in -rw-r--r-- 1 root wheel 273 Jul 20 2016 patch-etc_cnid__dbd_cnid__metad.c -rw-r--r-- 1 root wheel 341 May 1 2022 patch-etc_netatalk_Makefile.in -rw-r--r-- 1 root wheel 380 Nov 22 16:10 patch-etc_uams_uams__dhx2__pam.c -rw-r--r-- 1 root wheel 581 Nov 22 16:10 patch-etc_uams_uams__dhx__pam.c -rw-r--r-- 1 root wheel 416 Nov 22 16:10 patch-etc_uams_uams__pam.c root@xigmanas:/usr/ports/net/netatalk3/files # cat patch-etc_uams_uams__dhx2__pam.c --- etc/uams/uams_dhx2_pam.c.orig 2023-11-22 15:19:12 UTC +++ etc/uams/uams_dhx2_pam.c @@ -136,7 +136,7 @@ error: * echo off means password. */ static int PAM_conv (int num_msg, -#ifdef LINUX +#if defined(LINUX) || (defined(FREEBSD) && __FreeBSD_version >= 1400000) const struct pam_message **msg, #else struct pam_message **msg, root@xigmanas:/usr/ports/net/netatalk3/files # ls -l /usr/local/xigmanas/svn/build/ports/netatalk3/files/ total 24 -rw-r--r-- 1 root wheel 2563 Dec 28 17:22 netatalk.in -rw-r--r-- 1 root wheel 1767 Dec 28 17:22 patch-config_Makefile.in -rw-r--r-- 1 root wheel 508 Dec 28 17:22 patch-configure -rw-r--r-- 1 root wheel 1007 Dec 28 17:22 patch-etc_afpd_Makefile.in -rw-r--r-- 1 root wheel 273 Dec 28 17:22 patch-etc_cnid__dbd_cnid__metad.c -rw-r--r-- 1 root wheel 341 Dec 28 17:22 patch-etc_netatalk_Makefile.in root@xigmanas:/usr/ports/net/netatalk3/files # </pre>
Summary:
Please note that all contributions to pega.life may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Pega.life:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information