@ -7,37 +7,49 @@ include $(INCLUDE_DIR)/image.mk
DEVICE_VARS += IMAGE_SIZE DTB_SIZE
DEVICE_VARS += IMAGE_SIZE DTB_SIZE
d e f i n e D e v i c e / D e f a u l t
d e f i n e B u i l d / b o o t - i m g
PROFILES := Default
$( RM) -rf $@ .bootdir
KERNEL_DEPENDS = $$ ( wildcard ../dts/$$ ( DEVICE_DTS) .dts)
mkdir -p $@ .bootdir/boot
DEVICE_DTS :=
KERNEL_ENTRY := 0x00000000
$( CP) $@ .scr $@ .bootdir/boot/boot.scr
KERNEL_LOADADDR := 0x00000000
$( CP) $( IMAGE_KERNEL) .dtb $@ .bootdir/boot/$( DEVICE_DTB)
DEVICE_DTS_DIR := ../dts
$( CP) $( IMAGE_KERNEL) $@ .bootdir/boot/uImage
SUPPORTED_DEVICES = $( subst _,$( comma) ,$( 1) )
genext2fs --block-size $( BLOCKSIZE:%k= %Ki) --size-in-blocks $$ ( ( 1024 * $( BOOT_SIZE) ) ) --root $@ .bootdir $@ .boot
# convert it to revision 1 - needed for u-boot ext2load
$( STAGING_DIR_HOST) /bin/tune2fs -O filetype $@ .boot
$( STAGING_DIR_HOST) /bin/e2fsck -pDf $@ .boot > /dev/null
e n d e f
e n d e f
d e f i n e B u i l d / d t b
d e f i n e B u i l d / b o o t - s c r i p t
$( call Image/BuildDTB,../dts/$( DEVICE_DTS) .dts,$@ .dtb,,--space $( DTB_SIZE) )
$( STAGING_DIR_HOST) /bin/mkimage -A powerpc -T script -C none -n " $( PROFILE) Boot Script " \
-d mbl_boot.scr \
$@ .scr
e n d e f
e n d e f
d e f i n e B u i l d / p r e p e n d - d t b
d e f i n e B u i l d / c o p y - f i l e
cat " $@ .dtb.uimage " " $@ " > " $@ .new "
cat " $( 1) " > " $@ "
mv " $@ .new " " $@ "
e n d e f
e n d e f
d e f i n e B u i l d / e x p o r t - d t b
d e f i n e B u i l d / c r e a t e - u I m a g e - d t b
cp $( IMAGE_KERNEL) .dtb $@
# flat_dt target expect FIT image - which WNDR4700's uboot doesn't support
-$( STAGING_DIR_HOST) /bin/mkimage -A $( LINUX_KARCH) \
-O linux -T kernel -C none \
-n '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' \
-d " $@ .dtb " " $@ .dtb.uimage "
e n d e f
e n d e f
i f e q ( $( SUBTARGET ) , n a n d )
d e f i n e B u i l d / d t b
$( call Image/BuildDTB,../dts/$( DEVICE_DTS) .dts,$@ .dtb,,--space $( DTB_SIZE) )
e n d e f
d e f i n e I m a g e / c p i o g z
d e f i n e B u i l d / e x p o r t - d t b
( cd $( TARGET_DIR) ; find . | cpio -o -H newc | gzip -9n >$( KDIR_TMP) /$( IMG_PREFIX) -rootfs.cpio.gz )
cp $( IMAGE_KERNEL) .dtb $@
e n d e f
e n d e f
d e f i n e B u i l d / c o p y - f i l e
d e f i n e B u i l d / h d d - i m g
cat " $( 1) " > " $@ "
./mbl_gen_hdd_img.sh $@ $@ .boot $( IMAGE_ROOTFS) $( BOOT_SIZE) $( CONFIG_TARGET_ROOTFS_PARTSIZE)
e n d e f
e n d e f
d e f i n e B u i l d / M e r a k i A d d - d t b
d e f i n e B u i l d / M e r a k i A d d - d t b
@ -72,6 +84,56 @@ define Build/MerakiNAND
@cp $@ .new $@
@cp $@ .new $@
e n d e f
e n d e f
d e f i n e B u i l d / M u I m a g e - i n i t r a m f s
rm -rf $@ .fakerd $@ .new
dd if = /dev/zero of = $@ .fakerd bs = 32 count = 1 conv = sync
# Netgear used an old uboot that doesn't have FIT support.
# So we are stuck with either a full ext2/4 fs in a initrd.
# ... or we try to make the "multi" image approach to work
# for us.
#
# Sadly, the "multi" image has to consists of three
# "fixed" parts in the following "fixed" order:
# 1. The kernel which is in $@
# 2. The (fake) initrd which is in $@.fakerd
# 3. The device tree binary which is in $@.dtb
#
# Now, given that we use the function for the kernel which
# already has a initramfs image inside, we still have to
# add a "fake" initrd (which a mkimage header) in the second
# part of the legacy multi image. Since we need to put the
# device tree stuff into part 3.
-$( STAGING_DIR_HOST) /bin/mkimage -A $( LINUX_KARCH) -O linux -T multi \
-C $( 1) -a $( KERNEL_LOADADDR) -e $( KERNEL_ENTRY) \
-n '$(BOARD_NAME) initramfs' -d $@ :$@ .fakerd:$@ .dtb $@ .new
mv $@ .new $@
rm -rf $@ .fakerd
e n d e f
d e f i n e B u i l d / p r e p e n d - d t b
cat " $@ .dtb.uimage " " $@ " > " $@ .new "
mv " $@ .new " " $@ "
e n d e f
d e f i n e I m a g e / c p i o g z
( cd $( TARGET_DIR) ; find . | cpio -o -H newc | gzip -9n >$( KDIR_TMP) /$( IMG_PREFIX) -rootfs.cpio.gz )
e n d e f
d e f i n e D e v i c e / D e f a u l t
PROFILES := Default
KERNEL_DEPENDS = $$ ( wildcard ../dts/$$ ( DEVICE_DTS) .dts)
DEVICE_DTS :=
KERNEL_ENTRY := 0x00000000
KERNEL_LOADADDR := 0x00000000
DEVICE_DTS_DIR := ../dts
SUPPORTED_DEVICES = $( subst _,$( comma) ,$( 1) )
e n d e f
i f e q ( $( SUBTARGET ) , n a n d )
d e f i n e D e v i c e / m e r a k i _ m r 2 4
d e f i n e D e v i c e / m e r a k i _ m r 2 4
DEVICE_TITLE := Cisco Meraki MR24
DEVICE_TITLE := Cisco Meraki MR24
DEVICE_PACKAGES := kmod-spi-gpio -swconfig
DEVICE_PACKAGES := kmod-spi-gpio -swconfig
@ -115,43 +177,6 @@ define Device/meraki_mx60
e n d e f
e n d e f
TARGET_DEVICES += meraki_mx60
TARGET_DEVICES += meraki_mx60
d e f i n e B u i l d / c r e a t e - u I m a g e - d t b
# flat_dt target expect FIT image - which WNDR4700's uboot doesn't support
-$( STAGING_DIR_HOST) /bin/mkimage -A $( LINUX_KARCH) \
-O linux -T kernel -C none \
-n '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' \
-d " $@ .dtb " " $@ .dtb.uimage "
e n d e f
d e f i n e B u i l d / M u I m a g e - i n i t r a m f s
rm -rf $@ .fakerd $@ .new
dd if = /dev/zero of = $@ .fakerd bs = 32 count = 1 conv = sync
# Netgear used an old uboot that doesn't have FIT support.
# So we are stuck with either a full ext2/4 fs in a initrd.
# ... or we try to make the "multi" image approach to work
# for us.
#
# Sadly, the "multi" image has to consists of three
# "fixed" parts in the following "fixed" order:
# 1. The kernel which is in $@
# 2. The (fake) initrd which is in $@.fakerd
# 3. The device tree binary which is in $@.dtb
#
# Now, given that we use the function for the kernel which
# already has a initramfs image inside, we still have to
# add a "fake" initrd (which a mkimage header) in the second
# part of the legacy multi image. Since we need to put the
# device tree stuff into part 3.
-$( STAGING_DIR_HOST) /bin/mkimage -A $( LINUX_KARCH) -O linux -T multi \
-C $( 1) -a $( KERNEL_LOADADDR) -e $( KERNEL_ENTRY) \
-n '$(BOARD_NAME) initramfs' -d $@ :$@ .fakerd:$@ .dtb $@ .new
mv $@ .new $@
rm -rf $@ .fakerd
e n d e f
d e f i n e D e v i c e / n e t g e a r _ w n d a p 6 x 0
d e f i n e D e v i c e / n e t g e a r _ w n d a p 6 x 0
DEVICE_PACKAGES := kmod-eeprom-at24
DEVICE_PACKAGES := kmod-eeprom-at24
SUBPAGESIZE := 256
SUBPAGESIZE := 256
@ -217,32 +242,6 @@ endif
i f e q ( $( SUBTARGET ) , s a t a )
i f e q ( $( SUBTARGET ) , s a t a )
### Image scripts for the WD My Book Live Series ###
d e f i n e B u i l d / b o o t - s c r i p t
$( STAGING_DIR_HOST) /bin/mkimage -A powerpc -T script -C none -n " $( PROFILE) Boot Script " \
-d mbl_boot.scr \
$@ .scr
e n d e f
d e f i n e B u i l d / b o o t - i m g
$( RM) -rf $@ .bootdir
mkdir -p $@ .bootdir/boot
$( CP) $@ .scr $@ .bootdir/boot/boot.scr
$( CP) $( IMAGE_KERNEL) .dtb $@ .bootdir/boot/$( DEVICE_DTB)
$( CP) $( IMAGE_KERNEL) $@ .bootdir/boot/uImage
genext2fs --block-size $( BLOCKSIZE:%k= %Ki) --size-in-blocks $$ ( ( 1024 * $( BOOT_SIZE) ) ) --root $@ .bootdir $@ .boot
# convert it to revision 1 - needed for u-boot ext2load
$( STAGING_DIR_HOST) /bin/tune2fs -O filetype $@ .boot
$( STAGING_DIR_HOST) /bin/e2fsck -pDf $@ .boot > /dev/null
e n d e f
d e f i n e B u i l d / h d d - i m g
./mbl_gen_hdd_img.sh $@ $@ .boot $( IMAGE_ROOTFS) $( BOOT_SIZE) $( CONFIG_TARGET_ROOTFS_PARTSIZE)
e n d e f
d e f i n e D e v i c e / w d _ m y b o o k l i v e
d e f i n e D e v i c e / w d _ m y b o o k l i v e
DEVICE_TITLE := Western Digital My Book Live Series ( Single + Duo)
DEVICE_TITLE := Western Digital My Book Live Series ( Single + Duo)
DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic
DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic