Page MenuHomeFreeBSD

D38838.id153758.diff
No OneTemporary

D38838.id153758.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,20 @@
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}
+makefs $([ -n "${METALOG}" ] && echo -n "" || echo -n "-D") -t msdos -o volume_label=installcfg -o create_size=32m ${2}.config ${cfgdirname}
+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/share/bsdinstall/bsdinstall.example b/share/bsdinstall/bsdinstall.example
new file mode 100644
--- /dev/null
+++ b/share/bsdinstall/bsdinstall.example
@@ -0,0 +1,7 @@
+PARTITIONS=DEFAULT
+DISTRIBUTIONS="kernel.txz base.txz"
+
+#!/bin/sh
+sysrc ifconfig_DEFAULT=DHCP
+sysrc sshd_enable=YES
+pkg install puppet
diff --git a/usr.sbin/bsdinstall/startbsdinstall b/usr.sbin/bsdinstall/startbsdinstall
--- a/usr.sbin/bsdinstall/startbsdinstall
+++ b/usr.sbin/bsdinstall/startbsdinstall
@@ -47,18 +47,22 @@
# Query terminal size; useful for serial lines.
resizewin -z
-if [ -f /etc/installerconfig ]; then
+for config_file in "/etc/installerconfig" "/bsdinstall_config/installerconfig";
+do
+ if [ ! -f ${config_file} ]; then
+ continue
+ fi
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_file}; 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
bsddialog --backtitle "${OSNAME} Installer" --title "Error" --textbox /tmp/bsdinstall_log 0 0
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, 1 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24057783
Default Alt Text
D38838.id153758.diff (5 KB)

Event Timeline