Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Fixing custom MAC address
Browse files Browse the repository at this point in the history
  • Loading branch information
fbelavenuto committed Jul 21, 2022
1 parent 8f7318f commit 722c03a
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 9 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ It is still in alpha stage, with little documentation, but it is functional. I'm

I tried to make the system as user-friendly as possible, to make life easier. The loader automatically detects which device is being used, SATADom or USB, detecting its VID and PID correctly. redpill-lkm has been edited to allow booting the kernel without setting the variables related to network interfaces so the loader (and user) doesn't have to worry about that. The Jun's code that makes the zImage and Ramdisk patch is embedded, if there is a change in "zImage" or "rd.gz" by some update, the loader re-applies the patches. Builds 42218 and 42661 up to update5 are working. Automatic updates should still be disabled as we are not sure if this technique will work forever. The most important kernel modules are built into the DSM ramdisk image for automatic peripheral detection.

# Use

To use this project, download the latest image available and burn it to a USB stick or SATA disk-on-module. Set the PC to boot from the burned media and follow the informations on the screen. When booting, the user can call the "menu.sh" command from the computer itself, access via SSH or use the virtual terminal (ttyd) by typing the address provided on the screen (http://(ip):7681). The loader will automatically increase the size of the last partition and use this space as cache if it is larger than 2GiB.

## It is highly recommended to use an SSD for the loader in the case of the option via DoM or a fast USB flash drive

The menu system is dynamic and I hope it is intuitive enough that the user can use it without any problems. Its allows you to choose a model, the existing buildnumber for the chosen model, type or randomly create a serial number, add/remove addons, add/remove/view "cmdline" and "synoinfo" entries, choose the LKM version, create the loader, boot, manually edit the configuration file, choose a keymap, update and exit.

Changing addons and synoinfo entries require re-creating the loader, cmdline entries do not. You can view the "cmdline" and "synoinfo" entries defined for the chosen model, with user-defined entries having higher priority.
Expand All @@ -20,7 +24,8 @@ Another important point is that the loader detects whether or not the CPU has th

I developed a simple patch to no longer display the DUMMY port error on models without device-tree, the user will be able to install without having to worry about it.

# Thanks

All code was based on the work of TTG, pocopico, jumkey and others involved in continuing TTG's original redpill-load project.

More information will be added in the future.

5 changes: 2 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ A fazer
- Descobrir como é o serial do DS2422+
- Estudar acrescentar modo simples e avançado do menu
- Mudar synoinfo para ler do modelo e preencher no user_config, para usuário poder deletar entradas do modelo
- Acertar flag DIRTY ao atualizar módulos, etc

Concluidos:
- Generalizar código dos addons
Expand All @@ -26,5 +25,5 @@ Concluidos:
- Melhorar opções de HD, talvez criar um menu a parte
- Implementar update do bzimage e ramdisk online
- Mudar addons para colocar pacote completo na partição 3 e detectar dinâmicamente durante o boot do júnior

https://kb.synology.com/en-me/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have
- Acertar flag DIRTY ao atualizar módulos, etc
- Consertar MAC custom
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3-alpha3
0.3-alpha4
33 changes: 33 additions & 0 deletions files/board/arpl/overlayfs/etc/init.d/S41dhcpcd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
#
# Start/stop dhcpcd
#

DAEMON=/usr/sbin/dhcpcd
CONFIG=/etc/dhcpcd.conf
PIDFILE=/var/run/dhcpcd/pid

[ -f $CONFIG ] || exit 0

case "$1" in
start)
echo "Starting dhcpcd..."
start-stop-daemon -S -x "$DAEMON" -p "$PIDFILE" -- -f "$CONFIG"
;;
stop)
echo "Stopping dhcpcd..."
start-stop-daemon -K -x "$DAEMON" -p "$PIDFILE" -o
;;
reload|force-reload)
echo "Reloading dhcpcd configuration..."
"$DAEMON" -s reload
;;
restart)
"$0" stop
sleep 1 # Prevent race condition: ensure dhcpcd stops before start.
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
esac
7 changes: 4 additions & 3 deletions files/board/arpl/overlayfs/opt/arpl/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,19 @@ echo -e "Cmdline:\n\033[1;36m${CMDLINE_LINE}\033[0m"

# Wait for an IP
COUNT=0
echo -n "IP: "
echo -n "IP"
while true; do
IP=`ip route get 1.1.1.1 2>/dev/null | awk '{print$7}'`
if [ -n "${IP}" ]; then
echo -e "\033[1;32m${IP}\033[0m"
echo -e ": \033[1;32m${IP}\033[0m"
break
elif [ ${COUNT} -eq 15 ]; then
echo -e "\033[1;31mERROR\033[0m"
echo -e ": \033[1;31mERROR\033[0m"
break
fi
COUNT=$((${COUNT}+1))
sleep 1
echo -n "."
done

echo -e "\033[1;37mLoading DSM kernel...\033[0m"
Expand Down
2 changes: 1 addition & 1 deletion files/board/arpl/overlayfs/opt/arpl/include/consts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

ARPL_VERSION="0.3-alpha3"
ARPL_VERSION="0.3-alpha4"

# Define paths
TMP_PATH="/tmp"
Expand Down
8 changes: 8 additions & 0 deletions files/board/arpl/overlayfs/opt/arpl/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ if [ ! -f "${USER_CONFIG_FILE}" ]; then
writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}"
fi

# Set custom MAC if defined
MAC1=`readConfigKey "cmdline.mac1" "${USER_CONFIG_FILE}"`
if [ -n "${MAC1}" ]; then
MAC="${MAC1:0:2}:${MAC1:2:2}:${MAC1:4:2}:${MAC1:6:2}:${MAC1:8:2}:${MAC1:10:2}"
ip link set dev eth0 address ${MAC} >/dev/null 2>&1 && \
(/etc/init.d/S41dhcpcd restart >/dev/null 2>&1 &) || true
fi

# Get the VID/PID if we are in USB
VID="0x0000"
PID="0x0000"
Expand Down
5 changes: 5 additions & 0 deletions files/board/arpl/overlayfs/opt/arpl/menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ function cmdlineMenu() {
writeConfigKey "cmdline.mac1" "${MAC1}" "${USER_CONFIG_FILE}"
writeConfigKey "cmdline.netif_num" "1" "${USER_CONFIG_FILE}"
fi
/etc/init.d/S30arpl-mac restart 2>&1 | dialog --backtitle "`backtitle`" \
--title "User cmdline" --progressbox "Changing mac" 20 70
/etc/init.d/S41dhcpcd restart 2>&1 | dialog --backtitle "`backtitle`" \
--title "User cmdline" --progressbox "Renewing IP" 20 70
IP=`ip route get 1.1.1.1 2>/dev/null | awk '{print$7}'`
;;
s)
ITEMS=""
Expand Down
Binary file modified files/board/arpl/p3/addons/acpid/all.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/addons/dtbpatch/all.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/addons/eudev/all.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/addons/maxdisks/all.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/addons/misc/all.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/modules/apollolake-4.4.180.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/modules/broadwell-4.4.180.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/modules/broadwellnk-4.4.180.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/modules/denverton-4.4.180.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/modules/geminilake-4.4.180.tgz
Binary file not shown.
Binary file modified files/board/arpl/p3/modules/v1000-4.4.180.tgz
Binary file not shown.

0 comments on commit 722c03a

Please sign in to comment.