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

Joined: 26 Oct 2016
Posts: 27

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.

# 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
# 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:

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)

    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000

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

ACCEPT_KEYWORDS="amd64-fbsd ~amd64-fbsd"
CFLAGS="-O2 -pipe -mtune=generic"
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"
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"
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"
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"

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):

# 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

Joined: 26 Oct 2016
Posts: 27

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:

Can be used with the old install guide:

Has a working portage tree from 2017 pre-packaged.
Back to top
View user's profile Send private message

Joined: 10 Apr 2004
Posts: 5924

PostPosted: Thu Dec 17, 2020 10:22 pm    Post subject: Reply with quote

I would love to try this, but the file is gone. Are you still working on this? Thanks
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message

Joined: 17 Nov 2020
Posts: 1

PostPosted: Sat Dec 19, 2020 12:24 am    Post subject: Reply with quote

I guess you can create your own tarball according to this page :
Back to top
View user's profile Send private message

Joined: 26 Oct 2016
Posts: 27

PostPosted: Mon Jan 04, 2021 5:12 am    Post subject: Reply with quote

Didn't know anyone else was interested, looks like the free file host dropped my file in less than a month. :?

Re-Uploaded 11.1:

I stopped since I can't get portage to update without breaking it, and the aforementioned boot0 problem. It should be possible however, and new ebuilds could be made for the 12.2 base system, most of the same profile helper scripts still work.

If anyone makes any further progress please post about it and/or throw up an overlay. I think there are several undocumented portage features that could help in this endeavor (e.g. thin-manifests to avoid downloading all the source code, profile overrides etc., but I haven't actually figured it all out yet)
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