When booting up from a memstick img, the system goes straight into a dialog about starting bsdinstall().
How is that achieved? What scripts get run?
How is that achieved? What scripts get run?
Thanks, I can see that now, although I don't see what triggers rc.local when you are running an installation image..rc.local
I've read through those two man pages until my head hurts but still don't see how it works.
That is correct.Am I correct in thinking that installation media comes with an /etc/rc.local and its function is to start the install?
What problem do you have? I have the impression the real problem is not addressed here.I want to put together an mfsBSD ISO which can be booted from a PXE server and automatically run bsdinstall() with a preconfigured /etc/installerconfig to install FreeBSD on a local disk.
I'm trying to figure out how to build a mfsBSD ISO image which automatically runs bsdinstall with an installerconfig script.
...
I'm currently checking the build instructions to see what I need to change.
# cp rc.local conf/
# make iso BASE=/dir/to/distfiles_kernel.txz_and_base.txz
By login screen I assume you mean the installer dialog, put a /etc/installerconfig file.How do you avoid a login screen and go straight to bsdinstall ()?
cat > /etc/installerconfig <<__INSTALLERCONFIG_
# Installerconfig
PARTITIONS="ada0 gpt { 20G freebsd-ufs /, 4G freebsd-swap }"
DISTRIBUTIONS="kernel.txz base.txz"
#!/bin/sh
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
sysrc ifconfig_em0=DHCP
sysrc sshd_enable=YES
__INSTALLERCONFIG_
Before making additions, does the created mfsbsd iso boot from PXE?
Yes, it's just a question of how to get them included in the mfsBSD ISO image.I think you should place tgz files in /usr/freebsd-dist in order for them to be extracted by the installer
Yes, it's just a question of how to get them included in the mfsBSD ISO image.
- If there is a work directory and an ISO from a previous build remove them
- Edit Makefile 'MFSROOT_MAXSIZE?= 400m' # the ISO has ~300MB with kernel and base.
# If there are more sets included increase the size
cp rc.local conf/ # a rc.local from a installer image
mkdir -p customfiles/usr/freebsd-dist/ # copy here MANIFEST, kernel.txz, base.txz, ...
mkdir customfiles/etc/ # put here installerconfig
make iso BASE=/dir/to/distfiles_kernel.txz_and_base.txz
I thought I had replied to the thread you mention, but I must have forgotten to post. I did decide that it wasn't all that simple especially trying to inject files into mfsroot.gz so I looked again at the Makefile.In case you haven't figured out how to include those files on ISO follow the instructions bellow. I noticed your Thread updating-an-iso.80398. If that is an attempt to get the files on ISO there is an simpler way:
Code:- If there is a work directory and an ISO from a previous build remove them - Edit Makefile 'MFSROOT_MAXSIZE?= 400m' # the ISO has ~300MB with kernel and base. # If there are more sets included increase the size - Edit rc.local as shown in post #11 mkdir -p customfiles/usr/freebsd-dist/ # copy here MANIFEST, kernel.txz, base.txz, ... mkdir customfiles/etc/ # put here installerconfig make iso BASE=/dir/to/distfiles_kernel.txz_and_base.txz
There might be an error message 'roothack.full' but it seems harmless.
make iso BASE=/mnt/md/usr/freebsd-dist
but may have overlooked something. mkdir -p ~/mfsBSD-workdir/DIST
cd ~/mfsBSD-workdir
pkg install -y git
git clone https://github.com/mmatuska/mfsbsd.git
fetch -o - file:///mnt/repo/iso/BSD/FreeBSD-12.2-RELEASE-amd64-memstick.img.xz | xz -d > DIST/FreeBSD.img
mkdir /mnt/md
mount -r /dev/`mdconfig -o readonly DIST/FreeBSD.img`s2a /mnt/md
cp /mnt/md/etc/rc.local mfsbsd/conf/
cp mfsbsd/conf/hosts.sample mfsbsd/conf/hosts
sed 's/#ifconfig_rl0/ifconfig_em0/' mfsbsd/conf/rc.conf.sample >mfsbsd/conf/rc.conf
mkdir mfsbsd/customscripts
echo 'creating installerconfig script'
cat > mfsbsd/customscripts/installerconfig <<__CUSTOMSCRIPT_
cat > etc/installerconfig <<__INSTALLERCONFIG_
# Installerconfig
PARTITIONS="ada0 gpt { 20G freebsd-ufs /, 4G freebsd-swap }"
DISTRIBUTIONS="kernel.txz base.txz"
#!/bin/sh
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
sysrc ifconfig_em0=DHCP
sysrc sshd_enable=YES
__INSTALLERCONFIG_
__CUSTOMSCRIPT_
cd mfsbsd
make iso BASE=/mnt/md/usr/freebsd-dist