# The reference image is expected to have been built by prep.sh (see .spec)
# we disable the initial logic that called prep.sh if that was not the case
# The reference image is expected to have been built by prep.sh (see .spec)
# we disable the initial logic that called prep.sh if that was not the case
if [ ! -f $ISOREF/isofs/bootcd.img -o ! -f $ISOREF/version.txt ] ; then
echo "Could not find isofs and version.txt in $ISOREF"
if [ "$VARIANT" == "build" ] ; then
if [ ! -f $ISOREF/isofs/bootcd.img -o ! -f $ISOREF/version.txt ] ; then
echo "Could not find isofs and version.txt in $ISOREF"
if [ "$VARIANT" == "build" ] ; then
# without the need for a full devel environment
# for example, you would create /root/custom-bootcd/etc/rc.d/init.d/pl_hwinit
# and run this script with -C /root/custom-bootcd
# without the need for a full devel environment
# for example, you would create /root/custom-bootcd/etc/rc.d/init.d/pl_hwinit
# and run this script with -C /root/custom-bootcd
# bootcd.img in the resulting unionfs
# it seems that this feature has not been used nor tested in a long time, use with care
# bootcd.img in the resulting unionfs
# it seems that this feature has not been used nor tested in a long time, use with care
local matcher="XXX$(echo $ALL_TYPES | sed -e 's,\W,XXX,g')XXX"
for t in $TYPES; do
echo Checking type $t
local matcher="XXX$(echo $ALL_TYPES | sed -e 's,\W,XXX,g')XXX"
for t in $TYPES; do
echo Checking type $t
# this is still required, somewhere in the bootmanager apparently
install -D -m 644 $PLC_BOOT_CA_SSL_CRT $OVERLAY/usr/bootme/cacert/$PLC_BOOT_HOST/cacert.pem
echo "$FULL_VERSION_STRING" >$OVERLAY/usr/bootme/ID
# this is still required, somewhere in the bootmanager apparently
install -D -m 644 $PLC_BOOT_CA_SSL_CRT $OVERLAY/usr/bootme/cacert/$PLC_BOOT_HOST/cacert.pem
echo "$FULL_VERSION_STRING" >$OVERLAY/usr/bootme/ID
# Set root password
echo "* Setting root password"
if [ -z "$ROOT_PASSWORD" ] ; then
# Generate an encrypted password with crypt() if not defined
# in a static configuration.
# Set root password
echo "* Setting root password"
if [ -z "$ROOT_PASSWORD" ] ; then
# Generate an encrypted password with crypt() if not defined
# in a static configuration.
- ROOT_PASSWORD=$(python <<EOF
-import crypt, random, string
-salt = [random.choice(string.letters + string.digits + "./") for i in range(0,8)]
-print crypt.crypt('$PLC_ROOT_PASSWORD', '\$1\$' + "".join(salt) + '\$')
+ ROOT_PASSWORD=$(python3 << EOF
+import crypt
+print(crypt.crypt('$PLC_ROOT_PASSWORD', crypt.METHOD_SHA256))
# this is more harmful than helpful
# idea being, since we start a full-featured fedora system now, it would
# have been nice to be able to enter sshd very early on - before bm has even been downloaded
# however somehow it appears that these lines ruin all chances to enter ssh at all
# either early or even later on;
# this is more harmful than helpful
# idea being, since we start a full-featured fedora system now, it would
# have been nice to be able to enter sshd very early on - before bm has even been downloaded
# however somehow it appears that these lines ruin all chances to enter ssh at all
# either early or even later on;
# # recent bootCDs rely on a standard systemd startup sequence
# # so allow debug key to enter in this context whenever that makes sense
# mkdir -p $OVERLAY/root/.ssh
# # recent bootCDs rely on a standard systemd startup sequence
# # so allow debug key to enter in this context whenever that makes sense
# mkdir -p $OVERLAY/root/.ssh
# making sure the network interfaces are still numbered eth0 and above
KERNEL_ARGS="$KERNEL_ARGS biosdevname=0"
# this apparently is required instead (or in addition to) starting with f29
# making sure the network interfaces are still numbered eth0 and above
KERNEL_ARGS="$KERNEL_ARGS biosdevname=0"
# this apparently is required instead (or in addition to) starting with f29
### COPIED FROM build_usb() below!!!!
echo -n " populating USB image... "
mcopy -bsQ -i "$usb" "$ISOFS"/* z:/
### COPIED FROM build_usb() below!!!!
echo -n " populating USB image... "
mcopy -bsQ -i "$usb" "$ISOFS"/* z:/
#################### utility to setup CRAMFS related support
function prepare_cramfs() {
[ -n "$CRAMFS_PREPARED" ] && return 0
#################### utility to setup CRAMFS related support
function prepare_cramfs() {
[ -n "$CRAMFS_PREPARED" ] && return 0