logo

한국어

OpenWRT 이미지 빌드

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

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 )


번호 제목 날짜 조회 수
8 OpenWRT VLAN 설정 2014.05.14 262
7 OpenWRT에 pure-ftpd 설치하기 2014.05.04 33
6 ipTIME N604M 2014.05.03 196
5 TP-Link TL-WR740N 2014.05.03 50
4 OpenWRT StrongSwan IPSec VPN 설정 file 2014.05.02 160
3 OpenWRT Package 제작 2014.05.02 78
2 OpenWRT Cross Compile 2014.05.01 341
1 CentOS x86_64에 libmagic 최신버전 설치 2014.04.25 20