Compare commits

..

84 Commits

Author SHA1 Message Date
shenmo7192 7b06cf293b 修复 无法转换包的问题,提示需要安装dpkg;修复 apm debug 失效的问题 2025-10-31 13:04:38 +08:00
shenmo7192 137460768f update: APM upgrade notifier 2025-10-31 12:52:22 +08:00
shenmo7192 c3486af9a5 feat: 支持在fedora和arch上直接打包
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-30 07:24:47 +00:00
shenmo7192 9bbcb06c59 Revert "尝试让ace-run也挂载到系统的icon"
This reverts commit 5f55cf19360a891681bd787fafafe946adb5c1df.
2025-10-30 05:58:39 +00:00
shenmo7192 1c7ce04f42 update linyaps.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-30 05:01:43 +00:00
shenmo7192 d13b0b596b update linyaps.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-30 05:00:11 +00:00
shenmo7192 0d41828ece add linyaps.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-30 04:59:56 +00:00
shenmo7192 f8ce04cae3 尝试让ace-run也挂载到系统的icon
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-30 04:23:47 +00:00
shenmo7192 6b4d95b363 apm logo small
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-29 06:32:47 +00:00
shenmo7192 f9fd0020c2 删除部分无用文件;不再修改主机名 2025-10-29 11:12:47 +08:00
shenmo7192 7a0b949bd1 update Packaging-demo/README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-28 13:21:43 +00:00
shenmo7192 021279310f update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-28 11:38:15 +00:00
shenmo7192 338a3f5d93 支持 apm show 指令
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-28 11:14:15 +00:00
shenmo7192 48b0b0b5a1 update src/usr/bin/apm.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-28 11:09:33 +00:00
Ving 877bf82f6c !5 更新软件主图标与 README.md
* update README.md.
* update README.md.
* update README.md.
* update README.md.
* 删除文件 src/var/lib/apm/files/.keep
* 更新软件主图标
* 新建 files
* 更新软件主图标
2025-10-28 11:08:40 +00:00
shenmo7192 ac6846a64a update src/usr/bin/apm.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-28 08:32:24 +00:00
shenmo7192 b2ed2974b9 完成文档 2025-10-28 16:27:15 +08:00
shenmo7192 128944d7d4 修改文档 2025-10-28 16:23:34 +08:00
shenmo7192 910216a457 convert 只输入最表层的依赖
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-27 06:49:31 +00:00
shenmo7192 48b06ca964 1.0.10 2025-10-27 12:55:53 +08:00
shenmo7192 1cb22d8465 修复convert无法正确写入的问题 2025-10-27 12:54:49 +08:00
shenmo7192 0d368d73d9 写错了变量名称 2025-10-27 12:45:36 +08:00
shenmo7192 f73645a024 去除debug信息 2025-10-27 12:37:36 +08:00
shenmo7192 e46affc340 1.0.10 2025-10-27 12:36:48 +08:00
shenmo7192 c5fd74b513 更改spec以和实际一致 2025-10-27 11:42:05 +08:00
shenmo7192 1c492b165d 支持依赖解析 2025-10-27 11:29:37 +08:00
shenmo7192 737e7d4979 支持多层base加载 2025-10-27 10:44:58 +08:00
shenmo7192 379cd37fac 1.0.9 2025-10-27 09:58:09 +08:00
shenmo7192 a2f0af2ca7 支持 转换时多base 2025-10-27 09:56:06 +08:00
shenmo7192 5c811840fa 支持 多层 dir base 2025-10-27 09:42:25 +08:00
shenmo7192 a615cf0b72 修改彩蛋 2025-10-27 09:26:07 +08:00
shenmo7192 8736cf13b8 update src/usr/bin/amber-pm-convert.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-25 17:18:11 +00:00
shenmo7192 9702df0410 修复自动刷新软件源的问题 2025-10-26 00:41:19 +08:00
shenmo7192 9708cd7034 1.0.8.1 支持银河麒麟 2025-10-26 00:36:27 +08:00
shenmo7192 efa5204b53 删除GXDE Fixer 服务 2025-10-24 14:12:27 +08:00
shenmo7192 8c6ed8b965 update: eggs 2025-10-24 14:10:40 +08:00
shenmo7192 8d49cec009 1.0.8 修复GXDE上无法选择 2025-10-24 13:41:56 +08:00
shenmo7192 4aaef32ba9 写错了链接地址 2025-10-24 12:02:56 +08:00
shenmo7192 e088cca383 use data dir to avoid errors in DATA_DIRS 2025-10-24 11:58:53 +08:00
shenmo7192 03ae4e6129 update xz-utils 2025-10-24 10:49:11 +08:00
shenmo7192 e8c3ab67dd 更新 convert 2025-10-24 10:14:00 +08:00
shenmo7192 87342fdabd apm convert 用ssaudit 安装
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-23 15:32:35 +00:00
shenmo7192 c842ff767f 1.0.7.2-1 正确地清理卸载目录 2025-10-23 20:47:42 +08:00
shenmo7192 ee9908ed16 update tips 2025-10-22 18:55:21 +08:00
shenmo7192 0485303c1b Merge remote-tracking branch 'refs/remotes/origin/master' 2025-10-22 15:23:45 +08:00
shenmo7192 985c23a3f9 1072 2025-10-22 15:23:33 +08:00
shenmo7192 616a305739 update src/usr/bin/amber-pm-convert.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-22 07:12:50 +00:00
shenmo7192 fdf96c7fab rename 2025-10-22 14:41:23 +08:00
shenmo7192 993b220ef4 自带convert 2025-10-22 14:24:37 +08:00
shenmo7192 340811523c update:清理容器 2025-10-22 14:23:23 +08:00
shenmo7192 9b3f8acc58 更新convert 2025-10-22 14:14:53 +08:00
shenmo7192 b2dd1d2bd3 1072 支持服务器转制 2025-10-22 14:12:52 +08:00
shenmo7192 d85a84fed1 正确报错 2025-10-22 13:15:33 +08:00
shenmo7192 d9548f9f39 正确报错 2025-10-22 13:14:54 +08:00
shenmo7192 41aede9bbe 1.0.7.1 ubuntu fix 2025-10-22 12:58:04 +08:00
shenmo7192 7f1851b5cc 1.0.7 修复直接安装在主机时无法找到图标 2025-10-22 12:29:16 +08:00
shenmo7192 ba292e3870 微调dstore patch 2025-10-22 11:24:15 +08:00
shenmo7192 f22f0c95fa Merge remote-tracking branch 'refs/remotes/origin/master' 2025-10-22 10:48:42 +08:00
shenmo7192 8988e94ad1 update depends 2025-10-22 10:48:24 +08:00
shenmo7192 8c780d8c80 update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-22 02:41:40 +00:00
shenmo7192 ea0c263bf9 add LICENSE.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-22 02:30:29 +00:00
shenmo7192 f8e0667b1b 更新 apm run 自动补全 2025-10-22 00:31:28 +08:00
shenmo7192 785b83b15b 微调apm 2025-10-22 00:05:13 +08:00
shenmo7192 f999da97c8 补充命令 2025-10-22 00:02:58 +08:00
shenmo7192 a27df804f2 update 2025-10-21 23:58:38 +08:00
shenmo7192 ff73778e4b 支持绝对路径图表 2025-10-21 23:56:14 +08:00
shenmo7192 365e31677b update 1.0.5 2025-10-21 23:45:15 +08:00
shenmo7192 486d1d6d5f converter 完成 2025-10-21 23:42:33 +08:00
shenmo7192 45250753db 明天再修,先解压再提取文件 2025-10-21 20:52:39 +08:00
shenmo7192 e754932ba3 自动转换器 2025-10-21 20:45:57 +08:00
shenmo7192 091176d017 src update 2025-10-21 20:00:21 +08:00
shenmo7192 dfae67271b update tips 2025-10-21 19:59:33 +08:00
shenmo7192 7900e8af3b update tips.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-20 14:40:12 +00:00
shenmo7192 bb7ee02aec update tips.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-20 14:02:34 +00:00
shenmo7192 e771446966 update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-20 14:00:59 +00:00
shenmo7192 bb5bae062d update tips.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-20 13:56:47 +00:00
shenmo7192 f0ccb2f7ed update tips.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-20 12:55:31 +00:00
shenmo7192 092fb41740 update tips.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-19 12:49:53 +00:00
shenmo7192 c1b464be04 update tips.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-10-19 12:48:29 +00:00
shenmo7192 a34e9264a9 update tips 2025-10-19 20:46:45 +08:00
shenmo7192 f696793572 update trigger 2025-10-19 20:13:56 +08:00
shenmo7192 be5954c95e update tips 2025-10-19 19:46:11 +08:00
shenmo7192 90553f6737 tips 2025-10-19 19:32:36 +08:00
shenmo7192 af20707f71 update readme 2025-10-19 02:15:18 +08:00
68 changed files with 4934 additions and 20 deletions
+661
View File
@@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
+141
View File
@@ -0,0 +1,141 @@
# APM 软件包打包流程
本文档为开发者准备,若您只是想从 deb 软件包打包 APM 软件包,您可以通过 `amber-pm-convert`指令进行全自动一键转换
通过 `apm search amber-pm- ` 即可搜索到所有可用的 base 列表
---
## APM 软件包结构规范
在阅读前,请确保您对overlayfs有了基本的了解
overlayfs 原理解析:https://www.cnblogs.com/arnoldlu/p/13055501.html
---
一个典型的 APM 软件/中层依赖包应当包含以下内容
```
├── DEBIAN
│ ├── control
│ └── postinst
└── var
└── lib
└── apm
└── eom
├── entries
│ ├── applications
│ ├── doc
│ ├── glib-2.0
│ └── man
├── files
│ ├── core
│ └── work
├── info
└── info_debug
```
* DEBIAN目录包含了软件包的基本信息和依赖的环境信息
1. 以下是 control 文件的内容
```
Package: eom
Version: 1.26.0-2-apm
Architecture: amd64
Maintainer: APM Converter <apm-convert@spark-app.store>
Depends: amber-pm-bookworm
Installed-Size: 45228
Description: APM converted package from eom
This package was automatically converted from the original deb package.
Based on: amber-pm-bookworm
```
Package: 包名。应当唯一。若使用转换器进行转换,默认和原包名一致
Version: 版本号。若使用转换器进行转换,默认在原版本号后加`-apm`
Architecture: 软件包架构。同 dpkg 进行填写即可。若使用转换器进行转换,默认和原包架构一致
Depends: 依赖包。填写直接依赖的base即可
Installed-Size: 安装后的大小。若使用转换器进行转换,会自动填写
Description: 包描述。若使用转换器进行转换,会自动填写
2. 以下是 postinst 文件内容
```
#!/bin/bash
PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
echo "清理卸载残留"
rm -rf "/var/lib/apm/$PACKAGE_NAME"
else
echo "非卸载,跳过清理"
fi
```
若无特殊需求,内容保持一致即可,用于在卸载软件包后清理环境
* /var/lib/apm 包含了APM 软件容器的文件和信息
软件应当被放置在 /var/lib/apm/软件包名/ 处
此处有两个目录,两个文件
entries 可选,包含了软件包需要被放到 /usr/share/ 的文件,如 desktop icon 等
files 必须,包含了软件包的 upperdir 和 workdir
info 必须,包含了直接依赖的base信息。若应用使用了多层的依赖,会一层一层寻找info信息,直到找到底层依赖
info_debug 可选,包含了打包时解析的依赖信息
entries下的内容同软件需要放置到 /usr/share/ 下的内容
> 注意: .desktop 文件应当新加一行 X-APM-APPID=包名 来允许软件管理器管理
files的内容请见下一节
## APM upperdir 制作流程
以下为手动制作 upperdir 的流程
首先,安装 apm 并使用`sudo apm install` 安装你所需要的 base
随后,新建三个文件夹,corework 和 ace-env ,执行
`sudo mount -t overlay overlay -o lowerdir='/var/lib/apm/apm/files/ace-env/var/lib/apm/base包的包名(如amber-pm-trixie/files/ace-env',upperdir=core/,workdir=work/ ./ace-env`
随后chroot进入进行安装操作,直接进行 apt install 或者其他都可以,完成后解除挂载 ./ace-env
你便得到了:
* core: 保存新增文件
* work: 保存变更信息
需把这两个目录重新拥有并权限换成755后放入对应的目录进行 apm 打包
你也可以测试一下刚刚打包的软件
fuse-overlayfs -o lowerdir='/var/lib/apm/apm/files/ace-env/var/lib/apm/base包的包名(如amber-pm-trixie/files/ace-env',upperdir=core/,workdir=work/ ./ace-env
即可只读挂载。这一步 apm run 包名 会帮你做好。
> apm run 包名: 寻找 /var/lib/apm/包名/是否存在。若存在,根据info文件合成 fuser-overlayfs 参数进行挂载,随后用ACE工具chroot进入进行启动
./ace-run 即可进入,可以尝试启动一下刚刚安装的应用
## APM 打包
使用 `dpkg-deb --build 软件包目录 输出目录` 即可进行打包
## APM 底层 Base Runtime 的构建
详见 https://gitee.com/amber-ce/amber-pm-common
View File
+65 -20
View File
@@ -1,33 +1,78 @@
# APM 原理和软件包制作流程
<div align="center">
<img src="https://gitee.com/possibleving/amber-pm/raw/master/amber-pm-logo.png" alt="软件主图标" width="200" height="200"/>
</div>
制作apm包upperdir的流程
# <p align="center">APM 琥珀软件包管理器</p>
先安装base包(从release
## 简介
sudo mount -t overlay overlay -o lowerdir='/var/lib/apm/amber-pm-trixie-host/files/ace-env',upperdir=core/,workdir=work/ ./ace-env
APM 是一款基于 fuse-overlayfsdpkgAmberCE 容器的软件包管理系统,支持在 DebianFedoraArch Linux 等发行版上运行。
随后chroot进入进行安装操作,直接进行 apt install 或者其他都可以,完成后
APM 目前提供 Debian 12/13 与 deepin 25 基础环境,支持将适配以上环境的应用转换为 APM 应用。
core: 保存新增文件
work: 保存变更信息
需把这两个目录重新拥有并权限换成755
> APM 会自动从主机获取 NVIDIA 驱动文件,因此您无需担心 N 卡加速问题;
>
> 您可在 [src](src/) 目录找到 APM 的源代码;
>
> OverlayFS 原理解析:[https://www.cnblogs.com/arnoldlu/p/13055501.html](https://www.cnblogs.com/arnoldlu/p/13055501.html)。
## 使用方法
```
APM - Amber Package Manager 1.0.10
fuse-overlayfs -o lowerdir='/var/lib/apm/amber-pm-trixie-host/files/ace-env',upperdir=core/,workdir=work/ ./ace-env
Usage:
apm [COMMAND] [OPTIONS] [PACKAGES...]
即可只读挂载并进行ace操作
Commands:
install 安装软件包
remove 卸载软件包
update 更新软件包信息
list 查看可用软件包信息
show 查看软件包信息
search 搜索软件包
download 下载包
clean 清除缓存软件包
autoremove 自动移除不需要的包
full-upgrade 完全升级软件包
run <package> 运行指定软件包的可执行文件
ssaudit <path> 使用 ssaudit 进行本地软件安装,详情见 spark-store
debug 显示调试系统信息并进入调试环境
amber 彩蛋功能
xmp360 彩蛋功能
bronya 彩蛋功能
spec
对于lowerdir
/var/lib/apm/包名/files/ace-env 是 lowerdir
-h, --help 显示此帮助信息
对于upperdir
/var/lib/apm/包名/files/core是upperdir
/var/lib/apm/包名/files/work是upperdir的work
/var/lib/apm/包名/files/ace-env是chroot进的目录(需要在打包好的包内加上允许读写这个目录——或者后续换成tmp的挂载点)
/var/lib/apm/包名/info是配置信息,目前只写了依赖的base,后续可以定义默认启动指令等
/var/lib/apm/包名/entries是desktop位置,后续会加到自动展示中
```
apm run 包名: 寻找 /var/lib/apm/包名/是否存在。若存在,根据info文件合成 fuser-overlayfs 参数进行挂载,随后用ACE工具chroot进入进行启动
## APM Deb 包全自动转换器使用方法
```
用法: amber-pm-convert --base <basename> [--base <basename> ...] <deb文件路径> [--pkgname <包名>] [--version <版本号>]
参数说明:
--basename 必填参数,指定基础环境名称,可多次使用指定多个基础环境
deb文件路径 必填参数,要转换的 Deb 文件路径
--pkgname 可选参数,指定新包的包名(默认使用原 Deb 包名)
--version 可选参数,指定新包的版本号(默认在原版本后追加'-apm'
示例:
amber-pm-convert --base amber-pm-trixie /path/to/package.deb
amber-pm-convert --base amber-pm-bookworm-spark-wine /path/to/package.deb --pkgname new-pkg --version 1.0.0
最下层的 base 在最后,从上到下写 base
```
> 注意:APM 软件包为特殊的 Deb 软件包,因此若您在使用 Debian 或其他使用 dpkg 管理软件包的发行版,也可使用 apt 直接将 APM 软件包安装至系统中,同样可供使用。对于此种情况,请使用系统自带的 apt 进行软件包管理。
## APM 的原理和软件包的介绍
详见 [Packaging-demo](Packaging-demo)。
## APM 构建 Tips
APM 使用了特殊的精简版 AmberCE 兼容环境,相关的 Tips 见 [Tips](tips.md)。
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

+9
View File
@@ -0,0 +1,9 @@
Package: apm
Version: 1.1
Maintainer: shenmo <jifengshenmo@outlook.com>
Priority: optional
Section: utils
Installed-Size: 36
Description: A empty package to satisfy depends
Architecture: all
Homepage: https://shenmo7192.gitee.io/
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
export PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
case "$1" in
triggered)
amber-pm-dstore-patch
;;
esac
true
+1
View File
@@ -0,0 +1 @@
interest-noawait /var/lib/apm
+174
View File
@@ -0,0 +1,174 @@
#!/bin/bash
enumAppInfoList() {
appInfoList=()
apps="/var/lib/apm"
list=$(ls $apps 2>/dev/null)
for appID in $list; do
appInfoList+=("$appID")
done
echo "${appInfoList[@]}"
}
linkDir() {
ensureTargetDir() {
targetFile=$1
t=$(dirname "$targetFile")
mkdir -p "$t"
}
source=$1
target=$2
sourceDir=$(dirname "$source")
targetDir=$(dirname "$target")
find "$source" -type f | while read sourceFile; do
targetFile="$targetDir/${sourceFile#$sourceDir/}"
ensureTargetDir "$targetFile"
sourceFile=$(realpath --relative-to="$(dirname $targetFile)" "$sourceFile" )
if [ ! -e ${targetFile} ];then
ln -sv "$sourceFile" "$targetFile"
fi
done
}
linkApp() {
appID=$1
appEntriesDir="/var/lib/apm/$appID/entries"
appLibsDir="/var/lib/apm/$appID/files/lib"
autoStartDir="$appEntriesDir/autostart"
if [ -d "$autoStartDir" ]; then
linkDir "$autoStartDir" "/etc/xdg/autostart"
fi
# link application
sysShareDir="/usr/share"
for folder in "$appEntriesDir/applications" "$appEntriesDir/icons" "$appEntriesDir/mime" "$appEntriesDir/glib-2.0" "$appEntriesDir/services" "$appEntriesDir/GConf" "$appEntriesDir/help" "$appEntriesDir/locale" "$appEntriesDir/fcitx"; do
if [ ! -d "$folder" ]; then
continue
fi
if [ "$folder" = "$appEntriesDir/polkit" ]; then
linkDir "$folder" "/usr/share/polkit-1"
elif [ "$folder" = "$appEntriesDir/fonts/conf" ]; then
linkDir "$folder" "/etc/fonts/conf.d"
else
linkDir "$folder" "$sysShareDir/${folder##*/}"
fi
done
}
function exec_uos_package_link(){
for app in $(enumAppInfoList); do
linkApp "$app" &
done
wait
}
function exec_v23_icon_link(){
# Fix v23 broken icon
if [ ! -d "/usr/share/icons/hicolor/scalable/apps" ];then
mkdir -p /usr/share/icons/hicolor/scalable/apps
fi
for icon_root_icon_path in $(ls /usr/share/icons/*.png /usr/share/icons/*.svg 2>/dev/null)
do
target_icon_path=/usr/share/icons/hicolor/scalable/apps/$(basename ${icon_root_icon_path})
if [ ! -e ${target_icon_path} ];then
ln -sv $(realpath --relative-to=/usr/share/icons/hicolor/scalable/apps ${icon_root_icon_path}) /usr/share/icons/hicolor/scalable/apps
fi
done
}
function exec_link_clean(){
# remove broken links in /usr/share
find /usr/share/applications -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/icons -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/mime/packages -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/glib-2.0 -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/dbus-1/services -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/help -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/locale -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/lib/$(gcc -dumpmachine)/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/lib/mozilla/plugins -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/polkit-1/actions -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/fonts -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /etc/fonts/conf.d -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
}
function exec_uos_package_update(){
update-icon-caches /usr/share/icons/* > /dev/null 2>&1 &
update-desktop-database -q > /dev/null 2>&1 &
update-mime-database -V /usr/share/mime > /dev/null 2>&1 &
glib-compile-schemas /usr/share/glib-2.0/schemas/ > /dev/null 2>&1 &
}
function exec_debian_compatibile_links(){
# 源目录和目标目录定义
local SOURCE_DIR="/var/lib/apm"
local TARGET_DIR="/var/lib/apm/apm/files/ace-env/var/lib/apm"
# 检查目标目录是否存在
if [[ ! -d "$TARGET_DIR" ]]; then
mkdir -p $TARGET_DIR
fi
# 第一部分:为缺失的目录创建软链接
echo "检查并创建缺失的软链接..."
for dir in "$SOURCE_DIR"/*/; do
# 获取目录名(去掉路径和尾部斜杠)
dirname=$(basename "$dir")
# 跳过 apm 目录
if [[ "$dirname" == "apm" ]]; then
continue
fi
# 检查目标目录中是否已存在对应的软链接或目录
target_link="$TARGET_DIR/$dirname"
if [[ ! -e "$target_link" ]]; then
echo "创建软链接: $target_link -> $dir"
ln -sv "$dir" "$target_link"
fi
done
# 第二部分:清理无效的软链接
echo "清理无效的软链接..."
for link in "$TARGET_DIR"/*; do
# 检查是否为软链接
if [[ -L "$link" ]]; then
# 检查软链接是否有效(指向的目标是否存在)
if [[ ! -e "$link" ]]; then
echo "删除无效软链接: $link"
rm "$link"
fi
fi
done
}
#########################################################################################
echo "----------------Running APM Dstore Patch----------------"
# execute linkApp function for each app and print output
exec_uos_package_link
#exec_v23_icon_link
exec_link_clean
wait
exec_uos_package_update
if [[ "${IS_APM_ENV}" = "" ]];then
exec_debian_compatibile_links
fi
echo "----------------Finished----------------"
+34
View File
@@ -0,0 +1,34 @@
玲珑官方搞了个这玩意,APM用户这边有人想要那我就写了,其实意义不大
好用就完了,APM又快又简单
| 特性 | 如意玲珑 | 琥珀 APM | Snap | AppImage |
| ------------------------- | ------------------------------- | ------------- | ---------------- | -------------------------------------- |
| 打包桌面应用 | ✔ | ✔ | ✔ | ✔ |
| 打包终端应用 | ✔ | ✔ | ✔ | ✔ |
| 处理服务器应用 | ✔ | ✔ | ✔ | ✘ |
| 打包系统服务(root 权限) | ✘ | ✘ | ✔ | ✘ |
| 主题功能正常 | ✔ | ✔ | ✔ | ✔ |
| 提供库托管服务 | ✔ | ✔ | ✘ | ✘ |
| 库/依赖来源 | 包自身携带 | 包自身携带或使用 APM 中层 Base,用法详见[链接](https://bbs.deepin.org.cn/post/292648) | | |
| SDK | 包自身携带 | 无需专用SDK,复用Debian即可 | | |
| 商业支持 | ✔ | ✘ | ✔ | ✘ |
| 应用商店数量 | 预计 4700+ | 200+常用软件,持续扩充中 | 6600+ | 1300+ |
| 开发工具支持 | linglong-builder | 任意支持部署到debian的工具均支持 | electron-builder | |
| 容器支持 | ✔ | ✔ | ✔ | ◐ (官方不提供,技术上可行) |
| rootless 容器 | ✔ | ✔ | ✘ | ✘ |
| 不安装运行 | ✔ (提供 Bundle 模式) | ◐ (官方不提供,技术上可行) | ✘ | ✔ |
| 不解压运行 | ✔ (提供 Bundle 模式) | ◐ (官方不提供,技术上可行) | ✔ | ✔ |
| 自分发/绿色格式分发 | ✔ | ◐ (官方不提供,技术上可行) | ✘ | ✔ |
| 支持 Wine 应用运行 | ✔ | ✔ | ◐ (理论可行) | ◐ (使用 LD 修改 open 调用,兼容性差) |
| 离线环境支持 | ✔ | ✔ | ✔ | ✔ |
| 权限管理 | ✔ | ✘ | ✔ | ✘ |
| 中心仓库 | mirror-repo-linglong.deepin.com | 星火应用商店 | Snap Store | AppImageHub |
| 多版本共存 | ✔ | ✔ | ✔ | ✔ |
| 点对点分发 | ✔ | ✔ | ✔ | ✔ |
| 多镜像源加速分发 | ✘ | ✔ | ✘ | ◐ (官方不提供,技术上可行) |
| 作为普通安装包直接安装到宿主机 | ✘ | ✔ | ✘ | ✘ |
| 自定义生成 runtime base | ✘ | ✔ | ✘ | ✘ |
| 多级layer自动管理 | ◐ (理论可行) | ✔ | ✘ | ✘ |
| 一键直接转换 Debian 标准软件包 | ✘ | ✔ | ✘ | ✘ |
| 应用升级 | 仓库升级 | 仓库升级 | 仓库升级 | 官方工具升级 |
+13
View File
@@ -0,0 +1,13 @@
Package: apm
Source: amber-ce
Version: 1.1.1
Architecture: amd64
Maintainer: shenmo <shenmo@spark-app.store>
Installed-Size: 48724
Depends: bubblewrap, flatpak, policykit-1 | pkexec | polkit-1 | polkit, systemd, procps,coreutils,fuse-overlayfs,xz-utils,libnotify-bin,curl
Section: misc
Conflicts: ace-host-integration
Priority: optional
Multi-Arch: foreign
Homepage: https://gitee.com/amber-ce/amber-pm/
Description: bwrap wrapper for install and running debs inside a Amber-PM container
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
export PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
case "$1" in
configure)
/var/lib/apm/$PACKAGE_NAME/files/bin/ace-init
systemctl daemon-reload
systemctl enable apm-daily-update
systemctl start apm-daily-update
systemctl restart apparmor.service || true
if [ -f /usr/lib/sysctl.d/apm.conf ];then
sysctl -p /usr/lib/sysctl.d/apm.conf
fi
;;
triggered)
amber-pm-configure-nvidia-host
amber-pm-dstore-patch
;;
esac
true
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
systemctl stop apm-daily-update
systemctl disable apm-daily-update
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
echo "清理卸载残留"
rm -rf /var/lib/apm/
else
echo "非卸载,跳过清理"
fi
+1
View File
@@ -0,0 +1 @@
interest-noawait /var/lib/apm
+17
View File
@@ -0,0 +1,17 @@
# Ensure base distro defaults xdg path are set if nothing filed up some
# defaults yet.
if [ -z "$XDG_DATA_DIRS" ]; then
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
fi
# Desktop files (used by desktop environments within both X11 and Wayland) are
# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for ACE
ACE_path="/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/"
if [ -n "${XDG_DATA_DIRS##*${ACE_path}}" ] && [ -n "${XDG_DATA_DIRS##*${ACE_path}:*}" ]; then
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${ACE_path}"
fi
+9
View File
@@ -0,0 +1,9 @@
abi <abi/4.0>,
include <tunables/global>
profile bwrap /usr/bin/bwrap flags=(unconfined) {
userns,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/bwrap>
}
+16
View File
@@ -0,0 +1,16 @@
# Ensure base distro defaults xdg path are set if nothing filed up some
# defaults yet.
if [ -z "$XDG_DATA_DIRS" ]; then
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
fi
# Desktop files (used by desktop environments within both X11 and Wayland) are
# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for ACE
ACE_path="/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/"
if [ -n "${XDG_DATA_DIRS##*${ACE_path}}" ] && [ -n "${XDG_DATA_DIRS##*${ACE_path}:*}" ]; then
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${ACE_path}"
fi
+1
View File
@@ -0,0 +1 @@
../../var/lib/apm/apm/files/bin/amber-ce-configure-nvidia
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
APM_BASE="/var/lib/apm"
# 遍历 /var/lib/apm 下的所有目录
for dir in "$APM_BASE"/*/; do
# 移除末尾的斜杠获取目录名
dirname=$(basename "$dir")
# 跳过名为 "apm" 的目录
if [[ "$dirname" == "apm" ]]; then
continue
fi
# 检查是否存在 /var/lib/apm/目录名/files/ace-env
if [[ -f "$dir/files/ace-env" ]]; then
echo "执行 apm-configure-nvidia: $dir"
amber-pm-configure-nvidia "$dir/files/ace-env"
fi
done
+403
View File
@@ -0,0 +1,403 @@
#!/bin/bash
# APM软件包转换器 - 将DEB包转换为APM格式
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
SCRIPT_NAME=$(basename "$0")
if ! command -v dpkg > /dev/null ;then
log.error "若想使用APM软件包转换器,您需先安装dpkg"
exit 1
fi
# 显示用法信息
usage() {
echo "用法: $SCRIPT_NAME --base <basename> [--base <basename> ...] <deb文件路径> [--pkgname <包名>] [--version <版本号>]"
echo ""
echo "参数说明:"
echo " --basename 必填参数,指定基础环境名称,可多次使用指定多个基础环境"
echo " deb文件路径 必填参数,要转换的DEB文件路径"
echo " --pkgname 可选参数,指定新包的包名(默认使用原DEB包名)"
echo " --version 可选参数,指定新包的版本号(默认在原版本后追加'-apm'"
echo ""
echo "示例:"
echo " $SCRIPT_NAME --base amber-pm-trixie /path/to/package.deb"
echo " $SCRIPT_NAME --base amber-pm-bookworm-spark-wine /path/to/package.deb --pkgname new-pkg --version 1.0.0"
echo "最下层的base在最后面,从上到下写base"
}
# 检查参数数量
if [ $# -lt 3 ]; then
log.error "错误:参数不足"
usage
exit 1
fi
# 解析参数
BASENAMES=() # 改为数组存储多个base
DEB_PATH=""
PKGNAME=""
VERSION=""
# 参数解析
while [ $# -gt 0 ]; do
case $1 in
--base)
BASENAMES+=("$2")
BASENAMES_ORIG+=("$2")
shift 2
;;
--pkgname)
PKGNAME="$2"
shift 2
;;
--version)
VERSION="$2"
shift 2
;;
*)
if [ -z "$DEB_PATH" ] && [ -f "$1" ]; then
DEB_PATH="$1"
shift
else
log.error "错误:未知参数或无效的DEB文件路径: $1"
usage
exit 1
fi
;;
esac
done
# 检查必填参数
if [ ${#BASENAMES[@]} -eq 0 ] || [ -z "$DEB_PATH" ]; then
log.error "错误:至少需要一个--basename参数,且DEB文件路径为必填"
usage
exit 1
fi
# 检查DEB文件是否存在
if [ ! -f "$DEB_PATH" ]; then
log.error "错误:DEB文件不存在: $DEB_PATH"
exit 1
fi
log.info "开始转换DEB包: $DEB_PATH"
log.info "基础环境数量: ${#BASENAMES[@]}"
for i in "${!BASENAMES[@]}"; do
log.info " 基础环境 $((i+1)): ${BASENAMES[$i]}"
done
# 1. 创建临时工作目录
CRAFT_DIR="$HOME/apm-craft-$$"
log.info "创建临时工作目录: $CRAFT_DIR"
mkdir -p "$CRAFT_DIR"/{core,work,mergedir,modified_deb}
# 设置环境变量
export CRAFT_DIR
# 检查是否已挂载,避免重复挂载
cleanup_mount() {
if mountpoint -q "$CRAFT_DIR/mergedir"; then
log.info "解除挂载: $CRAFT_DIR/mergedir"
sudo umount "$CRAFT_DIR/mergedir" || true
fi
}
# 清理函数
cleanup() {
log.info "开始清理..."
cleanup_mount
if [ -d "$CRAFT_DIR" ]; then
log.info "删除临时目录: $CRAFT_DIR"
sudo rm -rf "$CRAFT_DIR"
fi
}
# 设置退出时清理
trap cleanup EXIT
# 递归获取info文件中的依赖
get_recursive_basenames() {
local basename="$1"
local base_dir="/var/lib/apm/apm/files/ace-env/var/lib/apm/$basename"
local info_file="$base_dir/info"
if [ -f "$info_file" ]; then
log.info "读取info文件: $info_file"
while IFS= read -r base; do
# 跳过空行
[[ -z "$base" ]] && continue
# 如果依赖的base没有被记录过,则递归添加
if [[ ! " ${BASENAMES[*]} " =~ " $base " ]]; then
BASENAMES+=("$base")
# 递归获取依赖
get_recursive_basenames "$base"
fi
done < "$info_file"
else
log.info "未找到info文件,跳过: $info_file"
fi
}
# 递归获取所有基础环境
for BASE in "${BASENAMES[@]}"; do
get_recursive_basenames "$BASE"
done
# 检查DEB文件
log.info "检查原DEB包信息..."
ORIG_PKGNAME=$(dpkg -f "$DEB_PATH" Package)
ORIG_VERSION=$(dpkg -f "$DEB_PATH" Version)
ORIG_ARCH=$(dpkg -f "$DEB_PATH" Architecture)
log.info "原包名: $ORIG_PKGNAME"
log.info "原版本: $ORIG_VERSION"
log.info "原架构: $ORIG_ARCH"
# 设置新包名和版本
NEW_PKGNAME="${PKGNAME:-$ORIG_PKGNAME}"
NEW_VERSION="${VERSION:-${ORIG_VERSION}-apm}"
log.info "新包名: $NEW_PKGNAME"
log.info "新版本: $NEW_VERSION"
log.info "新架构: $ORIG_ARCH"
# 2. 构建lowerdir路径(多个base按顺序叠放)
log.info "构建overlay lowerdir路径..."
LOWERDIRS=()
# 按顺序处理每个base(从第一个到最后一个,最后一个在最底层)
for BASENAME in "${BASENAMES[@]}"; do
ACE_ENV_PATH="/var/lib/apm/apm/files/ace-env/var/lib/apm/${BASENAME}/files/ace-env"
CORE_PATH="/var/lib/apm/apm/files/ace-env/var/lib/apm/${BASENAME}/files/core"
if [ -d "$ACE_ENV_PATH" ]; then
log.info "使用ace-env路径: $ACE_ENV_PATH"
LOWERDIRS+=("$ACE_ENV_PATH")
elif [ -d "$CORE_PATH" ]; then
log.info "使用core路径: $CORE_PATH"
LOWERDIRS+=("$CORE_PATH")
else
log.error "错误:基础环境路径不存在: $BASENAME"
log.error " 检查的路径: $ACE_ENV_PATH"
log.error " 检查的路径: $CORE_PATH"
exit 1
fi
done
# 将lowerdirs数组用冒号连接
LOWERDIR=$(IFS=:; echo "${LOWERDIRS[*]}")
log.debug "最终lowerdir: $LOWERDIR"
# 4. 进行融合挂载
log.info "正在进行融合挂载..."
sudo mount -t overlay overlay \
-o "lowerdir=$LOWERDIR,upperdir=$CRAFT_DIR/core/,workdir=$CRAFT_DIR/work/" \
"$CRAFT_DIR/mergedir"
log.info "挂载完成"
# 5. 在融合环境中安装修改后的DEB包
log.info "在融合环境中测试安装DEB包..."
# 更新包列表
export chrootEnvPath="$CRAFT_DIR/mergedir"
sudo -E /var/lib/apm/apm/files/ace-run-pkg aptss update
# 首先进行dry-run检查
log.info "进行安装前检查..."
if ! sudo -E /var/lib/apm/apm/files/ace-run-pkg aptss install "$DEB_PATH" --dry-run; then
log.error "错误:安装前检查失败,DEB包可能无法在基础环境中安装"
log.error "请检查依赖关系或基础环境是否兼容"
exit 1
fi
log.info "安装前检查通过,准备实际安装..."
# 6. 提取并修改DEB包
log.info "提取并修改原DEB包..."
EXTRACT_DIR="$CRAFT_DIR/extract"
MODIFIED_DEB_DIR="$CRAFT_DIR/modified_deb"
mkdir -p "$EXTRACT_DIR"
mkdir -p "$MODIFIED_DEB_DIR/DEBIAN"
# 解压DEB包
dpkg -x "$DEB_PATH" "$EXTRACT_DIR"
dpkg -e "$DEB_PATH" "$MODIFIED_DEB_DIR/DEBIAN"
# 处理.desktop文件
DESKTOP_MODIFIED=false
find "$EXTRACT_DIR" -name "*.desktop" | while read -r desktop_file; do
log.info "处理桌面文件: $desktop_file"
DESKTOP_MODIFIED=true
# 在Exec和TryExec行前追加 "apm run $NEW_PKGNAME"
# 处理Exec行
if grep -q '^Exec=' "$desktop_file"; then
sed -i 's/^Exec=\(.*\)$/Exec=apm run '"$NEW_PKGNAME"' \1/' "$desktop_file"
fi
# 处理TryExec行
if grep -q '^TryExec=' "$desktop_file"; then
sed -i 's/^TryExec=\(.*\)$/TryExec=apm run '"$NEW_PKGNAME"' \1/' "$desktop_file"
fi
# 处理Icon路径
icon_line=$(grep "^Icon=" "$desktop_file")
if [[ "$icon_line" == "Icon=/"* ]]; then
sed -i 's|^Icon=/|Icon=/var/lib/apm/apm/files/ace-env/var/lib/apm/'"$NEW_PKGNAME"'/files/core/|' "$desktop_file"
fi
# 添加X-APM-APPID
if ! grep -q "X-APM-APPID" "$desktop_file"; then
echo "X-APM-APPID=$NEW_PKGNAME" >> "$desktop_file"
fi
# 检查修改结果
if grep -q "apm run $NEW_PKGNAME" "$desktop_file"; then
log.info "桌面文件修改成功"
log.debug "修改后的Exec行: $(grep '^Exec=' "$desktop_file" || echo "未找到")"
log.debug "修改后的TryExec行: $(grep '^TryExec=' "$desktop_file" || echo "未找到")"
else
log.warn "桌面文件可能未正确修改: $desktop_file"
fi
done
if [ "$DESKTOP_MODIFIED" = false ]; then
log.info "未找到需要修改的.desktop文件"
fi
# 重新打包修改后的DEB
MODIFIED_DEB_PATH="$CRAFT_DIR/modified_${ORIG_PKGNAME}.deb"
log.info "重新打包修改后的DEB: $MODIFIED_DEB_PATH"
# 复制修改后的文件结构到打包目录
mkdir -p "$MODIFIED_DEB_DIR/data"
cp -r "$EXTRACT_DIR"/* "$MODIFIED_DEB_DIR/" 2>/dev/null || true
# 使用fakeroot重新打包
cd "$MODIFIED_DEB_DIR" && fakeroot dpkg-deb --build -Z none . "$MODIFIED_DEB_PATH"
cd - > /dev/null
if [ ! -f "$MODIFIED_DEB_PATH" ]; then
log.error "错误:重新打包DEB失败"
exit 1
fi
log.info "DEB包修改完成,新包路径: $MODIFIED_DEB_PATH"
# 实际安装修改后的DEB包
if ! sudo -E /var/lib/apm/apm/files/ace-run-pkg ssaudit "$MODIFIED_DEB_PATH" --native --no-create-desktop-entry; then
log.error "错误:修改后的DEB包安装失败"
exit 1
fi
log.info "修改后的DEB包安装完成"
# 清理一些垃圾
sudo -E /var/lib/apm/apm/files/ace-run-pkg aptss clean
sudo -E /var/lib/apm/apm/files/ace-run-pkg rm -vfr /var/lib/apt/lists
sudo -E /var/lib/apm/apm/files/ace-run-pkg rm -vfr /var/lib/aptss/lists
# 7. 创建新的APM包结构
log.info "创建新的APM包结构..."
PKG_BUILD_DIR="$CRAFT_DIR/new-pkg"
mkdir -p "$PKG_BUILD_DIR/DEBIAN"
mkdir -p "$PKG_BUILD_DIR/var/lib/apm/$NEW_PKGNAME"/{entries,files}
# 创建info文件 - 写入所有base,每行一个
log.info "创建info文件,包含输入的基础环境:"
for BASENAME in "${BASENAMES_ORIG[@]}"; do
echo "$BASENAME" >> "$PKG_BUILD_DIR/var/lib/apm/$NEW_PKGNAME/info"
log.info " 写入: $BASENAME"
done
log.info "创建info_debug文件,包含所有基础环境:"
for BASENAME in "${BASENAMES[@]}"; do
echo "$BASENAME" >> "$PKG_BUILD_DIR/var/lib/apm/$NEW_PKGNAME/info_debug"
log.info " 写入: $BASENAME"
done
# 创建postinst脚本
cat > "$PKG_BUILD_DIR/DEBIAN/postinst" << 'EOF'
#!/bin/bash
PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
echo "清理卸载残留"
rm -rf "/var/lib/apm/$PACKAGE_NAME"
else
echo "非卸载,跳过清理"
fi
EOF
chmod +x "$PKG_BUILD_DIR/DEBIAN/postinst"
# 8. 复制文件到新的APM包
log.info "复制文件到新的APM包..."
# 复制/usr/share/内容到entries
if [ -d "$EXTRACT_DIR/usr/share" ]; then
log.info "复制/usr/share/内容..."
cp -r "$EXTRACT_DIR/usr/share/"* "$PKG_BUILD_DIR/var/lib/apm/$NEW_PKGNAME/entries/"
fi
# 复制/opt/apps/内容(如果存在)
if [ -d "$EXTRACT_DIR/opt/apps/$ORIG_PKGNAME/entries" ]; then
log.info "复制/opt/apps/$ORIG_PKGNAME/entries内容..."
cp -r "$EXTRACT_DIR/opt/apps/$ORIG_PKGNAME/entries/"* "$PKG_BUILD_DIR/var/lib/apm/$NEW_PKGNAME/entries/"
fi
# 复制融合环境文件
log.info "复制融合环境文件..."
sudo cp -r "$CRAFT_DIR"/{core,work} "$PKG_BUILD_DIR/var/lib/apm/$NEW_PKGNAME/files/"
# 设置文件权限
sudo chmod -R 755 "$PKG_BUILD_DIR/var/lib/apm/$NEW_PKGNAME/files/"
# 9. 解除挂载
log.info "解除挂载..."
cleanup_mount
# 10. 打包新的APM包
log.info "打包新的APM包..."
calculate_directory_size() {
local dir="$1"
if [ -d "$dir" ]; then
du -sk "$dir" | cut -f1
else
echo "0"
fi
}
# 构建依赖字符串 - 包含所有base
DEPENDS_STR=$(IFS=,; echo "${BASENAMES_ORIG[*]}")
# 创建control文件
cat > "${PKG_BUILD_DIR}/DEBIAN/control" << EOF
Package: $NEW_PKGNAME
Version: $NEW_VERSION
Architecture: $ORIG_ARCH
Maintainer: APM Converter <apm-convert@spark-app.store>
Depends: $DEPENDS_STR
Installed-Size: $(calculate_directory_size $PKG_BUILD_DIR)
Description: APM converted package from $ORIG_PKGNAME
This package was automatically converted from the original deb package.
Based on: ${BASENAMES_ORIG[*]}
EOF
# 生成输出文件名
OUTPUT_DEB="${NEW_PKGNAME}_${NEW_VERSION}_${ORIG_ARCH}.deb"
# 打包
fakeroot dpkg-deb --build "$PKG_BUILD_DIR" "$OUTPUT_DEB"
log.info "转换完成!"
log.info "生成的APM包: $OUTPUT_DEB"
log.info "包名: $NEW_PKGNAME"
log.info "版本: $NEW_VERSION"
log.info "架构: $ORIG_ARCH"
log.info "依赖: $DEPENDS_STR"
log.info "基础环境: ${BASENAMES[*]}"
log.info "注意:桌面文件已修改,添加了APM运行前缀和APPID"
+1
View File
@@ -0,0 +1 @@
../../var/lib/apm/apm/files/bin/ace-run
+174
View File
@@ -0,0 +1,174 @@
#!/bin/bash
enumAppInfoList() {
appInfoList=()
apps="/var/lib/apm"
list=$(ls $apps 2>/dev/null)
for appID in $list; do
appInfoList+=("$appID")
done
echo "${appInfoList[@]}"
}
linkDir() {
ensureTargetDir() {
targetFile=$1
t=$(dirname "$targetFile")
mkdir -p "$t"
}
source=$1
target=$2
sourceDir=$(dirname "$source")
targetDir=$(dirname "$target")
find "$source" -type f | while read sourceFile; do
targetFile="$targetDir/${sourceFile#$sourceDir/}"
ensureTargetDir "$targetFile"
sourceFile=$(realpath --relative-to="$(dirname $targetFile)" "$sourceFile" )
if [ ! -e ${targetFile} ];then
ln -sv "$sourceFile" "$targetFile"
fi
done
}
linkApp() {
appID=$1
appEntriesDir="/var/lib/apm/$appID/entries"
appLibsDir="/var/lib/apm/$appID/files/lib"
autoStartDir="$appEntriesDir/autostart"
if [ -d "$autoStartDir" ]; then
linkDir "$autoStartDir" "/etc/xdg/autostart"
fi
# link application
sysShareDir="/usr/share"
for folder in "$appEntriesDir/applications" "$appEntriesDir/icons" "$appEntriesDir/mime" "$appEntriesDir/glib-2.0" "$appEntriesDir/services" "$appEntriesDir/GConf" "$appEntriesDir/help" "$appEntriesDir/locale" "$appEntriesDir/fcitx"; do
if [ ! -d "$folder" ]; then
continue
fi
if [ "$folder" = "$appEntriesDir/polkit" ]; then
linkDir "$folder" "/usr/share/polkit-1"
elif [ "$folder" = "$appEntriesDir/fonts/conf" ]; then
linkDir "$folder" "/etc/fonts/conf.d"
else
linkDir "$folder" "$sysShareDir/${folder##*/}"
fi
done
}
function exec_uos_package_link(){
for app in $(enumAppInfoList); do
linkApp "$app" &
done
wait
}
function exec_v23_icon_link(){
# Fix v23 broken icon
if [ ! -d "/usr/share/icons/hicolor/scalable/apps" ];then
mkdir -p /usr/share/icons/hicolor/scalable/apps
fi
for icon_root_icon_path in $(ls /usr/share/icons/*.png /usr/share/icons/*.svg 2>/dev/null)
do
target_icon_path=/usr/share/icons/hicolor/scalable/apps/$(basename ${icon_root_icon_path})
if [ ! -e ${target_icon_path} ];then
ln -sv $(realpath --relative-to=/usr/share/icons/hicolor/scalable/apps ${icon_root_icon_path}) /usr/share/icons/hicolor/scalable/apps
fi
done
}
function exec_link_clean(){
# remove broken links in /usr/share
find /usr/share/applications -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/icons -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/mime/packages -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/glib-2.0 -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/dbus-1/services -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/help -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/locale -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/lib/mozilla/plugins -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/polkit-1/actions -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /usr/share/fonts -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
find /etc/fonts/conf.d -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
}
function exec_uos_package_update(){
update-icon-caches /usr/share/icons/* > /dev/null 2>&1 &
update-desktop-database -q > /dev/null 2>&1 &
update-mime-database -V /usr/share/mime > /dev/null 2>&1 &
glib-compile-schemas /usr/share/glib-2.0/schemas/ > /dev/null 2>&1 &
}
function exec_debian_compatibile_links(){
# 源目录和目标目录定义
local SOURCE_DIR="/var/lib/apm"
local TARGET_DIR="/var/lib/apm/apm/files/ace-env/var/lib/apm"
# 检查目标目录是否存在
if [[ ! -d "$TARGET_DIR" ]]; then
mkdir -p $TARGET_DIR
fi
# 第一部分:为缺失的目录创建软链接
echo "检查并创建缺失的软链接..."
for dir in "$SOURCE_DIR"/*/; do
# 获取目录名(去掉路径和尾部斜杠)
dirname=$(basename "$dir")
# 跳过 apm 目录
if [[ "$dirname" == "apm" ]]; then
continue
fi
# 检查目标目录中是否已存在对应的软链接或目录
target_link="$TARGET_DIR/$dirname"
if [[ ! -e "$target_link" ]]; then
echo "创建软链接: $target_link -> $dir"
ln -sv "$dir" "$target_link"
fi
done
# 第二部分:清理无效的软链接
echo "清理无效的软链接..."
for link in "$TARGET_DIR"/*; do
# 检查是否为软链接
if [[ -L "$link" ]]; then
# 检查软链接是否有效(指向的目标是否存在)
if [[ ! -e "$link" ]]; then
echo "删除无效软链接: $link"
rm "$link"
fi
fi
done
}
#########################################################################################
echo "----------------Running APM Dstore Patch----------------"
# execute linkApp function for each app and print output
exec_uos_package_link
#exec_v23_icon_link
exec_link_clean
wait
exec_uos_package_update
if [[ "${IS_APM_ENV}" = "" ]];then
exec_debian_compatibile_links
fi
echo "----------------Finished----------------"
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
if [[ ! -e "/usr/share/gxde-api" ]] && ! grep -q "Kylin" /etc/os-release; then
exit 0 # No needed
fi
# 函数:检查目录并创建符号链接
process_directory() {
local source_dir="$1"
local target_dir="$2"
local name="$3"
if [ -d "$source_dir" ] && [ -n "$(ls -A "$source_dir")" ]; then
ln -sv $source_dir/* "$target_dir" 2>/dev/null
find "$target_dir" -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
else
echo "$name directory is empty or does not exist, skipping..."
fi
}
# 处理 applications 目录
process_directory "/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/applications/" \
"/usr/local/share/applications/" "Applications"
# 处理 icons 目录
process_directory "/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/icons/" \
"/usr/local/share/icons/" "Icons"
# 等待所有后台任务完成
wait
+148
View File
@@ -0,0 +1,148 @@
#!/bin/bash
# 发送通知
function get_upgradable_list(){
output=$(env LANGUAGE=en_US amber-pm-debug aptss list --upgradable | awk NR\>1)
IFS_OLD="$IFS"
IFS=$'\n'
for line in $output ; do
PKG_NAME=$(echo $line | awk -F '/' '{print $1}')
PKG_NEW_VER=$(echo $line | awk -F ' ' '{print $2}')
PKG_CUR_VER=$(echo $line | awk -F ' ' '{print $6}' | awk -F ']' '{print $1}')
echo "${PKG_NAME} ${PKG_NEW_VER} ${PKG_CUR_VER}"
done
IFS="$IFS_OLD"
}
function get_current_user() {
# 优先通过 who 命令获取用户
local user
user=$(who | awk '{print $1}' | head -n 1 2>/dev/null)
# 如果 who 无输出,则通过 loginctl 获取
if [[ -z "$user" ]]; then
user=$(loginctl list-sessions --no-legend 2>/dev/null | awk '{print $3}' | head -n 1)
fi
# 返回最终结果(可能为空)
echo "${user}"
}
function notify-send() {
# Detect user using the display
local user=$(get_current_user)
# Detect uid of the user
local uid=$(id -u $user)
sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${uid}/bus notify-send "$@"
}
# 检测网络链接畅通
function network-check() {
# 超时时间
local timeout=15
# 目标网站
local target=www.baidu.com
# 获取响应状态码
local ret_code=$(curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1)
if [ "$ret_code" = "200" ]; then
# 网络畅通
return 0
else
# 网络不畅通
return 1
fi
}
# 初始化等待时间和最大等待时间
initial_wait_time=15 # 初始等待时间 15 秒
max_wait_time=$((12 * 3600)) # 最大等待时间 12 小时
# 检测网络,若不通则进行重试,采用指数退避算法
wait_time=$initial_wait_time
while ! network-check; do
echo "$TRANSHELL_CONTENT_NETWORK_FAIL"
echo "Waiting for network to recover... Retrying in ${wait_time} seconds."
sleep $wait_time
wait_time=$((wait_time * 2)) # 等待时间翻倍
if [ $wait_time -gt $max_wait_time ]; then
wait_time=$max_wait_time # 最大等待时间限制为12小时
fi
done
# 每日更新星火源文件
updatetext=$(LANGUAGE=en_US apm update 2>&1)
# 在网络恢复后,继续更新操作
retry_count=0
max_retries=12 # 最大重试次数,防止死循环
until ! echo $updatetext | grep -q "E:"; do
if [ $retry_count -ge $max_retries ]; then
echo "Reached maximum retry limit for apm update."
exit 1
fi
echo "Update failed...Will retry in 15sec"
sleep 15
updatetext=$(LANGUAGE=en_US apm update 2>&1)
retry_count=$((retry_count + 1))
done
update_app_number=$(env LANGUAGE=en_US apm list --upgradable 2>/dev/null | grep -c upgradable)
echo "update_app_number is $update_app_number"
if [ "$update_app_number" -le 0 ]; then
exit 0
fi
# 获取用户选择的要更新的应用
PKG_LIST="$(get_upgradable_list)"
# 指定分隔符为 \n
IFS_OLD="$IFS"
IFS=$'\n'
for line in $PKG_LIST; do
# PKG_NAME=$(echo $line | awk -F ' ' '{print $1}')
# PKG_NEW_VER=$(echo $line | awk -F ' ' '{print $2}')
# PKG_CUR_VER=$(echo $line | awk -F ' ' '{print $3}')
# amber-pm-debug dpkg --compare-versions $PKG_NEW_VER le $PKG_CUR_VER
#
# if [ $? -eq 0 ]; then
# let update_app_number=$update_app_number-1
# continue
# fi
# 检测是否是 hold 状态
PKG_STA=$(amber-pm-debug dpkg-query -W -f='\''\${db:Status-Want}'\' $PKG_NAME)
#PKG_STA=$(dpkg-query -W -f='${db:Status-Want}' $PKG_NAME)
if [ "$PKG_STA" = "hold" ]; then
let update_app_number=$update_app_number-1
fi
done
# 还原分隔符
IFS="$IFS_OLD"
if [ $update_app_number -le 0 ]; then
exit 0
fi
# 如果都是hold或者版本一致的那就直接退出,否则把剩余的给提醒了
# TODO: 除了apt-mark hold之外额外有一个禁止检查列表
notify-send -a apm "APM 琥珀应用包" "有 $update_app_number 个应用可以更新啦,apm list --upgradable 以查看" || true # Some machine don't have bus, or who command just print nothing.
+352
View File
@@ -0,0 +1,352 @@
#!/bin/bash
VERSION=1.1.1
# 获取脚本名称用于帮助信息
SCRIPT_NAME=$(basename "$0")
PATH_PREFIX=/var/lib/apm/apm/files/ace-env/
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
# 帮助信息函数
show_help() {
cat <<EOF
APM - Amber Package Manager ${VERSION}
Usage:
$SCRIPT_NAME [COMMAND] [OPTIONS] [PACKAGES...]
Commands:
install 安装软件包
remove 卸载软件包
run <package> 运行指定软件包的可执行文件
update 更新软件包信息
hold 锁定软件包版本
unhold 解锁软件包版本
full-upgrade 升级全部软件包
list 查看可用软件包信息
search 搜索软件包
download 下载包
show 展示包信息
clean 清除缓存软件包
autoremove 自动移除不需要的包
ssaudit <path> 使用 ssaudit 进行本地软件安装,详情见 spark-store
debug 显示调试系统信息并进入调试环境
amber 彩蛋功能
xmp360 彩蛋功能
bronya 彩蛋功能
-h, --help 显示此帮助信息
-v, --version 展示APM版本号
EOF
}
apm_exec(){
# 递归读取info文件并构建lowerdir
local lowerdirs=()
local current_dir="${PATH_PREFIX}/var/lib/apm/${coredir}" # 当前目录开始
local next_info_file=""
while : ; do
# 构建info文件的路径
next_info_file="${current_dir}/info"
# echo "${current_dir}/info"
# 检查info文件是否存在
if [[ ! -f "$next_info_file" ]]; then
# log.debug "No more info files found, stopping recursion."
break
fi
# 读取info文件的每一行并构建lowerdir
while IFS= read -r basedir; do
[[ -z "$basedir" ]] && continue # 跳过空行
# 检查ace-env目录是否存在
if [[ -d "${PATH_PREFIX}/var/lib/apm/${basedir}/files/ace-env" ]]; then
lowerdirs+=("${PATH_PREFIX}/var/lib/apm/${basedir}/files/ace-env")
# 如果ace-env不存在,检查core目录
elif [[ -d "${PATH_PREFIX}/var/lib/apm/${basedir}/files/core" ]]; then
lowerdirs+=("${PATH_PREFIX}/var/lib/apm/${basedir}/files/core")
else
log.warn "Neither ace-env nor core directory found for base: $basedir"
fi
done < "$next_info_file"
# 尝试获取下一个依赖信息的路径
local next_basedir=$(tail -n 1 "$next_info_file")
if [[ -z "$next_basedir" || ! -d "${PATH_PREFIX}/var/lib/apm/${next_basedir}" ]]; then
log.debug "No further dependencies found, ending recursion."
break
fi
# 更新当前目录,递归处理下一个依赖
current_dir="${PATH_PREFIX}/var/lib/apm/${next_basedir}"
done
# 检查是否找到了有效的lowerdir
if [[ ${#lowerdirs[@]} -eq 0 ]]; then
log.error "No valid lower directories found for package: $coredir"
return 1
fi
# 将lowerdirs数组用冒号连接起来
local lowerdir=$(IFS=:; echo "${lowerdirs[*]}")
# 创建挂载点目录
mkdir -p "/tmp/apm/${coredir}"
# 使用fuse-overlayfs挂载
log.debug "Mounting with lowerdir: $lowerdir"
fuse-overlayfs -o lowerdir="$lowerdir",upperdir="${PATH_PREFIX}/var/lib/apm/${coredir}/files/core/",workdir="${PATH_PREFIX}/var/lib/apm/${coredir}/files/work/" "/tmp/apm/${coredir}"
# 执行命令
chrootEnvPath="/tmp/apm/${coredir}" /var/lib/apm/apm/files/ace-run "$@"
# 卸载
umount "/tmp/apm/${coredir}"
}
# 调试信息函数
debug_info() {
log.debug "======= APM Debug Information ======="
log.debug "User: $(whoami)"
log.debug "Hostname: $(hostname)"
log.debug "OS: $(lsb_release -ds 2>/dev/null || uname -om)"
log.debug "Kernel: $(uname -sr)"
log.debug "Bash Version: ${BASH_VERSION}"
log.debug "APT Version: $(apt --version | head -n1)"
log.debug "APM APT Version: $(amber-pm-debug apt --version | head -n1)"
log.debug "====================================="
amber-pm-debug "$@"
}
# 彩蛋函数
amber_egg() {
cat <<'EOF'
____ ____
/ __ )____ __________ ____ / __ )__ ______ ____ __ __
/ __ / __ `/ ___/ __ \/ __ \ / __ / / / / __ \/ __ \/ / / /
/ /_/ / /_/ / / / /_/ / / / / / /_/ / /_/ / / / / / / / /_/ /
/_____/\__,_/_/ \____/_/ /_/ /_____/\__,_/_/ /_/_/ /_/\__, /
/____/
Amber Package Manager - Sparkling with magic! 安柏包管理器 - blingbling
💎 Another target tracked down by Outrider Amber! 侦察骑士,发现目标!
EOF
}
bronya_egg() {
cat <<'EOF'
_ __ ____ _ ____ __
| | / /__ _/ / /____ ______(_)__ / __/_ _____ / /____ __ _
| |/ / _ `/ / '_/ // / __/ / -_) _\ \/ // (_-</ __/ -_) ' \
|___/\_,_/_/_/\_\\_, /_/ /_/\__/ /___/\_, /___/\__/\__/_/_/_/
/ / ___ ___ __/___/____/ / /___/
/ /__/ _ `/ // / _ \/ __/ _ \
/____/\_,_/\_,_/_//_/\__/_//_/
Valkyrie 系统启动 - 重装小兔,Fire!
💎 感谢 Anysets 为 AmberCE 和 AmberPM 的 Arch 架构支持提供帮助~
EOF
}
xmp360_egg() {
cat <<'EOF'
################################################################################
################################################################################
################################################################################
##################### ####################
####################. %###################
##########= ####################
############################ #=========*#########
############# .% .*****= :######
############################### =+ =#######* -#####
##### %: *######## :#####
######################% # ########* +#####
########: # %#####
########################## .# ######
##################* -* ######
##################= =###%: +- *###* ######
##################. # %: :* # -######
##################. % *###= % -- #### % %######
########################- ####+ ########################### .####. #########
######################### ############################% ##########
###########################=::+################################%-:-*############
################################################################################
哇——————袄 - 撞大运咯!
💎 感谢 潇湘·秀 为 APM 的 RPM 架构支持提供帮助~
EOF
}
apm-nvidia-toggle(){
# APM 基础路径
APM_BASE="${PATH_PREFIX}/var/lib/apm"
# 检查基础目录是否存在
if [[ ! -d "$APM_BASE" ]]; then
echo "错误: 目录 $APM_BASE 不存在"
exit 1
fi
# 遍历 /var/lib/apm 下的所有目录
for dir in "$APM_BASE"/*/; do
# 移除末尾的斜杠得到纯目录名
dir="${dir%/}"
# 提取目录名(不包括完整路径)
dirname=$(basename "$dir")
# 检查目标文件是否存在
target_file="${APM_BASE}/${dirname}/files/ace-env"
if [[ -e "$target_file" ]]; then
# 将目录传递给 amber-pm-configure-nvidia
amber-pm-configure-nvidia "$target_file"
fi
done
}
# 主命令处理
case "$1" in
install|full-upgrade|upgrade|reinstall)
command=$1
shift
amber-pm-debug aptss "$command" "$@"
exit_code=$?
if [ $exit_code -eq 0 ]; then
log.info "Operation successful"
else
log.error "Error: Operation failed"
exit $exit_code
fi
amber-pm-debug amber-pm-dstore-patch
apm-nvidia-toggle
amber-pm-gxde-desktop-fix
;;
download|search|policy|list|update|clean|show)
command=$1
shift
amber-pm-debug aptss "$command" "$@"
exit_code=$?
if [ $exit_code -eq 0 ]; then
log.info "Operation successful"
else
log.error "Error: Operation failed"
exit $exit_code
fi
;;
hold|unhold)
command=$1
shift
amber-pm-debug apt-mark "$command" "$@"
exit_code=$?
if [ $exit_code -eq 0 ]; then
log.info "Operation successful"
else
log.error "Error: Operation failed"
exit $exit_code
fi
;;
remove|autoremove|purge|autopurge)
# 特殊APT命令:移除第一个参数后传递其余参数
command=$1
shift
amber-pm-debug aptss "$command" "$@"
exit_code=$?
if [ $exit_code -eq 0 ]; then
log.info "Operation successful"
else
log.error "Error: Operation failed"
exit $exit_code
fi
amber-pm-debug amber-pm-dstore-patch
amber-pm-gxde-desktop-fix
;;
run)
# 运行包命令:第二个参数必须是包名
if [ -z "$2" ]; then
log.error "Package name required for 'run' command"
show_help
exit 1
fi
# 检查包是否已安装
pkg="$2"
shift 2 # 移除 'run' 和包名
if ! ls "${PATH_PREFIX}/var/lib/apm/$pkg" >/dev/null 2>&1; then
# 如果带前缀的目录不存在,尝试不带前缀的目录
if ls "/var/lib/apm/$pkg" >/dev/null 2>&1; then
# 如果不带前缀的目录存在,清空 PATH_PREFIX
PATH_PREFIX=""
else
# 如果两个目录都不存在,报错退出
log.error "Package not installed: $pkg"
exit 1
fi
fi
coredir=$pkg
# 检测是否有额外命令参数
if [ $# -gt 0 ]; then
# 有额外参数:执行用户提供的命令
log.info "Running user command: $*"
apm_exec "$@"
else
# 没有额外参数:提示
log.info "Usage: $SCRIPT_NAME run $pkg [EXEC_PATH]"
exit 1
fi
;;
debug)
shift
debug_info $@
;;
ssaudit)
amber-pm-debug ssaudit $@ --native
exit_code=$?
if [ $exit_code -eq 0 ]; then
log.info "Operation successful"
else
log.error "Error: Operation failed"
exit $exit_code
fi
amber-pm-debug amber-pm-dstore-patch
amber-pm-gxde-desktop-fix
;;
-h|--help)
show_help
;;
-v|--version)
echo "$VERSION"
;;
amber)
amber_egg
;;
xmp360)
xmp360_egg
;;
bronya)
bronya_egg
;;
*)
show_help
;;
esac
+6
View File
@@ -0,0 +1,6 @@
# ACE app runs in a container, need privileges within user namespace, so we need to set it
kernel.unprivileged_userns_clone=1
# Ubuntu 24.04 has more limitation on unprivileged user namespace,so we have to disable them.
# refer to https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
kernel.apparmor_restrict_unprivileged_unconfined=0
kernel.apparmor_restrict_unprivileged_userns=0
+14
View File
@@ -0,0 +1,14 @@
[Unit]
Description=APM Daily Update
After=apt-daily.service network.target network-online.target systemd-networkd.service NetworkManager.service connman.service
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=amber-pm-upgrade-notifier
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=Timer for APM Daily Update
[Timer]
# 开机后第一次执行
OnBootSec=1min
# 每天执行一次
OnUnitActiveSec=1d
[Install]
WantedBy=timers.target
+14
View File
@@ -0,0 +1,14 @@
[Unit]
Description=APM GXDE Fixer
After=apt-daily.service network.target network-online.target systemd-networkd.service NetworkManager.service connman.service
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/var/lib/apm/apm/files/bin/ace-gxde-fixer
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
# Ensure base distro defaults xdg path are set if nothing filed up some
# defaults yet.
if [ -z "$XDG_DATA_DIRS" ]; then
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
fi
# Desktop files (used by desktop environments within both X11 and Wayland) are
# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for ACE
ACE_path="/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/"
if [ -n "${XDG_DATA_DIRS##*${ACE_path}}" ] && [ -n "${XDG_DATA_DIRS##*${ACE_path}:*}" ]; then
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${ACE_path}"
fi
+255
View File
@@ -0,0 +1,255 @@
# Debian apt(8) completion -*- shell-script -*-
_apm()
{
local sourcesdir="/etc/apt/sources.list.d"
local cur prev words cword
_init_completion || return
local GENERIC_APT_GET_OPTIONS='
-d --download-only
-y --assume-yes
--assume-no
-u --show-upgraded
-m --ignore-missing
-t --target-release
--download
--fix-missing
--ignore-hold
--upgrade
--only-upgrade
--allow-change-held-packages
--allow-remove-essential
--allow-downgrades
--print-uris
--trivial-only
--remove
--arch-only
--allow-unauthenticated
--allow-insecure-repositories
--install-recommends
--install-suggests
--no-install-recommends
--no-install-suggests
--fix-policy
'
# see if the user selected a command already
local COMMANDS=(
"ssaudit"
"list"
"search"
"show" "showsrc"
"install" "remove" "purge" "autoremove" "autopurge"
"update"
"upgrade" "full-upgrade" "dist-upgrade"
"run"
"help"
"source" "build-dep"
"clean" "autoclean"
"download" "changelog"
"amber"
"debug"
"depends" "rdepends"
"policy")
local command i
for (( i=0; i < ${#words[@]}-1; i++ )); do
if [[ ${COMMANDS[@]} =~ ${words[i]} ]]; then
command=${words[i]}
break
fi
done
# supported options per command
if [[ "$cur" == -* ]]; then
case $command in
install|remove|purge|upgrade|dist-upgrade|full-upgrade|autoremove)
COMPREPLY=( $( compgen -W '--show-progress
--fix-broken --purge --verbose-versions --auto-remove
-s --simulate --dry-run
--download
--fix-missing
--fix-policy
--ignore-hold
--force-yes
--trivial-only
--reinstall --solver
-t --target-release'"$GENERIC_APT_GET_OPTIONS" -- "$cur" ) )
return 0
;;
update)
COMPREPLY=( $( compgen -W '--list-cleanup
--print-uris
--allow-insecure-repositories
' -- "$cur" ) )
return 0
;;
list)
COMPREPLY=( $( compgen -W '--installed --upgradable
--manual-installed
-v --verbose
-a --all-versions
-t --target-release
' -- "$cur" ) )
return 0
;;
show)
COMPREPLY=( $( compgen -W '-a --all-versions
' -- "$cur" ) )
return 0
;;
depends|rdepends)
COMPREPLY=( $( compgen -W '-i
--important
--installed
--pre-depends
--depends
--recommends
--suggests
--replaces
--breaks
--conflicts
--enhances
--recurse
--implicit' -- "$cur" ) )
return 0
;;
search)
COMPREPLY=( $( compgen -W '
-n --names-only
-f --full' -- "$cur" ) )
return 0
;;
showsrc)
COMPREPLY=( $( compgen -W '
--only-source' -- "$cur" ) )
return 0
;;
source)
COMPREPLY=( $( compgen -W '
-s --simulate --dry-run
-b --compile --build
-P --build-profiles
--diff-only --debian-only
--tar-only
--dsc-only
-t --target-release
'"$GENERIC_APT_GET_OPTIONS" -- "$cur" ) )
return 0
;;
build-dep)
COMPREPLY=( $( compgen -W '
-a --host-architecture
-s --simulate --dry-run
-P --build-profiles
-t --target-release
--purge --solver
'"$GENERIC_APT_GET_OPTIONS" -- "$cur" ) )
return 0
;;
moo)
COMPREPLY=( $( compgen -W '
--color
' -- "$cur" ) )
return 0
;;
clean|autoclean)
COMPREPLY=( $( compgen -W '
-s --simulate --dry-run
' -- "$cur" ) )
return 0
;;
esac
fi
# 定义目录路径
primary_dir="/var/lib/apm/apm/files/ace-env/var/lib/apm/"
fallback_dir="/var/lib/apm/"
# 查找不包含特定子目录的目录
find_directories_without_ace_env() {
local base_dir="$1"
local result=()
# 检查基础目录是否存在
if [[ ! -d "$base_dir" ]]; then
return 1
fi
# 查找所有直接子目录,排除包含ace-env子目录的目录
while IFS= read -r -d '' dir; do
if [[ -d "$dir" ]] && [[ ! -d "$dir/files/ace-env" ]]; then
result+=("$(basename $dir)")
fi
done < <(find "$base_dir" -maxdepth 1 -type d ! -path "$base_dir" -print0 2>/dev/null)
# 输出结果
if [[ ${#result[@]} -gt 0 ]]; then
printf '%s\n' "${result[@]}"
return 0
fi
return 1
}
function apm_run_compgen(){
result=$(find_directories_without_ace_env "$primary_dir")
if [[ -n "$result" ]]; then
echo "$result"
else
result=$(find_directories_without_ace_env "$fallback_dir")
if [[ -n "$result" ]]; then
echo "$result"
else
echo ""
fi
fi
}
# specific command arguments
if [[ -n $command ]]; then
case $command in
remove|purge|autoremove)
# Debian system
COMPREPLY=( $( compgen -W "$(ls /var/lib/apm/apm/files/ace-env/var/lib/apm/ )" $cur ) )
return 0
;;
show|list|download|changelog|depends|rdepends)
COMPREPLY=( $( amber-pm-debug apt-cache --no-generate pkgnames "$cur" -o Dir::Cache="/var/lib/aptss/" \
2> /dev/null ) )
return 0
;;
install)
COMPREPLY=( $( amber-pm-debug apt-cache --no-generate pkgnames "$cur" -o Dir::Cache="/var/lib/aptss/" \
2> /dev/null ) )
if [[ "$cur" == ./* || "$cur" == /* ]]; then
_filedir "deb"
fi
return 0
;;
source|build-dep|showsrc|policy)
COMPREPLY=( $( amber-pm-debug apt-cache --no-generate pkgnames "$cur" -o Dir::Cache="/var/lib/aptss/" \
2> /dev/null ) $( apt-cache dumpavail -o Dir::Cache="/var/lib/aptss/" | \
command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) )
return 0
;;
run)
COMPREPLY=( $( compgen -W "$(apm_run_compgen)" "$cur" ) )
return 0
;;
esac
fi
# no command yet, show what commands we have
if [ "$command" = "" ]; then
COMPREPLY=( $( compgen -W '${COMMANDS[@]}' -- "$cur" ) )
fi
return 0
} &&
complete -F _apm apm
# ex: ts=4 sw=4 et filetype=sh
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

+142
View File
@@ -0,0 +1,142 @@
#!/bin/bash
bash(){
/usr/bin/bash --rcfile <(cat ~/.bashrc; echo "PS1=\"\[\e[37;40m\][\[\e[32;40m\]\u\[\e[37;40m\]@Amber-PM \[\e[36;40m\]\w\[\e[0m\]]\\\$ \"") $@
}
export -f bash
chrootEnvPath="${chrootEnvPath:-$(pwd)/ace-env}"
non_root_user=$(who | awk '{print $1}' | head -n 1)
uid=$(id -u $non_root_user)
#### This part is for args pharm
if [ "$1" = "" ];then
container_command="bash"
else
container_command="$1"
shift
for arg in "$@"; do
arg="$(echo "${arg}x" | sed 's|'\''|'\'\\\\\'\''|g')"
arg="${arg%x}"
container_command="${container_command} '${arg}'"
done
fi
#########################################################################################
##########合成bwrap 1. 基础函数配置段
# 初始化 EXEC_COMMAND 为 bwrap 基础指令
EXEC_COMMAND="bwrap --dev-bind / / bwrap"
# add_command 函数定义
function add_command() {
# 参数拼接,考虑到转义和空格的处理
for arg in "$@"; do
EXEC_COMMAND="${EXEC_COMMAND} ${arg}"
done
}
function add_env_var() {
local var_name="${1}"
local var_value="${2}"
if [ "$var_value" != "" ]; then
add_command "--setenv $var_name $var_value"
fi
}
##########合成bwrap 2. 特殊需求函数配置段
function cursor_theme_dir_integration() {
local directory=""
if [ "$(id -u)" = "0" ]; then #####We don't want bother root to install themes,but will try to fix the unwriteable issue
mkdir -p $chrootEnvPath/usr/share/icons
chmod 777 -R $chrootEnvPath/usr/share/icons
return
fi
for directory in "/usr/share/icons"/*; do
# 检查是否为目录
if [ -d "$directory" ]; then
# 检查目录中是否存在 cursors 文件
if [ -d "$directory/cursors" ]; then
if [ -w $chrootEnvPath/usr/share/icons ];then
add_command "--ro-bind-try $directory $directory"
fi
fi
fi
done
}
##########合成bwrap 3. 环境变量和目录绑定配置段
# 添加环境变量和其他初始设置
ENV_VARS=(
"FAKEROOTDONTTRYCHOWN 1"
"PULSE_SERVER /run/user/\$uid/pulse/native"
"PATH /amber-ce-tools/bin-override:\$PATH"
"IS_ACE_ENV 1"
"GTK_USE_PORTAL 1"
"XDG_DATA_DIRS /amber-ce-tools/additional-data-dir-in-container:\$XDG_DATA_DIRS"
)
BIND_DIRS=(
"--dev-bind $chrootEnvPath/ /"
"--dev-bind-try /media /media"
"--dev-bind-try /mnt /mnt"
"--dev-bind-try /tmp /tmp"
"--dev-bind-try /data /data"
"--dev-bind-try /dev /dev"
"--proc /proc"
"--dev-bind /sys /sys"
"--dev-bind /run /run"
"--dev-bind-try /run/user/\$uid/pulse /run/user/\$uid/pulse"
"--dev-bind / /host"
"--ro-bind-try /usr/share/themes /usr/local/share/themes"
"--ro-bind-try /usr/share/icons /usr/share/icons"
"--ro-bind-try /usr/share/fonts /usr/local/share/fonts"
"--dev-bind-try /etc/resolv.conf /etc/resolv.conf"
"--dev-bind-try /home /home"
)
EXTRA_ARGS=(
"--cap-add CAP_SYS_ADMIN"
)
EXTRA_SCRIPTS=(
# cursor_theme_dir_integration
)
##########合成bwrap 4. 合成并执行指令
# 逐一添加到 EXEC_COMMAND
for var in "${ENV_VARS[@]}"; do
add_env_var $var
done
for var in "${BIND_DIRS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_ARGS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_SCRIPTS[@]}"; do
$var
done
# 添加最终的 bash 命令
add_command "bash -c \"${container_command}\""
# 输出完整的 EXEC_COMMAND 以查看
# echo "${EXEC_COMMAND}"
# 注意: 实际执行时,请确保所有变量(如 $uid, $chrootEnvPath 等)都已正确定义
eval ${EXEC_COMMAND}
+143
View File
@@ -0,0 +1,143 @@
#!/bin/bash
bash(){
/usr/bin/bash --rcfile <(cat ~/.bashrc; echo "PS1=\"\[\e[37;40m\][\[\e[32;40m\]\u\[\e[37;40m\]@Amber-PM \[\e[36;40m\]\w\[\e[0m\]]\\\$ \"") $@
}
export -f bash
chrootEnvPath="${chrootEnvPath:-$(pwd)/ace-env}"
non_root_user=$(who | awk '{print $1}' | head -n 1)
uid=$(id -u $non_root_user)
#### This part is for args pharm
if [ "$1" = "" ];then
container_command="bash"
else
container_command="$1"
shift
for arg in "$@"; do
arg="$(echo "${arg}x" | sed 's|'\''|'\'\\\\\'\''|g')"
arg="${arg%x}"
container_command="${container_command} '${arg}'"
done
fi
#########################################################################################
##########合成bwrap 1. 基础函数配置段
# 初始化 EXEC_COMMAND 为 bwrap 基础指令
EXEC_COMMAND="bwrap --dev-bind / / bwrap"
# add_command 函数定义
function add_command() {
# 参数拼接,考虑到转义和空格的处理
for arg in "$@"; do
EXEC_COMMAND="${EXEC_COMMAND} ${arg}"
done
}
function add_env_var() {
local var_name="${1}"
local var_value="${2}"
if [ "$var_value" != "" ]; then
add_command "--setenv $var_name $var_value"
fi
}
##########合成bwrap 2. 特殊需求函数配置段
function cursor_theme_dir_integration() {
local directory=""
if [ "$(id -u)" = "0" ]; then #####We don't want bother root to install themes,but will try to fix the unwriteable issue
mkdir -p $chrootEnvPath/usr/share/icons
chmod 777 -R $chrootEnvPath/usr/share/icons
return
fi
for directory in "/usr/share/icons"/*; do
# 检查是否为目录
if [ -d "$directory" ]; then
# 检查目录中是否存在 cursors 文件
if [ -d "$directory/cursors" ]; then
if [ -w $chrootEnvPath/usr/share/icons ];then
add_command "--ro-bind-try $directory $directory"
fi
fi
fi
done
}
##########合成bwrap 3. 环境变量和目录绑定配置段
# 添加环境变量和其他初始设置
ENV_VARS=(
"FAKEROOTDONTTRYCHOWN 1"
"PULSE_SERVER /run/user/\$uid/pulse/native"
"PATH /amber-ce-tools/bin-override:\$PATH"
"IS_ACE_ENV 1"
"GTK_USE_PORTAL 1"
"XDG_DATA_DIRS /amber-ce-tools/additional-data-dir-in-container:\$XDG_DATA_DIRS"
)
BIND_DIRS=(
"--dev-bind $chrootEnvPath/ /"
"--dev-bind-try /media /media"
"--dev-bind-try /root /root"
"--dev-bind-try /www /www"
"--dev-bind-try /mnt /mnt"
"--dev-bind-try /tmp /tmp"
"--dev-bind-try /data /data"
"--dev-bind-try /dev /dev"
"--proc /proc"
"--dev-bind /sys /sys"
"--dev-bind /run /run"
"--dev-bind-try /run/user/\$uid/pulse /run/user/\$uid/pulse"
"--dev-bind / /host"
"--dev-bind-try /etc/resolv.conf /etc/resolv.conf"
"--dev-bind-try /home /home"
)
EXTRA_ARGS=(
"--hostname Amber-PM"
"--unshare-uts"
"--cap-add CAP_SYS_ADMIN"
)
EXTRA_SCRIPTS=(
# cursor_theme_dir_integration
)
##########合成bwrap 4. 合成并执行指令
# 逐一添加到 EXEC_COMMAND
for var in "${ENV_VARS[@]}"; do
add_env_var $var
done
for var in "${BIND_DIRS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_ARGS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_SCRIPTS[@]}"; do
$var
done
# 添加最终的 bash 命令
add_command "bash -c \"${container_command}\""
# 输出完整的 EXEC_COMMAND 以查看
# echo "${EXEC_COMMAND}"
# 注意: 实际执行时,请确保所有变量(如 $uid, $chrootEnvPath 等)都已正确定义
eval ${EXEC_COMMAND}
@@ -0,0 +1,9 @@
Package: ace-host-integration
Version: 1.2.2
Section: misc
Priority: optional
Depends: bash
Maintainer: shenmo <shenmo@spark-app.store>
Architecture: all
Conflicts: apm
Description: ace-host-integration
@@ -0,0 +1,4 @@
#!/bin/bash
if [ "${1}" = "triggered" ];then
/opt/ace-host-integration/ace-host-integration
fi
@@ -0,0 +1,2 @@
interest-noawait /var/lib/apm
interest-noawait /usr/share/applications
@@ -0,0 +1 @@
IS_ACE_ENV=1
@@ -0,0 +1,98 @@
#!/bin/bash
# ===== Log =====
# log.info xxx
# log.warn xxx
# log.info xxx
# log.debug xxx
# 带颜色的echo
function log.color_output() {
local color=$1
shift 1
echo >&2 -e "\033[${color}m$@\033[0m"
return 0
}
# Log is named without prefix "utils." for convenience
# Usage: log.log <level> ...content
function log.log() {
if [[ $# < 2 ]]; then
return -1
fi
local level=$1
shift 1
case $level in
error) log.color_output "0;31" "[ERROR] $@" ;;
warn) log.color_output "1;33" "[WARN] $@" ;;
info) log.color_output "1;37" "[INFO] $@" ;;
debug) log.color_output "1;30" "[DEBUG] $@" ;;
esac
return 0
}
function log.error() { log.log "error" "$@"; }
function log.warn() { log.log "warn" $@; }
function log.info() { log.log "info" $@; }
function log.debug() { log.log "debug" $@; }
function do_integrate(){
local file=$1
if [ -f "$file" ]; then
# 获取文件名(不带.desktop后缀)作为X-AMBER-CE-DESKTOP-NAME的值
local desktop_name=$(basename "$file" .desktop)
# 检查是否已经处理过(通过检查X-AMBER-CE-DESKTOP-NAME字段)
if ! grep -q "^X-AMBER-CE-DESKTOP-NAME=" "$file"; then
echo "$file is detected. Processing host system integration..."
# 修改Exec行(如果尚未修改)
if ! grep -q "^Exec=apm-debug " "$file"; then
sed -i 's|^Exec=\(.*\)|Exec=apm-debug \1|' "$file"
fi
# 删除TryExec行
sed -i '/^TryExec=/d' "$file"
# 修改Name行(包括本地化Name)
sed -i '/^Name=/ s/$/ (Amber-PM)/' "$file"
sed -i "/^Name\[${LANGUAGE}\]=/ s/\$/ (Amber-PM)/" "$file"
# 修改GenericName行(包括本地化GenericName
sed -i '/^GenericName=/ s/$/ (Amber-PM)/' "$file"
sed -i "/^GenericName\[${LANGUAGE}\]=/ s/\$/ (Amber-PM)/" "$file"
# 添加X-AMBER-CE-DESKTOP-NAME字段
echo "X-AMBER-CE-DESKTOP-NAME=${desktop_name}" >> "$file"
# 处理Icon行
icon_line=$(grep "^Icon=" "$file")
if [[ "$icon_line" == "Icon=/"* ]]; then
# 如果Icon=后面接的是/,则添加前缀
sed -i 's|^Icon=/|Icon=/lib/apm/apm/files/ace-env/|' "$file"
fi
fi
fi
chmod +x "$file"
}
if [ "${IS_ACE_ENV}" != "" ]; then
if [ -e /opt/apps/ ]; then
for app_dir in $(/apm/); do
for file in /opt/apps/$app_dir/entries/applications/*.desktop; do
do_integrate "$file"
done
done
else
log.warn "No /opt/apps directory. Skip..."
fi
for file in /usr/share/applications/*.desktop; do
do_integrate "$file"
done
find "/usr/share/applications/" -xtype l -delete
else
log.error "DO NOT run me on host OS"
fi
@@ -0,0 +1,176 @@
#!/bin/bash
#############################################################
# ===== Log =====
# log.info xxx
# log.warn xxx
# log.info xxx
# log.debug xxx
# 带颜色的echo
function log.color_output() {
local color=$1
shift 1
echo >&2 -e "\033[${color}m$@\033[0m"
return 0
}
# Log is named without prefix "utils." for convenience
# Usage: log.log <level> ...content
function log.log() {
if [[ $# < 2 ]]; then
return -1
fi
local level=$1
shift 1
case $level in
error) log.color_output "0;31" "[ERROR] $@" ;;
warn) log.color_output "1;33" "[WARN] $@" ;;
info) log.color_output "1;37" "[INFO] $@" ;;
debug) log.color_output "1;30" "[DEBUG] $@" ;;
esac
return 0
}
function log.error() { log.log "error" "$@"; }
function log.warn() { log.log "warn" $@; }
function log.info() { log.log "info" $@; }
function log.debug() { log.log "debug" $@; }
# 发送通知
function notify-send() {
# Detect user using the display
local user=$(who | awk '{print $1}' | head -n 1)
# Detect uid of the user
local uid=$(id -u $user)
log.debug "User is $user and the uid of it is $uid"
sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${uid}/bus notify-send $@
}
# 检测网络链接畅通
function network-check()
{
# 超时时间
local timeout=15
# 目标网站
local target=www.baidu.com
# 获取响应状态码
local ret_code=`curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1`
if [ "x$ret_code" = "x200" ] ; then
# 网络畅通
return 0
else
# 网络不畅通
return 1
fi
}
###############################################################
if [ "$(id -u)" != "0" ]; then
log.error "Nope we need root to run"
exit -1
fi
network-check
if [ $? -ne 0 ] ; then
log.error "NETWORK_FAIL"
exit -1
fi
# The code above is modified from https://blog.csdn.net/yaxuan88521/article/details/120516298
if command -v aptss ;then
APT_COMMAND=aptss
/usr/bin/apt update
log.info "Using aptss to operate the upgrade process since we detect it."
elif [ -e /usr/bin/apt ];then
APT_COMMAND=/usr/bin/apt
log.info "Using apt to operate the upgrade process."
else
log.error "Nope we support debian only now"
exit -1
fi
${APT_COMMAND} clean
${APT_COMMAND} update
updatetext=`${APT_COMMAND} update 2>&1`
until [ "`echo $updatetext | grep E: `" = "" ];do
log.info "UPDATE_ERROR_AND_WAIT_15_SEC"
sleep 15
updatetext=`${APT_COMMAND} update 2>&1`
done
# 获取可升级包的数量
update_app_number=$(env LANGUAGE=en_US ${APT_COMMAND} list --upgradable 2>/dev/null | grep -c upgradable)
if [ "$update_app_number" -le 0 ] ; then
exit 0
fi
# 获取用户选择的要更新的应用
PKG_LIST="$(env LANGUAGE=en_US ${APT_COMMAND} list --upgradable | awk NR\>1)"
# 指定分隔符为 \n
IFS_OLD="$IFS"
IFS=$'\n'
for line in $PKG_LIST ; do
PKG_NAME=$(echo $line | awk -F ' ' '{print $1}')
PKG_NEW_VER=$(echo $line | awk -F ' ' '{print $2}')
PKG_CUR_VER=$(echo $line | awk -F ' ' '{print $3}')
# dpkg --compare-versions $PKG_NEW_VER le $PKG_CUR_VER
# if [ $? -eq 0 ] ; then
# let update_app_number=$update_app_number-1
# continue
# fi
## 检测是否是 hold 状态
PKG_STA=$(dpkg-query -W -f='${db:Status-Want}' $PKG_NAME)
if [ "$PKG_STA" = "hold" ] ; then
let update_app_number=$update_app_number-1
fi
done
# 还原分隔符
IFS="$IFS_OLD"
if [ $update_app_number -le 0 ] ; then
log.info "No package need to upgrade after ignoring those holded ones. exit"
exit 0
fi
## 如果都是hold或者版本一致的那就直接退出,否则把剩余的给提醒了
user=$(who | awk '{print $1}' | head -n 1)
log.info "ACE Amber-PM 环境中有 $update_app_number 个软件包可升级,正在自动升级"
notify-send -a apm "ACE Amber-PM" "ACE Amber-PM环境中有${update_app_number}个软件包可升级,执行自动升级..."
${APT_COMMAND} clean
${APT_COMMAND} full-upgrade -y
${APT_COMMAND} clean
notify-send -a apm "ACE兼容环境" "自动升级结束"
@@ -0,0 +1 @@
# File in this dir will be seen as one of XDG_DATA_DIRS in ACE container.
@@ -0,0 +1,10 @@
[Desktop Entry]
Exec=xdg-open %U
MimeType=inode/directory;application/x-mimearchive;x-scheme-handler/http;x-scheme-handler/https;application/msword;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/x-gzip;application/zip;application/rar;application/x-tar;application/pdf;application/rtf;image/gif;image/jpeg;image/jp2;image/png;image/tiff;image/bmp;image/svg+xml;image/webp;image/x-icon;application/kswps;application/kset;application/ksdps;application/x-photoshop;application/x-coreldraw;application/x-shockwave-flash;text/plain;application/x-javascript;text/javascript;text/css;text/html;application/xhtml+xml;text/xml;text/x-vcard;application/x-httpd-php;application/java-archive;application/vnd.android.package-archive;application/octet-stream;application/x-x509-user-cert;audio/mpeg;audio/midi;audio/x-wav;audio/x-mpegurl;audio/x-m4a;audio/ogg;audio/x-realaudio;video/mp4;video/mpeg;video/quicktime;video/x-m4v;video/x-ms-wmv;video/x-msvideo;video/webm;video/x-flv;application/xhtml_xml;
Name=ace-run-in-host-os
NoDisplay=true
Terminal=false
TryExec=
Type=Application
Version=1.0
@@ -0,0 +1,4 @@
#!/bin/bash
### We do not want users to install ACE in ACE.
echo "Running ACE in ACE is NOT Tested or recommended. Exit"
exit 1
@@ -0,0 +1,2 @@
#!/bin/bash
host-spawn /var/lib/apm/apm/files/bin/ace-run-bwrap "$@"
@@ -0,0 +1,6 @@
#!/bin/bash
if [ "$1" = "open" ];then
xdg-open ${@:2}
else
/usr/bin/gio $@
fi
@@ -0,0 +1,6 @@
#!/bin/bash
if [ "$UID" = "0" ];then
$@
else
host-spawn pkexec apm-debug $@
fi
@@ -0,0 +1,6 @@
#!/bin/bash
if [ "$UID" = "0" ];then
/usr/bin/sudo $@
else
host-spawn sudo apm-debug sudo env IS_ACE_ENV="1" PATH="/amber-ce-tools/bin-override:$PATH" "$@"
fi
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,143 @@
#!/bin/bash
if [ "$IS_ACE_ENV" != "1" ];then
echo "ONLY RUN ME IN ACE"
exit
fi
printf "ACE: Setting up sudo...\n"
mkdir -p /etc/sudoers.d
# Do not check fqdn when doing sudo, it will not work anyways
if ! grep -q 'Defaults !fqdn' /etc/sudoers.d/sudoers; then
printf "Defaults !fqdn\n" >> /etc/sudoers.d/sudoers
fi
# Ensure passwordless sudo is set up for user
if ! grep -q "\"${container_user_name}\" ALL = (root) NOPASSWD:ALL" /etc/sudoers.d/sudoers; then
printf "\"%s\" ALL = (root) NOPASSWD:ALL\n" "${container_user_name}" >> /etc/sudoers.d/sudoers
fi
printf "ACE: Setting up groups...\n"
# If not existing, ensure we have a group for our user.
if ! grep -q "^${container_user_name}:" /etc/group; then
if ! groupadd --force --gid "${container_user_gid}" "${container_user_name}"; then
# It may occur that we have users with unsupported user name (eg. on LDAP or AD)
# So let's try and force the group creation this way.
printf "%s:x:%s:" "${container_user_name}" "${container_user_gid}" >> /etc/group
fi
fi
printf "ACE: Setting up users...\n"
# Setup kerberos integration with the host
if [ -d "/run/host/var/kerberos" ] &&
[ -d "/etc/krb5.conf.d" ] &&
[ ! -e "/etc/krb5.conf.d/kcm_default_ccache" ]; then
cat << EOF > "/etc/krb5.conf.d/kcm_default_ccache"
# # To disable the KCM credential cache, comment out the following lines.
[libdefaults]
default_ccache_name = KCM:
EOF
fi
# If we have sudo/wheel groups, let's add the user to them.
additional_groups=""
if grep -q "^sudo" /etc/group; then
additional_groups="sudo"
elif grep -q "^wheel" /etc/group; then
additional_groups="wheel"
fi
# Let's add our user to the container. if the user already exists, enforce properties.
#
# In case of AD or LDAP usernames, it is possible we will have a backslach in the name.
# In that case grep would fail, so we replace the backslash with a point to make the regex work.
# shellcheck disable=SC1003
if ! grep -q "^$(printf '%s' "${container_user_name}" | tr '\\' '.'):" /etc/passwd &&
! grep -q "^.*:.*:${container_user_uid}:" /etc/passwd; then
if ! useradd \
--home-dir "${container_user_home}" \
--no-create-home \
--groups "${additional_groups}" \
--shell "${SHELL:-"/bin/bash"}" \
--uid "${container_user_uid}" \
--gid "${container_user_gid}" \
"${container_user_name}"; then
printf "Warning: there was a problem setting up the user\n"
printf "Warning: trying manual addition\n"
printf "%s:x:%s:%s:%s:%s:%s" \
"${container_user_name}" "${container_user_uid}" \
"${container_user_gid}" "${container_user_name}" \
"${container_user_home}" "${SHELL:-"/bin/bash"}" >> /etc/passwd
printf "%s::1::::::" "${container_user_name}" >> /etc/shadow
fi
# Ensure we're not using the specified SHELL. Run it only once, so that future
# user's preferences are not overwritten at each start.
elif [ ! -e /etc/passwd.done ]; then
# This situation is presented when podman or docker already creates the user
# for us inside container. We should modify the user's prepopulated shadowfile
# entry though as per user's active preferences.
# If the user was there with a different username, get that username so
# we can modify it
if ! grep -q "^$(printf '%s' "${container_user_name}" | tr '\\' '.'):" /etc/passwd; then
user_to_modify=$(getent passwd "${container_user_uid}" | cut -d: -f1)
fi
if ! usermod \
--home "${container_user_home}" \
--shell "${SHELL:-"/bin/bash"}" \
--groups "${additional_groups}" \
--uid "${container_user_uid}" \
--gid "${container_user_gid}" \
--login "${container_user_name}" \
"${user_to_modify:-"${container_user_name}"}"; then
printf "Warning: there was a problem setting up the user\n"
fi
touch /etc/passwd.done
fi
# We generate a random password to initialize the entry for the user and root.
temporary_password="$(cat /proc/sys/kernel/random/uuid)"
printf "%s\n%s\n" "${temporary_password}" "${temporary_password}" | passwd root
printf "%s:%s" "${container_user_name}" "${temporary_password}" | chpasswd -e
# Delete password for root and user
printf "%s:" "root" | chpasswd -e
printf "%s:" "${container_user_name}" | chpasswd -e
mkdir -p /usr/share/fonts
mkdir -p /usr/share/icons
mkdir -p /usr/share/themes
## init host-spawn
unlink /amber-ce-tools/bin-override/host-spawn
ln -sfv /amber-ce-tools/bin-override/host-spawn-$(uname -m) /amber-ce-tools/bin-override/host-spawn
exit 0
## install host-integration
pushd /amber-ce-tools/ace-host-integration
dpkg-deb -Z xz -b . ../ace-host-integration.deb
popd
apt install --reinstall /amber-ce-tools/ace-host-integration.deb -y
cd /amber-ce-tools/data-dir/
ln -sfv ../../usr/share/applications/ .
ln -sfv ../../usr/share/icons/ .
#ln -svf ../../usr/share/mime .
rm -vf ./mime
update-desktop-database /usr/share/applications || true
update-mime-database /usr/share/mime || true
@@ -0,0 +1 @@
# App in this dir will be integrated to host os. Will create symbol link when installing
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
if [ "$UID" != "0" ];then
pkexec $0
exit
fi
apm-debug amber-pm-dstore-patch
+117
View File
@@ -0,0 +1,117 @@
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "当前用户不是 root 用户,退出"
exit
fi
if [ "$PACKAGE_NAME" = "" ];then
curdir=`realpath $0`
parent_dir=`dirname $curdir`
pparent_dir=`dirname $parent_dir`
ppparent_dir=`dirname $pparent_dir`
PKGNAME=`basename $ppparent_dir`
else
PKGNAME=$PACKAGE_NAME
fi
chrootEnvPath=/var/lib/apm/$PKGNAME/files/ace-env
#if [ ! -e $chrootEnvPath ];then
echo "Uncompress the env...."
tar -xvf $chrootEnvPath.tar.xz -C /var/lib/apm/$PKGNAME/files/
#fi
HERE="$(dirname $(realpath $0))"
function get_current_user() {
# 优先通过 who 命令获取用户
local user
user=$(who | awk '{print $1}' | head -n 1 2>/dev/null)
# 如果 who 无输出,则通过 loginctl 获取
if [[ -z "$user" ]]; then
user=$(loginctl list-sessions --no-legend 2>/dev/null | awk '{print $3}' | head -n 1)
fi
# 返回最终结果(可能为空)
echo "${user}"
}
non_root_user=$(get_current_user)
uid=$(id -u $non_root_user)
function bookworm-run(){
bwrap --dev-bind $chrootEnvPath/ / \
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
--setenv PATH /amber-ce-tools/bin-override:$PATH \
--setenv IS_ACE_ENV "1" \
--dev-bind-try /media /media \
--dev-bind-try /tmp /tmp \
--dev /dev \
--dev-bind-try /dev/dri /dev/dri \
--proc /proc \
--dev-bind / /host \
--dev-bind /sys /sys \
--dev-bind /run /run \
--dev-bind-try /run/user/$uid/pulse /run/user/$uid/pulse \
--bind-try /usr/share/themes /usr/local/share/themes \
--bind-try /usr/share/icons /usr/local/share/icons \
--bind-try /usr/share/fonts /usr/local/share/fonts \
--hostname Amber-PM \
--unshare-uts \
--dev-bind-try /etc/resolv.conf /etc/resolv.conf \
--dev-bind-try /home /home \
$@
}
echo "Update the flamescion container tools"
cp -r `dirname $chrootEnvPath`/amber-ce-tools/ $chrootEnvPath
export container_user_gid="$(sudo -u $non_root_user id -rg)"
export container_user_home="/home/${non_root_user}"
export container_user_name="${non_root_user}"
export container_user_uid="$(sudo -u $non_root_user id -ru)"
#####init
bookworm-run bash /amber-ce-tools/container-init/init.sh
rm $chrootEnvPath/etc/localtime
cp $(realpath /etc/localtime) $chrootEnvPath/etc/localtime
chmod 777 $chrootEnvPath/etc/localtime
bookworm-run cp /host/etc/locale.gen /etc/locale.gen && locale-gen
bookworm-run touch /finish.flag
bookworm-run apt clean
bookworm-run chown -R $(get_current_user) /usr/lib/locale/
sudo -u $(get_current_user) bwrap --dev-bind $chrootEnvPath/ / \
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
--setenv PATH /amber-ce-tools/bin-override:$PATH \
--setenv IS_ACE_ENV "1" \
--dev-bind $chrootEnvPath/ / \
--dev-bind-try /media /media \
--dev-bind-try /tmp /tmp \
--dev /dev \
--dev-bind-try /dev/dri /dev/dri \
--proc /proc \
--dev-bind /sys /sys \
--dev-bind /run /run \
--dev-bind-try /run/user/$uid/pulse /run/user/$uid/pulse \
--dev-bind / /host \
--bind-try /usr/share/themes /usr/local/share/themes \
--bind-try /usr/share/icons /usr/local/share/icons \
--bind-try /usr/share/fonts /usr/local/share/fonts \
--dev-bind-try /etc/resolv.conf /etc/resolv.conf \
--dev-bind-try /home /home \
locale-gen
bookworm-run update-locale LANG=$LANG
chown -R root $chrootEnvPath
mkdir -p $chrootEnvPath/amber-ce-tools/data-dir
ln -sv ../../usr/share/applications $chrootEnvPath/amber-ce-tools/data-dir/
ln -sv ../../usr/share/icons $chrootEnvPath/amber-ce-tools/data-dir/
chmod 777 -R $chrootEnvPath/usr/share/icons
rm -vfr $chrootEnvPath/dev/*
true
+157
View File
@@ -0,0 +1,157 @@
#!/bin/bash
bash(){
/usr/bin/bash --rcfile <(cat ~/.bashrc; echo "PS1=\"\[\e[37;40m\][\[\e[32;40m\]\u\[\e[37;40m\]@Amber-PM \[\e[36;40m\]\w\[\e[0m\]]\\\$ \"") $@
}
export -f bash
curdir=`realpath $0`
parent_dir=`dirname $curdir`
pparent_dir=`dirname $parent_dir`
ppparent_dir=`dirname $pparent_dir`
PKGNAME=`basename $ppparent_dir`
export ACE_PACKAGE_NAME=$PKGNAME
chrootEnvPath=/var/lib/apm/$PKGNAME/files/ace-env
if [ ! -e $chrootEnvPath/finish.flag ];then
if [ "$(id -u)" = "0" ]; then
`dirname $chrootEnvPath`/bin/ace-init
else
pkexec `dirname $chrootEnvPath`/bin/ace-init
fi
fi
non_root_user=$(who | awk '{print $1}' | head -n 1)
uid=$(id -u $non_root_user)
#### This part is for args pharm
if [ "$1" = "" ];then
container_command="bash"
else
container_command="$1"
shift
for arg in "$@"; do
arg="$(echo "${arg}x" | sed 's|'\''|'\'\\\\\'\''|g')"
arg="${arg%x}"
container_command="${container_command} '${arg}'"
done
fi
#########################################################################################
##########合成bwrap 1. 基础函数配置段
# 初始化 EXEC_COMMAND 为 bwrap 基础指令
EXEC_COMMAND="bwrap --dev-bind / / bwrap"
# add_command 函数定义
function add_command() {
# 参数拼接,考虑到转义和空格的处理
for arg in "$@"; do
EXEC_COMMAND="${EXEC_COMMAND} ${arg}"
done
}
function add_env_var() {
local var_name="${1}"
local var_value="${2}"
if [ "$var_value" != "" ]; then
add_command "--setenv $var_name $var_value"
fi
}
##########合成bwrap 2. 特殊需求函数配置段
function cursor_theme_dir_integration() {
local directory=""
if [ "$(id -u)" = "0" ]; then #####We don't want bother root to install themes,but will try to fix the unwriteable issue
mkdir -p $chrootEnvPath/usr/share/icons
chmod 777 -R $chrootEnvPath/usr/share/icons
return
fi
for directory in "/usr/share/icons"/*; do
# 检查是否为目录
if [ -d "$directory" ]; then
# 检查目录中是否存在 cursors 文件
if [ -d "$directory/cursors" ]; then
if [ -w $chrootEnvPath/usr/share/icons ];then
add_command "--ro-bind-try $directory $directory"
fi
fi
fi
done
}
##########合成bwrap 3. 环境变量和目录绑定配置段
# 添加环境变量和其他初始设置
ENV_VARS=(
"FAKEROOTDONTTRYCHOWN 1"
"PULSE_SERVER /run/user/\$uid/pulse/native"
"PATH /amber-ce-tools/bin-override:\$PATH"
"IS_ACE_ENV 1"
"IS_APM_ENV 1"
"XDG_DATA_DIRS /amber-ce-tools/additional-data-dir-in-container:\$XDG_DATA_DIRS"
)
BIND_DIRS=(
"--dev-bind $chrootEnvPath/ /"
"--dev-bind-try /media /media"
"--dev-bind-try /mnt /mnt"
"--dev-bind-try /tmp /tmp"
"--dev-bind-try /data /data"
"--dev-bind-try /dev /dev"
"--proc /proc"
"--dev-bind /sys /sys"
"--dev-bind /run /run"
"--dev-bind-try /run/user/\$uid/pulse /run/user/\$uid/pulse"
"--dev-bind / /host"
"--ro-bind-try /usr/share/themes /usr/local/share/themes"
"--ro-bind-try /usr/share/icons /usr/local/share/icons"
"--ro-bind-try /usr/share/fonts /usr/local/share/fonts"
"--dev-bind-try /etc/resolv.conf /etc/resolv.conf"
"--dev-bind-try /home /home"
)
EXTRA_ARGS=(
"--cap-add CAP_SYS_ADMIN"
)
EXTRA_SCRIPTS=(
# cursor_theme_dir_integration
)
##########合成bwrap 4. 合成并执行指令
# 逐一添加到 EXEC_COMMAND
for var in "${ENV_VARS[@]}"; do
add_env_var $var
done
for var in "${BIND_DIRS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_ARGS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_SCRIPTS[@]}"; do
$var
done
# 添加最终的 bash 命令
add_command "bash -c \"${container_command}\""
# 输出完整的 EXEC_COMMAND 以查看
# echo "${EXEC_COMMAND}"
# 注意: 实际执行时,请确保所有变量(如 $uid, $chrootEnvPath 等)都已正确定义
eval ${EXEC_COMMAND}
+71
View File
@@ -0,0 +1,71 @@
#!/bin/bash
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
if [ "$UID" != "0" ];then
log.error "需要以root权限运行 Need to be run as root."
exit 1
fi
if [ -z "$1" ];then
log.error "需要把ace-env所在的路径设置为第一个参数"
exit 1
fi
# 1\. 获取宿主机 NVIDIA 驱动版本
nvidia_version=$(cat /sys/module/nvidia/version 2>/dev/null)
if [ -z "$nvidia_version" ]; then
log.warn "无法获取 NVIDIA 驱动版本 Can not determine NVIDIA Driver version"
exit 1
fi
# 2\. 目标目录准备
ACE_DIR="$1"
if [[ ! -e "${ACE_DIR}" ]];then
log.error "未检测到 apm安装,请安装后再试 apm is not detected. Please try again after installation"
log.info "请按回车关闭... Press Enter to close..."
read
exit 1
fi
mkdir -p "$ACE_DIR/usr/lib" "$ACE_DIR/usr/lib32"
log.info "正在链接 NVIDIA 驱动库 Linking NVIDIA Driver Libs"
# 3\. 收集库文件路径
lib_list=$(ldconfig -p | grep -Ei "nvidia|libcuda" | cut -d'>' -f2)
# 4\. 复制库文件
copied=0
for lib in $lib_list; do
resolved=$(readlink -f "$lib") # 解析符号链接
if file "$resolved" | grep -q "32-bit"; then
ln -sf "/host/$resolved" "$ACE_DIR/usr/lib32/$(basename $lib)"
else
ln -sf "/host/$resolved" "$ACE_DIR/usr/lib/$(basename $lib)"
copied=1
fi
done
# 5\. 复制辅助文件
additional_files=(
/usr/share/vulkan/icd.d/nvidia_icd.json
/usr/share/egl/egl_external_platform.d/20_nvidia_xcb.json
)
for file in "${additional_files[@]}"; do
if [ -f "$file" ]; then
file=$(readlink -f "$file")
dir=$(dirname "$file")
mkdir -p "$ACE_DIR/$dir"
ln -sf "/host/$file" "$ACE_DIR/$dir"
fi
done
# 6\. 标记版本
if [ $copied -eq 1 ]; then
echo "$nvidia_version" > "$ACE_DIR/current_version"
log.info "NVIDIA 驱动库已成功链接 Nvidia Driver Libs are successfully linked. "
else
log.info "未找到有效 NVIDIA 库文件 No valid NVIDIA Driver Libs found."
fi
+60
View File
@@ -0,0 +1,60 @@
#!/bin/bash
set -e
if [ `which debootstrap` = "" ];then
echo "Need to install debootstrap!"
exit
fi
if [ `which systemd-nspawn` = "" ];then
echo "Need to install systemd-container!"
exit
fi
if [ "$2" = "" ];then
echo "Usage: $0 ARCHITECTURE CODENAME"
exit
fi
sudo cp /usr/share/debootstrap/scripts/sid /usr/share/debootstrap/scripts/crimson -v
sudo cp /usr/share/debootstrap/scripts/sid /usr/share/debootstrap/scripts/beige -v
CODENAME=$2
# Set distroname and components based on codename
if [ "$CODENAME" = "beige" ] || [ "$CODENAME" = "crimson" ]; then
DISTRONAME="deepin/beige"
COMPONENTS="main,community,commercial"
GPG_CHECK="--no-check-gpg"
else
DISTRONAME="debian"
COMPONENTS="main,contrib,non-free,non-free-firmware"
GPG_CHECK=""
fi
if [ "$1" = "amd64" ] || [ "$1" = "x86_64" ];then
ARCH="amd64"
ARCH_ANOTHERWAY="x64"
cd "`dirname $0`"
sudo debootstrap $GPG_CHECK --components=$COMPONENTS --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} $2 ./ace-env https://mirrors.cernet.edu.cn/${DISTRONAME}/
elif [ "$1" = "arm64" ] || [ "$1" = "arm" ]|| [ "$1" = "aarch64" ];then
ARCH="arm64"
ARCH_ANOTHERWAY="arm64"
cd "`dirname $0`"
sudo debootstrap $GPG_CHECK --components=$COMPONENTS --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} $2 ./ace-env https://mirrors.cernet.edu.cn/${DISTRONAME}/
elif [ "$1" = "loong64" ] || [ "$1" = "loongarch64" ];then
if [ "$CODENAME" = "beige" ] || [ "$CODENAME" = "crimson" ]; then
ARCH="loong64"
ARCH_ANOTHERWAY="loongarch64"
cd "`dirname $0`"
sudo debootstrap $GPG_CHECK --components=$COMPONENTS --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} $2 ./ace-env https://mirrors.cernet.edu.cn/${DISTRONAME}/
else
echo "LoongArch64 is only supported on Deepin (beige/crimson)"
exit 1
fi
fi
sudo rm -rf ace-env/var/cache/apt/archives/*.deb
sudo rm -vfr ace-env/dev/*
sudo tar -I 'xz -T0' -cvf ace-env.tar.xz ace-env/*
sudo rm -rf ace-env
+46
View File
@@ -0,0 +1,46 @@
# Tips
1. apm run 会优先尝试独立环境内启动,失败后会在主机环境尝试启动
2. apm 添加了一个钩子(debian only),在安装到 /var/lib/apm 下的应用存在ace-env时,进行configure nvidia操作;若存在entries,则进行链接到/usr/share/applications操作
3. apm 内置 rootfs的修改如下
* 安装xz-utils
* 安装 bash-completion
* 安装 ca-certificates
* 使用支持apm源的aptss,使用独立的sources.list.d,删除原有的源
* 安装一个空的apm包,用于填充依赖,附带 amber-pm-dstore-patch
* 删除/var/lib/dpkg的 status status-old available cmethopt diversions diversions-old
4. 打包 apm 包时需要注意的
* 对应的desktop的 Exec 和 Tryexec 均需要加入 `apm run 包名` 前缀(未完成自动化)
* 完成释放后应删除tar.xz(未完成)
5. apm todo(未完成)
* apm版融合商店
* 类似 Wine 运行器的方式全图形化傻瓜式打包
* 自动融合 APM 应用到系统主机,并实现右键卸载
---
已完成
* apm 自动刷新 apm 仓库
* 完善 amber-pm-common 以快速创建rootfs(生成所有 locales )
* 添加 gxde fixer 确保在GXDE下可以正常展示应用(即进行一次host integration类操作)
* 完成amd64软件源配置
* 修改aptss以兼容APM源加速
* apm环境变量添加 IS_APM_ENV=1 GTK_USE_PORTAL=1
* 重要:如何在APM内更新内容——如何覆盖?
* deb全自动转apm