BlogBlog ÜbersichtjailscriptportsoptFreeBSDLinksThermoskanne

sysinstall-Ersatz für neuere FreeBSD-Versionen

Seit FreeBSD 9.0 ist sysinstall nicht mehr im Basissystem vorhanden. Möchte man trotzdem nicht auf ein dialog-basiertes Konfigurationsprogramm verzichten so befindet sich seit kurzem bsdconfig unter sysutils/bsdconfig im FreeBSD-Portsbaum:

# /usr/ports/sysutils/bsdconfig && make install clean

Benutzer von pkgng können bsdconfig wie folgt installieren:

# pkg install bsdconfig

Nun kann bsdconfig als root gestartet werden:

# bsdconfig

Nun startet ein dialog-basiertes Konfigurationsmenü in dem man die Dokumentation nachträglich installieren, ein neues root-Passwort setzten, Disks, Maus, Benutzer und Gruppen verwalten, Konsolen und Netzwerk-Einstellungen vornehmen, die Zeitzone und Sicherheitseinstellungen setzen, und rc.conf-Einstellungen ändern kann.

Weiter ist es möglich direkt von der Kommandozeile ein Untermenü aufzurufen. Alle verfügbaren Untermenüs können mit der -h Option ausgegeben werden:

# bsdconfig -h
Usage:
	bsdconfig [-h]
	bsdconfig command [-h]
	bsdconfig [OPTIONS] [command [OPTIONS]]

OPTIONS:
	-h         Print usage statement and exit.
	-S         Secure X11 mode (implies `-X'). As root, always prompt-for
	           and validate sudo(8) username/password before starting.
	-X         Use Xdialog(1) in place of dialog(1).

COMMANDS:
	console             defaultrouter       diskmgmt            docsinstall         dot              
	groupadd            groupdel            groupedit           groupmgmt           hostname         
	kern_securelevel    mouse               mouse_disable       mouse_enable        mouse_flags      
	mouse_port          mouse_type          nameservers         netdev              networking       
	password            security            startup             startup_misc        startup_rcadd    
	startup_rcconf      startup_rcdelete    startup_rcvar       syscons_font        syscons_keymap   
	syscons_repeat      syscons_saver       syscons_screenmap   syscons_ttys        timezone         
	ttys                useradd             userdel             useredit            usermgmt
# bsdconfig startup

Mehr Informationen zu bsdconfig findet man in der Manpage bsdconfig(8).

Related Entries:
Gespeicherte Optionen nach OptionsNG konvertieren
Ports-Subversion-Repository spiegeln
Alte FreeBSD-Port Patchdateien aufsplitten
FreeBSD-Portbaum auf Fehler überprüfen
FreeBSD-Dokumentation auf bekannte Fehler prüfen
Comments (1)  Permalink

Alte FreeBSD-Port Patchdateien aufsplitten

Alte Patchdateien im FreeBSD-Portbaum enthalten nicht den Dateinamen der zur patchenden Datei in der Patchbezeichnung sondern einen Namen im Stile von patch-aa, patch-ab usw. Auch ist es möglich dass eine solche Datei mehrere Dateien patcht. Mit Hilfe des ports/Tools/scripts/splitpatch.pl Skriptes lassen sich solche Patches in einzelne Dateien aufsplitten und richtig benennen:

# pwd
/usr/ports/www/mod_ruby/files
# ls -l
total 10
-rw-r--r--  1 root  wheel  5494 18 Feb  2010 patch-aa-git
-rw-r--r--  1 root  wheel   631 18 Feb  2010 patch-connection.c
-rw-r--r--  1 root  wheel   473 22 Apr  2002 patch-httpd.conf
# /usr/ports/Tools/scripts/splitpatch.pl patch-aa-git
Wrote patch-Makefile.in
Wrote patch-autoconf.rb
Wrote patch-configure.rb
Wrote patch-lib__apache__erb-run.rb
Wrote patch-lib__apache__eruby-run.rb
Wrote patch-lib__apache__ruby-run.rb
Wrote patch-mod_ruby.c
Wrote patch-request.c
# rm patch-aa-git 
# ls -l
total 20
-rw-r--r--  1 root  wheel   568 26 Mai 00:24 patch-Makefile.in
-rw-r--r--  1 root  wheel  1011 26 Mai 00:24 patch-autoconf.rb
-rw-r--r--  1 root  wheel  1031 26 Mai 00:24 patch-configure.rb
-rw-r--r--  1 root  wheel   631 18 Feb  2010 patch-connection.c
-rw-r--r--  1 root  wheel   473 22 Apr  2002 patch-httpd.conf
-rw-r--r--  1 root  wheel   400 26 Mai 00:24 patch-lib__apache__erb-run.rb
-rw-r--r--  1 root  wheel   417 26 Mai 00:24 patch-lib__apache__eruby-run.rb
-rw-r--r--  1 root  wheel   639 26 Mai 00:24 patch-lib__apache__ruby-run.rb
-rw-r--r--  1 root  wheel   463 26 Mai 00:24 patch-mod_ruby.c
-rw-r--r--  1 root  wheel   908 26 Mai 00:24 patch-request.c
Related Entries:
Gespeicherte Optionen nach OptionsNG konvertieren
Ports-Subversion-Repository spiegeln
sysinstall-Ersatz für neuere FreeBSD-Versionen
FreeBSD-Portbaum auf Fehler überprüfen
FreeBSD-Dokumentation auf bekannte Fehler prüfen
 Permalink

FreeBSD-Portbaum auf Fehler überprüfen

Mit Hilfe von pchecker lässt sich der FreeBSD-Portbaum auf bekannte Fehler überprüfen. Im FreeBSD-Portbaum findet man pchecker unter ports-mgmt/pchecker:

# cd /usr/ports/ports-mgmt/pchecker && make install clean

Führt man nun pchecker aus wird der aktuell installierte Portbaum nach bekannten Fehlern durchsucht:

# pchecker
zero size files:

nonstandard directories:
/usr/ports/distfiles/xorg/proto
/usr/ports/distfiles/xorg/util
[...]
/usr/ports/packages/portmaster-backup/hidesvn-1.0.tbz

nonstandard pkg-*:
whitelist: databases/squirrel-sql/pkg-messages don't exists
/usr/ports/distfiles/gnome2/pkg-config-0.23.tar.gz
/usr/ports/distfiles/gnome2/pkg-config-0.25.tar.gz
/usr/ports/distfiles/rubygem/pkg-config-1.1.1.gem

missing/nonstandard/duplicate lines in distinfo:
/usr/ports/devel/avrdude/distinfo: missing SIZE for avrdude-5.11.tar.gz
/usr/ports/devel/py-configobj/distinfo:  ???
/usr/ports/devel/py-asn1/distinfo: missing SIZE for pyasn1-0.1.2.tar.gz
/usr/ports/devel/py-DateTime/distinfo: missing SIZE for zope/DateTime-3.0b3.zip
/usr/ports/devel/yasm/distinfo: missing SIZE for yasm-1.2.0.tar.gz
/usr/ports/games/openarena-oax/distinfo: missing SIZE for oaxB50.zip
/usr/ports/graphics/inkscape/distinfo: missing SIZE for inkscape-0.48.2.tar.bz2
/usr/ports/graphics/gmt/distinfo: missing SHA256 for gmt/GMT_full.tar.bz2
/usr/ports/graphics/gmt/distinfo: missing SHA256 for gmt/GMT_high.tar.bz2
/usr/ports/graphics/gmt/distinfo: missing SHA256 for gmt/triangle.tar.bz2
/usr/ports/mail/qmail/distinfo: missing SIZE for qmail/qmail-ldap-1.03-20060201-SRS.patch
/usr/ports/net-mgmt/zenpack-macreport/distinfo: missing SIZE for zenoss-ZenPacks.sodonnell.MACReport-b345f53.zip
/usr/ports/security/fprint_demo/distinfo:  ???
/usr/ports/security/fprint_demo/distinfo:  ???
/usr/ports/security/ssl-admin/distinfo: missing SIZE for ssl-admin-1.0.4.tar.gz
/usr/ports/www/yii/distinfo: missing SHA256 for yii-1.1.9.r3135.tar.gz
/usr/ports/www/yii/distinfo: missing SIZE for yii-1.1.9.r3527.tar.gz

BROKEN/IGNORE quoted:
/usr/ports/databases/linux-oracle-instantclient-basic/Makefile:IGNORE+=         \"${DISTFILES}\".  \n
/usr/ports/databases/linux-oracle-instantclient-sdk/Makefile:IGNORE+=           \"${DISTFILES}\".  \n
/usr/ports/databases/linux-oracle-instantclient-sqlplus/Makefile:IGNORE+=               \"${DISTFILES}\".  \n
/usr/ports/databases/postgresql-docs/Makefile:BROKEN=           "not implemented yet"
/usr/ports/databases/sqldeveloper/Makefile:IGNORE+=             \"${DISTFILES}\".  \n
/usr/ports/editors/mode-info/Makefile:IGNORE=   cannot install: MI_ELISP_LANG should be "en"
/usr/ports/emulators/stonx/Makefile:IGNORE="Please get a ROM dump from your AtariST and save it as"\
/usr/ports/emulators/xmame/Makefile:IGNORE=             cannot install: MAMEMESS must be set to one of "mame" or "mess".
/usr/ports/games/darkplaces/Makefile:BROKEN=            Does not compile on ia64, powerpc, or sparc64: unrecognized command line option "-msse2"
/usr/ports/java/jai-imageio/Makefile:IGNORE=            you must manually fetch the "Linux Install" distribution (${DISTNAME}${EXTRACT_SUFX}) from ${DOWNLOAD_URL}, place it in ${DISTDIR} and then run make again
/usr/ports/java/jai/Makefile:IGNORE=            You must manually fetch from the \"Java Advanced Imaging API 1.1.3 Download Page\", the \"Java (no native acceleration)\" distribution \(${DISTNAME}${EXTRACT_SUFX}\) from ${DOWNLOAD_URL}, place it in ${DISTDIR} and then run make again
/usr/ports/java/jdk16-doc/Makefile:IGNORE=You must manually fetch ${DISTNAME}${EXTRACT_SUFX} from ${DOWNLOAD_URL} by selecting the \"Download\" link for the \"Java SE 6 Documentation\", place it in ${DISTDIR} and then run make again
/usr/ports/lang/python-doc-html/Makefile:IGNORE=                invalid value for DOCFORMAT: "${DOCFORMAT}", possible values are: text, html, pdf-a4, pdf-letter
/usr/ports/lang/python-doc-html/Makefile:IGNORE=                invalid value for DOCFORMAT: "${DOCFORMAT}", possible values are: html, pdf-a4, pdf-letter, postscript-a4, postscript-letter
/usr/ports/mail/dbmail22/Makefile:IGNORE="requires at least one database backend selected. Run 'make config'"
/usr/ports/math/unixstat/Makefile:IGNORE="Gary Perlman requires that users agree to his license"\
/usr/ports/ports-mgmt/vulnerability-test-port/Makefile:IGNORE=          ": \`\`${INSTALLATION_DATE}\'\' is not a legal date. INSTALLATION_DATE must be in the form YYYY.MM.DD"
/usr/ports/science/gamess/Makefile:IGNORE=you must manually get the source distribution from master site. http://www.msg.ameslab.gov/GAMESS/download.html. Please selsect "Source code distribution", and check on "running on Intel compatible PC running Linux". You must have license, and freely obtainable
/usr/ports/science/afni/Makefile:BROKEN=        Does not compile on sparc64: "undefined reference to '_mcount'"
/usr/ports/security/pam_krb5/Makefile:IGNORE=                   you must define KRB5_IMPL to be \"mit\" or \"heimdal\"
/usr/ports/www/apache20/Makefile.modules:IGNORE=                "Unknown MPM: ${WITH_MPM}"
/usr/ports/www/apache20/Makefile.modules:IGNORE=                "Unknown DBM"
/usr/ports/www/apache22/Makefile.modules:IGNORE=                "Unknown MPM: ${WITH_MPM}"
/usr/ports/www/apache22/Makefile.modules:IGNORE=                "Unknown DBM"

misspelled(wrong) USE_* vars in Makefile:
/usr/ports/editors/xemacs-devel/Makefile:#USE_XPM=      no
/usr/ports/ftp/proftpd/Makefile:USE_CLAMAV=     yes
/usr/ports/mail/dovecot2-antispam-plugin/Makefile:USE_CONFIGURE=        yes
/usr/ports/devel/d-feet/Makefile:USE_GTK=       yes
/usr/ports/audio/wildmidi/Makefile:USE_GZIP=    yes
/usr/ports/devel/ocaml-cppo/Makefile:USE_GZIP=  yes
/usr/ports/net-mgmt/collectd/Makefile:USE_PDNS= yes
/usr/ports/net-mgmt/collectd5/Makefile:USE_PDNS=        yes
/usr/ports/chinese/fcitx/Makefile:USE_QT=       yes
/usr/ports/textproc/ruby-htree/Makefile:USE_RUBY_RD2=           yes
/usr/ports/databases/xapian-bindings10/Makefile:USE_RUBY_RDOCS= no
/usr/ports/net/opal3/Makefile:USE_SLD=  yes
/usr/ports/mail/squirrelmail-user_special_mailboxes-plugin/Makefile:USE_SQ_COMPAT=      yes
/usr/ports/lang/ocaml/Makefile:USE_TK_THREADS = yes

lines after '.include <bsd.port.mk>|<bsd.port.post.mk>' in Makefile:
/usr/ports/emulators/virtualbox-ose-legacy/Makefile:

Mit der -a Option lassen sich zusätzliche Tests durchführen, diese dauern aber länger und sind zum Teil sehr CPU-Intensiv. Da pchecker noch nicht so lange existiert werden zum Teil noch Falschmeldungen ausgeben und daher sollte man den Ergebnissen nicht blind vertrauen, man kann aber davon ausgehen, dass pchecker in der Zukunft weiter ausgebaut und verbessert wird.

Related Entries:
Gespeicherte Optionen nach OptionsNG konvertieren
Ports-Subversion-Repository spiegeln
sysinstall-Ersatz für neuere FreeBSD-Versionen
Alte FreeBSD-Port Patchdateien aufsplitten
FreeBSD-Dokumentation auf bekannte Fehler prüfen
 Permalink

FreeBSD-Dokumentation auf bekannte Fehler prüfen

Mit Hilfe von Igor lassen sich FreeBSD-Manpages oder die FreeBSD-Dokumentation auf bekannte Fehler prüfen. Im FreeBSD-Portbaum findet man Igor unter textproc/igor:

# cd /usr/ports/textproc/igor && make install clean

Danach kann mit Igor eine Manpage auf bekannte Fehler überprüft werden. Dabei spielt es keine Rolle ob die Manpage komprimiert oder nicht ist:

# igor pkg-updating.1.gz 
pkg-updating.1.gz:18:date not today:[February 12, 2012]
pkg-updating.1.gz:34:sentence not on new line:of the installed ports. [Alternative a list of pkg-names could be passed.]
pkg-updating.1.gz:44:sentence not on new line:are shown. [Use a YYYYMMDD date format.]
pkg-updating.1.gz:45:trailing whitespace:.It Fl f Ar file[ ]

Soll das Datum in der Manpage nicht überprüft werden, verwendet man die -D Option:

# igor -D pkg-updating.1.gz
pkg-updating.1.gz:34:sentence not on new line:of the installed ports. [Alternative a list of pkg-names could be passed.]
pkg-updating.1.gz:44:sentence not on new line:are shown. [Use a YYYYMMDD date format.]
pkg-updating.1.gz:45:trailing whitespace:.It Fl f Ar file[ ]

Weiter lässt sich mit Igor auch die FreeBSD-Dokumentation auf Probleme prüfen:

# igor en_US.ISO8859-1/books/porters-handbook/book.sgml 
book.sgml:2851:repeated:	      <programlisting>MASTER_SITES=	[alpha alpha]:SOME_SITE</programlisting>
book.sgml:9179:repeated:GROUPS=	[pulse pulse]-access pulse-rt</programlisting>
book.sgml:13960:use "aka":		table support ([a.k.a.] setfib(1), setfib(2)).</entry>

Mehr Informationen zu Igor erhält man durch die -h Option oder in der Manpage igor(1).

Related Entries:
Gespeicherte Optionen nach OptionsNG konvertieren
Ports-Subversion-Repository spiegeln
sysinstall-Ersatz für neuere FreeBSD-Versionen
Alte FreeBSD-Port Patchdateien aufsplitten
FreeBSD-Portbaum auf Fehler überprüfen
 Permalink

Superpages auf FreeBSD verwenden

Seit FreeBSD 7.2 können auf den Plattformen i386 und amd64 Superpages aktiviert werden. Dadurch kann FreeBSD mit grossen Seiten im virtuellen Speicher umgehen, was vor allem auf neueren Mehrkern-Prozessoren zu Leistungssteigerungen führen kann. Möchte man die Superpages aktivieren, fügt man folgende Zeile in der /boot/loader.conf ein und startet danach das System neu:

vm.pmap.pg_ps_enabled=1
Comments (1)  Permalink

Ports im FreeBSD Portbaum suchen

Mit Hilfe von pkg_search kann im FreeBSD Portbaum nach Ports gesucht werden. Im Portbaum findet man pkg_serch unter ports-mgmt/pkg_search:

# cd /usr/ports/ports-mgmt/pkg_search && make install clean

Nun kann mit pkg_search nach einem Schlüsselwort gesucht werden:

# pkg_search ports
jasperreports-3.0.0_1   JasperReports is a powerful open source Java reporting tool
p5-UNIVERSAL-exports-0.05       Lightweight, universal exporting of variables
nagios-check_ports-0.6.1        Nagios Plugin to monitor your FreeBSD Ports
kports-0.6.1_5          KDE3-Version of your favorite frontend to the Ports
kports-0.8.1_1          Qt4-Version of your favorite frontend to the Ports
portscout-0.7.4_2       A tool to scan for new versions of FreeBSD ports
portsearch-1.3.2        Port searching tool that supports search by packing list files
portsman-0.2_2          An ncurses based front-end to manage the FreeBSD ports collection
portsopt-1.4            Shows WITH(OUT)-knobs of a port makefile
symports-1.0            Automatically generate symlinks for virtual categories
gtkportscan-1.2_4       A simple port scanner that prints out open ports
portscanner-1.2_1       A simple and easy to use TCP port scanner
portsentry-1.2          Port scan detection and active defense

Sollen zusätzliche Informationen wie die URL des Ports in die Suche aufgenommen werden, kann die -k Option verwedent werden:

# pkg_search -k firefox
de-bsdforen-firefox-searchplugin-0.3_2  Firefox searchplugins for the www.bsdforen.de board and wiki
de-bsdgroup-firefox-searchplugin-0.2_3  Firefox searchplugins for the www.BSDGroup.de board
firefox-2.0.0.20_9,1    Web browser based on the browser portion of Mozilla
firefox-i18n-2.0.0.20   Localized interface for Firefox
firefox-remote-20040803_3       Wrapper scripts for firefox web browser
firefox-3.0.14,1        Web browser based on the browser portion of Mozilla
firefox-3.5.r3,1        Web browser based on the browser portion of Mozilla
firefox3-i18n-3.0.13    Localized interface for Firefox3
firefox-3.5.3,1         Web browser based on the browser portion of Mozilla
firefox35-i18n-3.5.3    Localized interface for Firefox3.5
linux-firefox-3.0.14,1  Web browser based on the browser portion of Mozilla
linux-firefox-devel-3.0.b2_1    Web browser based on the browser portion of Mozilla
conkeror-20090821       A completely keyboard driven browser based on firefox
xpi-firefox-showcase-0.9.5      Easily locate and select any open browser window
xpi-firefoxonwooztalk-0.9.9,1   Meet your World Wide Web neighbors with Firefox
xpi-live_http_headers-0.15      A firefox extension to view HTTP headers
xpi-modify_headers-0.6.6        A firefox extension to manipulate HTTP headers
xpi-twitterfox-1.8.3    twitterFox firefox plugin.

Möchte man angezeigen in welchem Verzeichnis sich der Port befindet, verwendet man die -r Option:

# pkg_search -r firefox 
de-bsdforen-firefox-searchplugin-0.3_2  /usr/ports/german/bsdforen-firefox-searchplugin
de-bsdgroup-firefox-searchplugin-0.2_3  /usr/ports/german/bsdgroup-firefox-searchplugin
firefox-2.0.0.20_9,1    /usr/ports/www/firefox   
firefox-i18n-2.0.0.20   /usr/ports/www/firefox-i18n
firefox-remote-20040803_3       /usr/ports/www/firefox-remote
firefox-3.0.14,1        /usr/ports/www/firefox3  
firefox-3.5.r3,1        /usr/ports/www/firefox3-devel
firefox3-i18n-3.0.13    /usr/ports/www/firefox3-i18n
firefox-3.5.3,1         /usr/ports/www/firefox35 
firefox35-i18n-3.5.3    /usr/ports/www/firefox35-i18n
linux-firefox-3.0.14,1  /usr/ports/www/linux-firefox
linux-firefox-devel-3.0.b2_1    /usr/ports/www/linux-firefox-devel
xpi-firefox-showcase-0.9.5      /usr/ports/www/xpi-firefox-showcase
xpi-firefoxonwooztalk-0.9.9,1   /usr/ports/www/xpi-firefoxonwooztalk

Mehr Informationen zu pkg_search findet man in der Manpage pkg_search(1).

 Permalink

FreeBSD Dokumentation über die Ports installieren

Die FreeBSD Dokumentation kann seit einiger Zeit auch über die Ports installiert werden:

# cd /usr/ports/misc/freebsd-doc-en/ && make install clean

Nun können die Formate ausgewählt werden, welche installiert werden sollen:

[ ] HTML        Single HTML file per document
[X] HTML_SPLIT  The default HTML format used on www.FreeBSD.org 
[X] PDF         PDF format
[ ] PS          PostScript format
[ ] TXT         Plain text

Danach ist die Dokumentation unter /usr/local/share/doc/freebsd/en_US.ISO8859-1 verfügbar. Möchte man lieber die deutsche Übersetzung installieren, kann dies über den Port misc/freebsd-doc-de gemacht werden. Alternativ kann die Dokumentation auch mit Hilfe von CVSup erstellt werden: http://www.chruetertee.ch/blog/archive/2008/10/07/lokale-kopie-der-freebsd-dokumentation.html

 Permalink

FreeBSD nur auf ZFS installieren

Möchte man FreeBSD auf einem System nur mit ZFS installieren, so kann man dazu von einer FreeBSD LiveFS CD -ROM oder DVD booten und den Fixit -> CDROM/DVD Modus wählen. Nun kann eine GUID-Partitionstabelle auf der Platte erstellt werden, auf der man FreeBSD mit ZFS installieren kann. Im folgenden Beispiel wird die ganze Festplatte für FreeBSD verwendet, wobei diese noch keine Daten enthält:

Fixit# gpart create -s GPT ad0
ad0 created

Zuerst wird eine Boot-Partition erstellt:

Fixit# gpart add -b 34 -s 128 -t freebsd-boot ad0
ad0p1 added

Mit dem restlichen Speicherplatz wird eine Partition für das ZFS erstellt:

Fixit# gpart show ad0
=>       34  156301421  ad0  GPT  (75G)
         34        128    1  freebsd-boot  (64K)
        162  156301293       - free -   (75G)
Fixit# gpart add -b 162 -s 156301293 -t freebsd-zfs ad0
ad0p2 added

Danach kann der Bootstrap-Code in der Bootpartition installiert werden:

Fixit# gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ad0
ad0 has bootcode

Das erstellte Partitionsschema kann mit gpart show kontrolliert werden:

Fixit# gpart show ad0
=>       34  156301421  ad0  GPT  (75G)
         34        128    1  freebsd-boot  (64K)
        162  156301293    2  freebsd-zfs  (75G)

Als nächstes werden die für eine ZFS-Installation benötigten Kernelmodule geladen:

Fixit# kldload /mnt2/boot/kernel/opensolaris.ko
Fixit# kldload /mnt2/boot/kernel/zfs.ko

Danach wird auf der freien Partition ein ZFS-Pool namens rpool erstellt, von dem das System später gebootet wird:

Fixit# zpool create rpool /dev/ad0p2
Fixit# zpool set bootfs=rpool rpool

Darin werden nun die gewünschten ZFS-Dateisysteme erstellt:

Fixit# zfs create rpool/tmp
Fixit# zfs create rpool/usr
Fixit# zfs create rpool/var

Im ZFS-Pool wird danach ein Swap-Bereich erstellt, welcher im folgenden Beispiel 2GB gross ist:

Fixit# zfs create -V 2gb rpool/swap
Fixit# zfs set org.freebsd:swap=on rpool/swap
Fixit# zfs set checksum=off rpool/swap

Nun werden das Basissystem und der Kernel installiert:

Fixit# cd /dist/8.0-BETA2/base
Fixit# export DESTDIR=/rpool
Fixit# ./install.sh
You are about to extract the base distribution into /rpool - are you SURE
you want to do this over your installed system (y/n)? y
Fixit# cd ../kernels
Fixit# ./install.sh generic
Fixit# cd /rpool/boot
Fixit# cp -Rp GENERIC/* kernel/

Desweiteren müssen noch die FreeBSD-Quelldateien sowie die Manpages installiert werden:

Fixit# cd /dist/8.0-BETA2/src
Fixit# ./install.sh all
Extracting sources into /usr/src...
  Extracting source component: base
  Extracting source component: bin
  Extracting source component: cddl
  Extracting source component: contrib
  Extracting source component: crypto
  Extracting source component: etc
  Extracting source component: games
  Extracting source component: gnu
  Extracting source component: include
  Extracting source component: krb5
  Extracting source component: lib
  Extracting source component: libexec
  Extracting source component: release
  Extracting source component: rescue
  Extracting source component: sbin
  Extracting source component: secure
  Extracting source component: share
  Extracting source component: sys
  Extracting source component: tools
  Extracting source component: ubin
  Extracting source component: usbin
Done extracting sources.
Done extracting sources.
Fixit# cd ../manpages
Fixit# ./install.sh

Danach müssen die entsprechenden Einträge in rc.conf(5) sowie loader.conf(5) gemacht werden, so dass von einem ZFS-Dateisystem gebootet werden kann. Ausserdem muss der ZFS Support für den Bootloader in src.conf(5) gesetzt werden:

Fixit# echo 'zfs_enable="YES"' > /rpool/etc/rc.conf
Fixit# echo 'LOADER_ZFS_SUPPORT="YES"' > /rpool/etc/src.conf
Fixit# echo 'zfs_load="YES"' > /rpool/boot/loader.conf
Fixit# echo 'vfs.root.mountfrom="zfs:rpool"' >> /rpool/boot/loader.conf

Anschliessend kann die zpool.cache-Datei erstellt werden, indem der ZFS-Pool exportiert und wieder importiert wird:

Fixit# mkdir /boot/zfs
Fixit# zpool export rpool && zpool import rpool
Fixit# cp /boot/zfs/zpool.cache /rpool/boot/zfs/

Nun wird im neu installierten System der Bootloader mit ZFS-Support gebaut und installiert. Ausserdem wird eine leere fstab(5) erstellt, damit beim Booten keine Fehlermeldungen angezeigt werden:

Fixit# chroot /rpool
Fixit# mount -t devfs devfs /dev
Fixit# unset DESTDIR
Fixit# cd /usr/src/sys/boot/
Fixit# make obj
Fixit# make depend
Fixit# make
Fixit# cd i386/loader
Fixit# make install
Fixit# umount /dev
Fixit# touch /etc/fstab
Fixit# exit

Zuletzt wird noch festgelegt, wo die ZFS-Dateisysteme gemountet werden sollen. Damit die dynamisch gelinkten Programme danach noch funktionieren, muss zuerst die LD_LIBRARY_PATH -Umgebungsvariable richtig gesetzt werden:

Fixit# export LD_LIBRARY_PATH=/mnt2/lib
Fixit# zfs set mountpoint=legacy rpool
Fixit# zfs set mountpoint=/tmp rpool/tmp
Fixit# zfs set mountpoint=/var rpool/var
Fixit# zfs set mountpoint=/usr rpool/usr

Nun kann das System neu gestartet werden, welches danach von ZFS bootet. Ist das System gebootet, kann man sich als root ohne Passwort anmelden. Jetzt kann das System in der /etc/rc.conf konfiguriert werden sowie Benutzerkonten angelegt und das root-Passwort gesetzt werden.

Eine kleine Einführung in ZFS auf FreeBSD findet man hier: http://www.chruetertee.ch/blog/archive/2007/05/26/zfs-auf-freebsd.html

Dieser Artikel wurde auf der Basis des FreeBSD Wiki Artikels ZFSOnRootWithZFSboot erstellt.

Related Entries:
ZFS-Statistiken anzeigen
ZFS-Installation mit Hilfe von mfsBSD
Alle Änderungen eines ZFS-Pools anzeigen
Automatisch ZFS Snapshots erstellen
ZFS Dateisystemoptionen verwenden
Comments (6)  Permalink

Einstellungen des FreeBSD-Bootmanagers ändern

Verwendet man den FreeBSD-Bootmanager um auf einem Rechner verschiedene installierte Betriebssysteme starten zu können, so kann mit boot0cfg und der -v Option die aktuelle Konfiguration ausgelesen werden:

# boot0cfg -v /dev/ad4
#   flag     start chs   type       end chs       offset         size
1   0x00      0:  1: 1   0x07   1023:119:63           63    245866257
2   0x00   1023:255:63   0x12   1023:239:63    474541200     13849920
3   0x80   1023:255:63   0xa5   1023:254:63    245866320    228661650

version=2.0  drive=0x80  mask=0xf  ticks=182  bell=# (0x23)
options=packet,noupdate,nosetdrv
volume serial ID b8b8-b8b8
default_selection=F1 (Slice 1)

Möchte man nun ändern, von welchem Slice beim nächsten Neustart standardmässig gestartet werden soll, so kann die Slice-Nummer mit der -s Option an boot0cfg übergeben werden:

# boot0cfg -s 3 /dev/ad4
# boot0cfg -v /dev/ad4
#   flag     start chs   type       end chs       offset         size
1   0x00      0:  1: 1   0x07   1023:119:63           63    245866257
2   0x00   1023:255:63   0x12   1023:239:63    474541200     13849920
3   0x80   1023:255:63   0xa5   1023:254:63    245866320    228661650

version=2.0  drive=0x80  mask=0xf  ticks=182  bell=# (0x23)
options=packet,noupdate,nosetdrv
volume serial ID b8b8-b8b8
default_selection=F3 (Slice 3)

Standardmässig wartet der Bootmanager 10 Sekunden (was ~182 Ticks entspricht), bevor vom konfigurierten Standardslice gebootet wird. Möchte man diese Dauer ändern, kann mit der -t Option die Anzahl Ticks angegeben werden, wie lange gewartet werden soll. Im folgenden Beispiel wird die Zeit auf 91 Ticks eingestellt, was ~5 Sekunden entspricht:

# boot0cfg -t 91 /dev/ad4
# boot0cfg -v /dev/ad4
#   flag     start chs   type       end chs       offset         size
1   0x00      0:  1: 1   0x07   1023:119:63           63    245866257
2   0x00   1023:255:63   0x12   1023:239:63    474541200     13849920
3   0x80   1023:255:63   0xa5   1023:254:63    245866320    228661650

version=2.0  drive=0x80  mask=0xf  ticks=91  bell=# (0x23)
options=packet,noupdate,nosetdrv
volume serial ID b8b8-b8b8
default_selection=F3 (Slice 3)

Mehr Informationen zu boot0cfg findet man in der Manpage boot0cfg(8).

 Permalink

Informationen zu einer FreeBSD-Installation auslesen

Mit Hilfe von sysinfo können Informationen zu einem FreeBSD-System ausgelesen werden. Im FreeBSD Portbaum findet man sysinfo unter sysutils/sysinfo:

# cd /usr/ports/sysutils/sysinfo && make install clean

Führt man sysinfo mit der -a Option aus, werden verschiedene Informationen zum Rechner und der FreeBSD-Installation angezeigt:

# sysinfo -a

Sollen zusätzliche Informationen angezeigt werden, kann die Option -v 1 verwendet werden:

# sysinfo -a -v 1

Soll die Ausgabe nicht farbig dargestellt werden, kann -c verwendet werden. So lässt sich die Ausgabe auch ohne Probleme in eine Textdatei umleiten:

# sysinfo -a -c -v 1 > /tmp/sysinfo

Das Verhalten von sysinfo lässt sich auch in der Datei /usr/local/etc/sysinfo.conf konfigurieren. Eine Beispielausgabe von sysinfo findet man hier.

 Permalink
Next1-10/48