-
Notifications
You must be signed in to change notification settings - Fork 35
/
steps-to-franken-dsm.txt
executable file
·130 lines (97 loc) · 4.45 KB
/
steps-to-franken-dsm.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
************************************************************
*** This is a brain-dump of how to prepare a franken-DSM ***
*** For details please see franken-dsm.md ***
************************************************************
1. get VDSM PAT
2. unpack vdsm pat
3. unpack synoboot from it (synology_kvmx64_virtualdsm_25556_91803D68__.bin.zip) to synoboot-synology_kvmx64_virtualdsm_25556_91803D68__.bin
3a. add BIOS partition? => not needed most likely
dd if=/dev/zero bs=1M count=10 >> ./synoboot-synology_kvmx64_virtualdsm_25556_91803D68__.bin
fdisk ./synoboot-synology_kvmx64_virtualdsm_25556_91803D68__.bin
n
p
3
[make it 8159 sectors; most likely end sector will be 233439]
w
q [if needed]
4. losetup -f -P ./synoboot-synology_kvmx64_virtualdsm_25556_91803D68__.bin
5. mount /dev/loop0p1 /mnt/_tmp
6. nano /mnt/_tmp/boot/grub/grub.conf
Comment-out "terminal serial"
Comment-out "hiddenmenu"
Add "timeout_style=menu"
Add entry:
title FRANKEN_DSM
root (hd0,0)
kernel /zImage root=/dev/md0 ihd_num=0 netif_num=1 syno_hw_version=DS3617xs macs=0011320C3701 vender_format_version=2 console=ttyS0 sn=1130ODN002064
initrd /rd.gz
7. Patch ramdisk
mkdir -p /home/ttg/dsm-research/franken-dsm/rd
# UNPACK
cd /home/ttg/dsm-research/franken-dsm/rd ; xz -dc < /mnt/_tmp/rd.gz | cpio -idmv
# INIT
nano linuxrc.syno
Comment-out this if [don't forget the "fi" at the end idiot]:
<if [ "$UniqueRD" = "kvmx64" -o \
< "$UniqueRD" = "nextkvmx64" -o \
< "$UniqueRD" = "kvmcloud" ]; then
printf '#!/bin/sh\ncat /proc/sys/kernel/syno_serial\n' > ./usr/syno/bin/synovdsmserial
printf '#!/bin/sh\nexit 1\n' > ./usr/syno/bin/synovdsmtool
printf '#!/bin/sh\nexit 1\n' > ./usr/syno/bin/synoguestcommd
printf '#!/bin/sh\nexit 1\n' > ./usr/syno/bin/synoguestcmdd
printf '#!/bin/sh\nexit 0\n' > ./usr/syno/bin/syno_pstore_collect
chmod +x ./usr/syno/bin/syno_pstore_collect
nano ./etc/passwd => remove root password (root:x: => root::)
cp /home/ttg/dsm-research/franken-dsm/synoinfo-ds3617xs-franken.conf ./etc/synoinfo.conf
# don't do, alternative below
#nano ./usr/syno/sbin/installer.sh
# Find "if [ "$SYNOBIOS" = "kvmx64" -o" and comment-out the whole if
change "SYNOBIOS" to be ==>>> SYNOBIOS="broadwell"
nano ./etc/rc => find "if [ "kvmx64" ==" and comment-out that if/fi (leaving NET_DRIVERS enabled
# COPY MISSING FROM DS
cp /home/ttg/dsm-research/DSM_DS3617xs_25556/rd/etc/VERSION ./etc/VERSION
cp /home/ttg/dsm-research/DSM_DS3617xs_25556/rd/usr/syno/bin/scemd ./usr/syno/bin/scemd
cp /home/ttg/dsm-research/DSM_DS3617xs_25556/rd/usr/syno/bin/synosearchagent ./usr/syno/bin/synosearchagent
# PATCH BIOS UPDATE
=> TODO method to stop bios update from being triggered and screwing up the install
=> currently the hack is to run the following before starting install:
rm /tmp/checksum.syno.tmp
while [ ! -f /tmp/checksum.syno.tmp ]; do true; done; rm '/tmpData/upd@te/bios.ROM'
# FIX CONSOLE
add the following to ./usr/sbin/init.post (After mount w/ barrier)
_del()
{
if grep -q "$1" "$2";then
/tmpRoot/usr/bin/sed -i "$2" -e "/$1/ d"
fi
}
_del 'supportadt7490="yes"' /tmpRoot/etc.defaults/synoinfo.conf
#$1 pattern, $2 replace, $3 path
_replace()
{
if grep -q "$1" "$3";then
/tmpRoot/usr/bin/sed -i "$3" -e "s/$1/$2/"
fi
}
UPSTART="/tmpRoot/usr/share/init"
if ! echo; then
_replace '^start on' '#start on' $UPSTART/tty.conf
_replace "console output" "console none" $UPSTART/syno_poweroff_task.conf
_replace "console output" "console none" $UPSTART/burnin_loader.conf
_replace "console output" "console none" $UPSTART/udevtrigger.conf
_replace "console output" "console none" $UPSTART/bs-poweroff.conf
_replace "console output" "console none" $UPSTART/udevd.conf
else
_replace '^#start on' 'start on' $UPSTART/tty.conf
fi
# PACK BACK
cd /home/ttg/dsm-research/franken-dsm/rd ; find . 2>/dev/null | cpio -o -H newc -R root:root | xz -9 --format=lzma > /mnt/_tmp/rd.gz
7. umount /mnt/_tmp
---
Random useful commands:
date -s 2021.08.02-03:31
tail -f /var/log/* /tmp/installer_sh.log
mdadm --verbose -C /dev/md0 -e 0.9 -amd -R -l1 --force -n1 /dev/sda1
mdadm --grow /dev/md0 -n12 --force
mdadm --verbose -C /dev/md1 -e 0.9 -amd -R -l1 --force -n1 /dev/sda2
mdadm --grow /dev/md1 -n12 --force