diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2016-10-07 20:29:03 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-10-13 17:04:33 +0200 |
commit | 4fc48a8cf29bfc6997384c2aa4c72d0b9e6b3313 (patch) | |
tree | b49d3debdbb0655c8937c9ecba37f09fae73c4a8 /target/linux/apm821xx/image | |
parent | 4104613fae1ebf958cd5957aa336e1b3e53497bb (diff) | |
download | mtk-20170518-4fc48a8cf29bfc6997384c2aa4c72d0b9e6b3313.zip mtk-20170518-4fc48a8cf29bfc6997384c2aa4c72d0b9e6b3313.tar.gz mtk-20170518-4fc48a8cf29bfc6997384c2aa4c72d0b9e6b3313.tar.bz2 |
apm821xx: replace recovery image for the MBL with initramfs
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 <chunkeey@gmail.com>
Diffstat (limited to 'target/linux/apm821xx/image')
-rw-r--r-- | target/linux/apm821xx/image/Makefile | 22 | ||||
-rw-r--r-- | target/linux/apm821xx/image/mbl_gen_recovery_tar.sh | 92 |
2 files changed, 2 insertions, 112 deletions
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 |