Compare commits

..

33 Commits

Author SHA1 Message Date
Fabio Belavenuto
71e44bc7a3 Merge pull request #64 from fbelavenuto/dev
wip
2022-07-29 13:24:13 -03:00
Fabio Belavenuto
09dba3251b wip 2022-07-29 13:23:34 -03:00
Fabio Belavenuto
1682713fed Merge pull request #61 from fbelavenuto/dev
Modules
2022-07-27 11:41:59 -03:00
Fabio Belavenuto
e678c2aa53 Cosmetics 2022-07-26 17:28:01 -03:00
Fabio Belavenuto
2bceaea550 Modules 2022-07-26 13:12:12 -03:00
Fabio Belavenuto
ae78abc404 Merge pull request #59 from fbelavenuto/dev
Changing addon/modules instalation (for addons with modules)
2022-07-25 17:26:04 -03:00
Fabio Belavenuto
71df9e5a92 Changing addon/modules instalation (for addons with modules)
On build change, check invalid addons
2022-07-25 17:24:15 -03:00
Fabio Belavenuto
a74537aa02 Merge pull request #58 from fbelavenuto/dev
Fixing synoinfo entries for SHR
2022-07-25 14:27:51 -03:00
Fabio Belavenuto
16716b2172 Fixing synoinfo entries for SHR
Little bug into add synoinfo entry
2022-07-25 13:08:31 -03:00
Fabio Belavenuto
027a412b65 Merge pull request #57 from fbelavenuto/dev
Dev
2022-07-25 12:35:25 -03:00
Fabio Belavenuto
4ea6b9ad5c Force action cache remake 2022-07-25 12:34:58 -03:00
Fabio Belavenuto
c0209e0aae Missing synoinfo entries 2022-07-25 11:41:31 -03:00
Fabio Belavenuto
2c3ad3e7fb Merge pull request #56 from fbelavenuto/dev
PATA modules, unified p1 and p2 size
2022-07-25 11:26:59 -03:00
Fabio Belavenuto
74f09ffcd9 Now kernel/ramdisk of DSM and ARPL are located in partition 3 2022-07-25 09:59:35 -03:00
Fabio Belavenuto
acd413ab61 Adding PATA drivers 2022-07-25 08:22:48 -03:00
Fabio Belavenuto
415ee7e75d Merge pull request #53 from fbelavenuto/dev
Various commits
2022-07-22 16:58:46 -03:00
Fabio Belavenuto
2fe9b3237e Modules compiled with DSM toolchain 2022-07-22 16:58:08 -03:00
Fabio Belavenuto
81c0e00b76 Little fixes 2022-07-22 15:59:00 -03:00
Fabio Belavenuto
1b766e4974 Docker: using DSM toolchain 2022-07-22 15:50:43 -03:00
Fabio Belavenuto
690af5115d Re-added Addon external download 2022-07-22 08:11:37 -03:00
Fabio Belavenuto
a6ec7c0c46 Merge pull request #50 from fbelavenuto/dev
Adding module firmwares
2022-07-21 17:24:21 -03:00
Fabio Belavenuto
37fe50a1c5 Adding module firmwares 2022-07-21 17:22:38 -03:00
Fabio Belavenuto
ce5f427837 Merge pull request #49 from fbelavenuto/dev
Synoinfo entries unified
2022-07-21 16:50:16 -03:00
Fabio Belavenuto
5dc0b6e705 Synoinfo entries unified:
Synoinfo entries from model config file are copyed to user config file when the user choose a build.
2022-07-21 16:49:04 -03:00
Fabio Belavenuto
ea67f64d31 Merge pull request #48 from fbelavenuto/dev
Fixing custom MAC address
2022-07-21 14:26:12 -03:00
Fabio Belavenuto
722c03a506 Fixing custom MAC address 2022-07-21 14:21:25 -03:00
Fabio Belavenuto
678c7b6591 Merge pull request #47 from fbelavenuto/dev
Update modules set DIRTY flag
2022-07-21 11:22:12 -03:00
Fabio Belavenuto
8f7318f90f Cosmetics
Update module sets DIRTY flag
2022-07-21 11:21:24 -03:00
Fabio Belavenuto
7b2a7b210a Added DS2422+ 42661 build 2022-07-19 14:22:40 -03:00
Fabio Belavenuto
14362aae17 Added option to boot into junior mode 2022-07-19 13:54:51 -03:00
Fabio Belavenuto
0e16f96fad Added option to boot into junior mode 2022-07-19 13:53:03 -03:00
Fabio Belavenuto
159b7172b0 Merge pull request #43 from fbelavenuto/dev
Removing no more necessary php
2022-07-19 12:44:47 -03:00
Fabio Belavenuto
75c637a6e4 Removing no more necessary php 2022-07-19 12:44:03 -03:00
58 changed files with 353 additions and 127 deletions

View File

@@ -6,11 +6,15 @@ 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. 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. 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. 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. Changing addons and synoinfo entries require re-creating the loader, cmdline entries do not.
There is no need to configure the VID/PID (if using a USB stick) or define the MAC Addresses of the network interfaces. If the user wants to modify the MAC Address of any interface, he must manually add "cmdline" entries in the corresponding menu (set "netif_num" according to "mac1..4" entries). There is no need to configure the VID/PID (if using a USB stick) or define the MAC Addresses of the network interfaces. If the user wants to modify the MAC Address of any interface, he must manually add "cmdline" entries in the corresponding menu (set "netif_num" according to "mac1..4" entries).
@@ -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. 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. 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. More information will be added in the future.

6
TODO
View File

@@ -1,4 +1,5 @@
A fazer A fazer
- Validar netif_num e macX
- Descobrir como é o serial do DS2422+ - Descobrir como é o serial do DS2422+
- Estudar acrescentar modo simples e avançado do menu - Estudar acrescentar modo simples e avançado do menu
@@ -24,5 +25,6 @@ Concluidos:
- Melhorar opções de HD, talvez criar um menu a parte - Melhorar opções de HD, talvez criar um menu a parte
- Implementar update do bzimage e ramdisk online - 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 - Mudar addons para colocar pacote completo na partição 3 e detectar dinâmicamente durante o boot do júnior
- Acertar flag DIRTY ao atualizar módulos, etc
https://kb.synology.com/en-me/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have - Consertar MAC custom
- Mudar synoinfo para ler do modelo e preencher no user_config, para usuário poder deletar entradas do modelo

View File

@@ -12,15 +12,6 @@ tasks:
cmds: cmds:
- ./build.sh - ./build.sh
compile-lkms:
cmds:
- ./compile-lkm.sh
compile-addons:
dir: addons
cmds:
- ./compile-addons.sh {{.CLI_ARGS}}
compile-kpatch: compile-kpatch:
dir: kpatch dir: kpatch
cmds: cmds:

View File

@@ -1 +1 @@
0.3-alpha3 0.3-alpha6

View File

@@ -3,20 +3,17 @@ ARG PLATFORMS="@@@PLATFORMS@@@"
ARG TOOLKIT_VER="@@@TOOLKIT_VER@@@" ARG TOOLKIT_VER="@@@TOOLKIT_VER@@@"
# Copy downloaded toolkits # Copy downloaded toolkits
ADD cache /cache ADD cache/$TOOLKIT_VER /cache
# Extract toolkits # Extract toolkits
RUN for V in ${PLATFORMS}; do \ RUN for V in ${PLATFORMS}; do \
echo "${V}" | while IFS=':' read PLATFORM KVER; do \ echo "${V}" | while IFS=':' read PLATFORM KVER; do \
echo -e "${PLATFORM}\t${KVER}" >> /opt/platforms && \
echo "Extracting ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz" && \ echo "Extracting ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz" && \
mkdir "/opt/${PLATFORM}" && \ mkdir "/opt/${PLATFORM}" && \
tar -xaf "/cache/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz" -C "/opt/${PLATFORM}" --strip-components=10 \ tar -xaf "/cache/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz" -C "/opt/${PLATFORM}" --strip-components=9 \
"usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib/modules/DSM-${TOOLKIT_VER}/build" && \ "usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib/modules/DSM-${TOOLKIT_VER}" && \
echo -e "${PLATFORM}\t${KVER}" >> /opt/platforms && \ echo "Extracting ${PLATFORM}-toolchain.txz" && \
if [ ! -d "/opt/linux-${KVER}" ]; then \ tar -xaf "/cache/${PLATFORM}-toolchain.txz" -C "/opt/${PLATFORM}" --strip-components=1; \
mkdir "/opt/linux-${KVER}" && \
echo "Extracting linux-${KVER}.tar.xz" && \
tar -xaf "/cache/linux-${KVER}.tar.xz" -C "/opt/linux-${KVER}" --strip-components=1; \
fi; \
done; \ done; \
done done

View File

@@ -6,50 +6,75 @@ function trap_cancel() {
sleep 2 || exit 1 sleep 2 || exit 1
} }
trap trap_cancel SIGINT SIGTERM trap trap_cancel SIGINT SIGTERM
cd `dirname $0` cd `dirname $0`
# Read platforms/kerver version ###############################################################################
echo "Reading platforms" function prepare() {
declare -A PLATFORMS declare -A URLS
while read PLATFORM KVER; do
PLATFORMS[${PLATFORM}]="${KVER}"
done <../PLATFORMS
# Download toolkits URLS["apollolake"]="https://global.download.synology.com/download/ToolChain/toolchain/${TOOLCHAIN_VER}/Intel%20x86%20Linux%204.4.180%20%28Apollolake%29/apollolake-${GCCLIB_VER}_x86_64-GPL.txz"
mkdir -p cache URLS["broadwell"]="https://global.download.synology.com/download/ToolChain/toolchain/${TOOLCHAIN_VER}/Intel%20x86%20Linux%204.4.180%20%28Broadwell%29/broadwell-${GCCLIB_VER}_x86_64-GPL.txz"
URLS["broadwellnk"]="https://global.download.synology.com/download/ToolChain/toolchain/${TOOLCHAIN_VER}/Intel%20x86%20Linux%204.4.180%20%28Broadwellnk%29/broadwellnk-${GCCLIB_VER}_x86_64-GPL.txz"
URLS["bromolow"]="https://global.download.synology.com/download/ToolChain/toolchain/${TOOLCHAIN_VER}/Intel%20x86%20linux%203.10.108%20%28Bromolow%29/bromolow-${GCCLIB_VER}_x86_64-GPL.txz"
URLS["denverton"]="https://global.download.synology.com/download/ToolChain/toolchain/${TOOLCHAIN_VER}/Intel%20x86%20Linux%204.4.180%20%28Denverton%29/denverton-${GCCLIB_VER}_x86_64-GPL.txz"
URLS["geminilake"]="https://global.download.synology.com/download/ToolChain/toolchain/${TOOLCHAIN_VER}/Intel%20x86%20Linux%204.4.180%20%28GeminiLake%29/geminilake-${GCCLIB_VER}_x86_64-GPL.txz"
URLS["v1000"]="https://global.download.synology.com/download/ToolChain/toolchain/${TOOLCHAIN_VER}/Intel%20x86%20Linux%204.4.180%20%28V1000%29/v1000-${GCCLIB_VER}_x86_64-GPL.txz"
# Read platforms/kerver version
echo "Reading platforms"
declare -A PLATFORMS
while read PLATFORM KVER; do
PLATFORMS[${PLATFORM}]="${KVER}"
done <../PLATFORMS
# Download toolkits
mkdir -p cache
for PLATFORM in ${!PLATFORMS[@]}; do
KVER="${PLATFORMS[${PLATFORM}]}"
echo -n "Checking cache/${TOOLKIT_VER}/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz... "
if [ ! -f "cache/${TOOLKIT_VER}/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz" ]; then
URL="https://global.download.synology.com/download/ToolChain/toolkit/${TOOLKIT_VER}/${PLATFORM}/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz"
echo "Downloading ${URL}"
curl -L "${URL}" -o "cache/${TOOLKIT_VER}/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz"
else
echo "OK"
fi
echo -n "Checking cache/${TOOLKIT_VER}/${PLATFORM}-toolchain.txz... "
if [ ! -f "cache/${TOOLKIT_VER}/${PLATFORM}-toolchain.txz" ]; then
URL=${URLS["${PLATFORM}"]}
echo "Downloading ${URL}"
curl -L "${URL}" -o "cache/${TOOLKIT_VER}/${PLATFORM}-toolchain.txz"
else
echo "OK"
fi
done
# Generate Dockerfile
echo "Generating Dockerfile"
cp Dockerfile.template Dockerfile
VALUE=""
for PLATFORM in ${!PLATFORMS[@]}; do
VALUE+="${PLATFORM}:${PLATFORMS[${PLATFORM}]} "
done
sed -i "s|@@@PLATFORMS@@@|${VALUE::-1}|g" Dockerfile
sed -i "s|@@@TOOLKIT_VER@@@|${TOOLKIT_VER}|g" Dockerfile
}
# 7.0
TOOLKIT_VER="7.0" TOOLKIT_VER="7.0"
for PLATFORM in ${!PLATFORMS[@]}; do TOOLCHAIN_VER="7.0-41890"
KVER="${PLATFORMS[${PLATFORM}]}" GCCLIB_VER="gcc750_glibc226"
echo -n "Checking cache/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz... " prepare
if [ ! -f "cache/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz" ]; then echo "Building ${TOOLKIT_VER}"
URL="https://global.download.synology.com/download/ToolChain/toolkit/${TOOLKIT_VER}/${PLATFORM}/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz" docker image rm fbelavenuto/syno-compiler:${TOOLKIT_VER} >/dev/null 2>&1
echo "Downloading ${URL}" docker buildx build . --load --tag fbelavenuto/syno-compiler:${TOOLKIT_VER}
curl -L "${URL}" -o "cache/ds.${PLATFORM}-${TOOLKIT_VER}.dev.txz"
else
echo "OK"
fi
# echo -n "Checking cache/linux-${KVER}.tar.xz... "
# if [ ! -f "cache/linux-${KVER}.tar.xz" ]; then
# URL="https://cdn.kernel.org/pub/linux/kernel/v${KVER:0:1}.x/linux-${KVER}.tar.xz"
# echo "Downloading ${URL}"
# curl -L "${URL}" -o "cache/linux-${KVER}.tar.xz"
# else
# echo "OK"
# fi
done
# Generate Dockerfile # 7.1
echo "Generating Dockerfile" TOOLKIT_VER="7.1"
cp Dockerfile.template Dockerfile TOOLCHAIN_VER="7.1-42661"
VALUE="" GCCLIB_VER="gcc850_glibc226"
for PLATFORM in ${!PLATFORMS[@]}; do prepare
VALUE+="${PLATFORM}:${PLATFORMS[${PLATFORM}]} " echo "Building ${TOOLKIT_VER}"
done docker image rm fbelavenuto/syno-compiler:${TOOLKIT_VER} >/dev/null 2>&1
sed -i "s|@@@PLATFORMS@@@|${VALUE::-1}|g" Dockerfile docker buildx build . --load --tag fbelavenuto/syno-compiler:${TOOLKIT_VER} --tag fbelavenuto/syno-compiler:latest
sed -i "s|@@@TOOLKIT_VER@@@|${TOOLKIT_VER}|g" Dockerfile
# Build
echo "Building... Drink a coffee and wait!"
docker image rm fbelavenuto/syno-compiler >/dev/null 2>&1
docker buildx build . --load --tag fbelavenuto/syno-compiler

View File

@@ -1,5 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e
function export-vars {
# Validate
if [ -z "${1}" ]; then
echo "Use: export-vars <platform>"
exit 1
fi
export CROSS_COMPILE="/opt/${1}/bin/x86_64-pc-linux-gnu-"
export CFLAGS="-I/opt/${1}/include"
export LDFLAGS="-I/opt/${1}/lib"
export LD_LIBRARY_PATH="/opt/${1}/lib"
export ARCH=x86_64
}
function compile-module { function compile-module {
# Validate # Validate
if [ -z "${1}" ]; then if [ -z "${1}" ]; then
@@ -19,7 +34,9 @@ function compile-module {
fi fi
echo "Compiling module for ${PLATFORM}-${KVER}..." echo "Compiling module for ${PLATFORM}-${KVER}..."
cp -R /input /tmp cp -R /input /tmp
make -C "/opt/${PLATFORM}" M="/tmp/input" PLATFORM=${PLATFORM^^} modules export-vars ${PLATFORM}
make -C "/opt/${PLATFORM}/build" M="/tmp/input" \
${PLATFORM^^}-Y=y ${PLATFORM^^}-M=m modules
while read F; do while read F; do
strip -g "${F}" strip -g "${F}"
echo "Copying `basename ${F}`" echo "Copying `basename ${F}`"
@@ -34,11 +51,13 @@ function compile-lkm {
exit 1 exit 1
fi fi
cp -R /input /tmp cp -R /input /tmp
make -C "/tmp/input" LINUX_SRC="/opt/${PLATFORM}" dev-v7 export-vars ${PLATFORM}
export LINUX_SRC="/opt/${PLATFORM}/build"
make -C "/tmp/input" dev-v7
strip -g "/tmp/input/redpill.ko" strip -g "/tmp/input/redpill.ko"
mv "/tmp/input/redpill.ko" "/output/redpill-dev.ko" mv "/tmp/input/redpill.ko" "/output/redpill-dev.ko"
make -C "/tmp/input" LINUX_SRC="/opt/${PLATFORM}" clean make -C "/tmp/input" clean
make -C "/tmp/input" LINUX_SRC="/opt/${PLATFORM}" prod-v7 make -C "/tmp/input" prod-v7
strip -g "/tmp/input/redpill.ko" strip -g "/tmp/input/redpill.ko"
mv "/tmp/input/redpill.ko" "/output/redpill-prod.ko" mv "/tmp/input/redpill.ko" "/output/redpill-prod.ko"
} }
@@ -71,10 +90,10 @@ if [ $# -lt 1 ]; then
exit 1 exit 1
fi fi
case $1 in case $1 in
bash) shift; bash -l $@ ;; bash) shift && bash -l $@ ;;
shell) export-vars $2 && shift 2 && bash -l $@ ;;
compile-module) compile-module $2 ;; compile-module) compile-module $2 ;;
compile-lkm) compile-lkm $2 ;; compile-lkm) compile-lkm $2 ;;
# compile-drivers) compile-drivers ;; # compile-drivers) compile-drivers ;;
*) echo "Command not recognized: $1" ;; *) echo "Command not recognized: $1" ;;
esac esac

View File

@@ -121,6 +121,7 @@ CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_SG=y CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_SAS_ATA=y
CONFIG_BLK_DEV_3W_XXXX_RAID=m CONFIG_BLK_DEV_3W_XXXX_RAID=m
CONFIG_SCSI_HPSA=m CONFIG_SCSI_HPSA=m
CONFIG_SCSI_3W_9XXX=m CONFIG_SCSI_3W_9XXX=m
@@ -184,9 +185,31 @@ CONFIG_SATA_SIL=m
CONFIG_SATA_SIS=m CONFIG_SATA_SIS=m
CONFIG_SATA_ULI=m CONFIG_SATA_ULI=m
CONFIG_SATA_VIA=m CONFIG_SATA_VIA=m
CONFIG_PATA_ALI=m
CONFIG_PATA_AMD=y CONFIG_PATA_AMD=y
CONFIG_PATA_ARTOP=m
CONFIG_PATA_ATIIXP=m
CONFIG_PATA_ATP867X=m
CONFIG_PATA_CMD64X=m
CONFIG_PATA_EFAR=m
CONFIG_PATA_HPT366=m
CONFIG_PATA_HPT37X=m
CONFIG_PATA_HPT3X2N=m
CONFIG_PATA_HPT3X3=m
CONFIG_PATA_IT821X=m
CONFIG_PATA_JMICRON=m
CONFIG_PATA_NINJA32=m
CONFIG_PATA_NS87415=m
CONFIG_PATA_OLDPIIX=y CONFIG_PATA_OLDPIIX=y
CONFIG_PATA_PDC2027X=m
CONFIG_PATA_PDC_OLD=m
CONFIG_PATA_RDC=m
CONFIG_PATA_SCH=y CONFIG_PATA_SCH=y
CONFIG_PATA_SERVERWORKS=m
CONFIG_PATA_SIL680=m
CONFIG_PATA_TRIFLEX=m
CONFIG_PATA_VIA=m
CONFIG_PATA_WINBOND=m
CONFIG_ATA_GENERIC=y CONFIG_ATA_GENERIC=y
CONFIG_MD=y CONFIG_MD=y
CONFIG_BLK_DEV_MD=y CONFIG_BLK_DEV_MD=y

View File

@@ -19,7 +19,7 @@ dd if="/dev/zero" of="${IMAGE_FILE}" bs=1M count=300 conv=sync 2>/dev/null
# Copy grub stage1 to image # Copy grub stage1 to image
dd if="${BOARD_PATH}/grub.bin" of="${IMAGE_FILE}" conv=notrunc,sync 2>/dev/null dd if="${BOARD_PATH}/grub.bin" of="${IMAGE_FILE}" conv=notrunc,sync 2>/dev/null
# Create partitions on image # Create partitions on image
echo -e "n\np\n\n\n+150M\na\nt\n\n0b\nn\np\n\n\n+50M\nn\np\n\n\n\nw" | fdisk "${IMAGE_FILE}" >/dev/null echo -e "n\np\n\n\n+50M\na\nt\n\n0b\nn\np\n\n\n+50M\nn\np\n\n\n\nw" | fdisk "${IMAGE_FILE}" >/dev/null
# Force umount, ignore errors # Force umount, ignore errors
sudo umount "${BINARIES_DIR}/p1" 2>/dev/null || true sudo umount "${BINARIES_DIR}/p1" 2>/dev/null || true
@@ -40,8 +40,8 @@ sudo mount /dev/loop8p1 "${BINARIES_DIR}/p1"
sudo mount /dev/loop8p3 "${BINARIES_DIR}/p3" sudo mount /dev/loop8p3 "${BINARIES_DIR}/p3"
echo "Copying files" echo "Copying files"
sudo cp "${BINARIES_DIR}/bzImage" "${BINARIES_DIR}/p1/bzImage-arpl" sudo cp "${BINARIES_DIR}/bzImage" "${BINARIES_DIR}/p3/bzImage-arpl"
sudo cp "${BINARIES_DIR}/rootfs.cpio.xz" "${BINARIES_DIR}/p1/initrd-arpl" sudo cp "${BINARIES_DIR}/rootfs.cpio.xz" "${BINARIES_DIR}/p3/initrd-arpl"
sudo cp -R "${BOARD_PATH}/p1/"* "${BINARIES_DIR}/p1" sudo cp -R "${BOARD_PATH}/p1/"* "${BINARIES_DIR}/p1"
sudo cp -R "${BOARD_PATH}/p3/"* "${BINARIES_DIR}/p3" sudo cp -R "${BOARD_PATH}/p3/"* "${BINARIES_DIR}/p3"
sync sync

View File

@@ -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

View File

@@ -76,13 +76,15 @@ EFI_BUG="`readModelKey "${MODEL}" "builds.${BUILD}.efi-bug"`"
LOADER_DISK="`blkid | grep 'LABEL="ARPL3"' | cut -d3 -f1`" LOADER_DISK="`blkid | grep 'LABEL="ARPL3"' | cut -d3 -f1`"
BUS=`udevadm info --query property --name ${LOADER_DISK} | grep ID_BUS | cut -d= -f2` BUS=`udevadm info --query property --name ${LOADER_DISK} | grep ID_BUS | cut -d= -f2`
if [ "${BUS}" = "ata" ]; then if [ "${BUS}" = "ata" ]; then
SIZE=$((`df -BM | awk '/\/mnt\/p3/{print$2}' | tr 'M' ' '`+300)) LOADER_DEVICE_NAME=`echo ${LOADER_DISK} | sed 's|/dev/||'`
SIZE=$((`cat /sys/block/${LOADER_DEVICE_NAME}/size`/2048+10))
# Read SATADoM type # Read SATADoM type
DOM="`readModelKey "${MODEL}" "dom"`" DOM="`readModelKey "${MODEL}" "dom"`"
fi fi
# Prepare command line # Prepare command line
CMDLINE_LINE="" CMDLINE_LINE=""
grep -q "force_junior" /proc/cmdline && CMDLINE_LINE+="force_junior "
[ ${EFI} -eq 1 ] && CMDLINE_LINE+="withefi " [ ${EFI} -eq 1 ] && CMDLINE_LINE+="withefi "
[ "${BUS}" = "ata" ] && CMDLINE_LINE+="synoboot_satadom=${DOM} dom_szmax=${SIZE} " [ "${BUS}" = "ata" ] && CMDLINE_LINE+="synoboot_satadom=${DOM} dom_szmax=${SIZE} "
CMDLINE_LINE+="console=ttyS0,115200n8 earlyprintk log_buf_len=32M earlycon=uart8250,io,0x3f8,115200n8 elevator=elevator root=/dev/md0 loglevel=15" CMDLINE_LINE+="console=ttyS0,115200n8 earlyprintk log_buf_len=32M earlycon=uart8250,io,0x3f8,115200n8 elevator=elevator root=/dev/md0 loglevel=15"
@@ -101,18 +103,19 @@ echo -e "Cmdline:\n\033[1;36m${CMDLINE_LINE}\033[0m"
# Wait for an IP # Wait for an IP
COUNT=0 COUNT=0
echo -n "IP: " echo -n "IP"
while true; do while true; do
IP=`ip route get 1.1.1.1 2>/dev/null | awk '{print$7}'` IP=`ip route get 1.1.1.1 2>/dev/null | awk '{print$7}'`
if [ -n "${IP}" ]; then if [ -n "${IP}" ]; then
echo -e "\033[1;32m${IP}\033[0m" echo -e ": \033[1;32m${IP}\033[0m"
break break
elif [ ${COUNT} -eq 15 ]; then elif [ ${COUNT} -eq 15 ]; then
echo -e "\033[1;31mERROR\033[0m" echo -e ": \033[1;31mERROR\033[0m"
break break
fi fi
COUNT=$((${COUNT}+1)) COUNT=$((${COUNT}+1))
sleep 1 sleep 1
echo -n "."
done done
echo -e "\033[1;37mLoading DSM kernel...\033[0m" echo -e "\033[1;37mLoading DSM kernel...\033[0m"

View File

@@ -1,5 +1,5 @@
ARPL_VERSION="0.3-alpha3" ARPL_VERSION="0.3-alpha6"
# Define paths # Define paths
TMP_PATH="/tmp" TMP_PATH="/tmp"
@@ -8,12 +8,14 @@ RAMDISK_PATH="${TMP_PATH}/ramdisk"
LOG_FILE="${TMP_PATH}/log.txt" LOG_FILE="${TMP_PATH}/log.txt"
USER_CONFIG_FILE="${BOOTLOADER_PATH}/user-config.yml" USER_CONFIG_FILE="${BOOTLOADER_PATH}/user-config.yml"
MOD_ZIMAGE_FILE="${BOOTLOADER_PATH}/zImage"
MOD_RDGZ_FILE="${BOOTLOADER_PATH}/rd.gz"
ORI_ZIMAGE_FILE="${SLPART_PATH}/zImage" ORI_ZIMAGE_FILE="${SLPART_PATH}/zImage"
ORI_RDGZ_FILE="${SLPART_PATH}/rd.gz" ORI_RDGZ_FILE="${SLPART_PATH}/rd.gz"
ARPL_BZIMAGE_FILE="${CACHE_PATH}/bzImage-arpl"
ARPL_RAMDISK_FILE="${CACHE_PATH}/initrd-arpl"
MOD_ZIMAGE_FILE="${CACHE_PATH}/zImage-dsm"
MOD_RDGZ_FILE="${CACHE_PATH}/initrd-dsm"
ADDONS_PATH="${CACHE_PATH}/addons" ADDONS_PATH="${CACHE_PATH}/addons"
LKM_PATH="${CACHE_PATH}/lkms" LKM_PATH="${CACHE_PATH}/lkms"
MODULES_PATH="${CACHE_PATH}/modules" MODULES_PATH="${CACHE_PATH}/modules"

View File

@@ -34,7 +34,6 @@ mount ${LOADER_DISK}1 ${BOOTLOADER_PATH} || die "Can't mount ${BOOTLOADER_PATH}"
mount ${LOADER_DISK}2 ${SLPART_PATH} || die "Can't mount ${SLPART_PATH}" mount ${LOADER_DISK}2 ${SLPART_PATH} || die "Can't mount ${SLPART_PATH}"
mount ${LOADER_DISK}3 ${CACHE_PATH} || die "Can't mount ${CACHE_PATH}" mount ${LOADER_DISK}3 ${CACHE_PATH} || die "Can't mount ${CACHE_PATH}"
mkdir -p "${ADDONS_PATH}"
# Move/link SSH machine keys to/from cache volume # Move/link SSH machine keys to/from cache volume
[ ! -d "${CACHE_PATH}/ssh" ] && cp -R "/etc/ssh" "${CACHE_PATH}/ssh" [ ! -d "${CACHE_PATH}/ssh" ] && cp -R "/etc/ssh" "${CACHE_PATH}/ssh"
rm -rf "/etc/ssh" rm -rf "/etc/ssh"
@@ -59,6 +58,14 @@ if [ ! -f "${USER_CONFIG_FILE}" ]; then
writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}" writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}"
fi 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 # Get the VID/PID if we are in USB
VID="0x0000" VID="0x0000"
PID="0x0000" PID="0x0000"
@@ -148,3 +155,7 @@ echo
echo -e "User config is on \033[1;32m${USER_CONFIG_FILE}\033[0m" echo -e "User config is on \033[1;32m${USER_CONFIG_FILE}\033[0m"
echo -e "Default SSH Root password is \033[1;31mRedp1lL-1s-4weSomE\033[0m" echo -e "Default SSH Root password is \033[1;31mRedp1lL-1s-4weSomE\033[0m"
echo echo
mkdir -p "${ADDONS_PATH}"
mkdir -p "${LKM_PATH}"
mkdir -p "${MODULES_PATH}"

View File

@@ -63,6 +63,7 @@ function modelMenu() {
M="`basename ${M}`" M="`basename ${M}`"
M="${M::-4}" M="${M::-4}"
PLATFORM=`readModelKey "${M}" "platform"` PLATFORM=`readModelKey "${M}" "platform"`
DT="`readModelKey "${M}" "dt"`"
# Check id model is compatible with CPU # Check id model is compatible with CPU
COMPATIBLE=1 COMPATIBLE=1
for F in `readModelArray "${M}" "flags"`; do for F in `readModelArray "${M}" "flags"`; do
@@ -71,9 +72,10 @@ function modelMenu() {
break break
fi fi
done done
[ ${COMPATIBLE} -eq 1 ] && ITEMS+="${M} ${PLATFORM} " [ "${DT}" = "true" ] && DT="-DT" || DT=""
[ ${COMPATIBLE} -eq 1 ] && ITEMS+="${M} \Zb${PLATFORM}${DT}\Zn "
done < <(find "${MODEL_CONFIG_PATH}" -maxdepth 1 -name \*.yml | sort) done < <(find "${MODEL_CONFIG_PATH}" -maxdepth 1 -name \*.yml | sort)
dialog --backtitle "`backtitle`" --menu "Choose the model" 0 0 0 \ dialog --backtitle "`backtitle`" --colors --menu "Choose the model" 0 0 0 \
${ITEMS} 2>${TMP_PATH}/resp ${ITEMS} 2>${TMP_PATH}/resp
[ $? -ne 0 ] && return [ $? -ne 0 ] && return
resp=$(<${TMP_PATH}/resp) resp=$(<${TMP_PATH}/resp)
@@ -104,9 +106,23 @@ function buildMenu() {
if [ "${BUILD}" != "${resp}" ]; then if [ "${BUILD}" != "${resp}" ]; then
BUILD=${resp} BUILD=${resp}
writeConfigKey "build" "${BUILD}" "${USER_CONFIG_FILE}" writeConfigKey "build" "${BUILD}" "${USER_CONFIG_FILE}"
DIRTY=1 # Delete synoinfo and reload model/build synoinfo
writeConfigKey "synoinfo" "{}" "${USER_CONFIG_FILE}"
while IFS="=" read KEY VALUE; do
writeConfigKey "synoinfo.${KEY}" "${VALUE}" "${USER_CONFIG_FILE}"
done < <(readModelMap "${MODEL}" "builds.${BUILD}.synoinfo")
# Check addons
PLATFORM="`readModelKey "${MODEL}" "platform"`"
KVER="`readModelKey "${MODEL}" "builds.${BUILD}.kver"`"
while IFS="=" read ADDON PARAM; do
[ -z "${ADDON}" ] && continue
if ! checkAddonExist "${ADDON}" "${PLATFORM}" "${KVER}"; then
deleteConfigKey "addons.${ADDON}" "${USER_CONFIG_FILE}"
fi
done < <(readConfigMap "addons" "${USER_CONFIG_FILE}")
# Remove old files # Remove old files
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}"
DIRTY=1
fi fi
} }
@@ -168,6 +184,7 @@ function addonMenu() {
d "Delete addon(s)" \ d "Delete addon(s)" \
s "Show user addons" \ s "Show user addons" \
m "Show all available addons" \ m "Show all available addons" \
o "Download a external addon" \
e "Exit" \ e "Exit" \
2>${TMP_PATH}/resp 2>${TMP_PATH}/resp
[ $? -ne 0 ] && return [ $? -ne 0 ] && return
@@ -238,6 +255,30 @@ function addonMenu() {
dialog --backtitle "`backtitle`" --title "Available addons" \ dialog --backtitle "`backtitle`" --title "Available addons" \
--colors --msgbox "${MSG}" 0 0 --colors --msgbox "${MSG}" 0 0
;; ;;
o)
TEXT="please enter the complete URL to download.\n"
dialog --backtitle "`backtitle`" --aspect 18 --colors --inputbox "${TEXT}" 0 0 \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && continue
URL="`<"${TMP_PATH}/resp"`"
[ -z "${URL}" ] && continue
clear
echo "Downloading ${URL}"
curl --insecure -L "${URL}" -o "${TMP_PATH}/addon.tgz" --progress-bar
if [ $? -ne 0 ]; then
dialog --backtitle "`backtitle`" --title "Error downloading" --aspect 18 \
--msgbox "Check internet, URL or cache disk space" 0 0
return 1
fi
ADDON="`untarAddon "${TMP_PATH}/addon.tgz"`"
if [ -n "${ADDON}" ]; then
dialog --backtitle "`backtitle`" --title "Success" --aspect 18 \
--msgbox "Addon '${ADDON}' added to loader" 0 0
else
dialog --backtitle "`backtitle`" --title "Invalid addon" --aspect 18 \
--msgbox "File format not recognized!" 0 0
fi
;;
e) return ;; e) return ;;
esac esac
done done
@@ -315,6 +356,11 @@ function cmdlineMenu() {
writeConfigKey "cmdline.mac1" "${MAC1}" "${USER_CONFIG_FILE}" writeConfigKey "cmdline.mac1" "${MAC1}" "${USER_CONFIG_FILE}"
writeConfigKey "cmdline.netif_num" "1" "${USER_CONFIG_FILE}" writeConfigKey "cmdline.netif_num" "1" "${USER_CONFIG_FILE}"
fi 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) s)
ITEMS="" ITEMS=""
@@ -381,8 +427,7 @@ function synoinfoMenu() {
if [ "${DT}" != "true" ]; then if [ "${DT}" != "true" ]; then
echo "x \"Set maxdisks manually\"" >> "${TMP_PATH}/menu" echo "x \"Set maxdisks manually\"" >> "${TMP_PATH}/menu"
fi fi
echo "s \"Show user synoinfo\"" >> "${TMP_PATH}/menu" echo "s \"Show synoinfo entries\"" >> "${TMP_PATH}/menu"
echo "m \"Show model/build synoinfo\"" >> "${TMP_PATH}/menu"
echo "e \"Exit\"" >> "${TMP_PATH}/menu" echo "e \"Exit\"" >> "${TMP_PATH}/menu"
# menu loop # menu loop
@@ -392,13 +437,14 @@ function synoinfoMenu() {
[ $? -ne 0 ] && return [ $? -ne 0 ] && return
case "`<${TMP_PATH}/resp`" in case "`<${TMP_PATH}/resp`" in
a) a)
dialog --backtitle "`backtitle`" --title "User synoinfo" \ dialog --backtitle "`backtitle`" --title "Synoinfo entries" \
--inputbox "Type a name of synoinfo variable" 0 0 \ --inputbox "Type a name of synoinfo entry" 0 0 \
2>${TMP_PATH}/resp 2>${TMP_PATH}/resp
[ $? -ne 0 ] && continue [ $? -ne 0 ] && continue
NAME="`sed 's/://g' <"${TMP_PATH}/resp"`" NAME="`<"${TMP_PATH}/resp"`"
dialog --backtitle "`backtitle`" --title "User synoinfo" \ [ -z "${NAME}" ] && continue
--inputbox "Type a value of '${NAME}' variable" 0 0 "${SYNOINFO[${NAME}]}" \ dialog --backtitle "`backtitle`" --title "Synoinfo entries" \
--inputbox "Type a value of '${NAME}' entry" 0 0 "${SYNOINFO[${NAME}]}" \
2>${TMP_PATH}/resp 2>${TMP_PATH}/resp
[ $? -ne 0 ] && continue [ $? -ne 0 ] && continue
VALUE="`<"${TMP_PATH}/resp"`" VALUE="`<"${TMP_PATH}/resp"`"
@@ -408,7 +454,7 @@ function synoinfoMenu() {
;; ;;
d) d)
if [ ${#SYNOINFO[@]} -eq 0 ]; then if [ ${#SYNOINFO[@]} -eq 0 ]; then
dialog --backtitle "`backtitle`" --msgbox "No user synoinfo to remove" 0 0 dialog --backtitle "`backtitle`" --msgbox "No synoinfo entries to remove" 0 0
continue continue
fi fi
ITEMS="" ITEMS=""
@@ -416,7 +462,7 @@ function synoinfoMenu() {
ITEMS+="${I} ${SYNOINFO[${I}]} off " ITEMS+="${I} ${SYNOINFO[${I}]} off "
done done
dialog --backtitle "`backtitle`" \ dialog --backtitle "`backtitle`" \
--checklist "Select synoinfo to remove" 0 0 0 ${ITEMS} \ --checklist "Select synoinfo entry to remove" 0 0 0 ${ITEMS} \
2>"${TMP_PATH}/resp" 2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && continue [ $? -ne 0 ] && continue
RESP=`<"${TMP_PATH}/resp"` RESP=`<"${TMP_PATH}/resp"`
@@ -441,15 +487,7 @@ function synoinfoMenu() {
for KEY in ${!SYNOINFO[@]}; do for KEY in ${!SYNOINFO[@]}; do
ITEMS+="${KEY}: ${SYNOINFO[$KEY]}\n" ITEMS+="${KEY}: ${SYNOINFO[$KEY]}\n"
done done
dialog --backtitle "`backtitle`" --title "User synoinfo" \ dialog --backtitle "`backtitle`" --title "Synoinfo entries" \
--aspect 18 --msgbox "${ITEMS}" 0 0
;;
m)
ITEMS=""
while IFS="=" read KEY VALUE; do
ITEMS+="${KEY}: ${VALUE}\n"
done < <(readModelMap "${MODEL}" "builds.${BUILD}.synoinfo")
dialog --backtitle "`backtitle`" --title "Model/build synoinfo" \
--aspect 18 --msgbox "${ITEMS}" 0 0 --aspect 18 --msgbox "${ITEMS}" 0 0
;; ;;
e) return ;; e) return ;;
@@ -744,8 +782,8 @@ function updateMenu() {
fi fi
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--infobox "Installing new files" 0 0 --infobox "Installing new files" 0 0
mv /tmp/bzImage /mnt/p1/bzImage-arpl mv /tmp/bzImage "${ARPL_BZIMAGE_FILE}"
mv /tmp/rootfs.cpio.xz /mnt/p1/initrd-arpl mv /tmp/rootfs.cpio.xz "${ARPL_RAMDISK_FILE}"
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--yesno "Arpl updated with success to ${TAG}!\nReboot?" 0 0 --yesno "Arpl updated with success to ${TAG}!\nReboot?" 0 0
[ $? -ne 0 ] && continue [ $? -ne 0 ] && continue
@@ -777,13 +815,13 @@ function updateMenu() {
unzip /tmp/addons.zip -d /tmp/addons >/dev/null 2>&1 unzip /tmp/addons.zip -d /tmp/addons >/dev/null 2>&1
dialog --backtitle "`backtitle`" --title "Update addons" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update addons" --aspect 18 \
--infobox "Installing new addons" 0 0 --infobox "Installing new addons" 0 0
DEST_PATH="/mnt/p3/addons"
for PKG in `ls /tmp/addons/*.addon`; do for PKG in `ls /tmp/addons/*.addon`; do
ADDON=`basename ${PKG} | sed 's|.addon||'` ADDON=`basename ${PKG} | sed 's|.addon||'`
rm -rf "${DEST_PATH}/${ADDON}" rm -rf "${ADDONS_PATH}/${ADDON}"
mkdir -p "${DEST_PATH}/${ADDON}" mkdir -p "${ADDONS_PATH}/${ADDON}"
tar xaf "${PKG}" -C "${DEST_PATH}/${ADDON}" >/dev/null 2>&1 tar xaf "${PKG}" -C "${ADDONS_PATH}/${ADDON}" >/dev/null 2>&1
done done
DIRTY=1
dialog --backtitle "`backtitle`" --title "Update addons" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update addons" --aspect 18 \
--msgbox "Addons updated with success!" 0 0 --msgbox "Addons updated with success!" 0 0
;; ;;
@@ -809,6 +847,7 @@ function updateMenu() {
--infobox "Extracting last version" 0 0 --infobox "Extracting last version" 0 0
rm -rf "${LKM_PATH}/"* rm -rf "${LKM_PATH}/"*
unzip /tmp/rp-lkms.zip -d "${LKM_PATH}" >/dev/null 2>&1 unzip /tmp/rp-lkms.zip -d "${LKM_PATH}" >/dev/null 2>&1
DIRTY=1
dialog --backtitle "`backtitle`" --title "Update LKMs" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update LKMs" --aspect 18 \
--msgbox "LKMs updated with success!" 0 0 --msgbox "LKMs updated with success!" 0 0
;; ;;
@@ -845,6 +884,7 @@ function updateMenu() {
rm "${MODULES_PATH}/${P}.tgz" rm "${MODULES_PATH}/${P}.tgz"
mv "/tmp/${P}.tgz" "${MODULES_PATH}/${P}.tgz" mv "/tmp/${P}.tgz" "${MODULES_PATH}/${P}.tgz"
done done
DIRTY=1
dialog --backtitle "`backtitle`" --title "Update Modules" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update Modules" --aspect 18 \
--msgbox "Modules updated with success!" 0 0 --msgbox "Modules updated with success!" 0 0
;; ;;

View File

@@ -11,6 +11,8 @@ synoinfo: &synoinfo
updateurl: "http://example.com/" updateurl: "http://example.com/"
myds_region_api_base_url: "https://example.com" myds_region_api_base_url: "https://example.com"
security_version_server: "https://example.com/smallupdate" security_version_server: "https://example.com/smallupdate"
supportraidgroup: "no"
supportssdcache: "no"
cmdline: &cmdline cmdline: &cmdline
SMBusHddDynamicPower: 1 SMBusHddDynamicPower: 1
vender_format_version: 2 vender_format_version: 2
@@ -47,3 +49,21 @@ builds:
- "ramdisk-common-disable-root-pwd.patch" - "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-common-post-init-script.patch" - "ramdisk-common-post-init-script.patch"
42661:
ver: "7.1.0"
kver: "4.4.180"
rd-compressed: false
efi-bug: no
cmdline:
<<: *cmdline
synoinfo:
<<: *synoinfo
pat:
url: "https://global.download.synology.com/download/DSM/release/7.1/42661-1/DSM_DS2422%2B_42661.pat"
hash: "c38fee0470c592b679ab52a64eac76b2a3912fb2e6aba65a65abb5aa05a98d4c"
ramdisk-hash: "bb109132e96b1e26d5e3d44557944f7518168d8cb18e35d6254c0dfe7fb19382"
zimage-hash: "d939b5937be00a644aae64c33633619a7c310433e60a515c77bbef00b0a7e6b6"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42661-post-init-script.patch"

View File

@@ -7,6 +7,10 @@ synoinfo: &synoinfo
small_info_path: "https://example.com/null" small_info_path: "https://example.com/null"
updateurl: "http://example.com/" updateurl: "http://example.com/"
myds_region_api_base_url: "https://example.com" myds_region_api_base_url: "https://example.com"
support_disk_compatibility: "no"
support_memory_compatibility: "no"
supportraidgroup: "no"
supportssdcache: "no"
cmdline: &cmdline cmdline: &cmdline
syno_hdd_powerup_seq: 0 syno_hdd_powerup_seq: 0
HddHotplug: 0 HddHotplug: 0

View File

@@ -11,6 +11,10 @@ synoinfo: &synoinfo
updateurl: "http://example.com/" updateurl: "http://example.com/"
myds_region_api_base_url: "https://example.com" myds_region_api_base_url: "https://example.com"
security_version_server: "https://example.com/smallupdate" security_version_server: "https://example.com/smallupdate"
support_disk_compatibility: "no"
support_memory_compatibility: "no"
supportraidgroup: "no"
supportssdcache: "no"
cmdline: &cmdline cmdline: &cmdline
syno_hdd_powerup_seq: 0 syno_hdd_powerup_seq: 0
HddHotplug: 0 HddHotplug: 0

View File

@@ -44,10 +44,7 @@ RD_COMPRESSED="`readModelKey "${MODEL}" "builds.${BUILD}.rd-compressed"`"
declare -A SYNOINFO declare -A SYNOINFO
declare -A ADDONS declare -A ADDONS
# Read more config # Read synoinfo and addons from config
while IFS="=" read KEY VALUE; do
[ -n "${KEY}" ] && SYNOINFO["${KEY}"]="${VALUE}"
done < <(readModelMap "${MODEL}" "builds.${BUILD}.synoinfo")
while IFS="=" read KEY VALUE; do while IFS="=" read KEY VALUE; do
[ -n "${KEY}" ] && SYNOINFO["${KEY}"]="${VALUE}" [ -n "${KEY}" ] && SYNOINFO["${KEY}"]="${VALUE}"
done < <(readConfigMap "synoinfo" "${USER_CONFIG_FILE}") done < <(readConfigMap "synoinfo" "${USER_CONFIG_FILE}")
@@ -92,12 +89,11 @@ for F in `ls "${TMP_PATH}/modules/"*.ko`; do
# [ -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] || mv "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}" # [ -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] || mv "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}"
cp "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}" cp "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}"
done done
mkdir -p "${RAMDISK_PATH}/usr/lib/firmware"
gzip -dc "${CACHE_PATH}/modules/firmware.tgz" | tar xf - -C "${RAMDISK_PATH}/usr/lib/firmware"
# Clean # Clean
rm -rf "${TMP_PATH}/modules" rm -rf "${TMP_PATH}/modules"
# Build modules dependencies
/opt/arpl/depmod -a -b ${RAMDISK_PATH} 2>/dev/null
echo -n "." echo -n "."
# Copying fake modprobe # Copying fake modprobe
cp "${PATCH_PATH}/iosched-trampoline.sh" "${RAMDISK_PATH}/usr/sbin/modprobe" cp "${PATCH_PATH}/iosched-trampoline.sh" "${RAMDISK_PATH}/usr/sbin/modprobe"
@@ -108,16 +104,22 @@ cp "${LKM_PATH}/rp-${PLATFORM}-${KVER}-${LKM}.ko" "${RAMDISK_PATH}/usr/lib/modul
MAXDISKS=`readConfigKey "maxdisks" "${USER_CONFIG_FILE}"` MAXDISKS=`readConfigKey "maxdisks" "${USER_CONFIG_FILE}"`
# Check if model needs Device-tree dynamic patch # Check if model needs Device-tree dynamic patch
DT="`readModelKey "${MODEL}" "dt"`" DT="`readModelKey "${MODEL}" "dt"`"
# Add system addon "dtbpatch" or "maxdisks"
[ "${DT}" = "true" ] && ADDONS['dtbpatch']="" || ADDONS['maxdisks']="${MAXDISKS}"
# Indispensable eudev system addon
ADDONS['eudev']=""
echo -n "." echo -n "."
mkdir -p "${RAMDISK_PATH}/addons" mkdir -p "${RAMDISK_PATH}/addons"
echo "#!/bin/sh" > "${RAMDISK_PATH}/addons/addons.sh" echo "#!/bin/sh" > "${RAMDISK_PATH}/addons/addons.sh"
echo 'export INSMOD="/sbin/insmod"' >> "${RAMDISK_PATH}/addons/addons.sh"
echo 'echo "addons.sh called with params ${@}"' >> "${RAMDISK_PATH}/addons/addons.sh" echo 'echo "addons.sh called with params ${@}"' >> "${RAMDISK_PATH}/addons/addons.sh"
# Required eudev and dtbpatch/maxdisks
installAddon eudev
echo "/addons/eudev.sh \${1} " >> "${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
if [ "${DT}" = "true" ]; then
installAddon dtbpatch
echo "/addons/dtbpatch.sh \${1} " >> "${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
else
installAddon maxdisks
echo "/addons/maxdisks.sh \${1} ${MAXDISKS}" >> "${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
fi
# User addons
for ADDON in ${!ADDONS[@]}; do for ADDON in ${!ADDONS[@]}; do
PARAMS=${ADDONS[${ADDON}]} PARAMS=${ADDONS[${ADDON}]}
if ! installAddon ${ADDON}; then if ! installAddon ${ADDON}; then
@@ -128,6 +130,9 @@ for ADDON in ${!ADDONS[@]}; do
done done
chmod +x "${RAMDISK_PATH}/addons/addons.sh" chmod +x "${RAMDISK_PATH}/addons/addons.sh"
# Build modules dependencies
/opt/arpl/depmod -a -b ${RAMDISK_PATH} 2>/dev/null
# Reassembly ramdisk # Reassembly ramdisk
echo -n "." echo -n "."
if [ "${RD_COMPRESSED}" == "true" ]; then if [ "${RD_COMPRESSED}" == "true" ]; then

View File

@@ -6,7 +6,7 @@ terminal_input console
terminal_output console terminal_output console
set default="0" set default="0"
set timeout="3" set timeout="5"
set timeout_style="menu" set timeout_style="menu"
insmod loadenv insmod loadenv
@@ -51,8 +51,8 @@ if serial --unit=0 --speed=115200; then
fi fi
insmod search insmod search
search --set=root --label "ARPL1" search --set=root --label "ARPL3"
if [ -s /zImage -a -s /rd.gz ]; then if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
menuentry 'Boot DSM' --id boot { menuentry 'Boot DSM' --id boot {
echo "Loading kernel..." echo "Loading kernel..."
linux /bzImage-arpl console=ttyS0,115200n8 quiet linux /bzImage-arpl console=ttyS0,115200n8 quiet
@@ -60,6 +60,13 @@ if [ -s /zImage -a -s /rd.gz ]; then
initrd /initrd-arpl initrd /initrd-arpl
echo "Booting..." echo "Booting..."
} }
menuentry 'Force re-install DSM' --id junior {
echo "Loading kernel..."
linux /bzImage-arpl console=ttyS0,115200n8 quiet force_junior
echo "Loading initramfs..."
initrd /initrd-arpl
echo "Booting..."
}
else else
set timeout="1" set timeout="1"
fi fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,25 @@
version: 1
name: 9p
description: "Driver for virtio 9p"
available-for:
bromolow-3.10.108:
install-script: &script "install.sh"
copy: "bromolow-3.10.108"
apollolake-4.4.180:
install-script: *script
copy: "apollolake-4.4.180"
broadwell-4.4.180:
install-script: *script
copy: "broadwell-4.4.180"
broadwellnk-4.4.180:
install-script: *script
copy: "broadwellnk-4.4.180"
denverton-4.4.180:
install-script: *script
copy: "denverton-4.4.180"
geminilake-4.4.180:
install-script: *script
copy: "geminilake-4.4.180"
v1000-4.4.180:
install-script: *script
copy: "v1000-4.4.180"

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,7 @@
version: 1
name: i915
description: "Intel iGPU Drivers (10th Gen)"
available-for:
geminilake-4.4.180:
install-script: "install.sh"
copy: "geminilake-4.4.180"

Binary file not shown.

View File

@@ -37,12 +37,11 @@ BR2_PACKAGE_NVME=y
BR2_PACKAGE_PCIUTILS=y BR2_PACKAGE_PCIUTILS=y
BR2_PACKAGE_SMARTMONTOOLS=y BR2_PACKAGE_SMARTMONTOOLS=y
BR2_PACKAGE_USBUTILS=y BR2_PACKAGE_USBUTILS=y
BR2_PACKAGE_PHP=y
BR2_PACKAGE_PHP_SAPI_CLI=y
BR2_PACKAGE_DTC=y BR2_PACKAGE_DTC=y
BR2_PACKAGE_DTC_PROGRAMS=y BR2_PACKAGE_DTC_PROGRAMS=y
BR2_PACKAGE_LIBCURL=y BR2_PACKAGE_LIBCURL=y
BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_LIBCURL_CURL=y
BR2_PACKAGE_PCRE2=y
BR2_PACKAGE_DHCPCD=y BR2_PACKAGE_DHCPCD=y
BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_OPENSSH=y
# BR2_PACKAGE_OPENSSH_CLIENT is not set # BR2_PACKAGE_OPENSSH_CLIENT is not set
@@ -63,3 +62,4 @@ BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_E2FSPROGS=y BR2_PACKAGE_HOST_E2FSPROGS=y
BR2_PACKAGE_R8168=y BR2_PACKAGE_R8168=y
BR2_PACKAGE_R8125=y BR2_PACKAGE_R8125=y

View File

@@ -49,6 +49,7 @@ if [ -d ../arpl-addons ]; then
echo "${D}" echo "${D}"
(cd ${D} && tar caf "${MODULES_DIR}/${D}.tgz" *.ko) (cd ${D} && tar caf "${MODULES_DIR}/${D}.tgz" *.ko)
done done
(cd firmware && tar caf "${MODULES_DIR}/firmware.tgz" *)
cd - cd -
else else
TAG=`curl -s https://api.github.com/repos/fbelavenuto/arpl-modules/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'` TAG=`curl -s https://api.github.com/repos/fbelavenuto/arpl-modules/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
@@ -56,6 +57,7 @@ else
FILE="${PLATFORM}-${KVER}" FILE="${PLATFORM}-${KVER}"
curl -L "https://github.com/fbelavenuto/arpl-modules/releases/download/${TAG}/${FILE}.tgz" -o "${MODULES_DIR}/${FILE}.tgz" curl -L "https://github.com/fbelavenuto/arpl-modules/releases/download/${TAG}/${FILE}.tgz" -o "${MODULES_DIR}/${FILE}.tgz"
done < PLATFORMS done < PLATFORMS
curl -L "https://github.com/fbelavenuto/arpl-modules/releases/download/${TAG}/firmware.tgz" -o "${MODULES_DIR}/firmware.tgz"
fi fi
# Copy files # Copy files
@@ -71,7 +73,8 @@ echo "Version: ${VERSION}"
echo "Building... Drink a coffee and wait!" echo "Building... Drink a coffee and wait!"
make BR2_EXTERNAL=../external make BR2_EXTERNAL=../external
cd - cd -
qemu-img convert -O vmdk arpl.img arpl.vmdk qemu-img convert -O vmdk -o adapter_type=lsilogic arpl.img arpl.vmdk
#qemu-img convert -O vmdk -o adapter_type=lsilogic arpl.img -o subformat=monolithicFlat arpl.vmdk
[ -x test.sh ] && ./test.sh [ -x test.sh ] && ./test.sh
rm -f *.zip rm -f *.zip
zip -9 "arpl-${VERSION}.img.zip" arpl.img zip -9 "arpl-${VERSION}.img.zip" arpl.img