Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/nuageinit
- This file was added.
Property | Old Value | New Value |
---|---|---|
File Mode | null | 100755 |
#!/bin/sh | |||||
# | |||||
# $FreeBSD$ | |||||
# | |||||
# PROVIDE: nuageinit | |||||
# REQUIRE: mountcritlocal | |||||
# BEFORE: NETWORKING | |||||
# KEYWORD: firstboot | |||||
. /etc/rc.subr | |||||
name="nuageinit" | |||||
desc="Limited Cloud Init configuration" | |||||
start_cmd="nuageinit_start" | |||||
stop_cmd=":" | |||||
rcvar="nuageinit_enable" | |||||
nuageinit_start() | |||||
{ | |||||
# detect cloud init provider | |||||
# according to the specification of the config drive | |||||
# it either formatted in vfat or iso9660 and labeled | |||||
# config-2 | |||||
for f in iso9660 msdosfs; do | |||||
drive=/dev/$f/config-2 | |||||
if [ -e $drive ]; then | |||||
dch: I'm not fully understanding when this /dev/msdosfs/* appears.
- when I plug in a Kindle, I see… | |||||
Not Done Inline Actions/dev/msdosfs appears when the system tastes a geom provider with a FAT filesystem that has a label in the FAT filesystem. Perhaps your /dev/gpt/efiboot filesystem is missing this. imp: /dev/msdosfs appears when the system tastes a geom provider with a FAT filesystem that has a… | |||||
break | |||||
fi | |||||
unset drive | |||||
done | |||||
if [ -z "$drive" ]; then | |||||
err 1 "Impossible to find a cloud init provider" | |||||
fi | |||||
fs=$(fstyp $drive) | |||||
mkdir -p /media/cloudinit | |||||
mount -t $fs $drive /media/cloudinit | |||||
# according to the specification, the content is either | |||||
# in the openstack or ec2 directory | |||||
for d in openstack ec2; do | |||||
dir=/media/cloudinit/$d/latest | |||||
if [ -d $dir ]; then | |||||
/usr/libexec/nuageinit $dir | |||||
break | |||||
fi | |||||
done | |||||
umount /media/cloudinit | |||||
rmdir /media/cloudinit | |||||
} | |||||
load_rc_config $name | |||||
run_rc_command "$1" |
I'm not fully understanding when this /dev/msdosfs/* appears.
fstyp /dev/gpt/efiboot = msdos
According to cloudinit spec an EFI partition with either ec2 or openstack files in it should also be acceptable.
bapt does this sound ok for you?
the main advantage here is that we don't need to change how we build official FreeBSD images, and they can be trivially amended to include cloudinit parameters.
the code would need to accommodate /boot/efi and not just /media/cloudinit though.