Merge pull request #1 from AuxXxilium/dev

add linux live patch function
This commit is contained in:
Christian Schulthess 2023-09-17 12:39:48 +02:00 committed by GitHub
commit a7c86d0d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 69 additions and 82 deletions

View File

@ -1,8 +0,0 @@
--- a/etc/passwd
+++ b/etc/passwd
@@ -1,4 +1,4 @@
-root:x:0:0::/root:/bin/ash
+root::0:0::/root:/bin/ash
system:x:1:1::/usr/syno/synoman:/usr/bin/nologin
daemon:x:2:2::/:/bin/sh
SYSTEM_ADMIN:x:3:101::/nonexist:/usr/bin/nologin

View File

@ -1,39 +0,0 @@
--- a/linuxrc.syno.impl
+++ b/linuxrc.syno.impl
@@ -51,6 +51,10 @@
UnknownSynoPartitionMigrationFlag="/.unknown_syno_partition_migrate"
IncompatibleRootDevice="/.incompatible_root_device"
+set -x
+insmod /usr/lib/modules/rp.ko
+/addons/addons.sh early
+
UmountRoot()
{
grep "^${RootDevice}" /proc/mounts && /bin/umount -f ${Mnt}
@@ -67,6 +69,8 @@
# show date for login info
date
+ rmmod rp
+ /addons/addons.sh jrExit
UmountRoot
exit $1
@@ -176,6 +179,8 @@
echo "Insert basic USB modules..."
SYNOLoadModules $USB_MODULES
+
+/addons/addons.sh modules
# insert Etron USB3.0 drivers
if [ $KERNEL_VCODE -ge "$(KernelVersionCode "3.10")" ]; then
@@ -224,6 +229,7 @@
fi
fi
+/addons/addons.sh patches
LoadBrmModules
####################################################

View File

@ -8,4 +8,4 @@
+DisabledPortDisks=""
partition=`/usr/syno/bin/synodiskport -installable_disk_list`
product=`/bin/get_key_value /etc.defaults/synoinfo.conf product`
product=`/bin/get_key_value /etc.defaults/synoinfo.conf product`

View File

@ -8,4 +8,4 @@
+DisabledPortDisks=""
partition="$(/usr/syno/bin/synodiskport -installable_disk_list)"
upnpmodelname="$(/bin/get_key_value /etc.defaults/synoinfo.conf upnpmodelname)"
upnpmodelname="$(/bin/get_key_value /etc.defaults/synoinfo.conf upnpmodelname)"

View File

@ -5,4 +5,4 @@
+root::0:0::/root:/bin/ash
system:x:1:1::/usr/syno/synoman:/usr/bin/nologin
daemon:x:2:2::/:/bin/sh
lp:x:7:7::/var/spool/lpd:/bin/sh
lp:x:7:7::/var/spool/lpd:/bin/sh

View File

@ -5,4 +5,4 @@
+root::0:0::/root:/bin/ash
system:x:1:1::/usr/syno/synoman:/usr/bin/nologin
daemon:x:2:2::/:/bin/sh
SYSTEM_ADMIN:x:3:101::/nonexist:/usr/bin/nologin
SYSTEM_ADMIN:x:3:101::/nonexist:/usr/bin/nologin

View File

@ -6,4 +6,4 @@
echo "=============================="
-
+/addons/addons.sh rcExit
exit 0
exit 0

View File

@ -34,4 +34,4 @@
+
if [ "$SupportDualhead" = "yes" ]; then
# Run HA script
/etc.defaults/AHAtasks check_stage
/etc.defaults/AHAtasks check_stage

View File

@ -1,5 +1,5 @@
--- a/linuxrc.syno.impl
+++ b/linuxrc.syno.impl
--- a/linuxrc.syno
+++ b/linuxrc.syno
@@ -51,6 +51,8 @@
UnknownSynoPartitionMigrationFlag="/.unknown_syno_partition_migrate"
IncompatibleRootDevice="/.incompatible_root_device"
@ -9,28 +9,31 @@
UmountRoot()
{
grep "^${RootDevice}" /proc/mounts && /bin/umount -f ${Mnt}
@@ -67,6 +69,7 @@
# show date for login info
date
@@ -73,6 +75,9 @@
if [ "$SupportDualhead" = "yes" ]; then
/etc.defaults/AHAtasks stage_change_end
fi
+
+ /addons/addons.sh jrExit
+
UmountRoot
exit $1
@@ -176,6 +179,8 @@
}
@@ -154,6 +159,8 @@
echo "Insert basic USB modules..."
SYNOLoadModules $USB_MODULES
+
+/addons/addons.sh modules
+
# insert Etron USB3.0 drivers
if [ $KERNEL_VCODE -ge "$(KernelVersionCode "3.10")" ]; then
@@ -224,6 +229,7 @@
if [ $KERNEL_VCODE -ge $(KernelVersionCode "3.10") ]; then
@@ -206,6 +213,8 @@
fi
fi
+/addons/addons.sh patches
LoadBrmModules
####################################################
+
if [ "$SupportDualhead" = "yes" ]; then
# Run HA script
/etc.defaults/AHAtasks check_stage

View File

@ -33,4 +33,4 @@
+/addons/addons.sh patches
LoadBrmModules
####################################################
####################################################

View File

@ -1,10 +1,9 @@
--- a/linuxrc.syno.impl
+++ b/linuxrc.syno.impl
@@ -49,6 +49,10 @@
@@ -49,6 +49,9 @@
UnknownSynoPartitionMigrationFlag="/.unknown_syno_partition_migrate"
IncompatibleRootDevice="/.incompatible_root_device"
+set -x
+insmod /usr/lib/modules/rp.ko
+/addons/addons.sh early
+
@ -37,4 +36,4 @@
+
if [ "$SupportDualhead" = "yes" ]; then
# Run HA script
/etc.defaults/AHAtasks check_stage
/etc.defaults/AHAtasks check_stage

View File

@ -1,10 +1,9 @@
--- a/linuxrc.syno.impl
+++ b/linuxrc.syno.impl
@@ -51,6 +51,10 @@
@@ -51,6 +51,9 @@
UnknownSynoPartitionMigrationFlag="/.unknown_syno_partition_migrate"
IncompatibleRootDevice="/.incompatible_root_device"
+set -x
+insmod /usr/lib/modules/rp.ko
+/addons/addons.sh early
+
@ -23,17 +22,18 @@
@@ -176,6 +179,8 @@
echo "Insert basic USB modules..."
SYNOLoadModules $USB_MODULES
+
+/addons/addons.sh modules
+
# insert Etron USB3.0 drivers
if [ $KERNEL_VCODE -ge "$(KernelVersionCode "3.10")" ]; then
@@ -224,6 +229,7 @@
@@ -224,6 +229,8 @@
fi
fi
+/addons/addons.sh patches
+
LoadBrmModules
####################################################
####################################################

View File

@ -5,4 +5,4 @@
127.0.0.1 localhost
::1 localhost
+127.0.0.1 update7.synology.com
+127.0.0.1 dataupdate7.synology.com
+127.0.0.1 dataupdate7.synology.com

View File

@ -29,4 +29,4 @@
+
Mkdir -p /tmpRoot/initrd
Umount /proc >/dev/null 2>&1
Umount /proc >/dev/null 2>&1

View File

@ -0,0 +1,32 @@
--- a/usr/sbin/init.post
+++ b/usr/sbin/init.post
@@ -18,6 +18,29 @@
fi
mount $RootDevice /tmpRoot -o barrier=1
+############################################################################################
+SED_PATH='/tmpRoot/usr/bin/sed'
+
+@@@CONFIG-MANIPULATORS-TOOLS@@@
+
+@@@CONFIG-GENERATED@@@
+
+UPSTART="/tmpRoot/usr/share/init"
+
+if ! echo; then
+ _replace_in_file '^start on' '#start on' $UPSTART/tty.conf
+ _replace_in_file "console output" "console none" $UPSTART/syno_poweroff_task.conf
+ _replace_in_file "console output" "console none" $UPSTART/burnin_loader.conf
+ _replace_in_file "console output" "console none" $UPSTART/udevtrigger.conf
+ _replace_in_file "console output" "console none" $UPSTART/bs-poweroff.conf
+ _replace_in_file "console output" "console none" $UPSTART/udevd.conf
+else
+ _replace_in_file '^#start on' 'start on' $UPSTART/tty.conf
+fi
+
+/addons/addons.sh late
+############################################################################################
+
mkdir -p /tmpRoot/initrd
umount /proc &> /dev/null

View File

@ -28,4 +28,4 @@
+############################################################################################
Mkdir -p /tmpRoot/initrd
Umount /proc >/dev/null 2>&1
Umount /proc >/dev/null 2>&1

View File

@ -28,4 +28,4 @@
+############################################################################################
Mkdir -p /tmpRoot/initrd
Umount /proc >/dev/null 2>&1
Umount /proc >/dev/null 2>&1