mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 21:58:04 +00:00
c0ca9f90a8
Nothing here needs bash. Signed-off-by: Rosen Penev <rosenp@gmail.com> [add prefix to commit title] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
19 lines
531 B
Bash
Executable File
19 lines
531 B
Bash
Executable File
#!/bin/sh
|
|
|
|
OUTPUT_FILE=$1
|
|
KERNEL_FILE=$2
|
|
RECOVERY_FILE=$3
|
|
ROOTFS_FILE=$4
|
|
|
|
BS=512
|
|
|
|
#These to offsets are relative to the absolute location of the kernel on the mmc
|
|
#(0xA00), so their position in the image is -2560 blocks
|
|
RECOVERY_OFFSET=67072
|
|
ROOTFS_OFFSET=87552
|
|
|
|
dd bs="$BS" of="$OUTPUT_FILE" if="$KERNEL_FILE"
|
|
dd bs="$BS" of="$OUTPUT_FILE" if="$RECOVERY_FILE" seek="$RECOVERY_OFFSET"
|
|
dd bs="$BS" of="$OUTPUT_FILE" if="$ROOTFS_FILE" seek="$ROOTFS_OFFSET"
|
|
dd if=/dev/zero of="$OUTPUT_FILE" bs=128k count=1 oflag=append conv=notrunc
|