logo

한국어

OpenWRT 이미지 빌드

관리자 2014.06.03 18:19 조회 수 : 78

export KERNEL_SRC_DIR=/home/hasu0707/ib/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x
export ROOTFS_SRC_DIR=/home/hasu0707/ib/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips
export TOOLCHAIN_BIN_DIR=/home/hasu0707/ib/staging_dir/host/bin
export DTS_DIR=/home/hasu0707/ib/target/linux/ramips/dts
export OUTPUT_DIR=/home/hasu0707/ib/bin/ramips

cp -fv ${KERNEL_SRC_DIR}/vmlinux.elf ${OUTPUT_DIR}/openwrt-ramips-rt305x-vmlinux.elf
cp -fv ${KERNEL_SRC_DIR}/vmlinux ${OUTPUT_DIR}/openwrt-ramips-rt305x-vmlinux.bin

${TOOLCHAIN_BIN_DIR}/lzma e \
${KERNEL_SRC_DIR}/vmlinux \
-lc1 -lp2 -pb2 \
${KERNEL_SRC_DIR}/vmlinux.bin.lzma

cp -fv ${KERNEL_SRC_DIR}/uImage.lzma ${OUTPUT_DIR}/openwrt-ramips-rt305x-uImage.bin

${TOOLCHAIN_BIN_DIR}/mksquashfs4 \
${ROOTFS_SRC_DIR} \
${KERNEL_SRC_DIR}/root.squashfs \
-nopad -noappend -root-owned -comp xz -Xpreset 9 \
-Xe -Xlc 0 -Xlp 2 -Xpb 2  -b 256k -p '/dev d 755 0 0' \
-p '/dev/console c 600 0 0 5 1' -processors 1

dd \
if=${KERNEL_SRC_DIR}/root.squashfs \
of=${OUTPUT_DIR}/openwrt-ramips-rt305x-root.squashfs \
bs=128k conv=sync

cp -fv ${KERNEL_SRC_DIR}/vmlinux ${KERNEL_SRC_DIR}/vmlinux-sr-k100

${KERNEL_SRC_DIR}/linux-3.10.36/scripts/dtc/dtc \
-O dtb \
-o ${KERNEL_SRC_DIR}/SR-K100.dtb \
${DTS_DIR}/SR-K100.dts

${TOOLCHAIN_BIN_DIR}/patch-dtb \
${KERNEL_SRC_DIR}/vmlinux-sr-k100 \
${KERNEL_SRC_DIR}/SR-K100.dtb

${TOOLCHAIN_BIN_DIR}/lzma e \
${KERNEL_SRC_DIR}/vmlinux-sr-k100 \
-lc1 -lp2 -pb2 \
${KERNEL_SRC_DIR}/vmlinux-sr-k100.bin.lzma

cat \
${KERNEL_SRC_DIR}/vmlinux-sr-k100.uImage \
${KERNEL_SRC_DIR}/root.squashfs \
> ${KERNEL_SRC_DIR}/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin

${TOOLCHAIN_BIN_DIR}/padjffs2 \
${KERNEL_SRC_DIR}/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin \
4 8 16 64 128 256

# 펌웨어 파일 사이즈 검사
if [ `stat -c%s "${KERNEL_SRC_DIR}/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin"` -gt 8060928 ]; \
then  \
echo "Warning: ${KERNEL_SRC_DIR}/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin is too big" >&2;  \
else \
cp -fvpR ${KERNEL_SRC_DIR}/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin ${OUTPUT_DIR}/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin; \
fi

( cd ${OUTPUT_DIR} ; ${TOOLCHAIN_BIN_DIR}/find -maxdepth 1 -type f \! -name 'md5sums'  -printf "%P\n" | sort | xargs md5sum --binary > md5sums )


번호 제목 날짜 조회 수
28 dts 파일 컴파일 2014.05.23 1233
27 firmware-mod-kit의 펌웨어(bin) 추출과정 설명 2014.05.31 716
26 OpenWRT Cross Compile 2014.05.01 337
25 OpenWRT VLAN 설정 2014.05.14 256
24 SL-R6804 2016.04.06 247
23 ipTIME N604M 2016.04.06 246
22 ipTIME N702BCM file 2018.04.20 203
21 [OpenWRT] OpenVPN Server/Client 설정 2014.05.15 193
20 ipTIME N604M 2014.05.03 192
19 OpenWRT BuildRoot 빌드 방법 2014.05.17 192
18 Buffalo WHR-G300N V2 2016.04.06 180
17 OpenWRT StrongSwan IPSec VPN 설정 file 2014.05.02 141
16 OpenWRT, DD-WRT 국내 지원 모델 2018.04.13 120
15 OpenWRT BuildRoot 중요 디렉토리 및 파일 2014.05.24 118
14 OpenWRT 빌드환경 구축 (Ubuntu) 2018.04.16 117
13 OpenWRT 빌드환경 구축 (CentOS 6.5 x86_64) file 2014.05.17 101
12 OpenWRT 기본 방화벽 룰셋 2014.06.03 88
11 TP-LINK TL-WR740N v4.22 2016.04.06 87
10 MIPS Core군 정리 file 2014.05.19 84
» OpenWRT 이미지 빌드 2014.06.03 78