Changeset View
Standalone View
release/tools/arm.subr
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | umount_loop() { | ||||
done | done | ||||
return 0 | return 0 | ||||
} | } | ||||
arm_create_disk() { | arm_create_disk() { | ||||
# Create the target raw file and temporary work directory. | # Create the target raw file and temporary work directory. | ||||
chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev} | chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev} | ||||
if [ "${PART_SCHEME}" == "GPT" ]; then | |||||
chroot ${CHROOTDIR} gpart add -t efi -l msdosboot -a 512k -s ${FAT_SIZE} ${mddev} | |||||
chroot ${CHROOTDIR} newfs_msdos -F ${FAT_TYPE} /dev/${mddev}p1 | |||||
imp: we should label the dos partitions the same. | |||||
chroot ${CHROOTDIR} gpart add -t freebsd-ufs -l rootfs -a 64k ${mddev} | |||||
chroot ${CHROOTDIR} newfs -U /dev/${mddev}p2 | |||||
Not Done Inline Actionssame here. imp: same here. | |||||
fi | |||||
if [ "${PART_SCHEME}" == "MBR" ]; then | |||||
chroot ${CHROOTDIR} gpart add -t '!12' -a 512k -s ${FAT_SIZE} ${mddev} | chroot ${CHROOTDIR} gpart add -t '!12' -a 512k -s ${FAT_SIZE} ${mddev} | ||||
chroot ${CHROOTDIR} gpart set -a active -i 1 ${mddev} | chroot ${CHROOTDIR} gpart set -a active -i 1 ${mddev} | ||||
chroot ${CHROOTDIR} newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 | chroot ${CHROOTDIR} newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 | ||||
chroot ${CHROOTDIR} gpart add -t freebsd ${mddev} | chroot ${CHROOTDIR} gpart add -t freebsd ${mddev} | ||||
chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2 | chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2 | ||||
chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 | chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 | ||||
chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a | chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a | ||||
fi | |||||
Not Done Inline Actionsyou need to create gpt partition for the gpt scheme manu: you need to create gpt partition for the gpt scheme | |||||
return 0 | return 0 | ||||
} | } | ||||
arm_create_user() { | arm_create_user() { | ||||
# Create a default user account 'freebsd' with the password 'freebsd', | # Create a default user account 'freebsd' with the password 'freebsd', | ||||
# and set the default password for the 'root' user to 'root'. | # and set the default password for the 'root' user to 'root'. | ||||
chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ | chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | echo '# Disable the beastie menu and color' \ | ||||
>> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf | >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf | ||||
echo 'beastie_disable="YES"' \ | echo 'beastie_disable="YES"' \ | ||||
>> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf | >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf | ||||
echo 'loader_color="NO"' \ | echo 'loader_color="NO"' \ | ||||
>> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf | >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf | ||||
} | } | ||||
arm_install_base() { | arm_install_base() { | ||||
if [ "${PART_SCHEME}" == "GPT" ]; then | |||||
chroot ${CHROOTDIR} mount /dev/${mddev}p2 ${DESTDIR} | |||||
fi | |||||
if [ "${PART_SCHEME}" == "MBR" ]; then | |||||
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} | chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} | ||||
fi | |||||
eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \ | eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \ | ||||
TARGET=${EMBEDDED_TARGET} \ | TARGET=${EMBEDDED_TARGET} \ | ||||
TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ | TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ | ||||
DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ | DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ | ||||
${CONF_FILES} installworld installkernel distribution | ${CONF_FILES} installworld installkernel distribution | ||||
chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos | chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos | ||||
arm_create_user | arm_create_user | ||||
arm_setup_usb_otg | arm_setup_usb_otg | ||||
arm64_setup_multicons | arm64_setup_multicons | ||||
arm_setup_fdt_overlays | arm_setup_fdt_overlays | ||||
arm_setup_minimal_loader | arm_setup_minimal_loader | ||||
arm_do_quirk | arm_do_quirk | ||||
echo '# Custom /etc/fstab for FreeBSD embedded images' \ | echo '# Custom /etc/fstab for FreeBSD embedded images' \ | ||||
> ${CHROOTDIR}/${DESTDIR}/etc/fstab | > ${CHROOTDIR}/${DESTDIR}/etc/fstab | ||||
if [ "${PART_SCHEME}" == "GPT" ]; then | |||||
echo "/dev/gpt/rootfs / ufs rw 1 1" \ | |||||
Not Done Inline ActionsWhy not use the UFS label both places? imp: Why not use the UFS label both places? | |||||
Done Inline ActionsAs far as I can tell GPT labels are preferred over UFS when using GPT as a partitioning scheme? diizzy: As far as I can tell GPT labels are preferred over UFS when using GPT as a partitioning scheme? | |||||
Not Done Inline ActionsIt is? That's news to me. imp: It is? That's news to me.
| |||||
Done Inline Actionsbsdinstall sets GPT labels if labels are set however they are not utilized in fstab (hardset), ZFS installs uses also sets GPT labels (as no other label types are supported afaik) which is why I think we should probably adopt it here too for consistency? diizzy: bsdinstall sets GPT labels if labels are set however they are not utilized in fstab (hardset)… | |||||
>> ${CHROOTDIR}/${DESTDIR}/etc/fstab | |||||
echo "/dev/gpt/msdosboot /boot/msdos msdosfs rw,noatime 0 0" \ | |||||
Not Done Inline ActionsThe standard is just /boot/efi now imp: The standard is just /boot/efi now | |||||
Done Inline ActionsNot sure what you want me to do here diizzy: Not sure what you want me to do here | |||||
Not Done Inline ActionsYea, I thought we were mounting /boot/efi/msdosfs, so n/m. imp: Yea, I thought we were mounting /boot/efi/msdosfs, so n/m.
| |||||
>> ${CHROOTDIR}/${DESTDIR}/etc/fstab | |||||
fi | |||||
if [ "${PART_SCHEME}" == "MBR" ]; then | |||||
echo "/dev/ufs/rootfs / ufs rw 1 1" \ | echo "/dev/ufs/rootfs / ufs rw 1 1" \ | ||||
>> ${CHROOTDIR}/${DESTDIR}/etc/fstab | >> ${CHROOTDIR}/${DESTDIR}/etc/fstab | ||||
echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ | echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ | ||||
Not Done Inline ActionsDitto here. Mount on /boot/efi... likely need to correct other scripts... I know uboot wasn't always efi, but we have transitioned These kids seem kinda silly just to get imp: Ditto here. Mount on /boot/efi... likely need to correct other scripts... I know uboot wasn't… | |||||
Done Inline Actionsmanu@ said on irc that was going to fix MBR in a separate commit diizzy: manu@ said on irc that was going to fix MBR in a separate commit | |||||
>> ${CHROOTDIR}/${DESTDIR}/etc/fstab | >> ${CHROOTDIR}/${DESTDIR}/etc/fstab | ||||
fi | |||||
echo "tmpfs /tmp tmpfs rw,mode=1777,size=50m 0 0" \ | echo "tmpfs /tmp tmpfs rw,mode=1777,size=50m 0 0" \ | ||||
>> ${CHROOTDIR}/${DESTDIR}/etc/fstab | >> ${CHROOTDIR}/${DESTDIR}/etc/fstab | ||||
local hostname | local hostname | ||||
hostname="$(echo ${KERNEL} | tr '[:upper:]' '[:lower:]')" | hostname="$(echo ${KERNEL} | tr '[:upper:]' '[:lower:]')" | ||||
echo "hostname=\"${hostname}\"" > ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | echo "hostname=\"${hostname}\"" > ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | ||||
echo 'ifconfig_DEFAULT="DHCP"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | echo 'ifconfig_DEFAULT="DHCP"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | ||||
echo 'sshd_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | echo 'sshd_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | ||||
echo 'sendmail_enable="NONE"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | echo 'sendmail_enable="NONE"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | ||||
echo 'sendmail_submit_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | echo 'sendmail_submit_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | ||||
echo 'sendmail_outbound_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | echo 'sendmail_outbound_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | ||||
echo 'sendmail_msp_queue_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | echo 'sendmail_msp_queue_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | ||||
echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf | ||||
sync | sync | ||||
umount_loop ${CHROOTDIR}/${DESTDIR} | umount_loop ${CHROOTDIR}/${DESTDIR} | ||||
return 0 | return 0 | ||||
} | } | ||||
arm_install_boot() { | arm_install_boot() { | ||||
FATMOUNT="${DESTDIR%${KERNEL}}/fat" | FATMOUNT="${DESTDIR%${KERNEL}}/fat" | ||||
UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" | UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" | ||||
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" | chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" | ||||
if [ "${PART_SCHEME}" == "GPT" ]; then | |||||
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}p1 ${FATMOUNT} | |||||
Not Done Inline ActionsHere and elsewhere: we have a lot of ifs just to change the partition names.. imp: Here and elsewhere: we have a lot of ifs just to change the partition names.. | |||||
Done Inline ActionsI tried to keep the original script as unaltered as possible and I'm not aware of a better way. diizzy: I tried to keep the original script as unaltered as possible and I'm not aware of a better way. | |||||
Not Done Inline ActionsSet dospart= and ufspart= above and then use these down here. imp: Set dospart= and ufspart= above and then use these down here.
| |||||
chroot ${CHROOTDIR} mount /dev/${mddev}p2 ${UFSMOUNT} | |||||
fi | |||||
if [ "${PART_SCHEME}" == "MBR" ]; then | |||||
Not Done Inline ActionsAnd mount the gpt part here. manu: And mount the gpt part here. | |||||
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} | chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} | ||||
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} | chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} | ||||
fi | |||||
if [ "${EMBEDDED_TARGET}" == "arm" ]; then | if [ "${EMBEDDED_TARGET}" == "arm" ]; then | ||||
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ | chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ | ||||
${FATMOUNT}/ubldr.bin | ${FATMOUNT}/ubldr.bin | ||||
fi | fi | ||||
BOOTFILES="$(chroot ${CHROOTDIR} \ | BOOTFILES="$(chroot ${CHROOTDIR} \ | ||||
env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ | env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ | ||||
Show All 27 Lines |
we should label the dos partitions the same.