diff --git a/files/board/arpl/overlayfs/opt/arpl/lang/arpl.pot b/files/board/arpl/overlayfs/opt/arpl/lang/arpl.pot index 47cf5202..329b7e96 100644 --- a/files/board/arpl/overlayfs/opt/arpl/lang/arpl.pot +++ b/files/board/arpl/overlayfs/opt/arpl/lang/arpl.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-21 17:20+0800\n" +"POT-Creation-Date: 2023-06-23 21:24+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,11 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: boot.sh:8 init.sh:164 +#: boot.sh:8 init.sh:161 msgid "Loader is not configured!" msgstr "" -#: boot.sh:19 init.sh:43 +#: boot.sh:19 init.sh:41 msgid "Welcome to %s" msgstr "" @@ -29,12 +29,13 @@ msgstr "" msgid "DSM zImage changed" msgstr "" -#: boot.sh:35 boot.sh:47 menu.sh:720 menu.sh:746 menu.sh:815 menu.sh:826 -#: menu.sh:855 menu.sh:868 menu.sh:875 menu.sh:1080 menu.sh:1178 +#: boot.sh:35 boot.sh:47 menu.sh:739 menu.sh:747 menu.sh:773 menu.sh:801 +#: menu.sh:813 menu.sh:837 menu.sh:846 menu.sh:857 menu.sh:886 menu.sh:899 +#: menu.sh:906 msgid "Error" msgstr "" -#: boot.sh:36 menu.sh:869 +#: boot.sh:36 menu.sh:900 msgid "zImage not patched:\\n" msgstr "" @@ -42,7 +43,7 @@ msgstr "" msgid "DSM Ramdisk changed" msgstr "" -#: boot.sh:48 menu.sh:876 +#: boot.sh:48 menu.sh:907 msgid "Ramdisk not patched:\\n" msgstr "" @@ -59,121 +60,121 @@ msgid "" "The current version of arpl does not support booting %s-%s, please rebuild." msgstr "" -#: boot.sh:104 +#: boot.sh:105 msgid "'Not set MACs' is enabled." msgstr "" -#: boot.sh:117 +#: boot.sh:119 msgid "" "Detected %s network cards, %s MACs were customized, the rest will use the " "original MACs." msgstr "" -#: boot.sh:147 +#: boot.sh:149 msgid "Cmdline:\\n" msgstr "" -#: boot.sh:152 +#: boot.sh:154 msgid "Reboot to boot directly in DSM" msgstr "" -#: boot.sh:162 +#: boot.sh:164 msgid "Detected %s network cards, Waiting IP.(For reference only)" msgstr "" -#: boot.sh:169 init.sh:184 +#: boot.sh:171 init.sh:181 msgid "DOWN" msgstr "" -#: boot.sh:173 init.sh:188 +#: boot.sh:175 init.sh:185 msgid "ERROR" msgstr "" -#: boot.sh:179 +#: boot.sh:181 msgid "Access \\033[1;34mhttp://%s:5000\\033[0m to connect the DSM via web." msgstr "" -#: boot.sh:188 +#: boot.sh:190 msgid "Loading DSM kernel..." msgstr "" -#: boot.sh:192 +#: boot.sh:194 msgid "Warning, running kexec with --noefi param, strange things will happen!!" msgstr "" -#: boot.sh:197 +#: boot.sh:199 msgid "Booting..." msgstr "" -#: boot.sh:200 +#: boot.sh:201 msgid "" "[This interface will not be operational. Please use the http://find.synology." "com/ find DSM and connect.]" msgstr "" -#: init.sh:18 +#: init.sh:17 msgid "Loader disk not found!" msgstr "" -#: init.sh:20 +#: init.sh:19 msgid "Loader disk seems to be damaged!" msgstr "" -#: init.sh:21 +#: init.sh:20 msgid "There are multiple loader disks, please insert only one loader disk!" msgstr "" -#: init.sh:34 init.sh:35 init.sh:36 +#: init.sh:32 init.sh:33 init.sh:34 msgid "Can't mount %s" msgstr "" -#: init.sh:106 +#: init.sh:104 msgid "Setting %s MAC to %s" msgstr "" -#: init.sh:125 +#: init.sh:122 msgid "Loader disk neither USB or DoM" msgstr "" -#: init.sh:133 +#: init.sh:130 msgid "Loader disk:" msgstr "" -#: init.sh:146 +#: init.sh:143 msgid "Resizing %s" msgstr "" -#: init.sh:157 +#: init.sh:154 msgid "Loading keymap" msgstr "" -#: init.sh:167 +#: init.sh:164 msgid "User requested edit settings." msgstr "" -#: init.sh:177 +#: init.sh:174 msgid "Detected %s network cards, Waiting IP." msgstr "" -#: init.sh:194 +#: init.sh:191 msgid "" "Access \\033[1;34mhttp://%s:7681\\033[0m to configure the loader via web " "terminal." msgstr "" -#: init.sh:204 +#: init.sh:201 msgid "Call \\033[1;32mmenu.sh\\033[0m to configure loader" msgstr "" -#: init.sh:206 +#: init.sh:203 msgid "User config is on" msgstr "" -#: init.sh:207 +#: init.sh:204 msgid "Default SSH Root password is" msgstr "" -#: init.sh:213 +#: init.sh:210 msgid "" "You have less than 4GB of RAM, if errors occur in loader creation, please " "increase the amount of memory." @@ -195,929 +196,873 @@ msgstr "" msgid "Show beta models" msgstr "" -#: menu.sh:104 +#: menu.sh:105 msgid "Choose the model" msgstr "" -#: menu.sh:143 +#: menu.sh:144 msgid "Choose a build number" msgstr "" -#: menu.sh:154 menu.sh:159 menu.sh:163 +#: menu.sh:156 menu.sh:161 menu.sh:165 msgid "Build Number" msgstr "" -#: menu.sh:155 +#: menu.sh:157 msgid "" "This version does not support UEFI startup, Please select another version or " "switch the startup mode." msgstr "" -#: menu.sh:160 +#: menu.sh:162 msgid "" "This version only support usb startup, Please select another version or " "switch the startup mode." msgstr "" -#: menu.sh:164 +#: menu.sh:166 msgid "Reconfiguring Synoinfo, Addons and Modules" msgstr "" -#: menu.sh:209 menu.sh:345 menu.sh:478 menu.sh:610 menu.sh:1512 +#: menu.sh:211 menu.sh:354 menu.sh:497 menu.sh:636 menu.sh:1572 msgid "Choose a option" msgstr "" -#: menu.sh:210 +#: menu.sh:212 msgid "Add an addon" msgstr "" -#: menu.sh:211 +#: menu.sh:213 msgid "Delete addon(s)" msgstr "" -#: menu.sh:212 +#: menu.sh:214 msgid "Show user addons" msgstr "" -#: menu.sh:213 +#: menu.sh:215 msgid "Show all available addons" msgstr "" -#: menu.sh:214 +#: menu.sh:216 msgid "Upload a external addon" msgstr "" -#: menu.sh:215 menu.sh:352 menu.sh:475 menu.sh:606 menu.sh:923 menu.sh:1519 -#: menu.sh:1667 +#: menu.sh:217 menu.sh:361 menu.sh:493 menu.sh:631 menu.sh:954 menu.sh:1579 +#: menu.sh:1727 msgid "Exit" msgstr "" -#: menu.sh:226 -msgid "No available addons to add" +#: menu.sh:229 menu.sh:234 menu.sh:240 menu.sh:251 menu.sh:259 menu.sh:277 +#: menu.sh:291 menu.sh:296 menu.sh:300 menu.sh:314 menu.sh:318 menu.sh:325 +#: menu.sh:328 menu.sh:1706 +msgid "Addons" msgstr "" #: menu.sh:230 -msgid "Select an addon" +msgid "No available addons to add" msgstr "" #: menu.sh:235 -msgid "Params" +msgid "Select an addon" msgstr "" -#: menu.sh:236 +#: menu.sh:241 msgid "Type a opcional params to addon" msgstr "" -#: menu.sh:245 +#: menu.sh:252 msgid "No user addons to remove" msgstr "" -#: menu.sh:253 +#: menu.sh:260 msgid "Select addon to remove" msgstr "" -#: menu.sh:269 -msgid "User addons" -msgstr "" - -#: menu.sh:282 -msgid "Available addons" -msgstr "" - -#: menu.sh:288 menu.sh:1137 menu.sh:1167 menu.sh:1200 menu.sh:1581 +#: menu.sh:297 menu.sh:1186 menu.sh:1217 menu.sh:1250 menu.sh:1641 msgid "This feature is only available when accessed via web/ssh." msgstr "" -#: menu.sh:292 +#: menu.sh:301 msgid "Please upload the *.addons file." msgstr "" -#: menu.sh:305 menu.sh:319 -msgid "Invalid addon" -msgstr "" - -#: menu.sh:306 menu.sh:1608 menu.sh:1622 +#: menu.sh:315 menu.sh:1668 menu.sh:1682 msgid "Not a valid file, please try again!" msgstr "" -#: menu.sh:309 menu.sh:529 menu.sh:567 menu.sh:1333 menu.sh:1569 -msgid "Alert" -msgstr "" - -#: menu.sh:310 menu.sh:1570 +#: menu.sh:319 menu.sh:1630 msgid "Invalid proxy server url, continue?" msgstr "" -#: menu.sh:316 menu.sh:445 -msgid "Success" -msgstr "" - -#: menu.sh:317 +#: menu.sh:326 msgid "Addon '%s' added to loader, Please enable it in 'Add an addon' menu." msgstr "" -#: menu.sh:320 menu.sh:450 +#: menu.sh:329 menu.sh:468 msgid "File format not recognized!" msgstr "" -#: menu.sh:333 menu.sh:363 menu.sh:378 menu.sh:389 menu.sh:402 menu.sh:408 -#: menu.sh:1647 +#: menu.sh:342 menu.sh:370 menu.sh:374 menu.sh:391 menu.sh:404 menu.sh:418 +#: menu.sh:424 menu.sh:443 menu.sh:446 menu.sh:456 menu.sh:463 menu.sh:467 +#: menu.sh:1707 msgid "Modules" msgstr "" -#: menu.sh:334 +#: menu.sh:343 msgid "Reading modules" msgstr "" -#: menu.sh:346 +#: menu.sh:355 msgid "Show selected modules" msgstr "" -#: menu.sh:347 +#: menu.sh:356 msgid "Select loaded modules" msgstr "" -#: menu.sh:348 +#: menu.sh:357 msgid "Select all modules" msgstr "" -#: menu.sh:349 +#: menu.sh:358 msgid "Deselect all modules" msgstr "" -#: menu.sh:350 +#: menu.sh:359 msgid "Choose modules to include" msgstr "" -#: menu.sh:351 menu.sh:426 +#: menu.sh:360 msgid "Download a external module" msgstr "" -#: menu.sh:360 -msgid "User modules" -msgstr "" - -#: menu.sh:364 +#: menu.sh:375 msgid "Selecting loaded modules" msgstr "" -#: menu.sh:379 +#: menu.sh:392 msgid "Selecting all modules" msgstr "" -#: menu.sh:390 +#: menu.sh:405 msgid "Deselecting all modules" msgstr "" -#: menu.sh:403 +#: menu.sh:419 msgid "Select modules to include" msgstr "" -#: menu.sh:409 +#: menu.sh:425 msgid "Writing to user config" msgstr "" -#: menu.sh:421 +#: menu.sh:438 msgid "" "This function is experimental and dangerous. If you don't know much, please " "exit.\\n" msgstr "" -#: menu.sh:422 +#: menu.sh:439 msgid "" "The imported .ko of this function will be implanted into the corresponding " "arch's modules package, which will affect all models of the arch.\\n" msgstr "" -#: menu.sh:423 +#: menu.sh:440 msgid "" "This program will not determine the availability of imported modules or even " "make type judgments, as please double check if it is correct.\\n" msgstr "" -#: menu.sh:424 +#: menu.sh:441 msgid "" "If you want to remove it, please go to the \"Update Menu\" -> \"Update " "modules\" to forcibly update the modules. All imports will be reset.\\n" msgstr "" -#: menu.sh:425 +#: menu.sh:442 msgid "Do you want to continue?" msgstr "" -#: menu.sh:429 +#: menu.sh:447 msgid "please enter the complete URL to download.\\n" msgstr "" -#: menu.sh:435 menu.sh:702 +#: menu.sh:453 menu.sh:729 msgid "Downloading %s" msgstr "" -#: menu.sh:438 menu.sh:712 menu.sh:775 -msgid "Error downloading" -msgstr "" - -#: menu.sh:439 +#: menu.sh:457 msgid "Check internet, URL or cache disk space" msgstr "" -#: menu.sh:446 +#: menu.sh:464 msgid "Module '%s' added to %s-%s" msgstr "" -#: menu.sh:449 -msgid "Invalid module" -msgstr "" - -#: menu.sh:467 +#: menu.sh:485 msgid "Add/edit a cmdline item" msgstr "" -#: menu.sh:468 +#: menu.sh:486 msgid "Delete cmdline item(s)" msgstr "" -#: menu.sh:470 +#: menu.sh:488 msgid "Define a serial number" msgstr "" -#: menu.sh:472 +#: menu.sh:490 msgid "Define a custom MAC" msgstr "" -#: menu.sh:473 +#: menu.sh:491 msgid "Show user added cmdline" msgstr "" -#: menu.sh:474 +#: menu.sh:492 msgid "Show model inherent cmdline" msgstr "" -#: menu.sh:483 menu.sh:489 menu.sh:519 menu.sh:544 menu.sh:554 menu.sh:563 -#: menu.sh:565 menu.sh:578 -msgid "User cmdline" +#: menu.sh:502 menu.sh:508 menu.sh:518 menu.sh:526 menu.sh:539 menu.sh:549 +#: menu.sh:566 menu.sh:576 menu.sh:586 menu.sh:589 menu.sh:592 menu.sh:603 +#: menu.sh:611 +msgid "Cmdline" msgstr "" -#: menu.sh:484 +#: menu.sh:503 msgid "Type a name of cmdline" msgstr "" -#: menu.sh:490 +#: menu.sh:509 msgid "Type a value of '%s' cmdline" msgstr "" -#: menu.sh:499 +#: menu.sh:519 msgid "No user cmdline to remove" msgstr "" -#: menu.sh:507 +#: menu.sh:527 msgid "Select cmdline to remove" msgstr "" -#: menu.sh:520 +#: menu.sh:540 msgid "Please enter a serial number " msgstr "" -#: menu.sh:530 +#: menu.sh:550 msgid "Invalid serial, continue?" msgstr "" -#: menu.sh:545 +#: menu.sh:567 msgid "Type a custom MAC address of %s" msgstr "" -#: menu.sh:554 +#: menu.sh:577 msgid "Invalid MAC" msgstr "" -#: menu.sh:563 +#: menu.sh:587 msgid "Changing MAC" msgstr "" -#: menu.sh:565 +#: menu.sh:590 msgid "Renewing IP" msgstr "" -#: menu.sh:568 +#: menu.sh:593 msgid "Continue to custom MAC?" msgstr "" -#: menu.sh:586 -msgid "Model/build cmdline" -msgstr "" - -#: menu.sh:603 +#: menu.sh:628 msgid "Add/edit a synoinfo item" msgstr "" -#: menu.sh:604 +#: menu.sh:629 msgid "Delete synoinfo item(s)" msgstr "" -#: menu.sh:605 +#: menu.sh:630 msgid "Show synoinfo entries" msgstr "" -#: menu.sh:615 menu.sh:621 menu.sh:656 -msgid "Synoinfo entries" +#: menu.sh:641 menu.sh:647 menu.sh:658 menu.sh:666 menu.sh:683 +msgid "Synoinfo" msgstr "" -#: menu.sh:616 +#: menu.sh:642 msgid "Type a name of synoinfo entry" msgstr "" -#: menu.sh:622 +#: menu.sh:648 msgid "Type a value of '%s' synoinfo entry" msgstr "" -#: menu.sh:632 +#: menu.sh:659 msgid "No synoinfo entries to remove" msgstr "" -#: menu.sh:640 +#: menu.sh:667 msgid "Select synoinfo entry to remove" msgstr "" -#: menu.sh:681 +#: menu.sh:708 msgid "%s cached." msgstr "" -#: menu.sh:685 +#: menu.sh:712 msgid "Cleaning cache" msgstr "" -#: menu.sh:697 +#: menu.sh:724 msgid "" "Based on the current network situation, switch to %s mirror to downloading." msgstr "" -#: menu.sh:713 menu.sh:776 +#: menu.sh:740 menu.sh:802 msgid "Check internet or cache disk space" msgstr "" -#: menu.sh:718 +#: menu.sh:745 msgid "Checking hash of %s: " msgstr "" -#: menu.sh:721 +#: menu.sh:748 msgid "Hash of pat not match, try again!" msgstr "" -#: menu.sh:725 menu.sh:819 menu.sh:830 menu.sh:841 +#: menu.sh:752 menu.sh:850 menu.sh:861 menu.sh:872 msgid "OK" msgstr "" -#: menu.sh:729 +#: menu.sh:756 msgid "Disassembling %s: " msgstr "" -#: menu.sh:734 +#: menu.sh:761 msgid "Uncompressed tar" msgstr "" -#: menu.sh:738 +#: menu.sh:765 msgid "Compressed tar" msgstr "" -#: menu.sh:742 +#: menu.sh:769 msgid "Encrypted" msgstr "" -#: menu.sh:747 +#: menu.sh:774 msgid "" "Could not determine if pat file is encrypted or not, maybe corrupted, try " "again!" msgstr "" -#: menu.sh:758 +#: menu.sh:784 msgid "Extractor cached." msgstr "" -#: menu.sh:765 +#: menu.sh:791 msgid "Downloading old pat to extract synology .pat extractor..." msgstr "" -#: menu.sh:787 menu.sh:807 -msgid "Error extracting" -msgstr "" - -#: menu.sh:801 menu.sh:804 +#: menu.sh:831 menu.sh:834 msgid "Extracting..." msgstr "" -#: menu.sh:811 +#: menu.sh:842 msgid "Checking hash of zImage: " msgstr "" -#: menu.sh:816 +#: menu.sh:847 msgid "Hash of zImage not match, try again!" msgstr "" -#: menu.sh:822 +#: menu.sh:853 msgid "Checking hash of ramdisk: " msgstr "" -#: menu.sh:827 +#: menu.sh:858 msgid "Hash of ramdisk not match, try again!" msgstr "" -#: menu.sh:833 +#: menu.sh:864 msgid "Copying files: " msgstr "" -#: menu.sh:856 +#: menu.sh:887 msgid "Addon %s not found!" msgstr "" -#: menu.sh:880 menu.sh:1685 +#: menu.sh:911 menu.sh:1776 msgid "Cleaning" msgstr "" -#: menu.sh:883 +#: menu.sh:914 msgid "Ready!" msgstr "" -#: menu.sh:896 +#: menu.sh:927 msgid "Switch LKM version:" msgstr "" -#: menu.sh:899 +#: menu.sh:930 msgid "Switch direct boot:" msgstr "" -#: menu.sh:901 +#: menu.sh:932 msgid "boot IPs wait time:" msgstr "" -#: menu.sh:904 +#: menu.sh:935 msgid "Switch 'not set MACs':" msgstr "" -#: menu.sh:905 +#: menu.sh:936 msgid "Edit user config file manually" msgstr "" -#: menu.sh:906 +#: menu.sh:937 msgid "Try to recovery a DSM installed system" msgstr "" -#: menu.sh:907 +#: menu.sh:938 msgid "Show SATA(s) # ports and drives" msgstr "" -#: menu.sh:909 +#: menu.sh:940 msgid "show pat download link" msgstr "" -#: menu.sh:911 menu.sh:1011 menu.sh:1024 +#: menu.sh:942 msgid "Allow downgrade installation" msgstr "" -#: menu.sh:912 +#: menu.sh:943 msgid "Format disk(s) # Without loader disk" msgstr "" -#: menu.sh:913 menu.sh:1085 menu.sh:1092 menu.sh:1098 menu.sh:1110 +#: menu.sh:944 msgid "Reset syno system password" msgstr "" -#: menu.sh:914 menu.sh:1119 menu.sh:1122 +#: menu.sh:945 msgid "Persistence of arpl modifications" msgstr "" -#: menu.sh:916 +#: menu.sh:947 msgid "Custom dts file # Need rebuild" msgstr "" -#: menu.sh:919 +#: menu.sh:950 msgid "Backup bootloader disk # test" msgstr "" -#: menu.sh:920 +#: menu.sh:951 msgid "Restore bootloader disk # test" msgstr "" -#: menu.sh:922 menu.sh:1242 menu.sh:1251 +#: menu.sh:953 msgid "Development tools" msgstr "" -#: menu.sh:925 menu.sh:1042 +#: menu.sh:956 menu.sh:974 menu.sh:1034 menu.sh:1042 menu.sh:1050 menu.sh:1063 +#: menu.sh:1066 menu.sh:1081 menu.sh:1082 menu.sh:1087 menu.sh:1091 +#: menu.sh:1102 menu.sh:1104 menu.sh:1121 menu.sh:1126 menu.sh:1134 +#: menu.sh:1140 menu.sh:1153 menu.sh:1156 menu.sh:1162 menu.sh:1165 +#: menu.sh:1180 menu.sh:1185 menu.sh:1189 menu.sh:1204 menu.sh:1209 +#: menu.sh:1216 menu.sh:1220 menu.sh:1223 menu.sh:1228 menu.sh:1238 +#: menu.sh:1243 menu.sh:1249 menu.sh:1253 menu.sh:1270 menu.sh:1273 +#: menu.sh:1279 menu.sh:1287 menu.sh:1295 menu.sh:1304 menu.sh:1306 msgid "Advanced" msgstr "" -#: menu.sh:926 menu.sh:1670 +#: menu.sh:957 menu.sh:1730 msgid "Choose the option" msgstr "" -#: menu.sh:942 +#: menu.sh:975 msgid "Choose a waiting time(seconds)" msgstr "" -#: menu.sh:991 +#: menu.sh:1030 msgid "\\nTotal of ports: %s\\n" msgstr "" -#: menu.sh:992 +#: menu.sh:1031 msgid "" "\\nPorts with color \\Z1red\\Zn as DUMMY, color \\Z2\\Zbgreen\\Zn has drive " "connected." msgstr "" -#: menu.sh:993 +#: menu.sh:1032 msgid "\\nRecommended value:" msgstr "" -#: menu.sh:994 +#: menu.sh:1033 msgid "\\nDiskIdxMap:" msgstr "" -#: menu.sh:1003 -msgid "*.pat download link" -msgstr "" - -#: menu.sh:1008 +#: menu.sh:1047 msgid "" "This feature will allow you to downgrade the installation by removing the " "VERSION file from the first partition of all disks.\\n" msgstr "" -#: menu.sh:1009 +#: menu.sh:1048 msgid "Therefore, please insert all disks before continuing.\\n" msgstr "" -#: menu.sh:1010 menu.sh:1047 +#: menu.sh:1049 menu.sh:1088 msgid "" "Warning:\\nThis operation is irreversible. Please backup important data. Do " "you want to continue?" msgstr "" -#: menu.sh:1025 +#: menu.sh:1064 msgid "Removing ..." msgstr "" -#: menu.sh:1026 +#: menu.sh:1065 msgid "Remove VERSION file for all disks completed." msgstr "" -#: menu.sh:1041 menu.sh:1046 menu.sh:1050 menu.sh:1061 -msgid "Format disk" -msgstr "" - -#: menu.sh:1051 +#: menu.sh:1092 msgid "" "Warning:\\nThe current hds is in raid, do you still want to format them?" msgstr "" -#: menu.sh:1062 +#: menu.sh:1103 msgid "Formatting ..." msgstr "" -#: menu.sh:1064 +#: menu.sh:1105 msgid "Formatting is complete." msgstr "" -#: menu.sh:1081 +#: menu.sh:1122 msgid "The installed Syno system not found in the currently inserted disks!" msgstr "" -#: menu.sh:1086 +#: menu.sh:1127 msgid "Choose a user name" msgstr "" -#: menu.sh:1093 +#: menu.sh:1135 msgid "Type a new password for user '%s'" msgstr "" -#: menu.sh:1098 +#: menu.sh:1141 msgid "Invalid password" msgstr "" -#: menu.sh:1111 +#: menu.sh:1154 msgid "Resetting ..." msgstr "" -#: menu.sh:1114 +#: menu.sh:1157 msgid "Password reset completed." msgstr "" -#: menu.sh:1120 menu.sh:1171 menu.sh:1224 +#: menu.sh:1163 menu.sh:1221 menu.sh:1274 msgid "" "Warning:\\nDo not terminate midway, otherwise it may cause damage to the " "arpl. Do you want to continue?" msgstr "" -#: menu.sh:1123 +#: menu.sh:1166 msgid "Persisting ..." msgstr "" -#: menu.sh:1132 +#: menu.sh:1181 msgid "Persisting is complete." msgstr "" -#: menu.sh:1141 +#: menu.sh:1190 msgid "" "Currently, only dts format files are supported. Please prepare and click to " "confirm uploading.\\n(saved in /mnt/p3/users/)" msgstr "" -#: menu.sh:1155 menu.sh:1160 -msgid "Custom dts file" -msgstr "" - -#: menu.sh:1156 +#: menu.sh:1205 msgid "Not a valid dts file, please try again!" msgstr "" -#: menu.sh:1161 +#: menu.sh:1210 msgid "A valid dts file, Automatically import at compile time." msgstr "" -#: menu.sh:1170 menu.sh:1173 -msgid "Backup bootloader disk" -msgstr "" - -#: menu.sh:1174 +#: menu.sh:1224 msgid "Backuping..." msgstr "" -#: menu.sh:1179 +#: menu.sh:1229 msgid "" "Failed to generate backup. There may be insufficient memory. Please clear " "the cache and try again!" msgstr "" -#: menu.sh:1186 +#: menu.sh:1236 msgid "Click on the address above to download." msgstr "" -#: menu.sh:1187 +#: menu.sh:1237 msgid "" "Please confirm the completion of the download before closing this window." msgstr "" -#: menu.sh:1188 -msgid "backup.img.gz download link" -msgstr "" - -#: menu.sh:1194 +#: menu.sh:1244 msgid "backup is complete." msgstr "" -#: menu.sh:1203 menu.sh:1220 menu.sh:1223 menu.sh:1226 menu.sh:1234 -msgid "Restore bootloader disk" -msgstr "" - -#: menu.sh:1204 +#: menu.sh:1254 msgid "" "Please upload the backup file.\\nCurrently, zip(github) and img.gz(backup) " "compressed file formats are supported." msgstr "" -#: menu.sh:1221 +#: menu.sh:1271 msgid "Not a valid .zip/.img.gz file, please try again!" msgstr "" -#: menu.sh:1227 +#: menu.sh:1280 msgid "Writing..." msgstr "" -#: menu.sh:1235 +#: menu.sh:1288 msgid "Restore bootloader disk with success to %s!\\nReboot?" msgstr "" -#: menu.sh:1243 +#: menu.sh:1296 msgid "" "This option only installs opkg package management, allowing you to install " "more tools for use and debugging. Do you want to continue?" msgstr "" -#: menu.sh:1252 +#: menu.sh:1305 msgid "opkg installing ..." msgstr "" -#: menu.sh:1254 +#: menu.sh:1307 msgid "" "opkg install is complete. Please reconnect to SSH/web, or execute 'source ~/." "bashrc'" msgstr "" -#: menu.sh:1264 menu.sh:1292 menu.sh:1299 +#: menu.sh:1317 menu.sh:1345 menu.sh:1352 msgid "Try recovery DSM" msgstr "" -#: menu.sh:1265 +#: menu.sh:1318 msgid "Trying to recovery a DSM installed system" msgstr "" -#: menu.sh:1286 +#: menu.sh:1339 msgid "Found a installation:\\nModel: %s\\nBuildnumber: %s" msgstr "" -#: menu.sh:1290 +#: menu.sh:1343 msgid "\\nSerial: %s" msgstr "" -#: menu.sh:1300 +#: menu.sh:1353 msgid "Unfortunately I couldn't mount the DSM partition!" msgstr "" -#: menu.sh:1308 +#: menu.sh:1361 menu.sh:1367 msgid "Edit with caution" msgstr "" -#: menu.sh:1314 -msgid "Invalid YAML format" +#: menu.sh:1387 +msgid "Alert" msgstr "" -#: menu.sh:1334 +#: menu.sh:1388 msgid "Config changed, would you like to rebuild the loader?" msgstr "" -#: menu.sh:1346 menu.sh:1661 +#: menu.sh:1400 menu.sh:1721 msgid "Choose a language" msgstr "" -#: menu.sh:1359 +#: menu.sh:1414 msgid "Choose a layout" msgstr "" -#: menu.sh:1369 +#: menu.sh:1426 msgid "Choice a keymap" msgstr "" -#: menu.sh:1386 menu.sh:1419 menu.sh:1470 menu.sh:1524 menu.sh:1532 -#: menu.sh:1540 menu.sh:1548 +#: menu.sh:1444 menu.sh:1477 menu.sh:1528 menu.sh:1584 menu.sh:1592 +#: menu.sh:1600 menu.sh:1608 msgid "Update %s" msgstr "" -#: menu.sh:1389 +#: menu.sh:1447 msgid "Checking last version" msgstr "" -#: menu.sh:1397 +#: menu.sh:1455 msgid "Error checking new version" msgstr "" -#: menu.sh:1402 +#: menu.sh:1460 msgid "No new version. Actual version is %s\\nForce update?" msgstr "" -#: menu.sh:1406 +#: menu.sh:1464 msgid "Downloading last version" msgstr "" -#: menu.sh:1411 +#: menu.sh:1469 msgid "Error downloading new version" msgstr "" -#: menu.sh:1421 menu.sh:1472 +#: menu.sh:1479 menu.sh:1530 msgid "Extracting last version" msgstr "" -#: menu.sh:1425 +#: menu.sh:1483 msgid "Error extracting update file" msgstr "" -#: menu.sh:1432 +#: menu.sh:1490 msgid "Checksum do not match!" msgstr "" -#: menu.sh:1441 +#: menu.sh:1499 msgid "" "The current version does not support upgrading to the latest update.zip. " "Please remake the bootloader disk!" msgstr "" -#: menu.sh:1446 +#: menu.sh:1504 msgid "Installing new files" msgstr "" -#: menu.sh:1463 +#: menu.sh:1521 msgid "Arpl updated with success to %s!\\nReboot?" msgstr "" -#: menu.sh:1478 +#: menu.sh:1536 msgid "Installing new addons" msgstr "" -#: menu.sh:1503 +#: menu.sh:1561 msgid "Addons updated with success!" msgstr "" -#: menu.sh:1513 +#: menu.sh:1573 msgid "Update arpl" msgstr "" -#: menu.sh:1514 +#: menu.sh:1574 msgid "Update addons" msgstr "" -#: menu.sh:1515 +#: menu.sh:1575 msgid "Update modules" msgstr "" -#: menu.sh:1516 +#: menu.sh:1576 msgid "Update LKMs" msgstr "" -#: menu.sh:1517 +#: menu.sh:1577 msgid "Set proxy server" msgstr "" -#: menu.sh:1518 menu.sh:1607 menu.sh:1621 +#: menu.sh:1578 msgid "Local upload" msgstr "" -#: menu.sh:1524 +#: menu.sh:1584 msgid "arpl" msgstr "" -#: menu.sh:1532 +#: menu.sh:1592 msgid "addons" msgstr "" -#: menu.sh:1540 +#: menu.sh:1600 msgid "modules" msgstr "" -#: menu.sh:1548 +#: menu.sh:1608 msgid "LKMs" msgstr "" -#: menu.sh:1558 -msgid "Set Proxy Server" +#: menu.sh:1618 menu.sh:1629 menu.sh:1640 menu.sh:1650 menu.sh:1667 +#: menu.sh:1681 +msgid "Update" msgstr "" -#: menu.sh:1559 +#: menu.sh:1619 msgid "Please enter a proxy server url" msgstr "" -#: menu.sh:1585 +#: menu.sh:1645 msgid "" "Please keep the attachment name consistent with the attachment name on " "Github.\\n" msgstr "" -#: menu.sh:1586 +#: menu.sh:1646 msgid "Upload update.zip will update arpl.\\n" msgstr "" -#: menu.sh:1587 +#: menu.sh:1647 msgid "Upload addons.zip will update Addons.\\n" msgstr "" -#: menu.sh:1588 +#: menu.sh:1648 msgid "Upload modules.zip will update Modules.\\n" msgstr "" -#: menu.sh:1589 +#: menu.sh:1649 msgid "Upload rp-lkms.zip will update LKMs.\\n" msgstr "" -#: menu.sh:1642 +#: menu.sh:1702 msgid "Choose a model" msgstr "" -#: menu.sh:1644 +#: menu.sh:1704 msgid "Choose a Build Number" msgstr "" -#: menu.sh:1646 -msgid "Addons" -msgstr "" - -#: menu.sh:1648 +#: menu.sh:1708 msgid "Cmdline menu" msgstr "" -#: menu.sh:1649 +#: menu.sh:1709 msgid "Synoinfo menu" msgstr "" -#: menu.sh:1652 +#: menu.sh:1712 msgid "Advanced menu" msgstr "" -#: menu.sh:1655 +#: menu.sh:1715 msgid "Build the loader" msgstr "" -#: menu.sh:1659 +#: menu.sh:1719 msgid "Boot the loader" msgstr "" -#: menu.sh:1662 +#: menu.sh:1722 msgid "Choose a keymap" msgstr "" -#: menu.sh:1664 +#: menu.sh:1724 msgid "Clean disk cache" msgstr "" -#: menu.sh:1666 +#: menu.sh:1726 msgid "Update menu" msgstr "" -#: menu.sh:1692 +#: menu.sh:1788 msgid "Call \\033[1;32mmenu.sh\\033[0m to return to menu" msgstr "" diff --git a/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.mo b/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.mo index 8022cd15..1f338d98 100644 Binary files a/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.mo and b/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.mo differ diff --git a/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.po b/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.po index 699505d4..07d9f0bf 100644 --- a/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.po +++ b/files/board/arpl/overlayfs/opt/arpl/lang/zh_CN.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: arpl-i18n\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-21 17:20+0800\n" -"PO-Revision-Date: 2023-06-21 17:20+0800\n" +"POT-Creation-Date: 2023-06-23 21:24+0800\n" +"PO-Revision-Date: 2023-06-23 21:25+0800\n" "Last-Translator: ing \n" "Language-Team: Chinese (simplified) \n" "Language: zh_CN\n" @@ -16,11 +16,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: boot.sh:8 init.sh:164 +#: boot.sh:8 init.sh:161 msgid "Loader is not configured!" msgstr "引导未配置" -#: boot.sh:19 init.sh:43 +#: boot.sh:19 init.sh:41 msgid "Welcome to %s" msgstr "" @@ -28,12 +28,13 @@ msgstr "" msgid "DSM zImage changed" msgstr "DSM zImage 已更改" -#: boot.sh:35 boot.sh:47 menu.sh:720 menu.sh:746 menu.sh:815 menu.sh:826 -#: menu.sh:855 menu.sh:868 menu.sh:875 menu.sh:1080 menu.sh:1178 +#: boot.sh:35 boot.sh:47 menu.sh:739 menu.sh:747 menu.sh:773 menu.sh:801 +#: menu.sh:813 menu.sh:837 menu.sh:846 menu.sh:857 menu.sh:886 menu.sh:899 +#: menu.sh:906 msgid "Error" msgstr "错误" -#: boot.sh:36 menu.sh:869 +#: boot.sh:36 menu.sh:900 msgid "zImage not patched:\\n" msgstr "zImage打补丁失败:\\n" @@ -41,7 +42,7 @@ msgstr "zImage打补丁失败:\\n" msgid "DSM Ramdisk changed" msgstr "DSM Ramdisk 已更改" -#: boot.sh:48 menu.sh:876 +#: boot.sh:48 menu.sh:907 msgid "Ramdisk not patched:\\n" msgstr "Ramdisk打补丁失败:\\n" @@ -58,121 +59,121 @@ msgid "" "The current version of arpl does not support booting %s-%s, please rebuild." msgstr "当前版本的arpl不支持引导 %s-%s, 请重新编译." -#: boot.sh:104 +#: boot.sh:105 msgid "'Not set MACs' is enabled." msgstr "'不设置MACs' 已开启" -#: boot.sh:117 +#: boot.sh:119 msgid "" "Detected %s network cards, %s MACs were customized, the rest will use the " "original MACs." msgstr "检测到 %s 个网卡, 自定义了 %s 个 MACs, 其他网卡将使用自身 MACs." -#: boot.sh:147 +#: boot.sh:149 msgid "Cmdline:\\n" msgstr "Cmdline:\\n" -#: boot.sh:152 +#: boot.sh:154 msgid "Reboot to boot directly in DSM" msgstr "重启并直接进入DSM引导" -#: boot.sh:162 +#: boot.sh:164 msgid "Detected %s network cards, Waiting IP.(For reference only)" msgstr "检测到 %s 个网卡, 获取 IP.(仅供参考)" -#: boot.sh:169 init.sh:184 +#: boot.sh:171 init.sh:181 msgid "DOWN" msgstr "卸载" -#: boot.sh:173 init.sh:188 +#: boot.sh:175 init.sh:185 msgid "ERROR" msgstr "错误" -#: boot.sh:179 +#: boot.sh:181 msgid "Access \\033[1;34mhttp://%s:5000\\033[0m to connect the DSM via web." msgstr "在浏览器中访问 \\033[1;34mhttp://%s:5000\\033[0m 链接 DSM." -#: boot.sh:188 +#: boot.sh:190 msgid "Loading DSM kernel..." msgstr "加载 DSM kernel..." -#: boot.sh:192 +#: boot.sh:194 msgid "Warning, running kexec with --noefi param, strange things will happen!!" msgstr "警告, 使用'--noefi'参数运行'kexec', 可能有不好的事情发生!!" -#: boot.sh:197 +#: boot.sh:199 msgid "Booting..." msgstr "引导中..." -#: boot.sh:200 +#: boot.sh:201 msgid "" "[This interface will not be operational. Please use the http://find.synology." "com/ find DSM and connect.]" msgstr "该界面已不可操作, 请通过 http://find.synology.com/ 查找DSM并链接." -#: init.sh:18 +#: init.sh:17 msgid "Loader disk not found!" msgstr "引导磁盘未找到!" -#: init.sh:20 +#: init.sh:19 msgid "Loader disk seems to be damaged!" msgstr "引导磁盘似乎已损坏!" -#: init.sh:21 +#: init.sh:20 msgid "There are multiple loader disks, please insert only one loader disk!" msgstr "存在多个引导磁盘,请仅插入一个引导磁盘!" -#: init.sh:34 init.sh:35 init.sh:36 +#: init.sh:32 init.sh:33 init.sh:34 msgid "Can't mount %s" msgstr "挂载 %s 失败" -#: init.sh:106 +#: init.sh:104 msgid "Setting %s MAC to %s" msgstr "设置 %s 的MAC为 %s" -#: init.sh:125 +#: init.sh:122 msgid "Loader disk neither USB or DoM" msgstr "引导磁盘仅支持 USB 或者 DoM" -#: init.sh:133 +#: init.sh:130 msgid "Loader disk:" msgstr "引导盘:" -#: init.sh:146 +#: init.sh:143 msgid "Resizing %s" msgstr "重置 %s 大小" -#: init.sh:157 +#: init.sh:154 msgid "Loading keymap" msgstr "加载keymap" -#: init.sh:167 +#: init.sh:164 msgid "User requested edit settings." msgstr "用户触发编辑设置." -#: init.sh:177 +#: init.sh:174 msgid "Detected %s network cards, Waiting IP." msgstr "检测到 %s 个网卡, 获取 IP." -#: init.sh:194 +#: init.sh:191 msgid "" "Access \\033[1;34mhttp://%s:7681\\033[0m to configure the loader via web " "terminal." msgstr "在浏览器中访问 \\033[1;34mhttp://%s:7681\\033[0m 进入WEB终端进行配置." -#: init.sh:204 +#: init.sh:201 msgid "Call \\033[1;32mmenu.sh\\033[0m to configure loader" msgstr "执行 \\033[1;32mmenu.sh\\033[0m 进入设置菜单" -#: init.sh:206 +#: init.sh:203 msgid "User config is on" msgstr "用户配置文件位于" -#: init.sh:207 +#: init.sh:204 msgid "Default SSH Root password is" msgstr "默认SSH的root密码为" -#: init.sh:213 +#: init.sh:210 msgid "" "You have less than 4GB of RAM, if errors occur in loader creation, please " "increase the amount of memory." @@ -194,929 +195,873 @@ msgstr "禁用标志限制" msgid "Show beta models" msgstr "显示测试型号" -#: menu.sh:104 +#: menu.sh:105 msgid "Choose the model" msgstr "选择型号" -#: menu.sh:143 +#: menu.sh:144 msgid "Choose a build number" msgstr "选择版本" -#: menu.sh:154 menu.sh:159 menu.sh:163 +#: menu.sh:156 menu.sh:161 menu.sh:165 msgid "Build Number" msgstr "版本" -#: menu.sh:155 +#: menu.sh:157 msgid "" "This version does not support UEFI startup, Please select another version or " "switch the startup mode." msgstr "该版本不支持UEFI启动, 请选择其他版本或者切换启动模式." -#: menu.sh:160 +#: menu.sh:162 msgid "" "This version only support usb startup, Please select another version or " "switch the startup mode." msgstr "该版本仅支持 usb 启动, 请选择其他版本或者切换启动模式." -#: menu.sh:164 +#: menu.sh:166 msgid "Reconfiguring Synoinfo, Addons and Modules" msgstr "重新配置 Syninfo, 插件和模块" -#: menu.sh:209 menu.sh:345 menu.sh:478 menu.sh:610 menu.sh:1512 +#: menu.sh:211 menu.sh:354 menu.sh:497 menu.sh:636 menu.sh:1572 msgid "Choose a option" msgstr "设置" -#: menu.sh:210 +#: menu.sh:212 msgid "Add an addon" msgstr "添加插件" -#: menu.sh:211 +#: menu.sh:213 msgid "Delete addon(s)" msgstr "删除插件(s)" -#: menu.sh:212 +#: menu.sh:214 msgid "Show user addons" msgstr "显示用户插件" -#: menu.sh:213 +#: menu.sh:215 msgid "Show all available addons" msgstr "显示所有可用插件" -#: menu.sh:214 +#: menu.sh:216 msgid "Upload a external addon" msgstr "上传外部插件" -#: menu.sh:215 menu.sh:352 menu.sh:475 menu.sh:606 menu.sh:923 menu.sh:1519 -#: menu.sh:1667 +#: menu.sh:217 menu.sh:361 menu.sh:493 menu.sh:631 menu.sh:954 menu.sh:1579 +#: menu.sh:1727 msgid "Exit" msgstr "退出" -#: menu.sh:226 +#: menu.sh:229 menu.sh:234 menu.sh:240 menu.sh:251 menu.sh:259 menu.sh:277 +#: menu.sh:291 menu.sh:296 menu.sh:300 menu.sh:314 menu.sh:318 menu.sh:325 +#: menu.sh:328 menu.sh:1706 +msgid "Addons" +msgstr "插件" + +#: menu.sh:230 msgid "No available addons to add" msgstr "没有可用的插件可添加" -#: menu.sh:230 +#: menu.sh:235 msgid "Select an addon" msgstr "选择插件" -#: menu.sh:235 -msgid "Params" -msgstr "参数" - -#: menu.sh:236 +#: menu.sh:241 msgid "Type a opcional params to addon" msgstr "输入插件的加载参数" -#: menu.sh:245 +#: menu.sh:252 msgid "No user addons to remove" msgstr "没有要删除的用户插件" -#: menu.sh:253 +#: menu.sh:260 msgid "Select addon to remove" msgstr "选择要删除的插件" -#: menu.sh:269 -msgid "User addons" -msgstr "用户插件" - -#: menu.sh:282 -msgid "Available addons" -msgstr "可用插件" - -#: menu.sh:288 menu.sh:1137 menu.sh:1167 menu.sh:1200 menu.sh:1581 +#: menu.sh:297 menu.sh:1186 menu.sh:1217 menu.sh:1250 menu.sh:1641 msgid "This feature is only available when accessed via web/ssh." msgstr "此功能仅通过web/ssh访问时可用." -#: menu.sh:292 +#: menu.sh:301 msgid "Please upload the *.addons file." msgstr "请上传 *.addons 文件." -#: menu.sh:305 menu.sh:319 -msgid "Invalid addon" -msgstr "无效插件" - -#: menu.sh:306 menu.sh:1608 menu.sh:1622 +#: menu.sh:315 menu.sh:1668 menu.sh:1682 msgid "Not a valid file, please try again!" msgstr "不是有效的文件, 请重试!" -#: menu.sh:309 menu.sh:529 menu.sh:567 menu.sh:1333 menu.sh:1569 -msgid "Alert" -msgstr "警告" - -#: menu.sh:310 menu.sh:1570 +#: menu.sh:319 menu.sh:1630 msgid "Invalid proxy server url, continue?" msgstr "无效的代理服务器url,是否继续?" -#: menu.sh:316 menu.sh:445 -msgid "Success" -msgstr "下载成功" - -#: menu.sh:317 +#: menu.sh:326 msgid "Addon '%s' added to loader, Please enable it in 'Add an addon' menu." msgstr "插件 '%s' 已添加到引导中, 请在'添加插件' 菜单中开启." -#: menu.sh:320 menu.sh:450 +#: menu.sh:329 menu.sh:468 msgid "File format not recognized!" msgstr "文件格式无法识别!" -#: menu.sh:333 menu.sh:363 menu.sh:378 menu.sh:389 menu.sh:402 menu.sh:408 -#: menu.sh:1647 +#: menu.sh:342 menu.sh:370 menu.sh:374 menu.sh:391 menu.sh:404 menu.sh:418 +#: menu.sh:424 menu.sh:443 menu.sh:446 menu.sh:456 menu.sh:463 menu.sh:467 +#: menu.sh:1707 msgid "Modules" msgstr "模块" -#: menu.sh:334 +#: menu.sh:343 msgid "Reading modules" msgstr "读取模块中" -#: menu.sh:346 +#: menu.sh:355 msgid "Show selected modules" msgstr "显示已加载的模块" -#: menu.sh:347 +#: menu.sh:356 msgid "Select loaded modules" msgstr "选择已识别的模块" -#: menu.sh:348 +#: menu.sh:357 msgid "Select all modules" msgstr "选择所有模块" -#: menu.sh:349 +#: menu.sh:358 msgid "Deselect all modules" msgstr "取消所有模块" -#: menu.sh:350 +#: menu.sh:359 msgid "Choose modules to include" msgstr "选择要加载的模块" -#: menu.sh:351 menu.sh:426 +#: menu.sh:360 msgid "Download a external module" msgstr "下载一个外部模块" -#: menu.sh:360 -msgid "User modules" -msgstr "模块" - -#: menu.sh:364 +#: menu.sh:375 msgid "Selecting loaded modules" msgstr "选择已识别的模块" -#: menu.sh:379 +#: menu.sh:392 msgid "Selecting all modules" msgstr "全选所有模块" -#: menu.sh:390 +#: menu.sh:405 msgid "Deselecting all modules" msgstr "取消所有模块" -#: menu.sh:403 +#: menu.sh:419 msgid "Select modules to include" msgstr "选择要加载的插件" -#: menu.sh:409 +#: menu.sh:425 msgid "Writing to user config" msgstr "写入用户配置" -#: menu.sh:421 +#: menu.sh:438 msgid "" "This function is experimental and dangerous. If you don't know much, please " "exit.\\n" msgstr "该功能是实验性的且危险的, 如果你不了解, 请退出.\\n" -#: menu.sh:422 +#: menu.sh:439 msgid "" "The imported .ko of this function will be implanted into the corresponding " "arch's modules package, which will affect all models of the arch.\\n" msgstr "该功能导入 .ko 将被植入相应的架构的模块包中, 这将影响该架构的所有型号.\\n" -#: menu.sh:423 +#: menu.sh:440 msgid "" "This program will not determine the availability of imported modules or even " "make type judgments, as please double check if it is correct.\\n" msgstr "该程序不会判断导入的驱动模块的可用性, 甚至不会做类型判断, 因从请你再三确认是否正确.\\n" -#: menu.sh:424 +#: menu.sh:441 msgid "" "If you want to remove it, please go to the \"Update Menu\" -> \"Update " "modules\" to forcibly update the modules. All imports will be reset.\\n" msgstr "如果您想删除它, 请转到 \"更新\"->\"更新模块\" 强制更新模块, 所有导入都将被重置.\\n" -#: menu.sh:425 +#: menu.sh:442 msgid "Do you want to continue?" msgstr "是否继续?" -#: menu.sh:429 +#: menu.sh:447 msgid "please enter the complete URL to download.\\n" msgstr "请输入下载URL.\\n" -#: menu.sh:435 menu.sh:702 +#: menu.sh:453 menu.sh:729 msgid "Downloading %s" msgstr "下载 %s 中" -#: menu.sh:438 menu.sh:712 menu.sh:775 -msgid "Error downloading" -msgstr "下载错误" - -#: menu.sh:439 +#: menu.sh:457 msgid "Check internet, URL or cache disk space" msgstr "请检查internet, URL或磁盘空间" -#: menu.sh:446 +#: menu.sh:464 msgid "Module '%s' added to %s-%s" msgstr "模块 '%s' 已添加到 %s-%s" -#: menu.sh:449 -msgid "Invalid module" -msgstr "无效模块" - -#: menu.sh:467 +#: menu.sh:485 msgid "Add/edit a cmdline item" msgstr "添加/编辑cmdline参数" -#: menu.sh:468 +#: menu.sh:486 msgid "Delete cmdline item(s)" msgstr "删除cmdline参数(s)" -#: menu.sh:470 +#: menu.sh:488 msgid "Define a serial number" msgstr "自定义SN" -#: menu.sh:472 +#: menu.sh:490 msgid "Define a custom MAC" msgstr "自定义MAC" -#: menu.sh:473 +#: menu.sh:491 msgid "Show user added cmdline" msgstr "显示用户添加的cmdline参数" -#: menu.sh:474 +#: menu.sh:492 msgid "Show model inherent cmdline" msgstr "显示型号默认的cmdline参数" -#: menu.sh:483 menu.sh:489 menu.sh:519 menu.sh:544 menu.sh:554 menu.sh:563 -#: menu.sh:565 menu.sh:578 -msgid "User cmdline" -msgstr "用户cmdline参数" +#: menu.sh:502 menu.sh:508 menu.sh:518 menu.sh:526 menu.sh:539 menu.sh:549 +#: menu.sh:566 menu.sh:576 menu.sh:586 menu.sh:589 menu.sh:592 menu.sh:603 +#: menu.sh:611 +msgid "Cmdline" +msgstr "Cmdline" -#: menu.sh:484 +#: menu.sh:503 msgid "Type a name of cmdline" msgstr "输入参数的名称" -#: menu.sh:490 +#: menu.sh:509 msgid "Type a value of '%s' cmdline" msgstr "输入 '%s' 参数的值" -#: menu.sh:499 +#: menu.sh:519 msgid "No user cmdline to remove" msgstr "没有用户参数被删除" -#: menu.sh:507 +#: menu.sh:527 msgid "Select cmdline to remove" msgstr "选择要删除的参数" -#: menu.sh:520 +#: menu.sh:540 msgid "Please enter a serial number " msgstr "请输入SN " -#: menu.sh:530 +#: menu.sh:550 msgid "Invalid serial, continue?" msgstr "SN无效, 是否继续?" -#: menu.sh:545 +#: menu.sh:567 msgid "Type a custom MAC address of %s" msgstr "输入 %s 的自定义MAC地址" -#: menu.sh:554 +#: menu.sh:577 msgid "Invalid MAC" msgstr "无效的MAC" -#: menu.sh:563 +#: menu.sh:587 msgid "Changing MAC" msgstr "修改MAC" -#: menu.sh:565 +#: menu.sh:590 msgid "Renewing IP" msgstr "刷新IP" -#: menu.sh:568 +#: menu.sh:593 msgid "Continue to custom MAC?" msgstr "继续自定义MAC?" -#: menu.sh:586 -msgid "Model/build cmdline" -msgstr "型号默认cmdline参数" - -#: menu.sh:603 +#: menu.sh:628 msgid "Add/edit a synoinfo item" msgstr "添加/编辑Synoinfo参数" -#: menu.sh:604 +#: menu.sh:629 msgid "Delete synoinfo item(s)" msgstr "删除Synoinfo参数(s)" -#: menu.sh:605 +#: menu.sh:630 msgid "Show synoinfo entries" msgstr "显示Synoinfo参数" -#: menu.sh:615 menu.sh:621 menu.sh:656 -msgid "Synoinfo entries" -msgstr "Synoinfo参数" +#: menu.sh:641 menu.sh:647 menu.sh:658 menu.sh:666 menu.sh:683 +msgid "Synoinfo" +msgstr "Synoinfo" -#: menu.sh:616 +#: menu.sh:642 msgid "Type a name of synoinfo entry" msgstr "输入参数的名称" -#: menu.sh:622 +#: menu.sh:648 msgid "Type a value of '%s' synoinfo entry" msgstr "输入 '%s' 参数的值" -#: menu.sh:632 +#: menu.sh:659 msgid "No synoinfo entries to remove" msgstr "没有Synoinfo参数被删除" -#: menu.sh:640 +#: menu.sh:667 msgid "Select synoinfo entry to remove" msgstr "选择要删除的参数" -#: menu.sh:681 +#: menu.sh:708 msgid "%s cached." msgstr "%s 已缓存." -#: menu.sh:685 +#: menu.sh:712 msgid "Cleaning cache" msgstr "清除缓存" -#: menu.sh:697 +#: menu.sh:724 msgid "" "Based on the current network situation, switch to %s mirror to downloading." msgstr "根据当前的网络状况, 已切换到 %s 镜像服务器进行下载." -#: menu.sh:713 menu.sh:776 +#: menu.sh:740 menu.sh:802 msgid "Check internet or cache disk space" msgstr "请检查internet或磁盘空间" -#: menu.sh:718 +#: menu.sh:745 msgid "Checking hash of %s: " msgstr "检查 %s 的 hash: " -#: menu.sh:721 +#: menu.sh:748 msgid "Hash of pat not match, try again!" msgstr "pat的Hash不匹配, 请重试!" -#: menu.sh:725 menu.sh:819 menu.sh:830 menu.sh:841 +#: menu.sh:752 menu.sh:850 menu.sh:861 menu.sh:872 msgid "OK" msgstr "OK" -#: menu.sh:729 +#: menu.sh:756 msgid "Disassembling %s: " msgstr "解压 %s: " -#: menu.sh:734 +#: menu.sh:761 msgid "Uncompressed tar" msgstr "未压缩tar" -#: menu.sh:738 +#: menu.sh:765 msgid "Compressed tar" msgstr "压缩tar" -#: menu.sh:742 +#: menu.sh:769 msgid "Encrypted" msgstr "已加密" -#: menu.sh:747 +#: menu.sh:774 msgid "" "Could not determine if pat file is encrypted or not, maybe corrupted, try " "again!" msgstr "无法确定pat文件是否加密, 可能已损坏, 请重试!" -#: menu.sh:758 +#: menu.sh:784 msgid "Extractor cached." msgstr "已存在解密程序." -#: menu.sh:765 +#: menu.sh:791 msgid "Downloading old pat to extract synology .pat extractor..." msgstr "下载旧 pat, 提取 .pat 解密程序中..." -#: menu.sh:787 menu.sh:807 -msgid "Error extracting" -msgstr "解压失败" - -#: menu.sh:801 menu.sh:804 +#: menu.sh:831 menu.sh:834 msgid "Extracting..." msgstr "解压中..." -#: menu.sh:811 +#: menu.sh:842 msgid "Checking hash of zImage: " msgstr "检查 zImage 的 hash: " -#: menu.sh:816 +#: menu.sh:847 msgid "Hash of zImage not match, try again!" msgstr "zImage的Hash不匹配, 请重试!" -#: menu.sh:822 +#: menu.sh:853 msgid "Checking hash of ramdisk: " msgstr "检查 ramdisk 的 hash: " -#: menu.sh:827 +#: menu.sh:858 msgid "Hash of ramdisk not match, try again!" msgstr "ramdisk的Hash不匹配, 请重试!" -#: menu.sh:833 +#: menu.sh:864 msgid "Copying files: " msgstr "拷贝文件: " -#: menu.sh:856 +#: menu.sh:887 msgid "Addon %s not found!" msgstr "插件 %s 未找到!" -#: menu.sh:880 menu.sh:1685 +#: menu.sh:911 menu.sh:1776 msgid "Cleaning" msgstr "清除中" -#: menu.sh:883 +#: menu.sh:914 msgid "Ready!" msgstr "已就绪!" -#: menu.sh:896 +#: menu.sh:927 msgid "Switch LKM version:" msgstr "选择LKM版本:" -#: menu.sh:899 +#: menu.sh:930 msgid "Switch direct boot:" msgstr "切换直接启动:" -#: menu.sh:901 +#: menu.sh:932 msgid "boot IPs wait time:" msgstr "启动IPs等待时间:" -#: menu.sh:904 +#: menu.sh:935 msgid "Switch 'not set MACs':" msgstr "切换'不设置MACs':" -#: menu.sh:905 +#: menu.sh:936 msgid "Edit user config file manually" msgstr "编辑用户配置文件" -#: menu.sh:906 +#: menu.sh:937 msgid "Try to recovery a DSM installed system" msgstr "尝试恢复已安装DSM的系统" -#: menu.sh:907 +#: menu.sh:938 msgid "Show SATA(s) # ports and drives" msgstr "显示SATA(s) # 端口和驱动器" -#: menu.sh:909 +#: menu.sh:940 msgid "show pat download link" msgstr "当前pat下载链接" -#: menu.sh:911 menu.sh:1011 menu.sh:1024 +#: menu.sh:942 msgid "Allow downgrade installation" msgstr "允许降级安装" -#: menu.sh:912 +#: menu.sh:943 msgid "Format disk(s) # Without loader disk" msgstr "格式化磁盘(s) # 不含启动盘" -#: menu.sh:913 menu.sh:1085 menu.sh:1092 menu.sh:1098 menu.sh:1110 +#: menu.sh:944 msgid "Reset syno system password" msgstr "重置群晖系统密码" -#: menu.sh:914 menu.sh:1119 menu.sh:1122 +#: menu.sh:945 msgid "Persistence of arpl modifications" msgstr "持久化arpl的修改" -#: menu.sh:916 +#: menu.sh:947 msgid "Custom dts file # Need rebuild" msgstr "自定义 dts 文件 # 需要重新编译" -#: menu.sh:919 +#: menu.sh:950 msgid "Backup bootloader disk # test" msgstr "备份启动盘 # 测试" -#: menu.sh:920 +#: menu.sh:951 msgid "Restore bootloader disk # test" msgstr "恢复启动盘 # 测试" -#: menu.sh:922 menu.sh:1242 menu.sh:1251 +#: menu.sh:953 msgid "Development tools" msgstr "开发者工具" -#: menu.sh:925 menu.sh:1042 +#: menu.sh:956 menu.sh:974 menu.sh:1034 menu.sh:1042 menu.sh:1050 menu.sh:1063 +#: menu.sh:1066 menu.sh:1081 menu.sh:1082 menu.sh:1087 menu.sh:1091 +#: menu.sh:1102 menu.sh:1104 menu.sh:1121 menu.sh:1126 menu.sh:1134 +#: menu.sh:1140 menu.sh:1153 menu.sh:1156 menu.sh:1162 menu.sh:1165 +#: menu.sh:1180 menu.sh:1185 menu.sh:1189 menu.sh:1204 menu.sh:1209 +#: menu.sh:1216 menu.sh:1220 menu.sh:1223 menu.sh:1228 menu.sh:1238 +#: menu.sh:1243 menu.sh:1249 menu.sh:1253 menu.sh:1270 menu.sh:1273 +#: menu.sh:1279 menu.sh:1287 menu.sh:1295 menu.sh:1304 menu.sh:1306 msgid "Advanced" msgstr "高级" -#: menu.sh:926 menu.sh:1670 +#: menu.sh:957 menu.sh:1730 msgid "Choose the option" msgstr "设置" -#: menu.sh:942 +#: menu.sh:975 msgid "Choose a waiting time(seconds)" msgstr "选择一个等待时间(秒)" -#: menu.sh:991 +#: menu.sh:1030 msgid "\\nTotal of ports: %s\\n" msgstr "\\n端口总数: %s\\n" -#: menu.sh:992 +#: menu.sh:1031 msgid "" "\\nPorts with color \\Z1red\\Zn as DUMMY, color \\Z2\\Zbgreen\\Zn has drive " "connected." msgstr "\\n\\Z1红色\\Zn 为模拟端口, \\Z2\\Zb绿色\\Zn 为已驱动的物理端口." -#: menu.sh:993 +#: menu.sh:1032 msgid "\\nRecommended value:" msgstr "\\n建议值:" -#: menu.sh:994 +#: menu.sh:1033 msgid "\\nDiskIdxMap:" msgstr "\\nDiskIdxMap:" -#: menu.sh:1003 -msgid "*.pat download link" -msgstr "*.pat 下载链接" - -#: menu.sh:1008 +#: menu.sh:1047 msgid "" "This feature will allow you to downgrade the installation by removing the " "VERSION file from the first partition of all disks.\\n" msgstr "此功能通过删除所有磁盘的第一个分区的VERSION文件来允许你降级安装.\\n" -#: menu.sh:1009 +#: menu.sh:1048 msgid "Therefore, please insert all disks before continuing.\\n" msgstr "因此, 请插入所有磁盘后再进行操作.\\n" -#: menu.sh:1010 menu.sh:1047 +#: menu.sh:1049 menu.sh:1088 msgid "" "Warning:\\nThis operation is irreversible. Please backup important data. Do " "you want to continue?" msgstr "警告:\\n该操作不可逆, 请提前备份重要数据. 是否继续?" -#: menu.sh:1025 +#: menu.sh:1064 msgid "Removing ..." msgstr "删除中..." -#: menu.sh:1026 +#: menu.sh:1065 msgid "Remove VERSION file for all disks completed." msgstr "已移除所有磁盘的 VERSION 文件." -#: menu.sh:1041 menu.sh:1046 menu.sh:1050 menu.sh:1061 -msgid "Format disk" -msgstr "格式化磁盘" - -#: menu.sh:1051 +#: menu.sh:1092 msgid "" "Warning:\\nThe current hds is in raid, do you still want to format them?" msgstr "警告:\\n当前的硬盘处于raid中,是否仍要格式化?" -#: menu.sh:1062 +#: menu.sh:1103 msgid "Formatting ..." msgstr "格式化中..." -#: menu.sh:1064 +#: menu.sh:1105 msgid "Formatting is complete." msgstr "格式化完成." -#: menu.sh:1081 +#: menu.sh:1122 msgid "The installed Syno system not found in the currently inserted disks!" msgstr "未在当前插入的硬盘中找到已安装的syno系统!" -#: menu.sh:1086 +#: menu.sh:1127 msgid "Choose a user name" msgstr "选择一个用户" -#: menu.sh:1093 +#: menu.sh:1135 msgid "Type a new password for user '%s'" msgstr "输入用户 '%s' 的新密码" -#: menu.sh:1098 +#: menu.sh:1141 msgid "Invalid password" msgstr "无效密码" -#: menu.sh:1111 +#: menu.sh:1154 msgid "Resetting ..." msgstr "重置中" -#: menu.sh:1114 +#: menu.sh:1157 msgid "Password reset completed." msgstr "重置密码完成." -#: menu.sh:1120 menu.sh:1171 menu.sh:1224 +#: menu.sh:1163 menu.sh:1221 menu.sh:1274 msgid "" "Warning:\\nDo not terminate midway, otherwise it may cause damage to the " "arpl. Do you want to continue?" msgstr "警告:\\n请不要中途停止, 否则将导致arpl引导损毁, 是否继续?" -#: menu.sh:1123 +#: menu.sh:1166 msgid "Persisting ..." msgstr "持久化中..." -#: menu.sh:1132 +#: menu.sh:1181 msgid "Persisting is complete." msgstr "持久化完成." -#: menu.sh:1141 +#: menu.sh:1190 msgid "" "Currently, only dts format files are supported. Please prepare and click to " "confirm uploading.\\n(saved in /mnt/p3/users/)" msgstr "目前, 只支持dts格式的文件, 请准备并点击确认上传.\\n(保存于 /mnt/p3/users/ 中)" -#: menu.sh:1155 menu.sh:1160 -msgid "Custom dts file" -msgstr "自定义 dts 文件" - -#: menu.sh:1156 +#: menu.sh:1205 msgid "Not a valid dts file, please try again!" msgstr "dts 文件无效, 请重试!" -#: menu.sh:1161 +#: menu.sh:1210 msgid "A valid dts file, Automatically import at compile time." msgstr "dts 文件有效, 将在编译时自动导入." -#: menu.sh:1170 menu.sh:1173 -msgid "Backup bootloader disk" -msgstr "备份启动盘" - -#: menu.sh:1174 +#: menu.sh:1224 msgid "Backuping..." msgstr "备份中..." -#: menu.sh:1179 +#: menu.sh:1229 msgid "" "Failed to generate backup. There may be insufficient memory. Please clear " "the cache and try again!" msgstr "生成备份失败, 可能内存不足, 请清除缓存重试!" -#: menu.sh:1186 +#: menu.sh:1236 msgid "Click on the address above to download." msgstr "点击上面的地址下载." -#: menu.sh:1187 +#: menu.sh:1237 msgid "" "Please confirm the completion of the download before closing this window." msgstr "请确认下载完成再关闭此窗口." -#: menu.sh:1188 -msgid "backup.img.gz download link" -msgstr "backup.img.gz 下载链接" - -#: menu.sh:1194 +#: menu.sh:1244 msgid "backup is complete." msgstr "备份完成." -#: menu.sh:1203 menu.sh:1220 menu.sh:1223 menu.sh:1226 menu.sh:1234 -msgid "Restore bootloader disk" -msgstr "恢复启动盘" - -#: menu.sh:1204 +#: menu.sh:1254 msgid "" "Please upload the backup file.\\nCurrently, zip(github) and img.gz(backup) " "compressed file formats are supported." msgstr "请上传备份的文件\\n当前支持 zip(github) 和 img.gz(backup) 格式." -#: menu.sh:1221 +#: menu.sh:1271 msgid "Not a valid .zip/.img.gz file, please try again!" msgstr "不是有效的.zip/.img.gz文件, 请重试!" -#: menu.sh:1227 +#: menu.sh:1280 msgid "Writing..." msgstr "写入中..." -#: menu.sh:1235 +#: menu.sh:1288 msgid "Restore bootloader disk with success to %s!\\nReboot?" msgstr "成功恢复启动盘到 %s!\\n重启?" -#: menu.sh:1243 +#: menu.sh:1296 msgid "" "This option only installs opkg package management, allowing you to install " "more tools for use and debugging. Do you want to continue?" msgstr "该选项仅安装 opkg 包管理工具, 使你能够安装更多的工具以供使用和调试, 是否继续?" -#: menu.sh:1252 +#: menu.sh:1305 msgid "opkg installing ..." msgstr "opkg 安装中 ..." -#: menu.sh:1254 +#: menu.sh:1307 msgid "" "opkg install is complete. Please reconnect to SSH/web, or execute 'source ~/." "bashrc'" msgstr "opkg 安装完成. 请重新链接 SSH/web, 或者执行 'source ~/.bashrc'" -#: menu.sh:1264 menu.sh:1292 menu.sh:1299 +#: menu.sh:1317 menu.sh:1345 menu.sh:1352 msgid "Try recovery DSM" msgstr "尝试恢复DSM系统" -#: menu.sh:1265 +#: menu.sh:1318 msgid "Trying to recovery a DSM installed system" msgstr "尝试恢复已安装的DSM系统中" -#: menu.sh:1286 +#: menu.sh:1339 msgid "Found a installation:\\nModel: %s\\nBuildnumber: %s" msgstr "找到已安装:\\n型号: %s\\n版本: %s" -#: menu.sh:1290 +#: menu.sh:1343 msgid "\\nSerial: %s" msgstr "\\nSN: %s" -#: menu.sh:1300 +#: menu.sh:1353 msgid "Unfortunately I couldn't mount the DSM partition!" msgstr "很遗憾, 我无法挂载DSM分区!" -#: menu.sh:1308 +#: menu.sh:1361 menu.sh:1367 msgid "Edit with caution" msgstr "请谨慎编辑" -#: menu.sh:1314 -msgid "Invalid YAML format" -msgstr "无效的YAML格式" +#: menu.sh:1387 +msgid "Alert" +msgstr "警告" -#: menu.sh:1334 +#: menu.sh:1388 msgid "Config changed, would you like to rebuild the loader?" msgstr "配置已更改, 是否重新编译引导?" -#: menu.sh:1346 menu.sh:1661 +#: menu.sh:1400 menu.sh:1721 msgid "Choose a language" msgstr "选择语言" -#: menu.sh:1359 +#: menu.sh:1414 msgid "Choose a layout" msgstr "选择布局" -#: menu.sh:1369 +#: menu.sh:1426 msgid "Choice a keymap" msgstr "选择键盘" -#: menu.sh:1386 menu.sh:1419 menu.sh:1470 menu.sh:1524 menu.sh:1532 -#: menu.sh:1540 menu.sh:1548 +#: menu.sh:1444 menu.sh:1477 menu.sh:1528 menu.sh:1584 menu.sh:1592 +#: menu.sh:1600 menu.sh:1608 msgid "Update %s" msgstr "更新 %s" -#: menu.sh:1389 +#: menu.sh:1447 msgid "Checking last version" msgstr "检测新版本中" -#: menu.sh:1397 +#: menu.sh:1455 msgid "Error checking new version" msgstr "检测新版本错误" -#: menu.sh:1402 +#: menu.sh:1460 msgid "No new version. Actual version is %s\\nForce update?" msgstr "没有新版本. 实际版本为 %s\\n强制更新?" -#: menu.sh:1406 +#: menu.sh:1464 msgid "Downloading last version" msgstr "下载新版本中" -#: menu.sh:1411 +#: menu.sh:1469 msgid "Error downloading new version" msgstr "下载新版本错误" -#: menu.sh:1421 menu.sh:1472 +#: menu.sh:1479 menu.sh:1530 msgid "Extracting last version" msgstr "解压新版本" -#: menu.sh:1425 +#: menu.sh:1483 msgid "Error extracting update file" msgstr "更新文件解压错误" -#: menu.sh:1432 +#: menu.sh:1490 msgid "Checksum do not match!" msgstr "Checksum不匹配!" -#: menu.sh:1441 +#: menu.sh:1499 msgid "" "The current version does not support upgrading to the latest update.zip. " "Please remake the bootloader disk!" msgstr "当前版本不支持最新的update.zip升级, 请重新制作引导盘!" -#: menu.sh:1446 +#: menu.sh:1504 msgid "Installing new files" msgstr "安装更新中" -#: menu.sh:1463 +#: menu.sh:1521 msgid "Arpl updated with success to %s!\\nReboot?" msgstr "Arpl更新成功 %s!\\n重启?" -#: menu.sh:1478 +#: menu.sh:1536 msgid "Installing new addons" msgstr "安装新插件中" -#: menu.sh:1503 +#: menu.sh:1561 msgid "Addons updated with success!" msgstr "插件更新成功!" -#: menu.sh:1513 +#: menu.sh:1573 msgid "Update arpl" msgstr "更新arpl" -#: menu.sh:1514 +#: menu.sh:1574 msgid "Update addons" msgstr "更新插件" -#: menu.sh:1515 +#: menu.sh:1575 msgid "Update modules" msgstr "更新模块" -#: menu.sh:1516 +#: menu.sh:1576 msgid "Update LKMs" msgstr "更新LKMs" -#: menu.sh:1517 +#: menu.sh:1577 msgid "Set proxy server" msgstr "设置代理" -#: menu.sh:1518 menu.sh:1607 menu.sh:1621 +#: menu.sh:1578 msgid "Local upload" msgstr "本地上传" -#: menu.sh:1524 +#: menu.sh:1584 msgid "arpl" msgstr "arpl" -#: menu.sh:1532 +#: menu.sh:1592 msgid "addons" msgstr "插件" -#: menu.sh:1540 +#: menu.sh:1600 msgid "modules" msgstr "模块" -#: menu.sh:1548 +#: menu.sh:1608 msgid "LKMs" msgstr "LKMs" -#: menu.sh:1558 -msgid "Set Proxy Server" -msgstr "设置代理" +#: menu.sh:1618 menu.sh:1629 menu.sh:1640 menu.sh:1650 menu.sh:1667 +#: menu.sh:1681 +msgid "Update" +msgstr "更新" -#: menu.sh:1559 +#: menu.sh:1619 msgid "Please enter a proxy server url" msgstr "请输入代理服务器url" -#: menu.sh:1585 +#: menu.sh:1645 msgid "" "Please keep the attachment name consistent with the attachment name on " "Github.\\n" msgstr "请保持附件名称与 github 上附件名称一致.\\n" -#: menu.sh:1586 +#: menu.sh:1646 msgid "Upload update.zip will update arpl.\\n" msgstr "上传 update.zip 将更新 arpl.\\n" -#: menu.sh:1587 +#: menu.sh:1647 msgid "Upload addons.zip will update Addons.\\n" msgstr "上传 addons.zip 将更新 插件.\\n" -#: menu.sh:1588 +#: menu.sh:1648 msgid "Upload modules.zip will update Modules.\\n" msgstr "上传 modules.zip 将更新 模块.\\n" -#: menu.sh:1589 +#: menu.sh:1649 msgid "Upload rp-lkms.zip will update LKMs.\\n" msgstr "上传 rp-lkms.zip 将更新 LKMs.\\n" -#: menu.sh:1642 +#: menu.sh:1702 msgid "Choose a model" msgstr "选择型号" -#: menu.sh:1644 +#: menu.sh:1704 msgid "Choose a Build Number" msgstr "选择版本" -#: menu.sh:1646 -msgid "Addons" -msgstr "插件" - -#: menu.sh:1648 +#: menu.sh:1708 msgid "Cmdline menu" msgstr "设置Cmdline" -#: menu.sh:1649 +#: menu.sh:1709 msgid "Synoinfo menu" msgstr "设置Synoinfo" -#: menu.sh:1652 +#: menu.sh:1712 msgid "Advanced menu" msgstr "高级设置" -#: menu.sh:1655 +#: menu.sh:1715 msgid "Build the loader" msgstr "编译引导" -#: menu.sh:1659 +#: menu.sh:1719 msgid "Boot the loader" msgstr "启动" -#: menu.sh:1662 +#: menu.sh:1722 msgid "Choose a keymap" msgstr "选择键盘" -#: menu.sh:1664 +#: menu.sh:1724 msgid "Clean disk cache" msgstr "清除磁盘缓存" -#: menu.sh:1666 +#: menu.sh:1726 msgid "Update menu" msgstr "更新" -#: menu.sh:1692 +#: menu.sh:1788 msgid "Call \\033[1;32mmenu.sh\\033[0m to return to menu" msgstr "执行 \\033[1;32mmenu.sh\\033[0m 重新进入设置菜单" diff --git a/files/board/arpl/overlayfs/opt/arpl/menu.sh b/files/board/arpl/overlayfs/opt/arpl/menu.sh index f9cd91a5..7baff1db 100755 --- a/files/board/arpl/overlayfs/opt/arpl/menu.sh +++ b/files/board/arpl/overlayfs/opt/arpl/menu.sh @@ -6,29 +6,29 @@ # Check partition 3 space, if < 2GiB is necessary clean cache folder CLEARCACHE=0 -LOADER_DISK="`blkid | grep 'LABEL="ARPL3"' | cut -d3 -f1`" -LOADER_DEVICE_NAME=`echo ${LOADER_DISK} | sed 's|/dev/||'` -if [ `cat /sys/block/${LOADER_DEVICE_NAME}/${LOADER_DEVICE_NAME}3/size` -lt 4194304 ]; then +LOADER_DISK="$(blkid | grep 'LABEL="ARPL3"' | cut -d3 -f1)" +LOADER_DEVICE_NAME=$(echo ${LOADER_DISK} | sed 's|/dev/||') +if [ $(cat /sys/block/${LOADER_DEVICE_NAME}/${LOADER_DEVICE_NAME}3/size) -lt 4194304 ]; then CLEARCACHE=1 fi # Get actual IP -IP=`ip route 2>/dev/null | sed -n 's/.* via .* dev \(.*\) src \(.*\) metric .*/\1: \2 /p' | head -1` +IP=$(ip route 2>/dev/null | sed -n 's/.* via .* dev \(.*\) src \(.*\) metric .*/\1: \2 /p' | head -1) # Dirty flag DIRTY=0 # Debug flag # DEBUG=0 -MODEL="`readConfigKey "model" "${USER_CONFIG_FILE}"`" -BUILD="`readConfigKey "build" "${USER_CONFIG_FILE}"`" -LAYOUT="`readConfigKey "layout" "${USER_CONFIG_FILE}"`" -KEYMAP="`readConfigKey "keymap" "${USER_CONFIG_FILE}"`" -LKM="`readConfigKey "lkm" "${USER_CONFIG_FILE}"`" -DIRECTBOOT="`readConfigKey "directboot" "${USER_CONFIG_FILE}"`" -NOTSETMACS="`readConfigKey "notsetmacs" "${USER_CONFIG_FILE}"`" -BOOTIPWAIT="`readConfigKey "bootipwait" "${USER_CONFIG_FILE}"`" -SN="`readConfigKey "sn" "${USER_CONFIG_FILE}"`" +MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" +BUILD="$(readConfigKey "build" "${USER_CONFIG_FILE}")" +LAYOUT="$(readConfigKey "layout" "${USER_CONFIG_FILE}")" +KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")" +LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")" +DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")" +NOTSETMACS="$(readConfigKey "notsetmacs" "${USER_CONFIG_FILE}")" +BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")" +SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")" ############################################################################### # Mounts backtitle dynamically @@ -73,22 +73,22 @@ function modelMenu() { if [ -z "${1}" ]; then RESTRICT=1 FLGBETA=0 - dialog --backtitle "`backtitle`" --title "$(TEXT "Model")" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Model")" \ --infobox "$(TEXT "Reading models")" 0 0 while true; do - echo "" > "${TMP_PATH}/menu" + echo "" >"${TMP_PATH}/menu" FLGNEX=0 while read M; do - M="`basename ${M}`" + M="$(basename ${M})" M="${M::-4}" - PLATFORM=`readModelKey "${M}" "platform"` - DT="`readModelKey "${M}" "dt"`" - BETA="`readModelKey "${M}" "beta"`" + PLATFORM=$(readModelKey "${M}" "platform") + DT="$(readModelKey "${M}" "dt")" + BETA="$(readModelKey "${M}" "beta")" [ "${BETA}" = "true" -a ${FLGBETA} -eq 0 ] && continue # Check id model is compatible with CPU COMPATIBLE=1 if [ ${RESTRICT} -eq 1 ]; then - for F in `readModelArray "${M}" "flags"`; do + for F in $(readModelArray "${M}" "flags"); do if ! grep -q "^flags.*${F}.*" /proc/cpuinfo; then COMPATIBLE=0 FLGNEX=1 @@ -97,12 +97,13 @@ function modelMenu() { done fi [ "${DT}" = "true" ] && DT="-DT" || DT="" - [ ${COMPATIBLE} -eq 1 ] && echo "${M} \"\Zb${PLATFORM}${DT}\Zn\" " >> "${TMP_PATH}/menu" + [ ${COMPATIBLE} -eq 1 ] && echo "${M} \"\Zb${PLATFORM}${DT}\Zn\" " >>"${TMP_PATH}/menu" done < <(find "${MODEL_CONFIG_PATH}" -maxdepth 1 -name \*.yml | sort) - [ ${FLGNEX} -eq 1 ] && echo "f \"\Z1$(TEXT "Disable flags restriction")\Zn\"" >> "${TMP_PATH}/menu" - [ ${FLGBETA} -eq 0 ] && echo "b \"\Z1$(TEXT "Show beta models")\Zn\"" >> "${TMP_PATH}/menu" - dialog --backtitle "`backtitle`" --colors --menu "$(TEXT "Choose the model")" 0 0 0 \ - --file "${TMP_PATH}/menu" 2>${TMP_PATH}/resp + [ ${FLGNEX} -eq 1 ] && echo "f \"\Z1$(TEXT "Disable flags restriction")\Zn\"" >>"${TMP_PATH}/menu" + [ ${FLGBETA} -eq 0 ] && echo "b \"\Z1$(TEXT "Show beta models")\Zn\"" >>"${TMP_PATH}/menu" + dialog --backtitle "$(backtitle)" --colors \ + --menu "$(TEXT "Choose the model")" 0 0 0 --file "${TMP_PATH}/menu" \ + 2>${TMP_PATH}/resp [ $? -ne 0 ] && return resp=$(<${TMP_PATH}/resp) [ -z "${resp}" ] && return @@ -125,7 +126,7 @@ function modelMenu() { writeConfigKey "model" "${MODEL}" "${USER_CONFIG_FILE}" BUILD="" writeConfigKey "build" "${BUILD}" "${USER_CONFIG_FILE}" - SN=`generateSerial "${MODEL}"` + SN=$(generateSerial "${MODEL}") writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}" # Delete old files rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" @@ -137,10 +138,11 @@ function modelMenu() { ############################################################################### # Shows available buildnumbers from a model to user choose one function buildMenu() { - ITEMS="`readConfigEntriesArray "builds" "${MODEL_CONFIG_PATH}/${MODEL}.yml" | sort -r`" + ITEMS="$(readConfigEntriesArray "builds" "${MODEL_CONFIG_PATH}/${MODEL}.yml" | sort -r)" if [ -z "${1}" ]; then - dialog --clear --no-items --backtitle "`backtitle`" \ - --menu "$(TEXT "Choose a build number")" 0 0 0 ${ITEMS} 2>${TMP_PATH}/resp + dialog --backtitle "$(backtitle)" --colors \ + --no-items --menu "$(TEXT "Choose a build number")" 0 0 0 ${ITEMS} \ + 2>${TMP_PATH}/resp [ $? -ne 0 ] && return resp=$(<${TMP_PATH}/resp) [ -z "${resp}" ] && return @@ -149,18 +151,18 @@ function buildMenu() { resp="${1}" fi if [ "${BUILD}" != "${resp}" ]; then - local KVER=`readModelKey "${MODEL}" "builds.${resp}.kver"` + local KVER=$(readModelKey "${MODEL}" "builds.${resp}.kver") if [ -d "/sys/firmware/efi" -a "${KVER:0:1}" = "3" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Build Number")" --aspect 18 \ - --msgbox "$(TEXT "This version does not support UEFI startup, Please select another version or switch the startup mode.")" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Build Number")" \ + --msgbox "$(TEXT "This version does not support UEFI startup, Please select another version or switch the startup mode.")" 0 0 buildMenu fi - if [ ! "usb" = "`udevadm info --query property --name ${LOADER_DISK} | grep BUS | cut -d= -f2`" -a "${KVER:0:1}" = "5" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Build Number")" --aspect 18 \ - --msgbox "$(TEXT "This version only support usb startup, Please select another version or switch the startup mode.")" 0 0 + if [ ! "usb" = "$(udevadm info --query property --name ${LOADER_DISK} | grep BUS | cut -d= -f2)" -a "${KVER:0:1}" = "5" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Build Number")" \ + --msgbox "$(TEXT "This version only support usb startup, Please select another version or switch the startup mode.")" 0 0 buildMenu fi - dialog --backtitle "`backtitle`" --title "$(TEXT "Build Number")" \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Build Number")" \ --infobox "$(TEXT "Reconfiguring Synoinfo, Addons and Modules")" 0 0 BUILD=${resp} writeConfigKey "build" "${BUILD}" "${USER_CONFIG_FILE}" @@ -170,8 +172,8 @@ function buildMenu() { writeConfigKey "synoinfo.${KEY}" "${VALUE}" "${USER_CONFIG_FILE}" done < <(readModelMap "${MODEL}" "builds.${BUILD}.synoinfo") # Check addons - PLATFORM="`readModelKey "${MODEL}" "platform"`" - KVER="`readModelKey "${MODEL}" "builds.${BUILD}.kver"`" + PLATFORM="$(readModelKey "${MODEL}" "platform")" + KVER="$(readModelKey "${MODEL}" "builds.${BUILD}.kver")" while IFS=': ' read ADDON PARAM; do [ -z "${ADDON}" ] && continue if ! checkAddonExist "${ADDON}" "${PLATFORM}" "${KVER}"; then @@ -194,8 +196,8 @@ function buildMenu() { # Manage addons function addonMenu() { # Read 'platform' and kernel version to check if addon exists - PLATFORM="`readModelKey "${MODEL}" "platform"`" - KVER="`readModelKey "${MODEL}" "builds.${BUILD}.kver"`" + PLATFORM="$(readModelKey "${MODEL}" "platform")" + KVER="$(readModelKey "${MODEL}" "builds.${BUILD}.kver")" # Read addons from user config unset ADDONS declare -A ADDONS @@ -205,8 +207,8 @@ function addonMenu() { NEXT="a" # Loop menu while true; do - dialog --backtitle "`backtitle`" --default-item ${NEXT} \ - --menu "$(TEXT "Choose a option")" 0 0 0 \ + dialog --backtitle "$(backtitle)" --colors \ + --default-item ${NEXT} --menu "$(TEXT "Choose a option")" 0 0 0 \ a "$(TEXT "Add an addon")" \ d "$(TEXT "Delete addon(s)")" \ s "$(TEXT "Show user addons")" \ @@ -215,124 +217,131 @@ function addonMenu() { e "$(TEXT "Exit")" \ 2>${TMP_PATH}/resp [ $? -ne 0 ] && return - case "`<${TMP_PATH}/resp`" in - a) NEXT='a' - rm "${TMP_PATH}/menu" - while read ADDON DESC; do - arrayExistItem "${ADDON}" "${!ADDONS[@]}" && continue # Check if addon has already been added - echo "${ADDON} \"${DESC}\"" >> "${TMP_PATH}/menu" - done < <(availableAddons "${PLATFORM}" "${KVER}") - if [ ! -f "${TMP_PATH}/menu" ] ; then - dialog --backtitle "`backtitle`" --msgbox "$(TEXT "No available addons to add")" 0 0 - NEXT="e" - continue - fi - dialog --backtitle "`backtitle`" --menu "$(TEXT "Select an addon")" 0 0 0 \ - --file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp" - [ $? -ne 0 ] && continue - ADDON="`<"${TMP_PATH}/resp"`" - [ -z "${ADDON}" ] && continue - dialog --backtitle "`backtitle`" --title "$(TEXT "Params")" \ - --inputbox "$(TEXT "Type a opcional params to addon")" 0 0 \ - 2>${TMP_PATH}/resp - [ $? -ne 0 ] && continue - ADDONS[${ADDON}]="`<"${TMP_PATH}/resp"`" - writeConfigKey "addons.${ADDON}" "${VALUE}" "${USER_CONFIG_FILE}" - DIRTY=1 - ;; - d) NEXT='d' - if [ ${#ADDONS[@]} -eq 0 ]; then - dialog --backtitle "`backtitle`" --msgbox "$(TEXT "No user addons to remove")" 0 0 - continue - fi - ITEMS="" - for I in "${!ADDONS[@]}"; do - ITEMS+="${I} ${I} off " - done - dialog --backtitle "`backtitle`" --no-tags \ - --checklist "$(TEXT "Select addon to remove")" 0 0 0 ${ITEMS} \ - 2>"${TMP_PATH}/resp" - [ $? -ne 0 ] && continue - ADDON="`<"${TMP_PATH}/resp"`" - [ -z "${ADDON}" ] && continue - for I in ${ADDON}; do - unset ADDONS[${I}] - deleteConfigKey "addons.${I}" "${USER_CONFIG_FILE}" - done - DIRTY=1 - ;; - s) NEXT='s' - ITEMS="" - for KEY in ${!ADDONS[@]}; do - ITEMS+="${KEY}: ${ADDONS[$KEY]}\n" - done - dialog --backtitle "`backtitle`" --title "$(TEXT "User addons")" \ - --msgbox "${ITEMS}" 0 0 - ;; - m) NEXT='m' - MSG="" - while read MODULE DESC; do - if arrayExistItem "${MODULE}" "${!ADDONS[@]}"; then - MSG+="\Z4${MODULE}\Zn" - else - MSG+="${MODULE}" - fi - MSG+=": \Z5${DESC}\Zn\n" - done < <(availableAddons "${PLATFORM}" "${KVER}") - dialog --backtitle "`backtitle`" --title "$(TEXT "Available addons")" \ - --colors --msgbox "${MSG}" 0 0 - ;; - o) - if ! tty | grep -q "/dev/pts"; then - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 - return - fi - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "Please upload the *.addons file.")" 0 0 - TMP_UP_PATH=/tmp/users - USER_FILE="" - rm -rf ${TMP_UP_PATH} - mkdir -p ${TMP_UP_PATH} - pushd ${TMP_UP_PATH} - rz -be - for F in `ls -A`; do - USER_FILE=${F} - break - done - popd - if [ -z "${USER_FILE}" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Invalid addon")" --aspect 18 \ - --msgbox "$(TEXT "Not a valid file, please try again!")" 0 0 + case "$(<${TMP_PATH}/resp)" in + a) + NEXT='a' + rm "${TMP_PATH}/menu" + while read ADDON DESC; do + arrayExistItem "${ADDON}" "${!ADDONS[@]}" && continue # Check if addon has already been added + echo "${ADDON} \"${DESC}\"" >>"${TMP_PATH}/menu" + done < <(availableAddons "${PLATFORM}" "${KVER}") + if [ ! -f "${TMP_PATH}/menu" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --msgbox "$(TEXT "No available addons to add")" 0 0 + NEXT="e" + continue + fi + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --menu "$(TEXT "Select an addon")" 0 0 0 --file "${TMP_PATH}/menu" \ + 2>"${TMP_PATH}/resp" + [ $? -ne 0 ] && continue + ADDON="$(<"${TMP_PATH}/resp")" + [ -z "${ADDON}" ] && continue + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --inputbox "$(TEXT "Type a opcional params to addon")" 0 0 \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && continue + ADDONS[${ADDON}]="$(<"${TMP_PATH}/resp")" + writeConfigKey "addons.${ADDON}" "${VALUE}" "${USER_CONFIG_FILE}" + DIRTY=1 + ;; + d) + NEXT='d' + if [ ${#ADDONS[@]} -eq 0 ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --msgbox "$(TEXT "No user addons to remove")" 0 0 + continue + fi + ITEMS="" + for I in "${!ADDONS[@]}"; do + ITEMS+="${I} ${I} off " + done + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --no-tags --checklist "$(TEXT "Select addon to remove")" 0 0 0 ${ITEMS} \ + 2>"${TMP_PATH}/resp" + [ $? -ne 0 ] && continue + ADDON="$(<"${TMP_PATH}/resp")" + [ -z "${ADDON}" ] && continue + for I in ${ADDON}; do + unset ADDONS[${I}] + deleteConfigKey "addons.${I}" "${USER_CONFIG_FILE}" + done + DIRTY=1 + ;; + s) + NEXT='s' + ITEMS="" + for KEY in ${!ADDONS[@]}; do + ITEMS+="${KEY}: ${ADDONS[$KEY]}\n" + done + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --msgbox "${ITEMS}" 0 0 + ;; + m) + NEXT='m' + MSG="" + while read MODULE DESC; do + if arrayExistItem "${MODULE}" "${!ADDONS[@]}"; then + MSG+="\Z4${MODULE}\Zn" else - if [ -d "${ADDONS_PATH}/`basename ${USER_FILE} .addons`" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Alert")" \ - --yesno "$(TEXT "Invalid proxy server url, continue?")" 0 0 - RET=$? - [ ${RET} -eq 0 ] && return - fi - ADDON="`untarAddon "${TMP_UP_PATH}/${USER_FILE}"`" - if [ -n "${ADDON}" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Success")" --aspect 18 \ - --msgbox "`printf "$(TEXT "Addon '%s' added to loader, Please enable it in 'Add an addon' menu.")" "${ADDON}"`" 0 0 - else - dialog --backtitle "`backtitle`" --title "$(TEXT "Invalid addon")" --aspect 18 \ - --msgbox "$(TEXT "File format not recognized!")" 0 0 - fi + MSG+="${MODULE}" fi - ;; + MSG+=": \Z5${DESC}\Zn\n" + done < <(availableAddons "${PLATFORM}" "${KVER}") + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --msgbox "${MSG}" 0 0 + ;; + o) + if ! tty | grep -q "/dev/pts"; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 + return + fi + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --msgbox "$(TEXT "Please upload the *.addons file.")" 0 0 + TMP_UP_PATH=/tmp/users + USER_FILE="" + rm -rf ${TMP_UP_PATH} + mkdir -p ${TMP_UP_PATH} + pushd ${TMP_UP_PATH} + rz -be + for F in $(ls -A); do + USER_FILE=${F} + break + done + popd + if [ -z "${USER_FILE}" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --msgbox "$(TEXT "Not a valid file, please try again!")" 0 0 + else + if [ -d "${ADDONS_PATH}/$(basename ${USER_FILE} .addons)" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --yesno "$(TEXT "Invalid proxy server url, continue?")" 0 0 + RET=$? + [ ${RET} -eq 0 ] && return + fi + ADDON="$(untarAddon "${TMP_UP_PATH}/${USER_FILE}")" + if [ -n "${ADDON}" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --msgbox "$(printf "$(TEXT "Addon '%s' added to loader, Please enable it in 'Add an addon' menu.")" "${ADDON}")" 0 0 + else + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \ + --msgbox "$(TEXT "File format not recognized!")" 0 0 + fi + fi + ;; - e) return ;; + e) return ;; esac done } ############################################################################### function moduleMenu() { - PLATFORM="`readModelKey "${MODEL}" "platform"`" - KVER="`readModelKey "${MODEL}" "builds.${BUILD}.kver"`" - dialog --backtitle "`backtitle`" --title "$(TEXT "Modules")" --aspect 18 \ + PLATFORM="$(readModelKey "${MODEL}" "platform")" + KVER="$(readModelKey "${MODEL}" "builds.${BUILD}.kver")" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ --infobox "$(TEXT "Reading modules")" 0 0 - ALLMODULES=`getAllModules "${PLATFORM}" "${KVER}"` + ALLMODULES=$(getAllModules "${PLATFORM}" "${KVER}") unset USERMODULES declare -A USERMODULES while IFS=': ' read KEY VALUE; do @@ -341,8 +350,8 @@ function moduleMenu() { NEXT="s" # loop menu while true; do - dialog --backtitle "`backtitle`" --default-item ${NEXT} \ - --menu "$(TEXT "Choose a option")" 0 0 0 \ + dialog --backtitle "$(backtitle)" --colors \ + --default-item ${NEXT} --menu "$(TEXT "Choose a option")" 0 0 0 \ s "$(TEXT "Show selected modules")" \ l "$(TEXT "Select loaded modules")" \ a "$(TEXT "Select all modules")" \ @@ -352,111 +361,116 @@ function moduleMenu() { e "$(TEXT "Exit")" \ 2>${TMP_PATH}/resp [ $? -ne 0 ] && break - case "`<${TMP_PATH}/resp`" in - s) ITEMS="" - for KEY in ${!USERMODULES[@]}; do - ITEMS+="${KEY}: ${USERMODULES[$KEY]}\n" - done - dialog --backtitle "`backtitle`" --title "$(TEXT "User modules")" \ - --msgbox "${ITEMS}" 0 0 - ;; - l) dialog --backtitle "`backtitle`" --title "$(TEXT "Modules")" \ - --infobox "$(TEXT "Selecting loaded modules")" 0 0 - KOLIST="" - for I in `lsmod | awk -F' ' '{print $1}' | grep -v 'Module'`; do - KOLIST+="`getdepends ${PLATFORM} ${KVER} ${I}` ${I} " - done - KOLIST=(`echo ${KOLIST} | tr ' ' '\n' | sort -u`) - unset USERMODULES - declare -A USERMODULES - writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" - for ID in ${KOLIST[@]}; do - USERMODULES["${ID}"]="" - writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}" - done - DIRTY=1 - ;; - a) dialog --backtitle "`backtitle`" --title "$(TEXT "Modules")" \ - --infobox "$(TEXT "Selecting all modules")" 0 0 - unset USERMODULES - declare -A USERMODULES - writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" - while read ID DESC; do - USERMODULES["${ID}"]="" - writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}" - done <<<${ALLMODULES} - DIRTY=1 - ;; + case "$(<${TMP_PATH}/resp)" in + s) + ITEMS="" + for KEY in ${!USERMODULES[@]}; do + ITEMS+="${KEY}: ${USERMODULES[$KEY]}\n" + done + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --msgbox "${ITEMS}" 0 0 + ;; + l) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --infobox "$(TEXT "Selecting loaded modules")" 0 0 + KOLIST="" + for I in $(lsmod | awk -F' ' '{print $1}' | grep -v 'Module'); do + KOLIST+="$(getdepends ${PLATFORM} ${KVER} ${I}) ${I} " + done + KOLIST=($(echo ${KOLIST} | tr ' ' '\n' | sort -u)) + unset USERMODULES + declare -A USERMODULES + writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" + for ID in ${KOLIST[@]}; do + USERMODULES["${ID}"]="" + writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}" + done + DIRTY=1 + ;; + a) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --infobox "$(TEXT "Selecting all modules")" 0 0 + unset USERMODULES + declare -A USERMODULES + writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" + while read ID DESC; do + USERMODULES["${ID}"]="" + writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}" + done <<<${ALLMODULES} + DIRTY=1 + ;; - d) dialog --backtitle "`backtitle`" --title "$(TEXT "Modules")" \ - --infobox "$(TEXT "Deselecting all modules")" 0 0 - writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" - unset USERMODULES - declare -A USERMODULES - DIRTY=1 - ;; + d) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --infobox "$(TEXT "Deselecting all modules")" 0 0 + writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" + unset USERMODULES + declare -A USERMODULES + DIRTY=1 + ;; - c) - rm -f "${TMP_PATH}/opts" - while read ID DESC; do - arrayExistItem "${ID}" "${!USERMODULES[@]}" && ACT="on" || ACT="off" - echo "${ID} ${DESC} ${ACT}" >> "${TMP_PATH}/opts" - done <<<${ALLMODULES} - dialog --backtitle "`backtitle`" --title "$(TEXT "Modules")" --aspect 18 \ - --checklist "$(TEXT "Select modules to include")" 0 0 0 \ - --file "${TMP_PATH}/opts" 2>${TMP_PATH}/resp - [ $? -ne 0 ] && continue - resp=$(<${TMP_PATH}/resp) - [ -z "${resp}" ] && continue - dialog --backtitle "`backtitle`" --title "$(TEXT "Modules")" \ - --infobox "$(TEXT "Writing to user config")" 0 0 - unset USERMODULES - declare -A USERMODULES - writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" - for ID in ${resp}; do - USERMODULES["${ID}"]="" - writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}" - done - DIRTY=1 - ;; + c) + rm -f "${TMP_PATH}/opts" + while read ID DESC; do + arrayExistItem "${ID}" "${!USERMODULES[@]}" && ACT="on" || ACT="off" + echo "${ID} ${DESC} ${ACT}" >>"${TMP_PATH}/opts" + done <<<${ALLMODULES} + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --checklist "$(TEXT "Select modules to include")" 0 0 0 --file "${TMP_PATH}/opts" \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && continue + resp=$(<${TMP_PATH}/resp) + [ -z "${resp}" ] && continue + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --infobox "$(TEXT "Writing to user config")" 0 0 + unset USERMODULES + declare -A USERMODULES + writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}" + for ID in ${resp}; do + USERMODULES["${ID}"]="" + writeConfigKey "modules.${ID}" "" "${USER_CONFIG_FILE}" + done + DIRTY=1 + ;; - o) - MSG="" - MSG+="$(TEXT "This function is experimental and dangerous. If you don't know much, please exit.\n")" - MSG+="$(TEXT "The imported .ko of this function will be implanted into the corresponding arch's modules package, which will affect all models of the arch.\n")" - MSG+="$(TEXT "This program will not determine the availability of imported modules or even make type judgments, as please double check if it is correct.\n")" - MSG+="$(TEXT "If you want to remove it, please go to the \"Update Menu\" -> \"Update modules\" to forcibly update the modules. All imports will be reset.\n")" - MSG+="$(TEXT "Do you want to continue?")" - dialog --backtitle "`backtitle`" --title "$(TEXT "Download a external module")" \ - --yesno "${MSG}" 0 0 - [ $? -ne 0 ] && return - dialog --backtitle "`backtitle`" --aspect 18 --colors --inputbox "$(TEXT "please enter the complete URL to download.\n")" 0 0 \ - 2>${TMP_PATH}/resp - [ $? -ne 0 ] && continue - URL="`<"${TMP_PATH}/resp"`" - [ -z "${URL}" ] && continue - clear - echo "`printf "$(TEXT "Downloading %s")" "${URL}"`" - STATUS=`curl -kLJO -w "%{http_code}" "${URL}" --progress-bar` - if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Error downloading")" --aspect 18 \ - --msgbox "$(TEXT "Check internet, URL or cache disk space")" 0 0 - return 1 - fi - KONAME=$(basename "$URL") - if [ -n "${KONAME}" -a "${KONAME##*.}" = "ko" ]; then - addToModules ${PLATFORM} ${KVER} ${KONAME} - dialog --backtitle "`backtitle`" --title "$(TEXT "Success")" --aspect 18 \ - --msgbox "`printf "$(TEXT "Module '%s' added to %s-%s")" "${KONAME}" ${PLATFORM} ${KVER}`" 0 0 - rm -f ${KONAME} - else - dialog --backtitle "`backtitle`" --title "$(TEXT "Invalid module")" --aspect 18 \ - --msgbox "$(TEXT "File format not recognized!")" 0 0 - fi - ;; - e) - break - ;; + o) + MSG="" + MSG+="$(TEXT "This function is experimental and dangerous. If you don't know much, please exit.\n")" + MSG+="$(TEXT "The imported .ko of this function will be implanted into the corresponding arch's modules package, which will affect all models of the arch.\n")" + MSG+="$(TEXT "This program will not determine the availability of imported modules or even make type judgments, as please double check if it is correct.\n")" + MSG+="$(TEXT "If you want to remove it, please go to the \"Update Menu\" -> \"Update modules\" to forcibly update the modules. All imports will be reset.\n")" + MSG+="$(TEXT "Do you want to continue?")" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --yesno "${MSG}" 0 0 + [ $? -ne 0 ] && return + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --inputbox "$(TEXT "please enter the complete URL to download.\n")" 0 0 \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && continue + URL="$(<"${TMP_PATH}/resp")" + [ -z "${URL}" ] && continue + clear + echo "$(printf "$(TEXT "Downloading %s")" "${URL}")" + STATUS=$(curl -kLJO -w "%{http_code}" "${URL}" --progress-bar) + if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --msgbox "$(TEXT "Check internet, URL or cache disk space")" 0 0 + return 1 + fi + KONAME=$(basename "$URL") + if [ -n "${KONAME}" -a "${KONAME##*.}" = "ko" ]; then + addToModules ${PLATFORM} ${KVER} ${KONAME} + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --msgbox "$(printf "$(TEXT "Module '%s' added to %s-%s")" "${KONAME}" ${PLATFORM} ${KVER})" 0 0 + rm -f ${KONAME} + else + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Modules")" \ + --msgbox "$(TEXT "File format not recognized!")" 0 0 + fi + ;; + e) + break + ;; esac done } @@ -468,129 +482,136 @@ function cmdlineMenu() { while IFS=': ' read KEY VALUE; do [ -n "${KEY}" ] && CMDLINE["${KEY}"]="${VALUE}" done < <(readConfigMap "cmdline" "${USER_CONFIG_FILE}") - echo "a \"$(TEXT "Add/edit a cmdline item")\"" > "${TMP_PATH}/menu" - echo "d \"$(TEXT "Delete cmdline item(s)")\"" >> "${TMP_PATH}/menu" - if [ -n "${MODEL}" ]; then - echo "s \"$(TEXT "Define a serial number")\"" >> "${TMP_PATH}/menu" + echo "a \"$(TEXT "Add/edit a cmdline item")\"" >"${TMP_PATH}/menu" + echo "d \"$(TEXT "Delete cmdline item(s)")\"" >>"${TMP_PATH}/menu" + if [ -n "${MODEL}" ]; then + echo "s \"$(TEXT "Define a serial number")\"" >>"${TMP_PATH}/menu" fi - echo "c \"$(TEXT "Define a custom MAC")\"" >> "${TMP_PATH}/menu" - echo "v \"$(TEXT "Show user added cmdline")\"" >> "${TMP_PATH}/menu" - echo "m \"$(TEXT "Show model inherent cmdline")\"" >> "${TMP_PATH}/menu" - echo "e \"$(TEXT "Exit")\"" >> "${TMP_PATH}/menu" + echo "c \"$(TEXT "Define a custom MAC")\"" >>"${TMP_PATH}/menu" + echo "v \"$(TEXT "Show user added cmdline")\"" >>"${TMP_PATH}/menu" + echo "m \"$(TEXT "Show model inherent cmdline")\"" >>"${TMP_PATH}/menu" + echo "e \"$(TEXT "Exit")\"" >>"${TMP_PATH}/menu" # Loop menu while true; do - dialog --backtitle "`backtitle`" --menu "$(TEXT "Choose a option")" 0 0 0 \ - --file "${TMP_PATH}/menu" 2>${TMP_PATH}/resp + dialog --backtitle "$(backtitle)" --colors \ + --menu "$(TEXT "Choose a option")" 0 0 0 --file "${TMP_PATH}/menu" \ + 2>${TMP_PATH}/resp [ $? -ne 0 ] && return - case "`<${TMP_PATH}/resp`" in - a) - dialog --backtitle "`backtitle`" --title "$(TEXT "User cmdline")" \ - --inputbox "$(TEXT "Type a name of cmdline")" 0 0 \ + case "$(<${TMP_PATH}/resp)" in + a) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --inputbox "$(TEXT "Type a name of cmdline")" 0 0 \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && continue + NAME="$(sed 's/://g' <"${TMP_PATH}/resp")" + [ -z "${NAME}" ] && continue + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --inputbox "$(printf "$(TEXT "Type a value of '%s' cmdline")" "${NAME}")" 0 0 "${CMDLINE[${NAME}]}" \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && continue + VALUE="$(<"${TMP_PATH}/resp")" + CMDLINE[${NAME}]="${VALUE}" + writeConfigKey "cmdline.${NAME}" "${VALUE}" "${USER_CONFIG_FILE}" + ;; + d) + if [ ${#CMDLINE[@]} -eq 0 ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --msgbox "$(TEXT "No user cmdline to remove")" 0 0 + continue + fi + ITEMS="" + for I in "${!CMDLINE[@]}"; do + [ -z "${CMDLINE[${I}]}" ] && ITEMS+="${I} \"\" off " || ITEMS+="${I} ${CMDLINE[${I}]} off " + done + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --checklist "$(TEXT "Select cmdline to remove")" 0 0 0 ${ITEMS} \ + 2>"${TMP_PATH}/resp" + [ $? -ne 0 ] && continue + RESP=$(<"${TMP_PATH}/resp") + [ -z "${RESP}" ] && continue + for I in ${RESP}; do + unset CMDLINE[${I}] + deleteConfigKey "cmdline.${I}" "${USER_CONFIG_FILE}" + done + ;; + s) + while true; do + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --inputbox "$(TEXT "Please enter a serial number ")" 0 0 "" \ 2>${TMP_PATH}/resp - [ $? -ne 0 ] && continue - NAME="`sed 's/://g' <"${TMP_PATH}/resp"`" - [ -z "${NAME}" ] && continue - dialog --backtitle "`backtitle`" --title "$(TEXT "User cmdline")" \ - --inputbox "`printf "$(TEXT "Type a value of '%s' cmdline")" "${NAME}"`" 0 0 "${CMDLINE[${NAME}]}" \ - 2>${TMP_PATH}/resp - [ $? -ne 0 ] && continue - VALUE="`<"${TMP_PATH}/resp"`" - CMDLINE[${NAME}]="${VALUE}" - writeConfigKey "cmdline.${NAME}" "${VALUE}" "${USER_CONFIG_FILE}" - ;; - d) - if [ ${#CMDLINE[@]} -eq 0 ]; then - dialog --backtitle "`backtitle`" --msgbox "$(TEXT "No user cmdline to remove")" 0 0 - continue + [ $? -ne 0 ] && break 2 + SERIAL=$(cat ${TMP_PATH}/resp) + if [ -z "${SERIAL}" ]; then + return + elif [ $(validateSerial ${MODEL} ${SERIAL}) -eq 1 ]; then + break fi - ITEMS="" - for I in "${!CMDLINE[@]}"; do - [ -z "${CMDLINE[${I}]}" ] && ITEMS+="${I} \"\" off " || ITEMS+="${I} ${CMDLINE[${I}]} off " - done - dialog --backtitle "`backtitle`" \ - --checklist "$(TEXT "Select cmdline to remove")" 0 0 0 ${ITEMS} \ - 2>"${TMP_PATH}/resp" - [ $? -ne 0 ] && continue - RESP=`<"${TMP_PATH}/resp"` - [ -z "${RESP}" ] && continue - for I in ${RESP}; do - unset CMDLINE[${I}] - deleteConfigKey "cmdline.${I}" "${USER_CONFIG_FILE}" - done - ;; - s) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --yesno "$(TEXT "Invalid serial, continue?")" 0 0 + [ $? -eq 0 ] && break + done + SN="${SERIAL}" + writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}" + ;; + c) + ETHX=($(ls /sys/class/net/ | grep eth)) # real network cards list + for N in $( # Currently, only up to 8 are supported. (<==> boot.sh L96, <==> lkm: MAX_NET_IFACES) + seq 1 8 + ); do + MACR="$(cat /sys/class/net/${ETHX[$(expr ${N} - 1)]}/address | sed 's/://g')" + MACF=${CMDLINE["mac${N}"]} + [ -n "${MACF}" ] && MAC=${MACF} || MAC=${MACR} + RET=1 while true; do - dialog --backtitle "`backtitle`" --title "$(TEXT "User cmdline")" \ - --inputbox "$(TEXT "Please enter a serial number ")" 0 0 "" \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --inputbox "$(printf "$(TEXT "Type a custom MAC address of %s")" "mac${N}")" 0 0 "${MAC}" \ 2>${TMP_PATH}/resp - [ $? -ne 0 ] && break 2 - SERIAL=`cat ${TMP_PATH}/resp` - if [ -z "${SERIAL}" ]; then - return - elif [ `validateSerial ${MODEL} ${SERIAL}` -eq 1 ]; then - break - fi - dialog --backtitle "`backtitle`" --title "$(TEXT "Alert")" \ - --yesno "$(TEXT "Invalid serial, continue?")" 0 0 - [ $? -eq 0 ] && break + RET=$? + [ ${RET} -ne 0 ] && break 2 + MAC="$(<"${TMP_PATH}/resp")" + [ -z "${MAC}" ] && MAC="$(readConfigKey "original-mac${i}" "${USER_CONFIG_FILE}")" + [ -z "${MAC}" ] && MAC="${MACFS[$(expr ${i} - 1)]}" + MACF="$(echo "${MAC}" | sed 's/://g')" + [ ${#MACF} -eq 12 ] && break + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --msgbox "$(TEXT "Invalid MAC")" 0 0 done - SN="${SERIAL}" - writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}" - ;; - c) - ETHX=(`ls /sys/class/net/ | grep eth`) # real network cards list - for N in `seq 1 8`; do # Currently, only up to 8 are supported. (<==> boot.sh L96, <==> lkm: MAX_NET_IFACES) - MACR="`cat /sys/class/net/${ETHX[$(expr ${N} - 1)]}/address | sed 's/://g'`" - MACF=${CMDLINE["mac${N}"]} - [ -n "${MACF}" ] && MAC=${MACF} || MAC=${MACR} - RET=1 - while true; do - dialog --backtitle "`backtitle`" --title "$(TEXT "User cmdline")" \ - --inputbox "`printf "$(TEXT "Type a custom MAC address of %s")" "mac${N}"`" 0 0 "${MAC}"\ - 2>${TMP_PATH}/resp - RET=$? - [ ${RET} -ne 0 ] && break 2 - MAC="`<"${TMP_PATH}/resp"`" - [ -z "${MAC}" ] && MAC="`readConfigKey "original-mac${i}" "${USER_CONFIG_FILE}"`" - [ -z "${MAC}" ] && MAC="${MACFS[$(expr ${i} - 1)]}" - MACF="`echo "${MAC}" | sed 's/://g'`" - [ ${#MACF} -eq 12 ] && break - dialog --backtitle "`backtitle`" --title "$(TEXT "User cmdline")" --msgbox "$(TEXT "Invalid MAC")" 0 0 - done - if [ ${RET} -eq 0 ]; then - CMDLINE["mac${N}"]="${MACF}" - CMDLINE["netif_num"]=${N} - writeConfigKey "cmdline.mac${N}" "${MACF}" "${USER_CONFIG_FILE}" - writeConfigKey "cmdline.netif_num" "${N}" "${USER_CONFIG_FILE}" - MAC="${MACF:0:2}:${MACF:2:2}:${MACF:4:2}:${MACF:6:2}:${MACF:8:2}:${MACF:10:2}" - ip link set dev ${ETHX[$(expr ${N} - 1)]} address ${MAC} 2>&1 | dialog --backtitle "`backtitle`" \ - --title "$(TEXT "User cmdline")" --progressbox "$(TEXT "Changing MAC")" 20 70 - /etc/init.d/S41dhcpcd restart 2>&1 | dialog --backtitle "`backtitle`" \ - --title "$(TEXT "User cmdline")" --progressbox "$(TEXT "Renewing IP")" 20 70 - # IP=`ip route 2>/dev/null | sed -n 's/.* via .* dev \(.*\) src \(.*\) metric .*/\1: \2 /p' | head -1` - dialog --backtitle "`backtitle`" --title "$(TEXT "Alert")" \ - --yesno "$(TEXT "Continue to custom MAC?")" 0 0 - [ $? -ne 0 ] && break - fi - done - ;; - v) - ITEMS="" - for KEY in ${!CMDLINE[@]}; do - ITEMS+="${KEY}: ${CMDLINE[$KEY]}\n" - done - dialog --backtitle "`backtitle`" --title "$(TEXT "User cmdline")" \ - --aspect 18 --msgbox "${ITEMS}" 0 0 - ;; - m) - ITEMS="" - while IFS=': ' read KEY VALUE; do - ITEMS+="${KEY}: ${VALUE}\n" - done < <(readModelMap "${MODEL}" "builds.${BUILD}.cmdline") - dialog --backtitle "`backtitle`" --title "$(TEXT "Model/build cmdline")" \ - --aspect 18 --msgbox "${ITEMS}" 0 0 - ;; - e) return ;; + if [ ${RET} -eq 0 ]; then + CMDLINE["mac${N}"]="${MACF}" + CMDLINE["netif_num"]=${N} + writeConfigKey "cmdline.mac${N}" "${MACF}" "${USER_CONFIG_FILE}" + writeConfigKey "cmdline.netif_num" "${N}" "${USER_CONFIG_FILE}" + MAC="${MACF:0:2}:${MACF:2:2}:${MACF:4:2}:${MACF:6:2}:${MACF:8:2}:${MACF:10:2}" + ip link set dev ${ETHX[$(expr ${N} - 1)]} address ${MAC} 2>&1 | + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --progressbox "$(TEXT "Changing MAC")" 20 70 + /etc/init.d/S41dhcpcd restart 2>&1 | + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --progressbox "$(TEXT "Renewing IP")" 20 70 + # IP=`ip route 2>/dev/null | sed -n 's/.* via .* dev \(.*\) src \(.*\) metric .*/\1: \2 /p' | head -1` + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --yesno "$(TEXT "Continue to custom MAC?")" 0 0 + [ $? -ne 0 ] && break + fi + done + ;; + v) + ITEMS="" + for KEY in ${!CMDLINE[@]}; do + ITEMS+="${KEY}: ${CMDLINE[$KEY]}\n" + done + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --msgbox "${ITEMS}" 0 0 + ;; + m) + ITEMS="" + while IFS=': ' read KEY VALUE; do + ITEMS+="${KEY}: ${VALUE}\n" + done < <(readModelMap "${MODEL}" "builds.${BUILD}.cmdline") + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cmdline")" \ + --msgbox "${ITEMS}" 0 0 + ;; + e) return ;; esac done } @@ -604,63 +625,65 @@ function synoinfoMenu() { [ -n "${KEY}" ] && SYNOINFO["${KEY}"]="${VALUE}" done < <(readConfigMap "synoinfo" "${USER_CONFIG_FILE}") - echo "a \"$(TEXT "Add/edit a synoinfo item")\"" > "${TMP_PATH}/menu" - echo "d \"$(TEXT "Delete synoinfo item(s)")\"" >> "${TMP_PATH}/menu" - echo "s \"$(TEXT "Show synoinfo entries")\"" >> "${TMP_PATH}/menu" - echo "e \"$(TEXT "Exit")\"" >> "${TMP_PATH}/menu" + echo "a \"$(TEXT "Add/edit a synoinfo item")\"" >"${TMP_PATH}/menu" + echo "d \"$(TEXT "Delete synoinfo item(s)")\"" >>"${TMP_PATH}/menu" + echo "s \"$(TEXT "Show synoinfo entries")\"" >>"${TMP_PATH}/menu" + echo "e \"$(TEXT "Exit")\"" >>"${TMP_PATH}/menu" # menu loop while true; do - dialog --backtitle "`backtitle`" --menu "$(TEXT "Choose a option")" 0 0 0 \ - --file "${TMP_PATH}/menu" 2>${TMP_PATH}/resp + dialog --backtitle "$(backtitle)" --colors \ + --menu "$(TEXT "Choose a option")" 0 0 0 --file "${TMP_PATH}/menu" \ + 2>${TMP_PATH}/resp [ $? -ne 0 ] && return - case "`<${TMP_PATH}/resp`" in - a) - dialog --backtitle "`backtitle`" --title "$(TEXT "Synoinfo entries")" \ - --inputbox "$(TEXT "Type a name of synoinfo entry")" 0 0 \ - 2>${TMP_PATH}/resp - [ $? -ne 0 ] && continue - NAME="`<"${TMP_PATH}/resp"`" - [ -z "${NAME}" ] && continue - dialog --backtitle "`backtitle`" --title "$(TEXT "Synoinfo entries")" \ - --inputbox "`printf "$(TEXT "Type a value of '%s' synoinfo entry")" "${NAME}"`" 0 0 "${SYNOINFO[${NAME}]}" \ - 2>${TMP_PATH}/resp - [ $? -ne 0 ] && continue - VALUE="`<"${TMP_PATH}/resp"`" - SYNOINFO[${NAME}]="${VALUE}" - writeConfigKey "synoinfo.${NAME}" "${VALUE}" "${USER_CONFIG_FILE}" - DIRTY=1 - ;; - d) - if [ ${#SYNOINFO[@]} -eq 0 ]; then - dialog --backtitle "`backtitle`" --msgbox "$(TEXT "No synoinfo entries to remove")" 0 0 - continue - fi - ITEMS="" - for I in "${!SYNOINFO[@]}"; do - [ -z "${SYNOINFO[${I}]}" ] && ITEMS+="${I} \"\" off " || ITEMS+="${I} ${SYNOINFO[${I}]} off " - done - dialog --backtitle "`backtitle`" \ - --checklist "$(TEXT "Select synoinfo entry to remove")" 0 0 0 ${ITEMS} \ - 2>"${TMP_PATH}/resp" - [ $? -ne 0 ] && continue - RESP=`<"${TMP_PATH}/resp"` - [ -z "${RESP}" ] && continue - for I in ${RESP}; do - unset SYNOINFO[${I}] - deleteConfigKey "synoinfo.${I}" "${USER_CONFIG_FILE}" - done - DIRTY=1 - ;; - s) - ITEMS="" - for KEY in ${!SYNOINFO[@]}; do - ITEMS+="${KEY}: ${SYNOINFO[$KEY]}\n" - done - dialog --backtitle "`backtitle`" --title "$(TEXT "Synoinfo entries")" \ - --aspect 18 --msgbox "${ITEMS}" 0 0 - ;; - e) return ;; + case "$(<${TMP_PATH}/resp)" in + a) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Synoinfo")" \ + --inputbox "$(TEXT "Type a name of synoinfo entry")" 0 0 \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && continue + NAME="$(<"${TMP_PATH}/resp")" + [ -z "${NAME}" ] && continue + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Synoinfo")" \ + --inputbox "$(printf "$(TEXT "Type a value of '%s' synoinfo entry")" "${NAME}")" 0 0 "${SYNOINFO[${NAME}]}" \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && continue + VALUE="$(<"${TMP_PATH}/resp")" + SYNOINFO[${NAME}]="${VALUE}" + writeConfigKey "synoinfo.${NAME}" "${VALUE}" "${USER_CONFIG_FILE}" + DIRTY=1 + ;; + d) + if [ ${#SYNOINFO[@]} -eq 0 ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Synoinfo")" \ + --msgbox "$(TEXT "No synoinfo entries to remove")" 0 0 + continue + fi + ITEMS="" + for I in "${!SYNOINFO[@]}"; do + [ -z "${SYNOINFO[${I}]}" ] && ITEMS+="${I} \"\" off " || ITEMS+="${I} ${SYNOINFO[${I}]} off " + done + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Synoinfo")" \ + --checklist "$(TEXT "Select synoinfo entry to remove")" 0 0 0 ${ITEMS} \ + 2>"${TMP_PATH}/resp" + [ $? -ne 0 ] && continue + RESP=$(<"${TMP_PATH}/resp") + [ -z "${RESP}" ] && continue + for I in ${RESP}; do + unset SYNOINFO[${I}] + deleteConfigKey "synoinfo.${I}" "${USER_CONFIG_FILE}" + done + DIRTY=1 + ;; + s) + ITEMS="" + for KEY in ${!SYNOINFO[@]}; do + ITEMS+="${KEY}: ${SYNOINFO[$KEY]}\n" + done + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Synoinfo")" \ + --msgbox "${ITEMS}" 0 0 + ;; + e) return ;; esac done } @@ -668,12 +691,12 @@ function synoinfoMenu() { ############################################################################### # Extract linux and ramdisk files from the DSM .pat function extractDsmFiles() { - PAT_URL="`readModelKey "${MODEL}" "builds.${BUILD}.pat.url"`" - PAT_HASH="`readModelKey "${MODEL}" "builds.${BUILD}.pat.hash"`" - RAMDISK_HASH="`readModelKey "${MODEL}" "builds.${BUILD}.pat.ramdisk-hash"`" - ZIMAGE_HASH="`readModelKey "${MODEL}" "builds.${BUILD}.pat.zimage-hash"`" + PAT_URL="$(readModelKey "${MODEL}" "builds.${BUILD}.pat.url")" + PAT_HASH="$(readModelKey "${MODEL}" "builds.${BUILD}.pat.hash")" + RAMDISK_HASH="$(readModelKey "${MODEL}" "builds.${BUILD}.pat.ramdisk-hash")" + ZIMAGE_HASH="$(readModelKey "${MODEL}" "builds.${BUILD}.pat.zimage-hash")" - SPACELEFT=`df --block-size=1 | awk '/'${LOADER_DEVICE_NAME}'3/{print $4}'` # Check disk space left + SPACELEFT=$(df --block-size=1 | awk '/'${LOADER_DEVICE_NAME}'3/{print $4}') # Check disk space left PAT_FILE="${MODEL}-${BUILD}.pat" PAT_PATH="${CACHE_PATH}/dl/${PAT_FILE}" @@ -682,7 +705,7 @@ function extractDsmFiles() { OLDPAT_URL="https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_DS3622xs%2B_42218.pat" if [ -f "${PAT_PATH}" ]; then - echo "`printf "$(TEXT "%s cached.")" "${PAT_FILE}"`" + echo "$(printf "$(TEXT "%s cached.")" "${PAT_FILE}")" else # If we have little disk space, clean cache folder if [ ${CLEARCACHE} -eq 1 ]; then @@ -691,37 +714,37 @@ function extractDsmFiles() { fi mkdir -p "${CACHE_PATH}/dl" - speed_a=`ping -c 1 -W 5 global.synologydownload.com | awk '/time=/ {print $7}' | cut -d '=' -f 2` - speed_b=`ping -c 1 -W 5 global.download.synology.com | awk '/time=/ {print $7}' | cut -d '=' -f 2` - speed_c=`ping -c 1 -W 5 cndl.synology.cn | awk '/time=/ {print $7}' | cut -d '=' -f 2` - fastest="`echo -e "global.synologydownload.com ${speed_a:-999}\nglobal.download.synology.com ${speed_b:-999}\ncndl.synology.cn ${speed_c:-999}" | sort -k2n | head -1 | awk '{print $1}'`" - - mirror="`echo ${PAT_URL} | sed 's|^http[s]*://\([^/]*\).*|\1|'`" + speed_a=$(ping -c 1 -W 5 global.synologydownload.com | awk '/time=/ {print $7}' | cut -d '=' -f 2) + speed_b=$(ping -c 1 -W 5 global.download.synology.com | awk '/time=/ {print $7}' | cut -d '=' -f 2) + speed_c=$(ping -c 1 -W 5 cndl.synology.cn | awk '/time=/ {print $7}' | cut -d '=' -f 2) + fastest="$(echo -e "global.synologydownload.com ${speed_a:-999}\nglobal.download.synology.com ${speed_b:-999}\ncndl.synology.cn ${speed_c:-999}" | sort -k2n | head -1 | awk '{print $1}')" + + mirror="$(echo ${PAT_URL} | sed 's|^http[s]*://\([^/]*\).*|\1|')" if [ "${mirror}" != "${fastest}" ]; then - echo "`printf "$(TEXT "Based on the current network situation, switch to %s mirror to downloading.")" "${fastest}"`" - PAT_URL="`echo ${PAT_URL} | sed "s/${mirror}/${fastest}/"`" + echo "$(printf "$(TEXT "Based on the current network situation, switch to %s mirror to downloading.")" "${fastest}")" + PAT_URL="$(echo ${PAT_URL} | sed "s/${mirror}/${fastest}/")" OLDPAT_URL="https://${fastest}/download/DSM/release/7.0.1/42218/DSM_DS3622xs%2B_42218.pat" fi - echo ${PAT_URL} > "${TMP_PATH}/patdownloadurl" - echo "`printf "$(TEXT "Downloading %s")" "${PAT_FILE}"`" + echo ${PAT_URL} >"${TMP_PATH}/patdownloadurl" + echo "$(printf "$(TEXT "Downloading %s")" "${PAT_FILE}")" # Discover remote file size - FILESIZE=`curl -k -sLI "${PAT_URL}" | grep -i Content-Length | awk '{print$2}'` + FILESIZE=$(curl -k -sLI "${PAT_URL}" | grep -i Content-Length | awk '{print$2}') if [ 0${FILESIZE} -ge 0${SPACELEFT} ]; then # No disk space to download, change it to RAMDISK PAT_PATH="${TMP_PATH}/${PAT_FILE}" fi - STATUS=`curl -k -w "%{http_code}" -L "${PAT_URL}" -o "${PAT_PATH}" --progress-bar` + STATUS=$(curl -k -w "%{http_code}" -L "${PAT_URL}" -o "${PAT_PATH}" --progress-bar) if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then rm "${PAT_PATH}" - dialog --backtitle "`backtitle`" --title "$(TEXT "Error downloading")" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ --msgbox "$(TEXT "Check internet or cache disk space")" 0 0 return 1 fi fi - echo -n "`printf "$(TEXT "Checking hash of %s: ")" "${PAT_FILE}"`" - if [ "`sha256sum ${PAT_PATH} | awk '{print$1}'`" != "${PAT_HASH}" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Error")" --aspect 18 \ + echo -n "$(printf "$(TEXT "Checking hash of %s: ")" "${PAT_FILE}")" + if [ "$(sha256sum ${PAT_PATH} | awk '{print$1}')" != "${PAT_HASH}" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ --msgbox "$(TEXT "Hash of pat not match, try again!")" 0 0 rm -f ${PAT_PATH} return 1 @@ -730,31 +753,30 @@ function extractDsmFiles() { rm -rf "${UNTAR_PAT_PATH}" mkdir "${UNTAR_PAT_PATH}" - echo -n "`printf "$(TEXT "Disassembling %s: ")" "${PAT_FILE}"`" + echo -n "$(printf "$(TEXT "Disassembling %s: ")" "${PAT_FILE}")" header="$(od -bcN2 ${PAT_PATH} | head -1 | awk '{print $3}')" case ${header} in - 105) - echo "$(TEXT "Uncompressed tar")" - isencrypted="no" - ;; - 213) - echo "$(TEXT "Compressed tar")" - isencrypted="no" - ;; - 255) - echo "$(TEXT "Encrypted")" - isencrypted="yes" - ;; - *) - dialog --backtitle "`backtitle`" --title "$(TEXT "Error")" --aspect 18 \ - --msgbox "$(TEXT "Could not determine if pat file is encrypted or not, maybe corrupted, try again!")" \ - 0 0 - return 1 - ;; + 105) + echo "$(TEXT "Uncompressed tar")" + isencrypted="no" + ;; + 213) + echo "$(TEXT "Compressed tar")" + isencrypted="no" + ;; + 255) + echo "$(TEXT "Encrypted")" + isencrypted="yes" + ;; + *) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ + --msgbox "$(TEXT "Could not determine if pat file is encrypted or not, maybe corrupted, try again!")" 0 0 + return 1 + ;; esac - SPACELEFT=`df --block-size=1 | awk '/'${LOADER_DEVICE_NAME}'3/{print$4}'` # Check disk space left + SPACELEFT=$(df --block-size=1 | awk '/'${LOADER_DEVICE_NAME}'3/{print$4}') # Check disk space left if [ "${isencrypted}" = "yes" ]; then # Check existance of extractor @@ -768,15 +790,15 @@ function extractDsmFiles() { if [ ! -f "${OLDPAT_PATH}" ]; then echo "$(TEXT "Downloading old pat to extract synology .pat extractor...")" # Discover remote file size - FILESIZE=`curl -k -sLI "${OLDPAT_URL}" | grep -i Content-Length | awk '{print$2}'` + FILESIZE=$(curl -k -sLI "${OLDPAT_URL}" | grep -i Content-Length | awk '{print$2}') if [ 0${FILESIZE} -ge 0${SPACELEFT} ]; then # No disk space to download, change it to RAMDISK OLDPAT_PATH="${TMP_PATH}/DS3622xs+-42218.pat" fi - STATUS=`curl -k -w "%{http_code}" -L "${OLDPAT_URL}" -o "${OLDPAT_PATH}" --progress-bar` + STATUS=$(curl -k -w "%{http_code}" -L "${OLDPAT_URL}" -o "${OLDPAT_PATH}" --progress-bar) if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then rm "${OLDPAT_PATH}" - dialog --backtitle "`backtitle`" --title "$(TEXT "Error downloading")" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ --msgbox "$(TEXT "Check internet or cache disk space")" 0 0 return 1 fi @@ -788,12 +810,16 @@ function extractDsmFiles() { if [ $? -ne 0 ]; then rm -f "${OLDPAT_PATH}" rm -rf "${RAMDISK_PATH}" - dialog --backtitle "`backtitle`" --title "$(TEXT "Error extracting")" --textbox "${LOG_FILE}" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ + --textbox "${LOG_FILE}" 0 0 return 1 fi [ ${CLEARCACHE} -eq 1 ] && rm -f "${OLDPAT_PATH}" # Extract all files from rd.gz - (cd "${RAMDISK_PATH}"; xz -dc < rd.gz | cpio -idm) >/dev/null 2>&1 || true + ( + cd "${RAMDISK_PATH}" + xz -dc /dev/null 2>&1 || true # Copy only necessary files for f in libcurl.so.4 libmbedcrypto.so.5 libmbedtls.so.13 libmbedx509.so.1 libmsgpackc.so.2 libsodium.so libsynocodesign-ng-virtual-junior-wins.so.7; do cp "${RAMDISK_PATH}/usr/lib/${f}" "${EXTRACTOR_PATH}" @@ -808,15 +834,16 @@ function extractDsmFiles() { echo "$(TEXT "Extracting...")" tar -xf "${PAT_PATH}" -C "${UNTAR_PAT_PATH}" >"${LOG_FILE}" 2>&1 if [ $? -ne 0 ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Error extracting")" --textbox "${LOG_FILE}" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ + --textbox "${LOG_FILE}" 0 0 fi fi echo -n "$(TEXT "Checking hash of zImage: ")" - HASH="`sha256sum ${UNTAR_PAT_PATH}/zImage | awk '{print$1}'`" + HASH="$(sha256sum ${UNTAR_PAT_PATH}/zImage | awk '{print$1}')" if [ "${HASH}" != "${ZIMAGE_HASH}" ]; then sleep 1 - dialog --backtitle "`backtitle`" --title "$(TEXT "Error")" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ --msgbox "$(TEXT "Hash of zImage not match, try again!")" 0 0 return 1 fi @@ -824,10 +851,10 @@ function extractDsmFiles() { writeConfigKey "zimage-hash" "${ZIMAGE_HASH}" "${USER_CONFIG_FILE}" echo -n "$(TEXT "Checking hash of ramdisk: ")" - HASH="`sha256sum ${UNTAR_PAT_PATH}/rd.gz | awk '{print$1}'`" + HASH="$(sha256sum ${UNTAR_PAT_PATH}/rd.gz | awk '{print$1}')" if [ "${HASH}" != "${RAMDISK_HASH}" ]; then sleep 1 - dialog --backtitle "`backtitle`" --title "$(TEXT "Error")" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ --msgbox "$(TEXT "Hash of ramdisk not match, try again!")" 0 0 return 1 fi @@ -836,11 +863,11 @@ function extractDsmFiles() { echo -n "$(TEXT "Copying files: ")" cp "${UNTAR_PAT_PATH}/grub_cksum.syno" "${BOOTLOADER_PATH}" - cp "${UNTAR_PAT_PATH}/GRUB_VER" "${BOOTLOADER_PATH}" + cp "${UNTAR_PAT_PATH}/GRUB_VER" "${BOOTLOADER_PATH}" cp "${UNTAR_PAT_PATH}/grub_cksum.syno" "${SLPART_PATH}" - cp "${UNTAR_PAT_PATH}/GRUB_VER" "${SLPART_PATH}" - cp "${UNTAR_PAT_PATH}/zImage" "${ORI_ZIMAGE_FILE}" - cp "${UNTAR_PAT_PATH}/rd.gz" "${ORI_RDGZ_FILE}" + cp "${UNTAR_PAT_PATH}/GRUB_VER" "${SLPART_PATH}" + cp "${UNTAR_PAT_PATH}/zImage" "${ORI_ZIMAGE_FILE}" + cp "${UNTAR_PAT_PATH}/rd.gz" "${ORI_RDGZ_FILE}" rm -rf "${UNTAR_PAT_PATH}" echo "$(TEXT "OK")" } @@ -849,15 +876,15 @@ function extractDsmFiles() { # Where the magic happens! function make() { clear - PLATFORM="`readModelKey "${MODEL}" "platform"`" - KVER="`readModelKey "${MODEL}" "builds.${BUILD}.kver"`" + PLATFORM="$(readModelKey "${MODEL}" "platform")" + KVER="$(readModelKey "${MODEL}" "builds.${BUILD}.kver")" # Check if all addon exists while IFS=': ' read ADDON PARAM; do [ -z "${ADDON}" ] && continue if ! checkAddonExist "${ADDON}" "${PLATFORM}" "${KVER}"; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Error")" --aspect 18 \ - --msgbox "`printf "$(TEXT "Addon %s not found!")" "${ADDON}"`" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ + --msgbox "$(printf "$(TEXT "Addon %s not found!")" "${ADDON}")" 0 0 return 1 fi done < <(readConfigMap "addons" "${USER_CONFIG_FILE}") @@ -869,15 +896,15 @@ function make() { /opt/arpl/zimage-patch.sh if [ $? -ne 0 ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Error")" --aspect 18 \ - --msgbox "$(TEXT "zImage not patched:\n")`<"${LOG_FILE}"`" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ + --msgbox "$(TEXT "zImage not patched:\n")$(<"${LOG_FILE}")" 0 0 return 1 fi /opt/arpl/ramdisk-patch.sh if [ $? -ne 0 ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Error")" --aspect 18 \ - --msgbox "$(TEXT "Ramdisk not patched:\n")`<"${LOG_FILE}"`" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Error")" \ + --msgbox "$(TEXT "Ramdisk not patched:\n")$(<"${LOG_FILE}")" 0 0 return 1 fi @@ -897,368 +924,389 @@ function advancedMenu() { while true; do rm "${TMP_PATH}/menu" if [ -n "${BUILD}" ]; then - echo "l \"$(TEXT "Switch LKM version:") \Z4${LKM}\Zn\"" >> "${TMP_PATH}/menu" + echo "l \"$(TEXT "Switch LKM version:") \Z4${LKM}\Zn\"" >>"${TMP_PATH}/menu" fi if loaderIsConfigured; then - echo "q \"$(TEXT "Switch direct boot:") \Z4${DIRECTBOOT}\Zn\"" >> "${TMP_PATH}/menu" + echo "q \"$(TEXT "Switch direct boot:") \Z4${DIRECTBOOT}\Zn\"" >>"${TMP_PATH}/menu" if [ "${DIRECTBOOT}" = "false" ]; then - echo "w \"$(TEXT "boot IPs wait time:") \Z4${BOOTIPWAIT}\Zn\"" >> "${TMP_PATH}/menu" + echo "w \"$(TEXT "boot IPs wait time:") \Z4${BOOTIPWAIT}\Zn\"" >>"${TMP_PATH}/menu" fi fi - echo "m \"$(TEXT "Switch 'not set MACs':") \Z4${NOTSETMACS}\Zn\"" >> "${TMP_PATH}/menu" - echo "u \"$(TEXT "Edit user config file manually")\"" >> "${TMP_PATH}/menu" - echo "t \"$(TEXT "Try to recovery a DSM installed system")\"" >> "${TMP_PATH}/menu" - echo "s \"$(TEXT "Show SATA(s) # ports and drives")\"" >> "${TMP_PATH}/menu" + echo "m \"$(TEXT "Switch 'not set MACs':") \Z4${NOTSETMACS}\Zn\"" >>"${TMP_PATH}/menu" + echo "u \"$(TEXT "Edit user config file manually")\"" >>"${TMP_PATH}/menu" + echo "t \"$(TEXT "Try to recovery a DSM installed system")\"" >>"${TMP_PATH}/menu" + echo "s \"$(TEXT "Show SATA(s) # ports and drives")\"" >>"${TMP_PATH}/menu" if [ -n "${MODEL}" -a -n "${BUILD}" ]; then - echo "k \"$(TEXT "show pat download link")\"" >> "${TMP_PATH}/menu" + echo "k \"$(TEXT "show pat download link")\"" >>"${TMP_PATH}/menu" fi - echo "a \"$(TEXT "Allow downgrade installation")\"" >> "${TMP_PATH}/menu" - echo "f \"$(TEXT "Format disk(s) # Without loader disk")\"" >> "${TMP_PATH}/menu" - echo "x \"$(TEXT "Reset syno system password")\"" >> "${TMP_PATH}/menu" - echo "p \"$(TEXT "Persistence of arpl modifications")\"" >> "${TMP_PATH}/menu" - if [ -n "${MODEL}" -a "true" = "`readModelKey "${MODEL}" "dt"`" ]; then - echo "d \"$(TEXT "Custom dts file # Need rebuild")\"" >> "${TMP_PATH}/menu" + echo "a \"$(TEXT "Allow downgrade installation")\"" >>"${TMP_PATH}/menu" + echo "f \"$(TEXT "Format disk(s) # Without loader disk")\"" >>"${TMP_PATH}/menu" + echo "x \"$(TEXT "Reset syno system password")\"" >>"${TMP_PATH}/menu" + echo "p \"$(TEXT "Persistence of arpl modifications")\"" >>"${TMP_PATH}/menu" + if [ -n "${MODEL}" -a "true" = "$(readModelKey "${MODEL}" "dt")" ]; then + echo "d \"$(TEXT "Custom dts file # Need rebuild")\"" >>"${TMP_PATH}/menu" fi if [ -n "${DEBUG}" ]; then - echo "b \"$(TEXT "Backup bootloader disk # test")\"" >> "${TMP_PATH}/menu" - echo "r \"$(TEXT "Restore bootloader disk # test")\"" >> "${TMP_PATH}/menu" + echo "b \"$(TEXT "Backup bootloader disk # test")\"" >>"${TMP_PATH}/menu" + echo "r \"$(TEXT "Restore bootloader disk # test")\"" >>"${TMP_PATH}/menu" fi - echo "o \"$(TEXT "Development tools")\"" >> "${TMP_PATH}/menu" - echo "e \"$(TEXT "Exit")\"" >> "${TMP_PATH}/menu" + echo "o \"$(TEXT "Development tools")\"" >>"${TMP_PATH}/menu" + echo "e \"$(TEXT "Exit")\"" >>"${TMP_PATH}/menu" - dialog --default-item "${NEXT}" --backtitle "`backtitle`" --title "$(TEXT "Advanced")" \ - --colors --menu "$(TEXT "Choose the option")" 0 0 0 --file "${TMP_PATH}/menu" \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --default-item "${NEXT}" --menu "$(TEXT "Choose the option")" 0 0 0 --file "${TMP_PATH}/menu" \ 2>${TMP_PATH}/resp [ $? -ne 0 ] && break - case `<"${TMP_PATH}/resp"` in - l) LKM=$([ "${LKM}" = "dev" ] && echo 'prod' || ([ "${LKM}" = "test" ] && echo 'dev' || echo 'test')) - writeConfigKey "lkm" "${LKM}" "${USER_CONFIG_FILE}" - DIRTY=1 - NEXT="l" - ;; - q) [ "${DIRECTBOOT}" = "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false' - writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}" - NEXT="e" - ;; - w) - ITEMS="`echo -e "1 \n5 \n10 \n30 \n60 \n"`" - dialog --backtitle "`backtitle`" --default-item "${BOOTIPWAIT}" --no-items \ - --colors --menu "$(TEXT "Choose a waiting time(seconds)")" 0 0 0 ${ITEMS} 2>${TMP_PATH}/resp - [ $? -ne 0 ] && return - resp=`cat ${TMP_PATH}/resp 2>/dev/null` - [ -z "${resp}" ] && return - BOOTIPWAIT=${resp} - writeConfigKey "bootipwait" "${BOOTIPWAIT}" "${USER_CONFIG_FILE}" - NEXT="e" - ;; - m) [ "${NOTSETMACS}" = "false" ] && NOTSETMACS='true' || NOTSETMACS='false' - writeConfigKey "notsetmacs" "${NOTSETMACS}" "${USER_CONFIG_FILE}" - NEXT="e" - ;; - u) editUserConfig; NEXT="e" ;; - t) tryRecoveryDSM ;; - s) MSG="" - NUMPORTS=0 - ATTACHTNUM=0 - DiskIdxMap="" - for PCI in `echo -e "$(lspci -d ::106)\n$(lspci -d ::107)" | awk '{print $1}'`; do - NAME=`lspci -s "${PCI}" | sed "s/\ .*://"` - MSG+="\Zb${NAME}\Zn\nPorts: " - unset HOSTPORTS - declare -A HOSTPORTS - ATTACHTIDX=0 - while read LINE; do - ATAPORT="`echo ${LINE} | grep -o 'ata[0-9]*'`" - PORT="" - if [ -n "${ATAPORT}" ]; then - PORT=`echo ${ATAPORT} | sed 's/ata//'` - else - SASPORT="`echo ${LINE} | grep -o "${PCI}/host[0-9]*"`" - PORT=`echo ${SASPORT} | sed "s/${PCI}\/host//"` - fi - HOSTPORTS[${PORT}]=`echo ${LINE} | grep -o 'host[0-9]*$'` - done < <(ls -l /sys/class/scsi_host | fgrep "${PCI}") - while read PORT; do - ls -l /sys/block | fgrep -q "${PCI}/ata${PORT}" && ATTACH=1 || \ - ls -l /sys/block | fgrep -q "${PCI}/host${PORT}" && ATTACH=1 || ATTACH=0 - PCMD=`cat /sys/class/scsi_host/${HOSTPORTS[${PORT}]}/ahci_port_cmd` - [ "${PCMD}" = "0" ] && DUMMY=1 || DUMMY=0 - [ ${ATTACH} -eq 1 ] && MSG+="\Z2\Zb" && ATTACHTIDX=$((${ATTACHTIDX}+1)) - [ ${DUMMY} -eq 1 ] && MSG+="\Z1" - MSG+="${PORT}\Zn " - NUMPORTS=$((${NUMPORTS}+1)) - done < <(echo ${!HOSTPORTS[@]} | tr ' ' '\n' | sort -n) - MSG+="\n" - [ ${ATTACHTIDX} -gt 0 ] && DiskIdxMap+=`printf '%02x' ${ATTACHTNUM}` || DiskIdxMap+="ff" - ATTACHTNUM=$((${ATTACHTNUM}+${ATTACHTIDX})) - done - MSG+="`printf "$(TEXT "\nTotal of ports: %s\n")" "${NUMPORTS}"`" - MSG+="$(TEXT "\nPorts with color \Z1red\Zn as DUMMY, color \Z2\Zbgreen\Zn has drive connected.")" - MSG+="$(TEXT "\nRecommended value:")" - MSG+="$(TEXT "\nDiskIdxMap:") ${DiskIdxMap}" - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "${MSG}" 0 0 - ;; - k) - # output pat download link - if [ ! -f "${TMP_PATH}/patdownloadurl" ]; then - echo "`readModelKey "${MODEL}" "builds.${BUILD}.pat.url"`" > "${TMP_PATH}/patdownloadurl" - fi - dialog --backtitle "`backtitle`" --title "$(TEXT "*.pat download link")" --aspect 18 \ - --editbox "${TMP_PATH}/patdownloadurl" 10 100 - ;; - a) - MSG="" - MSG+="$(TEXT "This feature will allow you to downgrade the installation by removing the VERSION file from the first partition of all disks.\n")" - MSG+="$(TEXT "Therefore, please insert all disks before continuing.\n")" - MSG+="$(TEXT "Warning:\nThis operation is irreversible. Please backup important data. Do you want to continue?")" - dialog --backtitle "`backtitle`" --title "$(TEXT "Allow downgrade installation")" \ - --yesno "${MSG}" 0 0 - [ $? -ne 0 ] && return - ( - mkdir -p /tmp/sdX1 - for I in `ls /dev/sd*1 2>/dev/null | grep -v ${LOADER_DISK}1`; do - mount ${I} /tmp/sdX1 - [ -f "/tmp/sdX1/etc/VERSION" ] && rm -f "/tmp/sdX1/etc/VERSION" - [ -f "/tmp/sdX1/etc.defaults/VERSION" ] && rm -f "/tmp/sdX1/etc.defaults/VERSION" - sync - umount ${I} - done - rm -rf /tmp/sdX1 - ) | dialog --backtitle "`backtitle`" --title "$(TEXT "Allow downgrade installation")" \ - --progressbox "$(TEXT "Removing ...")" 20 70 - MSG="$(TEXT "Remove VERSION file for all disks completed.")" - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "${MSG}" 0 0 - ;; - f) ITEMS="" - while read POSITION NAME; do - [ -z "${POSITION}" -o -z "${NAME}" ] && continue - echo "${POSITION}" | grep -q "${LOADER_DEVICE_NAME}" && continue - ITEMS+="`printf "%s %s off " "${POSITION}" "${NAME}"`" - done < <(ls -l /dev/disk/by-id/ | sed 's|../..|/dev|g' | grep -E "/dev/sd*" | awk -F' ' '{print $NF" "$(NF-2)}' | sort -uk 1,1) - while read POSITION NAME; do - [ -z "${POSITION}" -o -z "${NAME}" ] && continue - echo "${POSITION}" | grep -q "${LOADER_DEVICE_NAME}" && continue - ITEMS+="`printf "%s %s off " "${POSITION}" "${NAME}"`" - done < <(ls -l /dev/disk/by-path/ | sed 's|../..|/dev|g' | grep -E "/dev/sd*" | awk -F' ' '{print $NF" "$(NF-2)}' | sort -uk 1,1) - dialog --backtitle "`backtitle`" --title "$(TEXT "Format disk")" \ - --checklist "$(TEXT "Advanced")" 0 0 0 ${ITEMS} 2>${TMP_PATH}/resp - [ $? -ne 0 ] && return - RESP=`<"${TMP_PATH}/resp"` - [ -z "${RESP}" ] && return - dialog --backtitle "`backtitle`" --title "$(TEXT "Format disk")" \ - --yesno "$(TEXT "Warning:\nThis operation is irreversible. Please backup important data. Do you want to continue?")" 0 0 - [ $? -ne 0 ] && return - if [ `ls /dev/md* | wc -l` -gt 0 ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Format disk")" \ - --yesno "$(TEXT "Warning:\nThe current hds is in raid, do you still want to format them?")" 0 0 - [ $? -ne 0 ] && return - for I in `ls /dev/md*`; do - mdadm -S ${I} - done - fi - ( - for I in ${RESP}; do - mkfs.ext4 -F -O ^metadata_csum ${I} - done - ) | dialog --backtitle "`backtitle`" --title "$(TEXT "Format disk")" \ - --progressbox "$(TEXT "Formatting ...")" 20 70 - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "Formatting is complete.")" 0 0 - ;; - x) - SHADOW_FILE="" - mkdir -p /tmp/sdX1 - for I in `ls /dev/sd*1 2>/dev/null | grep -v ${LOADER_DISK}1`; do - mount ${I} /tmp/sdX1 - if [ -f "/tmp/sdX1/etc/shadow" ]; then - cp "/tmp/sdX1/etc/shadow" "/tmp/shadow_bak" - SHADOW_FILE="/tmp/shadow_bak" + case $(<"${TMP_PATH}/resp") in + l) + LKM=$([ "${LKM}" = "dev" ] && echo 'prod' || ([ "${LKM}" = "test" ] && echo 'dev' || echo 'test')) + writeConfigKey "lkm" "${LKM}" "${USER_CONFIG_FILE}" + DIRTY=1 + NEXT="l" + ;; + q) + [ "${DIRECTBOOT}" = "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false' + writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}" + NEXT="e" + ;; + w) + ITEMS="$(echo -e "1 \n5 \n10 \n30 \n60 \n")" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --default-item "${BOOTIPWAIT}" --no-items --menu "$(TEXT "Choose a waiting time(seconds)")" 0 0 0 ${ITEMS} \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && return + resp=$(cat ${TMP_PATH}/resp 2>/dev/null) + [ -z "${resp}" ] && return + BOOTIPWAIT=${resp} + writeConfigKey "bootipwait" "${BOOTIPWAIT}" "${USER_CONFIG_FILE}" + NEXT="e" + ;; + m) + [ "${NOTSETMACS}" = "false" ] && NOTSETMACS='true' || NOTSETMACS='false' + writeConfigKey "notsetmacs" "${NOTSETMACS}" "${USER_CONFIG_FILE}" + NEXT="e" + ;; + u) + editUserConfig + NEXT="e" + ;; + t) tryRecoveryDSM ;; + s) + MSG="" + NUMPORTS=0 + ATTACHTNUM=0 + DiskIdxMap="" + for PCI in $(echo -e "$(lspci -d ::106)\n$(lspci -d ::107)" | awk '{print $1}'); do + NAME=$(lspci -s "${PCI}" | sed "s/\ .*://") + MSG+="\Zb${NAME}\Zn\nPorts: " + unset HOSTPORTS + declare -A HOSTPORTS + ATTACHTIDX=0 + while read LINE; do + ATAPORT="$(echo ${LINE} | grep -o 'ata[0-9]*')" + PORT="" + if [ -n "${ATAPORT}" ]; then + PORT=$(echo ${ATAPORT} | sed 's/ata//') + else + SASPORT="$(echo ${LINE} | grep -o "${PCI}/host[0-9]*")" + PORT=$(echo ${SASPORT} | sed "s/${PCI}\/host//") fi + HOSTPORTS[${PORT}]=$(echo ${LINE} | grep -o 'host[0-9]*$') + done < <(ls -l /sys/class/scsi_host | fgrep "${PCI}") + while read PORT; do + ls -l /sys/block | fgrep -q "${PCI}/ata${PORT}" && ATTACH=1 || + ls -l /sys/block | fgrep -q "${PCI}/host${PORT}" && ATTACH=1 || ATTACH=0 + PCMD=$(cat /sys/class/scsi_host/${HOSTPORTS[${PORT}]}/ahci_port_cmd) + [ "${PCMD}" = "0" ] && DUMMY=1 || DUMMY=0 + [ ${ATTACH} -eq 1 ] && MSG+="\Z2\Zb" && ATTACHTIDX=$((${ATTACHTIDX} + 1)) + [ ${DUMMY} -eq 1 ] && MSG+="\Z1" + MSG+="${PORT}\Zn " + NUMPORTS=$((${NUMPORTS} + 1)) + done < <(echo ${!HOSTPORTS[@]} | tr ' ' '\n' | sort -n) + MSG+="\n" + [ ${ATTACHTIDX} -gt 0 ] && DiskIdxMap+=$(printf '%02x' ${ATTACHTNUM}) || DiskIdxMap+="ff" + ATTACHTNUM=$((${ATTACHTNUM} + ${ATTACHTIDX})) + done + MSG+="$(printf "$(TEXT "\nTotal of ports: %s\n")" "${NUMPORTS}")" + MSG+="$(TEXT "\nPorts with color \Z1red\Zn as DUMMY, color \Z2\Zbgreen\Zn has drive connected.")" + MSG+="$(TEXT "\nRecommended value:")" + MSG+="$(TEXT "\nDiskIdxMap:") ${DiskIdxMap}" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "${MSG}" 0 0 + ;; + k) + # output pat download link + if [ ! -f "${TMP_PATH}/patdownloadurl" ]; then + echo "$(readModelKey "${MODEL}" "builds.${BUILD}.pat.url")" >"${TMP_PATH}/patdownloadurl" + fi + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --editbox "${TMP_PATH}/patdownloadurl" 10 100 + ;; + a) + MSG="" + MSG+="$(TEXT "This feature will allow you to downgrade the installation by removing the VERSION file from the first partition of all disks.\n")" + MSG+="$(TEXT "Therefore, please insert all disks before continuing.\n")" + MSG+="$(TEXT "Warning:\nThis operation is irreversible. Please backup important data. Do you want to continue?")" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --yesno "${MSG}" 0 0 + [ $? -ne 0 ] && return + ( + mkdir -p /tmp/sdX1 + for I in $(ls /dev/sd*1 2>/dev/null | grep -v ${LOADER_DISK}1); do + mount ${I} /tmp/sdX1 + [ -f "/tmp/sdX1/etc/VERSION" ] && rm -f "/tmp/sdX1/etc/VERSION" + [ -f "/tmp/sdX1/etc.defaults/VERSION" ] && rm -f "/tmp/sdX1/etc.defaults/VERSION" + sync umount ${I} - [ -n "${SHADOW_FILE}" ] && break done rm -rf /tmp/sdX1 - if [ -z "${SHADOW_FILE}" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Error")" --aspect 18 \ - --msgbox "$(TEXT "The installed Syno system not found in the currently inserted disks!")" 0 0 - return - fi - ITEMS="`cat ${SHADOW_FILE} | awk -F ':' '{if ($2 != "*" && $2 != "!!") {print $1;}}'`" - dialog --clear --no-items --backtitle "`backtitle`" --title "$(TEXT "Reset syno system password")" \ - --menu "$(TEXT "Choose a user name")" 0 0 0 ${ITEMS} 2>${TMP_PATH}/resp + ) | dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --progressbox "$(TEXT "Removing ...")" 20 70 + MSG="$(TEXT "Remove VERSION file for all disks completed.")" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "${MSG}" 0 0 + ;; + f) + ITEMS="" + while read POSITION NAME; do + [ -z "${POSITION}" -o -z "${NAME}" ] && continue + echo "${POSITION}" | grep -q "${LOADER_DEVICE_NAME}" && continue + ITEMS+="$(printf "%s %s off " "${POSITION}" "${NAME}")" + done < <(ls -l /dev/disk/by-id/ | sed 's|../..|/dev|g' | grep -E "/dev/sd*" | awk -F' ' '{print $NF" "$(NF-2)}' | sort -uk 1,1) + while read POSITION NAME; do + [ -z "${POSITION}" -o -z "${NAME}" ] && continue + echo "${POSITION}" | grep -q "${LOADER_DEVICE_NAME}" && continue + ITEMS+="$(printf "%s %s off " "${POSITION}" "${NAME}")" + done < <(ls -l /dev/disk/by-path/ | sed 's|../..|/dev|g' | grep -E "/dev/sd*" | awk -F' ' '{print $NF" "$(NF-2)}' | sort -uk 1,1) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --checklist "$(TEXT "Advanced")" 0 0 0 ${ITEMS} \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && return + RESP=$(<"${TMP_PATH}/resp") + [ -z "${RESP}" ] && return + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --yesno "$(TEXT "Warning:\nThis operation is irreversible. Please backup important data. Do you want to continue?")" 0 0 + [ $? -ne 0 ] && return + if [ $(ls /dev/md* | wc -l) -gt 0 ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --yesno "$(TEXT "Warning:\nThe current hds is in raid, do you still want to format them?")" 0 0 [ $? -ne 0 ] && return - USER=$(<${TMP_PATH}/resp) - [ -z "${USER}" ] && return - OLDPASSWD=`cat ${SHADOW_FILE} | grep "^${USER}:" | awk -F ':' '{print $2}'` - while true; do - dialog --backtitle "`backtitle`" --title "$(TEXT "Reset syno system password")" \ - --inputbox "`printf "$(TEXT "Type a new password for user '%s'")" "${USER}"`" 0 0 "${CMDLINE[${NAME}]}" \ - 2>${TMP_PATH}/resp - [ $? -ne 0 ] && break 2 - VALUE="`<"${TMP_PATH}/resp"`" - [ -n "${VALUE}" ] && break - dialog --backtitle "`backtitle`" --title "$(TEXT "Reset syno system password")" --msgbox "$(TEXT "Invalid password")" 0 0 + for I in $(ls /dev/md*); do + mdadm -S ${I} done - NEWPASSWD=`python -c "import crypt,getpass;pw=\"${VALUE}\";print(crypt.crypt(pw))"` - ( - mkdir -p /tmp/sdX1 - for I in `ls /dev/sd*1 2>/dev/null | grep -v ${LOADER_DISK}1`; do - mount ${I} /tmp/sdX1 - sed -i "s|${OLDPASSWD}|${NEWPASSWD}|g" "/tmp/sdX1/etc/shadow" - sync - umount ${I} - done - rm -rf /tmp/sdX1 - ) | dialog --backtitle "`backtitle`" --title "$(TEXT "Reset syno system password")" \ - --progressbox "$(TEXT "Resetting ...")" 20 70 - [ -f "${SHADOW_FILE}" ] && rm -rf "${SHADOW_FILE}" - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "Password reset completed.")" 0 0 - # dialog --backtitle "`backtitle`" --colors --aspect 18 \ - # --msgbox "$(TEXT "You came early, this function has not been implemented yet, hahaha!")" 0 0 - ;; - p) - dialog --backtitle "`backtitle`" --title "$(TEXT "Persistence of arpl modifications")" \ - --yesno "$(TEXT "Warning:\nDo not terminate midway, otherwise it may cause damage to the arpl. Do you want to continue?")" 0 0 - [ $? -ne 0 ] && return - dialog --backtitle "`backtitle`" --title "$(TEXT "Persistence of arpl modifications")" \ - --infobox "$(TEXT "Persisting ...")" 0 0 - RDXZ_PATH=/tmp/rdxz_tmp - mkdir -p "${RDXZ_PATH}" - (cd "${RDXZ_PATH}"; xz -dc < "/mnt/p3/initrd-arpl" | cpio -idm) >/dev/null 2>&1 || true - rm -rf "${RDXZ_PATH}/opt/arpl" - cp -rf "/opt" "${RDXZ_PATH}/" - (cd "${RDXZ_PATH}"; find . 2>/dev/null | cpio -o -H newc -R root:root | xz --check=crc32 > "/mnt/p3/initrd-arpl") || true - rm -rf "${RDXZ_PATH}" - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox ""$(TEXT "Persisting is complete.")"" 0 0 - ;; - d) - if ! tty | grep -q "/dev/pts"; then - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 - return - fi - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "Currently, only dts format files are supported. Please prepare and click to confirm uploading.\n(saved in /mnt/p3/users/)")" 0 0 - TMP_UP_PATH=/tmp/users - rm -rf ${TMP_UP_PATH} - mkdir -p ${TMP_UP_PATH} - pushd ${TMP_UP_PATH} - rz -be - for F in `ls -A`; do - USER_FILE=${TMP_UP_PATH}/${F} - dtc -q -I dts -O dtb ${F} > test.dtb - RET=$? - break + fi + ( + for I in ${RESP}; do + mkfs.ext4 -F -O ^metadata_csum ${I} done - popd - if [ ${RET} -ne 0 -o -z "${USER_FILE}" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Custom dts file")" --aspect 18 \ - --msgbox "$(TEXT "Not a valid dts file, please try again!")" 0 0 - else - mkdir -p ${USER_UP_PATH} - cp -f ${USER_FILE} ${USER_UP_PATH}/${MODEL}.dts - dialog --backtitle "`backtitle`" --title "$(TEXT "Custom dts file")" --aspect 18 \ - --msgbox "$(TEXT "A valid dts file, Automatically import at compile time.")" 0 0 + ) | dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --progressbox "$(TEXT "Formatting ...")" 20 70 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "Formatting is complete.")" 0 0 + ;; + x) + SHADOW_FILE="" + mkdir -p /tmp/sdX1 + for I in $(ls /dev/sd*1 2>/dev/null | grep -v ${LOADER_DISK}1); do + mount ${I} /tmp/sdX1 + if [ -f "/tmp/sdX1/etc/shadow" ]; then + cp "/tmp/sdX1/etc/shadow" "/tmp/shadow_bak" + SHADOW_FILE="/tmp/shadow_bak" fi - DIRTY=1 - ;; - b) - if ! tty | grep -q "/dev/pts"; then - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 - return - fi - dialog --backtitle "`backtitle`" --title "$(TEXT "Backup bootloader disk")" \ - --yesno "$(TEXT "Warning:\nDo not terminate midway, otherwise it may cause damage to the arpl. Do you want to continue?")" 0 0 - [ $? -ne 0 ] && return - dialog --backtitle "`backtitle`" --title "$(TEXT "Backup bootloader disk")" \ - --infobox "$(TEXT "Backuping...")" 0 0 - rm -f /var/www/data/backup.img.gz # thttpd root path - dd if="${LOADER_DISK}" bs=1M conv=fsync | gzip > /var/www/data/backup.img.gz - if [ $? -ne 0]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Error")" --aspect 18 \ - --msgbox "$(TEXT "Failed to generate backup. There may be insufficient memory. Please clear the cache and try again!")" 0 0 - return - fi - if [ -z "${SSH_TTY}" ]; then # web - IP_HEAD="`ip route show 2>/dev/null | sed -n 's/.* via .* src \(.*\) metric .*/\1/p' | head -1`" - echo "http://${IP_HEAD}/backup.img.gz" > ${TMP_PATH}/resp - echo " ↑ " >> ${TMP_PATH}/resp - echo "$(TEXT "Click on the address above to download.")" >> ${TMP_PATH}/resp - echo "$(TEXT "Please confirm the completion of the download before closing this window.")" >> ${TMP_PATH}/resp - dialog --backtitle "`backtitle`" --title "$(TEXT "backup.img.gz download link")" --aspect 18 \ - --editbox "${TMP_PATH}/resp" 10 100 - else # ssh - sz -be /var/www/data/backup.img.gz - fi - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "backup is complete.")" 0 0 - rm -f /var/www/data/backup.img.gz - ;; - r) - if ! tty | grep -q "/dev/pts"; then - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 - return - fi - dialog --backtitle "`backtitle`" --title "$(TEXT "Restore bootloader disk")" --aspect 18 \ - --yesno "$(TEXT "Please upload the backup file.\nCurrently, zip(github) and img.gz(backup) compressed file formats are supported.")" 0 0 - [ $? -ne 0 ] && return - IFTOOL="" - TMP_UP_PATH=/tmp/users - rm -rf ${TMP_UP_PATH} - mkdir -p ${TMP_UP_PATH} - pushd ${TMP_UP_PATH} - rz -be - for F in `ls -A`; do - USER_FILE="${F}" - [ "${F##*.}" = "zip" -a `unzip -l "${TMP_UP_PATH}/${USER_FILE}" | grep -c "\.img$"` -eq 1 ] && IFTOOL="zip" - [ "${F##*.}" = "gz" -a "${F#*.}" = "img.gz" ] && IFTOOL="gzip" - break + umount ${I} + [ -n "${SHADOW_FILE}" ] && break + done + rm -rf /tmp/sdX1 + if [ -z "${SHADOW_FILE}" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "The installed Syno system not found in the currently inserted disks!")" 0 0 + return + fi + ITEMS="$(cat ${SHADOW_FILE} | awk -F ':' '{if ($2 != "*" && $2 != "!!") {print $1;}}')" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --no-items --menu "$(TEXT "Choose a user name")" 0 0 0 ${ITEMS} \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && return + USER=$(<${TMP_PATH}/resp) + [ -z "${USER}" ] && return + OLDPASSWD=$(cat ${SHADOW_FILE} | grep "^${USER}:" | awk -F ':' '{print $2}') + while true; do + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --inputbox "$(printf "$(TEXT "Type a new password for user '%s'")" "${USER}")" 0 0 "${CMDLINE[${NAME}]}" \ + 2>${TMP_PATH}/resp + [ $? -ne 0 ] && break 2 + VALUE="$(<"${TMP_PATH}/resp")" + [ -n "${VALUE}" ] && break + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "Invalid password")" 0 0 + done + NEWPASSWD=$(python -c "import crypt,getpass;pw=\"${VALUE}\";print(crypt.crypt(pw))") + ( + mkdir -p /tmp/sdX1 + for I in $(ls /dev/sd*1 2>/dev/null | grep -v ${LOADER_DISK}1); do + mount ${I} /tmp/sdX1 + sed -i "s|${OLDPASSWD}|${NEWPASSWD}|g" "/tmp/sdX1/etc/shadow" + sync + umount ${I} done - popd - if [ -z "${IFTOOL}" -o -z "${TMP_UP_PATH}/${USER_FILE}" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Restore bootloader disk")" --aspect 18 \ - --msgbox "`printf "$(TEXT "Not a valid .zip/.img.gz file, please try again!")" "${USER_FILE}"`" 0 0 - else - dialog --backtitle "`backtitle`" --title "$(TEXT "Restore bootloader disk")" \ - --yesno "$(TEXT "Warning:\nDo not terminate midway, otherwise it may cause damage to the arpl. Do you want to continue?")" 0 0 - [ $? -ne 0 ] && ( rm -f ${LOADER_DISK}; return ) - dialog --backtitle "`backtitle`" --title "$(TEXT "Restore bootloader disk")" --aspect 18 \ - --infobox "$(TEXT "Writing...")" 0 0 - umount /mnt/p1 /mnt/p2 /mnt/p3 - if [ "${IFTOOL}" = "zip" ]; then - unzip -p "${TMP_UP_PATH}/${USER_FILE}" | dd of="${LOADER_DISK}" bs=1M conv=fsync - elif [ "${IFTOOL}" = "gzip" ]; then - gzip -dc "${TMP_UP_PATH}/${USER_FILE}" | dd of="${LOADER_DISK}" bs=1M conv=fsync - fi - dialog --backtitle "`backtitle`" --title "$(TEXT "Restore bootloader disk")" --aspect 18 \ - --yesno "`printf "$(TEXT "Restore bootloader disk with success to %s!\nReboot?")" "${USER_FILE}"`" 0 0 - [ $? -ne 0 ] && continue - reboot - exit + rm -rf /tmp/sdX1 + ) | dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --progressbox "$(TEXT "Resetting ...")" 20 70 + [ -f "${SHADOW_FILE}" ] && rm -rf "${SHADOW_FILE}" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "Password reset completed.")" 0 0 + # dialog --backtitle "`backtitle`" --colors --title "$(TEXT "Advanced")" \ + # --msgbox "$(TEXT "You came early, this function has not been implemented yet, hahaha!")" 0 0 + ;; + p) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --yesno "$(TEXT "Warning:\nDo not terminate midway, otherwise it may cause damage to the arpl. Do you want to continue?")" 0 0 + [ $? -ne 0 ] && return + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --infobox "$(TEXT "Persisting ...")" 0 0 + RDXZ_PATH=/tmp/rdxz_tmp + mkdir -p "${RDXZ_PATH}" + ( + cd "${RDXZ_PATH}" + xz -dc <"/mnt/p3/initrd-arpl" | cpio -idm + ) >/dev/null 2>&1 || true + rm -rf "${RDXZ_PATH}/opt/arpl" + cp -rf "/opt" "${RDXZ_PATH}/" + ( + cd "${RDXZ_PATH}" + find . 2>/dev/null | cpio -o -H newc -R root:root | xz --check=crc32 >"/mnt/p3/initrd-arpl" + ) || true + rm -rf "${RDXZ_PATH}" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox ""$(TEXT "Persisting is complete.")"" 0 0 + ;; + d) + if ! tty | grep -q "/dev/pts"; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 + return + fi + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "Currently, only dts format files are supported. Please prepare and click to confirm uploading.\n(saved in /mnt/p3/users/)")" 0 0 + TMP_UP_PATH=/tmp/users + rm -rf ${TMP_UP_PATH} + mkdir -p ${TMP_UP_PATH} + pushd ${TMP_UP_PATH} + rz -be + for F in $(ls -A); do + USER_FILE=${TMP_UP_PATH}/${F} + dtc -q -I dts -O dtb ${F} >test.dtb + RET=$? + break + done + popd + if [ ${RET} -ne 0 -o -z "${USER_FILE}" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "Not a valid dts file, please try again!")" 0 0 + else + mkdir -p ${USER_UP_PATH} + cp -f ${USER_FILE} ${USER_UP_PATH}/${MODEL}.dts + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "A valid dts file, Automatically import at compile time.")" 0 0 + fi + DIRTY=1 + ;; + b) + if ! tty | grep -q "/dev/pts"; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 + return + fi + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --yesno "$(TEXT "Warning:\nDo not terminate midway, otherwise it may cause damage to the arpl. Do you want to continue?")" 0 0 + [ $? -ne 0 ] && return + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --infobox "$(TEXT "Backuping...")" 0 0 + rm -f /var/www/data/backup.img.gz # thttpd root path + dd if="${LOADER_DISK}" bs=1M conv=fsync | gzip >/var/www/data/backup.img.gz + if [ $? -ne 0]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "Failed to generate backup. There may be insufficient memory. Please clear the cache and try again!")" 0 0 + return + fi + if [ -z "${SSH_TTY}" ]; then # web + IP_HEAD="$(ip route show 2>/dev/null | sed -n 's/.* via .* src \(.*\) metric .*/\1/p' | head -1)" + echo "http://${IP_HEAD}/backup.img.gz" >${TMP_PATH}/resp + echo " ↑ " >>${TMP_PATH}/resp + echo "$(TEXT "Click on the address above to download.")" >>${TMP_PATH}/resp + echo "$(TEXT "Please confirm the completion of the download before closing this window.")" >>${TMP_PATH}/resp + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --editbox "${TMP_PATH}/resp" 10 100 + else # ssh + sz -be /var/www/data/backup.img.gz + fi + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "backup is complete.")" 0 0 + rm -f /var/www/data/backup.img.gz + ;; + r) + if ! tty | grep -q "/dev/pts"; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 + return + fi + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --yesno "$(TEXT "Please upload the backup file.\nCurrently, zip(github) and img.gz(backup) compressed file formats are supported.")" 0 0 + [ $? -ne 0 ] && return + IFTOOL="" + TMP_UP_PATH=/tmp/users + rm -rf ${TMP_UP_PATH} + mkdir -p ${TMP_UP_PATH} + pushd ${TMP_UP_PATH} + rz -be + for F in $(ls -A); do + USER_FILE="${F}" + [ "${F##*.}" = "zip" -a $(unzip -l "${TMP_UP_PATH}/${USER_FILE}" | grep -c "\.img$") -eq 1 ] && IFTOOL="zip" + [ "${F##*.}" = "gz" -a "${F#*.}" = "img.gz" ] && IFTOOL="gzip" + break + done + popd + if [ -z "${IFTOOL}" -o -z "${TMP_UP_PATH}/${USER_FILE}" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(printf "$(TEXT "Not a valid .zip/.img.gz file, please try again!")" "${USER_FILE}")" 0 0 + else + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --yesno "$(TEXT "Warning:\nDo not terminate midway, otherwise it may cause damage to the arpl. Do you want to continue?")" 0 0 + [ $? -ne 0 ] && ( + rm -f ${LOADER_DISK} + return + ) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --infobox "$(TEXT "Writing...")" 0 0 + umount /mnt/p1 /mnt/p2 /mnt/p3 + if [ "${IFTOOL}" = "zip" ]; then + unzip -p "${TMP_UP_PATH}/${USER_FILE}" | dd of="${LOADER_DISK}" bs=1M conv=fsync + elif [ "${IFTOOL}" = "gzip" ]; then + gzip -dc "${TMP_UP_PATH}/${USER_FILE}" | dd of="${LOADER_DISK}" bs=1M conv=fsync fi - ;; - o) - dialog --backtitle "`backtitle`" --title "$(TEXT "Development tools")" --aspect 18 \ - --yesno "$(TEXT "This option only installs opkg package management, allowing you to install more tools for use and debugging. Do you want to continue?")" 0 0 - [ $? -ne 0 ] && return - ( - wget -O - http://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh - sed -i 's|:/opt/arpl|:/opt/bin:/opt/arpl|' ~/.bashrc - source ~/.bashrc - opkg update - #opkg install python3 python3-pip - ) | dialog --backtitle "`backtitle`" --title "$(TEXT "Development tools")" \ - --progressbox "$(TEXT "opkg installing ...")" 20 70 - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "opkg install is complete. Please reconnect to SSH/web, or execute 'source ~/.bashrc'")" 0 0 - ;; - e) break ;; + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --yesno "$(printf "$(TEXT "Restore bootloader disk with success to %s!\nReboot?")" "${USER_FILE}")" 0 0 + [ $? -ne 0 ] && continue + reboot + exit + fi + ;; + o) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --yesno "$(TEXT "This option only installs opkg package management, allowing you to install more tools for use and debugging. Do you want to continue?")" 0 0 + [ $? -ne 0 ] && return + ( + wget -O - http://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh + sed -i 's|:/opt/arpl|:/opt/bin:/opt/arpl|' ~/.bashrc + source ~/.bashrc + opkg update + #opkg install python3 python3-pip + ) | dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --progressbox "$(TEXT "opkg installing ...")" 20 70 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ + --msgbox "$(TEXT "opkg install is complete. Please reconnect to SSH/web, or execute 'source ~/.bashrc'")" 0 0 + ;; + e) break ;; esac done } @@ -1266,19 +1314,19 @@ function advancedMenu() { ############################################################################### # Try to recovery a DSM already installed function tryRecoveryDSM() { - dialog --backtitle "`backtitle`" --title "$(TEXT "Try recovery DSM")" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Try recovery DSM")" \ --infobox "$(TEXT "Trying to recovery a DSM installed system")" 0 0 if findAndMountDSMRoot; then MODEL="" BUILD="" if [ -f "${DSMROOT_PATH}/.syno/patch/VERSION" ]; then - eval `cat ${DSMROOT_PATH}/.syno/patch/VERSION | grep unique` - eval `cat ${DSMROOT_PATH}/.syno/patch/VERSION | grep base` - if [ -n "${unique}" ] ; then + eval $(cat ${DSMROOT_PATH}/.syno/patch/VERSION | grep unique) + eval $(cat ${DSMROOT_PATH}/.syno/patch/VERSION | grep base) + if [ -n "${unique}" ]; then while read F; do - M="`basename ${F}`" + M="$(basename ${F})" M="${M::-4}" - UNIQUE=`readModelKey "${M}" "unique"` + UNIQUE=$(readModelKey "${M}" "unique") [ "${unique}" = "${UNIQUE}" ] || continue # Found modelMenu "${M}" @@ -1288,20 +1336,20 @@ function tryRecoveryDSM() { if [ -n "${BUILD}" ]; then cp "${DSMROOT_PATH}/.syno/patch/zImage" "${SLPART_PATH}" cp "${DSMROOT_PATH}/.syno/patch/rd.gz" "${SLPART_PATH}" - MSG="`printf "$(TEXT "Found a installation:\nModel: %s\nBuildnumber: %s")" "${MODEL}" "${BUILD}"`" - SN=`_get_conf_kv SN "${DSMROOT_PATH}/etc/synoinfo.conf"` + MSG="$(printf "$(TEXT "Found a installation:\nModel: %s\nBuildnumber: %s")" "${MODEL}" "${BUILD}")" + SN=$(_get_conf_kv SN "${DSMROOT_PATH}/etc/synoinfo.conf") if [ -n "${SN}" ]; then writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}" - MSG+="`printf "$(TEXT "\nSerial: %s")" "${SN}"`" + MSG+="$(printf "$(TEXT "\nSerial: %s")" "${SN}")" fi - dialog --backtitle "`backtitle`" --title "$(TEXT "Try recovery DSM")" \ - --aspect 18 --msgbox "${MSG}" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Try recovery DSM")" \ + --msgbox "${MSG}" 0 0 fi fi fi fi else - dialog --backtitle "`backtitle`" --title "$(TEXT "Try recovery DSM")" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Try recovery DSM")" \ --msgbox "$(TEXT "Unfortunately I couldn't mount the DSM partition!")" 0 0 fi } @@ -1310,19 +1358,20 @@ function tryRecoveryDSM() { # Permits user edit the user config function editUserConfig() { while true; do - dialog --backtitle "`backtitle`" --title "$(TEXT "Edit with caution")" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Edit with caution")" \ --editbox "${USER_CONFIG_FILE}" 0 0 2>"${TMP_PATH}/userconfig" [ $? -ne 0 ] && return mv "${TMP_PATH}/userconfig" "${USER_CONFIG_FILE}" - ERRORS=`yq eval "${USER_CONFIG_FILE}" 2>&1` + ERRORS=$(yq eval "${USER_CONFIG_FILE}" 2>&1) [ $? -eq 0 ] && break - dialog --backtitle "`backtitle`" --title "$(TEXT "Invalid YAML format")" --msgbox "${ERRORS}" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Edit with caution")" \ + --msgbox "${ERRORS}" 0 0 done OLDMODEL=${MODEL} OLDBUILD=${BUILD} - MODEL="`readConfigKey "model" "${USER_CONFIG_FILE}"`" - BUILD="`readConfigKey "build" "${USER_CONFIG_FILE}"`" - SN="`readConfigKey "sn" "${USER_CONFIG_FILE}"`" + MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" + BUILD="$(readConfigKey "build" "${USER_CONFIG_FILE}")" + SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")" if [ "${MODEL}" != "${OLDMODEL}" -o "${BUILD}" != "${OLDBUILD}" ]; then # Remove old files @@ -1335,7 +1384,7 @@ function editUserConfig() { ############################################################################### # Calls boot.sh to boot into DSM kernel/ramdisk function boot() { - [ ${DIRTY} -eq 1 ] && dialog --backtitle "`backtitle`" --title "$(TEXT "Alert")" \ + [ ${DIRTY} -eq 1 ] && dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Alert")" \ --yesno "$(TEXT "Config changed, would you like to rebuild the loader?")" 0 0 if [ $? -eq 0 ]; then make || return @@ -1346,35 +1395,38 @@ function boot() { ############################################################################### # Shows language to user choose one function languageMenu() { - ITEMS="`ls /usr/share/locale`" - dialog --backtitle "`backtitle`" --default-item "${LAYOUT}" --no-items \ - --menu "$(TEXT "Choose a language")" 0 0 0 ${ITEMS} 2>${TMP_PATH}/resp + ITEMS="$(ls /usr/share/locale)" + dialog --backtitle "$(backtitle)" --colors \ + --default-item "${LAYOUT}" --no-items --menu "$(TEXT "Choose a language")" 0 0 0 ${ITEMS} 2>${TMP_PATH}/resp [ $? -ne 0 ] && return - resp=`cat ${TMP_PATH}/resp 2>/dev/null` + resp=$(cat ${TMP_PATH}/resp 2>/dev/null) [ -z "${resp}" ] && return LANGUAGE=${resp} - echo "${LANGUAGE}.UTF-8" > ${BOOTLOADER_PATH}/.locale + echo "${LANGUAGE}.UTF-8" >${BOOTLOADER_PATH}/.locale export LANG="${LANGUAGE}.UTF-8" } ############################################################################### # Shows available keymaps to user choose one function keymapMenu() { - dialog --backtitle "`backtitle`" --default-item "${LAYOUT}" --no-items \ - --menu "$(TEXT "Choose a layout")" 0 0 0 "azerty" "bepo" "carpalx" "colemak" \ - "dvorak" "fgGIod" "neo" "olpc" "qwerty" "qwertz" \ + OPTIONS="azerty bepo carpalx colemak dvorak fgGIod neo olpc qwerty qwertz" + dialog --backtitle "$(backtitle)" --colors \ + --default-item "${LAYOUT}" --no-items --menu "$(TEXT "Choose a layout")" 0 0 0 ${OPTIONS} \ 2>${TMP_PATH}/resp [ $? -ne 0 ] && return - LAYOUT="`<${TMP_PATH}/resp`" + LAYOUT="$(<${TMP_PATH}/resp)" OPTIONS="" while read KM; do OPTIONS+="${KM::-7} " - done < <(cd /usr/share/keymaps/i386/${LAYOUT}; ls *.map.gz) - dialog --backtitle "`backtitle`" --no-items --default-item "${KEYMAP}" \ - --menu "$(TEXT "Choice a keymap")" 0 0 0 ${OPTIONS} \ + done < <( + cd /usr/share/keymaps/i386/${LAYOUT} + ls *.map.gz + ) + dialog --backtitle "$(backtitle)" --colors \ + --default-item "${KEYMAP}" --no-items --menu "$(TEXT "Choice a keymap")" 0 0 0 ${OPTIONS} \ 2>${TMP_PATH}/resp [ $? -ne 0 ] && return - resp=`cat ${TMP_PATH}/resp 2>/dev/null` + resp=$(cat ${TMP_PATH}/resp 2>/dev/null) [ -z "${resp}" ] && return KEYMAP=${resp} writeConfigKey "layout" "${LAYOUT}" "${USER_CONFIG_FILE}" @@ -1387,32 +1439,33 @@ function keymapMenu() { # 3 - repo url # 4 - attachment name function downloadExts() { - PROXY="`readConfigKey "proxy" "${USER_CONFIG_FILE}"`"; [ -n "${PROXY}" ] && [[ "${PROXY: -1}" != "/" ]] && PROXY="${PROXY}/" - T="`printf "$(TEXT "Update %s")" "${1}"`" + PROXY="$(readConfigKey "proxy" "${USER_CONFIG_FILE}")" + [ -n "${PROXY}" ] && [[ "${PROXY: -1}" != "/" ]] && PROXY="${PROXY}/" + T="$(printf "$(TEXT "Update %s")" "${1}")" - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --infobox "$(TEXT "Checking last version")" 0 0 # TAG=`curl -skL "${PROXY}https://api.github.com/repos/wjz304/arpl-addons/releases/latest" | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'` # In the absence of authentication, the default API access count for GitHub is 60 per hour, so removing the use of api.github.com - LATESTURL="`curl -skL -w %{url_effective} -o /dev/null "${PROXY}${3}/releases/latest"`" + LATESTURL="$(curl -skL -w %{url_effective} -o /dev/null "${PROXY}${3}/releases/latest")" TAG="${LATESTURL##*/}" [ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}" if [ -z "${TAG}" ]; then - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --msgbox "$(TEXT "Error checking new version")" 0 0 return 1 fi if [ "${2}" = "${TAG}" ]; then - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ - --yesno "`printf "$(TEXT "No new version. Actual version is %s\nForce update?")" "${2}"`" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ + --yesno "$(printf "$(TEXT "No new version. Actual version is %s\nForce update?")" "${2}")" 0 0 [ $? -ne 0 ] && return 1 fi - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --infobox "$(TEXT "Downloading last version")" 0 0 rm -f "/tmp/${4}.zip" - STATUS=`curl -kL -w "%{http_code}" "${PROXY}${3}/releases/download/${TAG}/${4}.zip" -o "/tmp/${4}.zip"` + STATUS=$(curl -kL -w "%{http_code}" "${PROXY}${3}/releases/download/${TAG}/${4}.zip" -o "/tmp/${4}.zip") if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --msgbox "$(TEXT "Error downloading new version")" 0 0 return 1 fi @@ -1421,19 +1474,19 @@ function downloadExts() { # 1 - ext name function updateArpl() { - T="`printf "$(TEXT "Update %s")" "${1}"`" - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + T="$(printf "$(TEXT "Update %s")" "${1}")" + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --infobox "$(TEXT "Extracting last version")" 0 0 unzip -oq /tmp/update.zip -d /tmp if [ $? -ne 0 ]; then - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --msgbox "$(TEXT "Error extracting update file")" 0 0 continue fi # Check checksums (cd /tmp && sha256sum --status -c sha256sum) if [ $? -ne 0 ]; then - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --msgbox "$(TEXT "Checksum do not match!")" 0 0 continue fi @@ -1442,12 +1495,12 @@ function updateArpl() { chmod +x /tmp/update-check.sh /tmp/update-check.sh if [ $? -ne 0 ]; then - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --msgbox "$(TEXT "The current version does not support upgrading to the latest update.zip. Please remake the bootloader disk!")" 0 0 continue fi fi - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --infobox "$(TEXT "Installing new files")" 0 0 # Process update-list.yml while read F; do @@ -1458,33 +1511,33 @@ function updateArpl() { if [ "${KEY: -1}" = "/" ]; then rm -Rf "${VALUE}" mkdir -p "${VALUE}" - tar -zxf "/tmp/`basename "${KEY}"`.tgz" -C "${VALUE}" + tar -zxf "/tmp/$(basename "${KEY}").tgz" -C "${VALUE}" else - mkdir -p "`dirname "${VALUE}"`" - mv "/tmp/`basename "${KEY}"`" "${VALUE}" + mkdir -p "$(dirname "${VALUE}")" + mv "/tmp/$(basename "${KEY}")" "${VALUE}" fi done < <(readConfigMap "replace" "/tmp/update-list.yml") - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ - --yesno "`printf "$(TEXT "Arpl updated with success to %s!\nReboot?")" "${TAG}"`" 0 0 + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ + --yesno "$(printf "$(TEXT "Arpl updated with success to %s!\nReboot?")" "${TAG}")" 0 0 [ $? -ne 0 ] && continue arpl-reboot.sh config } # 1 - ext name function updateExts() { - T="`printf "$(TEXT "Update %s")" "${1}"`" - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + T="$(printf "$(TEXT "Update %s")" "${1}")" + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --infobox "$(TEXT "Extracting last version")" 0 0 if [ "${1}" = "addons" ]; then rm -rf /tmp/addons mkdir -p /tmp/addons unzip /tmp/addons.zip -d /tmp/addons >/dev/null 2>&1 - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --infobox "$(TEXT "Installing new addons")" 0 0 rm -Rf "${ADDONS_PATH}/"* [ -f /tmp/addons/VERSION ] && cp -f /tmp/addons/VERSION ${ADDONS_PATH}/ - for PKG in `ls /tmp/addons/*.addon`; do - ADDON=`basename ${PKG} | sed 's|.addon||'` + for PKG in $(ls /tmp/addons/*.addon); do + ADDON=$(basename ${PKG} | sed 's|.addon||') rm -rf "${ADDONS_PATH}/${ADDON}" mkdir -p "${ADDONS_PATH}/${ADDON}" tar -xaf "${PKG}" -C "${ADDONS_PATH}/${ADDON}" >/dev/null 2>&1 @@ -1504,17 +1557,19 @@ function updateExts() { unzip /tmp/rp-lkms.zip -d "${LKM_PATH}" >/dev/null 2>&1 fi DIRTY=1 - dialog --backtitle "`backtitle`" --title "${T}" --aspect 18 \ + dialog --backtitle "$(backtitle)" --colors --title "${T}" \ --msgbox "$(TEXT "Addons updated with success!")" 0 0 } ############################################################################### function updateMenu() { - PLATFORM="`readModelKey "${MODEL}" "platform"`" - KVER="`readModelKey "${MODEL}" "builds.${BUILD}.kver"`" - PROXY="`readConfigKey "proxy" "${USER_CONFIG_FILE}"`"; [ -n "${PROXY}" ] && [[ "${PROXY: -1}" != "/" ]] && PROXY="${PROXY}/" + PLATFORM="$(readModelKey "${MODEL}" "platform")" + KVER="$(readModelKey "${MODEL}" "builds.${BUILD}.kver")" + PROXY="$(readConfigKey "proxy" "${USER_CONFIG_FILE}")" + [ -n "${PROXY}" ] && [[ "${PROXY: -1}" != "/" ]] && PROXY="${PROXY}/" while true; do - dialog --backtitle "`backtitle`" --menu "$(TEXT "Choose a option")" 0 0 0 \ + dialog --backtitle "$(backtitle)" --colors \ + --menu "$(TEXT "Choose a option")" 0 0 0 \ a "$(TEXT "Update arpl")" \ d "$(TEXT "Update addons")" \ m "$(TEXT "Update modules")" \ @@ -1524,111 +1579,111 @@ function updateMenu() { e "$(TEXT "Exit")" \ 2>${TMP_PATH}/resp [ $? -ne 0 ] && return - case "`<${TMP_PATH}/resp`" in - a) - T="`printf "$(TEXT "Update %s")" "$(TEXT "arpl")"`" - CURVER="${ARPL_VERSION:-0}" - downloadExts "arpl" ${CURVER} "https://github.com/wjz304/arpl-i18n" "update" - [ $? -ne 0 ] && continue - updateArpl "arpl" - ;; + case "$(<${TMP_PATH}/resp)" in + a) + T="$(printf "$(TEXT "Update %s")" "$(TEXT "arpl")")" + CURVER="${ARPL_VERSION:-0}" + downloadExts "arpl" ${CURVER} "https://github.com/wjz304/arpl-i18n" "update" + [ $? -ne 0 ] && continue + updateArpl "arpl" + ;; - d) - T="`printf "$(TEXT "Update %s")" "$(TEXT "addons")"`" - CURVER="`cat "/mnt/p3/addons/VERSION" 2>/dev/null`" - downloadExts "addons" "${CURVER:-0}" "https://github.com/wjz304/arpl-addons" "addons" - [ $? -ne 0 ] && continue - updateExts "addons" - ;; + d) + T="$(printf "$(TEXT "Update %s")" "$(TEXT "addons")")" + CURVER="$(cat "/mnt/p3/addons/VERSION" 2>/dev/null)" + downloadExts "addons" "${CURVER:-0}" "https://github.com/wjz304/arpl-addons" "addons" + [ $? -ne 0 ] && continue + updateExts "addons" + ;; - m) - T="`printf "$(TEXT "Update %s")" "$(TEXT "modules")"`" - CURVER="`cat "/mnt/p3/modules/VERSION" 2>/dev/null`" - downloadExts "modules" "${CURVER:-0}" "https://github.com/wjz304/arpl-modules" "modules" - [ $? -ne 0 ] && continue - updateExts "modules" - ;; + m) + T="$(printf "$(TEXT "Update %s")" "$(TEXT "modules")")" + CURVER="$(cat "/mnt/p3/modules/VERSION" 2>/dev/null)" + downloadExts "modules" "${CURVER:-0}" "https://github.com/wjz304/arpl-modules" "modules" + [ $? -ne 0 ] && continue + updateExts "modules" + ;; - l) - T="`printf "$(TEXT "Update %s")" "$(TEXT "LKMs")"`" - CURVER="`cat "/mnt/p3/lkms/VERSION" 2>/dev/null`" - downloadExts "LKMs" "${CURVER:-0}" "https://github.com/wjz304/redpill-lkm" "rp-lkms" - [ $? -ne 0 ] && continue - updateExts "LKMs" - ;; + l) + T="$(printf "$(TEXT "Update %s")" "$(TEXT "LKMs")")" + CURVER="$(cat "/mnt/p3/lkms/VERSION" 2>/dev/null)" + downloadExts "LKMs" "${CURVER:-0}" "https://github.com/wjz304/redpill-lkm" "rp-lkms" + [ $? -ne 0 ] && continue + updateExts "LKMs" + ;; - p) - RET=1 - while true; do - dialog --backtitle "`backtitle`" --title "$(TEXT "Set Proxy Server")" \ - --inputbox "$(TEXT "Please enter a proxy server url")" 0 0 "${PROXY}" \ - 2>${TMP_PATH}/resp - RET=$? - [ ${RET} -ne 0 ] && break - PROXY=`cat ${TMP_PATH}/resp` - if [ -z "${PROXYSERVER}" ]; then - break - elif [[ "${PROXYSERVER}" =~ "^(https?|ftp)://[^\s/$.?#].[^\s]*$" ]]; then - break - else - dialog --backtitle "`backtitle`" --title "$(TEXT "Alert")" \ - --yesno "$(TEXT "Invalid proxy server url, continue?")" 0 0 - RET=$? - [ ${RET} -eq 0 ] && break - fi - done - [ ${RET} -eq 0 ] && writeConfigKey "proxy" "${PROXY}" "${USER_CONFIG_FILE}" - ;; - - u) - if ! tty | grep -q "/dev/pts"; then - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 - return - fi - MSG="" - MSG+="$(TEXT "Please keep the attachment name consistent with the attachment name on Github.\n")" - MSG+="$(TEXT "Upload update.zip will update arpl.\n")" - MSG+="$(TEXT "Upload addons.zip will update Addons.\n")" - MSG+="$(TEXT "Upload modules.zip will update Modules.\n")" - MSG+="$(TEXT "Upload rp-lkms.zip will update LKMs.\n")" - dialog --backtitle "`backtitle`" --colors --aspect 18 \ - --msgbox "${MSG}" 0 0 - EXTS=("update.zip" "addons.zip" "modules.zip" "rp-lkms.zip") - TMP_UP_PATH=/tmp/users - USER_FILE="" - rm -rf ${TMP_UP_PATH} - mkdir -p ${TMP_UP_PATH} - pushd ${TMP_UP_PATH} - rz -be - for F in `ls -A`; do - for I in ${EXTS[@]}; do - [[ "${I}" == "${F}" ]] && USER_FILE=${F} - done - break - done - popd - if [ -z "${USER_FILE}" ]; then - dialog --backtitle "`backtitle`" --title "$(TEXT "Local upload")" --aspect 18 \ - --msgbox "$(TEXT "Not a valid file, please try again!")" 0 0 + p) + RET=1 + while true; do + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Update")" \ + --inputbox "$(TEXT "Please enter a proxy server url")" 0 0 "${PROXY}" \ + 2>${TMP_PATH}/resp + RET=$? + [ ${RET} -ne 0 ] && break + PROXY=$(cat ${TMP_PATH}/resp) + if [ -z "${PROXYSERVER}" ]; then + break + elif [[ "${PROXYSERVER}" =~ "^(https?|ftp)://[^\s/$.?#].[^\s]*$" ]]; then + break else - rm /tmp/${USER_FILE} - mv ${TMP_UP_PATH}/${USER_FILE} /tmp/${USER_FILE} - if [ "${USER_FILE}" = "update.zip" ]; then - updateArpl "arpl" - elif [ "${USER_FILE}" = "addons.zip" ]; then - updateExts "addons" - elif [ "${USER_FILE}" = "modules.zip" ]; then - updateExts "modules" - elif [ "${USER_FILE}" = "rp-lkms.zip" ]; then - updateExts "LKMs" - else - dialog --backtitle "`backtitle`" --title "$(TEXT "Local upload")" --aspect 18 \ - --msgbox "$(TEXT "Not a valid file, please try again!")" 0 0 - fi + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Update")" \ + --yesno "$(TEXT "Invalid proxy server url, continue?")" 0 0 + RET=$? + [ ${RET} -eq 0 ] && break fi - ;; - e) return ;; + done + [ ${RET} -eq 0 ] && writeConfigKey "proxy" "${PROXY}" "${USER_CONFIG_FILE}" + ;; + + u) + if ! tty | grep -q "/dev/pts"; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Update")" \ + --msgbox "$(TEXT "This feature is only available when accessed via web/ssh.")" 0 0 + return + fi + MSG="" + MSG+="$(TEXT "Please keep the attachment name consistent with the attachment name on Github.\n")" + MSG+="$(TEXT "Upload update.zip will update arpl.\n")" + MSG+="$(TEXT "Upload addons.zip will update Addons.\n")" + MSG+="$(TEXT "Upload modules.zip will update Modules.\n")" + MSG+="$(TEXT "Upload rp-lkms.zip will update LKMs.\n")" + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Update")" \ + --msgbox "${MSG}" 0 0 + EXTS=("update.zip" "addons.zip" "modules.zip" "rp-lkms.zip") + TMP_UP_PATH=/tmp/users + USER_FILE="" + rm -rf ${TMP_UP_PATH} + mkdir -p ${TMP_UP_PATH} + pushd ${TMP_UP_PATH} + rz -be + for F in $(ls -A); do + for I in ${EXTS[@]}; do + [[ "${I}" == "${F}" ]] && USER_FILE=${F} + done + break + done + popd + if [ -z "${USER_FILE}" ]; then + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Update")" \ + --msgbox "$(TEXT "Not a valid file, please try again!")" 0 0 + else + rm /tmp/${USER_FILE} + mv ${TMP_UP_PATH}/${USER_FILE} /tmp/${USER_FILE} + if [ "${USER_FILE}" = "update.zip" ]; then + updateArpl "arpl" + elif [ "${USER_FILE}" = "addons.zip" ]; then + updateExts "addons" + elif [ "${USER_FILE}" = "modules.zip" ]; then + updateExts "modules" + elif [ "${USER_FILE}" = "rp-lkms.zip" ]; then + updateExts "LKMs" + else + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Update")" \ + --msgbox "$(TEXT "Not a valid file, please try again!")" 0 0 + fi + fi + ;; + e) return ;; esac done } @@ -1644,53 +1699,89 @@ fi # Main loop NEXT="m" while true; do - echo "m \"$(TEXT "Choose a model")\"" > "${TMP_PATH}/menu" + echo "m \"$(TEXT "Choose a model")\"" >"${TMP_PATH}/menu" if [ -n "${MODEL}" ]; then - echo "n \"$(TEXT "Choose a Build Number")\"" >> "${TMP_PATH}/menu" + echo "n \"$(TEXT "Choose a Build Number")\"" >>"${TMP_PATH}/menu" if [ -n "${BUILD}" ]; then - echo "a \"$(TEXT "Addons")\"" >> "${TMP_PATH}/menu" - echo "o \"$(TEXT "Modules")\"" >> "${TMP_PATH}/menu" - echo "x \"$(TEXT "Cmdline menu")\"" >> "${TMP_PATH}/menu" - echo "i \"$(TEXT "Synoinfo menu")\"" >> "${TMP_PATH}/menu" + echo "a \"$(TEXT "Addons")\"" >>"${TMP_PATH}/menu" + echo "o \"$(TEXT "Modules")\"" >>"${TMP_PATH}/menu" + echo "x \"$(TEXT "Cmdline menu")\"" >>"${TMP_PATH}/menu" + echo "i \"$(TEXT "Synoinfo menu")\"" >>"${TMP_PATH}/menu" fi fi - echo "v \"$(TEXT "Advanced menu")\"" >> "${TMP_PATH}/menu" + echo "v \"$(TEXT "Advanced menu")\"" >>"${TMP_PATH}/menu" if [ -n "${MODEL}" ]; then if [ -n "${BUILD}" ]; then - echo "d \"$(TEXT "Build the loader")\"" >> "${TMP_PATH}/menu" + echo "d \"$(TEXT "Build the loader")\"" >>"${TMP_PATH}/menu" fi fi if loaderIsConfigured; then - echo "b \"$(TEXT "Boot the loader")\"" >> "${TMP_PATH}/menu" + echo "b \"$(TEXT "Boot the loader")\"" >>"${TMP_PATH}/menu" fi - echo "l \"$(TEXT "Choose a language")\"" >> "${TMP_PATH}/menu" - echo "k \"$(TEXT "Choose a keymap")\"" >> "${TMP_PATH}/menu" + echo "l \"$(TEXT "Choose a language")\"" >>"${TMP_PATH}/menu" + echo "k \"$(TEXT "Choose a keymap")\"" >>"${TMP_PATH}/menu" if [ ${CLEARCACHE} -eq 1 -a -d "${CACHE_PATH}/dl" ]; then - echo "c \"$(TEXT "Clean disk cache")\"" >> "${TMP_PATH}/menu" + echo "c \"$(TEXT "Clean disk cache")\"" >>"${TMP_PATH}/menu" fi - echo "p \"$(TEXT "Update menu")\"" >> "${TMP_PATH}/menu" - echo "e \"$(TEXT "Exit")\"" >> "${TMP_PATH}/menu" + echo "p \"$(TEXT "Update menu")\"" >>"${TMP_PATH}/menu" + echo "e \"$(TEXT "Exit")\"" >>"${TMP_PATH}/menu" - dialog --default-item ${NEXT} --backtitle "`backtitle`" --colors \ - --menu "$(TEXT "Choose the option")" 0 0 0 --file "${TMP_PATH}/menu" \ + dialog --backtitle "$(backtitle)" --colors \ + --default-item ${NEXT} --menu "$(TEXT "Choose the option")" 0 0 0 --file "${TMP_PATH}/menu" \ 2>${TMP_PATH}/resp [ $? -ne 0 ] && break - case `<"${TMP_PATH}/resp"` in - m) modelMenu; NEXT="n" ;; - n) buildMenu; NEXT="a" ;; - a) addonMenu; NEXT="o" ;; - o) moduleMenu; NEXT="x" ;; - x) cmdlineMenu; NEXT="i" ;; - i) synoinfoMenu; NEXT="v" ;; - v) advancedMenu; NEXT="d" ;; - d) make; NEXT="b" ;; - b) boot && exit 0 || sleep 5 ;; - l) languageMenu ;; - k) keymapMenu ;; - c) dialog --backtitle "`backtitle`" --title "$(TEXT "Cleaning")" --aspect 18 \ - --prgbox "rm -rfv \"${CACHE_PATH}/dl\"" 0 0 ;; - p) updateMenu ;; - e) break ;; + case $(<"${TMP_PATH}/resp") in + m) + modelMenu + NEXT="n" + ;; + n) + buildMenu + NEXT="a" + ;; + a) + addonMenu + NEXT="o" + ;; + o) + moduleMenu + NEXT="x" + ;; + x) + cmdlineMenu + NEXT="i" + ;; + i) + synoinfoMenu + NEXT="v" + ;; + v) + advancedMenu + NEXT="d" + ;; + d) + make + NEXT="b" + ;; + b) + boot && exit 0 || sleep 5 + ;; + l) + languageMenu + ;; + k) + keymapMenu + ;; + c) + dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Cleaning")" \ + --prgbox "rm -rfv \"${CACHE_PATH}/dl\"" 0 0 + ;; + p) + updateMenu + ;; + e) + break + ;; esac done clear