Compare commits

...

40 Commits

Author SHA1 Message Date
Fabio Belavenuto
0a01291188 Merge pull request #188 from fbelavenuto/firmwares
Adding buildroot firmwares
2022-09-22 13:25:56 -03:00
Fabio Belavenuto
fe8258b8a8 Adding buildroot firmwares 2022-09-22 13:25:41 -03:00
Fabio Belavenuto
ebf1bf2e24 Merge pull request #187 from fbelavenuto/arpl-reboot
Added missing arpl-reboot
2022-09-22 11:39:32 -03:00
Fabio Belavenuto
15194a396c Added missing arpl-reboot 2022-09-22 11:39:17 -03:00
Fabio Belavenuto
a62bba0eff Merge pull request #186 from fbelavenuto/patch-cmos-write
Add patch rtc_cmos_write (issue #174)
2022-09-22 11:37:56 -03:00
Fabio Belavenuto
6253ab9b20 Add patch rtc_cmos_write (issue #174)
Another improvements
2022-09-22 11:26:05 -03:00
Fabio Belavenuto
8fe3c41ce4 Merge pull request #180 from fbelavenuto/checksum-yet
Checksum yet
2022-09-19 16:35:34 -03:00
Fabio Belavenuto
e097941014 Checksum yet 2022-09-19 16:35:21 -03:00
Fabio Belavenuto
67f1ee8066 Merge pull request #179 from fbelavenuto/fixing-checksum
Fixing checksum
2022-09-19 14:01:40 -03:00
Fabio Belavenuto
f74d889ce3 Fixing checksum 2022-09-19 14:01:27 -03:00
Fabio Belavenuto
9ac8279c2b Merge pull request #178 from fbelavenuto/update-fix
Testing actions
2022-09-19 11:31:18 -03:00
Fabio Belavenuto
f5220d1468 Testing actions 2022-09-19 11:30:57 -03:00
Fabio Belavenuto
7898b54980 Merge pull request #177 from fbelavenuto/update-fix
Testing update checksum check
2022-09-19 10:07:58 -03:00
Fabio Belavenuto
2ad2825c46 Testing update checksum check 2022-09-19 10:07:41 -03:00
Fabio Belavenuto
8b9b1439b3 Merge pull request #171 from fbelavenuto/fix-eudev
addon eudev with RAID mount bug fixed
2022-09-15 16:38:32 -03:00
Fabio Belavenuto
da89a97182 addon eudev with RAID mount bug fixed
script to reboot into another mode (junior/config)
Anothers minor changes
2022-09-15 16:38:02 -03:00
Fabio Belavenuto
19ec462570 Merge pull request #170 from fbelavenuto/debug
Adding resources to facilitate debug by author
2022-09-15 14:09:12 -03:00
Fabio Belavenuto
8cc750a527 Adding resources to facilitate debug by author 2022-09-15 14:08:52 -03:00
Fabio Belavenuto
c5ec8f7d24 Merge pull request #169 from fbelavenuto/ram-warning
Adding low memory warning
2022-09-15 14:06:18 -03:00
Fabio Belavenuto
82acaabe26 Adding low memory warning 2022-09-15 14:05:35 -03:00
Fabio Belavenuto
dc7076709c Merge pull request #167 from jimmyGALLAND/main
fix dfree smb error
2022-09-15 08:51:09 -03:00
JimmyGALLAND
eeec01864f fix dfree smb error 2022-09-14 22:26:25 +02:00
Fabio Belavenuto
dc102f5af7 Create FUNDING.yml 2022-09-13 18:38:10 -03:00
Fabio Belavenuto
d4c342c0fd Merge pull request #157 from fbelavenuto/dev
Testing actions
2022-09-09 11:35:17 -03:00
Fabio Belavenuto
8fff3377be Testing actions 2022-09-09 11:35:00 -03:00
Fabio Belavenuto
bb130cdc23 Update main.yml 2022-09-06 20:43:15 -03:00
Fabio Belavenuto
6c2f0b936e Merge pull request #149 from fbelavenuto/fbmod
Fixing fb modules
2022-09-06 17:01:37 -03:00
Fabio Belavenuto
fe7fbf4821 Fixing fb modules 2022-09-06 17:01:24 -03:00
Fabio Belavenuto
e669a94738 Merge pull request #143 from fbelavenuto/dev
Fixing updates (checking curl HTTP status)
2022-09-05 15:06:35 -03:00
Fabio Belavenuto
6d9c217b7d Fixing updates (checking curl HTTP status) 2022-09-05 13:18:21 -03:00
Fabio Belavenuto
0777beadc1 Merge pull request #142 from fbelavenuto/dev
New buildnumber
2022-09-05 10:09:40 -03:00
Fabio Belavenuto
04e5e5dc21 New buildnumber 2022-09-05 10:09:18 -03:00
Fabio Belavenuto
db33698894 Merge pull request #136 from fbelavenuto/r8169
Adding r8169 and removing r8168, for loader
2022-08-26 08:22:25 -03:00
Fabio Belavenuto
87f72b50cc Adding r8169 and removing r8168, for loader 2022-08-26 08:22:06 -03:00
Fabio Belavenuto
35bd08a9c4 Merge pull request #135 from fbelavenuto/link-folders-p3
Link to cache partition for ARPL model-config and patch
2022-08-25 15:04:40 -03:00
Fabio Belavenuto
e7303130d6 Link to cache partition for ARPL model-config and patch 2022-08-25 14:42:45 -03:00
Fabio Belavenuto
4f2014ee14 Merge pull request #134 from fbelavenuto/synoinfo-loader-bug
Bug in loader synoinfo.conf patch
2022-08-25 14:39:41 -03:00
Fabio Belavenuto
3382821c81 Bug in loader synoinfo.conf patch 2022-08-25 14:39:26 -03:00
Fabio Belavenuto
f283cc3f54 Merge pull request #133 from fbelavenuto/fb-mods
Added framebuffer drivers for loader
2022-08-25 13:59:17 -03:00
Fabio Belavenuto
78dfc09716 Added framebuffer drivers for loader 2022-08-25 13:58:54 -03:00
77 changed files with 798 additions and 137 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
# These are supported funding model platforms
github: fbelavenuto

View File

@@ -2,8 +2,8 @@ name: Build image
on: on:
push: push:
# branches: branches:
# - main - main
tags: tags:
- v* - v*
workflow_dispatch: workflow_dispatch:
@@ -54,25 +54,25 @@ jobs:
rm -rf .buildroot/board/arpl/p1 rm -rf .buildroot/board/arpl/p1
rm -rf .buildroot/board/arpl/p3 rm -rf .buildroot/board/arpl/p3
# Get latest LKMs # Get latest LKMs
# echo "Getting latest LKMs" echo "Getting latest LKMs"
# TAG=`curl -s https://api.github.com/repos/fbelavenuto/redpill-lkm/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'` TAG=`curl -s https://api.github.com/repos/fbelavenuto/redpill-lkm/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
# curl -L "https://github.com/fbelavenuto/redpill-lkm/releases/download/${TAG}/rp-lkms.zip" -o /tmp/rp-lkms.zip curl -L "https://github.com/fbelavenuto/redpill-lkm/releases/download/${TAG}/rp-lkms.zip" -o /tmp/rp-lkms.zip
# rm -rf files/board/arpl/p3/lkms/* rm -rf files/board/arpl/p3/lkms/*
# unzip /tmp/rp-lkms.zip -d files/board/arpl/p3/lkms unzip /tmp/rp-lkms.zip -d files/board/arpl/p3/lkms
# # Get latest addons and install its # Get latest addons and install its
# echo "Getting latest Addons" echo "Getting latest Addons"
# TAG=`curl -s https://api.github.com/repos/fbelavenuto/arpl-addons/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'` TAG=`curl -s https://api.github.com/repos/fbelavenuto/arpl-addons/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
# curl -L "https://github.com/fbelavenuto/arpl-addons/releases/download/${TAG}/addons.zip" -o /tmp/addons.zip curl -L "https://github.com/fbelavenuto/arpl-addons/releases/download/${TAG}/addons.zip" -o /tmp/addons.zip
# mkdir -p /tmp/addons mkdir -p /tmp/addons
# unzip /tmp/addons.zip -d /tmp/addons unzip /tmp/addons.zip -d /tmp/addons
# DEST_PATH="files/board/arpl/p3/addons" DEST_PATH="files/board/arpl/p3/addons"
# echo "Installing addons to ${DEST_PATH}" echo "Installing addons to ${DEST_PATH}"
# 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||'`
# mkdir -p "${DEST_PATH}/${ADDON}" mkdir -p "${DEST_PATH}/${ADDON}"
# echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}" echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}"
# tar xaf "${PKG}" -C "${DEST_PATH}/${ADDON}" tar xaf "${PKG}" -C "${DEST_PATH}/${ADDON}"
# done done
# Copy files # Copy files
echo "Copying files" echo "Copying files"
sed 's/^ARPL_VERSION=.*/ARPL_VERSION="'${VERSION}'"/' -i files/board/arpl/overlayfs/opt/arpl/include/consts.sh sed 's/^ARPL_VERSION=.*/ARPL_VERSION="'${VERSION}'"/' -i files/board/arpl/overlayfs/opt/arpl/include/consts.sh
@@ -87,12 +87,13 @@ jobs:
#qemu-img convert -O vmdk arpl.img arpl.vmdk #qemu-img convert -O vmdk arpl.img arpl.vmdk
qemu-img convert -O vmdk -o adapter_type=lsilogic arpl.img -o subformat=monolithicFlat arpl.vmdk qemu-img convert -O vmdk -o adapter_type=lsilogic arpl.img -o subformat=monolithicFlat arpl.vmdk
# Zip image # Zip image and generate checksum
- name: Pack - name: Pack
shell: bash shell: bash
run: | run: |
zip -9 "arpl-${{ steps.build.outputs.VERSION }}.img.zip" arpl.img zip -9 "arpl-${{ steps.build.outputs.VERSION }}.img.zip" arpl.img
zip -9 "arpl-${{ steps.build.outputs.VERSION }}.vmdk.zip" arpl*.vmdk zip -9 "arpl-${{ steps.build.outputs.VERSION }}.vmdk.zip" arpl*.vmdk
(cd .buildroot/output/images && sha256sum bzImage rootfs.cpio.xz) >> sha256sum
# Upload artifact # Upload artifact
- name: Upload - name: Upload
@@ -114,3 +115,4 @@ jobs:
arpl-${{ steps.build.outputs.VERSION }}.vmdk.zip arpl-${{ steps.build.outputs.VERSION }}.vmdk.zip
.buildroot/output/images/bzImage .buildroot/output/images/bzImage
.buildroot/output/images/rootfs.cpio.xz .buildroot/output/images/rootfs.cpio.xz
sha256sum

2
.gitignore vendored
View File

@@ -4,7 +4,7 @@ arpl*.img
arpl*.vmdk arpl*.vmdk
*.zip *.zip
.buildroot .buildroot
test.sh test*.sh
docker/Dockerfile docker/Dockerfile
docker/cache docker/cache
*.bak *.bak

View File

@@ -4,23 +4,29 @@ This particular project was created to facilitate my testing with Redpill and I
It is still in alpha stage, with little documentation, but it is functional. I'm Brazilian and my English is not good, so I apologize for my translations. It is still in alpha stage, with little documentation, but it is functional. I'm Brazilian and my English is not good, so I apologize for my translations.
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 smallupdate, the loader re-applies the patches. The most important kernel modules are built into the DSM ramdisk image for automatic peripheral detection.
# Important
## 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
## You must have at least 4GB of RAM, both in baremetal and VMs
## The DSM kernel is compatible with SATA ports, not SAS/SCSI/etc. For device-tree models only SATA ports work. For the other models, another type of disks may work.
# Use # 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. 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, uses the "Change MAC" into "cmdline" menu.
If a model is chosen that uses the Device-tree system to define the HDs, there is no need to configure anything. In the case of models that do not use device-tree, the configurations must be done manually and for this there is an option in the "Cmdline" menu to display the SATA controllers, DUMMY ports and ports in use, to assist in the creation of the "SataPortMap", "DiskIdxMap" and "sata_remap" if necessary. If a model is chosen that uses the Device-tree system to define the HDs, there is no need to configure anything. In the case of models that do not use device-tree, the configurations must be done manually and for this there is an option in the "cmdline" menu to display the SATA controllers, DUMMY ports and ports in use, to assist in the creation of the "SataPortMap", "DiskIdxMap" and "sata_remap" if necessary.
Another important point is that the loader detects whether or not the CPU has the FMA3 instruction and does not display the models that require it. So if the DS918+ and DVA3221 models are not displayed it is because of the CPU's lack of support for FMA instructions. Another important point is that the loader detects whether or not the CPU has the FMA3 instruction and does not display the models that require it. So if the DS918+ and DVA3221 models are not displayed it is because of the CPU's lack of support for FMA instructions. You can disable this restriction and test at your own risk.
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.

View File

@@ -1 +1 @@
0.4-alpha4 0.4-alpha11

View File

@@ -110,6 +110,8 @@ CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y CONFIG_DEVTMPFS_MOUNT=y
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_FW_LOADER_COMPRESS=y
CONFIG_DEBUG_DEVRES=y CONFIG_DEBUG_DEVRES=y
CONFIG_CONNECTOR=y CONFIG_CONNECTOR=y
CONFIG_EFI_VARS=y CONFIG_EFI_VARS=y
@@ -143,7 +145,7 @@ CONFIG_MEGARAID_MM=m
CONFIG_MEGARAID_MAILBOX=m CONFIG_MEGARAID_MAILBOX=m
CONFIG_MEGARAID_LEGACY=m CONFIG_MEGARAID_LEGACY=m
CONFIG_MEGARAID_SAS=m CONFIG_MEGARAID_SAS=m
CONFIG_SCSI_MPT2SAS=m CONFIG_SCSI_MPT3SAS=m
CONFIG_SCSI_MPI3MR=m CONFIG_SCSI_MPI3MR=m
CONFIG_SCSI_SMARTPQI=m CONFIG_SCSI_SMARTPQI=m
CONFIG_SCSI_UFSHCD=m CONFIG_SCSI_UFSHCD=m
@@ -178,49 +180,35 @@ CONFIG_SCSI_VIRTIO=m
CONFIG_SCSI_DH=y CONFIG_SCSI_DH=y
CONFIG_ATA=y CONFIG_ATA=y
CONFIG_SATA_AHCI=y CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=m
CONFIG_SATA_ACARD_AHCI=m
CONFIG_SATA_SIL24=m
CONFIG_PDC_ADMA=m
CONFIG_SATA_QSTOR=m
CONFIG_ATA_PIIX=y CONFIG_ATA_PIIX=y
CONFIG_SATA_DWC=m
CONFIG_SATA_MV=m CONFIG_SATA_MV=m
CONFIG_SATA_NV=m CONFIG_SATA_NV=m
CONFIG_SATA_PROMISE=m
CONFIG_SATA_SIL=m CONFIG_SATA_SIL=m
CONFIG_SATA_SIS=m CONFIG_SATA_SIS=m
CONFIG_SATA_SVW=m
CONFIG_SATA_ULI=m CONFIG_SATA_ULI=m
CONFIG_SATA_VIA=m CONFIG_SATA_VIA=m
CONFIG_PATA_ALI=m CONFIG_SATA_VITESSE=m
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_PDC2027X=m
CONFIG_PATA_PDC_OLD=m
CONFIG_PATA_RDC=m
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
CONFIG_BLK_DEV_DM=y CONFIG_BLK_DEV_DM=y
CONFIG_DM_MIRROR=y CONFIG_DM_MIRROR=y
CONFIG_DM_RAID=m
CONFIG_DM_ZERO=y CONFIG_DM_ZERO=y
CONFIG_FUSION=y CONFIG_FUSION=y
CONFIG_FUSION_SPI=m CONFIG_FUSION_SPI=m
CONFIG_FUSION_SAS=m CONFIG_FUSION_SAS=m
CONFIG_FUSION_CTL=m CONFIG_FUSION_CTL=m
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_NET_TEAM=m
CONFIG_MACVLAN=m CONFIG_MACVLAN=m
CONFIG_IPVLAN=m CONFIG_IPVLAN=m
CONFIG_VXLAN=m CONFIG_VXLAN=m
@@ -298,6 +286,7 @@ CONFIG_QED=m
CONFIG_QEDE=m CONFIG_QEDE=m
CONFIG_QCOM_EMAC=m CONFIG_QCOM_EMAC=m
CONFIG_RMNET=m CONFIG_RMNET=m
CONFIG_R8169=m
CONFIG_SXGBE_ETH=m CONFIG_SXGBE_ETH=m
CONFIG_SFC=m CONFIG_SFC=m
# CONFIG_SFC_MCDI_MON is not set # CONFIG_SFC_MCDI_MON is not set
@@ -371,8 +360,11 @@ CONFIG_AGP=y
CONFIG_AGP_AMD64=y CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y CONFIG_AGP_INTEL=y
CONFIG_DRM=y CONFIG_DRM=y
CONFIG_DRM_VIRTIO_GPU=m
CONFIG_FB=y CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
CONFIG_FB_TILEBLITTING=y
CONFIG_FB_VGA16=m
CONFIG_FB_UVESA=m
CONFIG_FB_VESA=y CONFIG_FB_VESA=y
CONFIG_FB_EFI=y CONFIG_FB_EFI=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_CLASS_DEVICE=y
@@ -448,9 +440,6 @@ CONFIG_AUTOFS4_FS=y
CONFIG_MSDOS_FS=y CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y CONFIG_VFAT_FS=y
CONFIG_PROC_KCORE=y CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_INODE64=y
CONFIG_HUGETLBFS=y CONFIG_HUGETLBFS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y CONFIG_NFS_V3_ACL=y

View File

@@ -45,8 +45,6 @@ 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
cp "${BINARIES_DIR}/bzImage" ~/bzImage-arpl
cp "${BINARIES_DIR}/rootfs.cpio.xz" ~/initrd-arpl
echo "Unmount image file" echo "Unmount image file"
sudo umount "${BINARIES_DIR}/p1" sudo umount "${BINARIES_DIR}/p1"

View File

@@ -4,6 +4,8 @@
obey pam restrictions = yes obey pam restrictions = yes
map to guest = Bad User map to guest = Bad User
usershare allow guests = yes usershare allow guests = yes
dfree command = /usr/bin/df
[arpl] [arpl]
browseable = yes browseable = yes
public = yes public = yes

View File

@@ -1,5 +1,5 @@
ARPL_VERSION="0.4-alpha4" ARPL_VERSION="0.4-alpha11"
# Define paths # Define paths
TMP_PATH="/tmp" TMP_PATH="/tmp"

View File

@@ -146,3 +146,25 @@ function arrayExistItem() {
done done
return ${EXISTS} return ${EXISTS}
} }
###############################################################################
# Replace/remove/add values in .conf K=V file
# 1 - name
# 2 - new_val
# 3 - path
function _set_conf_kv() {
# Delete
if [ -z "$2" ]; then
sed -i "$3" -e "s/^$1=.*$//"
return $?;
fi
# Replace
if grep -q "^$1=" "$3"; then
sed -i "$3" -e "s\"^$1=.*\"$1=\\\"$2\\\"\""
return $?
fi
# Add if doesn't exist
echo "$1=\"$2\"" >> $3
}

View File

@@ -50,6 +50,17 @@ ln -s "${CACHE_PATH}/ssh" "/etc/ssh"
rm -rf ~/.bash_history rm -rf ~/.bash_history
ln -s ${CACHE_PATH}/.bash_history ~/.bash_history ln -s ${CACHE_PATH}/.bash_history ~/.bash_history
# Check if exists directories into P3 partition, if yes remove and link it
if [ -d "${CACHE_PATH}/model-configs" ]; then
rm -rf "${MODEL_CONFIG_PATH}"
ln -s "${CACHE_PATH}/model-configs" "${MODEL_CONFIG_PATH}"
fi
if [ -d "${CACHE_PATH}/patch" ]; then
rm -rf "${PATCH_PATH}"
ln -s "${CACHE_PATH}/patch" "${PATCH_PATH}"
fi
# Get first MAC address # Get first MAC address
MAC=`ip link show eth0 | awk '/ether/{print$2}'` MAC=`ip link show eth0 | awk '/ether/{print$2}'`
MACF=`echo ${MAC} | sed 's/://g'` MACF=`echo ${MAC} | sed 's/://g'`
@@ -169,6 +180,12 @@ 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
# Check memory
RAM=`free -m | awk '/Mem:/{print$2}'`
if [ ${RAM} -le 3500 ]; then
echo -e "\033[1;33mYou have less than 4GB of RAM, if errors occur in loader creation, please increase the amount of memory.\033[0m\n"
fi
mkdir -p "${ADDONS_PATH}" mkdir -p "${ADDONS_PATH}"
mkdir -p "${LKM_PATH}" mkdir -p "${LKM_PATH}"
mkdir -p "${MODULES_PATH}" mkdir -p "${MODULES_PATH}"

View File

@@ -287,8 +287,8 @@ function addonMenu() {
[ -z "${URL}" ] && continue [ -z "${URL}" ] && continue
clear clear
echo "Downloading ${URL}" echo "Downloading ${URL}"
curl --insecure -L "${URL}" -o "${TMP_PATH}/addon.tgz" --progress-bar STATUS=`curl --insecure -w "%{http_code}" -L "${URL}" -o "${TMP_PATH}/addon.tgz" --progress-bar`
if [ $? -ne 0 ]; then if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Error downloading" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Error downloading" --aspect 18 \
--msgbox "Check internet, URL or cache disk space" 0 0 --msgbox "Check internet, URL or cache disk space" 0 0
return 1 return 1
@@ -546,8 +546,8 @@ function extractDsmFiles() {
echo "${PAT_FILE} cached." echo "${PAT_FILE} cached."
else else
echo "Downloading ${PAT_FILE}" echo "Downloading ${PAT_FILE}"
curl --insecure -L "${PAT_URL}" -o "${PAT_PATH}" --progress-bar STATUS=`curl --insecure -w "%{http_code}" -L "${PAT_URL}" -o "${PAT_PATH}" --progress-bar`
if [ $? -ne 0 ]; then if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Error downloading" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Error downloading" --aspect 18 \
--msgbox "Check internet or cache disk space" 0 0 --msgbox "Check internet or cache disk space" 0 0
return 1 return 1
@@ -599,9 +599,8 @@ function extractDsmFiles() {
# Check if old pat already downloaded # Check if old pat already downloaded
if [ ! -f "${OLDPAT_PATH}" ]; then if [ ! -f "${OLDPAT_PATH}" ]; then
echo "Downloading old pat to extract synology .pat extractor..." echo "Downloading old pat to extract synology .pat extractor..."
curl --insecure -L "${OLDPAT_URL}" \ STATUS=`curl --insecure -w "%{http_code}" -L "${OLDPAT_URL}" -o "${OLDPAT_PATH}" --progress-bar`
-o "${OLDPAT_PATH}" --progress-bar if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
if [ $? -ne 0 ]; then
dialog --backtitle "`backtitle`" --title "Error downloading" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Error downloading" --aspect 18 \
--msgbox "Check internet or cache disk space" 0 0 --msgbox "Check internet or cache disk space" 0 0
return 1 return 1
@@ -684,14 +683,14 @@ function make() {
[ ! -f "${ORI_ZIMAGE_FILE}" -o ! -f "${ORI_RDGZ_FILE}" ] && extractDsmFiles [ ! -f "${ORI_ZIMAGE_FILE}" -o ! -f "${ORI_RDGZ_FILE}" ] && extractDsmFiles
/opt/arpl/zimage-patch.sh | tee -a "${LOG_FILE}" /opt/arpl/zimage-patch.sh
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
dialog --backtitle "`backtitle`" --title "Error" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Error" --aspect 18 \
--msgbox "zImage not patched:\n`<"${LOG_FILE}"`" 0 0 --msgbox "zImage not patched:\n`<"${LOG_FILE}"`" 0 0
return 1 return 1
fi fi
/opt/arpl/ramdisk-patch.sh | tee -a "${LOG_FILE}" /opt/arpl/ramdisk-patch.sh
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
dialog --backtitle "`backtitle`" --title "Error" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Error" --aspect 18 \
--msgbox "Ramdisk not patched:\n`<"${LOG_FILE}"`" 0 0 --msgbox "Ramdisk not patched:\n`<"${LOG_FILE}"`" 0 0
@@ -798,20 +797,33 @@ function updateMenu() {
fi fi
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--infobox "Downloading last version ${TAG}" 0 0 --infobox "Downloading last version ${TAG}" 0 0
curl --insecure -s -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/bzImage" -o /tmp/bzImage # Download checksum
if [ $? -ne 0 ]; then STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/sha256sum" -o /tmp/sha256sum`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Error downloading checksums" 0 0
continue
fi
STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/bzImage" -o /tmp/bzImage`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Error downloading bzImage" 0 0 --msgbox "Error downloading bzImage" 0 0
continue continue
fi fi
curl --insecure -s -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/rootfs.cpio.xz" -o /tmp/rootfs.cpio.xz STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/rootfs.cpio.xz" -o /tmp/rootfs.cpio.xz`
if [ $? -ne 0 ]; then if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Error downloading rootfs.cpio.xz" 0 0 --msgbox "Error downloading rootfs.cpio.xz" 0 0
continue continue
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
(cd /tmp && sha256sum --status -c sha256sum)
if [ $? -ne 0 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Checksum do not match!" 0 0
continue
fi
mv /tmp/bzImage "${ARPL_BZIMAGE_FILE}" mv /tmp/bzImage "${ARPL_BZIMAGE_FILE}"
mv /tmp/rootfs.cpio.xz "${ARPL_RAMDISK_FILE}" mv /tmp/rootfs.cpio.xz "${ARPL_RAMDISK_FILE}"
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
@@ -832,8 +844,8 @@ function updateMenu() {
fi fi
dialog --backtitle "`backtitle`" --title "Update addons" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update addons" --aspect 18 \
--infobox "Downloading last version" 0 0 --infobox "Downloading last version" 0 0
curl --insecure -s -L "https://github.com/fbelavenuto/arpl-addons/releases/download/${TAG}/addons.zip" -o /tmp/addons.zip STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl-addons/releases/download/${TAG}/addons.zip" -o /tmp/addons.zip`
if [ $? -ne 0 ]; then if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update addons" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update addons" --aspect 18 \
--msgbox "Error downloading new version" 0 0 --msgbox "Error downloading new version" 0 0
continue continue
@@ -867,8 +879,8 @@ function updateMenu() {
fi fi
dialog --backtitle "`backtitle`" --title "Update LKMs" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update LKMs" --aspect 18 \
--infobox "Downloading last version" 0 0 --infobox "Downloading last version" 0 0
curl --insecure -s -L "https://github.com/fbelavenuto/redpill-lkm/releases/download/${TAG}/rp-lkms.zip" -o /tmp/rp-lkms.zip STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/redpill-lkm/releases/download/${TAG}/rp-lkms.zip" -o /tmp/rp-lkms.zip`
if [ $? -ne 0 ]; then if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update LKMs" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update LKMs" --aspect 18 \
--msgbox "Error downloading last version" 0 0 --msgbox "Error downloading last version" 0 0
continue continue
@@ -905,8 +917,8 @@ function updateMenu() {
for P in ${!PLATFORMS[@]}; do for P in ${!PLATFORMS[@]}; do
dialog --backtitle "`backtitle`" --title "Update Modules" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update Modules" --aspect 18 \
--infobox "Downloading ${P} modules" 0 0 --infobox "Downloading ${P} modules" 0 0
curl --insecure -s -L "https://github.com/fbelavenuto/arpl-modules/releases/download/${TAG}/${P}.tgz" -o "/tmp/${P}.tgz" STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl-modules/releases/download/${TAG}/${P}.tgz" -o "/tmp/${P}.tgz"`
if [ $? -ne 0 ]; then if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update Modules" --aspect 18 \ dialog --backtitle "`backtitle`" --title "Update Modules" --aspect 18 \
--msgbox "Error downloading ${P}.tgz" 0 0 --msgbox "Error downloading ${P}.tgz" 0 0
continue continue
@@ -926,6 +938,10 @@ function updateMenu() {
############################################################################### ###############################################################################
############################################################################### ###############################################################################
if [ "x$1" = "xb" -a -n "${MODEL}" -a -n "${BUILD}" -a loaderIsConfigured ]; then
make
boot
fi
# Main loop # Main loop
NEXT="m" NEXT="m"
while true; do while true; do

View File

@@ -71,6 +71,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -85,3 +86,23 @@ builds:
- "ramdisk-common-disable-root-pwd.patch" - "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DS1520%2B_42962.pat"
hash: "f19d2ac39fae564797c148929b8fe7c9740ac3a74099bf573b68df8fe0228cb3"
ramdisk-hash: "aad75938d165ef5efdbfc4c570c4cd1cc252344d0756dd3d89a44f581aa6be6f"
zimage-hash: "89ee173272101e6714728e73930d8b31a414f9f1eca8ab78f45c12fc721138ab"
md5-hash: "b7b4a7c7f9160023e1129e4097403828"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"

View File

@@ -73,6 +73,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -87,3 +88,23 @@ builds:
- "ramdisk-common-disable-root-pwd.patch" - "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DS1621%2B_42962.pat"
hash: "bd88dfdf1eccdf7fefcdac67e11929818ae3aea938fd13286c1ac7b5aaa3964f"
ramdisk-hash: "7a900e3017b4ee09b792d2ed291b7229476ae3e583fe559bbd9baaa812705aa0"
zimage-hash: "b0f296aad0cc3b8adba13483f89770d0a4daf9b9cab335910717448b1eaa8254"
md5-hash: "b5e6be956385c1b49825517409265a44"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"

View File

@@ -73,6 +73,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -87,3 +88,23 @@ builds:
- "ramdisk-common-disable-root-pwd.patch" - "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DS2422%2B_42962.pat"
hash: "a887cc3f06e2b51d34f682a1a812637486aeefbef57c309414f69c3e5514edef"
ramdisk-hash: "edcf0e07e2773326d7f6c2f17a0c2d18e8ef4600a720bbdd4965fc1f11eb21e9"
zimage-hash: "b0f296aad0cc3b8adba13483f89770d0a4daf9b9cab335910717448b1eaa8254"
md5-hash: "97e2f7a56f011d8a7414867ac07d37cb"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"

View File

@@ -75,6 +75,7 @@ builds:
kver: "3.10.108" kver: "3.10.108"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -90,3 +91,24 @@ builds:
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch" - "ramdisk-42661-disable-disabled-ports.patch"
42962:
ver: "7.1.1"
kver: "3.10.108"
rd-compressed: false
efi-bug: no
cmdline:
<<: *cmdline
synoinfo:
<<: *synoinfo
pat:
url: "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS3615xs_42962.pat"
hash: "b79c129354c203b7340010573d16b2d6ebc6a676c946579a959c891a70b8bcfc"
ramdisk-hash: "e4bdca874027b603a18d7b44cc312f3eb6d6cbf2e49329ef51753fc322d880c0"
zimage-hash: "b7d2ca699195a1990f838690be32a65158d4ed01e8126af2ddb27a0f08e177ca"
md5-hash: "84a8d6d92a7a44c775ff995cac555a19"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch"

View File

@@ -76,6 +76,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -91,3 +92,24 @@ builds:
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch" - "ramdisk-42661-disable-disabled-ports.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DS3617xs_42962.pat"
hash: "2a556206201df10245dbcf4cf0366b2f32cb318cd705fbdd74412303d85e7267"
ramdisk-hash: "c8d067a9737d67453e0b476d7115c3e12b2daf2450c371c19e44e480a1076a94"
zimage-hash: "8e6da6c3c9259d23ee5cae3c71691a75b0a281551d19cb75041df469c7524e72"
md5-hash: "3e034e2cdf90209112e0fdad28474970"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch"

View File

@@ -3,7 +3,6 @@ synoinfo: &synoinfo
support_disk_compatibility: "no" support_disk_compatibility: "no"
support_memory_compatibility: "no" support_memory_compatibility: "no"
supportraidgroup: "no" supportraidgroup: "no"
supportssdcache: "no"
esataportcfg: "0x00" esataportcfg: "0x00"
support_bde_internal_10g: "no" support_bde_internal_10g: "no"
support_oob_ctl: "no" support_oob_ctl: "no"
@@ -78,6 +77,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -93,3 +93,24 @@ builds:
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch" - "ramdisk-42661-disable-disabled-ports.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DS3622xs%2B_42962.pat"
hash: "b48aadaba7ff561b7d55aa9ed75f1f2f4c49c0c2f73ece4020f3ffd08f6bbfd0"
ramdisk-hash: "432f315818adad4e1ca54040557e164caf2937004e2d009aac8865391353e2f6"
zimage-hash: "8903dc99f7201c8656de618d767c05f91bfd32edd9a3706a50fd223237842bf2"
md5-hash: "1bf63db06cbc048befc24f277dd520f3"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch"

View File

@@ -79,6 +79,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -94,3 +95,24 @@ builds:
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch" - "ramdisk-42661-disable-disabled-ports.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DS918%2B_42962.pat"
hash: "c1ffb1b48301fbcf1ccffae00062e95c8b5b18d50a70c3fbb79ea12a38a39bb7"
ramdisk-hash: "6ac446bddba53b1c215e0abbf05236371e5e3b91ab0c4c193a0999cc8b8a857b"
zimage-hash: "12afcd27e15ba5e4596e1af7275d9462d31c7d8afb32aa723f7b8b7cfa5a19a2"
md5-hash: "74c067cf1363b9b70522b145b59e1626"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch"

View File

@@ -73,6 +73,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -87,3 +88,23 @@ builds:
- "ramdisk-common-disable-root-pwd.patch" - "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DS920%2B_42962.pat"
hash: "90b1bd215b85eb366b3d3b6bef6bb6bef657dd0caba032dae556717b58e44c06"
ramdisk-hash: "42053cbfbce34d43c50db2d68786360f644fc88af3e9bbaa6377ffa9953bf158"
zimage-hash: "89ee173272101e6714728e73930d8b31a414f9f1eca8ab78f45c12fc721138ab"
md5-hash: "ba9fbd499791d19859dd9a53372b016a"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"

View File

@@ -55,6 +55,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -69,3 +70,23 @@ builds:
- "ramdisk-common-disable-root-pwd.patch" - "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DVA1622_42962.pat"
hash: "9106f6bcc52b4bc2b4ce82748788ca353ddecf8b7552e7c6fb477eb4eca42e67"
ramdisk-hash: "e610146b475074cb1835c7a2528afd0cba389cfa68b8a3ef20214b48ddca78dc"
zimage-hash: "89ee173272101e6714728e73930d8b31a414f9f1eca8ab78f45c12fc721138ab"
md5-hash: "862ef2fffc884038bd3804439b974ab9"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"

View File

@@ -79,6 +79,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -94,3 +95,24 @@ builds:
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch" - "ramdisk-42661-disable-disabled-ports.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DVA3219_42962.pat"
hash: "f03395fd9db108d2c5a684b6ba9b4fadc6b1ab05c4e227d401572c01ec4b3dca"
ramdisk-hash: "8a36c36096dfc9dd5bbd572a6174719c5018fe5d932a4859832025719abac4fc"
zimage-hash: "3c67cefc969ee3de51b7978b8d86cd53cbb0e49ec43b2240bf9b8aad3f2e2200"
md5-hash: "22f43fb4de401436616f943beaf13bd5"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch"

View File

@@ -77,6 +77,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -92,3 +93,24 @@ builds:
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch" - "ramdisk-42661-disable-disabled-ports.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_DVA3221_42962.pat"
hash: "d83044ff12c9ed81c5e7f5ba4b23b68d96c9a40c29a6a9e5c53ad807d1e27ed2"
ramdisk-hash: "7ecb774bfccde028d456613c7232b1d770526ea37e928bf90badac267bafcd78"
zimage-hash: "3c67cefc969ee3de51b7978b8d86cd53cbb0e49ec43b2240bf9b8aad3f2e2200"
md5-hash: "cff2b34f0d9547781da3cf66e161dc3f"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch"

View File

@@ -71,6 +71,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -85,3 +86,23 @@ builds:
- "ramdisk-common-disable-root-pwd.patch" - "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_FS2500_42962.pat"
hash: "1adc272ba9f308866dc69a8f550d4511966a1156c553f925be167815046a5ab4"
ramdisk-hash: "9efc0351212d36e5a51542bff9b2f173beb913c5be3eaaeec1e78625d62763cb"
zimage-hash: "b0f296aad0cc3b8adba13483f89770d0a4daf9b9cab335910717448b1eaa8254"
md5-hash: "3647d21771fe9be4a3898f95491e9393"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"

View File

@@ -74,6 +74,7 @@ builds:
kver: "4.4.180" kver: "4.4.180"
rd-compressed: false rd-compressed: false
efi-bug: no efi-bug: no
rc: true
cmdline: cmdline:
<<: *cmdline <<: *cmdline
synoinfo: synoinfo:
@@ -89,3 +90,24 @@ builds:
- "ramdisk-common-init-script.patch" - "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch" - "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch" - "ramdisk-42661-disable-disabled-ports.patch"
42962:
ver: "7.1.1"
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.1/42962/DSM_RS4021xs%2B_42962.pat"
hash: "fd848be9336d8b5cc9b514e71d447c7612d0f542d373eef61a6d427430daa931"
ramdisk-hash: "40775a6b9b4fae2887cd07c0efdfb26e738e2b8de73602657f7bc4407ae4a688"
zimage-hash: "8903dc99f7201c8656de618d767c05f91bfd32edd9a3706a50fd223237842bf2"
md5-hash: "c8574a8e358fe40a7b49bbf1ddf38491"
patch:
- "ramdisk-common-disable-root-pwd.patch"
- "ramdisk-common-init-script.patch"
- "ramdisk-42951-post-init-script.patch"
- "ramdisk-42661-disable-disabled-ports.patch"

View File

@@ -3,8 +3,10 @@
. /opt/arpl/include/functions.sh . /opt/arpl/include/functions.sh
. /opt/arpl/include/addons.sh . /opt/arpl/include/addons.sh
set -o pipefail # Get exit code from process piped
# Sanity check # Sanity check
[ -f "${ORI_RDGZ_FILE}" ] || die "${ORI_RDGZ_FILE} not found!" [ -f "${ORI_RDGZ_FILE}" ] || (die "${ORI_RDGZ_FILE} not found!" | tee -a "${LOG_FILE}")
echo -n "Patching Ramdisk" echo -n "Patching Ramdisk"
@@ -39,14 +41,14 @@ KVER="`readModelKey "${MODEL}" "builds.${BUILD}.kver"`"
RD_COMPRESSED="`readModelKey "${MODEL}" "builds.${BUILD}.rd-compressed"`" RD_COMPRESSED="`readModelKey "${MODEL}" "builds.${BUILD}.rd-compressed"`"
# Sanity check # Sanity check
[ -z "${PLATFORM}" -o -z "${KVER}" ] && die "ERROR: Configuration for model ${MODEL} and buildnumber ${BUILD} not found." [ -z "${PLATFORM}" -o -z "${KVER}" ] && (die "ERROR: Configuration for model ${MODEL} and buildnumber ${BUILD} not found." | tee -a "${LOG_FILE}")
declare -A SYNOINFO declare -A SYNOINFO
declare -A ADDONS declare -A ADDONS
# Read synoinfo and addons from config # Read synoinfo and addons from config
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}")
while IFS="=" read KEY VALUE; do while IFS="=" read KEY VALUE; do
[ -n "${KEY}" ] && ADDONS["${KEY}"]="${VALUE}" [ -n "${KEY}" ] && ADDONS["${KEY}"]="${VALUE}"
@@ -62,7 +64,7 @@ done < <(readModelArray "${MODEL}" "builds.${BUILD}.patch")
# Patch /etc/synoinfo.conf # Patch /etc/synoinfo.conf
echo -n "." echo -n "."
for KEY in ${!SYNOINFO[@]}; do for KEY in ${!SYNOINFO[@]}; do
sed -i "s|^${KEY}=.*|${KEY}=\"${SYNOINFO[${KEY}]}\"|" "${RAMDISK_PATH}/etc/synoinfo.conf" >"${LOG_FILE}" 2>&1 || dieLog _set_conf_kv "${KEY}" "${SYNOINFO[${KEY}]}" "${RAMDISK_PATH}/etc/synoinfo.conf" >"${LOG_FILE}" 2>&1 || dieLog
done done
# Patch /sbin/init.post # Patch /sbin/init.post
@@ -109,6 +111,8 @@ 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 'echo "addons.sh called with params ${@}"' >> "${RAMDISK_PATH}/addons/addons.sh" echo 'echo "addons.sh called with params ${@}"' >> "${RAMDISK_PATH}/addons/addons.sh"
chmod +x "${RAMDISK_PATH}/addons/addons.sh"
# Required eudev and dtbpatch/maxdisks # Required eudev and dtbpatch/maxdisks
installAddon eudev installAddon eudev
echo "/addons/eudev.sh \${1} " >> "${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog echo "/addons/eudev.sh \${1} " >> "${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
@@ -123,12 +127,11 @@ fi
for ADDON in ${!ADDONS[@]}; do for ADDON in ${!ADDONS[@]}; do
PARAMS=${ADDONS[${ADDON}]} PARAMS=${ADDONS[${ADDON}]}
if ! installAddon ${ADDON}; then if ! installAddon ${ADDON}; then
echo "ADDON ${ADDON} not found!" | tee "${LOG_FILE}" echo "ADDON ${ADDON} not found!" | tee -a "${LOG_FILE}"
exit 1 exit 1
fi fi
echo "/addons/${ADDON}.sh \${1} ${PARAMS}" >> "${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog echo "/addons/${ADDON}.sh \${1} ${PARAMS}" >> "${RAMDISK_PATH}/addons/addons.sh" 2>"${LOG_FILE}" || dieLog
done done
chmod +x "${RAMDISK_PATH}/addons/addons.sh"
# Build modules dependencies # Build modules dependencies
/opt/arpl/depmod -a -b ${RAMDISK_PATH} 2>/dev/null /opt/arpl/depmod -a -b ${RAMDISK_PATH} 2>/dev/null

View File

@@ -2,8 +2,10 @@
. /opt/arpl/include/functions.sh . /opt/arpl/include/functions.sh
set -o pipefail # Get exit code from process piped
# Sanity check # Sanity check
[ -f "${ORI_ZIMAGE_FILE}" ] || die "${ORI_ZIMAGE_FILE} not found!" [ -f "${ORI_ZIMAGE_FILE}" ] || (die "${ORI_ZIMAGE_FILE} not found!" | tee -a "${LOG_FILE}")
echo -n "Patching zImage" echo -n "Patching zImage"
@@ -17,7 +19,6 @@ echo -n "."
echo -n "." echo -n "."
# rebuild zImage # rebuild zImage
/opt/arpl/vmlinux-to-bzImage.sh "${TMP_PATH}/vmlinux-mod" "${MOD_ZIMAGE_FILE}" >"${LOG_FILE}" 2>&1 || dieLog /opt/arpl/vmlinux-to-bzImage.sh "${TMP_PATH}/vmlinux-mod" "${MOD_ZIMAGE_FILE}" >"${LOG_FILE}" 2>&1 || dieLog
echo -n "." echo -n "."
# Update HASH of new DSM zImage # Update HASH of new DSM zImage
HASH="`sha256sum ${ORI_ZIMAGE_FILE} | awk '{print$1}'`" HASH="`sha256sum ${ORI_ZIMAGE_FILE} | awk '{print$1}'`"

Binary file not shown.

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env ash
function use() {
echo "Use: ${0} junior|config"
exit 1
}
[ -z "${1}" ] && use
[ "${1}" != "junior" -a "${1}" != "config" ] && use
echo "Rebooting to ${1} mode"
grub-editenv /mnt/p1/grub/grubenv set next_entry="${1}"
reboot

Binary file not shown.

View File

@@ -1,8 +1,9 @@
version: 1 version: 1
name: misc name: misc
description: "Fix missing HW features dependencies" description: "Miscellaneous functions"
all: all:
install-script: "install.sh" install-script: "install.sh"
copy: "all"
available-for: available-for:
bromolow-3.10.108: bromolow-3.10.108:
apollolake-4.4.180: apollolake-4.4.180:

View File

@@ -27,6 +27,17 @@ BR2_PACKAGE_CPIO=y
BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS=y
BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
BR2_PACKAGE_LINUX_FIRMWARE=y
BR2_PACKAGE_LINUX_FIRMWARE_BROADCOM_TIGON3=y
BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4=y
BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T5=y
BR2_PACKAGE_LINUX_FIRMWARE_INTEL_E100=y
BR2_PACKAGE_LINUX_FIRMWARE_INTEL_ICE=y
BR2_PACKAGE_LINUX_FIRMWARE_MICROCHIP_VSC85XX_PHY=y
BR2_PACKAGE_LINUX_FIRMWARE_QLOGIC_4X=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_815X=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_8169=y
BR2_PACKAGE_ACPID=y BR2_PACKAGE_ACPID=y
BR2_PACKAGE_KBD=y BR2_PACKAGE_KBD=y
BR2_PACKAGE_LSHW=y BR2_PACKAGE_LSHW=y
@@ -60,6 +71,4 @@ BR2_TARGET_ROOTFS_CPIO_XZ=y
# BR2_TARGET_ROOTFS_TAR is not set # BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_E2FSPROGS=y BR2_PACKAGE_HOST_E2FSPROGS=y
BR2_PACKAGE_HOST_MKPASSWD=y
BR2_PACKAGE_R8168=y
BR2_PACKAGE_R8125=y BR2_PACKAGE_R8125=y

View File

@@ -75,10 +75,10 @@ cp -Ru files/* .buildroot/
cd .buildroot cd .buildroot
echo "Generating default config" echo "Generating default config"
make BR2_EXTERNAL=../external arpl_defconfig make BR2_EXTERNAL=../external -j`nproc` arpl_defconfig
echo "Version: ${VERSION}" 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 -j`nproc`
cd - cd -
#qemu-img convert -O vmdk -o adapter_type=lsilogic -o compat6 arpl.img arpl.vmdk #qemu-img convert -O vmdk -o adapter_type=lsilogic -o compat6 arpl.img arpl.vmdk
qemu-img convert -O vmdk -o adapter_type=lsilogic arpl.img -o subformat=monolithicFlat arpl.vmdk qemu-img convert -O vmdk -o adapter_type=lsilogic arpl.img -o subformat=monolithicFlat arpl.vmdk

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020 Fabio Belavenuto <belavenuto@gmail.com> * Copyright (c) 2022 Fabio Belavenuto <belavenuto@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -28,11 +28,8 @@
* - values of ORs are 1/2/4/8 respectively * - values of ORs are 1/2/4/8 respectively
* - [const-ptr] is always the same * - [const-ptr] is always the same
* *
*/ * Added patch for CMOS_WRITE by Fabio Belavenuto
/** *
* A quick tool for patching the ramdisk check in the DSM kernel image
* This lets you tinker with the initial ramdisk contents without disabling mount() features and modules loading
*
*/ */
#include <stdio.h> #include <stdio.h>
@@ -44,22 +41,25 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h>
#include <gelf.h> #include <gelf.h>
const int DIR_FWD = 1; const int DIR_FWD = 1;
const int DIR_RWD = -1; const int DIR_RWD = -1;
/* Variables */ /* Variables */
int fd; int fd, verbose = 1, read_only = 0;
int verbose = 1, read_only = 0; Elf *elfHandle;
Elf *elfHandle; GElf_Ehdr elfExecHeader;
GElf_Ehdr elfExecHeader; uint64_t orPos[4], fileSize, rodataAddr, rodataOffs, initTextOffs;
uint64_t orPos[4], fileSize, rodataAddr, rodataOffs, initTextOffs;
unsigned char *fileData; unsigned char *fileData;
/*****************************************************************************/ /*****************************************************************************/
void errorMsg(char *message) { void errorMsg(char *fmt, ...) {
fprintf(stderr, "%s\n", message); va_list args;
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
exit(1); exit(1);
} }
@@ -125,8 +125,8 @@ void patchBootParams() {
uint64_t newPtrOffset, ptrOffset; uint64_t newPtrOffset, ptrOffset;
int n; int n;
printf("Patching boot params.\n");
//The function will reside in init code part. We don't care we may potentially search beyond as we expect it to be found //The function will reside in init code part. We don't care we may potentially search beyond as we expect it to be found
printf("Found .init.text at %lX\n", initTextOffs);
while (initTextOffs < fileSize) { while (initTextOffs < fileSize) {
addr = findPUSH_R12_R15_SEQ(initTextOffs); addr = findPUSH_R12_R15_SEQ(initTextOffs);
if (addr == -1) if (addr == -1)
@@ -160,8 +160,8 @@ void patchBootParams() {
} else if (ptrOffset == newPtrOffset) { } else if (ptrOffset == newPtrOffset) {
++ec; ++ec;
} }
printf("\t[+] Found LOCK-OR#$idx sequence @ %lX => %02X %02X %02X %02X %02X %02X %02X %02X [RIP+%lX]\n", printf("\t[+] Found LOCK-OR#%d sequence @ %lX => %02X %02X %02X %02X %02X %02X %02X %02X [RIP+%lX]\n",
pos, fileData[pos], fileData[pos+1], fileData[pos+2], fileData[pos+3], fileData[pos+4], n, pos, fileData[pos], fileData[pos+1], fileData[pos+2], fileData[pos+3], fileData[pos+4],
fileData[pos+5], fileData[pos+6], fileData[pos+7], newPtrOffset); fileData[pos+5], fileData[pos+6], fileData[pos+7], newPtrOffset);
} }
if (ec != 4) { if (ec != 4) {
@@ -175,7 +175,7 @@ void patchBootParams() {
break; break;
} }
if (addr == -1) { if (addr == -1) {
errorMsg("\nFailed to find matching sequences"); errorMsg("\nFailed to find matching sequences\n");
} else { } else {
//Patch offsets //Patch offsets
for (n = 0; n < 4; n++) { for (n = 0; n < 4; n++) {
@@ -197,11 +197,10 @@ uint32_t changeEndian(uint32_t num) {
/*****************************************************************************/ /*****************************************************************************/
uint64_t findSeq(const char* seq, int len, uint32_t pos, int dir, uint64_t max) { uint64_t findSeq(const char* seq, int len, uint32_t pos, int dir, uint64_t max) {
uint64_t i; uint64_t i = pos;
i = pos;
do { do {
if (strncmp((const char*)fileData+i, seq, len) == 0) { if (memcmp((const char*)fileData+i, seq, len) == 0) {
return i; return i;
} }
i += dir; i += dir;
@@ -216,9 +215,9 @@ void patchRamdiskCheck() {
uint64_t printkPos, testPos, jzPos; uint64_t printkPos, testPos, jzPos;
const char str[] = "3ramdisk corrupt"; const char str[] = "3ramdisk corrupt";
printf("Patching ramdisk check\n"); printf("Patching ramdisk check.\n");
for (pos = rodataOffs; pos < fileSize; pos++) { for (pos = rodataOffs; pos < fileSize; pos++) {
if (strncmp(str, (const char*)(fileData + pos), 16) == 0) { if (memcmp(str, (const char*)(fileData + pos), 16) == 0) {
pos -= rodataOffs; pos -= rodataOffs;
break; break;
} }
@@ -227,17 +226,15 @@ void patchRamdiskCheck() {
printf("LE arg addr: %08lX\n", errPrintAddr); printf("LE arg addr: %08lX\n", errPrintAddr);
printkPos = findSeq((const char*)&errPrintAddr, 4, 0, DIR_FWD, -1); printkPos = findSeq((const char*)&errPrintAddr, 4, 0, DIR_FWD, -1);
if (printkPos == -1) { if (printkPos == -1) {
errorMsg("printk pos not found!"); errorMsg("printk pos not found!\n");
} }
//double check if it's a MOV reg,VAL (where reg is EAX/ECX/EDX/EBX/ESP/EBP/ESI/EDI) //double check if it's a MOV reg,VAL (where reg is EAX/ECX/EDX/EBX/ESP/EBP/ESI/EDI)
printkPos -= 3; printkPos -= 3;
if (strncmp((const char*)fileData+printkPos, "\x48\xc7", 2) != 0) { if (memcmp((const char*)fileData+printkPos, "\x48\xc7", 2) != 0) {
printf("Expected MOV=>reg before printk error, got %02X %02X\n", fileData[printkPos], fileData[printkPos+1]); errorMsg("Expected MOV=>reg before printk error, got %02X %02X\n", fileData[printkPos], fileData[printkPos+1]);
errorMsg("");
} }
if (fileData[printkPos+2] < 0xC0 || fileData[printkPos+2] > 0xC7) { if (fileData[printkPos+2] < 0xC0 || fileData[printkPos+2] > 0xC7) {
printf("Expected MOV w/reg operand [C0-C7], got %02X\n", fileData[printkPos+2]); errorMsg("Expected MOV w/reg operand [C0-C7], got %02X\n", fileData[printkPos+2]);
errorMsg("");
} }
printf("Found printk MOV @ %08lX\n", printkPos); printf("Found printk MOV @ %08lX\n", printkPos);
@@ -256,6 +253,54 @@ void patchRamdiskCheck() {
fileData[jzPos] = 0xEB; fileData[jzPos] = 0xEB;
} }
/*****************************************************************************/
void patchCmosWrite() {
uint64_t pos, errPrintAddr;
uint64_t pr_errPos, testPos, callPos;
const char str[] = "3smpboot: %s: this boot have memory training";
printf("Patching call to rtc_cmos_write.\n");
for (pos = rodataOffs; pos < fileSize; pos++) {
if (memcmp(str, (const char*)(fileData + pos), 16) == 0) {
pos -= rodataOffs;
break;
}
}
errPrintAddr = rodataAddr + pos - 1;
printf("LE arg addr: %08lX\n", errPrintAddr);
pr_errPos = findSeq((const char*)&errPrintAddr, 4, 0, DIR_FWD, -1);
if (pr_errPos == -1) {
printf("pr_err pos not found - ignoring.\n"); // Some kernels do not have the call, exit without error
return;
}
//double check if it's a MOV reg,VAL (where reg is EAX/ECX/EDX/EBX/ESP/EBP/ESI/EDI)
pr_errPos -= 3;
if (memcmp((const char*)fileData+pr_errPos, "\x48\xc7", 2) != 0) {
errorMsg("Expected MOV=>reg before pr_err error, got %02X %02X\n", fileData[pr_errPos], fileData[pr_errPos+1]);
}
if (fileData[pr_errPos+2] < 0xC0 || fileData[pr_errPos+2] > 0xC7) {
errorMsg("Expected MOV w/reg operand [C0-C7], got %02X\n", fileData[pr_errPos+2]);
}
printf("Found pr_err MOV @ %08lX\n", pr_errPos);
// now we should seek a reasonable amount (say, up to 64 bytes) for a sequence of
// MOV ESI, 0x48 => MOV EDI, 0xFF => MOV EBX, EAX
testPos = findSeq("\xBE\x48\x00\x00\x00\xBF\xFF\x00\x00\x00\x89\xC3", 12, pr_errPos, DIR_RWD, 64);
if (testPos == -1) {
printf("Failed to find MOV ESI, 0x48 => MOV EDI, 0xFF => MOV EBX, EAX\n");
return;
}
printf("Found MOV ESI, 0x48 => MOV EDI, 0xFF => MOV EBX, EAX @ %08lX\n", testPos);
callPos = testPos + 12;
if (fileData[callPos] != 0xE8) {
errorMsg("Failed to find CALL\n");
}
printf("OK - patching %02X (CALL) to 0x90.. (NOPs) @ %08lX\n",
fileData[callPos], callPos);
for(uint64_t i = 0; i < 5; i++)
fileData[callPos+i] = 0x90;
}
/*****************************************************************************/ /*****************************************************************************/
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
struct stat fileInf; struct stat fileInf;
@@ -264,7 +309,7 @@ int main(int argc, char *argv[]) {
char *sectionName; char *sectionName;
if (argc != 3) { if (argc != 3) {
errorMsg("Use: kpatch <vmlinux> <output>"); errorMsg("Use: kpatch <vmlinux> <output>\n");
} }
if (elf_version(EV_CURRENT) == EV_NONE) if (elf_version(EV_CURRENT) == EV_NONE)
@@ -281,13 +326,13 @@ int main(int argc, char *argv[]) {
switch(elf_kind(elfHandle)) { switch(elf_kind(elfHandle)) {
case ELF_K_NUM: case ELF_K_NUM:
case ELF_K_NONE: case ELF_K_NONE:
errorMsg("file type unknown"); errorMsg("file type unknown\n");
break; break;
case ELF_K_COFF: case ELF_K_COFF:
errorMsg("COFF binaries not supported"); errorMsg("COFF binaries not supported\n");
break; break;
case ELF_K_AR: case ELF_K_AR:
errorMsg("AR archives not supported"); errorMsg("AR archives not supported\n");
break; break;
case ELF_K_ELF: case ELF_K_ELF:
break; break;
@@ -319,8 +364,12 @@ int main(int argc, char *argv[]) {
} }
close(fd); close(fd);
printf("Found .init.text offset @ %lX\n", initTextOffs);
printf("Found .rodata address @ %lX\n", rodataAddr);
printf("Found .rodata offset @ %lX\n", rodataOffs);
patchBootParams(); patchBootParams();
patchRamdiskCheck(); patchRamdiskCheck();
patchCmosWrite();
if ((fd = open(argv[2], O_WRONLY | O_CREAT, 0644)) == -1) { if ((fd = open(argv[2], O_WRONLY | O_CREAT, 0644)) == -1) {
errorNum(); errorNum();
} }
@@ -328,6 +377,6 @@ int main(int argc, char *argv[]) {
errorNum(); errorNum();
} }
close(fd); close(fd);
printf("\n"); printf("Finish!\n");
return 0; return 0;
} }

91
make_rsss.sh Executable file
View File

@@ -0,0 +1,91 @@
#!/usr/bin/env bash
set -e
MODEL_CONFIG_PATH="./files/board/arpl/overlayfs/opt/arpl/model-configs"
RELEASE="7.1.1"
BUILDNUMBER="42962"
EXTRA=""
function readConfigKey() {
RESULT=`yq eval '.'${1}' | explode(.)' "${2}"`
[ "${RESULT}" == "null" ] && echo "" || echo ${RESULT}
}
function readModelKey() {
readConfigKey "${2}" "${MODEL_CONFIG_PATH}/${1}.yml"
}
# JSON
cat <<EOF
{
"title": "DSM ${RELEASE}-${BUILDNUMBER}",
"MajorVer": ${RELEASE:0:1},
"MinorVer": ${RELEASE:2:1},
"NanoVer": ${RELEASE:4:1},
"BuildPhase": 0,
"BuildNum": ${BUILDNUMBER},
"BuildDate": "2022/08/01",
"ReqMajorVer": 7,
"ReqMinorVer": 1,
"ReqBuildPhase": 0,
"ReqBuildNum": 41890,
"ReqBuildDate": "2021/06/25",
"isSecurityVersion": false,
"model": [
EOF
while read M; do
M="`basename ${M}`"
M="${M::-4}"
UNIQUE=`readModelKey "${M}" "unique"`
URL=`readModelKey "${M}" "builds.${BUILDNUMBER}.pat.url"`
HASH=`readModelKey "${M}" "builds.${BUILDNUMBER}.pat.md5-hash"`
cat <<EOF
{
"mUnique": "${UNIQUE}",
"mLink": "${URL}",
"mCheckSum": "${HASH}"
},
EOF
done < <(find "${MODEL_CONFIG_PATH}" -maxdepth 1 -name \*.yml | sort)
cat <<EOF
]
},
EOF
# XML
cat <<EOF
<item>
<title>DSM ${RELEASE}-${BUILDNUMBER}</title>
<MajorVer>${RELEASE:0:1}</MajorVer>
<MinorVer>${RELEASE:2:1}</MinorVer>
<BuildPhase>${RELEASE:4:1}</BuildPhase>
<BuildNum>${BUILDNUMBER}</BuildNum>
<BuildDate>2022/08/01</BuildDate>
<ReqMajorVer>7</ReqMajorVer>
<ReqMinorVer>0</ReqMinorVer>
<ReqBuildPhase>0</ReqBuildPhase>
<ReqBuildNum>41890</ReqBuildNum>
<ReqBuildDate>2021/06/25</ReqBuildDate>
EOF
while read M; do
M="`basename ${M}`"
M="${M::-4}"
UNIQUE=`readModelKey "${M}" "unique"`
URL=`readModelKey "${M}" "builds.${BUILDNUMBER}.pat.url"`
HASH=`readModelKey "${M}" "builds.${BUILDNUMBER}.pat.md5-hash"`
cat <<EOF
<model>
<mUnique>${UNIQUE}</mUnique>
<mLink>${URL}</mLink>
<mCheckSum>${HASH}</mCheckSum>
</model>
EOF
done < <(find "${MODEL_CONFIG_PATH}" -maxdepth 1 -name \*.yml | sort)
cat <<EOF
</item>
EOF

View File

@@ -19,25 +19,26 @@ KVERS["DVA3221"]="4.4.180"
KVERS["FS2500"]="4.4.180" KVERS["FS2500"]="4.4.180"
KVERS["RS4021xs+"]="4.4.180" KVERS["RS4021xs+"]="4.4.180"
RELEASE="7.1.1" RELEASE="7.1.1"
BUILDNUMBER="42951" BUILDNUMBER="42962"
EXTRA="" EXTRA=""
for MODEL in DS918+ DS920+ DS1520+ DS1621+ DS2422+ DS3615xs DS3617xs DS3622xs+ DVA1622 DVA3221 DVA3219 FS2500 RS4021xs+; do for MODEL in DS918+ DS920+ DS1520+ DS1621+ DS2422+ DS3615xs DS3617xs DS3622xs+ DVA1622 DVA3221 DVA3219 FS2500 RS4021xs+; do
MODEL_CODED=`echo ${MODEL} | sed 's/+/%2B/g'` MODEL_CODED=`echo ${MODEL} | sed 's/+/%2B/g'`
URL="https://global.download.synology.com/download/DSM/release/${RELEASE}/${BUILDNUMBER}${EXTRA}/DSM_${MODEL_CODED}_${BUILDNUMBER}.pat" URL="https://global.download.synology.com/download/DSM/release/${RELEASE}/${BUILDNUMBER}${EXTRA}/DSM_${MODEL_CODED}_${BUILDNUMBER}.pat"
#URL="https://archive.synology.com/download/Os/DSM/${RELEASE}-${BUILDNUMBER}/DSM_${MODEL_CODED}_${BUILDNUMBER}.pat"
FILENAME="${MODEL}-${BUILDNUMBER}.pat" FILENAME="${MODEL}-${BUILDNUMBER}.pat"
FILEPATH="/tmp/${FILENAME}" FILEPATH="/tmp/${FILENAME}"
echo -n "Checking ${MODEL}... " echo -n "Checking ${MODEL}... "
if [ -f ${FILEPATH} ]; then if [ -f ${FILEPATH} ]; then
echo "cached" echo "cached"
else else
STATUS=`curl -s -o /dev/null -w "%{http_code}" -L "${URL}"` echo "no cached, downloading..."
if [ ${STATUS} -ne 200 ]; then fi
echo "error: HTTP status = ${STATUS}" STATUS=`curl --progress-bar -o ${FILEPATH} -w "%{http_code}" -L "${URL}"`
continue if [ ${STATUS} -ne 200 ]; then
fi echo "error: HTTP status = ${STATUS}"
echo "ok, download it." rm -f ${FILEPATH}
curl --progress-bar -C - -L "${URL}" -o ${FILEPATH} continue
fi fi
echo "Calculating md5:" echo "Calculating md5:"
PAT_MD5=`md5sum ${FILEPATH} | awk '{print$1}'` PAT_MD5=`md5sum ${FILEPATH} | awk '{print$1}'`

View File

@@ -6,6 +6,88 @@
"pubDate": "Sat Aug 6 0:18:39 CST 2022", "pubDate": "Sat Aug 6 0:18:39 CST 2022",
"copyright": "Copyright 2022 Synology Inc", "copyright": "Copyright 2022 Synology Inc",
"item": [ "item": [
{
"title": "DSM 7.1.1-42962",
"MajorVer": 7,
"MinorVer": 1,
"NanoVer": 1,
"BuildPhase": 0,
"BuildNum": 42962,
"BuildDate": "2022/08/01",
"ReqMajorVer": 7,
"ReqMinorVer": 1,
"ReqBuildPhase": 0,
"ReqBuildNum": 41890,
"ReqBuildDate": "2021/06/25",
"isSecurityVersion": false,
"model": [
{
"mUnique": "synology_geminilake_1520+",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS1520%2B_42962.pat",
"mCheckSum": "b7b4a7c7f9160023e1129e4097403828"
},
{
"mUnique": "synology_v1000_1621+",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS1621%2B_42962.pat",
"mCheckSum": "b5e6be956385c1b49825517409265a44"
},
{
"mUnique": "synology_v1000_2422+",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS2422%2B_42962.pat",
"mCheckSum": "97e2f7a56f011d8a7414867ac07d37cb"
},
{
"mUnique": "synology_bromolow_3615xs",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS3615xs_42962.pat",
"mCheckSum": "84a8d6d92a7a44c775ff995cac555a19"
},
{
"mUnique": "synology_broadwell_3617xs",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS3617xs_42962.pat",
"mCheckSum": "3e034e2cdf90209112e0fdad28474970"
},
{
"mUnique": "synology_broadwellnk_3622xs+",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS3622xs%2B_42962.pat",
"mCheckSum": "1bf63db06cbc048befc24f277dd520f3"
},
{
"mUnique": "synology_apollolake_918+",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS918%2B_42962.pat",
"mCheckSum": "74c067cf1363b9b70522b145b59e1626"
},
{
"mUnique": "synology_geminilake_920+",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS920%2B_42962.pat",
"mCheckSum": "ba9fbd499791d19859dd9a53372b016a"
},
{
"mUnique": "synology_geminilake_dva1622",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DVA1622_42962.pat",
"mCheckSum": "862ef2fffc884038bd3804439b974ab9"
},
{
"mUnique": "synology_denverton_dva3219",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DVA3219_42962.pat",
"mCheckSum": "22f43fb4de401436616f943beaf13bd5"
},
{
"mUnique": "synology_denverton_dva3221",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DVA3221_42962.pat",
"mCheckSum": "cff2b34f0d9547781da3cf66e161dc3f"
},
{
"mUnique": "synology_v1000_fs2500",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_FS2500_42962.pat",
"mCheckSum": "3647d21771fe9be4a3898f95491e9393"
},
{
"mUnique": "synology_broadwellnk_rs4021xs+",
"mLink": "https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_RS4021xs%2B_42962.pat",
"mCheckSum": "c8574a8e358fe40a7b49bbf1ddf38491"
}
]
},
{ {
"title": "DSM 7.1.1-42951", "title": "DSM 7.1.1-42951",
"MajorVer": 7, "MajorVer": 7,

78
rss.xml
View File

@@ -5,6 +5,84 @@
<link>http://update.synology.com/autoupdate/genRSS.php</link> <link>http://update.synology.com/autoupdate/genRSS.php</link>
<pubDate>Sat Aug 6 0:11:41 CST 2022</pubDate> <pubDate>Sat Aug 6 0:11:41 CST 2022</pubDate>
<copyright>Copyright 2022 Synology Inc</copyright> <copyright>Copyright 2022 Synology Inc</copyright>
<item>
<title>DSM 7.1.1-42962</title>
<MajorVer>7</MajorVer>
<MinorVer>1</MinorVer>
<BuildPhase>1</BuildPhase>
<BuildNum>42962</BuildNum>
<BuildDate>2022/08/01</BuildDate>
<ReqMajorVer>7</ReqMajorVer>
<ReqMinorVer>0</ReqMinorVer>
<ReqBuildPhase>0</ReqBuildPhase>
<ReqBuildNum>41890</ReqBuildNum>
<ReqBuildDate>2021/06/25</ReqBuildDate>
<model>
<mUnique>synology_geminilake_1520+</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS1520%2B_42962.pat</mLink>
<mCheckSum>b7b4a7c7f9160023e1129e4097403828</mCheckSum>
</model>
<model>
<mUnique>synology_v1000_1621+</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS1621%2B_42962.pat</mLink>
<mCheckSum>b5e6be956385c1b49825517409265a44</mCheckSum>
</model>
<model>
<mUnique>synology_v1000_2422+</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS2422%2B_42962.pat</mLink>
<mCheckSum>97e2f7a56f011d8a7414867ac07d37cb</mCheckSum>
</model>
<model>
<mUnique>synology_bromolow_3615xs</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS3615xs_42962.pat</mLink>
<mCheckSum>84a8d6d92a7a44c775ff995cac555a19</mCheckSum>
</model>
<model>
<mUnique>synology_broadwell_3617xs</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS3617xs_42962.pat</mLink>
<mCheckSum>3e034e2cdf90209112e0fdad28474970</mCheckSum>
</model>
<model>
<mUnique>synology_broadwellnk_3622xs+</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS3622xs%2B_42962.pat</mLink>
<mCheckSum>1bf63db06cbc048befc24f277dd520f3</mCheckSum>
</model>
<model>
<mUnique>synology_apollolake_918+</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS918%2B_42962.pat</mLink>
<mCheckSum>74c067cf1363b9b70522b145b59e1626</mCheckSum>
</model>
<model>
<mUnique>synology_geminilake_920+</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DS920%2B_42962.pat</mLink>
<mCheckSum>ba9fbd499791d19859dd9a53372b016a</mCheckSum>
</model>
<model>
<mUnique>synology_geminilake_dva1622</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DVA1622_42962.pat</mLink>
<mCheckSum>862ef2fffc884038bd3804439b974ab9</mCheckSum>
</model>
<model>
<mUnique>synology_denverton_dva3219</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DVA3219_42962.pat</mLink>
<mCheckSum>22f43fb4de401436616f943beaf13bd5</mCheckSum>
</model>
<model>
<mUnique>synology_denverton_dva3221</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_DVA3221_42962.pat</mLink>
<mCheckSum>cff2b34f0d9547781da3cf66e161dc3f</mCheckSum>
</model>
<model>
<mUnique>synology_v1000_fs2500</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_FS2500_42962.pat</mLink>
<mCheckSum>3647d21771fe9be4a3898f95491e9393</mCheckSum>
</model>
<model>
<mUnique>synology_broadwellnk_rs4021xs+</mUnique>
<mLink>https://global.download.synology.com/download/DSM/release/7.1.1/42962/DSM_RS4021xs%2B_42962.pat</mLink>
<mCheckSum>c8574a8e358fe40a7b49bbf1ddf38491</mCheckSum>
</model>
</item>
<item> <item>
<title>DSM 7.1.1-42951</title> <title>DSM 7.1.1-42951</title>
<MajorVer>7</MajorVer> <MajorVer>7</MajorVer>