Changeset View
Changeset View
Standalone View
Standalone View
release/tools/ec2-builder.conf
| Show All 22 Lines | |||||
| export VM_RC_LIST="${VM_RC_LIST} ec2_configinit ec2_ephemeral_swap \ | export VM_RC_LIST="${VM_RC_LIST} ec2_configinit ec2_ephemeral_swap \ | ||||
| ec2_fetchkey ec2_loghostkey sshd" | ec2_fetchkey ec2_loghostkey sshd" | ||||
| vm_extra_pre_umount() { | vm_extra_pre_umount() { | ||||
| # Any EC2 ephemeral disks seen when the system first boots will | # Any EC2 ephemeral disks seen when the system first boots will | ||||
| # be "new" disks; there is no "previous boot" when they might have | # be "new" disks; there is no "previous boot" when they might have | ||||
| # been seen and used already. | # been seen and used already. | ||||
| touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen | touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen | ||||
| metalog_add_data ./var/db/ec2_ephemeral_diskseen | |||||
| # Configuration common to all EC2 AMIs | # Configuration common to all EC2 AMIs | ||||
| ec2_common | ec2_common | ||||
| # Standard FreeBSD network configuration | # Standard FreeBSD network configuration | ||||
| ec2_base_networking | ec2_base_networking | ||||
| # Grab a copy of the ec2-base disk image, and compress it | # Grab a copy of the ec2-base disk image, and compress it | ||||
| zstd < ${EC2BASEIMG} > ${DESTDIR}/image.zst | zstd < ${EC2BASEIMG} > ${DESTDIR}/image.zst | ||||
| metalog_add_data ./image.zst | |||||
| # Disable fortune so we don't have extra noise at login | # Disable fortune so we don't have extra noise at login | ||||
| chmod a-x ${DESTDIR}/usr/bin/fortune | chmod a-x ${DESTDIR}/usr/bin/fortune | ||||
| # Install the AMI-building script | # Install the AMI-building script | ||||
| install -m 755 ${WORLDDIR}/release/tools/mkami.sh ${DESTDIR}/bin/mkami | install -m 755 ${WORLDDIR}/release/tools/mkami.sh ${DESTDIR}/bin/mkami | ||||
| metalog_add_data ./bin/mkami 0755 | |||||
| # Install an /etc/rc which juggles disks around for us | # Install an /etc/rc which juggles disks around for us | ||||
| install -m 755 ${WORLDDIR}/release/tools/rc.amibuilder ${DESTDIR}/etc | install -m 755 ${WORLDDIR}/release/tools/rc.amibuilder ${DESTDIR}/etc | ||||
| metalog_add_data ./etc/rc.amibuilder 0755 | |||||
| # We want to mount from the UFS disk and juggle disks first | # We want to mount from the UFS disk and juggle disks first | ||||
| cat >> ${DESTDIR}/boot/loader.conf <<-EOF | cat >> ${DESTDIR}/boot/loader.conf <<-EOF | ||||
| vfs.root.mountfrom="ufs:/dev/gpt/rootfs" | vfs.root.mountfrom="ufs:/dev/gpt/rootfs" | ||||
| init_script="/etc/rc.amibuilder" | init_script="/etc/rc.amibuilder" | ||||
| EOF | EOF | ||||
| metalog_add_data ./boot/loader.conf | |||||
emaste: Do we have cases where we'd add `./boot/loader.conf` twice? (E.g., here and in ec2.conf) | |||||
Done Inline ActionsYes. It can happen even more than that, e.g., vmimage.subr will add loader.conf entries if the root file system is on ZFS. It's harmless to have duplicate entries. I suspect the right solution is to have each cloudware variant specify its modifications declaratively rather than having code which hacks up the image in various ad-hoc ways. markj: Yes. It can happen even more than that, e.g., vmimage.subr will add loader.conf entries if the… | |||||
| return 0 | return 0 | ||||
| } | } | ||||
Do we have cases where we'd add ./boot/loader.conf twice? (E.g., here and in ec2.conf)