Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107106778
D43848.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D43848.diff
View Options
diff --git a/release/tools/arm.subr b/release/tools/arm.subr
--- a/release/tools/arm.subr
+++ b/release/tools/arm.subr
@@ -67,22 +67,25 @@
# Create the target raw file and temporary work directory.
chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev}
+
+ arm_create_partitions
+
if [ "${PART_SCHEME}" = "GPT" ]; then
chroot ${CHROOTDIR} gpart add -t efi -l efi -a 512k -s ${FAT_SIZE} ${mddev}
- chroot ${CHROOTDIR} newfs_msdos -L efi -F ${FAT_TYPE} /dev/${mddev}p1
chroot ${CHROOTDIR} gpart add -t freebsd-ufs -l rootfs -a 64k ${mddev}
- chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}p2
fi
if [ "${PART_SCHEME}" = "MBR" ]; then
chroot ${CHROOTDIR} gpart add -t '!12' -a 512k -s ${FAT_SIZE} ${mddev}
chroot ${CHROOTDIR} gpart set -a active -i 1 ${mddev}
- chroot ${CHROOTDIR} newfs_msdos -L efi -F ${FAT_TYPE} /dev/${mddev}s1
chroot ${CHROOTDIR} gpart add -t freebsd ${mddev}
- chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2
- chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k -b 64k ${mddev}s2
- chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a
+ chroot ${CHROOTDIR} gpart create -s bsd ${mddev}${BSDLABEL_SUFFIX}
+ chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k -b 64k ${mddev}${BSDLABEL_SUFFIX}
fi
+ # Create the EFI and UFS filesystems
+ chroot ${CHROOTDIR} newfs_msdos -L efi -F ${FAT_TYPE} /dev/${mddev}${EFIPART_SUFFIX}
+ chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}${ROOTFSPART_SUFFIX}
+
return 0
}
@@ -171,12 +174,7 @@
}
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}
- fi
+ chroot ${CHROOTDIR} mount /dev/${mddev}${ROOTFSPART_SUFFIX} ${DESTDIR}
_OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U)
REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION)
BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH)
@@ -230,14 +228,8 @@
FATMOUNT="${DESTDIR%${KERNEL}}/fat"
UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
- if [ "${PART_SCHEME}" = "GPT" ]; then
- dospart="/dev/${mddev}p1"
- ufspart="/dev/${mddev}p2"
- fi
- if [ "${PART_SCHEME}" = "MBR" ]; then
- dospart="/dev/${mddev}s1"
- ufspart="/dev/${mddev}s2a"
- fi
+ dospart="/dev/${mddev}${EFIPART_SUFFIX}"
+ ufspart="/dev/${mddev}${ROOTFSPART_SUFFIX}"
chroot ${CHROOTDIR} mount_msdosfs ${dospart} ${FATMOUNT}
chroot ${CHROOTDIR} mount ${ufspart} ${UFSMOUNT}
@@ -271,3 +263,20 @@
arm_do_quirk() {
# Override in the ${EMBEDDED_TARGET}/${BOARDNAME}.conf file.
}
+
+arm_create_partitions() {
+ # Override in the ${EMBEDDED_TARGET}/${BOARDNAME}.conf file.
+
+ # Set defaults for EFIPART_SUFFIX, ROOTFSPART_SUFFIX, and
+ # BSDLABEL_SUFFIX (MBR only), needed elsewhere.
+
+ if [ "${PART_SCHEME}" = "GPT" ]; then
+ export EFIPART_SUFFIX=p1
+ export ROOTFSPART_SUFFIX=p2
+ fi
+ if [ "${PART_SCHEME}" = "MBR" ]; then
+ export EFIPART_SUFFIX=s1
+ export BSDLABEL_SUFFIX=s2
+ export ROOTFSPART_SUFFIX=s2a
+ fi
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 5:21 AM (19 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15750698
Default Alt Text
D43848.diff (3 KB)
Attached To
Mode
D43848: release: make SD card partition layout more flexible
Attached
Detach File
Event Timeline
Log In to Comment