summaryrefslogtreecommitdiff
path: root/distrib/armv7/miniroot
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2013-10-28 14:10:42 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2013-10-28 14:10:42 +0000
commit29950e68ba62c0161f7c7354372b8f0250503d15 (patch)
treed38cab96e8bff21968c1096becc7dab5b38f66f1 /distrib/armv7/miniroot
parent49b356009bae2f694c9103265b773244aa779ac6 (diff)
Revamp ARMv7 ramdisk and miniroot creation process.
Instead of running mkuboot during install, we call it on during the release build, so that we can also ship bootable images of the generic and the ramdisk kernel. We can now build miniroots for imx, too. The installer also can recognize the SoC and makes decision based on it. Use ext2fs for i.MX6 based devices. Tar the bootloader files to save some space. ok syl@
Diffstat (limited to 'distrib/armv7/miniroot')
-rw-r--r--distrib/armv7/miniroot/Makefile2
-rw-r--r--distrib/armv7/miniroot/Makefile.inc27
-rw-r--r--distrib/armv7/miniroot/am335x/Makefile2
-rw-r--r--distrib/armv7/miniroot/beagle/Makefile2
-rw-r--r--distrib/armv7/miniroot/imx/Makefile7
-rw-r--r--distrib/armv7/miniroot/panda/Makefile2
6 files changed, 36 insertions, 6 deletions
diff --git a/distrib/armv7/miniroot/Makefile b/distrib/armv7/miniroot/Makefile
index 98abfe080b5..c024f558e46 100644
--- a/distrib/armv7/miniroot/Makefile
+++ b/distrib/armv7/miniroot/Makefile
@@ -1,3 +1,3 @@
-SUBDIR= am335x beagle panda
+SUBDIR= am335x beagle panda imx
.include <bsd.subdir.mk>
diff --git a/distrib/armv7/miniroot/Makefile.inc b/distrib/armv7/miniroot/Makefile.inc
index 018ed3b257f..9e9b141607f 100644
--- a/distrib/armv7/miniroot/Makefile.inc
+++ b/distrib/armv7/miniroot/Makefile.inc
@@ -3,6 +3,7 @@ REV= ${OSrev}
BSD_RD= bsd.rd.OMAP
IMAGE= miniroot-${BOARD}-${REV}.fs
+MKUBOOT?= mkuboot
MOUNT_POINT= /mnt
@@ -17,6 +18,15 @@ PID!= echo $$$$
NBLKS= 36864
+FS?= msdos
+PART_ID?=C
+
+NEWFS_ARGS_msdos=-F 16 -L boot
+NEWFS_ARGS_ext2fs=-v boot
+
+cleandir: clean
+clean:
+ rm -f ${IMAGE}
.ifndef DESTDIR
all ${IMAGE}:
@@ -30,20 +40,27 @@ ${IMAGE}: rd_setup do_files rd_teardown
.endif
do_files:
- echo 'bootcmd=mmc rescan ; setenv loadaddr 0x82800000 ; setenv bootargs sd0i:/bsd.umg ; fatload mmc 0 $${loadaddr} bsd.umg ; bootm $${loadaddr} ;\nuenvcmd=boot' > ${MOUNT_POINT}/uenv.txt
+.if ${PLATFORM} == "OMAP"
cp /usr/mdec/${BOARD}/mlo ${MOUNT_POINT}/mlo
+ echo "bootcmd=mmc rescan ; setenv loadaddr ${LOADADDR} ; setenv bootargs sd0i:/bsd.umg ; fatload mmc 0 \$${loadaddr} bsd.umg ; bootm \$${loadaddr} ;\nuenvcmd=boot" > ${MOUNT_POINT}/uenv.txt
cp /usr/mdec/${BOARD}/u-boot.* ${MOUNT_POINT}/
mkdir ${MOUNT_POINT}/u-boots
cp -r /usr/mdec/{am335x,beagle,panda} ${MOUNT_POINT}/u-boots
- mkuboot -a arm -o linux -e 0x80300000 -l 0x80300000 \
- ${.OBJDIR}/../../ramdisk/bsd.rd.OMAP ${MOUNT_POINT}/bsd.umg
+.endif
+.if ${PLATFORM} == "IMX"
+ echo "; setenv loadaddr ${LOADADDR} ; setenv bootargs sd0i:/bsd.umg ; for dtype in sata mmc ; do for disk in 0 1 ; do \$${dtype} dev \$${disk} ; for fs in fat ext2 ; do if \$${fs}load \$${dtype} \$${disk}:1 \$${loadaddr} bsd.umg ; then bootm \$${loadaddr} ; fi ; done; done; done; echo; echo failed to load bsd.umg" > 6x_bootscript.cmd
+ ${MKUBOOT} -t script -a arm -o linux 6x_bootscript.cmd 6x_bootscript.scr
+ cp 6x_bootscript.scr ${MOUNT_POINT}/6x_bootscript
+
+.endif
+ cp ${.OBJDIR}/../../ramdisk/bsd.rd.${PLATFORM}.umg ${MOUNT_POINT}/bsd.umg
rd_setup:
dd if=/dev/zero of=${IMAGE} bs=512 count=${NBLKS}
vnconfig -c ${VND} ${IMAGE}
fdisk -c 2 -h 255 -s 63 -yi ${VND} >/dev/null
- echo 'u\ne 0\nC\ny\n0\n1\n1\n1\n254\n63\nf 0\nw\nq\n' | fdisk -c 2 -h 255 -s 63 -e ${VND} >/dev/null
- newfs_msdos -F 16 -L boot ${VND_RIDEV} >/dev/null
+ echo "u\ne 0\n${PART_ID}\ny\n0\n1\n1\n1\n254\n63\nf 0\nw\nq\n" | fdisk -c 2 -h 255 -s 63 -e ${VND} >/dev/null
+ newfs_${FS} ${NEWFS_ARGS_${FS}} ${VND_RIDEV} >/dev/null
mount ${VND_IDEV} ${MOUNT_POINT}
rd_teardown:
diff --git a/distrib/armv7/miniroot/am335x/Makefile b/distrib/armv7/miniroot/am335x/Makefile
index 58a8892a8c1..3abba971a24 100644
--- a/distrib/armv7/miniroot/am335x/Makefile
+++ b/distrib/armv7/miniroot/am335x/Makefile
@@ -1,3 +1,5 @@
BOARD= am335x
+PLATFORM=OMAP
+LOADADDR=0x82800000
.include "${.CURDIR}/../Makefile.inc"
diff --git a/distrib/armv7/miniroot/beagle/Makefile b/distrib/armv7/miniroot/beagle/Makefile
index eb3c36bdb58..e4eb94dc34b 100644
--- a/distrib/armv7/miniroot/beagle/Makefile
+++ b/distrib/armv7/miniroot/beagle/Makefile
@@ -1,3 +1,5 @@
BOARD= beagle
+PLATFORM=OMAP
+LOADADDR=0x82800000
.include "${.CURDIR}/../Makefile.inc"
diff --git a/distrib/armv7/miniroot/imx/Makefile b/distrib/armv7/miniroot/imx/Makefile
new file mode 100644
index 00000000000..8984070e9b1
--- /dev/null
+++ b/distrib/armv7/miniroot/imx/Makefile
@@ -0,0 +1,7 @@
+BOARD= imx
+PLATFORM=IMX
+LOADADDR=0x18800000
+FS=ext2fs
+PART_ID=83
+
+.include "${.CURDIR}/../Makefile.inc"
diff --git a/distrib/armv7/miniroot/panda/Makefile b/distrib/armv7/miniroot/panda/Makefile
index a9626bfb717..c8ed3fdd097 100644
--- a/distrib/armv7/miniroot/panda/Makefile
+++ b/distrib/armv7/miniroot/panda/Makefile
@@ -1,3 +1,5 @@
BOARD= panda
+PLATFORM=OMAP
+LOADADDR=0x82800000
.include "${.CURDIR}/../Makefile.inc"