Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133112049
D4833.id12045.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4833.id12045.diff
View Options
Index: sys/boot/efi/boot1/Makefile
===================================================================
--- sys/boot/efi/boot1/Makefile
+++ sys/boot/efi/boot1/Makefile
@@ -79,8 +79,13 @@
# created by generate-fat.sh
.include "${.CURDIR}/Makefile.fat"
+BOOT1_MAXSIZE?= 65536
boot1.efifat: boot1.efi
+ if [ `cat boot1.efi | wc -c` -gt ${BOOT1_MAXSIZE} ]; then \
+ echo "boot1.efi too large"; \
+ exit 1; \
+ fi
echo ${.OBJDIR}
uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu
mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2
Index: sys/boot/efi/boot1/generate-fat.sh
===================================================================
--- sys/boot/efi/boot1/generate-fat.sh
+++ sys/boot/efi/boot1/generate-fat.sh
@@ -55,9 +55,20 @@
# Convert to number of blocks
BOOT1_OFFSET=$(echo 0x$BOOT1_OFFSET | awk '{printf("%x\n",$1/512);}')
+# Record maximum boot1 size in bytes
+case $BOOT1_SIZE in
+*k)
+ BOOT1_MAXSIZE=$(expr ${BOOT1_SIZE%k} '*' 1024)
+ ;;
+*)
+ BOOT1_MAXSIZE=$BOOT1_SIZE
+ ;;
+esac
+
echo '# This file autogenerated by generate-fat.sh - DO NOT EDIT' > Makefile.fat
echo '# $FreeBSD$' >> Makefile.fat
echo "BOOT1_OFFSET=0x$BOOT1_OFFSET" >> Makefile.fat
+echo "BOOT1_MAXSIZE=$BOOT1_MAXSIZE" >> Makefile.fat
bzip2 $OUTPUT_FILE
echo 'FAT template boot filesystem created by generate-fat.sh' > $OUTPUT_FILE.bz2.uu
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 24, 2:04 AM (3 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24113247
Default Alt Text
D4833.id12045.diff (1 KB)
Attached To
Mode
D4833: add safety belt check for boot1.efi file size
Attached
Detach File
Event Timeline
Log In to Comment