OpenWrt – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
4 | office | 1 | #!/usr/bin/env bash |
2 | # |
||
3 | # Copyright (C) 2013 OpenWrt.org |
||
4 | # |
||
5 | # This is free software, licensed under the GNU General Public License v2. |
||
6 | # See /LICENSE for more information. |
||
7 | # |
||
8 | |||
9 | set -ex |
||
10 | [ $# -eq 6 ] || { |
||
11 | echo "SYNTAX: $0 <file> <bootfs image> <rootfs image> <bootfs size> <rootfs size> <u-boot image>" |
||
12 | exit 1 |
||
13 | } |
||
14 | |||
15 | OUTPUT="$1" |
||
16 | BOOTFS="$2" |
||
17 | ROOTFS="$3" |
||
18 | BOOTFSSIZE="$4" |
||
19 | ROOTFSSIZE="$5" |
||
20 | UBOOT="$6" |
||
21 | |||
22 | head=4 |
||
23 | sect=63 |
||
24 | |||
25 | set `ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M` |
||
26 | |||
27 | BOOTOFFSET="$(($1 / 512))" |
||
28 | BOOTSIZE="$(($2 / 512))" |
||
29 | ROOTFSOFFSET="$(($3 / 512))" |
||
30 | ROOTFSSIZE="$(($4 / 512))" |
||
31 | |||
32 | dd bs=1024 if="$UBOOT" of="$OUTPUT" seek=8 conv=notrunc |
||
33 | dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc |
||
34 | dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc |