Commit 9510093c04f474171ecdaf834ee9933f693f8c33
1 parent
3130d44168
Exists in
master
and in
2 other branches
= Fusing SD 관련 추가
Showing
4 changed files
with
367 additions
and
1 deletions
Show diff stats
bootloader/u-boot_2015_04/include/configs/mx6s_prime_oven.h
... | ... | @@ -241,7 +241,7 @@ |
241 | 241 | "fi; " \ |
242 | 242 | "bootm 0x12000000 - 0x11F00000; \0" \ |
243 | 243 | "bootload_fw=mmc dev 1; mmc read 0x11F00000 2C00 100; mmc read 0x12000000 3000 3800; mmc read 0x1E000000 7000 20000; bootm 0x12000000 - 0x11F00000; \0" \ |
244 | - "fw=env default -a; saveenv; setenv mmcdev 1; run bootcmd_fw; run bootcmd_fw; \0" \" \ | |
244 | + "fw=env default -a; saveenv; setenv mmcdev 1; setenv bootargs_ram ${bootargs_ram} fusing=1; run bootcmd_fw; run bootcmd_fw; \0" \" \ | |
245 | 245 | "bootcmd_fw=run bootargs_ram bootload_fw \0" \ |
246 | 246 | "bootcmd=run bootargs_mmc bootload\0" |
247 | 247 | ... | ... |
buildroot/buildroot-2016.08.1/board/falinux/prime_oven/rootfs_overlay/etc/init.d/S83fusing
... | ... | @@ -0,0 +1,42 @@ |
1 | +#!/bin/sh | |
2 | + | |
3 | +TOOL_PATH="/root/.falinux" | |
4 | + | |
5 | +start() { | |
6 | + echo "## Start Boot Img eMMC Fusing ##" | |
7 | + | |
8 | + # Start Boot Img eMMC Fusing Mode | |
9 | + FUSING=$(cmd_parsing fusing $CMDLINE) | |
10 | + if [ "$FUSING" != "" ]; then | |
11 | + # Run Fusing | |
12 | + ${TOOL_PATH}/mk-emmc-fusing.sh | |
13 | + else | |
14 | + # Check First Boot | |
15 | + if [ ! -f "${TOOL_PATH}/.complete" ]; then | |
16 | + echo "Run JIG Script" | |
17 | + | |
18 | + fi | |
19 | + fi | |
20 | +} | |
21 | + | |
22 | +stop() { | |
23 | + echo "OK" | |
24 | +} | |
25 | + | |
26 | +case "$1" in | |
27 | + start) | |
28 | + start | |
29 | + ;; | |
30 | + stop) | |
31 | + stop | |
32 | + ;; | |
33 | + restart|reload) | |
34 | + restart | |
35 | + ;; | |
36 | + *) | |
37 | + echo "Usage: $0 {start|stop|restart}" | |
38 | + exit 1 | |
39 | +esac | |
40 | + | |
41 | +exit $? | |
42 | + | ... | ... |
buildroot/buildroot-2016.08.1/board/falinux/prime_oven/rootfs_overlay/root/.falinux/mk-emmc-fusing.sh
... | ... | @@ -0,0 +1,176 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +C_NC='\033[0m' | |
4 | +C_LRED='\033[1;31m' | |
5 | + | |
6 | + | |
7 | +EMMC_DEV_PATH="/dev/mmcblk3" | |
8 | +SD_DEV_PATH="/dev/mmcblk2" | |
9 | +PART1=p1 | |
10 | +PART2=p2 | |
11 | +PART3=p3 | |
12 | +PART4=p4 | |
13 | + | |
14 | +FNAME_UBOOT="u-boot.imx" | |
15 | +FNAME_LOGO="init.bmp" | |
16 | +FNAME_DTB="imx6s-prime-oven.dtb" | |
17 | +FNAME_KERNEL="uImage" | |
18 | +FNAME_FS128="ramdisk-prime_oven-128M.gz" | |
19 | +FNAME_FS64="ramdisk-prime_oven-64M.gz" | |
20 | +FNAME_RFS="rootfs.tar" | |
21 | + | |
22 | +SD_MOUNT_PATH_P1="/tmp/mmcblk2p1" | |
23 | +EMMC_MOUNT_PATH_P1="/tmp/mmcblk3p1" | |
24 | +EMMC_MOUNT_PATH_P2="/tmp/mmcblk3p2" | |
25 | + | |
26 | +function Init_Unmount() | |
27 | +{ | |
28 | + echo "" | |
29 | + echo -e "${C_LRED}### UnMount - Init_Unmount() ### ${C_NC}" | |
30 | + echo "" | |
31 | + umount ${EMMC_DEV_PATH}${PART1} | |
32 | + umount ${EMMC_DEV_PATH}${PART2} | |
33 | + umount ${EMMC_DEV_PATH}${PART3} | |
34 | + umount ${EMMC_DEV_PATH}${PART4} | |
35 | + umount ${SD_DEV_PATH}${PART1} | |
36 | + umount ${SD_DEV_PATH}${PART2} | |
37 | +} | |
38 | + | |
39 | +function create_partition() | |
40 | +{ | |
41 | + echo "" | |
42 | + echo -e "${C_LRED}### Fdisk Create Partition - create_partition() ###${C_NC}" | |
43 | + echo "" | |
44 | + fdisk ${EMMC_DEV_PATH} << EOF | |
45 | + o | |
46 | + n | |
47 | + p | |
48 | + 1 | |
49 | + 4096 | |
50 | + 8191 | |
51 | + n | |
52 | + p | |
53 | + 2 | |
54 | + 8192 | |
55 | + 16383 | |
56 | + n | |
57 | + p | |
58 | + 3 | |
59 | + 16384 | |
60 | + 32767 | |
61 | + n | |
62 | + p | |
63 | + 32768 | |
64 | + | |
65 | + p | |
66 | + w | |
67 | +EOF | |
68 | +} | |
69 | + | |
70 | +function run_format() | |
71 | +{ | |
72 | + echo "" | |
73 | + echo -e "${C_LRED}### Format eMMC - run_format() ###${C_NC}" | |
74 | + echo "" | |
75 | + mkfs.ext3 -F ${EMMC_DEV_PATH}${PART1} -L BOOT0 | |
76 | + mkfs.ext4 -j -F ${EMMC_DEV_PATH}${PART2} -L SYSTEM | |
77 | + mkfs.ext4 -j -F ${EMMC_DEV_PATH}${PART3} -L FALINUX | |
78 | + mkfs.ext4 -j -F ${EMMC_DEV_PATH}${PART4} -L PRIME | |
79 | +} | |
80 | + | |
81 | +function run_mount() | |
82 | +{ | |
83 | + echo "" | |
84 | + echo -e "${C_LRED}### Mount SD/eMMC - run_mount() ###${C_NC}" | |
85 | + echo "" | |
86 | + | |
87 | + if [ ! -d ${SD_MOUNT_PATH_P1} ]; then | |
88 | + mkdir ${SD_MOUNT_PATH_P1} | |
89 | + fi | |
90 | + | |
91 | + if [ ! -d ${EMMC_MOUNT_PATH_P1} ]; then | |
92 | + mkdir ${EMMC_MOUNT_PATH_P1} | |
93 | + fi | |
94 | + | |
95 | + if [ ! -d ${EMMC_MOUNT_PATH_P2} ]; then | |
96 | + mkdir ${EMMC_MOUNT_PATH_P2} | |
97 | + fi | |
98 | + | |
99 | + mount -t ext4 ${SD_DEV_PATH}${PART1} ${SD_MOUNT_PATH_P1} | |
100 | + mount -t ext3 ${EMMC_DEV_PATH}${PART1} ${EMMC_MOUNT_PATH_P1} | |
101 | + mount -t ext4 ${EMMC_DEV_PATH}${PART2} ${EMMC_MOUNT_PATH_P2} | |
102 | +} | |
103 | + | |
104 | +function run_copy_image() | |
105 | +{ | |
106 | + echo "" | |
107 | + echo -e "${C_LRED}### Write SD Boot Image - run_copy_image() ###${C_NC}" | |
108 | + echo "" | |
109 | + | |
110 | + if [ ! -d ${EMMC_MOUNT_PATH_P1}/boot ]; then | |
111 | + mkdir ${EMMC_MOUNT_PATH_P1}/boot | |
112 | + fi | |
113 | + | |
114 | + cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_UBOOT} ${EMMC_MOUNT_PATH_P1}/boot/ | |
115 | + cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_LOGO} ${EMMC_MOUNT_PATH_P1}/boot/ | |
116 | + cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_DTB} ${EMMC_MOUNT_PATH_P1}/boot/ | |
117 | + cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_KERNEL} ${EMMC_MOUNT_PATH_P1}/boot/ | |
118 | + cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_FS128} ${EMMC_MOUNT_PATH_P1}/boot/ | |
119 | + run_copy_rootfs | |
120 | + sleep 1 | |
121 | + sync | |
122 | +} | |
123 | + | |
124 | +function run_copy_rootfs() | |
125 | +{ | |
126 | + echo "" | |
127 | + echo -e "${C_LRED}### Make MMC Filesystem ###${C_NC}" | |
128 | + echo "" | |
129 | + | |
130 | + tar -xf ${SD_MOUNT_PATH_P1}/boot/${FNAME_RFS} -C ${EMMC_MOUNT_PATH_P2} | |
131 | + | |
132 | + cp /etc/ssh/ssh_host_ed25519_key ${EMMC_MOUNT_PATH_P2}/etc/ssh/ | |
133 | +} | |
134 | + | |
135 | +function run_raw_write() | |
136 | +{ | |
137 | + echo "" | |
138 | + echo -e "${C_LRED}### Write SD Boot Image to RAW - run_raw_write() ###${C_NC}" | |
139 | + echo "" | |
140 | + dd if=${SD_MOUNT_PATH_P1}/boot/${FNAME_UBOOT} of=${EMMC_DEV_PATH} bs=512 seek=2 | |
141 | + dd if=${SD_MOUNT_PATH_P1}/boot/${FNAME_LOGO} of=${EMMC_DEV_PATH} bs=512 seek=2048 | |
142 | + dd if=${SD_MOUNT_PATH_P1}/boot/${FNAME_DTB} of=${EMMC_DEV_PATH} bs=512 seek=11264 | |
143 | + dd if=${SD_MOUNT_PATH_P1}/boot/${FNAME_KERNEL} of=${EMMC_DEV_PATH} bs=512 seek=12288 | |
144 | + dd if=${SD_MOUNT_PATH_P1}/boot/${FNAME_FS128} of=${EMMC_DEV_PATH} bs=512 seek=28672 | |
145 | +# dd if=./$FNAME_FS64 of=$EMMC_DEV_PATH bs=512 seek=28672 | |
146 | + sleep 1 | |
147 | + sync | |
148 | +} | |
149 | + | |
150 | +function run_umount() | |
151 | +{ | |
152 | + echo "" | |
153 | + echo -e "${C_LRED}### UnMount - run_umount() ###${C_NC}" | |
154 | + echo "" | |
155 | + umount ${SD_MOUNT_PATH_P1} | |
156 | + umount ${EMMC_MOUNT_PATH_P1} | |
157 | + umount ${EMMC_MOUNT_PATH_P2} | |
158 | +} | |
159 | + | |
160 | + | |
161 | +function main() | |
162 | +{ | |
163 | + echo "" | |
164 | + echo -e "${C_LRED}#### Start - main() ####${C_NC}" | |
165 | + echo "" | |
166 | + | |
167 | + Init_Unmount | |
168 | + create_partition | |
169 | + run_format | |
170 | + run_mount | |
171 | + run_copy_image | |
172 | + run_raw_write | |
173 | + run_umount | |
174 | +} | |
175 | + | |
176 | +main | ... | ... |
release/mk-fusingsd.sh
... | ... | @@ -0,0 +1,148 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +C_NC='\033[0m' | |
4 | +C_LRED='\033[1;31m' | |
5 | + | |
6 | +DEVNAME="mmcblk0" | |
7 | +DEV_PATH="/dev/mmcblk0" | |
8 | +DEV_PATH_P1="/dev/mmcblk0p1" | |
9 | +INPUT="/tmp/input" | |
10 | + | |
11 | +FNAME_UBOOT="u-boot.imx" | |
12 | +FNAME_LOGO="init.bmp" | |
13 | +FNAME_DTB="imx6s-prime-oven.dtb" | |
14 | +FNAME_KERNEL="uImage" | |
15 | +FNAME_FS128="ramdisk-prime_oven-128M.gz" | |
16 | +FNAME_FS64="ramdisk-prime_oven-64M.gz" | |
17 | +FNAME_RFS="rootfs.tar" | |
18 | + | |
19 | +MOUNT_PATH_P1="/tmp/mmcblk0p1" | |
20 | + | |
21 | + | |
22 | +function create_partition() | |
23 | +{ | |
24 | + echo "" | |
25 | + echo -e "${C_LRED}### Fdisk Create Partition - create_partition() ###${C_NC}" | |
26 | + echo "" | |
27 | + fdisk $DEV_PATH << EOF | |
28 | + o | |
29 | + n | |
30 | + p | |
31 | + 1 | |
32 | + 262144 | |
33 | + 1310719 | |
34 | + n | |
35 | + p | |
36 | + 2 | |
37 | + 1310720 | |
38 | + | |
39 | + p | |
40 | + w | |
41 | +EOF | |
42 | +} | |
43 | + | |
44 | +function run_format() | |
45 | +{ | |
46 | + echo "" | |
47 | + echo -e "${C_LRED}### Format SDCARD - run_format() ###${C_NC}" | |
48 | + echo "" | |
49 | + mkfs.ext4 ${DEV_PATH}p1 -L BOOT0 | |
50 | + mkfs.ext4 ${DEV_PATH}p2 -L DATA | |
51 | +} | |
52 | + | |
53 | +function run_mount() | |
54 | +{ | |
55 | + echo "" | |
56 | + echo -e "${C_LRED}### Mount SD - run_mount() ###${C_NC}" | |
57 | + echo "" | |
58 | + if [ ! -d ${MOUNT_PATH_P1} ]; then | |
59 | + mkdir ${MOUNT_PATH_P1} | |
60 | + fi | |
61 | + | |
62 | + mount ${DEV_PATH}p1 ${MOUNT_PATH_P1} | |
63 | +} | |
64 | + | |
65 | +function run_umount() | |
66 | +{ | |
67 | + echo "" | |
68 | + echo -e "${C_LRED}### UnMount - run_umount() ###${C_NC}" | |
69 | + echo "" | |
70 | + umount ${MOUNT_PATH_P1} | |
71 | +} | |
72 | + | |
73 | +function run_copy_image() | |
74 | +{ | |
75 | + # SD Boot Image(SD 카드 부팅용 이미지) | |
76 | + echo "" | |
77 | + echo -e "${C_LRED}### Write SD Boot Image - run_copy_image() ###${C_NC}" | |
78 | + echo "" | |
79 | + if [ ! -d ${MOUNT_PATH_P1}/boot ]; then | |
80 | + mkdir ${MOUNT_PATH_P1}/boot | |
81 | + fi | |
82 | + cp -v ./$FNAME_UBOOT ${MOUNT_PATH_P1}/boot/ | |
83 | + cp -v ./$FNAME_LOGO ${MOUNT_PATH_P1}/boot/ | |
84 | + cp -v ./$FNAME_DTB ${MOUNT_PATH_P1}/boot/ | |
85 | + cp -v ./$FNAME_KERNEL ${MOUNT_PATH_P1}/boot/ | |
86 | + cp -v ./$FNAME_FS128 ${MOUNT_PATH_P1}/boot/ | |
87 | + cp -v ./$FNAME_FS64 ${MOUNT_PATH_P1}/boot/ | |
88 | + cp -v ./$FNAME_RFS ${MOUNT_PATH_P1}/boot/ | |
89 | + sleep 1 | |
90 | + sync | |
91 | +} | |
92 | + | |
93 | +function run_raw_write() | |
94 | +{ | |
95 | + echo "" | |
96 | + echo -e "${C_LRED}### Write SD Boot Image to RAW - run_raw_write() ###${C_NC}" | |
97 | + echo "" | |
98 | + dd if=./$FNAME_UBOOT of=$DEV_PATH bs=512 seek=2 | |
99 | + dd if=./$FNAME_LOGO of=$DEV_PATH bs=512 seek=2048 | |
100 | + dd if=./$FNAME_DTB of=$DEV_PATH bs=512 seek=11264 | |
101 | + dd if=./$FNAME_KERNEL of=$DEV_PATH bs=512 seek=12288 | |
102 | + dd if=./$FNAME_FS128 of=$DEV_PATH bs=512 seek=28672 | |
103 | +# dd if=./$FNAME_FS64 of=$DEV_PATH bs=512 seek=28672 | |
104 | + sleep 1 | |
105 | + sync | |
106 | +} | |
107 | + | |
108 | +function Init_Unmount() | |
109 | +{ | |
110 | + echo "" | |
111 | + echo -e "${C_LRED}### Unmount SD - Init_Unmount() ###${C_NC}" | |
112 | + echo "" | |
113 | + umount $DEV_PATH_P1 | |
114 | +} | |
115 | + | |
116 | +function main() | |
117 | +{ | |
118 | + echo "" | |
119 | + echo -e "${C_LRED}#### Start - main() ####${C_NC}" | |
120 | + echo "" | |
121 | + Init_Unmount | |
122 | + create_partition | |
123 | + | |
124 | + run_format | |
125 | + run_mount | |
126 | + run_raw_write | |
127 | + run_copy_image | |
128 | + run_umount | |
129 | + sync | |
130 | +} | |
131 | + | |
132 | +if [ "$1" != "" ]; then | |
133 | + DEVNAME=$1 | |
134 | +fi | |
135 | + | |
136 | +DEV_PATH="/dev/${DEVNAME}" | |
137 | +DEV_PATH_P1="${DEV_PATH}p1" | |
138 | +MOUNT_PATH_P1="/tmp/${DEVNAME}p1" | |
139 | + | |
140 | +echo "" | |
141 | +echo "================================" | |
142 | +echo "DEV_Name: $DEVNAME" | |
143 | +echo "DEV_Path: $DEV_PATH" | |
144 | +echo "P1 MountPath: $MOUNT_PATH_P1" | |
145 | +echo "================================" | |
146 | +echo "" | |
147 | + | |
148 | +main | ... | ... |