Skip to content

Add HLK-RM04 and some options to build it correctly. Also enable libs needed for telnetd #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build/bin/build_mfsroot
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ ${INSTALL_DEF_BIN} ${X_BASEDIR}/files/rc ${X_STAGING_FSROOT}/etc/
${INSTALL_DEF_BIN} ${X_BASEDIR}/files/rc2 ${X_STAGING_FSROOT}/c/etc/

# local etc stuff - eg local password file
${INSTALL_DEF_FILE} ${X_BASEDIR}/files/ttys ${X_STAGING_FSROOT}/c/etc/
${INSTALL_DEF_FILE} ${X_DESTDIR}/etc/login.conf ${X_STAGING_FSROOT}/c/etc/
${INSTALL_DEF_FILE} ${X_BASEDIR}/files/gettytab ${X_STAGING_FSROOT}/c/etc/
${INSTALL_DEF_FILE} ${X_BASEDIR}/files/passwd ${X_STAGING_FSROOT}/c/etc/
Expand Down Expand Up @@ -363,6 +362,11 @@ cat ${X_BASEDIR}/files/rc.conf | sed "s|@DEF_ETH@|${X_CFG_DEFAULT_ETHER}|g" \
> ${X_STAGING_TMPDIR}/rc.conf
${INSTALL_DEF_FILE} ${X_STAGING_TMPDIR}/rc.conf ${X_STAGING_FSROOT}/c/etc/cfg/

# Set the console tty
cat ${X_BASEDIR}/files/ttys | sed "s|@DEF_TTY@|${X_CFG_DEFAULT_TTY}|" \
> ${X_STAGING_TMPDIR}/ttys
${INSTALL_DEF_FILE} ${X_STAGING_TMPDIR}/ttys ${X_STAGING_FSROOT}/c/etc/

# kernel modules - if required
if [ "x${MFSROOT_INC_MODULES}" = "xYES" ]; then
echo "*** Including modules.."
Expand Down
19 changes: 9 additions & 10 deletions build/bin/build_ralink
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ fi
# include the config variable generation code
. ${SCRIPT_DIR}/../lib/cfg.sh || exit 1

# This builds a buffalo airstation system image from the given kernel and MFS.

# lzma the kernel image
# Use the lzma from ports (/usr/local/bin/lzma) rather than the lzma
# from base, as EOS (end of stream) markers aren't allowed for uboot.

# refer at ZRouter
../obj/mipsel/mips.mipsel${CUR_DIR}/tmp/usr/bin/objcopy -O binary ${X_KERNEL} ${X_TFTPBOOT}/kernel.${KERNCONF}.kbin || exit 1
../obj/${X_BUILD_BASE_CFG}/mips.mipsel${CUR_DIR}/tmp/usr/bin/objcopy -O binary ${X_KERNEL} ${X_TFTPBOOT}/kernel.${KERNCONF}.kbin || exit 1

/usr/local/bin/lzma e ${X_TFTPBOOT}/kernel.${KERNCONF}.kbin ${X_TFTPBOOT}/kernel.${KERNCONF}.lzma || exit 1

Expand All @@ -34,11 +32,12 @@ mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C lzma \
${X_TFTPBOOT}/kernel.${KERNCONF}.lzma.uImage \
|| exit 1

# Format requires the string as a preamble for validation
(
printf "# Airstation Public Fmt1\0\0\0\0\0\0\0\0"
dd if=${X_TFTPBOOT}/kernel.${KERNCONF}.lzma.uImage bs=1M conv=sync;
dd if=${X_FSIMAGE}${X_FSIMAGE_SUFFIX} bs=1M conv=sync
) > ${X_TFTPBOOT}/${CFGNAME}-tftp.bin

if [ "x${X_UBOOT_AIRSTATION_PREAMBLE}" = "xYES" ] ; then
# Format requires the string as a preamble for validation
(
printf "# Airstation Public Fmt1\0\0\0\0\0\0\0\0"
dd if=${X_TFTPBOOT}/kernel.${KERNCONF}.lzma.uImage bs=1M conv=sync;
dd if=${X_FSIMAGE}${X_FSIMAGE_SUFFIX} bs=1M conv=sync
) > ${X_TFTPBOOT}/${CFGNAME}-tftp.bin
fi
exit 0
1 change: 1 addition & 0 deletions build/cfg/fon2305e
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ UBOOT_KERN_STARTADDR="0x80001100"

# Building the firmware image
X_BUILD_BUILD_IMG_DEFAULTS="mfsroot fsimage ralink"
X_UBOOT_AIRSTATION_PREAMBLE="YES"
27 changes: 27 additions & 0 deletions build/cfg/hlkrm04
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Base configuration
X_BUILD_BASE_CFG="mipsel_ap"

# board configuration
KERNCONF=RT5350
X_MAKEFS_ENDIAN=le

# The configuration load/save script needs to know the
# configuration partition name and location.
#BIN_CFG_PARTITION="/dev/map/cfg"
#BIN_CFG_SIZE="65536"

UBOOT_ARCH="mips"
UBOOT_KERN_LOADADDR="0x80001100"
UBOOT_KERN_STARTADDR="0x80001100"

X_FSIMAGE_CMD="mkulzma"
X_FSIMAGE_ARGS="-s 131072 -v"
X_FSIMAGE_SUFFIX=".ulzma"

# If no build options are provided, which build options
# should be run when building
X_BUILD_BUILD_IMG_DEFAULTS="mfsroot fsimage ralink"

# Configuration file overrides
X_CFG_DEFAULT_ETHER="rt0"
X_CFG_DEFAULT_TTY="ttyu1"
2 changes: 1 addition & 1 deletion build/files/ttys
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
console none unknown off secure

# Serial terminals
ttyu0 "/usr/libexec/getty 3wire" vt100 on secure
@DEF_TTY@ "/usr/libexec/getty 3wire" vt100 on secure
2 changes: 2 additions & 0 deletions build/lib/cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ X_CFGFS="${CUR_DIR}/../cfgfs-${CFGNAME}.img"

X_UBOOT_KERNROOTIMG=${X_UBOOT_KERNROOTIMG:="NO"}
TPLINK_SKIP_ROOTFS=${TPLINK_SKIP_ROOTFS:="NO"}
X_UBOOT_AIRSTATION_PREAMBLE=${X_UBOOT_AIRSTATION_PREAMBLE:="NO"}

# Defaults!
X_FSIMAGE_CMD=${X_FSIMAGE_CMD:="mkuzip"}
Expand All @@ -133,3 +134,4 @@ X_ROOTFS_DEV=${X_ROOTFS_DEV:="/dev/da0"}
# Configuration file template defaults
X_CFG_DEFAULT_ETHER=${X_CFG_DEFAULT_ETHER:="arge0"}
X_CFG_DEFAULT_HOSTNAME=${X_CFG_DEFAULT_HOSTNAME:="freebsd-wifi"}
X_CFG_DEFAULT_TTY=${X_CFG_DEFAULT_TTY:="ttyu0"}