Build: Add FreeBSD support (#1492)

This commit is contained in:
BenJilks 2020-03-21 08:46:30 +00:00 committed by GitHub
parent bceabd7c4b
commit c64b5e73f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 3 deletions

View file

@ -24,6 +24,9 @@ if [ "$(uname -s)" = "OpenBSD" ]; then
VND=$(vnconfig _disk_image)
(echo "e 0"; echo 83; echo n; echo 0; echo "*"; echo "quit") | fdisk -e "$VND"
mkfs.ext2 -I 128 -F "/dev/${VND}i" || die "could not create filesystem"
elif [ "$(uname -s)" = "FreeBSD" ]; then
MD=$(mdconfig _disk_image)
mke2fs -q -I 128 _disk_image || die "could not create filesystem"
else
if [ -x /sbin/mke2fs ]; then
/sbin/mke2fs -q -I 128 _disk_image || die "could not create filesystem"
@ -39,6 +42,8 @@ if [ "$(uname -s)" = "Darwin" ]; then
fuse-ext2 _disk_image mnt -o rw+,allow_other,uid=501,gid=20 || die "could not mount filesystem"
elif [ "$(uname -s)" = "OpenBSD" ]; then
mount -t ext2fs "/dev/${VND}i" mnt/ || die "could not mount filesystem"
elif [ "$(uname -s)" = "FreeBSD" ]; then
fuse-ext2 -o rw+ "/dev/${MD}" mnt/ || die "could not mount filesystem"
else
mount _disk_image mnt/ || die "could not mount filesystem"
fi
@ -50,7 +55,9 @@ cleanup() {
umount mnt || ( sleep 1 && sync && umount mnt )
rm -rf mnt
if [ "$(uname -s)" = "OpenBSD" ]; then
vnconfig -u "$VND"
vnconfig -u "$VND"
elif [ "$(uname -s)" = "FreeBSD" ]; then
mdconfig -d -u "$MD"
fi
echo "done"
fi

View file

@ -105,7 +105,7 @@ printf "installing userland... "
if [ "$(uname -s)" = "Darwin" ]; then
find ../Userland/ -type f -perm +111 -exec cp {} mnt/bin/ \;
elif [ "$(uname -s)" = "OpenBSD" ]; then
elif [ "$(uname -s)" = "OpenBSD" ] || [ "$(uname -s)" = "FreeBSD" ]; then
find ../Userland/ -type f -perm -555 -exec cp {} mnt/bin/ \;
else
find ../Userland/ -type f -executable -exec cp {} mnt/bin/ \;

View file

@ -20,7 +20,7 @@ sudo id
MAKE="make"
if [ "$(uname -s)" = "OpenBSD" ]; then
if [ "$(uname -s)" = "OpenBSD" ] || [ "$(uname -s)" = "FreeBSD" ]; then
MAKE="gmake"
fi

View file

@ -26,6 +26,10 @@ if [ `uname -s` = "OpenBSD" ]; then
export CXX=eg++
export with_gmp=/usr/local
export LDFLAGS=-Wl,-z,notext
elif [ `uname -s` = "FreeBSD" ]; then
MAKE=gmake
MD5SUM="md5 -q"
NPROC="sysctl -n hw.ncpu"
fi
echo PREFIX is "$PREFIX"

View file

@ -24,6 +24,10 @@ if [ `uname -s` = "OpenBSD" ]; then
export CXX=eg++
export with_gmp=/usr/local
export LDFLAGS=-Wl,-z,notext
elif [ `uname -s` = "FreeBSD" ]; then
MAKE=gmake
MD5SUM="md5 -q"
NPROC="sysctl -n hw.ncpu"
fi
echo PREFIX is "$PREFIX"