Gret, everything is in. Thank you. For the record, the relevant function is :
uo_addfile() {
local dest=${1}
local src=${2}
local vnd_n=0
[ -r "${WRKDIR}/bsd.rd" ] || uo_err 2 "uo_addfile: no
bsd.rd in WRKDIR"
[ -r "${src}" ] || uo_err 1 "file not found: ${src}"
uo_verbose "adding response file: ${dest}: ${src}"
# extract ramdisk from bsd.rd
elfrdsetroot -x "${WRKDIR}/bsd.rd" "${WRKDIR}/ramdisk"
# create mountpoint
mkdir "${WRKDIR}/ramdisk.d"
# prepare ramdisk for mounting
while ! uo_priv vnconfig "vnd${vnd_n}"
"${WRKDIR}/ramdisk"; do
vnd_n=$(( vnd_n + 1 ))
[[ ${vnd_n} > 4 ]] && \
uo_err 1 "no more vnd
device available"
done
# mount ramdisk
if ! uo_priv mount -o noperm "/dev/vnd${vnd_n}a"
"${WRKDIR}/ramdisk.d"; then
uo_priv vnconfig -u "vnd${vnd_n}" ||
true
uo_err 1 "unable to mount:
/dev/vnd${vnd_n}a"
fi
# copy the file
if ! uo_priv install -m 644 -o root -g wheel -- \
"${src}" "${WRKDIR}/ramdisk.d/${dest}";
then
uo_priv umount "/dev/vnd${vnd_n}a" ||
true
uo_priv vnconfig -u "vnd${vnd_n}" ||
true
uo_err 1 "unable to copy: ${src}:
ramdisk.d/${dest}"
fi
# umount vndX
if ! uo_priv umount "/dev/vnd${vnd_n}a" ; then
uo_priv vnconfig -u "vnd${vnd_n}" ||
true
uo_err 1 "unable to umount:
/dev/vnd${vnd_n}a"
fi
# unconfigure vndX
if ! uo_priv vnconfig -u "vnd${vnd_n}" ; then
uo_err 1 "unable to unconfigure:
vnd${vnd_n}"
fi
# mountpoint cleanup (ensure it is empty)
rmdir "${WRKDIR}/ramdisk.d"
# put ramdisk back in bsd.rd
elfrdsetroot "${WRKDIR}/bsd.rd" "${WRKDIR}/ramdisk"
}
* Wesley MOUEDINE ASSABY <[email protected]> le [23-02-2018 17:05:11 +0400]:
> Try 'upobsd' tool
> (http://ports.su/sysutils/upobsd)
> (https://maly.io/@semarie)
>
> /Wesley
>
>
> Le 2018-02-23 17:01, Thuban a écrit :
> > As mentionned in autoinstall(8),
> > """
> > If either /auto_install.conf or /auto_upgrade.conf is found on bsd.rd's
> > built-in RAM disk, autoinstall behaves as if the machine is netbooted,
> > but uses the local response file.
> > """
> >
> > I would like to build a custom bsd.rd to include auto_install.conf file.
> >
> > Do you have any advice for this ?
> > I found some tutorials for 5.7 [1], so quite outdated, and can't go
> > through
> > the entire process.
> >
> > Regards.
> >
> > [1] : http://mouedine.net/reinstall57/
--
thuban
signature.asc
Description: PGP signature

