Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Re-visiting Gentoo/FreeBSD 11.1
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
toofied
n00b
n00b


Joined: 26 Oct 2016
Posts: 26

PostPosted: Tue Oct 06, 2020 8:23 pm    Post subject: Re-visiting Gentoo/FreeBSD 11.1 Reply with quote

I've spent the last several days gathering and researching as much information as I can about FreeBSD 11.1 and I was able to get a fully working chroot. The way I accomplished this was from the provided 9.1 stage and tons of time hunting down source files on obscure and dying mirrors, and reviewing git commit logs.

Code:
# Boot 12.1 CD
# Drop to shell
dhclient vtnet0 (or your interface)

# Create GPTS with UFS / standard FreeBSD boot loader
gpart create -s GPT ada0 # check /dev for drive number
gpart add -s 64k -t freebsd-boot ada0
gpart add -s 29G -t freebsd-ufs -l root ada0
gpart add -t freebsd-swap -l swap ada0
newfs -L gfbsdroot -U /dev/ada0p2
mount /dev/ufs/gfbsdroot /mnt
swapon /dev/gpt/swap
cd /mnt
tar -jxvpf stage3-*.tar.bz2
mount -t devfs none /mnt/dev/
cp /etc/resolv.conf /mnt/etc/
chroot /mnt/ /bin/bash
env-update && source /etc/profile
# You'll need portage snapshot: gentoo-20171201.tar.bz2 or there abouts.
# git checkout `git rev-list -n 1 --before="2017-30-12 13:37" master`
ln -sf /usr/portage/profiles/default-bsd/fbsd/11.1/x86/ /etc/portage/make.profile
# Follow Upgrade Toolchain Guide https://wiki.gentoo.org/wiki/Gentoo_FreeBSD/Upgrade_Guide
# Use search engine to wget all the rare old files to /usr/portage/distfiles
# after installing b00t0, exit chroot and install bootloader:
gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptboot -i 1 ada0


At this point the kernel will not boot, the bootloader says "Booting...". Not sure if this is a bug in FreeBSD 11.1 or if I configured something wrong with boot0.
However, the toolchain is sound and the chroot is working, emerge --info:

Code:
Portage 2.3.13 (python 3.5.4-final-0, default/bsd/fbsd/amd64/11.1, gcc-6.4.0, freebsd-lib-11.1, 12.1-RELEASE amd64)
=================================================================
System uname: FreeBSD-12.1-RELEASE-amd64-64bit-ELF
KiB Mem:     2057700 total
KiB Swap:    1048472 total
sh sh
ld GNU ld (Gentoo 2.27 p1.1) 2.27
app-shells/bash:         4.4_p12::gentoo
dev-lang/perl:           5.26.1-r1::gentoo
dev-lang/python:         2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/pkgconfig:      0.29.2::gentoo
sys-apps/baselayout:     2.4.1-r2::gentoo
sys-apps/openrc:         0.34.11::gentoo
sys-devel/autoconf:      2.69-r4::gentoo
sys-devel/automake:      1.9.6-r3::gentoo, 1.13.2::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:      2.27-r1::gentoo, 2.29.1-r1::gentoo
sys-devel/gcc:           6.4.0::gentoo, 7.2.0::gentoo
sys-devel/gcc-config:    1.9.1::gentoo
sys-devel/libtool:       2.4.6-r4::gentoo
sys-devel/make:          4.2.1-r1::gentoo
sys-freebsd/freebsd-lib: 11.1::gentoo (virtual/os-headers)
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:

gentoo-bsd
    location: /usr/local/portage/gentoo-bsd
    masters: gentoo
    priority: 10

ACCEPT_KEYWORDS="amd64-fbsd ~amd64-fbsd"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-gentoo-freebsd11.1"
CFLAGS="-O2 -pipe -mtune=generic"
CHOST="x86_64-gentoo-freebsd11.1"
CONFIG_PROTECT="/boot/device.hints /etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/terminfo"
CXXFLAGS="-O2 -pipe -mtune=generic"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs chflags config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/lib/systemd"
LDFLAGS=""
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64-fbsd berkdb bindist cracklib crypt cxx dri gdbm iconv ipv6 mmx modules multilib ncurses nls oss pam pcre readline sse sse2 ssl tcpd unicode xattr zlib" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="FreeBSD" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="FreeBSD" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22" USERLAND="BSD" VIDEO_CARDS="cyrix dummy mga nv r128 radeon fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS



Next steps would be to see if portage can be updated to 3.x. And if ebuilds can be created for 12.1. It seems a lot of sabotage occurred in portage and catalyst over the years making it not possible without some extensive patching. Current hack to get portage upgraded (not-working):

Code:
# Download portage snapshot, extract to /tmp/snapshot
# Force our keyword since it's totally impossible to add a new architecture right now even with ekeyword
grep -rl 'amd64 ' /tmp/snapshot | xargs sed -i 's/amd64/amd64-fbsd/g'
# Delete useless new profiles, since ALL freebsd profiles were purged, including eclasses etc.
rm -rf /tmp/snapshot/profiles
cp -r /tmp/snapshot/* /usr/portage
# Yay, all digest now corrupted!
# Repoman can be built but, can't realistically repoman the entire tree (tons of 404s on old junk)
# ebuild *.ebuild manifest STILL thinks it's cool to get digest for entire folder, not just the ebuild you want
# So.... rm non-working ebuilds and ignore digest, forcing upgrade...
emerge --digest -qav python
USE='-rsync-verify' emerge --digest -qavO portage
emerge -qav portage


Unfortunately, you'll now end up with a portage that can't emerge anything due to can't find dependency of "__const__empty-any-of". Whatever the heck that means. :?

If anyone is interested in the last-known working freebsd 11.1 let me know and will upload a tarball. I can't create a real stage3 from it since catalyst is barely documented and it isn't working even using the 2.x old version. I think it would work with 2.x if I was able to boot, but not inside chroot (since you can't chroot inside of a chroot).
Back to top
View user's profile Send private message
toofied
n00b
n00b


Joined: 26 Oct 2016
Posts: 26

PostPosted: Thu Oct 22, 2020 10:26 pm    Post subject: My attempt at 11.1 stage3 Reply with quote

As previously mentioned, tarball: stage3-amd64-fbsd-11.1-forcestage3.tar.bz2:
https://gofile.io/d/QpWxlC


Can be used with the old install guide: https://wiki.gentoo.org/wiki/Gentoo_FreeBSD

Has a working portage tree from 2017 pre-packaged.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum