Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add support ds918+ 6.2.4. update 5 #71

Open
wants to merge 80 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
5707471
fix patch & add uefi support
jumkey Aug 21, 2021
195d4de
Ugly fix efi folder
jumkey Sep 13, 2021
4a42938
7.0.1-42218
jumkey Sep 2, 2021
6cf6a9d
implement load extra kernel modules
jumkey Sep 13, 2021
97e3db0
Revert "implement load extra kernel modules"
jumkey Oct 8, 2021
c61b1b3
ext not tested
jumkey Oct 8, 2021
4538862
add redpill-virtio
OrpheeGT Oct 9, 2021
a7e2b8a
add redpill-boot-wait
jumkey Oct 10, 2021
ca2ec26
add power button
jumkey Oct 17, 2021
8b4b2ca
test on_os_load
jumkey Oct 19, 2021
e10bfe7
optimization
jumkey Oct 19, 2021
36b5c82
add power button v6
jumkey Oct 20, 2021
bc6cc25
make bsp file action
jumkey Oct 23, 2021
0559bf0
7.0.1-42218 from actions
jumkey Oct 23, 2021
f51f4ec
change to lzma
jumkey Oct 25, 2021
7eaa5a8
change to lzma not tested
jumkey Oct 25, 2021
3831fb2
support update pack
jumkey Oct 25, 2021
00b6d84
DS920+\7.0.1-42218
jumkey Feb 12, 2022
dd26c1e
基于@dogodefi 的优化更新DS3622xs+ 7.0.1-42218
jumkey Feb 20, 2022
04a5c66
disconnect update7.synology.com
jumkey Feb 20, 2022
aeb710b
fix pat_url
tossp Feb 21, 2022
c861e36
Merge pull request #5 from tossp/patch-1
jumkey Feb 22, 2022
90ce81f
add cmdline
jumkey Feb 22, 2022
845c9dd
redpill-dtb ext for SupportPortMappingV2(DS920+)
jumkey Feb 26, 2022
77f4600
7.1-42550
jumkey Feb 26, 2022
9d6c719
fix sed path
jumkey Feb 26, 2022
e4deb05
fix
jumkey Feb 26, 2022
3389d93
fix
jumkey Feb 26, 2022
41b670a
misc ds3622xsp_42550
jumkey Mar 1, 2022
6e480dc
misc
jumkey Mar 1, 2022
338caef
ttyd
jumkey Mar 1, 2022
7634eb0
ttyd
jumkey Mar 1, 2022
a8f2984
ttyd
jumkey Mar 1, 2022
71142ff
ttyd
jumkey Mar 2, 2022
6668686
install dtc
jumkey Mar 3, 2022
25af608
pcie_root = "00:1e.0,01.0,07.0"
jumkey Mar 3, 2022
8b04368
DS1621+
jumkey Mar 7, 2022
dedd6d6
ds3622xsp_42550 virtio
jumkey Mar 10, 2022
a0ecad8
DS2422+ × jun mod
jumkey Mar 12, 2022
3c8e941
buildroot.yml
jumkey Mar 17, 2022
7679da7
libelf-dev
jumkey Mar 17, 2022
1a00169
version
jumkey Mar 18, 2022
a76b62e
ds3622xsp_42621
jumkey Mar 25, 2022
6c85c53
42550-42661
jumkey May 11, 2022
ce40f83
Yet Another Jun's Mod × RedPill v7.0.1-42218
jumkey May 11, 2022
f5cfd20
Remove bsp
jumkey May 13, 2022
712ad28
Yet Another Jun's Mod
jumkey May 13, 2022
dfb70ca
Revert "Remove bsp"
jumkey May 13, 2022
7815f3a
vmlinux-to-bzImage.sh
jumkey May 13, 2022
a0d9442
Support for external scripts
jumkey May 14, 2022
21cfe79
for DS3615xs linux v3
jumkey May 14, 2022
60f3e2d
chmod +x
jumkey May 14, 2022
f86bacb
add debug mode
jumkey May 14, 2022
f55bc8e
git config user
jumkey May 15, 2022
3d8896a
satadom
jumkey May 15, 2022
9eeb973
move bzImage to second partition
jumkey May 16, 2022
b5a9e4c
mac1 or macs
jumkey May 19, 2022
0992e0b
check
jumkey May 19, 2022
6af7129
add udevadm
jumkey May 19, 2022
d82b482
auto patch dtb
jumkey May 21, 2022
e160700
fix
jumkey May 21, 2022
0abd040
rm old menu_entries
jumkey May 21, 2022
cccd87d
add quickjs
jumkey May 21, 2022
f77ece8
identify synoboot
jumkey May 22, 2022
c8c9834
fix identify synoboot
jumkey May 23, 2022
886be2b
fix identify synoboot
jumkey May 23, 2022
a534296
fix identify synoboot
jumkey May 23, 2022
44ff2e9
fix identify synoboot
jumkey May 23, 2022
31ba93d
dtb: patch nvme
jumkey May 25, 2022
c220eab
redpill-runtime-qjs&redpill-qjs-dtb
jumkey Jun 1, 2022
4d35a6f
fix ds920p sha256
jumkey Jun 4, 2022
a356521
button.ko
jumkey Jun 6, 2022
bbde50a
remove lzma compression
jumkey Jun 10, 2022
f59e35e
bzImage
jumkey Jun 10, 2022
a36ff76
acpid: add dva3221_42218
jumkey Jun 16, 2022
dc499ef
virtio: add rs3621xsp_42661
jumkey Jul 8, 2022
c5f46e1
universal
jumkey Nov 16, 2022
92cc80b
dva3221
jumkey May 22, 2022
a5ef5e1
dva1622
jumkey Nov 24, 2022
ceab8e8
ds923p
jumkey Nov 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/buildroot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: buildroot

on:
workflow_dispatch:
inputs:
git-address:
description: 'git-address'
required: true
default: 'https://github.com/buildroot/buildroot.git'
branches-tags:
description: 'branches-tags'
required: true
default: '2022.02'
board:
description: 'board'
required: true
default: 'syno'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Clone source code
run: |
git clone ${{github.event.inputs.git-address}} /opt/buildroot
cd /opt/buildroot
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y libelf-dev
- name: Bulid
run: |
mkdir /opt/firmware
cd /opt/buildroot
git checkout ${{github.event.inputs.branches-tags}}
git pull origin ${{github.event.inputs.branches-tags}}
cp -rf /home/runner/work/redpill-load/redpill-load/buildroot/* .
echo '---start make---'
make ${{github.event.inputs.board}}_defconfig
make
cp -r /opt/buildroot/output/images /opt/firmware
- name: Upload buildroot-${{github.event.inputs.branches-tags}}-${{github.event.inputs.board}}
uses: actions/upload-artifact@v3
with:
name: buildroot-${{github.event.inputs.branches-tags}}-${{github.event.inputs.board}}
path: /opt/firmware
118 changes: 118 additions & 0 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Make kernel bs patch

on:
workflow_dispatch:
inputs:
pat-address:
description: 'Pat file URL'
required: true
default: 'https://global.download.synology.com/download/DSM/release/7.0.1/42218/DSM_DS918%2B_42218.pat'
toolchain:
description: 'DSM toolchain URL for repack zImage'
required: true
default: 'https://sourceforge.net/projects/dsgpl/files/Tool%20Chain/DSM%207.0.0%20Tool%20Chains/Intel%20x86%20Linux%204.4.180%20%28Apollolake%29/apollolake-gcc750_glibc226_x86_64-GPL.txz'
linux-src:
description: 'Linux kernel source URL for repack zImage'
required: true
default: 'https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.180.tar.xz'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Bulid
id: bulid-bsp
run: |
patfile=$(basename ${{github.event.inputs.pat-address}} | while read; do echo -e ${REPLY//%/\\x}; done)
echo "::set-output name=patfile::$patfile"
# install bsdiff
sudo apt-get install -y bsdiff

#ls -al $GITHUB_WORKSPACE/
mkdir /opt/build
mkdir /opt/dist
cd /opt/build
curl -L ${{github.event.inputs.pat-address}} -o ds.pat
curl -L ${{github.event.inputs.toolchain}} -o toolchain.txz
curl -L ${{github.event.inputs.linux-src}} -o linux.tar.xz
mkdir pat
tar xf ds.pat -C pat
# is update_pack
if [ ! -f "pat/zImage" ]; then
cd pat
ar x $(ls flashupdate*)
tar xf data.tar.xz
cd ..
fi
mkdir toolchain
tar xf toolchain.txz -C toolchain
mkdir linux-src
tar xf linux.tar.xz --strip-components 1 -C linux-src

# extract vmlinux
./linux-src/scripts/extract-vmlinux pat/zImage > vmlinux
# sha256
sha256sum ds.pat >> checksum.sha256
sha256sum pat/zImage >> checksum.sha256
sha256sum pat/rd.gz >> checksum.sha256
sha256sum vmlinux >> checksum.sha256
# patch vmlinux
# vmlinux_mod.bin
curl -L https://github.com/jumkey/dsm-research/raw/master/tools/common.php -o common.php
curl -L https://github.com/jumkey/dsm-research/raw/master/tools/patch-ramdisk-check.php -o patch-ramdisk-check.php
curl -L https://github.com/jumkey/dsm-research/raw/master/tools/patch-boot_params-check.php -o patch-boot_params-check.php
php patch-boot_params-check.php vmlinux vmlinux-mod
php patch-ramdisk-check.php vmlinux-mod vmlinux_mod.bin

git clone https://github.com/kiler129/recreate-zImage.git
chmod +x recreate-zImage/rebuild_kernel.sh
cd linux-src
# ---------- make zImage_mod
# Make file more anonymous
export KBUILD_BUILD_TIMESTAMP="1970/1/1 00:00:00"
export KBUILD_BUILD_USER="root"
export KBUILD_BUILD_HOST="localhost"
export KBUILD_BUILD_VERSION=0

export ARCH=x86_64
export CROSS_COMPILE=/opt/build/toolchain/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-
#make olddefconfig
make defconfig
# change to lzma
sed -i 's/CONFIG_KERNEL_GZIP=y/# CONFIG_KERNEL_GZIP is not set/' .config
sed -i 's/# CONFIG_KERNEL_LZMA is not set/CONFIG_KERNEL_LZMA=y/' .config
<< see_below
make clean
sed -i 's/bzImage: vmlinux/bzImage: /' arch/x86/Makefile
make vmlinux -j4 || true # make some *.o inspire by UnknowO
cp ../vmlinux_mod.bin vmlinux # vmlinux_mod.bin is already stripped of debugging and comments, strippe again should be ok
make bzImage
sed -i 's/bzImage: /bzImage: vmlinux/' arch/x86/Makefile
cp arch/x86/boot/bzImage ../zImage_mod
make clean
see_below
# for DS3615xs
#sed -i 's/ -std=gnu89$/ -std=gnu89 $(call cc-option,-fno-PIE)/' Makefile
sed -i 's/ ld -/ ${CROSS_COMPILE}ld -/' ../recreate-zImage/rebuild_kernel.sh
sed -i 's/(ld -/(${CROSS_COMPILE}ld -/' ../recreate-zImage/rebuild_kernel.sh
sed -i 's/ gcc / ${CROSS_COMPILE}gcc /' ../recreate-zImage/rebuild_kernel.sh
sed -i 's/ nm / ${CROSS_COMPILE}nm /' ../recreate-zImage/rebuild_kernel.sh
sed -i 's/ objcopy / ${CROSS_COMPILE}objcopy /' ../recreate-zImage/rebuild_kernel.sh
sed -i 's/(objdump /(${CROSS_COMPILE}objdump /' ../recreate-zImage/rebuild_kernel.sh
sed -i 's/ readelf / ${CROSS_COMPILE}readelf /' ../recreate-zImage/rebuild_kernel.sh
../recreate-zImage/rebuild_kernel.sh $PWD/../linux-src ../vmlinux_mod.bin ../zImage_mod
# ----------
cd ..
bsdiff pat/zImage zImage_mod diff.bsp

echo '---copy file---'
cp vmlinux /opt/dist
cp vmlinux_mod.bin /opt/dist
cp diff.bsp /opt/dist
cp checksum.sha256 /opt/dist
echo '---END---'
- name: Upload
uses: actions/upload-artifact@v2
with:
name: kernel bs patch for ${{ steps.bulid-bsp.outputs.patfile }}
path: /opt/dist
64 changes: 53 additions & 11 deletions build-loader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cd "${BASH_SOURCE%/*}/" || exit 1
########################################################################################################################

##### CONFIGURATION YOU CAN OVERRIDE USING ENVIRONMENT #################################################################
BRP_JUN_MOD=${BRP_JUN_MOD:-0} # whether you want to use jun's mod
BRP_DEBUG=${BRP_DEBUG:-0} # whether you want to see debug messages
BRP_CACHE_DIR=${BRP_CACHE_DIR:-"$PWD/cache"} # cache directory where stuff is downloaded & unpacked
BRP_USER_CFG=${BRP_USER_CFG:-"$PWD/user_config.json"}
Expand Down Expand Up @@ -257,6 +258,7 @@ fi
readonly BRP_RD_FILE=${BRP_UPAT_DIR}/$(brp_json_get_field "${BRP_REL_CONFIG_JSON}" 'files.ramdisk.name') # original ramdisk file
readonly BRP_URD_DIR="${BRP_BUILD_DIR}/rd-${BRP_REL_OS_ID}-unpacked" # folder with unpacked ramdisk contents
readonly BRP_RD_REPACK="${BRP_BUILD_DIR}/rd-patched-${BRP_REL_OS_ID}.gz" # repacked ramdisk file
readonly BRP_JUN_PATCH="${BRP_USER_DIR}/jun.patch" # jun.patch

#rm -rf build/testing/rd-* # for debugging ramdisk routines; also comment-out rm of BRP_URD_DIR
#rm "${BRP_RD_REPACK}" # for testing
Expand All @@ -272,6 +274,17 @@ if [ ! -f "${BRP_RD_REPACK}" ]; then # do we even need to unpack-modify-repack t
pr_info "Found unpacked ramdisk at \"%s\" - skipping unpacking" "${BRP_URD_DIR}"
fi

if [ "${BRP_JUN_MOD}" -eq 1 ]; then
pushd ${BRP_URD_DIR}
git init
git config user.name "Mona Lisa"
git config user.email "[email protected]"
git add -A
git commit -m "import ramdisk"
git tag baseline
popd
fi

# Applies all static .patch files to the ramdisk
brp_apply_text_patches \
"${BRP_URD_DIR}" \
Expand Down Expand Up @@ -317,16 +330,30 @@ if [ ! -f "${BRP_RD_REPACK}" ]; then # do we even need to unpack-modify-repack t
|| pr_crit "Failed to move mfgBIOS LKM"
fi

if [ "${BRP_JUN_MOD}" -eq 1 ]; then
git -C ${BRP_URD_DIR} diff baseline > ${BRP_JUN_PATCH}
pushd ${BRP_URD_DIR}
# rm .git
"${RM_PATH}" -rf .git
popd
fi

# Finally, we can finish ramdisk modifications with repacking it
readonly BRP_RD_COMPRESSED=$(brp_json_get_field "${BRP_REL_CONFIG_JSON}" "extra.compress_rd")

pr_process "Repacking ramdisk to %s" "${BRP_RD_REPACK}"
if [ "${BRP_RD_COMPRESSED}" == "true" ]; then
brp_pack_zrd "${BRP_RD_REPACK}" "${BRP_URD_DIR}"
elif [ "${BRP_RD_COMPRESSED}" == "false" ]; then
brp_pack_cpiord "${BRP_RD_REPACK}" "${BRP_URD_DIR}"
if [ "${BRP_JUN_MOD}" -eq 1 ]; then
cp ${BRP_RD_FILE} ${BRP_RD_REPACK}
else
pr_crit "Invalid value for platform extra.compress_rd (expected bool, got \"%s\")" "${BRP_RD_COMPRESSED}"
pr_process "Repacking ramdisk to %s" "${BRP_RD_REPACK}"
if [ "${BRP_RD_COMPRESSED}" == "true" ]; then
brp_pack_zrd "${BRP_RD_REPACK}" "${BRP_URD_DIR}"
# add fake 64byte sign
dd if=/dev/zero of=${BRP_RD_REPACK} bs=$((3-(($(stat --format=%s ${BRP_RD_REPACK})+3)&0x03)+64)) count=1 conv=notrunc oflag=append
elif [ "${BRP_RD_COMPRESSED}" == "false" ]; then
brp_pack_cpiord "${BRP_RD_REPACK}" "${BRP_URD_DIR}"
else
pr_crit "Invalid value for platform extra.compress_rd (expected bool, got \"%s\")" "${BRP_RD_COMPRESSED}"
fi
fi
pr_process_ok

Expand Down Expand Up @@ -384,13 +411,28 @@ if [[ "${BRP_DEV_DISABLE_EXTS}" -ne 1 ]]; then
pr_process_ok
fi

pr_process "Packing custom ramdisk layer to %s" "${BRP_CUSTOM_RD_PATH}"
if [ "${BRP_RD_COMPRESSED}" == "true" ]; then
if [ "${BRP_JUN_MOD}" -eq 1 ]; then
brp_mkdir "${BRP_CUSTOM_DIR}/usr/bin"
brp_mkdir "${BRP_CUSTOM_DIR}/etc"
"${CP_PATH}" --recursive --dereference "${BRP_COMMON_CFG_BASE}/jun/init" "${BRP_CUSTOM_DIR}/init"
"${CP_PATH}" --recursive --dereference "${BRP_COMMON_CFG_BASE}/jun/usr/bin/patch" "${BRP_CUSTOM_DIR}/usr/bin/patch"
"${CP_PATH}" --recursive --dereference "${BRP_JUN_PATCH}" "${BRP_CUSTOM_DIR}/etc/jun.patch"

pr_process "Packing custom ramdisk layer to %s" "${BRP_CUSTOM_RD_PATH}"
brp_pack_zrd "${BRP_CUSTOM_RD_PATH}" "${BRP_CUSTOM_DIR}"
elif [ "${BRP_RD_COMPRESSED}" == "false" ]; then
brp_pack_cpiord "${BRP_CUSTOM_RD_PATH}" "${BRP_CUSTOM_DIR}"
# add fake 64byte sign
dd if=/dev/zero of=${BRP_CUSTOM_RD_PATH} bs=$((3-(($(stat --format=%s ${BRP_RD_REPACK})+3)&0x03)+64)) count=1 conv=notrunc oflag=append
else
pr_crit "Invalid value for platform extra.compress_rd (expected bool, got \"%s\")" "${BRP_RD_COMPRESSED}"
pr_process "Packing custom ramdisk layer to %s" "${BRP_CUSTOM_RD_PATH}"
if [ "${BRP_RD_COMPRESSED}" == "true" ]; then
brp_pack_zrd "${BRP_CUSTOM_RD_PATH}" "${BRP_CUSTOM_DIR}"
# add fake 64byte sign
dd if=/dev/zero of=${BRP_CUSTOM_RD_PATH} bs=$((3-(($(stat --format=%s ${BRP_RD_REPACK})+3)&0x03)+64)) count=1 conv=notrunc oflag=append
elif [ "${BRP_RD_COMPRESSED}" == "false" ]; then
brp_pack_cpiord "${BRP_CUSTOM_RD_PATH}" "${BRP_CUSTOM_DIR}"
else
pr_crit "Invalid value for platform extra.compress_rd (expected bool, got \"%s\")" "${BRP_RD_COMPRESSED}"
fi
fi
pr_process_ok

Expand Down
13 changes: 13 additions & 0 deletions buildroot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Build

```shell
git clone git://git.buildroot.net/buildroot
cd buildroot
# copy custom files
make syno_defconfig
make
# get bzImage rootfs.cpio.lzma
ls output/images
```

[see .github/workflows/buildroot.yml](../.github/workflows/buildroot.yml)
Loading