From patchwork Fri Oct 7 18:29:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 679698 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3srJ4q6fwJz9t0J for ; Sat, 8 Oct 2016 05:31:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=lLPEY0SL; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bsZtk-0002xC-Cj; Fri, 07 Oct 2016 18:29:32 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bsZte-0002qi-VF for lede-dev@lists.infradead.org; Fri, 07 Oct 2016 18:29:29 +0000 Received: by mail-wm0-x244.google.com with SMTP id i130so4131643wmg.0 for ; Fri, 07 Oct 2016 11:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:subject:date:message-id; bh=5tIijND7Ej43GXNDUH3yGSbR+gnQ9geR7C4d7LbAo/A=; b=lLPEY0SLR5dTSlZOPttIaqFwIT+1qXk7t0GDsxSeA8Ja/mXRHDFtoDFsrM7jkaTJNF iR4kAy+dKPHhl+NKD0KmC5sW0hdLQEIthErw7H2ZTMOzdafxS4sNyVi743OkAh+/05mt 8Rt17muQjw7+DwKmIKHO9sGfh4XwdXtdAbwnKSAo6Mv42vhPWc9HUwcIMfJHqojTwHYQ vsyjIjZpWvLlLabVr2kWO1Rwhp5d08Dibw7l7K5aYui74TOahdXXMIVULi8G0N7C4pnl sqaO0+JVe61o17MscGtRriiOopAgqCByvDdC9cas0s/EIDQ3hQh1xtUQYUXBoPbEmxq8 O0hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=5tIijND7Ej43GXNDUH3yGSbR+gnQ9geR7C4d7LbAo/A=; b=H4e7aEtt779epDcw9vI83L/VurzEMZVlLu2TEQO3A2MaWbI7pmnAT/BZS344ZAYaFI fM7OH315NCVeDwNA4CZ5kw0xFpJCebm8IjskQsVdAXxnDQlSgHJzMnJ2SAn8wWDRRRdy JWNFyMB9JlIe98TQiAiU9L7Up6btLzAb2YFs/qnEtjhHH11QgOypbPddVTrPsO/CI0Lg Q0uahYf24Dc2qxNmV81n7s7w3vEhd8gNBEOLghJbZNNqAG2yzpz0plR8Q+46ku9REQhV MzHwR1cTlajHazdk/GZnUU+FM5LMlJ+E+D1H/kwmCoam+CfsblTOyOdK9gZz/O3tnFQW r8Jw== X-Gm-Message-State: AA6/9RnP9pNxBgYoEwe2qI9g0cYrLQUG8fFg+VAce80fX4tJhC86W41GALhEwkhNDfcTgg== X-Received: by 10.194.104.232 with SMTP id gh8mr18093218wjb.49.1475864945176; Fri, 07 Oct 2016 11:29:05 -0700 (PDT) Received: from debian64.daheim (pD9F8B6C7.dip0.t-ipconnect.de. [217.248.182.199]) by smtp.gmail.com with ESMTPSA id 193sm4203407wmo.14.2016.10.07.11.29.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Oct 2016 11:29:04 -0700 (PDT) From: Christian Lamparter X-Google-Original-From: Christian Lamparter Received: from chuck by debian64.daheim with local (Exim 4.87) (envelope-from ) id 1bsZtH-00066T-H9 for lede-dev@lists.infradead.org; Fri, 07 Oct 2016 20:29:03 +0200 To: lede-dev@lists.infradead.org Date: Fri, 7 Oct 2016 20:29:03 +0200 Message-Id: <20161007182903.23419-1-chunkeey@gmail.com> X-Mailer: git-send-email 2.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161007_112927_314868_E2B865D6 X-CRM114-Status: GOOD ( 10.55 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]googlemail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [PATCH] apm821xx: replace recovery image for the MBL with initramfs X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The patch "images: bump default rootfs size to 256 MB" a1f83bad606411a561e8e60110c71232b1a28aa2 caused a crash during boot for the recovery images. This is because both variants of the MyBook Live only have 256MB of RAM and for the recovery option, the ext4 rootfs was simply stored in the RAMDISK. This patch replaces recovery image for the MBL with an initramfs kernel. In order to boot the initramfs (for recovery or development): 0. copy the initramfs and device tree into tftp's server directory # cp *-initramfs-kernel.bin to /tftp-server/mbl.bin # cp *-ext4-kernel.dtb to /tftp-server/fdt.bin 1. Connect the MyBook Live (Duo) serial port. (Warning! Use a 3.3v level shifter). 2. Hit Enter during u-boot and insert these three lines: # setenv serverip 192.168.1.254; setenv ipaddr 192.168.1.1; # tftp ${kernel_addr_r} mbl.bin; tftp ${fdt_addr_r} fdt.bin # run addtty addmisc; bootm ${kernel_addr_r} - ${fdt_addr_r} Where 192.168.1.254 is your TFTP server. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/image/Makefile | 22 +----- .../linux/apm821xx/image/mbl_gen_recovery_tar.sh | 92 ---------------------- target/linux/apm821xx/sata/config-default | 5 -- target/linux/apm821xx/sata/target.mk | 2 +- 4 files changed, 3 insertions(+), 118 deletions(-) delete mode 100644 target/linux/apm821xx/image/mbl_gen_recovery_tar.sh diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 607df06..fb1705e 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -196,24 +196,6 @@ define Build/hdd-img $(if $(CONFIG_TARGET_IMAGES_GZIP),gzip -9n -c $@ > $(BIN_DIR)/$(notdir $@).gz) endef -define Build/uRamdisk - $(STAGING_DIR_HOST)/bin/mkimage \ - -A powerpc -T ramdisk -C gzip \ - -n "$(DEVICE_NAME) rootfs" \ - -d $@ $@.new - mv $@.new $@ -endef - -define Build/recovery-tar - sh ./mbl_gen_recovery_tar.sh \ - --profile $(DEVICE_PROFILE) \ - --dtb $(IMAGE_KERNEL).dtb \ - --dtbname $(DEVICE_DTB) \ - --kernel $(IMAGE_KERNEL) \ - --rootfs $@ \ - $@ -endef - define Build/export-dtb cp $(IMAGE_KERNEL).dtb $@ endef @@ -223,13 +205,13 @@ define Device/MyBookLiveDefault BLOCKSIZE := 1k DTB_SIZE := 16384 KERNEL := kernel-bin | dtb | gzip | uImage gzip + KERNEL_INITRAMFS := kernel-bin | dtb | gzip | uImage gzip BOOT_SIZE := 8 - IMAGES := rootfs.img recovery.tar kernel.dtb + IMAGES := rootfs.img kernel.dtb DEVICE_DTB := apollo3g.dtb FILESYSTEMS := ext4 IMAGE/kernel.dtb := export-dtb IMAGE/rootfs.img := boot-script | boot-img | hdd-img - IMAGE/recovery.tar := append-rootfs | gzip | uRamdisk | recovery-tar endef define Device/MyBookLiveSingle diff --git a/target/linux/apm821xx/image/mbl_gen_recovery_tar.sh b/target/linux/apm821xx/image/mbl_gen_recovery_tar.sh deleted file mode 100644 index f871aef..0000000 --- a/target/linux/apm821xx/image/mbl_gen_recovery_tar.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh - -# based on scripts/sysupgrade-nand.sh - -profile="" -dtb="" -dtbname="" -kernel="" -rootfs="" -outfile="" -err="" - -while [ "$1" ]; do - case "$1" in - "--profile") - profile="$2" - shift - shift - continue - ;; - "--dtb") - dtb="$2" - shift - shift - continue - ;; - "--dtbname") - dtbname="$2" - shift - shift - continue - ;; - "--kernel") - kernel="$2" - shift - shift - continue - ;; - "--rootfs") - rootfs="$2" - shift - shift - continue - ;; - *) - if [ ! "$outfile" ]; then - outfile=$1 - shift - continue - else - shift - continue - fi - ;; - esac -done - -if [ -z "$profile" -o ! -r "$dtb" -o ! -r "$kernel" -o ! -r "$rootfs" -o ! "$outfile" ]; then - echo "syntax: $0 [--profile profilename] [--dtb dtbimage] [--dtbname dtbname] [--kernel kernelimage] [--rootfs rootfs] out" - exit 1 -fi - -tmpdir="$( mktemp -d 2> /dev/null )" -if [ -z "$tmpdir" ]; then - # try OSX signature - tmpdir="$( mktemp -t 'roottmp' -d )" -fi - -if [ -z "$tmpdir" ]; then - exit 1 -fi - -mkdir -p "${tmpdir}/${profile}" -[ -z "${dtb}" ] || cp "${dtb}" "${tmpdir}/${profile}/${dtbname}" -[ -z "${rootfs}" ] || cp "${rootfs}" "${tmpdir}/${profile}/uRamdisk" -[ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/${profile}/uImage" - -mtime="" -if [ -n "$SOURCE_DATE_EPOCH" ]; then - mtime="--mtime=@${SOURCE_DATE_EPOCH}" -fi - -(cd "$tmpdir"; tar cvf ${profile}.tar ${profile} ${mtime}) -err="$?" -if [ -e "$tmpdir/${profile}.tar" ]; then - cp "$tmpdir/${profile}.tar" "$outfile" -else - err=2 -fi -rm -rf "$tmpdir" - -exit $err diff --git a/target/linux/apm821xx/sata/config-default b/target/linux/apm821xx/sata/config-default index 5abc105..b8342de 100644 --- a/target/linux/apm821xx/sata/config-default +++ b/target/linux/apm821xx/sata/config-default @@ -17,7 +17,6 @@ CONFIG_SATA_DWC=y CONFIG_EXT4_FS=y CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y -CONFIG_BLK_DEV_RAM=y CONFIG_GPIOLIB=y CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y @@ -26,9 +25,6 @@ CONFIG_LEDS_TRIGGER_DISK=y CONFIG_BLK_DEV_DM=y CONFIG_BLK_DEV_DM_BUILTIN=y CONFIG_BLK_DEV_MD=y -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_MD=y CONFIG_MD_AUTODETECT=y # CONFIG_MD_LINEAR is not set @@ -37,7 +33,6 @@ CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y # CONFIG_MD_RAID10 is not set # CONFIG_MD_RAID456 is not set -CONFIG_BLK_DEV_RAM_SIZE=50331648 CONFIG_PPC_EARLY_DEBUG=y CONFIG_PPC_EARLY_DEBUG_44x=y # CONFIG_PPC_EARLY_DEBUG_MEMCONS is not set diff --git a/target/linux/apm821xx/sata/target.mk b/target/linux/apm821xx/sata/target.mk index c652fe4..1c78568 100644 --- a/target/linux/apm821xx/sata/target.mk +++ b/target/linux/apm821xx/sata/target.mk @@ -1,5 +1,5 @@ BOARDNAME := Devices which boot from SATA (NAS) -FEATURES += ext4 usb +FEATURES += ext4 usb ramdisk DEFAULT_PACKAGES += badblocks block-mount e2fsprogs \ kmod-dm kmod-md-mod partx-utils