Page MenuHomeFreeBSD

D38838.id153736.diff
No OneTemporary

D38838.id153736.diff

diff --git a/release/Makefile b/release/Makefile
--- a/release/Makefile
+++ b/release/Makefile
@@ -205,12 +205,16 @@
echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf
cp ${.CURDIR}/rc.local ${.TARGET}/etc
+ cp ${.CURDIR}/../share/bsdinstall/bsdinstall.example ${.TARGET}/usr/share
+ mkdir ${.TARGET}/bsdinstall_config
.if defined(NO_ROOT)
echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
+ echo "./usr/share/bsdinstall.example type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
+ echo "./bsdinstall_config type=dir uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
.endif
touch ${.TARGET}
@@ -240,11 +244,15 @@
echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf
cp ${.CURDIR}/rc.local ${.TARGET}/etc
+ cp ${.CURDIR}/../share/bsdinstall/bsdinstall.example ${.TARGET}/usr/share
+ mkdir ${.TARGET}/bsdinstall_config
echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
+ echo "./usr/share/bsdinstall.example type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
+ echo "./bsdinstall_config type=dir uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
dvd: packagesystem
# Install system
@@ -278,12 +286,16 @@
echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf
cp ${.CURDIR}/rc.local ${.TARGET}/etc
+ cp ${.CURDIR}/../share/bsdinstall/bsdinstall.example ${.TARGET}/usr/share
+ mkdir ${.TARGET}/bsdinstall_config
.if defined(NO_ROOT)
echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
+ echo "./usr/share/bsdinstall.example type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
+ echo "./bsdinstall_config type=dir uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
.endif
touch ${.TARGET}
diff --git a/release/amd64/make-memstick.sh b/release/amd64/make-memstick.sh
--- a/release/amd64/make-memstick.sh
+++ b/release/amd64/make-memstick.sh
@@ -43,6 +43,7 @@
fi
echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${BASEBITSDIR}/etc/fstab
+echo '/dev/msdosfs/INSTALLCFG /bsdinstall_config msdosfs ro,noatime 0 0' >> ${BASEBITSDIR}/etc/fstab
echo 'root_rw_mount="NO"' > ${BASEBITSDIR}/etc/rc.conf.local
if [ -n "${METALOG}" ]; then
metalogfilename=$(mktemp /tmp/metalog.XXXXXX)
@@ -67,12 +68,24 @@
make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi
fi
+# Make configuration directory
+cfgdirname=$(mktemp -d /tmp/config.XXXXX)
+cp ${BASEBITSDIR}/usr/share/bsdinstall.example ${cfgdirname}
+if [ -n "${METALOG}" ]; then
+ makefs -t msdos -o fat_type=16 -o volume_label=installcfg -o create_size=32m ${2}.config ${cfgdirname}
+else
+ makefs -D -t msdos -o fat_type=16 -o volume_label=installcfg -o create_size=32m ${2}.config ${cfgdirname}
+fi
+rm -r ${cfgdirname}
+
mkimg -s mbr \
-b ${BASEBITSDIR}/boot/mbr \
-p efi:=${espfilename} \
-p freebsd:-"mkimg -s bsd -b ${BASEBITSDIR}/boot/boot -p freebsd-ufs:=${2}.part" \
+ -p fat16b:=${2}.config \
-a 2 \
-o ${2}
rm ${espfilename}
rm ${2}.part
+rm ${2}.config
diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh
--- a/release/amd64/mkisoimages.sh
+++ b/release/amd64/mkisoimages.sh
@@ -89,6 +89,7 @@
publisher="The FreeBSD Project. https://www.FreeBSD.org/"
echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab"
+# echo "/dev/gpt/efiboot0 /bsdinstall_config msdosfs ro,noatime 0 0" >> "$BASEBITSDIR/etc/fstab"
if [ -n "${METALOG}" ]; then
metalogfilename=$(mktemp /tmp/metalog.XXXXXX)
cat ${METALOG} > ${metalogfilename}
diff --git a/share/bsdinstall/bsdinstall.example b/share/bsdinstall/bsdinstall.example
new file mode 100644
--- /dev/null
+++ b/share/bsdinstall/bsdinstall.example
@@ -0,0 +1,8 @@
+PARTITIONS=DEFAULT
+DISTRIBUTIONS="kernel.txz base.txz"
+
+#!/bin/sh
+sysrc ifconfig_DEFAULT=DHCP
+sysrc sshd_enable=YES
+pkg install puppet
+
diff --git a/targets/pseudo/userland/share/Makefile.depend b/targets/pseudo/userland/share/Makefile.depend
--- a/targets/pseudo/userland/share/Makefile.depend
+++ b/targets/pseudo/userland/share/Makefile.depend
@@ -2,6 +2,7 @@
DIRDEPS = \
share/atf \
+ share/bsdinstall \
share/ctypedef \
share/colldef \
share/dict \
diff --git a/usr.sbin/bsdinstall/startbsdinstall b/usr.sbin/bsdinstall/startbsdinstall
--- a/usr.sbin/bsdinstall/startbsdinstall
+++ b/usr.sbin/bsdinstall/startbsdinstall
@@ -47,11 +47,13 @@
# Query terminal size; useful for serial lines.
resizewin -z
-if [ -f /etc/installerconfig ]; then
+for config_dir in "/etc/installerconfig" "/bsdinstall_config/installerconfig"
+do
+if [ -f ${config_dir} ]; then
if [ "$1" != "primary" ]; then
bsddialog --backtitle "${OSNAME} Installer" --title "Installing" --msgbox "${OSNAME} is being installed from a script; please use the primary console." 0 0
. "$0"
- elif bsdinstall script /etc/installerconfig; then
+ elif bsdinstall script ${config_dir} $; then
bsddialog --backtitle "${OSNAME} Installer" --title "Complete" --no-cancel --ok-label "Reboot" --pause "Installation of ${OSNAME} complete! Rebooting in 10 seconds" 10 30 10
reboot
else
@@ -59,6 +61,7 @@
fi
exit
fi
+done
bsddialog --backtitle "${OSNAME} Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live System" --yesno "Welcome to ${OSNAME}! Would you like to begin an installation or use the live system?" 0 0

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 23, 1:34 AM (48 m, 19 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24077426
Default Alt Text
D38838.id153736.diff (6 KB)

Event Timeline