commit 63e8d82d2166a7221cbb637a9a96caad8f3eab99 Author: crims0n Date: Wed Jun 2 00:02:41 2021 +0300 git init diff --git a/.build_dir b/.build_dir new file mode 100644 index 0000000..46f7482 --- /dev/null +++ b/.build_dir @@ -0,0 +1 @@ +/build/focal diff --git a/autoinstall b/autoinstall new file mode 100755 index 0000000..f7400c0 --- /dev/null +++ b/autoinstall @@ -0,0 +1,73 @@ +#!/bin/bash + +set -e # exit on error +set -o pipefail # exit on pipeline error +set -u # treat unset variable as error + +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +PARENT_DIR="$(dirname "$SCRIPT_DIR")" +ISO_DIR="$(dirname "$SCRIPT_DIR")"/iso + +set +u +if [ -z $OUTPUT ]; then + . $SCRIPT_DIR/linux-live/buildconfig || exit 1 +fi +set -u +. $SCRIPT_DIR/linux-live/minioslib || exit 1 +. $SCRIPT_DIR/linux-live/config || exit 1 + +# don't change! use ./install instead +UNATTENDED="1" + +CMD=(setup_host build_bootstrap build_chroot build_live build_modules_chroot build_modules_live build_iso) + +# ============= main ================ + +BUILD_DIR="" + +common_variables + +if [ -f /.dockerenv ] || [ "$container" = "podman" ]; then + new_run +fi + +console_colours + +allow_root_only + +create_livekitname_install_symlink + +create_completion + +create_backup + +# check number of args +if [[ $# == 0 || $# > 3 ]]; then help; fi + +# loop through args +dash_flag=false +start_index=0 +end_index=${#CMD[*]} +for ii in "$@"; do + if [[ $ii == "-" ]]; then + dash_flag=true + continue + fi + find_index $ii + if [[ $dash_flag == false ]]; then + start_index=$index + else + end_index=$(($index + 1)) + fi +done +if [[ $dash_flag == false ]]; then + end_index=$(($start_index + 1)) +fi + +#loop through the commands +for ((ii = $start_index; ii < $end_index; ii++)); do + setup_build_dir + ${CMD[ii]} +done + +echo -e "${BOLD}${LIGHTYELLOW}$0${ENDCOLOUR} - ${LIGHTGREEN}Command completed successfully!${ENDCOLOUR}" diff --git a/docker/01-runme.sh b/docker/01-runme.sh new file mode 100755 index 0000000..00759ea --- /dev/null +++ b/docker/01-runme.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Several packages need to be installed to use Dockerfile.py +# It creates a local container that you can use to build minios-live +apt install python3-pip +pip3 install pydocker +python3 ./Dockerfile.py \ No newline at end of file diff --git a/docker/02-build.sh b/docker/02-build.sh new file mode 100755 index 0000000..b7f4d84 --- /dev/null +++ b/docker/02-build.sh @@ -0,0 +1,5 @@ +#!/bin/bash +#docker run -d --name mlc --privileged -v /build:/build local/mlc /build/slax/autoinstall - +docker run --rm -it --privileged -v /build:/build local/mlc /build/slax/autoinstall build_modules_chroot - +#docker run -it --name mlc --privileged -v /build:/build local/mlc +#docker run -d --name mlc --privileged -v /build:/build local/mlc \ No newline at end of file diff --git a/docker/Dockerfile.py b/docker/Dockerfile.py new file mode 100755 index 0000000..8036cec --- /dev/null +++ b/docker/Dockerfile.py @@ -0,0 +1,68 @@ +#!/usr/bin/python3 +# Dockerfile.py + +import sys +import logging +import pydocker # github.com/jen-soft/pydocker + +logging.getLogger('').setLevel(logging.INFO) +logging.root.addHandler(logging.StreamHandler(sys.stdout)) + + +class DockerFile(pydocker.DockerFile): + """ add here your custom features """ + +#d = DockerFile(base_img='ubuntu:focal', name='crims0n/minios-live-container:latest') +d = DockerFile(base_img='ubuntu:focal', name='local/mlc:latest') + +d.RUN_bash_script('/opt/install.sh', r''' +touch /.minios-live-container +apt-get update -y +apt-get install -y wget sudo debootstrap xorriso genisoimage binutils squashfs-tools grub-pc-bin grub-efi-amd64-bin dosfstools mtools xz-utils liblz4-tool zstd +: 'apt-get install -y patch +cd /opt/ +wget -c http://ru.archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.123ubuntu2_all.deb +dpkg -i /opt/debootstrap_1.0.123ubuntu2_all.deb +rm -f /opt/debootstrap_1.0.123ubuntu2_all.deb +cat <<'EOF' >/usr/share/debootstrap/functions.diff +--- functions 2020-10-23 20:42:16.000000000 +0300 ++++ functions.new 2021-01-16 23:22:25.612064306 +0300 +@@ -1176,7 +1176,9 @@ + umount_on_exit /dev/shm + umount_on_exit /proc + umount_on_exit /proc/bus/usb +- umount "$TARGET/proc" 2>/dev/null || true ++ if [ ! -h "$TARGET/proc" ]; then ++ umount "$TARGET/proc" 2>/dev/null || true ++ fi + + # some container environment are used at second-stage, it already treats /proc and so on + if [ -z "$(ls -A "$TARGET/proc")" ]; then + +EOF +cd /usr/share/debootstrap/ +patch 3 ]]; then help; fi + +# loop through args +dash_flag=false +start_index=0 +end_index=${#CMD[*]} +for ii in "$@"; do + if [[ $ii == "-" ]]; then + dash_flag=true + continue + fi + find_index $ii + if [[ $dash_flag == false ]]; then + start_index=$index + else + end_index=$(($index + 1)) + fi +done +if [[ $dash_flag == false ]]; then + end_index=$(($start_index + 1)) +fi + +#loop through the commands +for ((ii = $start_index; ii < $end_index; ii++)); do + setup_build_dir + ${CMD[ii]} +done + +echo -e "${BOLD}${LIGHTYELLOW}$0${ENDCOLOUR} - ${LIGHTGREEN}Command completed successfully!${ENDCOLOUR}" diff --git a/linux-live/DOC/GNU_GPL b/linux-live/DOC/GNU_GPL new file mode 100644 index 0000000..86568a9 --- /dev/null +++ b/linux-live/DOC/GNU_GPL @@ -0,0 +1,341 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + 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 +this service 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. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/linux-live/DOC/LICENSE b/linux-live/DOC/LICENSE new file mode 100644 index 0000000..45a5fa7 --- /dev/null +++ b/linux-live/DOC/LICENSE @@ -0,0 +1,13 @@ + + License: + + This software is released under GNU GENERAL PUBLIC LICENSE. + + Warranty: + + This software is distributed with NO WARRANTY, use it at your own risk. + + Author: + + This software is written by + Tomas M. diff --git a/linux-live/DOC/boot_parameters.txt b/linux-live/DOC/boot_parameters.txt new file mode 100644 index 0000000..8f19f81 --- /dev/null +++ b/linux-live/DOC/boot_parameters.txt @@ -0,0 +1,5 @@ +You can pass the following boot parameters: + +debug ... start shell prompt several times during live kit startup + +from=... load data from given directory (search all drives for it) diff --git a/linux-live/DOC/bundle.txt b/linux-live/DOC/bundle.txt new file mode 100644 index 0000000..82d310d --- /dev/null +++ b/linux-live/DOC/bundle.txt @@ -0,0 +1,31 @@ +Bundle +------ + +A bundle is compressed squashfs filesystem, consisting of up-to-the-root +directory structure. Old name for bundle is 'module'. Bundle format +brings some new enhancements over the old modules. + +File extension for bundles may vary. Currently Slax uses .sb extension, +where 'sb' means 'slax bundle'. + + +How to create bundle: + + # mksquashfs bundle_rootfs wholefs.sb -comp xz -bs 512k + + or + # mksquashfs /usr /usr.sb --keep-as-directory -comp xz -bs 512k + + or use function in livekitlib: + # . livekitlib; make_bundle bundle_rootfs wholefs.sb + + +Special files in bundle filesystem structure: + + + /run/requires + /run/activate.sh + /run/deactivate.sh + /run/startcmd.sh ? + + diff --git a/linux-live/DOC/sources.txt b/linux-live/DOC/sources.txt new file mode 100644 index 0000000..b303744 --- /dev/null +++ b/linux-live/DOC/sources.txt @@ -0,0 +1,2 @@ +Source code for precompiled binaries (initramfs/static/*) can be found at +http://ftp.slax.org/Slax-7.x-development/sources/Slax-7.0-sources/busybox-and-ntfs3g/ diff --git a/linux-live/DOC/supported_fs.txt b/linux-live/DOC/supported_fs.txt new file mode 100644 index 0000000..ff574d2 --- /dev/null +++ b/linux-live/DOC/supported_fs.txt @@ -0,0 +1,14 @@ +Supported filesystems +--------------------- + +The Live distro created by Linux Live Kit can be installed +on the following filesystems: + +* iso9660 (CD) ..... using isolinux +* FAT32 (vfat) ..... using syslinux or extlinux +* ntfs ............. using syslinux or extlinux +* ext2/3/4,btrfs ... using extlinux +* any other fs ..... using lilo + +Most users will install on FAT32 for compatibility +with the other operating systems (I mean Windows). diff --git a/linux-live/DOC/terminology.txt b/linux-live/DOC/terminology.txt new file mode 100644 index 0000000..93807f9 --- /dev/null +++ b/linux-live/DOC/terminology.txt @@ -0,0 +1,18 @@ +Live Kit +-------- + +* also known as Linux Live Kit. Formely known as Linux Live CD. Nowadays, +people mostly use USB flash drives, cameras, and other devices to run +such 'Live' linuxes, thus Live CD is no longer ideal name for it. + +Meaning of Kit is like a tool, toolkit, or such. Which (I believe) corresponds +with the usage of such Live Linux distribution much better. + + +Bundles +------- + +* compressed squashfs images with some specialities +Read ./bundle.txt for more. + + diff --git a/linux-live/README b/linux-live/README new file mode 100644 index 0000000..1f58c98 --- /dev/null +++ b/linux-live/README @@ -0,0 +1,59 @@ +Linux Live Kit +============== + +Use this set of scripts to turn your existing preinstalled Linux +distribution into a Live Kit (formely known as Live CD). +Make sure to extract and use it on a posix-compatible filesystem, +since it creates some (sym)links and such. + +Note: + +* Store Linux Live kit in a directory which is not going to be included + in your live distro, else it would be copied to it. Best practice is to + make a directory such as /a and put these scripts there. + Be warned, if you put it to /tmp, some distros may erase it on reboot. + +* Before you start building your Kit, edit the file ./config + Most importantly change the LIVEKITNAME variable. + +* Make sure your kernel is in /boot/vmlinuz or change the path in ./config + Your kernel must support squashfs. Your kernel must also support either + aufs or overlayfs or both. AUFS is recommended for more flexibility, + but if your distro does not support it, overlayfs will work too. + +* You may also wish to replace boot graphics in ./bootfiles/bootlogo.png + (one options is to modify and run the ./tools/bootlogo.update script) + and reorganize isolinux.cfg to fit your needs (when editing the file, + keep all paths in /boot/, it will be rellocated during LiveKit creation) + +* Linux Live Kit comes with precompiled static binaries in ./initramfs + directory. Those may be outdated but will work. You may replace them + by your own statically linked binaries, if you know how to compile them. + +* If you plan to boot your Live Kit from CD, you need to recompile + syslinux.bin else it won't be able to boot your Live Kit from directory + LIVEKITNAME. There is a script prepared for you which will handle all + of that. Simply go to directory ./tools/ and run isolinux.bin.update ... + it will update ./bootfiles/isolinux.bin automatically by downloading + isolinux sources, patching them using your actual LIVEKITNAME and + recompiling. This step is not needed if you plan to boot from USB only. + +* If you have tmpfs mounted on /tmp, make sure you have enough RAM + since LiveKit will store lots of data there. If you are low on RAM, + make sure /tmp is a regular on-disk directory. + +* When done, run the ./build script to create your Live Kit + - it will create ISO and TAR files for you in /tmp + - make sure you have enough free space in /tmp to handle it + +* If you want to use the Live Kit on a USB you have to either + - use Windows to execute the bootinst.bat file in the $NAME/boot folder + - or use Linux to execute the shellscript bootinst.sh in the $NAME/boot folder. + +* You will need the following packages to be installed: + - squashfs-tools + - genisoimage or mkisofs + - zip + + +Author: Tomas M. diff --git a/linux-live/aptsources/bionic.list b/linux-live/aptsources/bionic.list new file mode 100644 index 0000000..c620167 --- /dev/null +++ b/linux-live/aptsources/bionic.list @@ -0,0 +1,54 @@ +# deb http://ru.archive.ubuntu.com/ubuntu/ bionic main restricted + +# deb http://ru.archive.ubuntu.com/ubuntu/ bionic-updates main restricted +# deb http://security.ubuntu.com/ubuntu bionic-security main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ bionic main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ bionic main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ bionic-updates main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ bionic-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ bionic universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ bionic universe +deb http://ru.archive.ubuntu.com/ubuntu/ bionic-updates universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ bionic-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://ru.archive.ubuntu.com/ubuntu/ bionic multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ bionic multiverse +deb http://ru.archive.ubuntu.com/ubuntu/ bionic-updates multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ bionic-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu bionic partner +# deb-src http://archive.canonical.com/ubuntu bionic partner + +deb http://security.ubuntu.com/ubuntu bionic-security main restricted +# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted +deb http://security.ubuntu.com/ubuntu bionic-security universe +# deb-src http://security.ubuntu.com/ubuntu bionic-security universe +deb http://security.ubuntu.com/ubuntu bionic-security multiverse +# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse diff --git a/linux-live/aptsources/buster.list b/linux-live/aptsources/buster.list new file mode 100644 index 0000000..d054356 --- /dev/null +++ b/linux-live/aptsources/buster.list @@ -0,0 +1,5 @@ +deb http://deb.debian.org/debian/ buster main contrib non-free +deb http://deb.debian.org/debian/ buster-updates main contrib non-free +deb http://security.debian.org/debian-security buster/updates main contrib non-free + +deb-src http://deb.debian.org/debian/ buster main contrib non-free diff --git a/linux-live/aptsources/focal.list b/linux-live/aptsources/focal.list new file mode 100644 index 0000000..0a100fe --- /dev/null +++ b/linux-live/aptsources/focal.list @@ -0,0 +1,54 @@ +# deb http://ru.archive.ubuntu.com/ubuntu/ focal main restricted + +# deb http://ru.archive.ubuntu.com/ubuntu/ focal-updates main restricted +# deb http://security.ubuntu.com/ubuntu focal-security main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ focal main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ focal main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ focal-updates main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ focal-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ focal universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ focal universe +deb http://ru.archive.ubuntu.com/ubuntu/ focal-updates universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ focal-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://ru.archive.ubuntu.com/ubuntu/ focal multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ focal multiverse +deb http://ru.archive.ubuntu.com/ubuntu/ focal-updates multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ focal-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu focal partner +# deb-src http://archive.canonical.com/ubuntu focal partner + +deb http://security.ubuntu.com/ubuntu focal-security main restricted +# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted +deb http://security.ubuntu.com/ubuntu focal-security universe +# deb-src http://security.ubuntu.com/ubuntu focal-security universe +deb http://security.ubuntu.com/ubuntu focal-security multiverse +# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse diff --git a/linux-live/aptsources/groovy.list b/linux-live/aptsources/groovy.list new file mode 100644 index 0000000..8679716 --- /dev/null +++ b/linux-live/aptsources/groovy.list @@ -0,0 +1,54 @@ +# deb http://ru.archive.ubuntu.com/ubuntu/ groovy main restricted + +# deb http://ru.archive.ubuntu.com/ubuntu/ groovy-updates main restricted +# deb http://security.ubuntu.com/ubuntu groovy-security main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ groovy main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ groovy main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ groovy-updates main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ groovy-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ groovy universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ groovy universe +deb http://ru.archive.ubuntu.com/ubuntu/ groovy-updates universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ groovy-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://ru.archive.ubuntu.com/ubuntu/ groovy multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ groovy multiverse +deb http://ru.archive.ubuntu.com/ubuntu/ groovy-updates multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ groovy-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ groovy-backports main restricted universe multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ groovy-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu groovy partner +# deb-src http://archive.canonical.com/ubuntu groovy partner + +deb http://security.ubuntu.com/ubuntu groovy-security main restricted +# deb-src http://security.ubuntu.com/ubuntu groovy-security main restricted +deb http://security.ubuntu.com/ubuntu groovy-security universe +# deb-src http://security.ubuntu.com/ubuntu groovy-security universe +deb http://security.ubuntu.com/ubuntu groovy-security multiverse +# deb-src http://security.ubuntu.com/ubuntu groovy-security multiverse diff --git a/linux-live/aptsources/sources.list b/linux-live/aptsources/sources.list new file mode 100644 index 0000000..c88ad71 --- /dev/null +++ b/linux-live/aptsources/sources.list @@ -0,0 +1,54 @@ +# deb http://ru.archive.ubuntu.com/ubuntu/ distro main restricted + +# deb http://ru.archive.ubuntu.com/ubuntu/ distro-updates main restricted +# deb http://security.ubuntu.com/ubuntu distro-security main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ distro main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ distro main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ distro-updates main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ distro-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ distro universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ distro universe +deb http://ru.archive.ubuntu.com/ubuntu/ distro-updates universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ distro-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://ru.archive.ubuntu.com/ubuntu/ distro multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ distro multiverse +deb http://ru.archive.ubuntu.com/ubuntu/ distro-updates multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ distro-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ distro-backports main restricted universe multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ distro-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu distro partner +# deb-src http://archive.canonical.com/ubuntu distro partner + +deb http://security.ubuntu.com/ubuntu distro-security main restricted +# deb-src http://security.ubuntu.com/ubuntu distro-security main restricted +deb http://security.ubuntu.com/ubuntu distro-security universe +# deb-src http://security.ubuntu.com/ubuntu distro-security universe +deb http://security.ubuntu.com/ubuntu distro-security multiverse +# deb-src http://security.ubuntu.com/ubuntu distro-security multiverse diff --git a/linux-live/aptsources/trusty.list b/linux-live/aptsources/trusty.list new file mode 100644 index 0000000..da2bbd9 --- /dev/null +++ b/linux-live/aptsources/trusty.list @@ -0,0 +1,54 @@ +# deb http://ru.archive.ubuntu.com/ubuntu/ trusty main restricted + +# deb http://ru.archive.ubuntu.com/ubuntu/ trusty-updates main restricted +# deb http://security.ubuntu.com/ubuntu trusty-security main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ trusty main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ trusty-updates main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ trusty universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty universe +deb http://ru.archive.ubuntu.com/ubuntu/ trusty-updates universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://ru.archive.ubuntu.com/ubuntu/ trusty multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty multiverse +deb http://ru.archive.ubuntu.com/ubuntu/ trusty-updates multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu trusty partner +# deb-src http://archive.canonical.com/ubuntu trusty partner + +deb http://security.ubuntu.com/ubuntu trusty-security main restricted +# deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted +deb http://security.ubuntu.com/ubuntu trusty-security universe +# deb-src http://security.ubuntu.com/ubuntu trusty-security universe +deb http://security.ubuntu.com/ubuntu trusty-security multiverse +# deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse diff --git a/linux-live/aptsources/xenial.list b/linux-live/aptsources/xenial.list new file mode 100644 index 0000000..f22a2bc --- /dev/null +++ b/linux-live/aptsources/xenial.list @@ -0,0 +1,54 @@ +# deb http://ru.archive.ubuntu.com/ubuntu/ xenial main restricted + +# deb http://ru.archive.ubuntu.com/ubuntu/ xenial-updates main restricted +# deb http://security.ubuntu.com/ubuntu xenial-security main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ xenial main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ xenial main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://ru.archive.ubuntu.com/ubuntu/ xenial-updates main restricted +# deb-src http://ru.archive.ubuntu.com/ubuntu/ xenial-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ xenial universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ xenial universe +deb http://ru.archive.ubuntu.com/ubuntu/ xenial-updates universe +# deb-src http://ru.archive.ubuntu.com/ubuntu/ xenial-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://ru.archive.ubuntu.com/ubuntu/ xenial multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ xenial multiverse +deb http://ru.archive.ubuntu.com/ubuntu/ xenial-updates multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ xenial-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://ru.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu xenial partner +# deb-src http://archive.canonical.com/ubuntu xenial partner + +deb http://security.ubuntu.com/ubuntu xenial-security main restricted +# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted +deb http://security.ubuntu.com/ubuntu xenial-security universe +# deb-src http://security.ubuntu.com/ubuntu xenial-security universe +deb http://security.ubuntu.com/ubuntu xenial-security multiverse +# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse diff --git a/linux-live/basesystem/01-casper/install b/linux-live/basesystem/01-casper/install new file mode 100644 index 0000000..637d470 --- /dev/null +++ b/linux-live/basesystem/01-casper/install @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e # exit on error +set -o pipefail # exit on pipeline error +set -u # treat unset variable as error + +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" + +# install packages +if [ -f $SCRIPT_DIR/package.list ]; then + #sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD update >>$OUTPUT 2>&1 && + #sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/package.list | tr "\n" " ") >>$OUTPUT 2>&1 +fi diff --git a/linux-live/basesystem/01-casper/package.list b/linux-live/basesystem/01-casper/package.list new file mode 100644 index 0000000..bfab0fd --- /dev/null +++ b/linux-live/basesystem/01-casper/package.list @@ -0,0 +1,17 @@ +# since we work without modules, we install everything in one file +# main +casper +lupin-casper +discover +laptop-detect +os-prober +network-manager +net-tools +wireless-tools +# gui +xubuntu-core^ +ubiquity +ubiquity-casper +ubiquity-frontend-gtk +ubiquity-slideshow-xubuntu +ubiquity-ubuntu-artwork \ No newline at end of file diff --git a/linux-live/basesystem/01-casper/rootcopy/etc/casper.conf b/linux-live/basesystem/01-casper/rootcopy/etc/casper.conf new file mode 100644 index 0000000..ae7dde1 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/etc/casper.conf @@ -0,0 +1,14 @@ +# This file should go in /etc/casper.conf +# Supported variables are: +# USERNAME, USERFULLNAME, HOST, BUILD_SYSTEM, FLAVOUR + +export USERNAME="live" +export USERFULLNAME="Live session user" +export HOST="minios" +export BUILD_SYSTEM="Ubuntu" + +# USERNAME and HOSTNAME as specified above won't be honoured and will be set to +# flavour string acquired at boot time, unless you set FLAVOUR to any +# non-empty string. + +# export FLAVOUR="Ubuntu" diff --git a/linux-live/basesystem/01-casper/rootcopy/etc/issue b/linux-live/basesystem/01-casper/rootcopy/etc/issue new file mode 100644 index 0000000..7e33ac0 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/etc/issue @@ -0,0 +1,2 @@ +Welcome to MiniOS! \n \l + diff --git a/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/helpers.rc b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/helpers.rc new file mode 100644 index 0000000..fc0f325 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/helpers.rc @@ -0,0 +1 @@ +WebBrowser=google-chrome \ No newline at end of file diff --git a/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/launcher-19/16093657651.desktop b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/launcher-19/16093657651.desktop new file mode 100644 index 0000000..19e8d6c --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/launcher-19/16093657651.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Exec=exo-open --launch FileManager %u +Icon=system-file-manager +StartupNotify=true +Terminal=false +Categories=Utility;X-XFCE;X-Xfce-Toplevel; +OnlyShowIn=XFCE; +X-XFCE-MimeType=inode/directory;x-scheme-handler/trash; +Name=File Manager +Name[ru]=Файловый менеджер +Comment=Browse the file system +Comment[ru]=Просмотреть файловую систему +X-XFCE-Source=file:///usr/share/applications/exo-file-manager.desktop diff --git a/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/launcher-23/16093659533.desktop b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/launcher-23/16093659533.desktop new file mode 100644 index 0000000..0298d34 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/launcher-23/16093659533.desktop @@ -0,0 +1,16 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Exec=exo-open --launch WebBrowser %u +Icon=web-browser +StartupNotify=true +Terminal=false +Categories=Network;X-XFCE;X-Xfce-Toplevel; +OnlyShowIn=XFCE; +X-XFCE-MimeType=x-scheme-handler/http;x-scheme-handler/https; +Name=Web Browser +Name[ru]=Веб-браузер +Comment=Browse the web +Comment[ru]=Смотреть в Интернете +X-XFCE-Source=file:///usr/share/applications/exo-web-browser.desktop +Path= diff --git a/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/launcher-24/16093659584.desktop b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/launcher-24/16093659584.desktop new file mode 100644 index 0000000..2034e66 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/launcher-24/16093659584.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Exec=exo-open --launch TerminalEmulator +Icon=utilities-terminal +StartupNotify=true +Terminal=false +Categories=Utility;X-XFCE;X-Xfce-Toplevel; +OnlyShowIn=XFCE; +Name=Terminal Emulator +Name[ru]=Эмулятор терминала +Comment=Use the command line +Comment[ru]=Использовать командную строку +X-XFCE-Source=file:///usr/share/applications/exo-terminal-emulator.desktop diff --git a/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/whiskermenu-1.rc b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/whiskermenu-1.rc new file mode 100644 index 0000000..f0539a5 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/panel/whiskermenu-1.rc @@ -0,0 +1,68 @@ +favorites=ubiquity.desktop +recent= +button-title=Applications Menu +button-icon=MiniOS-white +button-single-row=false +show-button-title=false +show-button-icon=true +launcher-show-name=true +launcher-show-description=false +launcher-show-tooltip=true +item-icon-size=2 +hover-switch-category=false +category-show-name=true +category-icon-size=1 +load-hierarchy=true +recent-items-max=10 +favorites-in-recent=true +display-recent-default=false +position-search-alternate=true +position-commands-alternate=false +position-categories-alternate=false +menu-width=400 +menu-height=500 +menu-opacity=100 +command-settings=xfce4-settings-manager +show-command-settings=true +command-lockscreen=xflock4 +show-command-lockscreen=true +command-switchuser=dm-tool switch-to-greeter +show-command-switchuser=false +command-logout=xfce4-session-logout +show-command-logout=true +command-menueditor=menulibre +show-command-menueditor=true +command-profile=mugshot +show-command-profile=true +search-actions=5 + +[action0] +name=Man-страницы +pattern=# +command=exo-open --launch TerminalEmulator man %s +regex=false + +[action1] +name=Web-поиск +pattern=? +command=exo-open --launch WebBrowser https://duckduckgo.com/?q=%u +regex=false + +[action2] +name=Википедия +pattern=!w +command=exo-open --launch WebBrowser https://en.wikipedia.org/wiki/%u +regex=false + +[action3] +name=Выполнить в терминале +pattern=! +command=exo-open --launch TerminalEmulator %s +regex=false + +[action4] +name=Открыть URI +pattern=^(file|http|https):\\/\\/(.*)$ +command=exo-open \\0 +regex=true + diff --git a/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml new file mode 100644 index 0000000..38aef24 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linux-live/basesystem/01-casper/rootcopy/etc/timezone b/linux-live/basesystem/01-casper/rootcopy/etc/timezone new file mode 100644 index 0000000..b1f078f --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/etc/timezone @@ -0,0 +1 @@ +Europe/Moscow \ No newline at end of file diff --git a/linux-live/basesystem/01-casper/rootcopy/root/.bashrc b/linux-live/basesystem/01-casper/rootcopy/root/.bashrc new file mode 100644 index 0000000..b0879e6 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/root/.bashrc @@ -0,0 +1,140 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +apt-get() +{ + if [ -e /var/cache/apt/pkgcache.bin ]; then + /usr/bin/apt-get "$@" + else + /usr/bin/apt-get update + /usr/bin/apt-get "$@" + fi +} + +apt() +{ + if [ -e /var/cache/apt/pkgcache.bin ]; then + /usr/bin/apt "$@" + else + /usr/bin/apt update + /usr/bin/apt "$@" + fi +} + +export -f apt-get +export -f apt \ No newline at end of file diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/backgrounds/MiniOS.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/backgrounds/MiniOS.png new file mode 100644 index 0000000..5716d76 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/backgrounds/MiniOS.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/pixmaps/MiniOS-white.svg b/linux-live/basesystem/01-casper/rootcopy/usr/share/pixmaps/MiniOS-white.svg new file mode 100644 index 0000000..ca13046 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/usr/share/pixmaps/MiniOS-white.svg @@ -0,0 +1,149 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/default.plymouth b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/default.plymouth new file mode 120000 index 0000000..b251b32 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/default.plymouth @@ -0,0 +1 @@ +/usr/share/plymouth/themes/minios-logo/minios-logo.plymouth \ No newline at end of file diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/details/details.plymouth b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/details/details.plymouth new file mode 100644 index 0000000..bd84964 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/details/details.plymouth @@ -0,0 +1,4 @@ +[Plymouth Theme] +Name=Details +Description=Verbose fallback theme +ModuleName=details diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/fsck-fade.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/fsck-fade.png new file mode 100644 index 0000000..3ef161a Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/fsck-fade.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/fsck-fade_16bit.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/fsck-fade_16bit.png new file mode 100644 index 0000000..3ada9e0 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/fsck-fade_16bit.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/logo.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/logo.png new file mode 100644 index 0000000..cb8af2d Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/logo.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/logo_16bit.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/logo_16bit.png new file mode 100644 index 0000000..fbae9b3 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/logo_16bit.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/minios-logo.plymouth b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/minios-logo.plymouth new file mode 100644 index 0000000..db7715b --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/minios-logo.plymouth @@ -0,0 +1,8 @@ +[Plymouth Theme] +Name=MiniOS Logo +Description=A theme that features a background with a logo. +ModuleName=script + +[script] +ImageDir=/usr/share/plymouth/themes/minios-logo +ScriptFile=/usr/share/plymouth/themes/minios-logo/minios-logo.script diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/minios-logo.script b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/minios-logo.script new file mode 100644 index 0000000..0f0c1e1 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/minios-logo.script @@ -0,0 +1,512 @@ + /************************************************************************** + * + * Copyright (C) 2011 The Xubuntu Community + * Copyright (C) 2009 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Written by: Mad Nick + * + **************************************************************************/ + +/* + * Related to the screen */ + +screen_width = Window.GetWidth(); +screen_height = Window.GetHeight(); +screen_x = Window.GetX(); +screen_y = Window.GetY(); + +/**/ + +/* + * Images, check bits per pixel + * and load images accordingly */ + +background_image = Image("wallpaper.png"); +passw_dialog_input_image = Image("passw-dialog.png"); +bullet_image = Image("test.png"); + +bpp = Window.GetBitsPerPixel(); + +if (bpp == 4) { + + logotype_image = Image("logo_16bit.png"); + progress_meter_image = Image("progress-meter_16bit.png"); + progress_fade_image = Image("progress-fade_16bit.png"); + fsck_progress_meter_image = Image("progress-meter_16bit.png"); + fsck_progress_fade_image = Image("fsck-fade_16bit.png"); + +} +else { + + logotype_image = Image("logo.png"); + progress_meter_image = Image("progress-meter.png"); + progress_fade_image = Image("progress-fade.png"); + fsck_progress_meter_image = Image("progress-meter.png"); + fsck_progress_fade_image = Image("fsck-fade.png"); + +} + +/**/ + +/* + * Sprites */ + +ratio = screen_height / screen_width; +background_ratio = background_image.GetHeight() / background_image.GetWidth(); +factor = 0; + +if (ratio > background_ratio) { + + factor = screen_height / background_image.GetHeight(); + +} +else { + + factor = screen_width / background_image.GetWidth(); + +} + +scaled = background_image.Scale(background_image.GetWidth() * factor, background_image.GetHeight() * factor); +background_sprite = Sprite(scaled); +background_sprite.SetX(screen_x + screen_width / 2 - scaled.GetWidth() / 2); +background_sprite.SetY(screen_y + screen_height / 2 - scaled.GetHeight() / 2); + +logotype_sprite = Sprite(logotype_image); + +fsck_progress_meter_sprite = Sprite(fsck_progress_meter_image); +fsck_progress_fade_sprite = Sprite(fsck_progress_fade_image.Scale(1, fsck_progress_fade_image.GetHeight())); + +passw_dialog_input_sprite = Sprite(passw_dialog_input_image); +passw_lbl_sprite = Sprite(); + +msg_label_sprite = Sprite(); + +/**/ + +/* + * Misc */ + +counter = 0; + +fade_pos_x = (screen_width / 2) - (progress_meter_image.GetWidth() / 2); +fade_dir = 0; /* 0 = right, 1 = left */ + +fsck_running = 0; +fsck_dev_array; +fsck_dev_counter = 0; +fsck_fade_in_counter = 0; +fsck_done_fading = 0; + +stars_array; +stars_n = 0; + +//full_msg = ""; +msgs_line = [NULL,NULL,NULL,NULL,NULL]; + +/**/ + +/* + * Debug related */ + +debug = 0; +debug_sprite = Sprite(); + +fun debugOutput(str) { + + /* + * This will print to the top left corner */ + debug_sprite.SetImage(Image.Text(str)); + +} + +/**/ + +/* + * Setup the graphics properties */ +logotype_sprite.SetPosition(screen_x + (screen_width / 2) - (logotype_image.GetWidth() / 2), screen_y + (screen_height / 2) - (logotype_image.GetHeight() / 2)); +fsck_progress_meter_sprite.SetPosition(screen_x + (screen_width / 2) - (progress_meter_image.GetWidth() / 2), screen_y + (screen_height / 2) + (logotype_image.GetHeight() / 2) + 25); +fsck_progress_fade_sprite.SetPosition(screen_x + (screen_width / 2) - (progress_meter_image.GetWidth() / 2), screen_y + (screen_height / 2) + (logotype_image.GetHeight() / 2) + 25); +fsck_progress_meter_sprite.SetOpacity(0); +fsck_progress_fade_sprite.SetOpacity(0); +passw_dialog_input_sprite.SetPosition(screen_x + (screen_width / 2) - (passw_dialog_input_image.GetWidth() / 2), screen_y + (screen_height / 2) + (logotype_image.GetHeight() / 2) + 70); +passw_dialog_input_sprite.SetOpacity(0); +passw_lbl_sprite.SetOpacity(0); + +spin = 0; + +/* + * this function only goes up to 100 + * because thats all thats needed for + * the progress meter bar */ +fun atoi(str) { + + int = -1; + + for (i = 0; i <= 100; i++) { + + if (i + "" == str) { + + int = i; + + break; + + } + + } + + return int; + +} + +/* + * This handler will/can be invoked + * 50 times per second. + * + * According to the previous author of the + * splash script, without this callback + * the screen is not updated correctly */ +spinner_sprite; +spinner; + +fun refreshHandler() { + + if (spin < 3.14 * 2) { + + spin = spin + 0.1; + + } + else { + + spin = 0; + + } + + /* if fsck is running or the password is prompted, hide the spinner */ + if (fsck_running == 1 || passw_dialog_input_sprite.GetOpacity() == 1) { + + spinner_sprite.SetOpacity(0); + + } else { + + spinner = Image("spinner.png"); + spinner = spinner.Rotate(spin); + spinner_sprite = Sprite(spinner); + spinner_sprite.SetPosition(screen_x + (screen_width / 2) - (spinner.GetWidth() / 2), screen_y + (screen_height / 2) - (spinner.GetHeight() / 2) + 80); + + } + + if (fade_dir == 0) { + + counter++; + + if (counter >= 200) { + + fade_dir = 1; + + } + + } + else { + + counter--; + + if (counter <= 0) { + + fade_dir = 0; + + } + + } + + if ((fsck_running == 1) && (fsck_done_fading == 0)) { + + + fsck_progress_meter_sprite.SetOpacity(fsck_fade_in_counter); + fsck_progress_fade_sprite.SetOpacity(fsck_fade_in_counter); + + if (fsck_fade_in_counter < 1) { + + fsck_fade_in_counter+= 0.025; + + } + else { + + fsck_done_fading = 1; + + } + + } + +} + +Plymouth.SetRefreshFunction (refreshHandler); + +/**/ + +/* + * This function will display the password related information + * when being prompt with entering a password */ +fun showPasswordHandler(prompt, stars) { + + if (passw_dialog_input_sprite.GetOpacity() == 0 && passw_lbl_sprite.GetOpacity() == 0) { + + passw_dialog_input_sprite.SetOpacity(1); + passw_lbl_sprite.SetOpacity(1); + + } + + tmp_prompt_image = Image.Text(prompt, 1, 1, 1); + + passw_lbl_sprite.SetImage(tmp_prompt_image); + passw_lbl_sprite.SetPosition(screen_x + (screen_width / 2) - (tmp_prompt_image.GetWidth() / 2), screen_y + (screen_height / 2) + (logotype_image.GetHeight() / 2) + 50); + + for(i = 0; i < stars_n; i++) { + + stars_array[i] = NULL; + + } + + stars_n = 0; + + for(i = 0; (i < stars) && (i < 15); i++) { + + stars_array[i] = Sprite(bullet_image); + stars_array[i].SetPosition(screen_x + (((screen_width / 2) - (passw_dialog_input_image.GetWidth() / 2)) + (18 * i)) + 2, screen_y + (screen_height / 2) + (logotype_image.GetHeight() / 2) + 75); + stars_n++; + + } + +} + +Plymouth.SetDisplayPasswordFunction(showPasswordHandler); + +/**/ + +fun displayNormalHandler() { + + /* + * Hide the password dialog and the bullets */ + + if (passw_dialog_input_sprite.GetOpacity() == 1) { + + passw_dialog_input_sprite.SetOpacity(0); + + } + + if (passw_lbl_sprite.GetOpacity() == 1) { + + passw_lbl_sprite.SetOpacity(0); + + } + + for(i = 0; i < stars_n; i++) { + + stars_array[i] = NULL; + + } + +} + +Plymouth.SetDisplayNormalFunction(displayNormalHandler); + +fun strlen(string) { + + i = 0; + + while (String(string).CharAt(i)) { + + i++; + + } + + return i; + +} + +/* + * This function will display the most current message */ +fun messageHandler(msg) { + + if ((msg == "") || !msg) { + + return 0; + + } + + if (msg.SubString(0, 5) == "keys:") { + + msg = msg.SubString(5, strlen(msg)); + + } + + # Get the message without the "fsckd-cancel-msg" prefix as we don't support i18n + if (msg.SubString(0, 17) == "fsckd-cancel-msg:") + msg = msg.SubString(17, strlen(msg)); + + //full_msg += msg + " "; + for(i = 4; i > 0; i--) { + + msgs_line[i] = msgs_line[i - 1]; + + } + + msgs_line[0] = Sprite(Image.Text(msg, 1, 1, 1)); + + dist = 1; + + for(i = 0; i < 5; i++) { + + if (msgs_line[i] != NULL) { + + msgs_line[i].SetPosition(screen_x + (screen_width / 2) - (msgs_line[i].GetImage().GetWidth() / 2), screen_y + (screen_height - msgs_line[i].GetImage().GetHeight()) - 20*dist); + dist++; + + } + + } + +} + +Plymouth.SetMessageFunction(messageHandler); + +/**/ + +/* + * Handles the updates passed to the plymouth daemon + * for example the FSCK data */ +fun statusHandler(status) { + + tmp_char; + status_array[0] = ""; + elem_count = 0; + + for (i = 0; String(status).CharAt(i) != ""; i++) { + + tmp_char = String(status).CharAt(i); + + if (tmp_char != ":") { + + status_array[elem_count] += tmp_char; + + } + else { + + elem_count++; + status_array[elem_count] = ""; + + } + + } + + if (status_array[0] == "fsck") { + + already_added = 0; + + if (fsck_running == 0) { + + /* + * use the dedicated message handler for this + * since there is no messages about fsck checks + * currently... */ + messageHandler("Routine disk drive check."); + + fsck_running = 1; + + } + + for(i = 0; i < fsck_dev_counter; i++) { + + /* + * check if the device already exist and update + * the progress only in that case */ + if (fsck_dev_array[i][0] == status_array[1]) { + + fsck_dev_array[i][1] = status_array[2]; /* progress */ + already_added = 1; + + } + + } + + /* + * if the device is not added, then add it */ + if (already_added == 0) { + + fsck_dev_array[fsck_dev_counter][0] = status_array[1]; /* device */ + fsck_dev_array[fsck_dev_counter][1] = status_array[2]; /* progress */ + fsck_dev_counter++; + + } + + /* + * update the progress */ + + total = 0; + + for(i = 0; i < fsck_dev_counter; i++) { + + total += atoi(fsck_dev_array[i][1]); + + } + + if (fsck_dev_counter > 0) { + + /* + * display the total percentage */ + fsck_progress_fade_sprite.SetImage(fsck_progress_fade_image.Scale((fsck_progress_meter_image.GetWidth() / 100) * (total / fsck_dev_counter), fsck_progress_fade_image.GetHeight())); + + } + + /**/ + + /* + * if the total progress is at maximum, + * make the progress meter go away, + * we might want to fade this out... */ + if (total == (100 * fsck_dev_counter)) { + + fsck_progress_meter_sprite.SetOpacity(0); + fsck_progress_fade_sprite.SetOpacity(0); + + } + + } + + # systemd-fsckd pass fsckd::: + if (status_array[0] == "fsckd") { + fsck_running = 1; + + # remove ",x" as we only care about integers + progress_str = status_array[2]; + progress = atoi(progress_str.SubString(0, strlen(progress_str) - 2)); + + fsck_progress_fade_sprite.SetImage(fsck_progress_fade_image.Scale((fsck_progress_meter_image.GetWidth() / 100) * progress, fsck_progress_fade_image.GetHeight())); + + /* + * if the total progress is at maximum, + * make the progress meter go away, + * we might want to fade this out... */ + if (progress == 100) { + fsck_progress_meter_sprite.SetOpacity(0); + fsck_progress_fade_sprite.SetOpacity(0); + } + } + +} + +Plymouth.SetUpdateStatusFunction(statusHandler); + +/**/ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/passw-dialog.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/passw-dialog.png new file mode 100644 index 0000000..9e6a504 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/passw-dialog.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-fade.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-fade.png new file mode 100644 index 0000000..ec475f4 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-fade.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-fade_16bit.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-fade_16bit.png new file mode 100644 index 0000000..878aec6 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-fade_16bit.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-meter.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-meter.png new file mode 100644 index 0000000..4e8b719 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-meter.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-meter_16bit.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-meter_16bit.png new file mode 100644 index 0000000..75f8713 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/progress-meter_16bit.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/spinner.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/spinner.png new file mode 100644 index 0000000..80944a3 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/spinner.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/test.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/test.png new file mode 100644 index 0000000..3d64128 Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/test.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/wallpaper.png b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/wallpaper.png new file mode 100644 index 0000000..3a3b82d Binary files /dev/null and b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-logo/wallpaper.png differ diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-text/minios-text.plymouth b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-text/minios-text.plymouth new file mode 100644 index 0000000..3376c71 --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/minios-text/minios-text.plymouth @@ -0,0 +1,11 @@ +[Plymouth Theme] +Name=MiniOS Text +Description=Text mode theme based on minios-logo theme +ModuleName=ubuntu-text + +[ubuntu-text] +title=MiniOS 2021 +black=0x000000 +white=0xffffff +brown=0x000000 +blue=0xffffff diff --git a/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/text.plymouth b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/text.plymouth new file mode 120000 index 0000000..740f19a --- /dev/null +++ b/linux-live/basesystem/01-casper/rootcopy/usr/share/plymouth/themes/text.plymouth @@ -0,0 +1 @@ +/usr/share/plymouth/themes/minios-text/minios-text.plymouth \ No newline at end of file diff --git a/linux-live/basesystem/01-core/install b/linux-live/basesystem/01-core/install new file mode 100644 index 0000000..29e9948 --- /dev/null +++ b/linux-live/basesystem/01-core/install @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e # exit on error +set -o pipefail # exit on pipeline error +set -u # treat unset variable as error + +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" + +# install packages +if [ -f $SCRIPT_DIR/package.list ]; then + #sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD update >>$OUTPUT 2>&1 && + #sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD install $APT_OPTIONS $APT_OPTIONS2 \ + $(grep -vE "^\s*#" $SCRIPT_DIR/package.list | tr "\n" " ") >>$OUTPUT 2>&1 +fi diff --git a/linux-live/basesystem/01-core/package.list b/linux-live/basesystem/01-core/package.list new file mode 100644 index 0000000..83b471e --- /dev/null +++ b/linux-live/basesystem/01-core/package.list @@ -0,0 +1,41 @@ +mc +squashfs-tools +genisoimage +zip +unzip +psmisc +net-tools +alsa-utils +man +less +xz-utils +ca-certificates +openssl +acpid +acpi-support-base +powermgmt-base +bzip2 +gpart +hdparm +sdparm +mdadm +smartmontools +dosfstools +lsof +htop +gddrescue +rsync +netcat +ssh +gpm +wireless-tools +ntfs-3g +rfkill +file +dnsmasq +ntpdate +dvd+rw-tools +usb-modeswitch +pm-utils +wget +linux-image-amd64 \ No newline at end of file diff --git a/linux-live/basesystem/01-core/postinstall b/linux-live/basesystem/01-core/postinstall new file mode 100644 index 0000000..e33a74d --- /dev/null +++ b/linux-live/basesystem/01-core/postinstall @@ -0,0 +1,103 @@ +#!/bin/bash + +apt-get remove --yes vim* grub* debconf-i18n installation-report + +CWD="$(pwd)" +cd /tmp +apt -y update +apt-get download acpi-support +dpkg -x acpi-support*.deb /tmp/acpisupport +cd /tmp/acpisupport +cp -aR * / +cd "$CWD" + +rm -f /etc/fstab +rm -f /etc/mtab +rm -f /etc/apt/sources.list~ +rm -Rf /etc/systemd/system/timers.target.wants +rm -f /etc/systemd/system/multi-user.target.wants/ssh.service +rm -f /etc/systemd/system/multi-user.target.wants/dnsmasq.service + +rm -f /etc/ssh/ssh_host* + +rm -f /var/backups/* +rm -f /var/cache/ldconfig/* +rm -f /var/cache/debconf/* +rm -f /var/cache/fontconfig/* +rm -f /var/lib/apt/extended_states +rm -f /var/lib/systemd/random-seed +rm -f /var/lib/apt/lists/deb.* +rm -Rf /root/.local/share/mc +rm -Rf /root/.cache +rm -f /root/.wget-hsts + +rm -f /var/lib/dpkg/*-old +rm -f /var/log/* +rm -f /var/log/*/* +rm -f /var/log/*/*/* +rm -f /var/cache/apt/archives/*.deb +rm -f /var/cache/apt/*.bin +rm -f /var/cache/debconf/*-old +rm -f /var/lib/dhcp/dhclient.leases +rm -f /root/.bash_history +rm -f /root/.wget-hsts +rm -Rf /usr/share/doc/* +rm -Rf /usr/share/info/* +rm -f /usr/share/images/fluxbox/debian-squared.jpg +rm -Rf /usr/share/fluxbox/nls/??* +rm -Rf /usr/share/gnome/help + +rm -Rf /usr/share/locale/?? +rm -Rf /usr/share/locale/??_* +rm -Rf /usr/share/locale/??@* +rm -Rf /usr/share/locale/??? +rm -Rf /usr/share/i18n/locales/*_* +rm -Rf /usr/share/man/?? +rm -Rf /usr/share/man/*_* + +rm -Rf /usr/share/icons/elementaryXubuntu-dark +rm -Rf /usr/share/icons/gnome/256x256 + +rm /usr/share/applications/compton.desktop +rm /usr/share/applications/debian-uxterm.desktop +rm /usr/share/applications/debian-xterm.desktop +rm /usr/share/applications/htop.desktop +rm /usr/share/applications/mc.desktop +rm /usr/share/applications/mcedit.desktop +rm /usr/share/applications/pcmanfm-desktop-pref.desktop +rm /usr/share/applications/python2.7.desktop +rm /usr/share/applications/python3.7.desktop +rm /usr/share/applications/vim.desktop + + + +# Unzip gzipped files (man pages), so LZMA can compress 2times better. +# First we fix symlinks, then uncompress files +# $1 = search directory +uncompress_files() +{ + local LINK LINE + + find "$1" -type l -name "*.gz" | while read LINE; do + LINK="$(readlink "$LINE" | sed -r 's/.gz$//')" + FILE="$(echo "$LINE" | sed -r 's/.gz$//')" + ln -sfn "$LINK" "$FILE" + rm -f "$LINE" + done + find "$1" -type f -name "*.gz" | xargs -r gunzip +} + +uncompress_files /etc/alternatives +uncompress_files /usr/share/man + +# remove broken links +# $1 = search directory +remove_broken_links() +{ + find "$1" -type l -exec test ! -e {} \; -print | xargs rm -vf +} + +remove_broken_links /etc/alternatives +remove_broken_links /usr/share/man + + diff --git a/linux-live/basesystem/01-core/rootcopy/etc/adjtime b/linux-live/basesystem/01-core/rootcopy/etc/adjtime new file mode 100644 index 0000000..5cd8f24 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/adjtime @@ -0,0 +1,3 @@ +0.0 0 0.0 +0 +LOCAL diff --git a/linux-live/basesystem/01-core/rootcopy/etc/apt/apt.conf.d/000Slax b/linux-live/basesystem/01-core/rootcopy/etc/apt/apt.conf.d/000Slax new file mode 100644 index 0000000..e197a86 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/apt/apt.conf.d/000Slax @@ -0,0 +1,3 @@ +APT::Install-Recommends "0"; +APT::Install-Suggests "0"; +Acquire::Languages { "none"; } diff --git a/linux-live/basesystem/01-core/rootcopy/etc/apt/sources.list b/linux-live/basesystem/01-core/rootcopy/etc/apt/sources.list new file mode 100644 index 0000000..d054356 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/apt/sources.list @@ -0,0 +1,5 @@ +deb http://deb.debian.org/debian/ buster main contrib non-free +deb http://deb.debian.org/debian/ buster-updates main contrib non-free +deb http://security.debian.org/debian-security buster/updates main contrib non-free + +deb-src http://deb.debian.org/debian/ buster main contrib non-free diff --git a/linux-live/basesystem/01-core/rootcopy/etc/hostname b/linux-live/basesystem/01-core/rootcopy/etc/hostname new file mode 100644 index 0000000..6a08bc9 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/hostname @@ -0,0 +1 @@ +minios \ No newline at end of file diff --git a/linux-live/basesystem/01-core/rootcopy/etc/hosts b/linux-live/basesystem/01-core/rootcopy/etc/hosts new file mode 100644 index 0000000..892092a --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/hosts @@ -0,0 +1,7 @@ +127.0.0.1 localhost +127.0.1.1 minios + +# The following lines are desirable for IPv6 capable hosts +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters diff --git a/linux-live/basesystem/01-core/rootcopy/etc/issue b/linux-live/basesystem/01-core/rootcopy/etc/issue new file mode 100644 index 0000000..05598ec --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/issue @@ -0,0 +1,31 @@ + + + \l + + + + + + Thank you for using MiniOS. + Based on Debian GNU/Linux 10. + + :::: :::: ::::::::::: :::: ::: ::::::::::: :::::::: :::::::: + +:+:+: :+:+:+ :+: :+:+: :+: :+: :+: :+: :+: :+: + +:+ +:+:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ + +#+ +:+ +#+ +#+ +#+ +:+ +#+ +#+ +#+ +:+ +#++:++#++ + +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ + #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# + ### ### ########### ### #### ########### ######## ######## + + : : + : Root login name: root : + : Password: toor : + : User login name: live : + : Password: evil : + + + + + + + diff --git a/linux-live/basesystem/01-core/rootcopy/etc/localtime b/linux-live/basesystem/01-core/rootcopy/etc/localtime new file mode 120000 index 0000000..e59d7a1 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/localtime @@ -0,0 +1 @@ +/usr/share/zoneinfo/Etc/UTC \ No newline at end of file diff --git a/linux-live/basesystem/01-core/rootcopy/etc/motd b/linux-live/basesystem/01-core/rootcopy/etc/motd new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/motd @@ -0,0 +1 @@ + diff --git a/linux-live/basesystem/01-core/rootcopy/etc/profile b/linux-live/basesystem/01-core/rootcopy/etc/profile new file mode 100644 index 0000000..196c337 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/profile @@ -0,0 +1,34 @@ +# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) +# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). + +if [ "`id -u`" -eq 0 ]; then + PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games" +else + PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" +fi +export PATH + +if [ "${PS1-}" ]; then + if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then + # The file bash.bashrc already sets the default PS1. + # PS1='\h:\w\$ ' + if [ -f /etc/bash.bashrc ]; then + . /etc/bash.bashrc + fi + else + if [ "`id -u`" -eq 0 ]; then + PS1='# ' + else + PS1='$ ' + fi + fi +fi + +if [ -d /etc/profile.d ]; then + for i in /etc/profile.d/*.sh; do + if [ -r $i ]; then + . $i + fi + done + unset i +fi diff --git a/linux-live/basesystem/01-core/rootcopy/etc/ssh/sshd_config.d/90-minios.conf b/linux-live/basesystem/01-core/rootcopy/etc/ssh/sshd_config.d/90-minios.conf new file mode 100644 index 0000000..33d8862 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/ssh/sshd_config.d/90-minios.conf @@ -0,0 +1,2 @@ +PermitRootLogin yes +PasswordAuthentication yes \ No newline at end of file diff --git a/linux-live/basesystem/01-core/rootcopy/etc/systemd/system/multi-user.target.wants/dhclient.service b/linux-live/basesystem/01-core/rootcopy/etc/systemd/system/multi-user.target.wants/dhclient.service new file mode 120000 index 0000000..160b857 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/systemd/system/multi-user.target.wants/dhclient.service @@ -0,0 +1 @@ +/lib/systemd/system/dhclient.service \ No newline at end of file diff --git a/linux-live/basesystem/01-core/rootcopy/etc/timezone b/linux-live/basesystem/01-core/rootcopy/etc/timezone new file mode 100644 index 0000000..7f39493 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/etc/timezone @@ -0,0 +1 @@ +Etc/UTC diff --git a/linux-live/basesystem/01-core/rootcopy/root/.bashrc b/linux-live/basesystem/01-core/rootcopy/root/.bashrc new file mode 100644 index 0000000..b0879e6 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/root/.bashrc @@ -0,0 +1,140 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +apt-get() +{ + if [ -e /var/cache/apt/pkgcache.bin ]; then + /usr/bin/apt-get "$@" + else + /usr/bin/apt-get update + /usr/bin/apt-get "$@" + fi +} + +apt() +{ + if [ -e /var/cache/apt/pkgcache.bin ]; then + /usr/bin/apt "$@" + else + /usr/bin/apt update + /usr/bin/apt "$@" + fi +} + +export -f apt-get +export -f apt \ No newline at end of file diff --git a/linux-live/basesystem/01-core/rootcopy/usr/bin/dir2sb b/linux-live/basesystem/01-core/rootcopy/usr/bin/dir2sb new file mode 100755 index 0000000..3ddd64d --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/bin/dir2sb @@ -0,0 +1,58 @@ +#!/bin/bash +# Author: Tomas M. + +usage() +{ + echo "" + echo "Convert directory to .sb compressed module" + echo "Usage: $0 [source_directory.sb] [[target_file.sb]]" + echo " If source_directory does not have .sb suffix and it is not 'squashfs-root'," + echo " then the source_directory itself is included in the module and" + echo " then the target_file.sb parameter is required." + echo " If target_file.sb is not specified, the source_directory is erased" + echo " and replaced by the newly generated module file." +} + +P1="$(readlink -f "$1")" +P2="$(readlink -f "$2")" + +if [ "$P1" = "$P2" ]; then + P2="" +fi + +SB=$(echo "$P1" | grep -o "[.]sb/*\$") +if [ "$(echo "$P1" | grep -o "/squashfs-root/*\$")" != "" ]; then + SB="true" +fi + +if [ "$SB" = "" ]; then + KEEP="-keep-as-directory" + if [ "$P2" = "" ]; then + usage + exit 1 + fi +else + KEEP="" +fi + +if [ ! -d "$P1" ]; then + echo "Not a directory: $P1" >&2 + exit 2 +fi + + +if [ "$P2" = "" ]; then + TARGET="$P1".sb + while [ -e "$TARGET" ]; do TARGET="$TARGET"x; done + mksquashfs "$P1" "$TARGET" -comp xz -b 1024K -always-use-fragments $KEEP >/dev/null || exit 3 + umount "$P1" 2>/dev/null + rm -Rf "$P1" + mv "$TARGET" "$P1" +else + if [ -e "$P2" ]; then + echo "Target exists: $P2" >&2 + exit 4 + fi + + mksquashfs "$P1" "$P2" -comp xz -b 1024K -always-use-fragments $KEEP >/dev/null +fi diff --git a/linux-live/basesystem/01-core/rootcopy/usr/bin/genminiosiso b/linux-live/basesystem/01-core/rootcopy/usr/bin/genminiosiso new file mode 100755 index 0000000..c7d5859 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/bin/genminiosiso @@ -0,0 +1,80 @@ +#!/bin/bash + +# Author: Tomas M. +# Author: crims0n. + +CWD=$(pwd) +SOURCE=/run/initramfs/memory +TEMP=/tmp/miniosiso.$$ +REGEX='^$' + +if [ "$1" = "-e" ]; then + REGEX="$2" + shift + shift +fi + +TARGET="$(readlink -f "$1")" + +if [ "$TARGET" = "" ]; then + echo "" + echo "Generate MiniOS ISO image, adding specified modules" + echo "Regular expression is used to exclude any existing path or file with -e regex" + echo "" + echo "Usage:" + echo " $0 [[ -e regex ]] target.iso [[module.sb]] [[module.sb]] ..." + echo "" + echo "Examples:" + echo " # to create MiniOS iso without chromium.sb module:" + echo " $0 -e 'chromium' minios_without_chromium.iso" + echo "" + echo " # to create MiniOS text-mode core only:" + echo " $0 -e 'firmware|xorg|desktop|apps|chromium' minios_textmode.iso" + exit 1 +fi + +if [ -e "$SOURCE/data/minios/boot/isolinux.bin" ]; then + MINIOS=$SOURCE/data/minios +fi + +if [ -e "$SOURCE/toram/boot/isolinux.bin" ]; then + MINIOS=$SOURCE/toram +fi + +if [ "$MINIOS" = "" ]; then + echo "Cannot find boot/isolinux.bin in MiniOS data" >&2 + exit 2 +fi + +GRAFT=\ +$( + cd "$MINIOS" + find . -type f | sed -r "s:^[.]/::" | egrep -v "^boot/isolinux.(bin|boot)$" | egrep -v "^changes/" | egrep -v "$REGEX" | while read LINE; do + echo "minios/$LINE=$MINIOS/$LINE" + done +) + +# add all modules +while [ "$2" != "" ]; do + if [ ! -e "$2" ]; then + echo "File does not exist: $2" + exit 3 + fi + BAS="$(basename "$2")" + MOD="$(readlink -f "$2")" + GRAFT="$GRAFT minios/modules/$BAS=$MOD" + shift +done + +( + mkdir -p $TEMP/minios/{boot,modules,changes} + cp "$MINIOS/boot/isolinux.bin" "$TEMP/minios/boot" + cd "$TEMP" + genisoimage -o - -quiet -v -J -R -D -A minios -V minios \ + -no-emul-boot -boot-info-table -boot-load-size 4 -input-charset utf-8 \ + -b minios/boot/isolinux.bin -c minios/boot/isolinux.boot \ + -graft-points $GRAFT \ + . \ +) > "$TARGET" + +rm -Rf $TEMP diff --git a/linux-live/basesystem/01-core/rootcopy/usr/bin/pxe b/linux-live/basesystem/01-core/rootcopy/usr/bin/pxe new file mode 100755 index 0000000..3aaff4e --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/bin/pxe @@ -0,0 +1,86 @@ +#!/bin/bash +# Rebuild initial ramdisk with full network drivers, +# start DHCP and TFTP server in order to provide PXE service +# +# Author: Tomas M + +LIVE=/run/initramfs +FTPROOT=/var/state/dnsmasq/root + +# find out our own IP address. If more interfaces are available, use the first one +IP="$(hostname -I | cut -d " " -f 1)" +GW=$(ip route show | grep default | grep -o "via.*" | head -n 1 | cut -d " " -f 2) + +# if no IP is assigned to this computer, setup private address randomly +if [ "$IP" = "" ]; then + killall dhclient 2>/dev/null + IP="10."$(($RANDOM/130+1))"."$(($RANDOM/130+1))".1" + ifconfig $(ls -1 /sys/class/net | egrep -v '^lo$' | sort | head -n 1) $IP netmask 255.255.255.0 +fi + +# if gateway is not recognized, lets make our IP a gateway and enable forwarding +if [ "$GW" = "" ]; then + GW="$IP" + echo 1 > /proc/sys/net/ipv4/conf/all/forwarding + echo 1 > /proc/sys/net/ipv6/conf/all/forwarding +fi + +echo Starting PXE server on $IP ... + +# calculate C class range +RANGE=$(echo $IP | cut -d "." -f 1-3) + +# make sure dnsmasq can be started +killall dnsmasq 2>/dev/null +killall busybox 2>/dev/null +rm -Rf $FTPROOT 2>/dev/null +mkdir -p $FTPROOT/{pxelinux.cfg,tmp}/ + +# create root filesystem for ftfp +cd $LIVE +( find . -print | grep -v "memory" + cd / + find /lib/modules/$(uname -r)/kernel/drivers/net | grep -v wireless +) | cpio -pvd $FTPROOT/tmp 2>/dev/null + +cp /lib/modules/$(uname -r)/modules.* $FTPROOT/tmp/lib/modules/$(uname -r) +depmod -b $FTPROOT/tmp +rm $FTPROOT/tmp/lib/initramfs_escaped + +# pack root in initramfs +cd $FTPROOT/tmp +find . -print | cpio -o -H newc 2>/dev/null | gzip -f --fast >../initrfs.img +cd .. +rm -Rf tmp + +# link files here since copying is not necessary +ln -s $(find $LIVE/memory/{data,iso,toram} 2>/dev/null | grep vmlinuz | head -n 1) $FTPROOT/vmlinuz +ln -s $(find $LIVE/memory/{data,iso,toram} 2>/dev/null | grep pxelinux.0 | head -n 1) $FTPROOT/pxelinux.0 +ln -s $(find $LIVE/memory/{data,iso,toram} 2>/dev/null | grep ldlinux.c32 | head -n 1) $FTPROOT/ldlinux.c32 + +find $LIVE/memory/{data,iso,toram} 2>/dev/null | egrep "[.]sb\$" | sort -n | while read LINE; do + BAS="$(basename "$LINE")" + ln -s $LINE "$FTPROOT/$BAS" + echo $BAS >> "$FTPROOT/PXEFILELIST" +done + +echo "This is Slax PXE data server. PXE clients will download file list" > "$FTPROOT/index.html" + +# default pxelinux configuration. Keep xmode selection for clients the same like for the server +echo " +PROMPT 0 +DEFAULT slax +LABEL slax +KERNEL /vmlinuz +IPAPPEND 1 +APPEND initrd=/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 $(cat /proc/cmdline | egrep -o 'slax.flags=[^ ]+' | sed -r 's:[,=]pxe::' | sed -r 's:[,=]toram::') +" > $FTPROOT/pxelinux.cfg/default + +# start the DHCP server and TFTP server +dnsmasq --enable-tftp --tftp-root=/var/state/dnsmasq/root \ +--dhcp-boot=pxelinux.0,"$IP",$IP \ +--dhcp-option=3,$GW \ +--dhcp-range=$RANGE.2,$RANGE.250,infinite --log-dhcp + +# start HTTP server at port 7529 (that are the numbers you type on your phone to write 'slax') +busybox httpd -p 7529 -h /var/state/dnsmasq/root diff --git a/linux-live/basesystem/01-core/rootcopy/usr/bin/rmsbdir b/linux-live/basesystem/01-core/rootcopy/usr/bin/rmsbdir new file mode 100755 index 0000000..42cb449 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/bin/rmsbdir @@ -0,0 +1,17 @@ +#!/bin/bash +# Author: Tomas M. + +if [ ! -e "$1" ]; then + echo + echo "Erase module directory created by sb2dir" + echo "Usage: $0 [source_directory.sb]" + exit 1 +fi + +if [ ! -d "$1" ]; then + echo "Directory does not exist: $1" >&2 + exit +fi + +umount "$1" 2>/dev/null +rm -Rf "$1" diff --git a/linux-live/basesystem/01-core/rootcopy/usr/bin/savechanges b/linux-live/basesystem/01-core/rootcopy/usr/bin/savechanges new file mode 100755 index 0000000..48e9c9e --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/bin/savechanges @@ -0,0 +1,46 @@ +#!/bin/bash + +TMP=/tmp/changes$$ +EXCLUDE="^\$|/\$|[.]wh[.][.]wh[.]orph/|^[.]wh[.][.]wh[.]plnk/|^[.]wh[.][.]wh[.]aufs|^var/cache/|^var/backups/|^var/tmp/|^var/log/|^var/lib/apt/|^var/lib/dhcp/|^var/lib/systemd/|^sbin/fsck[.]aufs|^etc/resolv[.]conf|^root/[.]Xauthority|^root/[.]xsession-errors|^root/[.]fehbg|^root/[.]fluxbox/lastwallpaper|^root/[.]fluxbox/menu_resolution|^etc/mtab|^etc/fstab|^boot/|^dev/|^mnt/|^proc/|^run/|^sys/|^tmp/" +CHANGES=/run/initramfs/memory/changes + +if [ "$1" = "" ]; then + echo "" + echo "savechanges - save all changed files in a compressed filesystem bundle" + echo " - excluding some predefined files such as /etc/mtab," + echo " temp & log files, empty directories, apt cache, and such" + echo "" + echo "Usage:" + echo " $0 [ target_file.sb ] [ changes_directory ]" + echo "" + echo "If changes_directory is not specified, /run/initramfs/memory/changes is used." + echo "" + exit 1 +fi + +if [ ! "$2" = "" ]; then + CHANGES="$2" +fi + +# exclude the save_file itself of course +EXCLUDE="$EXCLUDE|^""$(readlink -f "$1" | cut -b 2- | sed -r "s/[.]/[.]/")""\$" + +CWD=$(pwd) + +cd $CHANGES || exit + +mkdir -p $TMP +mount -t tmpfs tmpfs $TMP + +find \( -type d -printf "%p/\n" , -not -type d -print \) \ + | sed -r "s/^[.]\\///" | egrep -v "$EXCLUDE" \ + | while read FILE; do + cp --parents -afr "$FILE" "$TMP" +done + +cd $CWD + +mksquashfs $TMP "$1" -comp xz -b 1024K -always-use-fragments -noappend + +umount $TMP +rmdir $TMP diff --git a/linux-live/basesystem/01-core/rootcopy/usr/bin/sb b/linux-live/basesystem/01-core/rootcopy/usr/bin/sb new file mode 100755 index 0000000..5346f44 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/bin/sb @@ -0,0 +1,29 @@ +#!/bin/bash + +if [ "$1" = "rm" ]; then + shift + rmsbdir "$@" + exit $? +fi + +if [ "$1" = "rmdir" ]; then + shift + rmsbdir "$@" + exit $? +fi + +if [ "$1" = "conv" ]; then + shift +fi + +if [ ! -r "$1" ]; then + echo File not found "$1" + exit 1 +fi + +if [ -d "$1" ]; then + dir2sb "$@" + exit $? +fi + +sb2dir "$@" diff --git a/linux-live/basesystem/01-core/rootcopy/usr/bin/sb2dir b/linux-live/basesystem/01-core/rootcopy/usr/bin/sb2dir new file mode 100755 index 0000000..4f580ec --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/bin/sb2dir @@ -0,0 +1,33 @@ +#!/bin/bash +# Author: Tomas M. + +if [ ! -e "$1" ]; then + echo + echo "Convert .sb compressed module into directory with the same name" + echo "Usage: $0 [source_file.sb] [[optional output_directory]]" + echo " If the output_directory is specified, it must exist" + echo " If the output_directory is not specified, the name source_file.sb" + echo " is used and the directory is overmounted with tmpfs" + exit 1 +fi + +if [ ! -r "$1" ]; then + echo "File does not exist: $1" >&2 + exit +fi + +if [ "$2" = "" ]; then + SOURCE="$1".x + while [ -e "$SOURCE" ]; do SOURCE="$SOURCE"x; done + mv "$1" "$SOURCE" || exit + mkdir "$1" + mount -t tmpfs tmpfs "$1" + unsquashfs -f -dest "$1" "$SOURCE" >/dev/null || exit + rm "$SOURCE" +else + if [ ! -d "$2" ]; then + echo "Directory does not exist: $2" >&2 + exit + fi + unsquashfs -f -dest "$2" "$1" >/dev/null +fi diff --git a/linux-live/basesystem/01-core/rootcopy/usr/bin/slax b/linux-live/basesystem/01-core/rootcopy/usr/bin/slax new file mode 100755 index 0000000..a8843ad --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/bin/slax @@ -0,0 +1,178 @@ +#!/bin/bash +# Slax management and control script +# Author: Tomas M + +# activate +# deactivate +# list + + +LIVE=/run/initramfs/memory +RAMSTORE=$LIVE/modules + +# Print error message and exit +# $1 = error message +# +die() +{ + echo "$1" >&2 + exit 1 +} + + +print_branches() +{ + local SI BUNDLE LOOP CWD + + SI="/sys/fs/aufs/$(cat /proc/mounts | grep 'aufs / aufs' | egrep -o 'si=([^,) ]+)' | tr = _)" + CWD="$(pwd)" + cd "$SI" + ls -v1 | grep -v xi_path | egrep 'br[0-9]+' | xargs cat | grep memory/bundles | rev | cut -b 4- | rev | while read BUNDLE; do + if mountpoint -q "$BUNDLE"; then + LOOP=$(cat /proc/mounts | fgrep " $BUNDLE squashfs" | cut -d " " -f 1) + echo -n "$BUNDLE" + echo -ne "\t" + losetup $LOOP | sed -r "s:.*[(]|[)].*::g" + fi + done | tac + cd "$CWD" +} + + +# Activate Slax Bundle +# $1 = file to activate +# +activate() +{ + local SB TGT BAS + + SB="$(readlink -f "$1")" + BAS="$(basename "$SB")" + + # check if file exists + if [ ! -r "$SB" ]; then + usage + die "file not found $SB" + fi + + # check if the file is part of aufs union, if yes we need to copy it outside + if df "$SB" | cut -d " " -f 1 | grep -q aufs; then + TGT="$RAMSTORE" + mkdir -p "$TGT" + if [ -r $TGT/$BAS ]; then die "File exists: $TGT/$BAS"; fi + cp -n "$SB" "$TGT/$BAS" + if [ $? -ne 0 ]; then die "Error copying file to $TGT/$BAS. Not enough free RAM or disk space?"; fi + SB="$TGT/$BAS" + fi + + # check if this particular file is already activated + if print_branches | cut -f 2 | fgrep -q "$SB"; then + exit + fi + + # mount remount,add + TGT="$LIVE/bundles/$BAS" + mkdir -p "$TGT" + + mount -n -o loop,ro "$SB" "$TGT" + if [ $? -ne 0 ]; then + die "Error mounting $SB to $TGT, perhaps corrupted download" + fi + + # add current branch to aufs union + mount -t aufs -o remount,add:1:"$TGT" aufs / + if [ $? -ne 0 ]; then + umount "$TGT" + rmdir "$TGT" + die "Error attaching bundle filesystem to Slax" + fi + + echo "Slax Bundle activated: $BAS" +} + + +# Deactivate Slax bundle of the given name +# $1 = path to bundle file, or its name +# +deactivate() +{ + local BUNDLES SB MATCH LOOP LOOPFILE + + BUNDLES=$LIVE/bundles + MODULES=$LIVE/modules + SB="$(basename "$1")" + + rmdir "$BUNDLES/$SB" 2>/dev/null # this fails unless the dir is + rmdir "$BUNDLES/$SB.sb" 2>/dev/null # forgotten there empty. It's safe this way + + if [ ! -d "$BUNDLES/$SB" ]; then + # we don't have real filename match, lets try to add .sb extension + if [ ! -d "$BUNDLES/$SB.sb" ]; then + # no, still no match. Lets use some guesswork + SB=$(print_branches | cut -f 2 | egrep -o "/[0-9]+-$SB.sb\$" | tail -n 1 | xargs -r basename) + else + SB="$SB.sb" + fi + fi + + if [ "$SB" = "" -o ! -d "$BUNDLES/$SB" ]; then + die "can't find active slax bundle $1" + fi + + echo "Attempting to deactivate Slax bundle $SB..." + mount -t aufs -o remount,verbose,del:"$BUNDLES/$SB" aufs / 2>/dev/null + if [ $? -ne 0 ]; then + die "Unable to deactivate Slax Bundle - still in use. See dmesg for more." + fi + + # remember what loop device was the bundle mounted to, it may be needed later + LOOP="$(cat /proc/mounts | fgrep " $BUNDLES/$SB " | cut -d " " -f 1)" + LOOPFILE="$(losetup "$LOOP" | cut -d " " -f 3 | sed -r 's:^.|.$::g')" + + umount "$BUNDLES/$SB" 2>/dev/null + if [ $? -ne 0 ]; then + die "Unable to umount Slax bundle loop-mount $BUNDLES/$SB" + fi + rmdir "$BUNDLES/$SB" + + # free the loop device manually since umount fails to do that if the bundle was activated on boot + losetup -d "$LOOP" 2>/dev/null + + if echo "$LOOPFILE" | grep -q $RAMSTORE; then + rm -f $LOOPFILE + fi + + echo "Slax Bundle deactivated: $SB" +} + + +usage() +{ + echo "Usage: $0 [ activate | deactivate | list ] [ file.sb ]" >&2 + if [ "$1" != "" ]; then + echo "$1" >&2 + fi +} + + +if [ "$1" = "" ]; then + usage + die +fi + +if [ "$1" = "activate" ]; then + activate "$2" +fi + +if [ "$1" = "deactivate" ]; then + deactivate "$2" +fi + +if [ "$1" = "list" ]; then + print_branches +fi + +if [ "$1" = "savechanges" ]; then + shift + savechanges "$@" +fi diff --git a/linux-live/basesystem/01-core/rootcopy/usr/bin/sudo b/linux-live/basesystem/01-core/rootcopy/usr/bin/sudo new file mode 100755 index 0000000..aaff119 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/bin/sudo @@ -0,0 +1,11 @@ +#!/bin/bash +if [ "$#" -lt 1 ]; then + echo "Usage: sudo [command] [arguments]" + exit 1 +fi + +if [ "$UID" = 0 ]; then + exec "$@" +fi + +echo "Sudo is not installed. Run the command as root or install sudo." diff --git a/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/apparmor.service b/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/apparmor.service new file mode 100644 index 0000000..a2df76a --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/apparmor.service @@ -0,0 +1,38 @@ +[Unit] +Description=Load AppArmor profiles +DefaultDependencies=no +Before=sysinit.target +After=local-fs.target +After=systemd-journald-audit.socket +RequiresMountsFor=/var/cache/apparmor +AssertPathIsReadWrite=/sys/kernel/security/apparmor/.load +ConditionSecurity=apparmor +Documentation=man:apparmor(7) +Documentation=https://gitlab.com/apparmor/apparmor/wikis/home/ + +# Don't start this unit on the Ubuntu Live CD +ConditionPathExists=!/rofs/etc/apparmor.d + +# Don't start this unit on the Debian Live CD when using overlayfs +ConditionPathExists=!/run/live/overlay/work + +# Don't start this unit on Slax Live CD +ConditionPathExists=!/run/initramfs/lib/livekitlib + +[Service] +Type=oneshot +ExecStart=/lib/apparmor/apparmor.systemd reload +ExecReload=/lib/apparmor/apparmor.systemd reload + +# systemd maps 'restart' to 'stop; start' which means removing AppArmor confinement +# from running processes (and not being able to re-apply it later). +# Upstream systemd developers refused to implement an option that allows overriding +# this behaviour, therefore we have to make ExecStop a no-op to error out on the +# safe side. +# +# If you really want to unload all AppArmor profiles, run aa-teardown +ExecStop=/bin/true +RemainAfterExit=yes + +[Install] +WantedBy=sysinit.target diff --git a/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/dhclient.service b/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/dhclient.service new file mode 100644 index 0000000..2c92a32 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/dhclient.service @@ -0,0 +1,16 @@ +[Unit] +Description=DHCP Client +Documentation=man:dhclient(8) +Wants=network.target +After=network-pre.target systemd-sysctl.service systemd-modules-load.service +Before=network.target shutdown.target network-online.target +ConditionPathExists=!/run/initramfs/net.up.flag + +[Service] +Type=forking +ExecStart=-/bin/sh -c 'udevadm settle && dhclient -nw' +PIDFile=/run/dhclient.pid + +[Install] +WantedBy=multi-user.target +WantedBy=network-online.target diff --git a/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/getty@.service b/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/getty@.service new file mode 100644 index 0000000..3a805ae --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/getty@.service @@ -0,0 +1,54 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service plymouth-quit-wait.service +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# IgnoreOnIsolate causes issues with sulogin, if someone isolates +# rescue.target or starts rescue.service from multi-user.target or +# graphical.target. +Conflicts=rescue.service +Before=rescue.service + +# On systems without virtual consoles, don't start any getty. Note +# that serial gettys are covered by serial-getty@.service, not this +# unit. +ConditionPathExists=/dev/tty0 + +[Service] +# the VT is cleared by TTYVTDisallocate +ExecStart=-/sbin/agetty --noclear %I $TERM +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +#TM do not clear VT: +TTYVTDisallocate=no +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= + +[Install] +WantedBy=getty.target +DefaultInstance=tty1 diff --git a/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/ssh.service b/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/ssh.service new file mode 100644 index 0000000..a29b18e --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/lib/systemd/system/ssh.service @@ -0,0 +1,18 @@ +[Unit] +Description=OpenBSD Secure Shell server +After=network.target auditd.service +ConditionPathExists=!/etc/ssh/sshd_not_to_be_run + +[Service] +EnvironmentFile=-/etc/default/ssh +ExecStartPre=-/bin/sh -c 'if ! ls /etc/ssh/ssh_host_* >/dev/null 2>&1; then /usr/sbin/dpkg-reconfigure openssh-server; fi' +ExecStart=/usr/sbin/sshd -D $SSHD_OPTS +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=on-failure +RestartPreventExitStatus=255 +Type=notify + +[Install] +WantedBy=multi-user.target +Alias=sshd.service diff --git a/linux-live/basesystem/01-core/rootcopy/usr/lib/udev/rules.d/90-slax-automount.rules b/linux-live/basesystem/01-core/rootcopy/usr/lib/udev/rules.d/90-slax-automount.rules new file mode 100644 index 0000000..92f1899 --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/lib/udev/rules.d/90-slax-automount.rules @@ -0,0 +1,2 @@ +# we don't care about loop* and ram* devices +KERNEL=="[!lr]*", SUBSYSTEM=="block", RUN+="/usr/sbin/slax-automount %r/%k" diff --git a/linux-live/basesystem/01-core/rootcopy/usr/sbin/gtk-bookmarks-update b/linux-live/basesystem/01-core/rootcopy/usr/sbin/gtk-bookmarks-update new file mode 100755 index 0000000..1245bda --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/sbin/gtk-bookmarks-update @@ -0,0 +1,23 @@ +#!/bin/bash + +LOCK=/run/lock/gtk-bookmark-update-lock +BOOKMARKS=/root/.gtk-bookmarks + +# make sure to avoid parallel execution by using mkdir as lock +while true; do + mkdir $LOCK 2>/dev/null + if [ $? = 0 ]; then + break + fi +done + +cat $BOOKMARKS | fgrep -v ///media/ | fgrep -v "file:/// /" | egrep -v '^$' > $BOOKMARKS.tmp 2>/dev/null +ls -1 /media | sort | while read LINE; do + echo "file:///media/$LINE $LINE" >> $BOOKMARKS.tmp +done + +echo "file:/// /" >> $BOOKMARKS.tmp # add root at the beginning + +mv -f $BOOKMARKS.tmp $BOOKMARKS + +rmdir $LOCK diff --git a/linux-live/basesystem/01-core/rootcopy/usr/sbin/slax-automount b/linux-live/basesystem/01-core/rootcopy/usr/sbin/slax-automount new file mode 100755 index 0000000..093689c --- /dev/null +++ b/linux-live/basesystem/01-core/rootcopy/usr/sbin/slax-automount @@ -0,0 +1,67 @@ +#!/bin/bash +# Recreate fstab entries in /etc/fstab and make /media directories +# This script is called by udev rules, see /lib/udev/rules.d/ +# +# Author: Tomas M + +# Variables available in udev environment: +# $ACTION (eg: add, remove) +# $DEVNAME (full device node name including path) +# $DEVTYPE (eg: disk) +# $ID_FS_TYPE (eg: ext3) +# $MAJOR and $MINOR numbers +# $SUBSYSTEM (eg: block) + +PATH=$PATH:/usr/bin:/usr/sbin:/bin:/sbin + +BAS="$(basename "$DEVNAME")" +UNIT="media-$BAS.mount" +MNT="/media/$BAS" +TARGET="/etc/systemd/system/$UNIT" + + +# exit if noautomount boot parameter is present +if cat /proc/cmdline | grep -q noautomount; then + exit +fi + +# exit if 'automount' boot parameter is missing +if ! cat /proc/cmdline | grep -q automount; then + exit +fi + + +if [ "$ACTION" = "add" -o "$ACTION" = "change" ]; then + if [ ! -r "$TARGET" ]; then # skip if exists + + if [ "$ID_FS_TYPE" != "" -a "$(cat /proc/filesystems | grep "$ID_FS_TYPE")" != "" ]; then + + mkdir -p "$MNT" + + echo "[Unit]" >$TARGET + echo "Description=Disk $BAS" >>$TARGET + echo "" >>$TARGET + echo "[Mount]" >>$TARGET + echo "What=$DEVNAME" >>$TARGET + echo "Where=$MNT" >>$TARGET + echo "Type=$ID_FS_TYPE" >>$TARGET + echo "Options=defaults" >>$TARGET + echo "" >>$TARGET + echo "[Install]" >>$TARGET + echo "WantedBy=multi-user.target" >>$TARGET + + systemctl enable $UNIT + systemctl start $UNIT + + gtk-bookmarks-update + DISPLAY=:0.0 pcmanfm -n file://$MNT >/dev/null 2>&1 + fi + fi +fi + +if [ "$ACTION" = "remove" ]; then + systemctl disable $UNIT + rm "$TARGET" + rmdir "$MNT" + gtk-bookmarks-update +fi diff --git a/linux-live/bootfiles/boot/EFI/Boot/bootx64.efi b/linux-live/bootfiles/boot/EFI/Boot/bootx64.efi new file mode 100755 index 0000000..95d5126 Binary files /dev/null and b/linux-live/bootfiles/boot/EFI/Boot/bootx64.efi differ diff --git a/linux-live/bootfiles/boot/EFI/Boot/ldlinux.e64 b/linux-live/bootfiles/boot/EFI/Boot/ldlinux.e64 new file mode 100644 index 0000000..e5428ae Binary files /dev/null and b/linux-live/bootfiles/boot/EFI/Boot/ldlinux.e64 differ diff --git a/linux-live/bootfiles/boot/EFI/Boot/libcom32.c32 b/linux-live/bootfiles/boot/EFI/Boot/libcom32.c32 new file mode 100755 index 0000000..d9c8af3 Binary files /dev/null and b/linux-live/bootfiles/boot/EFI/Boot/libcom32.c32 differ diff --git a/linux-live/bootfiles/boot/EFI/Boot/libutil.c32 b/linux-live/bootfiles/boot/EFI/Boot/libutil.c32 new file mode 100644 index 0000000..492c227 Binary files /dev/null and b/linux-live/bootfiles/boot/EFI/Boot/libutil.c32 differ diff --git a/linux-live/bootfiles/boot/EFI/Boot/menu.c32 b/linux-live/bootfiles/boot/EFI/Boot/menu.c32 new file mode 100644 index 0000000..4088d58 Binary files /dev/null and b/linux-live/bootfiles/boot/EFI/Boot/menu.c32 differ diff --git a/linux-live/bootfiles/boot/EFI/Boot/syslinux.cfg b/linux-live/bootfiles/boot/EFI/Boot/syslinux.cfg new file mode 100644 index 0000000..6566d1d --- /dev/null +++ b/linux-live/bootfiles/boot/EFI/Boot/syslinux.cfg @@ -0,0 +1,42 @@ +UI vesamenu.c32 + +PROMPT 0 +TIMEOUT 40 + +MENU CLEAR +MENU HIDDEN +MENU HIDDENKEY Enter default +MENU BACKGROUND /minios/boot/bootlogo.png + +MENU WIDTH 80 +MENU MARGIN 20 +MENU ROWS 5 +MENU TABMSGROW 9 +MENU CMDLINEROW 9 +MENU HSHIFT 0 +MENU VSHIFT 19 + +MENU COLOR BORDER 30;40 #00000000 #00000000 none +MENU COLOR SEL 47;30 #FF000000 #FFFFFFFF none +MENU COLOR UNSEL 37;40 #FFFFFFFF #FF000000 none +MENU COLOR TABMSG 32;40 #FF60CA00 #FF000000 none + +F1 help.txt /minios/boot/zblack.png + +MENU AUTOBOOT Press Esc for options, automatic boot in # second{,s} ... +MENU TABMSG [F1] help [Tab] cmdline > + +LABEL default +MENU LABEL Run MiniOS Slax (Persistent changes) +KERNEL /minios/boot/vmlinuz +APPEND vga=normal initrd=/minios/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 consoleblank=0 slax.flags=perch,automount net.ifnames=0 biosdevname=0 + +LABEL live +MENU LABEL Run MiniOS Slax (Fresh start) +KERNEL /minios/boot/vmlinuz +APPEND vga=normal initrd=/minios/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 consoleblank=0 slax.flags=automount net.ifnames=0 biosdevname=0 + +LABEL toram +MENU LABEL Run MiniOS Slax (Copy to RAM) +KERNEL /minios/boot/vmlinuz +APPEND vga=normal initrd=/minios/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 consoleblank=0 slax.flags=toram net.ifnames=0 biosdevname=0 diff --git a/linux-live/bootfiles/boot/EFI/Boot/syslinux.efi b/linux-live/bootfiles/boot/EFI/Boot/syslinux.efi new file mode 100755 index 0000000..95d5126 Binary files /dev/null and b/linux-live/bootfiles/boot/EFI/Boot/syslinux.efi differ diff --git a/linux-live/bootfiles/boot/EFI/Boot/vesamenu.c32 b/linux-live/bootfiles/boot/EFI/Boot/vesamenu.c32 new file mode 100755 index 0000000..06ac582 Binary files /dev/null and b/linux-live/bootfiles/boot/EFI/Boot/vesamenu.c32 differ diff --git a/linux-live/bootfiles/boot/bootinst.bat b/linux-live/bootfiles/boot/bootinst.bat new file mode 100755 index 0000000..a43f872 --- /dev/null +++ b/linux-live/bootfiles/boot/bootinst.bat @@ -0,0 +1,106 @@ +#!/bin/sh +exec /bin/bash "$(dirname "$0")"/bootinst.sh +exec /bin/sh "$(dirname "$0")"/bootinst.sh + +@echo off +COLOR 2F +cls +echo =============================================================================== +echo. +echo ________.__ +echo / ____/^| ^| _____ ___ ___ +echo \____ \ ^| ^| \__ \ \ \/ / +echo / \^| ^|__/ __ \_^> ^< +echo /______ /^|____(____ /__/\_ \ +echo \/ \/ \/ +echo. +echo =============================================================================== +echo. + +set DISK=none +set BOOTFLAG=boot666s.tmp + +:checkPrivileges +mkdir "%windir%\AdminCheck" 2>nul +if '%errorlevel%' == '0' rmdir "%windir%\AdminCheck" & goto gotPrivileges else goto getPrivileges + +:getPrivileges +ECHO. +ECHO Administrator Rights are required +ECHO Invoking UAC for Privilege Escalation +ECHO. +runadmin.vbs %0 +goto end + +:gotPrivileges +CD /D "%~dp0" + +echo This file is used to determine current drive letter. It should be deleted. >\%BOOTFLAG% +if not exist \%BOOTFLAG% goto readOnly + +echo.|set /p=wait please +for %%d in ( C D E F G H I J K L M N O P Q R S T U V W X Y Z ) do echo.|set /p=. & if exist %%d:\%BOOTFLAG% set DISK=%%d +echo . . . . . . . . . . +del \%BOOTFLAG% +if %DISK% == none goto DiskNotFound + +wscript.exe samedisk.vbs %windir% %DISK% +if %ERRORLEVEL% == 99 goto refuseDisk + +echo Setting up boot record for %DISK%: ... + +if %OS% == Windows_NT goto setupNT +goto setup95 + +:setupNT +\slax\boot\syslinux.exe -maf -d /slax/boot/ %DISK%: +if %ERRORLEVEL% == 0 goto setupEFI +goto errorFound + +:setup95 +\slax\boot\syslinux.com -maf -d /slax/boot/ %DISK%: +if %ERRORLEVEL% == 0 goto setupEFI +goto errorFound + +:setupEFI +mkdir %DISK%:\EFI\Boot +copy \slax\boot\EFI\Boot\* %DISK%:\EFI\Boot +goto setupDone + +:setupDone +echo Installation finished. +goto pauseit + +:errorFound +color 4F +echo. +echo Error installing boot loader +goto pauseit + +:refuseDisk +color 4F +echo. +echo Directory %DISK%:\slax\boot\ seems to be on the same physical disk as your Windows. +echo Installing bootloader would harm your Windows and thus is disabled. +echo Please use different drive and try again. +goto pauseit + +:readOnly +color 4F +echo. +echo You're starting this installer from a read-only media, this will not work. +goto pauseit + +:DiskNotFound +color 4F +echo. +echo Error: can't discover current drive letter + +:pauseit +if "%1" == "auto" goto end + +echo. +echo Press any key... +pause > nul + +:end diff --git a/linux-live/bootfiles/boot/bootinst.sh b/linux-live/bootfiles/boot/bootinst.sh new file mode 100755 index 0000000..7ec48d0 --- /dev/null +++ b/linux-live/bootfiles/boot/bootinst.sh @@ -0,0 +1,158 @@ +#!/bin/sh +# +# This script will setup booting from disk (USB or harddrive) +# +# If you see this file in a text editor instead of getting it executed, +# then it is missing executable permissions (chmod). You can try to set +# exec permissions for this file by using: chmod a+x bootinst.sh +# Alternatively, you may try to run bootinst.bat file instead +# +# Scrolling down will reveal the actual code of this script. +# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# if we're running this from X, re-run the script in konsole or xterm +if [ "$DISPLAY" != "" ]; then + if [ "$1" != "--rex" -a "$2" != "--rex" ]; then + konsole --nofork -e /bin/sh $0 --rex 2>/dev/null || xterm -e /bin/sh $0 --rex 2>/dev/null || /bin/sh $0 --rex 2>/dev/null + exit + fi +fi + +# make sure I am root +if [ "$UID" != "0" -a "$UID" != "" ]; then + echo "" + echo "You are not root. You must run bootinst script as root." + echo "The bootinst script needs direct access to your boot device." + echo "Use sudo or kdesudo or similar wrapper to execute this." + read junk + exit 1 +fi + +# change working directory to dir from which we are started +CWD="$(pwd)" +BOOT="$(dirname "$0")" +BOOT="$(realpath "$BOOT" 2>/dev/null || echo $BOOT)" +cd "$BOOT" + +# find out device and mountpoint +PART="$(df . | tail -n 1 | tr -s " " | cut -d " " -f 1)" +DEV="$(echo "$PART" | sed -r "s:[0-9]+\$::" | sed -r "s:([0-9])[a-z]+\$:\\1:i")" #" + +# check if disk is already bootable. Mostly for Windows discovery +if [ "$(fdisk -l "$DEV" | fgrep "$DEV" | fgrep "*")" != "" ]; then + echo "" + echo "Partition $PART seems to be located on a physical disk," + echo "which is already bootable. If you continue, your drive $DEV" + echo "will boot only Slax by default." + echo "Press [Enter] to continue, or [Ctrl+C] to abort..." + read junk +fi + +ARCH=$(uname -m) +if [ "$ARCH" = "x86_64" ]; then ARCH=64; else ARCH=32; fi +EXTLINUX=extlinux.x$ARCH + +if [ ! -x ./$EXTLINUX ]; then + # extlinux is not executable. There are two possible reasons: + # either the fs is mounted with noexec, or file perms are wrong. + # Try to fix both, no fail on error yet + mount -o remount,exec $DEV + chmod a+x ./$EXTLINUX +fi + +if [ ! -x ./$EXTLINUX ]; then + # extlinux is still not executable. As a last try, copy it to .exe + # because the partition may be mounted with showexec option, from which + # we probably can't escape by remount + cp -f ./$EXTLINUX ./extlinux.exe + EXTLINUX=extlinux.exe +fi + +# install syslinux bootloader +echo "* attempting to install bootloader to $BOOT..." + +./"$EXTLINUX" --install "$BOOT" + +if [ $? -ne 0 ]; then + echo "Error installing boot loader." + echo "Read the errors above and press enter to exit..." + read junk + exit 1 +fi + +if [ "$DEV" != "$PART" ]; then + # Setup MBR on the first block + echo "* setup MBR on $DEV" + dd bs=440 count=1 conv=notrunc if="$BOOT/mbr.bin" of="$DEV" 2>/dev/null + + # Toggle bootable flags + echo "* set bootable flag for $PART" + PART="$(echo "$PART" | sed -r "s:.*[^0-9]::")" + ( + fdisk -l "$DEV" | fgrep "*" | fgrep "$DEV" | cut -d " " -f 1 \ + | sed -r "s:.*[^0-9]::" | xargs -I '{}' echo -ne "a\n{}\n" + echo a + echo $PART + echo w + ) | fdisk $DEV >/dev/null 2>&1 +fi + +# UEFI boot loader +mkdir -p "$BOOT/../../EFI" +mv "EFI/Boot" "$BOOT/../../EFI/" + +echo "Boot installation finished." +echo "Press Enter..." +read junk +cd "$CWD" diff --git a/linux-live/bootfiles/boot/bootlogo-hd.png b/linux-live/bootfiles/boot/bootlogo-hd.png new file mode 100644 index 0000000..45ec427 Binary files /dev/null and b/linux-live/bootfiles/boot/bootlogo-hd.png differ diff --git a/linux-live/bootfiles/boot/bootlogo.png b/linux-live/bootfiles/boot/bootlogo.png new file mode 100644 index 0000000..a6af99f Binary files /dev/null and b/linux-live/bootfiles/boot/bootlogo.png differ diff --git a/linux-live/bootfiles/boot/extlinux.x32 b/linux-live/bootfiles/boot/extlinux.x32 new file mode 100755 index 0000000..4db677c Binary files /dev/null and b/linux-live/bootfiles/boot/extlinux.x32 differ diff --git a/linux-live/bootfiles/boot/extlinux.x64 b/linux-live/bootfiles/boot/extlinux.x64 new file mode 100755 index 0000000..dc07867 Binary files /dev/null and b/linux-live/bootfiles/boot/extlinux.x64 differ diff --git a/linux-live/bootfiles/boot/help.txt b/linux-live/bootfiles/boot/help.txt new file mode 100644 index 0000000..43ad58c --- /dev/null +++ b/linux-live/bootfiles/boot/help.txt @@ -0,0 +1,19 @@ + + Welcome + + If you need to edit boot command line (for advanced users), hit [Tab]. + When finished, press [Enter]. + + + Keep changes persistent + + Save all filesystem modifications to 'changes' directory and restore + those changes next time you boot. Only usable while running from a + writable media such as USB device or hard disk. + + + Copy to RAM + + Copies all data to memory during startup so you can eject the boot device. + Requires enough RAM to store all modules and to run the system. + diff --git a/linux-live/bootfiles/boot/isolinux.bin b/linux-live/bootfiles/boot/isolinux.bin new file mode 100644 index 0000000..cbdc7a2 Binary files /dev/null and b/linux-live/bootfiles/boot/isolinux.bin differ diff --git a/linux-live/bootfiles/boot/ldlinux.c32 b/linux-live/bootfiles/boot/ldlinux.c32 new file mode 100644 index 0000000..6186b22 Binary files /dev/null and b/linux-live/bootfiles/boot/ldlinux.c32 differ diff --git a/linux-live/bootfiles/boot/libcom32.c32 b/linux-live/bootfiles/boot/libcom32.c32 new file mode 100644 index 0000000..f9a7e43 Binary files /dev/null and b/linux-live/bootfiles/boot/libcom32.c32 differ diff --git a/linux-live/bootfiles/boot/libutil.c32 b/linux-live/bootfiles/boot/libutil.c32 new file mode 100644 index 0000000..e5105f6 Binary files /dev/null and b/linux-live/bootfiles/boot/libutil.c32 differ diff --git a/linux-live/bootfiles/boot/mbr.bin b/linux-live/bootfiles/boot/mbr.bin new file mode 100644 index 0000000..0d8bad4 Binary files /dev/null and b/linux-live/bootfiles/boot/mbr.bin differ diff --git a/linux-live/bootfiles/boot/pxelinux.0 b/linux-live/bootfiles/boot/pxelinux.0 new file mode 100644 index 0000000..61a3888 Binary files /dev/null and b/linux-live/bootfiles/boot/pxelinux.0 differ diff --git a/linux-live/bootfiles/boot/runadmin.vbs b/linux-live/bootfiles/boot/runadmin.vbs new file mode 100644 index 0000000..1bc13af --- /dev/null +++ b/linux-live/bootfiles/boot/runadmin.vbs @@ -0,0 +1,3 @@ +Set UAC = CreateObject("Shell.Application") +Set args = WScript.Arguments +UAC.ShellExecute args.Item(0), "", "", "runas", 1 diff --git a/linux-live/bootfiles/boot/samedisk.vbs b/linux-live/bootfiles/boot/samedisk.vbs new file mode 100644 index 0000000..a19d6eb --- /dev/null +++ b/linux-live/bootfiles/boot/samedisk.vbs @@ -0,0 +1,68 @@ +' This script compares two given parameters (just first letter, so you can pass in full paths as well) +' and returns exit code 99 if both disk drives are on the same physical drive +' Run it as: wscript.exe samedisk.vbs c:\ d:\ +' Author: Tomas M +' Inspired by: http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/disk/drives/ +' ------------------------------------------- + +drive1 = "" +drive2 = "" +phys1 = "" +phys2 = "" + +Set args = WScript.Arguments + +if args.Length > 0 then + drive1 = args.Item(0) +end if +if args.Length > 1 then + drive2 = args.Item(1) +end if + +if drive1 = "" then + WScript.Quit(1) +end if + +if drive2 = "" then + WScript.Quit(2) +end if + + +ComputerName = "." +Set wmiServices = GetObject _ + ("winmgmts:{impersonationLevel=Impersonate}!//" & ComputerName) +Set wmiDiskDrives = wmiServices.ExecQuery _ + ("SELECT Caption, DeviceID FROM Win32_DiskDrive") + +For Each wmiDiskDrive In wmiDiskDrives + + strEscapedDeviceID = _ + Replace(wmiDiskDrive.DeviceID, "\", "\\", 1, -1, vbTextCompare) + Set wmiDiskPartitions = wmiServices.ExecQuery _ + ("ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & _ + strEscapedDeviceID & """} WHERE " & _ + "AssocClass = Win32_DiskDriveToDiskPartition") + + For Each wmiDiskPartition In wmiDiskPartitions + Set wmiLogicalDisks = wmiServices.ExecQuery _ + ("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & _ + wmiDiskPartition.DeviceID & """} WHERE " & _ + "AssocClass = Win32_LogicalDiskToPartition") + + For Each wmiLogicalDisk In wmiLogicalDisks + + if UCase(Left(drive1,1)) = UCase(Left(wmiLogicalDisk.DeviceID,1)) then + phys1=wmiDiskDrive.DeviceID + end if + + if UCase(Left(drive2,1)) = UCase(Left(wmiLogicalDisk.DeviceID,1)) then + phys2=wmiDiskDrive.DeviceID + end if + + Next + Next +Next + +if phys1 = phys2 then + WScript.Quit(99) +end if diff --git a/linux-live/bootfiles/boot/syslinux.cfg b/linux-live/bootfiles/boot/syslinux.cfg new file mode 100644 index 0000000..eaefab0 --- /dev/null +++ b/linux-live/bootfiles/boot/syslinux.cfg @@ -0,0 +1,42 @@ +UI /minios/boot/vesamenu.c32 + +PROMPT 0 +TIMEOUT 40 + +MENU CLEAR +MENU HIDDEN +MENU HIDDENKEY Enter default +MENU BACKGROUND /minios/boot/bootlogo.png + +MENU WIDTH 80 +MENU MARGIN 20 +MENU ROWS 5 +MENU TABMSGROW 9 +MENU CMDLINEROW 9 +MENU HSHIFT 0 +MENU VSHIFT 19 + +MENU COLOR BORDER 30;40 #00000000 #00000000 none +MENU COLOR SEL 47;30 #FF000000 #FFFFFFFF none +MENU COLOR UNSEL 37;40 #FFFFFFFF #FF000000 none +MENU COLOR TABMSG 32;40 #FF60CA00 #FF000000 none + +F1 help.txt /minios/boot/zblack.png + +MENU AUTOBOOT Press Esc for options, automatic boot in # second{,s} ... +MENU TABMSG [F1] help [Tab] cmdline > + +LABEL default +MENU LABEL Run MiniOS Slax (Persistent changes) +KERNEL /minios/boot/vmlinuz +APPEND vga=normal initrd=/minios/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 consoleblank=0 minios.flags=perch net.ifnames=0 biosdevname=0 + +LABEL perch +MENU LABEL Run MiniOS Slax (Fresh start) +KERNEL /minios/boot/vmlinuz +APPEND vga=normal initrd=/minios/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 consoleblank=0 minios.flags= net.ifnames=0 biosdevname=0 + +LABEL toram +MENU LABEL Run MiniOS Slax (Copy to RAM) +KERNEL /minios/boot/vmlinuz +APPEND vga=normal initrd=/minios/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 consoleblank=0 minios.flags=toram net.ifnames=0 biosdevname=0 diff --git a/linux-live/bootfiles/boot/syslinux.com b/linux-live/bootfiles/boot/syslinux.com new file mode 100644 index 0000000..514e72c Binary files /dev/null and b/linux-live/bootfiles/boot/syslinux.com differ diff --git a/linux-live/bootfiles/boot/syslinux.exe b/linux-live/bootfiles/boot/syslinux.exe new file mode 100644 index 0000000..8c3c859 Binary files /dev/null and b/linux-live/bootfiles/boot/syslinux.exe differ diff --git a/linux-live/bootfiles/boot/vesamenu.c32 b/linux-live/bootfiles/boot/vesamenu.c32 new file mode 100644 index 0000000..c423245 Binary files /dev/null and b/linux-live/bootfiles/boot/vesamenu.c32 differ diff --git a/linux-live/bootfiles/boot/zblack.png b/linux-live/bootfiles/boot/zblack.png new file mode 100644 index 0000000..be1a21d Binary files /dev/null and b/linux-live/bootfiles/boot/zblack.png differ diff --git a/linux-live/bootinfo.txt b/linux-live/bootinfo.txt new file mode 100644 index 0000000..a860f52 --- /dev/null +++ b/linux-live/bootinfo.txt @@ -0,0 +1,24 @@ +# This file gets copied to LiveKit ZIP build, in order to provide +# some basic information for the user - mostly hints to encourage +# the user to run /mylinux/boot/bootinst.sh(bat). +# +# Lines containing # are ignored +# +Thank you for using mylinux! +If you are reading this from a CD, it is already bootable. +Steps to make it bootable from your USB device are following: + +1) Copy the entire /mylinux/ directory to your USB drive. + If you are using Windows, you will get for example E:\mylinux\ + You probably already did this - just make sure you are on your + USB drive now and not on your local harddisk. + +2) Now navigate to directory /mylinux/boot/ on your USB drive. + In Windows, it will be E:\mylinux\boot\ for example. + Use explorer or any other file manager for this task. + +3) While you're in the boot directory, locate file bootinst.bat + Run it by doubleclicking it. It will setup your USB to boot. + +-- That's it. Your USB device is now ready to boot mylinux. +-- You can safely delete this file (readme.txt), it's not needed. diff --git a/linux-live/build b/linux-live/build new file mode 100755 index 0000000..1f8bc71 --- /dev/null +++ b/linux-live/build @@ -0,0 +1,93 @@ +#!/bin/bash +# Linux Live Kit version 7 + +export PATH=.:./tools:../tools:/usr/sbin:/usr/bin:/sbin:/bin:/ + +CHANGEDIR=$(dirname $(readlink -f $0)) +echo "Changing current directory to $CHANGEDIR" +CWD="$(pwd)" +cd $CHANGEDIR + +. ./config || exit 1 +. ./livekitlib || exit 1 + +# only root can continue, because only root can read all files from your system +allow_only_root + +# check for mksquashfs with xz compression +if [ "$(mksquashfs 2>&1 | grep "Xdict-size")" = "" ]; then + echo "mksquashfs not found or doesn't support -comp xz, aborting, no changes made" + echo "you may consider installing squashfs-tools package" + exit 1 +fi + +MKISOFS=$(which mkisofs) +if [ "$MKISOFS" = "" ]; then + MKISOFS=$(which genisoimage) +fi +if [ "$MKISOFS" = "" ]; then + echo "Cannot found mkisofs or genisoimage, stop" + exit 3 +fi + +# build initramfs image +if [ "$SKIPINITRFS" = "" ]; then + echo "Building intramfs image..." + cd initramfs + INITRAMFS=$(./initramfs_create) + cd .. +fi + +# create live kit filesystem (cpio archive) +rm -Rf "$LIVEKITDATA" +BOOT="$LIVEKITDATA"/"$LIVEKITNAME"/boot +mkdir -p "$BOOT" +mkdir -p "$BOOT"/../changes +mkdir -p "$BOOT"/../modules + +if [ "$INITRAMFS" != "" ]; then + mv "$INITRAMFS" $BOOT/initrfs.img +fi + +# BIOS / MBR booting +cp -r bootfiles/* $BOOT +cat bootfiles/syslinux.cfg | sed -r "s:/boot/:/$LIVEKITNAME/boot/:" > $BOOT/syslinux.cfg +cat bootfiles/bootinst.bat | sed -r "s:/boot/:/$LIVEKITNAME/boot/:" | sed -r "s:\\\\boot\\\\:\\\\$LIVEKITNAME\\\\boot\\\\:" > $BOOT/bootinst.bat +cp $VMLINUZ $BOOT/ || exit + +# UEFI booting +mkdir -p $BOOT/EFI/Boot +cp bootfiles/EFI/Boot/syslinux.efi $BOOT/EFI/Boot/bootx64.efi +cp bootfiles/EFI/Boot/{ldlinux.e64,menu.c32,libutil.c32,vesamenu.c32,libcom32.c32} $BOOT/EFI/Boot +cat $BOOT/syslinux.cfg | sed -r "s:/$LIVEKITNAME/boot/vesamenu:vesamenu:" > $BOOT/EFI/Boot/syslinux.cfg + +# create compressed 01-core.sb +COREFS="" +for i in $MKMOD; do + if [ -d /$i ]; then + COREFS="$COREFS /$i" + fi +done +mksquashfs $COREFS $LIVEKITDATA/$LIVEKITNAME/01-core.$BEXT -comp xz -b 1024K -always-use-fragments -keep-as-directory || exit + +cd "$LIVEKITDATA" +ARCH=$(uname -m) +TARGET=/tmp + +cat "$CWD/bootinfo.txt" | fgrep -v "#" | sed -r "s/mylinux/$LIVEKITNAME/" | sed -r "s/\$/\x0D/" > readme.txt + +echo cd $LIVEKITDATA '&&' $MKISOFS -o "$TARGET/$LIVEKITNAME-$ARCH.iso" -v -J -R -D -A "$LIVEKITNAME" -V "$LIVEKITNAME" \ +-no-emul-boot -boot-info-table -boot-load-size 4 \ +-b "$LIVEKITNAME"/boot/isolinux.bin -c "$LIVEKITNAME"/boot/isolinux.boot . \ +> $TARGET/gen_"$LIVEKITNAME"_iso.sh +chmod o+x $TARGET/gen_"$LIVEKITNAME"_iso.sh + +echo cd $LIVEKITDATA '&&' zip -0 -r "$TARGET/$LIVEKITNAME-$ARCH.zip" '*' \ +> $TARGET/gen_"$LIVEKITNAME"_zip.sh +chmod o+x $TARGET/gen_"$LIVEKITNAME"_zip.sh + +echo "-----------------------------" +echo "Finished. Find your result in $LIVEKITDATA" +echo "To build ISO, run: $TARGET/gen_"$LIVEKITNAME"_iso.sh" +echo "To build ZIP, run: $TARGET/gen_"$LIVEKITNAME"_zip.sh" +cd $CWD diff --git a/linux-live/buildconfig b/linux-live/buildconfig new file mode 100644 index 0000000..e14eb6b --- /dev/null +++ b/linux-live/buildconfig @@ -0,0 +1,43 @@ +#!/bin/bash + +LOGPATH="/var/log" + +# default is output to log. you can use OUTPUT="/dev/stdout" if you want to route events to standard output. +#OUTPUT="$LOGPATH/$LIVEKITNAME.log" +OUTPUT="/dev/stdout" +#OUTPUT="/dev/null" + +# if = "1", creates a second iso with a constant filename +# если ="1", создаёт второй iso с постоянным именем файла +BUILD_TEST_ISO="1" + +# удаляет старые файлы iso для данного типа сборки +REMOVE_OLD_ISO="0" + +# if = "1", creates a copy of minios-live in chroot /opt +# если ="1", создаёт копию minios-live в chroot /opt +DEV_SYSTEM="0" + +# if ="1", creates backup in parent folder +# если ="1", создаёт резервную копию в родительской папке +CREATE_BACKUP="0" + +DEBIAN_FRONTEND_TYPE="noninteractive" +#DEBIAN_FRONTEND_TYPE="dialog" +#DEBIAN_FRONTEND_TYPE="text" + +APT_CMD="apt-get" + +APT_OPTIONS="-y" +APT_OPTIONS2="--no-install-recommends" + +#LIVE_TYPE="casper" +LIVE_TYPE="livekit" + +#BOOT_TYPE="minios" +BOOT_TYPE="slax" + +UNION_BUILD_TYPE="overlayfs" +#UNION_BUILD_TYPE="aufs" + +INSTALL_OPTIONAL="1" diff --git a/linux-live/cleanup b/linux-live/cleanup new file mode 100644 index 0000000..dd745ec --- /dev/null +++ b/linux-live/cleanup @@ -0,0 +1,91 @@ +#!/bin/bash + +rm -f /etc/fstab +rm -f /etc/mtab +rm -f /etc/apt/sources.list~ +rm -Rf /etc/systemd/system/timers.target.wants +rm -f /etc/systemd/system/multi-user.target.wants/ssh.service +rm -f /etc/systemd/system/multi-user.target.wants/dnsmasq.service + +rm -f /etc/ssh/ssh_host* + +rm -f /var/backups/* +rm -f /var/cache/ldconfig/* +rm -f /var/cache/debconf/* +rm -f /var/cache/fontconfig/* +rm -f /var/lib/apt/extended_states +rm -f /var/lib/systemd/random-seed +rm -f /var/lib/apt/lists/deb.* +rm -Rf /root/.local/share/mc +rm -Rf /root/.cache +rm -f /root/.wget-hsts + +rm -f /var/lib/dpkg/*-old +rm -f /var/log/* +rm -f /var/log/*/* +rm -f /var/log/*/*/* +rm -f /var/cache/apt/archives/*.deb +rm -f /var/cache/apt/*.bin +rm -f /var/cache/debconf/*-old +rm -f /var/lib/dhcp/dhclient.leases +rm -f /root/.bash_history +rm -f /root/.wget-hsts +rm -Rf /usr/share/doc/* +rm -Rf /usr/share/info/* +rm -f /usr/share/images/fluxbox/debian-squared.jpg +rm -Rf /usr/share/fluxbox/nls/??* +rm -Rf /usr/share/gnome/help + +rm -Rf /usr/share/locale/?? +rm -Rf /usr/share/locale/??_* +rm -Rf /usr/share/locale/??@* +rm -Rf /usr/share/locale/??? +rm -Rf /usr/share/i18n/locales/*_* +rm -Rf /usr/share/man/?? +rm -Rf /usr/share/man/*_* + +rm -Rf /usr/share/icons/elementaryXubuntu-dark +rm -Rf /usr/share/icons/gnome/256x256 + +rm /usr/share/applications/compton.desktop +rm /usr/share/applications/debian-uxterm.desktop +rm /usr/share/applications/debian-xterm.desktop +rm /usr/share/applications/htop.desktop +rm /usr/share/applications/mc.desktop +rm /usr/share/applications/mcedit.desktop +rm /usr/share/applications/pcmanfm-desktop-pref.desktop +rm /usr/share/applications/python2.7.desktop +rm /usr/share/applications/python3.7.desktop +rm /usr/share/applications/vim.desktop + + + +# Unzip gzipped files (man pages), so LZMA can compress 2times better. +# First we fix symlinks, then uncompress files +# $1 = search directory +uncompress_files() +{ + local LINK LINE + + find "$1" -type l -name "*.gz" | while read LINE; do + LINK="$(readlink "$LINE" | sed -r 's/.gz$//')" + FILE="$(echo "$LINE" | sed -r 's/.gz$//')" + ln -sfn "$LINK" "$FILE" + rm -f "$LINE" + done + find "$1" -type f -name "*.gz" | xargs -r gunzip +} + +uncompress_files /etc/alternatives +uncompress_files /usr/share/man + +# remove broken links +# $1 = search directory +remove_broken_links() +{ + find "$1" -type l -exec test ! -e {} \; -print | xargs rm -vf +} + +remove_broken_links /etc/alternatives +remove_broken_links /usr/share/man + diff --git a/linux-live/config b/linux-live/config new file mode 100644 index 0000000..bc93df1 --- /dev/null +++ b/linux-live/config @@ -0,0 +1,72 @@ +#!/bin/bash +# This is a config file for Linux Live Kit build script. +# You shouldn't need to change anything expect LIVEKITNAME + +# Live Kit Name. Defaults to 'linux'; +# This will be the name of the directory created on your CD/USB, which +# will contain everything including boot files and such. +# For example, Slax changes it to 'slax' +# Must not contain any spaces. +# If you change it, you must run ./tools/isolinux.bin.update script +# in order to update isolinux.bin for CD booting. +# If you do not need booting from CD (eg you're booting only from USB) +# then you can ignore recompiling isolinux.bin, just rename LIVEKITNAME +# and you're done. +LIVEKITNAME="minios" + +# +SYSTEMNAME="MiniOS" + +# +SYSTEMVER="2021" + +# +DISTRIBUTION="buster" + +# +DISTRIBUTION_ARCH="amd64" + +# +DISTRIBUTION_VARIANT="minbase" +#DISTRIBUTION_VARIANT="" + +# +DISTRIBUTION_URL="http://ftp.ru.debian.org/debian/" + +# +COMP_TYPE="xz" + +# Kernel file, will be copied to your Live Kit +# Your kernel must support aufs and squashfs. Debian Jessie's kernel is ready +# out of the box. +VMLINUZ="/vmlinuz" + +# Kernel version. Change it to "3.2.28" for example, if you are building +# Live Kit with a different kernel than the one you are actually running +if [ -f /usr/bin/dpkg-query ] 2>/dev/null; then + KERNEL=$(dpkg-query -W -f='${binary:Package}\n' linux-image-* | head -n 1 | sed 's/linux-image-//') +else + KERNEL=$(uname -r) +fi + +# List of directories for root filesystem +# No subdirectories are allowed, no slashes, +# so You can't use /var/tmp here for example +# Exclude directories like proc sys tmp +MKMOD="bin etc home lib lib64 opt root sbin srv usr var" + +# If you require network support in initrd, for example to boot over +# PXE or to load data using 'from' boot parameter from a http server, +# you will need network modules included in your initrd. +# This is disabled by default since most people won't need it. +# To enable, set to true +NETWORK=true + +# Temporary directory to store livekit filesystem +LIVEKITDATA=/tmp/$LIVEKITNAME-data-$$ + +# Bundle extension, for example 'sb' for .sb extension +BEXT=sb + +# Directory with kernel .ko modules, can be different in some distros +LMK="lib/modules/$KERNEL" diff --git a/linux-live/initramfs/init b/linux-live/initramfs/init new file mode 100644 index 0000000..9098bcf --- /dev/null +++ b/linux-live/initramfs/init @@ -0,0 +1,61 @@ +#!/bin/sh +# Initial script for Linux Live Kit +# Author: Tomas M + +export PATH=.:/:/usr/sbin:/usr/bin:/sbin:/bin + +. /lib/config +. /lib/livekitlib + +transfer_initramfs + +MEMORY=/memory +CHANGES=$MEMORY/changes +UNION=$MEMORY/union +DATAMNT=$MEMORY/data +BUNDLES=$MEMORY/bundles + +header "Live Kit init " + +init_proc_sysfs + +debug_start + debug_shell +# load some modules manually first, then modprobe everything we have +init_devs +init_aufs +init_zram + +# modprobe all devices excluding network drivers +modprobe_everything -v /drivers/net/ + +# find data dir with filesystem bundles +DATA="$(find_data 45 "$DATAMNT")" +check_data_found "$DATA" + debug_shell +# setup persistent changes, if possible +persistent_changes "$DATA" "$CHANGES" + debug_shell +# copy to RAM if needed +DATA="$(copy_to_ram "$DATA" "$CHANGES")" + +# mount bundles +mount_bundles "$DATA" "$BUNDLES" + debug_shell +# init aufs union, or setup overlayfs union +init_union "$CHANGES" "$UNION" "$BUNDLES" + +# add data to aufs union +union_append_bundles "$BUNDLES" "$UNION" + debug_shell +# rootcopy +copy_rootcopy_content "$DATA" "$UNION" + +# create fstab +fstab_create "$UNION" "$DATAMNT" + debug_shell +header "Live Kit done, starting $LIVEKITNAME" +change_root "$UNION" + +header "!!ERROR occured, you shouldn't be here.!!" +/bin/sh diff --git a/linux-live/initramfs/initramfs_create b/linux-live/initramfs/initramfs_create new file mode 100755 index 0000000..9978003 --- /dev/null +++ b/linux-live/initramfs/initramfs_create @@ -0,0 +1,159 @@ +#!/bin/bash +# Create initramfs image +# Author: Tomas M +# + +. ../config + +INITRAMFS=/tmp/$LIVEKITNAME-initramfs-$$ + +# copy file to initramfs tree, including +# all library dependencies (as shown by ldd) +# $1 = file to copy (full path) +copy_including_deps() { + # if source doesn't exist or target exists, do nothing + if [ ! -e "$1" -o -e "$INITRAMFS"/"$1" ]; then + return + fi + + cp -R --parents "$1" "$INITRAMFS" + if [ -L "$1" ]; then + DIR="$(dirname "$1")" + LNK="$(readlink "$1")" + copy_including_deps "$( + cd "$DIR" + realpath -s "$LNK" + )" + fi + + ldd "$1" 2>/dev/null | sed -r "s/.*=>|[(].*//g" | sed -r "s/^\\s+|\\s+\$//" | + while read LIB; do + copy_including_deps "$LIB" + done + + for MOD in $(find "$1" -type f | grep .ko); do + for DEP in $(cat /$LMK/modules.dep | fgrep /$(basename $MOD):); do + copy_including_deps "/$LMK/$DEP" + done + done + + shift + if [ "$1" != "" ]; then + copy_including_deps "$@" + fi +} + +rm -Rf $INITRAMFS +mkdir -p $INITRAMFS/{bin,dev,etc,lib,lib64,mnt,proc,root,run,sys,tmp,usr,var/log} +ln -s bin $INITRAMFS/sbin + +cp static/busybox $INITRAMFS/bin +cp static/eject $INITRAMFS/bin +cp static/mount.dynfilefs $INITRAMFS/bin/@mount.dynfilefs +cp static/mount.httpfs2 $INITRAMFS/bin/@mount.httpfs2 +cp static/mount.ntfs-3g $INITRAMFS/bin/@mount.ntfs-3g +cp static/blkid $INITRAMFS/bin +chmod a+x $INITRAMFS/bin/* + +$INITRAMFS/bin/busybox | grep , | grep -v Copyright | tr "," " " | while read LINE; do + for TOOL in $LINE; do + if [ ! -e $INITRAMFS/bin/$TOOL ]; then + ln -s busybox $INITRAMFS/bin/$TOOL + fi + done +done +rm -f $INITRAMFS/{s,}bin/init + +mknod $INITRAMFS/dev/console c 5 1 +mknod $INITRAMFS/dev/null c 1 3 +mknod $INITRAMFS/dev/ram0 b 1 0 +mknod $INITRAMFS/dev/tty1 c 4 1 +mknod $INITRAMFS/dev/tty2 c 4 2 +mknod $INITRAMFS/dev/tty3 c 4 3 +mknod $INITRAMFS/dev/tty4 c 4 4 + +#copy_including_deps /usr/bin/strace +#copy_including_deps /usr/bin/lsof + +copy_including_deps /$LMK/kernel/fs/aufs +copy_including_deps /$LMK/kernel/fs/overlayfs +copy_including_deps /$LMK/kernel/fs/ext2 +copy_including_deps /$LMK/kernel/fs/ext3 +copy_including_deps /$LMK/kernel/fs/ext4 +copy_including_deps /$LMK/kernel/fs/fat +copy_including_deps /$LMK/kernel/fs/nls +copy_including_deps /$LMK/kernel/fs/fuse +copy_including_deps /$LMK/kernel/fs/isofs +copy_including_deps /$LMK/kernel/fs/ntfs +copy_including_deps /$LMK/kernel/fs/reiserfs +copy_including_deps /$LMK/kernel/fs/squashfs + +# crc32c is needed for ext4, but I don't know which one, add them all, they are small +find /$LMK/kernel/ | grep crc32c | while read LINE; do + copy_including_deps $LINE +done + +copy_including_deps /$LMK/kernel/drivers/staging/zsmalloc # needed by zram +copy_including_deps /$LMK/kernel/drivers/block/zram +copy_including_deps /$LMK/kernel/drivers/block/loop.* + +# usb drivers +copy_including_deps /$LMK/kernel/drivers/usb/storage/usb-storage.* +copy_including_deps /$LMK/kernel/drivers/usb/host +copy_including_deps /$LMK/kernel/drivers/usb/common +copy_including_deps /$LMK/kernel/drivers/usb/core +copy_including_deps /$LMK/kernel/drivers/hid/usbhid +copy_including_deps /$LMK/kernel/drivers/hid/hid.* +copy_including_deps /$LMK/kernel/drivers/hid/uhid.* +copy_including_deps /$LMK/kernel/drivers/hid/hid-generic.* + +# disk and cdrom drivers +copy_including_deps /$LMK/kernel/drivers/cdrom +copy_including_deps /$LMK/kernel/drivers/scsi/sr_mod.* +copy_including_deps /$LMK/kernel/drivers/scsi/sd_mod.* +copy_including_deps /$LMK/kernel/drivers/scsi/scsi_mod.* +copy_including_deps /$LMK/kernel/drivers/scsi/sg.* +copy_including_deps /$LMK/kernel/drivers/ata +copy_including_deps /$LMK/kernel/drivers/nvme +copy_including_deps /$LMK/kernel/drivers/mmc + +# network support drivers +if [ "$NETWORK" = "true" ]; then + # add all known ethernet drivers + copy_including_deps /$LMK/kernel/drivers/net/ethernet +fi + +# copy all custom-built modules +copy_including_deps /$LMK/updates + +copy_including_deps /$LMK/modules.* + +find $INITRAMFS -name "*.ko.gz" -exec gunzip {} \; + +# trim modules.order file. Perhaps we could remove it entirely +MODULEORDER="$( + cd "$INITRAMFS/$LMK/" + find -name "*.ko" | sed -r "s:^./::g" | tr "\n" "|" | sed -r "s:[.]:.:g" +)" +cat $INITRAMFS/$LMK/modules.order | sed -r "s/.ko.gz\$/.ko/" | grep -E "$MODULEORDER"/foo/bar >$INITRAMFS/$LMK/_ +mv $INITRAMFS/$LMK/_ $INITRAMFS/$LMK/modules.order + +depmod -b $INITRAMFS $KERNEL + +echo "root::0:0::/root:/bin/bash" >$INITRAMFS/etc/passwd +touch $INITRAMFS/etc/{m,fs}tab + +cp init $INITRAMFS +chmod a+x $INITRAMFS/init +cp shutdown $INITRAMFS +chmod a+x $INITRAMFS/shutdown +ln -s ../init $INITRAMFS/bin/init +cp ../livekitlib $INITRAMFS/lib/ +cp ../config $INITRAMFS/lib/ + +cd $INITRAMFS +find . -print | cpio -o -H newc 2>/dev/null | xz -f --extreme --check=crc32 >$INITRAMFS.img +echo $INITRAMFS.img + +cd .. +rm -Rf $INITRAMFS diff --git a/linux-live/initramfs/shutdown b/linux-live/initramfs/shutdown new file mode 100644 index 0000000..be32dd8 --- /dev/null +++ b/linux-live/initramfs/shutdown @@ -0,0 +1,80 @@ +#!/bin/sh +# Shutdown script for initramfs. It's automatically started by +# systemd (if you use it) on shutdown, no need for any tweaks. +# Purpose of this script is to unmount everything cleanly. +# +# Author: Tomas M +# + +. /lib/config +. /lib/livekitlib + +debug_start + +debug_log "Entering shutdown procedures of Linux Live Kit" +debug_log "Called with arguments: " "$*" + +# if debug is enabled, run shell now +debug_shell + +detach_free_loops() +{ + losetup -a | cut -d : -f 1 | xargs -r -n 1 losetup -d +} + +# $1=dir +umount_all() +{ + tac /proc/mounts | cut -d " " -f 2 | grep ^$1 | while read LINE; do + umount $LINE 2>/dev/null + done +} + +# Update devs so we are aware of all active /dev/loop* files. +# Detach loop devices which are no longer used +debug_log "- Detaching loops" +mdev -s +detach_free_loops + +# do it the dirty way, simply try to umount everything to get rid of most mounts +debug_log "- Unmounting submounts of union" +umount_all /oldroot + +# free aufs of /run mount, and umount aufs +debug_log "- Unmounting union itself" +mkdir /run2 +mount --move /oldroot/run /run2 +umount /oldroot + +# remember from which device we are started, so we can eject it later +DEVICE="$(cat /proc/mounts | grep /memory/data | grep /dev/ | cut -d " " -f 1)" + +debug_log "- going through several cycles of umounts to clear everything left" +umount_all /run2 +detach_free_loops +umount_all /run2 +detach_free_loops +umount_all /run2 + +# eject cdrom device if we were running from it +for i in $(cat /proc/sys/dev/cdrom/info | grep name); do + if [ "$DEVICE" = "/dev/$i" ]; then + echo "[ OK ] Attemptiong to eject /dev/$i..." + eject /dev/$i + echo "[ OK ] CD/DVD tray will close in 6 seconds..." + sleep 6 + eject -t /dev/$i + fi +done + +debug_shell + +debug_log $1 -f +$1 -f + +debug_log reboot -f +reboot -f + +echo We should never reach so far. Something is totally fucked up. +echo Here you have a shell, to experiment with the universe. +/bin/sh diff --git a/linux-live/initramfs/static/README b/linux-live/initramfs/static/README new file mode 100644 index 0000000..f13893a --- /dev/null +++ b/linux-live/initramfs/static/README @@ -0,0 +1,17 @@ +#!/bin/bash + +Source codes should be found at github +https://github.com/Tomas-M/ + + +How to rebuild these static binaries: +- using buildroot scripts +- unpack buildroot in /usr/src +- copy busybox config (generated by busybox bbconfig) to /usr/src/buildroot-source/package/busybox/busybox-1.20.x.config +- cd /usr/src/buildroot-sources +- make menuconfig +- configure buildroot to compile static libraries, set target processor architecture, and so on +- add packages to buildroot, such as httpfs2-enhanced, dynfilefs, etc. +- some manual tweaking is necessary, sorry about not commenting it here +- make +- find static binaries in /usr/src/buildroot-sources/output/target/bin/ etc diff --git a/linux-live/initramfs/static/blkid b/linux-live/initramfs/static/blkid new file mode 100755 index 0000000..feaf742 Binary files /dev/null and b/linux-live/initramfs/static/blkid differ diff --git a/linux-live/initramfs/static/busybox b/linux-live/initramfs/static/busybox new file mode 100755 index 0000000..be60508 Binary files /dev/null and b/linux-live/initramfs/static/busybox differ diff --git a/linux-live/initramfs/static/eject b/linux-live/initramfs/static/eject new file mode 100755 index 0000000..7d83e66 Binary files /dev/null and b/linux-live/initramfs/static/eject differ diff --git a/linux-live/initramfs/static/mount.dynfilefs b/linux-live/initramfs/static/mount.dynfilefs new file mode 100755 index 0000000..d3335d0 Binary files /dev/null and b/linux-live/initramfs/static/mount.dynfilefs differ diff --git a/linux-live/initramfs/static/mount.httpfs2 b/linux-live/initramfs/static/mount.httpfs2 new file mode 100755 index 0000000..53487f9 Binary files /dev/null and b/linux-live/initramfs/static/mount.httpfs2 differ diff --git a/linux-live/initramfs/static/mount.ntfs-3g b/linux-live/initramfs/static/mount.ntfs-3g new file mode 100755 index 0000000..d51554c Binary files /dev/null and b/linux-live/initramfs/static/mount.ntfs-3g differ diff --git a/linux-live/initramfs/tools/initramfs_repack b/linux-live/initramfs/tools/initramfs_repack new file mode 100755 index 0000000..7b4e3e7 --- /dev/null +++ b/linux-live/initramfs/tools/initramfs_repack @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +if [ "$1" = "-h" -o "$1" = "--help" -o "$2" = "" ]; then + echo "" + echo "Create initramfs image from a directory tree" + echo "Usage: $0 [source_directory] [target_initramfs_file.img]" + echo "" + exit 2 +fi + +(cd "$1"; find . -print | cpio -o -H newc) | xz -f --extreme --check=crc32 >"$2" diff --git a/linux-live/initramfs/tools/initramfs_unpack b/linux-live/initramfs/tools/initramfs_unpack new file mode 100755 index 0000000..2dd4086 --- /dev/null +++ b/linux-live/initramfs/tools/initramfs_unpack @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +if [ "$1" = "-h" -o "$1" = "--help" -o "$2" = "" ]; then + echo "" + echo "Unpack initramfs image to a directory" + echo "Usage: $0 [source_initramfs_file.img] [target_directory]" + echo "" + exit 2 +fi + +mkdir -p "$2" + +(cd "$2"; xz -d | cpio -idv) < "$1" diff --git a/linux-live/initrfs b/linux-live/initrfs new file mode 100755 index 0000000..79cbc18 --- /dev/null +++ b/linux-live/initrfs @@ -0,0 +1,17 @@ +#!/bin/bash + +export PATH=.:./tools:../tools:/usr/sbin:/usr/bin:/sbin:/bin:/ + +. /linux-live/config || exit 1 +. /linux-live/livekitlib || exit 1 +. /linux-live/buildconfig || exit 1 + +# build initramfs image +echo "Building intramfs image..." +cd /linux-live/initramfs +chmod 755 ./initramfs_create +INITRAMFS=$(./initramfs_create) + +if [ "$INITRAMFS" != "" ]; then + mv "$INITRAMFS" /boot/initrfs.img +fi \ No newline at end of file diff --git a/linux-live/install_chroot b/linux-live/install_chroot new file mode 100644 index 0000000..949166f --- /dev/null +++ b/linux-live/install_chroot @@ -0,0 +1,53 @@ +#!/bin/bash + +set -e # exit on error +set -o pipefail # exit on pipeline error +set -u # treat unset variable as error + +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" + +. $SCRIPT_DIR/buildconfig || exit 1 +. $SCRIPT_DIR/minioslib || exit 1 +. $SCRIPT_DIR/config || exit 1 + +CMD=(chroot_setup_host chroot_pkg_install chroot_configure chroot_finish_up) + +# ============= main ================ + +common_variables + +console_colours + +allow_root_only + +#check_is_in_chroot + +# check number of args +if [[ $# == 0 || $# > 3 ]]; then help_ru; fi + +# loop through args +dash_flag=false +start_index=0 +end_index=${#CMD[*]} +for ii in "$@"; do + if [[ $ii == "-" ]]; then + dash_flag=true + continue + fi + find_index $ii + if [[ $dash_flag == false ]]; then + start_index=$index + else + end_index=$(($index + 1)) + fi +done +if [[ $dash_flag == false ]]; then + end_index=$(($start_index + 1)) +fi + +#loop through the commands +for ((ii = $start_index; ii < $end_index; ii++)); do + ${CMD[ii]} +done + +echo -e "${BOLD}${LIGHTYELLOW}$0${ENDCOLOUR} - ${LIGHTGREEN}Command completed successfully!${ENDCOLOUR}" diff --git a/linux-live/livekitlib b/linux-live/livekitlib new file mode 100644 index 0000000..7d5a7e2 --- /dev/null +++ b/linux-live/livekitlib @@ -0,0 +1,891 @@ +#!/bin/sh + +# Functions library :: for Linux Live Kit scripts +# Author: Tomas M. +# + +# ================================================================= +# debug and output functions +# ================================================================= + +debug_start() +{ + if grep -q debug /proc/cmdline; then + DEBUG_IS_ENABLED=1 + set -x + else + DEBUG_IS_ENABLED= + fi +} + +debug_log() +{ + if [ "$DEBUG_IS_ENABLED" ]; then + echo "- debug: $*" >&2 + log "- debug: $*" + fi +} + +# header +# $1 = text to show +# +header() +{ + echo """$@""" +} + + +# echo green star +# +echo_green_star() +{ + echo -ne """* """ +} + +# log - store given text in /var/log/livedbg +log() +{ + echo "$@" 2>/dev/null >>/var/log/livedbg +} + +echolog() +{ + echo "$@" + log "$@" +} + + +# show information about the debug shell +show_debug_banner() +{ + echo + echo "=====" + echo ": Debugging started. Here is the root shell for you." + echo ": Type your desired commands or hit Ctrl+D to continue booting." + echo +} + + +# debug_shell +# executed when debug boot parameter is present +# +debug_shell() +{ + if [ "$DEBUG_IS_ENABLED" ]; then + show_debug_banner + setsid sh -c 'exec sh < /dev/tty1 >/dev/tty1 2>&1' + echo + fi +} + +fatal() +{ + echolog + header "Fatal error occured - $1" + echolog "Something went wrong and we can't continue. This should never happen." + echolog "Please reboot your computer with Ctrl+Alt+Delete ..." + echolog + setsid sh -c 'exec sh < /dev/tty1 >/dev/tty1 2>&1' +} + + +# get value of commandline parameter $1 +# $1 = parameter to search for +# +cmdline_value() +{ + cat /proc/cmdline | egrep -o "(^|[[:space:]])$1=[^[:space:]]+" | tr -d " " | cut -d "=" -f 2- | tail -n 1 +} + + +# test if the script is started by root user. If not, exit +# +allow_only_root() +{ + if [ "0$UID" -ne 0 ]; then + echo "Only root can run $(basename $0)"; exit 1 + fi +} + + +# Create bundle +# call mksquashfs with apropriate arguments +# $1 = directory which will be compressed to squashfs bundle +# $2 = output file +# $3..$9 = optional arguments like -keep-as-directory or -b 123456789 +# +create_bundle() +{ + debug_log "create_module" "$*" + rm -f "$2" # overwrite, never append to existing file + mksquashfs "$1" "$2" -comp xz -b 1024K -always-use-fragments $3 $4 $5 $6 $7 $8 $9>/dev/null +} + + +# Move entire initramfs tree to tmpfs mount. +# It's a bit tricky but is necessray to enable pivot_root +# even for initramfs boot image +# +transfer_initramfs() +{ + if [ ! -r /lib/initramfs_escaped ]; then + echo "switch root from initramfs to ramfs" + SWITCH=/m # one letter directory + mkdir -p $SWITCH + mount -t tmpfs -o size="100%" tmpfs $SWITCH + cp -a /??* $SWITCH 2>/dev/null # only copy two-and-more-letter directories + cd $SWITCH + echo "This file indicates that we successfully escaped initramfs" > $SWITCH/lib/initramfs_escaped + exec switch_root -c /dev/console . $0 + fi +} + + +# mount virtual filesystems like proc etc +# +init_proc_sysfs() +{ + debug_log "init_proc_sysfs" "$*" + mkdir -p /proc /sys /etc $MEMORY + mount -n -t proc proc /proc + echo "0" >/proc/sys/kernel/printk + mount -n -t sysfs sysfs /sys + mount -n -o remount,rw rootfs / + ln -sf /proc/mounts /etc/mtab +} + + +# modprobe all modules found in initial ramdisk +# $1 = -e for match, -v for negative match +# $2 = regex pattern +# +modprobe_everything() +{ + debug_log "modprobe_everything" "$*" + + echo_green_star >&2 + echo "Probing for hardware" >&2 + + find /lib/modules/ | fgrep .ko | egrep $1 $2 | sed -r "s:^.*/|[.]ko\$::g" | xargs -n 1 modprobe 2>/dev/null + refresh_devs +} + + +refresh_devs() +{ + debug_log "refresh_devs" "$*" + if [ -r /proc/sys/kernel/hotplug ]; then + echo /sbin/mdev > /proc/sys/kernel/hotplug + fi + mdev -s +} + + +# make sure some devices are there +init_devs() +{ + debug_log "init_devs" "$*" + modprobe zram 2>/dev/null + modprobe loop 2>/dev/null + modprobe squashfs 2>/dev/null + modprobe fuse 2>/dev/null + refresh_devs +} + + +# Activate zram (auto-compression of RAM) +# Compressed RAM consumes 1/2 or even 1/4 of original size +# Setup static size of 500MB +# +init_zram() +{ + debug_log "init_zram" "$*" + echo_green_star + echo "Setting dynamic RAM compression using ZRAM if available" + if [ -r /sys/block/zram0/disksize ]; then + echo 536870912 > /sys/block/zram0/disksize # 512MB + mkswap /dev/zram0 >/dev/null + swapon /dev/zram0 + echo 100 > /proc/sys/vm/swappiness + fi +} + + +aufs_is_supported() +{ + cat /proc/filesystems | grep aufs +} + + +# load the AUFS kernel driver. If not found, +# load overlayfs instead. +# +init_aufs() +{ + debug_log "init_aufs" "$*" + modprobe aufs 2>/dev/null + if ! aufs_is_supported >/dev/null; then + modprobe overlay 2>/dev/null + fi + refresh_devs +} + + +# Setup empty aufs union, or create overlayfs union +# $1 = changes directory (ramfs or persistent changes) +# $2 = union directory where to mount the union +# $3 = bundles directory +# +init_union() +{ + debug_log "init_union" "$*" + mkdir -p "$1" + mkdir -p "$2" + + if aufs_is_supported >/dev/null; then + echo_green_star + echo "Setting up empty union using aufs" + mount -t aufs -o xino="/.xino",trunc_xino,br="$1" aufs "$2" + else + echo_green_star + echo "Setting up union using overlayfs" + mkdir -p "$1/changes" + mkdir -p "$1/workdir" + mount -t overlay overlay -o lowerdir=$(find "$3" -mindepth 1 -maxdepth 1 | sortmod | tac | tr '\n' ':' | sed -r 's/:$//'),upperdir=$1/changes,workdir=$1/workdir $2 + fi +} + + +# Return device mounted for given directory +# $1 = directory +# +mounted_device() +{ + debug_log "mounted_device" "$*" + + local MNT TARGET + MNT="$1" + while [ "$MNT" != "/" -a "$MNT" != "." -a "$MNT" != "" ]; do + TARGET="$(grep -F " $MNT " /proc/mounts | cut -d " " -f 1)" + if [ "$TARGET" != "" ]; then + echo "$TARGET" + return + fi + MNT="$(dirname "$MNT")" + done +} + + +# Return mounted dir for given directory +# $1 = directory +# +mounted_dir() +{ + debug_log "mounted_dir" "$*" + + local MNT + MNT="$1" + while [ "$MNT" != "/" -a "$MNT" != "." -a "$MNT" != "" ]; do + if mountpoint -q "$MNT" 2>/dev/null; then + echo "$MNT" + return + fi + MNT="$(dirname "$MNT")" + done +} + + +# Get device tag. +# $1 = device +# $2 = tag name, such as TYPE, LABEL, UUID, etc +# +device_tag() +{ + blkid -s $2 "$1" | sed -r "s/^[^=]+=//" | tr -d '"' +} + + +# Make sure to mount FAT12/16/32 using vfat +# in order to support long filenames +# $1 = device +# $2 = prefix to add, like -t +# +device_bestfs() +{ + debug_log "device_bestfs" "$*" + local FS + + FS="$(device_tag "$1" TYPE | tr [A-Z] [a-z])" + if [ "$FS" = "msdos" -o "$FS" = "fat" -o "$FS" = "vfat" ]; then + FS="vfat" + elif [ "$FS" = "ntfs" ]; then + FS="ntfs-3g" + fi + + if [ "$2" != "" ]; then + echo -n "$2" + fi + + echo "$FS" +} + + +# Filesystem options for initial mount +# $1.. = filesystem +# +fs_options() +{ + debug_log "fs_options" "$*" + + if [ "$1" != "ntfs-3g" ]; then + echo -n "-t $1 " + fi + + echo -n "-o rw" + + if [ "$1" = "vfat" ]; then + echo ",check=s,shortname=mixed,iocharset=utf8" + fi +} + + +# Mount command for given filesystem +# $1.. = filesystem +# +mount_command() +{ + debug_log "mount_command" "$*" + + if [ "$1" = "ntfs-3g" ]; then + echo "@mount.ntfs-3g" + else + echo "mount" + fi +} + + +# echo first network device known at the moment of calling, eg. eth0 +# +network_device() +{ + debug_log "network_device" "$*" + cat /proc/net/dev | grep : | grep -v lo: | cut -d : -f 1 | tr -d " " | head -n 1 +} + + +# Modprobe network kernel modules until a working driver is found. +# These drivers are (or used to be) probed in Slackware's initrd. +# The function returns the first device found, yet it doesn't have +# to be a working one, eg. if the computer has two network interfaces +# and ethernet cable is plugged only to one of them. +# +init_network_dev() +{ + debug_log "init_network_dev" "$*" + local MODULE ETH + + for MODULE in 3c59x acenic e1000 e1000e e100 epic100 hp100 ne2k-pci \ + pcnet32 8139too 8139cp tulip via-rhine r8169 atl1e yellowfin tg3 \ + dl2k ns83820 atl1 b44 bnx2 skge sky2 tulip forcedeth sb1000 sis900; do + modprobe $MODULE 2>/dev/null + ETH="$(network_device)" + if [ "$ETH" != "" ]; then + echo $ETH + return 0 + fi + rmmod $MODULE 2>/dev/null + done + + # If we are here, none of the above specified modules worked. + # As a last chance, try to modprobe everything else + modprobe_everything -e /drivers/net/ + echo $(network_device) +} + + +# Initialize network IP address +# either static from ip=bootparameter, or from DHCP +# +init_network_ip() +{ + debug_log "init_network_ip" "$*" + local IP ETH SCRIPT CLIENT SERVER GW MASK + + SCRIPT=/tmp/dhcpscript + ETH=$(init_network_dev) + IP=$(cmdline_value ip) + + echo "* Setting up network" >&2 + + if [ "$IP" != "" ]; then + # set IP address as given by boot paramter + echo "$IP" | while IFS=":" read CLIENT SERVER GW MASK; do + ifconfig $ETH "$CLIENT" netmask "$MASK" + route add default gw "$GW" + echo nameserver "$GW" >> /etc/resolv.conf + echo nameserver "$SERVER" >> /etc/resolv.conf + done + else + # if client ip is unknown, try to get a DHCP lease + ifconfig $ETH up + echo -e '#!/bin/sh\nif [ "$1" != "bound" ]; then exit; fi\nifconfig $interface $ip netmask $subnet\nroute add default gw $router\necho nameserver $dns >>/etc/resolv.conf' >$SCRIPT + chmod a+x $SCRIPT + udhcpc -i $ETH -n -s $SCRIPT -q >/dev/null + fi +} + + +# Mount data from http using httpfs +# $1 = from URL +# $2 = target +mount_data_http() +{ + debug_log "mount_data_http" "$*" + local CACHE + + echo_green_star >&2 + echo "Load data from $1" >&2 + + CACHE=$(cmdline_value cache | sed -r "s/[^0-9]//g" | sed -r "s/^0+//g") + if [ "$CACHE" != "" ]; then + CACHE="-C /tmp/httpfs.cache -S "$(($CACHE*1024*1024)) + fi + + init_network_ip + + if [ "$(network_device)" != "" ]; then + echo "* Mounting remote file..." >&2 + mkdir -p "$2" + @mount.httpfs2 -r 9999 -t 5 $CACHE -c /dev/null "$1" "$2" -o ro >/dev/null 2>/dev/null + mount -o loop "$2"/* "$2" # self mount + echo "$2/$LIVEKITNAME" + fi +} + + +# stdin = files to get +# $1 = server +# $2 = destination directory +# +tftp_mget() +{ + while read FNAME; do + echo "* $FNAME ..." >&2 + tftp -b 1486 -g -r "$FNAME" -l "$2/$FNAME" "$1" + done +} + + +# Download data from tftp +# $1 = target (store downloaded files there) +# +download_data_pxe() +{ + debug_log "download_data_pxe" "$*" + local IP CMD CLIENT SERVER GW MASK PORT PROTOCOL JOBS + + mkdir -p "$1/$LIVEKITNAME" + IP="$(cmdline_value ip)" + + echo "$IP" | while IFS=":" read CLIENT SERVER GW MASK PORT; do + echo_green_star >&2 + echo "Contacting PXE server $SERVER" >&2 + + if [ "$PORT" = "" ]; then PORT="7529"; fi + + init_network_ip + + echo "* Downloading PXE file list" >&2 + + PROTOCOL=http + wget -q -O "$1/PXEFILELIST" "http://$SERVER:$PORT/PXEFILELIST?$(uname -r):$(uname -m)" + if [ $? -ne 0 ]; then + echo "Error downloading from http://$SERVER:$PORT, trying TFTP" >&2 + PROTOCOL=tftp + echo PXEFILELIST | tftp_mget "$SERVER" "$1" + fi + + echo "* Downloading files from the list" >&2 + + if [ "$PROTOCOL" = "http" ]; then + cat "$1/PXEFILELIST" | while read FILE; do + wget -O "$1/$LIVEKITNAME/$(basename $FILE)" "http://$SERVER:$PORT/$FILE" + done + else + JOBS=3 + for i in $(seq 1 $JOBS); do + awk "NR % $JOBS == $i-1" "$1/PXEFILELIST" | tftp_mget "$SERVER" "$1/$LIVEKITNAME" & + done + wait + fi + done + + echo "$1/$LIVEKITNAME" +} + + +# Find LIVEKIT data by mounting all devices +# If found, keep mounted, else unmount +# $1 = data directory target (mount here) +# $2 = data directory which contains compressed bundles +# +find_data_try() +{ + debug_log "find_data_try" "$*" + + local DEVICE FS FROM OPTIONS MOUNT + + mkdir -p "$1" + blkid | sort | cut -d: -f 1 | grep -E -v "/loop|/ram|/zram" | while read DEVICE; do + FROM="$2" + FS="$(device_bestfs "$DEVICE")" + OPTIONS="$(fs_options $FS)" + MOUNT="$(mount_command $FS)" + + $MOUNT "$DEVICE" "$1" $OPTIONS 2>/dev/null + + # if the FROM parameter is actual file, mount it again as loop (eg. iso) + if [ -f "$1/$FROM" ]; then + mkdir -p "$1/../iso" + mount -o loop,ro "$1/$FROM" "$1/../iso" 2>/dev/null + FROM="../iso/$LIVEKITNAME" + fi + + # search for bundles in the mounted directory + if [ "$(find "$1/$FROM" -maxdepth 1 -name "*.$BEXT" 2>/dev/null)" != "" ]; then + # we found at least one bundle/module here + echo "$1/$FROM" | tr -s "/" | sed -r "s:/[^/]+/[.][.]/:/:g" + return + fi + + # unmount twice, since there could be mounted ISO as loop too. If not, it doesn't hurt + umount "$1" 2>/dev/null + umount "$1" 2>/dev/null + done +} + + +# Retry finding LIVEKIT data several times, +# until timeouted or until data is found +# $1 = timeout +# $2 = data directory target (mount here) +# +find_data() +{ + debug_log "find_data" "$*" + + local DATA FROM + + FROM="$(cmdline_value from)" + + # boot parameter specified as from=http://server.com/file.iso + if [ "$(echo $FROM | grep 'http://')" != "" ]; then + mount_data_http "$FROM" "$2" + return + fi + + # if we got IP address as boot parameter, it means we booted over PXE + if [ "$(cmdline_value ip)" != "" ]; then + download_data_pxe "$2" + return + fi + + if [ "$FROM" = "" ]; then FROM="$LIVEKITNAME"; fi + + echo_green_star >&2 + echo -n "Looking for $LIVEKITNAME data in /$FROM .." | tr -s "/" >&2 + for timeout in $(seq 1 $1); do + echo -n "." >&2 + refresh_devs + DATA="$(find_data_try "$2" "$FROM")" + if [ "$DATA" != "" ]; then + echo "" >&2 + echo "* Found on $(mounted_device "$2")" >&2 + echo "$DATA" + return + fi + sleep 1 + done + echo "" >&2 +} + + +# Check if data is found and exists +# $1 = data directory +# +check_data_found() +{ + if [ "$1" = "" -o ! -d "$1" ]; then + fatal "Could not locate $LIVEKITNAME data"; + fi +} + + +# Activate persistent changes +# $1 = data directory +# $2 = target changes directory +# +persistent_changes() +{ + debug_log "persistent_changes" "$*" + + local CHANGES T1 T2 EXISTS + + CHANGES="$1/$(basename "$2")" + T1="$CHANGES/.empty" + T2="$T1"2 + + # Setup the directory anyway, it will be used in all cases + mkdir -p "$2" + + # If persistent changes are not requested, end here + if grep -vq perch /proc/cmdline; then + return + fi + + # check if changes directory exists and is writable + touch "$T1" 2>/dev/null && rm -f "$T1" 2>/dev/null + + # if not, simply return back + if [ $? -ne 0 ]; then + echo "* Persistent changes not writable or not used" + return + fi + + echo_green_star + echo "Testing persistent changes for posix compatibility" + touch "$T1" && ln -sf "$T1" "$T2" 2>/dev/null && \ + chmod +x "$T1" 2>/dev/null && test -x "$T1" && \ + chmod -x "$T1" 2>/dev/null && test ! -x "$T1" && \ + rm "$T1" "$T2" 2>/dev/null + + if [ $? -eq 0 ]; then + echo "* Activating native persistent changes" + mount --bind "$CHANGES" "$2" + return + fi + + if [ -e "$CHANGES/changes.dat" ]; then + echo "* Restoring persistent changes" + EXISTS="true" + else + echo "* Creating new persistent changes" + EXISTS="" + fi + + @mount.dynfilefs "$CHANGES/changes.dat" 4000 "$2" + if [ ! "$EXISTS" ]; then + mke2fs -F "$2/loop.fs" >/dev/null 2>&1 + fi + mount -o loop,sync "$2/loop.fs" "$2" + + # if test failed at any point, we may have temp files left behind + rm "$T1" "$T2" 2>/dev/null + rmdir "$2/lost+found" 2>/dev/null +} + + +# Copy content of rootcopy directory to union +# $1 = data directory +# $2 = union directory +copy_rootcopy_content() +{ + debug_log "copy_rootcopy_content" "$*" + + if [ "$(ls -1 "$1/rootcopy/" 2>/dev/null)" != "" ]; then + echo_green_star + echo "Copying content of rootcopy directory..." + cp -a "$1"/rootcopy/* "$2" + fi +} + + +# Copy data to RAM if requested +# $1 = live data directory +# $2 = changes directory +# +copy_to_ram() +{ + debug_log "copy_to_ram" "$*" + + local MDIR MDEV RAM CHANGES + + if grep -vq toram /proc/cmdline; then + echo "$1" + return + fi + + echo "* Copying $LIVEKITNAME data to RAM..." >&2 + RAM="$(dirname "$2")"/toram + mkdir -p "$RAM" + cp -a "$1"/* "$RAM" + echo "$RAM" + + MDIR="$(mounted_dir "$1")" + MDEV="$(mounted_device "$1")" + MDEV="$(losetup $MDEV 2>/dev/null | cut -d " " -f 3)" + umount "$MDIR" 2>/dev/null + + if [ "$MDEV" ]; then # iso was mounted here, try to unmount the FS it resides on too + MDEV="$(mounted_device "$MDEV")" + umount "$MDEV" 2>/dev/null + fi +} + + +# load filter +# +filter_load() +{ + local FILTER + FILTER=$(cmdline_value load) + if [ "$FILTER" = "" ]; then + cat - + else + cat - | egrep "$FILTER" + fi +} + + +# noload filter +# +filter_noload() +{ + local FILTER + FILTER=$(cmdline_value noload) + if [ "$FILTER" = "" ]; then + cat - + else + cat - | egrep -v "$FILTER" + fi +} + +# sort modules by number even if they are in subdirectory +# +sortmod() +{ + cat - | sed -r "s,(.*/(.*)),\\2:\\1," | sort -n | cut -d : -f 2- +} + + +# Mount squashfs filesystem bundles +# $1 = directory where to search for bundles +# $2 = directory where to mount bundles +mount_bundles() +{ + echo_green_star + echo "Mounting bundles" + ( ls -1 "$1" | sort -n ; cd "$1" ; find modules/ 2>/dev/null | sortmod | filter_load) | grep '[.]'$BEXT'$' | filter_noload | while read BUNDLE; do + echo "* $BUNDLE" + BUN="$(basename "$BUNDLE")" + mkdir -p "$2/$BUN" + mount -o loop,ro -t squashfs "$1/$BUNDLE" "$2/$BUN" + done +} + + +# Add mounted bundles to aufs union +# $1 = directory where bundles are mounted +# $2 = directory where union is mounted +# +union_append_bundles() +{ + debug_log "union_append_bundles" "$*" + + if aufs_is_supported >/dev/null; then + echo_green_star + echo "Adding bundles to union" + find "$1" -mindepth 1 -maxdepth 1 | sortmod | while read BUNDLE; do + mount -o remount,add:1:"$BUNDLE" aufs "$2" + done + fi +} + + +# Create empty fstab properly +# $1 = root directory +# $2 = directory where boot disk is mounted +# +fstab_create() +{ + debug_log "fstab_create" "$*" + + local FSTAB DEVICE FS LABEL BOOTDEVICE OPTS + + FSTAB="$1/etc/fstab" + echo aufs / aufs defaults 0 0 > $FSTAB + echo proc /proc proc defaults 0 0 >> $FSTAB + echo sysfs /sys sysfs defaults 0 0 >> $FSTAB + echo devpts /dev/pts devpts gid=5,mode=620 0 0 >> $FSTAB + echo tmpfs /dev/shm tmpfs defaults 0 0 >> $FSTAB + + if grep -vq automount /proc/cmdline; then + return + fi + + BOOTDEVICE=$(df "$2" | tail -n 1 | cut -d " " -f 1) + + echo >> $FSTAB + + blkid | grep -v "^/dev/loop" | grep -v "^/dev/zram" | cut -d: -f 1 | while read DEVICE; do + FS="$(device_bestfs $DEVICE)" + LABEL="$(basename $DEVICE)" + OPTS="defaults,noatime,nofail,x-systemd.device-timeout=10" + + if [ "$FS" != "" -a "$FS" != "swap" -a "$FS" != "squashfs" -a "$DEVICE" != "$BOOTDEVICE" ]; then + mkdir -p "$1/media/$LABEL" + echo "$DEVICE" "/media/$LABEL" $FS $OPTS 0 0 >> $FSTAB + fi + done +} + + +# Change root and execute init +# $1 = where to change root +# +change_root() +{ + debug_log "change_root" "$*" + + # if we are booting over httpfs, we need to copyup some files so they are + # accessible on union without any further lookup down, else httpfs locks + if [ "$(network_device)" != "" ]; then + touch "/net.up.flag" + touch "$1/etc/resolv.conf" + touch "$1/etc/hosts" + touch "$1/etc/gai.conf" + fi + + umount /proc + umount /sys + + cd "$1" + + # make sure important device files and directories are in union + mkdir -p boot dev proc sys tmp media mnt run + chmod 1777 tmp + if [ ! -e dev/console ]; then mknod dev/console c 5 1; fi + if [ ! -e dev/tty ]; then mknod dev/tty c 5 0; fi + if [ ! -e dev/tty0 ]; then mknod dev/tty0 c 4 0; fi + if [ ! -e dev/tty1 ]; then mknod dev/tty1 c 4 1; fi + if [ ! -e dev/null ]; then mknod dev/null c 1 3; fi + if [ ! -e sbin/fsck.aufs ]; then ln -s /bin/true sbin/fsck.aufs; fi + + # find chroot and init + if [ -x bin/chroot -o -L bin/chroot ]; then CHROOT=bin/chroot; fi + if [ -x sbin/chroot -o -L sbin/chroot ]; then CHROOT=sbin/chroot; fi + if [ -x usr/bin/chroot -o -L usr/bin/chroot ]; then CHROOT=usr/bin/chroot; fi + if [ -x usr/sbin/chroot -o -L usr/sbin/chroot ]; then CHROOT=usr/sbin/chroot; fi + if [ "$CHROOT" = "" ]; then fatal "Can't find executable chroot command"; fi + + if [ -x bin/init -o -L bin/init ]; then INIT=bin/init; fi + if [ -x sbin/init -o -L sbin/init ]; then INIT=sbin/init; fi + if [ "$INIT" = "" ]; then fatal "Can't find executable init command"; fi + + mkdir -p run + mount -t tmpfs tmpfs run + mkdir -p run/initramfs + mount -n -o remount,ro aufs . + pivot_root . run/initramfs + exec $CHROOT . $INIT < dev/console > dev/console 2>&1 +} diff --git a/linux-live/minioslib b/linux-live/minioslib new file mode 100644 index 0000000..2eb5f68 --- /dev/null +++ b/linux-live/minioslib @@ -0,0 +1,1530 @@ +#!/bin/bash + +# Functions library :: for install scripts +# Author: crims0n. +# + +# ================================================================= +# ================================================================= +# ========================= VARIABLES ============================= +# ================================================================= +# ================================================================= + +function common_variables() { + # + CONTAINER_TYPE="0" + set +u + if [ -z $container ]; then + container="" + fi + set -u + : 'if [ -f /.dockerenv ] || [ "$container" = "podman" ]; then + OUTPUT="/dev/stdout" + #CONTAINER="docker" + fi' + if [ -f /.dockerenv ] || [ "$container" = "podman" ] && [ ! -d /opt/minios-live ] && [ ! -f /.minios-live-container ]; then + CONTAINER_TYPE="1" + fi + if [[ (-f /.dockerenv || "$container" = "podman") && (-d /opt/minios-live || -f /.minios-live-container) ]]; then + CONTAINER_TYPE="2" + fi +} + +# ================================================================= +# ================================================================= +# ===================== COMMON FUNCTIONS ========================== +# ================================================================= +# ================================================================= + +function current_process() { + echo -e "${LIGHTYELLOW}=====> running ${CYAN}${CMD[ii]}${ENDCOLOUR}${LIGHTYELLOW} ...${ENDCOLOUR}" +} + +# ================================================================= +# beautiful console +# красивая консоль +# ================================================================= +function console_colours() { + RED="\e[31m" + GREEN="\e[32m" + YELLOW="\e[33m" + BLUE="\e[34m" + MAGENTA="\e[35m" + CYAN="\e[36m" + LIGHTGRAY="\e[37m" + DARKGRAY="\e[90m" + LIGHTRED="\e[91m" + LIGHTGREEN="\e[92m" + LIGHTYELLOW="\e[93m" + LIGHTBLUE="\e[94m" + LIGHTMAGENTA="\e[95m" + LIGHTCYAN="\e[96m" + BOLD="\e[1m" + DIM="\e[2m" + UNDERLINED="\e[4m" + BLINK="\e[5m" + REVERSE="\e[7m" + HIDDEN="\e[8m" + ENDCOLOUR="\e[0m" +} + +# ================================================================= +# help functions +# функции помощи +# ================================================================= +function help() { + # if $1 is set, use $1 as headline message in help() + if grep 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then + if [ -z ${1+x} ]; then + echo -e "${LIGHTYELLOW}Этот скрипт собирает загружаемый ISO образ $SYSTEMNAME.${ENDCOLOUR}" + echo -e + else + echo -e $1 + echo + fi + echo -e "Поддерживаемые команды : ${CYAN}${CMD[*]}${ENDCOLOUR}" + echo -e + echo -e "Синтаксис: ${MAGENTA}$0${ENDCOLOUR} [start_cmd] [-] [end_cmd]" + if [ -L /usr/bin/$LIVEKITNAME-install ] && [ "$0" != "/usr/bin/$LIVEKITNAME-install" ]; then + echo -e "\t${CYAN}$LIVEKITNAME-install${ENDCOLOUR} [start_cmd] [-] [end_cmd]" + fi + echo -e "\tзапуск от start_cmd до end_cmd" + echo -e "\tесли start_cmd опущен, выполняются все команды, начиная с первой" + echo -e "\tесли end_cmd опущен, выполняются все команды до последней" + echo -e "\tвведите одну команду, чтобы запустить определенную команду" + echo -e "\tвведите '-' как единственный аргумент для запуска всех команд" + echo -e "\t" + echo -e "\tПримеры:${LIGHTYELLOW}$0 build_bootstrap - build_chroot${ENDCOLOUR}" + echo -e "\t\t${LIGHTYELLOW}$0 - build_chroot${ENDCOLOUR}" + echo -e "\t\t${LIGHTYELLOW}$0 build_bootstrap -${ENDCOLOUR}" + echo -e "\t\t${LIGHTYELLOW}$0 build_iso${ENDCOLOUR}" + echo -e "\t\t${LIGHTYELLOW}$0 -${ENDCOLOUR}" + exit 0 + else + if [ -z ${1+x} ]; then + echo -e "${LIGHTYELLOW}This script builds bootable $SYSTEMNAME ISO image.${ENDCOLOUR}" + echo -e + else + echo -e $1 + echo + fi + echo -e "Supported commands : ${CYAN}${CMD[*]}${ENDCOLOUR}" + echo -e + echo -e "Syntax: ${MAGENTA}$0${ENDCOLOUR} [start_cmd] [-] [end_cmd]" + if [ -L /usr/bin/$LIVEKITNAME-install ] && [ "$0" != "/usr/bin/$LIVEKITNAME-install" ]; then + echo -e "\t${CYAN}$LIVEKITNAME-install${ENDCOLOUR} [start_cmd] [-] [end_cmd]" + fi + echo -e "\trun from start_cmd to end_cmd" + echo -e "\tif start_cmd is omitted, start from first command" + echo -e "\tif end_cmd is omitted, end with last command" + echo -e "\tenter single cmd to run the specific command" + echo -e "\tenter '-' as only argument to run all commands" + echo -e "\t" + echo -e "\tExamples:${LIGHTYELLOW}$0 build_bootstrap - build_chroot${ENDCOLOUR}" + echo -e "\t\t${LIGHTYELLOW}$0 - build_chroot${ENDCOLOUR}" + echo -e "\t\t${LIGHTYELLOW}$0 build_bootstrap -${ENDCOLOUR}" + echo -e "\t\t${LIGHTYELLOW}$0 build_iso${ENDCOLOUR}" + echo -e "\t\t${LIGHTYELLOW}$0 -${ENDCOLOUR}" + exit 0 + fi +} + +# ================================================================= +# parsing input commands +# разбор входных команд +# ================================================================= +function find_index() { + local ret + local i + for ((i = 0; i < ${#CMD[*]}; i++)); do + if [ "${CMD[i]}" == "$1" ]; then + index=$i + return + fi + done + help "Command not found : $1" +} + +# ================================================================= +# creating a symbolic link to the executable file for using +# autocompletion on the command line +# создание символической ссылки на исполняемый файл для +# использования автодополнения в командной строке +# ================================================================= +function create_livekitname_install_symlink() { + if [ -L /usr/bin/$LIVEKITNAME-install ]; then + if [ "$(readlink /usr/bin/$LIVEKITNAME-install)" != "$SCRIPT_DIR/install" ]; then + rm -f /usr/bin/$LIVEKITNAME-install + ln -s $SCRIPT_DIR/install /usr/bin/$LIVEKITNAME-install + if grep 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then + echo -e "Символическая ссылка ${MAGENTA}/usr/bin/$LIVEKITNAME-install${ENDCOLOUR} была обновлена." + echo -e "Теперь она указывает на ${MAGENTA}$SCRIPT_DIR/install${ENDCOLOUR}." + else + echo -e "The ${MAGENTA}/usr/bin/$LIVEKITNAME-install${ENDCOLOUR} symbolic link has been updated." + echo -e "It now points to ${MAGENTA}$SCRIPT_DIR/install${ENDCOLOUR}." + fi + fi + if [ "$0" != "/usr/bin/$LIVEKITNAME-install" ]; then + if grep 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then + echo -e "Вы можете использовать команду ${CYAN}$LIVEKITNAME-install${ENDCOLOUR} для запуска этой программы." + else + echo -e "You can use the ${CYAN}$LIVEKITNAME-install${ENDCOLOUR} command to run this program." + fi + fi + else + ln -s $SCRIPT_DIR/install /usr/bin/$LIVEKITNAME-install + if grep 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then + echo -e "Символическая ссылка ${MAGENTA}/usr/bin/$LIVEKITNAME-install${ENDCOLOUR} была добавлена" + echo -e "для ${MAGENTA}$SCRIPT_DIR/install${ENDCOLOUR}." + + else + echo -e "The ${MAGENTA}/usr/bin/$LIVEKITNAME-install${ENDCOLOUR} symbolic link has been added" + echo -e "for ${MAGENTA}$SCRIPT_DIR/install${ENDCOLOUR}." + fi + fi +} + +# ================================================================= +# creating autocompletion on the command line +# создание автодополнения в командной строке +# ================================================================= +function create_completion() { + if [ -d /etc/bash_completion.d ]; then + if [ ! -f /etc/bash_completion.d/$LIVEKITNAME-install ] || ! grep "${CMD[*]}" /etc/bash_completion.d/$LIVEKITNAME-install >>$OUTPUT; then + cat </etc/bash_completion.d/$LIVEKITNAME-install +#/usr/bin/env bash +complete -W "${CMD[*]}" $LIVEKITNAME-install +EOF + fi + if [ "$0" != "/usr/bin/$LIVEKITNAME-install" ]; then + if grep 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then + echo -e "Дополнение команд работает только при использовании команды ${CYAN}$LIVEKITNAME-install${ENDCOLOUR}." + echo -e + else + echo -e "Command completion only works when using the ${CYAN}$LIVEKITNAME-install${ENDCOLOUR} command." + echo -e + fi + fi + fi +} + +# ================================================================= +# only allow 'root' to run the script +# разрешаем запуск скрипта только пользователю 'root' +# ================================================================= + +function allow_root_only() { + if [ $(id -u) -ne 0 ]; then + echo -e "${BOLD}${RED}This script should be run as 'root'!${ENDCOLOUR}" + exit 1 + fi + + export HOME=/root + export LC_ALL=C +} + +# ================================================================= +# check that we are inside chroot +# проверяем, что мы внутри chroot +# ================================================================= + +function check_is_in_chroot() { + if [ $(stat -c %i /)="2" ]; then + echo -e "${BOLD}${RED}This script should be run inside chroot only!${ENDCOLOUR}" + exit 1 + fi +} + +# ================================================================= +# check if filesystems are unmounted inside chroot +# проверяем, размонтированы ли файловые системы внутри chroot +# ================================================================= + +function check_mounted() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if grep -qs "$BUILD_DIR/dev" /proc/mounts || grep -qs "$BUILD_DIR/run" /proc/mounts || grep -qs "$BUILD_DIR/proc" /proc/mounts || grep -qs "$BUILD_DIR/sys" /proc/mounts || grep -qs "$BUILD_DIR/dev/pts" /proc/mounts || grep -qs "$BUILD_DIR/tmp" /proc/mounts; then + echo -e "${BOLD}${LIGHTYELLOW}Сhroot contains mounted filesystems.${ENDCOLOUR}" + if [ "$UNATTENDED" = "1" ]; then + chroot_umount_fs + else + read -r -p "$(echo -e ""Do you want to ${GREEN}unmount them${ENDCOLOUR}? [${BOLD}${GREEN}Y${ENDCOLOUR}/n])" response + response=${response,,} + if [[ "$response" =~ ^(no|n)$ ]]; then + exit 1 + else + chroot_umount_fs + fi + fi + fi +} + +# ================================================================= +# check if the folder where the installation will be performed is empty +# проверяем, пуста ли папка, в которую будет производиться установка +# ================================================================= + +function check_build_dir() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if [ "$UNATTENDED" = "1" ]; then + #echo -e "${RED}!!!Unattended installation!!!${ENDCOLOUR}" + BUILD_DIR="/build/$DISTRIBUTION" + echo -e "The working directory is ${MAGENTA}$BUILD_DIR${ENDCOLOUR}." + if [ "$(ls -A $BUILD_DIR)" != "" ]; then + cleanup + check_mounted + fi + else + # ▼ должно быть только перенаправление ошибки! + if [ "$(ls -A $BUILD_DIR)" != "" ]; then + echo -e "${MAGENTA}$BUILD_DIR${ENDCOLOUR} is not empty." + cleanup + check_mounted + if [ ! -d "$BUILD_DIR" ]; then + mkdir -p $BUILD_DIR + fi + BUILD_DIR="$( + cd $BUILD_DIR + pwd + )" + echo $BUILD_DIR >$SCRIPT_DIR/.build_dir && chmod 644 $SCRIPT_DIR/.build_dir + echo -e "The working directory is ${MAGENTA}$BUILD_DIR${ENDCOLOUR}." + else + mkdir -p $BUILD_DIR + check_mounted + BUILD_DIR="$( + cd $BUILD_DIR + pwd + )" + echo $BUILD_DIR >$SCRIPT_DIR/.build_dir && chmod 644 $SCRIPT_DIR/.build_dir + echo -e "The working directory is ${MAGENTA}$BUILD_DIR${ENDCOLOUR}." + fi + fi +} + +# ================================================================= +# configure the build folder +# настраиваем папку для сборки +# ================================================================= + +function setup_build_dir() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if [ "$UNATTENDED" = "1" ] && [ "$BUILD_DIR" = "" ]; then + BUILD_DIR="/build/$DISTRIBUTION" + check_build_dir + else + if [ "$BUILD_DIR" = "" ]; then + if [ ! -f "$SCRIPT_DIR/.build_dir" ]; then + echo "Enter the address of the working directory where we will build the system" + read -r -p "$(echo -e "(Default is ${MAGENTA}$PARENT_DIR/$DISTRIBUTION${ENDCOLOUR}): ")" response + BUILD_DIR=${response,,} + if [ "$BUILD_DIR" = "" ]; then + BUILD_DIR=$PARENT_DIR/$DISTRIBUTION + fi + check_build_dir + else + LAST_BUILD_DIR=$(cat "$SCRIPT_DIR/.build_dir") + echo -e "Last time you used the build directory ${MAGENTA}$LAST_BUILD_DIR${ENDCOLOUR}." + read -r -p "$(echo -e ""Do you want to use it again? [${BOLD}${GREEN}Y${ENDCOLOUR}/n])" response + response=${response,,} + if [[ "$response" =~ ^(no|n)$ ]]; then + echo "Enter the address of the working directory where we will build the system" + read -r -p "$(echo -e "(Default is ${MAGENTA}$PARENT_DIR/$DISTRIBUTION${ENDCOLOUR}): ")" response + BUILD_DIR=${response,,} + if [ "$BUILD_DIR" = "" ]; then + BUILD_DIR=$PARENT_DIR/$DISTRIBUTION + fi + check_build_dir + else + BUILD_DIR="$LAST_BUILD_DIR" + check_build_dir + fi + fi + fi + fi +} + +# ================================================================= +# cleaning the build folder +# очистка папки для сборки +# ================================================================= +function cleanup() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if [ "${CMD[ii]}" = "setup_host" ] || [ "${CMD[ii]}" = "build_bootstrap" ] || [ "${CMD[ii]}" = "build_chroot" ]; then + if [ "$UNATTENDED" = "1" ]; then + check_mounted + rm -rf $BUILD_DIR + if [ -d "$BUILD_DIR" ]; then + cleanup + fi + else + read -r -p "$(echo -e ""Do you want to ${BOLD}${RED}completely remove content${ENDCOLOUR} of ${MAGENTA}$BUILD_DIR${ENDCOLOUR}? [y/${BOLD}${GREEN}N${ENDCOLOUR}])" response + response=${response,,} + if [[ "$response" =~ ^(yes|y)$ ]]; then + check_mounted + rm -rf $BUILD_DIR + if [ -d "$BUILD_DIR" ]; then + cleanup + fi + else + echo -e "${MAGENTA}$BUILD_DIR${ENDCOLOUR} should be empty to continue." + exit 1 + fi + fi + fi +} + +# ================================================================= +# mount filesystems inside chroot +# монтируем файловые системы внутри chroot +# ================================================================= + +function chroot_mount_fs() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + + check_mounted + + mount --bind /dev $BUILD_DIR/dev + mount --bind /run $BUILD_DIR/run + mount none -t proc $BUILD_DIR/proc + mount none -t sysfs $BUILD_DIR/sys + mount none -t devpts $BUILD_DIR/dev/pts + mount none -t tmpfs $BUILD_DIR/tmp +} + +# ================================================================= +# unmount filesystems inside chroot +# размонтируем файловые системы внутри chroot +# ================================================================= + +function chroot_umount_fs() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + + set +e + umount $BUILD_DIR/proc >>$OUTPUT 2>&1 + umount $BUILD_DIR/sys >>$OUTPUT 2>&1 + umount $BUILD_DIR/dev/pts >>$OUTPUT 2>&1 + umount $BUILD_DIR/tmp >>$OUTPUT 2>&1 + umount $BUILD_DIR/dev >>$OUTPUT 2>&1 + umount $BUILD_DIR/run >>$OUTPUT 2>&1 + set -e + + check_mounted +} + +# ================================================================= +# delete the log +# удаляем лог +# ================================================================= +function remove_log_file() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if [ -f $LOGPATH/$LIVEKITNAME.log ]; then + rm -f $LOGPATH/$LIVEKITNAME.log + fi + if [ -f $BUILD_DIR/$LIVEKITNAME.log ]; then + rm -f $BUILD_DIR/$LIVEKITNAME.log + fi +} + +# ================================================================= +# creating a backup of scripts (to run you need to set the variable +# CREATE_BACKUP = "1" in linux-live/buildconfig) +# создание бэкапа скриптов (для запуска необходимо установить +# переменную CREATE_BACKUP="1" в linux-live/buildconfig) +# ================================================================= +function create_backup() { + if [ $CREATE_BACKUP = "1" ]; then + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if [ ! -f $SCRIPT_DIR/.script_version ]; then + cat "1" >$SCRIPT_DIR/.script_version >>$OUTPUT 2>&1 + chmod 644 $SCRIPT_DIR/.script_version >>$OUTPUT 2>&1 + fi + DATE=$(date +%Y%m%d_%H%M) + CHANGED="0" + rm -rf $SCRIPT_DIR/iso >>$OUTPUT 2>&1 + rm -f $SCRIPT_DIR/.build_dir >>$OUTPUT 2>&1 + rm -f $SCRIPT_DIR/*.log >>$OUTPUT 2>&1 + if [ ! -d $PARENT_DIR/minios-live-current ]; then + CHANGED="1" + mkdir -p $PARENT_DIR/minios-live-current + (cd $SCRIPT_DIR && cp --parents -afr * $PARENT_DIR/minios-live-current) + else + for file in $(find $SCRIPT_DIR -path $SCRIPT_DIR/.git -prune -false -o -type f | sed "s,$SCRIPT_DIR/,,g" | sed "s,.script_version,,g"); do + if ! cmp $SCRIPT_DIR/$file $PARENT_DIR/minios-live-current/$file >>$OUTPUT 2>&1; then + CHANGED="1" + echo -e "$file has been modified since last backup." >>$OUTPUT 2>&1 + echo -e "Copying $SCRIPT_DIR/$file to $PARENT_DIR/minios-live-current/$file..." >>$OUTPUT 2>&1 + cp -f "$SCRIPT_DIR/$file" "$PARENT_DIR/minios-live-current/$file" >>$OUTPUT 2>&1 + fi + done + fi + if [ $CHANGED = "1" ]; then + SCRIPT_VERSION=$(cat $SCRIPT_DIR/.script_version) + echo $(($SCRIPT_VERSION + 1)) >$SCRIPT_DIR/.script_version + echo $(($SCRIPT_VERSION + 1)) >$PARENT_DIR/minios-live-current/.script_version + cd $SCRIPT_DIR >>$OUTPUT 2>&1 + rm -f $PARENT_DIR/minios-live-current.tar.gz + tar -czf $PARENT_DIR/minios-live-current.tar.gz ./ >>$OUTPUT 2>&1 + cp $PARENT_DIR/minios-live-current.tar.gz $PARENT_DIR/minios-live-v$SCRIPT_VERSION-$DATE.tar.gz >>$OUTPUT 2>&1 + fi + fi +} + +# ================================================================= +# Displaying information about the start of the build for a more +# convenient search in the logs +# Отображение информации о старте сборки для более удобного поиска +# в логах +# ================================================================= +function new_run() { + DATE=$(date +"%Y.%m.%d %H:%M") + echo "" + echo "=================================================================" >>$OUTPUT 2>&1 + echo "=================================================================" >>$OUTPUT 2>&1 + echo "============================ NEW RUN ============================" >>$OUTPUT 2>&1 + echo "======================== $DATE =======================" >>$OUTPUT 2>&1 + echo "=================================================================" >>$OUTPUT 2>&1 + echo "======= If during the installation you get an error that ========" >>$OUTPUT 2>&1 + echo "=== /dev/stdout is not available, try using a bionic or xenial ==" >>$OUTPUT 2>&1 + echo "================= based container to install. ===================" >>$OUTPUT 2>&1 + echo "=================================================================" >>$OUTPUT 2>&1 + echo "=================================================================" >>$OUTPUT 2>&1 + echo "" +} + +# ================================================================= +# ================================================================= +# ====================== HOST FUNCTIONS =========================== +# ================================================================= +# ================================================================= + +# ================================================================= +# Creating a package list from a template +# Создание списка пакетов из шаблона +# ================================================================= +function create_apt_list() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if [ ! -f $SCRIPT_DIR/linux-live/aptsources/$DISTRIBUTION.list ] && [ $DISTRIBUTION != "buster" ]; then + cp -f $SCRIPT_DIR/linux-live/aptsources/sources.list $SCRIPT_DIR/linux-live/aptsources/$DISTRIBUTION.list + sed -i "s,distro,$DISTRIBUTION,g" $SCRIPT_DIR/linux-live/aptsources/$DISTRIBUTION.list + sed -i "s,http://ru.archive.ubuntu.com/ubuntu,$DISTRIBUTION_URL,g" $SCRIPT_DIR/linux-live/aptsources/$DISTRIBUTION.list + fi +} + +# ================================================================= +# Installing the base system +# Установка базовой системы +# ================================================================= +function build_bootstrap() { + current_process + + if [ $CONTAINER_TYPE = "1" ]; then + if [ ! -f /.minios-live ]; then + setup_host + fi + fi + if [ $DISTRIBUTION != "buster" ]; then + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + debootstrap --arch=$DISTRIBUTION_ARCH --variant=$DISTRIBUTION_VARIANT $DISTRIBUTION $BUILD_DIR $DISTRIBUTION_URL >>$OUTPUT 2>>$OUTPUT + else + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + debootstrap --arch=$DISTRIBUTION_ARCH $DISTRIBUTION $BUILD_DIR $DISTRIBUTION_URL >>$OUTPUT 2>>$OUTPUT + fi +} + +function copy_build_scripts() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if [ ! -d $BUILD_DIR/linux-live ]; then + mkdir -p $BUILD_DIR/linux-live + (cd $SCRIPT_DIR/linux-live && cp --parents -afr * $BUILD_DIR/linux-live) + else + find $SCRIPT_DIR/linux-live -type f -print0 | sed "s,$SCRIPT_DIR/linux-live/,,g" | while IFS= read -r -d '' file; do + if ! cmp $SCRIPT_DIR/linux-live/"$file" $BUILD_DIR/linux-live/"$file" >>$OUTPUT 2>&1; then + echo -e "$file has been modified since last build run." >>$OUTPUT 2>&1 + echo -e "Copying $SCRIPT_DIR/linux-live/$file to $BUILD_DIR/linux-live/$file..." >>$OUTPUT 2>&1 + cp -f $SCRIPT_DIR/linux-live/"$file" $BUILD_DIR/linux-live/"$file" >>$OUTPUT 2>&1 + fi + done + fi + + chmod +x $BUILD_DIR/linux-live/build + chmod +x $BUILD_DIR/linux-live/install_chroot + + if [ "$DEV_SYSTEM" = "1" ]; then + if [ ! -d $BUILD_DIR/opt/minios-live ]; then + mkdir -p $BUILD_DIR/opt/minios-live + (cd $SCRIPT_DIR && cp --parents -afr * $BUILD_DIR/opt/minios-live) + else + find $SCRIPT_DIR/linux-live -type f -print0 | sed "s,$SCRIPT_DIR/linux-live/,,g" | while IFS= read -r -d '' file; do + if ! cmp $SCRIPT_DIR/"$file" $BUILD_DIR/opt/minios-live/"$file" >>$OUTPUT 2>&1; then + echo -e "$file has been modified since last build run." >>$OUTPUT 2>&1 + echo -e "Copying $SCRIPT_DIR/$file to $BUILD_DIR/opt/minios-live/$file..." >>$OUTPUT 2>&1 + cp -f $SCRIPT_DIR/"$file" $BUILD_DIR/opt/minios-live/"$file" >>$OUTPUT 2>&1 + fi + done + fi + fi +} + +function preserve_environment_variables() { + if [ -d /opt/minios-live ]; then + chroot $BUILD_DIR /usr/bin/env \ + OUTPUT=$OUTPUT \ + LOGPATH=$LOGPATH \ + BUILD_TEST_ISO=$BUILD_TEST_ISO \ + CREATE_BACKUP=$CREATE_BACKUP \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE + fi + +} + +function build_chroot() { + current_process + + if [ $CONTAINER_TYPE = "1" ]; then + if [ ! -f /.minios-live ]; then + setup_host + fi + fi + + chroot_mount_fs + + copy_build_scripts + + create_apt_list + + if [ "$OUTPUT"="$LOGPATH/$LIVEKITNAME.log" ] && [ -f /$LIVEKITNAME.log ]; then + mv -f /$LIVEKITNAME.log $BUILD_DIR/$LIVEKITNAME.log + fi + if [ "$OUTPUT"="$LOGPATH/$LIVEKITNAME.log" ] && [ -f $BUILD_DIR/$LIVEKITNAME.log ]; then + echo "===========================================" >>$BUILD_DIR/$LIVEKITNAME.log 2>&1 + echo "===========================================" >>$BUILD_DIR/$LIVEKITNAME.log 2>&1 + echo "=============== CHROOT LOG ================" >>$BUILD_DIR/$LIVEKITNAME.log 2>&1 + echo "===========================================" >>$BUILD_DIR/$LIVEKITNAME.log 2>&1 + echo "===========================================" >>$BUILD_DIR/$LIVEKITNAME.log 2>&1 + fi + + cp -f $SCRIPT_DIR/linux-live/aptsources/$DISTRIBUTION.list $BUILD_DIR/etc/apt/sources.list + + if [ -d /opt/minios-live ] || [ -f /.minios-live-container ]; then + chroot $BUILD_DIR /usr/bin/env \ + OUTPUT=$OUTPUT \ + LOGPATH=$LOGPATH \ + BUILD_TEST_ISO=$BUILD_TEST_ISO \ + CREATE_BACKUP=$CREATE_BACKUP \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE /linux-live/install_chroot - + else + chroot $BUILD_DIR /linux-live/install_chroot - + fi + + chroot_umount_fs + + if [ "$OUTPUT"="$LOGPATH/$LIVEKITNAME.log" ] && [ -f $BUILD_DIR/$LIVEKITNAME.log ]; then + mv -f $BUILD_DIR/$LIVEKITNAME.log $SCRIPT_DIR/$LIVEKITNAME.log + if [ -f $SCRIPT_DIR/$LIVEKITNAME.log ]; then + echo -e "Installation log was saved to ${MAGENTA}$SCRIPT_DIR/$LIVEKITNAME.log${ENDCOLOUR}" + fi + fi +} + +function build_package() { + current_process + + if [ $CONTAINER_TYPE = "1" ]; then + if [ ! -f /.minios-live ]; then + setup_host + fi + fi + + chroot_mount_fs + + #copy_build_scripts + + if [ -d /opt/minios-live ] || [ -f /.minios-live-container ]; then + chroot $BUILD_DIR /usr/bin/env \ + OUTPUT=$OUTPUT \ + LOGPATH=$LOGPATH \ + BUILD_TEST_ISO=$BUILD_TEST_ISO \ + CREATE_BACKUP=$CREATE_BACKUP \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD update >>$OUTPUT 2>&1 && + chroot $BUILD_DIR /usr/bin/env \ + OUTPUT=$OUTPUT \ + LOGPATH=$LOGPATH \ + BUILD_TEST_ISO=$BUILD_TEST_ISO \ + CREATE_BACKUP=$CREATE_BACKUP \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/add_pkg.list | tr "\n" " ") >>$OUTPUT 2>&1 + else + chroot $BUILD_DIR sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD update >>$OUTPUT 2>&1 && + chroot $BUILD_DIR sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/add_pkg.list | tr "\n" " ") >>$OUTPUT 2>&1 + fi + + chroot_umount_fs + + rm -f $BUILD_DIR/var/lib/apt/extended_states >>$OUTPUT 2>&1 + rm -f $BUILD_DIR/var/lib/apt/lists/*Packages* >>$OUTPUT 2>&1 + rm -f $BUILD_DIR/var/lib/apt/lists/*Translation* >>$OUTPUT 2>&1 + rm -f $BUILD_DIR/var/lib/apt/lists/*InRelease >>$OUTPUT 2>&1 + rm -f $BUILD_DIR/var/lib/apt/lists/deb.* >>$OUTPUT 2>&1 + rm -f $BUILD_DIR/var/lib/dpkg/*-old >>$OUTPUT 2>&1 +} + +function build_live() { + current_process + + if [ $CONTAINER_TYPE = "1" ]; then + if [ ! -f /.minios-live ]; then + setup_host + fi + fi + + remove_log_file + + copy_build_scripts + + check_build_dir + + #(cd /linux-live/rootcopy && cp --parents -afr * /) + + chroot $BUILD_DIR mount none -t proc /proc + chroot $BUILD_DIR /linux-live/initrfs + chroot $BUILD_DIR umount /proc + + rm -rf $PARENT_DIR/image + mkdir -p $PARENT_DIR/image/$LIVEKITNAME/{boot,changes,modules} + + # copy kernel files + if [ $DISTRIBUTION != "buster" ]; then + cp $BUILD_DIR/boot/vmlinuz-**-**-generic $PARENT_DIR/image/$LIVEKITNAME/boot/vmlinuz + else + cp $BUILD_DIR/boot/vmlinuz-**-**-amd64 $PARENT_DIR/image/$LIVEKITNAME/boot/vmlinuz + fi + mv $BUILD_DIR/boot/initrfs.img $PARENT_DIR/image/$LIVEKITNAME/boot/initrfs.img + + cp -r $SCRIPT_DIR/linux-live/bootfiles/* $PARENT_DIR/image/$LIVEKITNAME + + # create compressed 01-core.sb + cd $BUILD_DIR + COREFS="" + for i in $MKMOD; do + if [ -d /$i ]; then + COREFS="$COREFS $i" + fi + done + if [ $COMP_TYPE = "zstd" ]; then + mksquashfs $COREFS $PARENT_DIR/image/$LIVEKITNAME/01-core-$COMP_TYPE.$BEXT -comp $COMP_TYPE -Xcompression-level 22 -b 1024K -always-use-fragments -keep-as-directory -noappend || exit + else + mksquashfs $COREFS $PARENT_DIR/image/$LIVEKITNAME/01-core-$COMP_TYPE.$BEXT -comp $COMP_TYPE -b 1024K -always-use-fragments -keep-as-directory -noappend || exit + fi + +} + +function build_iso() { + current_process + + if [ $CONTAINER_TYPE = "1" ]; then + if [ ! -f /.minios-live ]; then + setup_host + fi + fi + + check_build_dir + + if [ "$UNATTENDED" = "1" ]; then + BUILD_DIR="/build/$DISTRIBUTION" + fi + if [ "$BUILD_DIR" = "" ]; then + LAST_BUILD_DIR=$(cat "$SCRIPT_DIR/.build_dir") >>$OUTPUT 2>&1 + BUILD_DIR=$LAST_BUILD_DIR + fi + + cd $PARENT_DIR/image + if [ ! -d $ISO_DIR ]; then + mkdir -p $ISO_DIR + fi + + mkdir -p $ISO_DIR >>$OUTPUT 2>&1 + VER=$SYSTEMVER + DATE=$(date +%Y%m%d_%H%M) + + DIR=$PARENT_DIR/image + ISO=$ISO_DIR/$LIVEKITNAME-$DISTRIBUTION-$DISTRIBUTION_ARCH-$COMP_TYPE-$LIVE_TYPE-$DATE.iso + + B="-b $LIVEKITNAME/boot/isolinux.bin -c $LIVEKITNAME/boot/isolinux.boot" + + C="-no-emul-boot -boot-load-size 4 -boot-info-table" + + # ▼ должно быть только перенаправление ошибки! + + M=genisoimage + + D="" + + E="" + + #VER="$SYSTEMNAME $VER" + VER="$SYSTEMNAME" + + if [ REMOVE_OLD_ISO = "1" ]; then + rm $ISO_DIR/$LIVEKITNAME-$DISTRIBUTION-$DISTRIBUTION_ARCH-$COMP_TYPE-$LIVE_TYPE-*.iso >>$OUTPUT 2>&1 + fi + + if + ! $M -f -r -J -l -V "$VER" -A "$VER" \ + $B $C $D $E -o $ISO $DIR + then + exit 1 + fi + + echo ">>> $ISO created" + + if [ $BUILD_TEST_ISO = "1" ]; then + if [ -L $ISO_DIR/$LIVEKITNAME.iso ]; then + rm $ISO_DIR/$LIVEKITNAME.iso + fi + if ln -s $LIVEKITNAME-$DISTRIBUTION-$DISTRIBUTION_ARCH-$COMP_TYPE-$LIVE_TYPE-$DATE.iso $ISO_DIR/$LIVEKITNAME.iso; then + echo ">>> $ISO_DIR/$LIVEKITNAME.iso created" + fi + fi + exit 0 +} + +function batch_run() { + current_process + + chroot $1 /usr/bin/env \ + OUTPUT=$OUTPUT \ + LOGPATH=$LOGPATH \ + BUILD_TEST_ISO=$BUILD_TEST_ISO \ + CREATE_BACKUP=$CREATE_BACKUP \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $2 +} + +# ================================================================= +# ================================================================= +# ====================== INSTALL FUNCTIONS ======================== +# ================================================================= +# ================================================================= + +function setup_host() { + current_process + + if [ $CONTAINER_TYPE != "2" ]; then + hostreq_pkg_list + fi +} + +function chroot_setup_host() { + current_process + + echo $LIVEKITNAME >/etc/hostname + + prereq_pkg_list + + #configure machine id + dbus-uuidgen >/etc/machine-id >>$OUTPUT 2>&1 + ln -fs /etc/machine-id /var/lib/dbus/machine-id >>$OUTPUT 2>&1 + + # don't understand why, but multiple sources indicate this + dpkg-divert --local --rename --add /sbin/initctl >>$OUTPUT 2>&1 + ln -s /bin/true /sbin/initctl >>$OUTPUT 2>&1 + + current_process +} + +function hostreq_pkg_list() { + echo -e "${YELLOW}=====> installing required software for host system ...${ENDCOLOUR}" + $APT_CMD update >>$OUTPUT 2>&1 + + if [ -f $SCRIPT_DIR/linux-live/pkglists/hostreq.list ]; then + $APT_CMD install -y \ + $(grep -vE "^\s*#" $SCRIPT_DIR/linux-live/pkglists/hostreq.list | tr "\n" " ") >>$OUTPUT 2>&1 + else + $APT_CMD install -y sudo debootstrap genisoimage >>$OUTPUT 2>&1 + fi +} + +function prereq_pkg_list() { + echo -e "${YELLOW}=====> installing prerequested software for chroot system ...${ENDCOLOUR}" + + if [ -f $SCRIPT_DIR/pkglists/prereq.list ]; then + $APT_CMD update >>$OUTPUT 2>&1 && + echo -e "${YELLOW}=====> upgrading chroot system ...${ENDCOLOUR}" && + $APT_CMD upgrade $APT_OPTIONS >>$OUTPUT 2>&1 && + echo -e "${YELLOW}=====> installing packages ...${ENDCOLOUR}" && + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/prereq.list | tr "\n" " ") >>$OUTPUT 2>&1 + fi +} + +function main_pkg_list() { + echo -e "${YELLOW}=====> installing main packages for chroot system ...${ENDCOLOUR}" + + if [ -f /linux-live/basesystem/01-core/preinstall ]; then + chmod +x /linux-live/basesystem/01-core/preinstall + /usr/bin/env \ + OUTPUT=$OUTPUT \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + /linux-live/basesystem/01-core/preinstall + fi + if [ "$(ls -A /linux-live/basesystem/01-core/rootcopy)" != "" ]; then + (cd /linux-live/basesystem/01-core/rootcopy && cp --parents -afr * /) + fi + if [ -f /linux-live/basesystem/01-core/install ]; then + chmod +x /linux-live/basesystem/01-core/install + /usr/bin/env \ + OUTPUT=$OUTPUT \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + /linux-live/basesystem/01-core/install + fi + if [ -f /linux-live/basesystem/01-core/postinstall ]; then + chmod +x /linux-live/basesystem/01-core/postinstall + /usr/bin/env \ + OUTPUT=$OUTPUT \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + /linux-live/basesystem/01-core/postinstall + fi +} + +function chroot_pkg_install() { + current_process + + main_pkg_list + + # remove unused + $APT_CMD autoremove $APT_OPTIONS >>$OUTPUT 2>&1 + + # clean up apt cache + $APT_CMD clean $APT_OPTIONS >>$OUTPUT 2>&1 +} + +function chroot_configure() { + current_process + + (cd /linux-live/basesystem/01-core/rootcopy && cp --parents -afr * /) + + echo "Set up password for user 'root'" >>$OUTPUT 2>&1 + echo root:toor | chpasswd >>$OUTPUT 2>&1 + + echo "Set up user 'live'" >>$OUTPUT 2>&1 + adduser --gecos '' live --disabled-password >>$OUTPUT 2>&1 + echo "Set up password for user 'live'" >>$OUTPUT 2>&1 + echo live:evil | chpasswd >>$OUTPUT 2>&1 + addgroup live adm >>$OUTPUT 2>&1 + addgroup live sudo >>$OUTPUT 2>&1 + + cat </etc/sudoers.d/90-minios +# live user is default user in minios. +# It needs passwordless sudo functionality. +live ALL=(ALL) NOPASSWD:ALL +EOF + + if [ ! -d /etc/NetworkManager ]; then + echo "Enable dhclient.service autostart." >>$OUTPUT 2>&1 + cat </lib/systemd/system/dhclient.service +[Unit] +Description=DHCP Client +Documentation=man:dhclient(8) +Wants=network.target +After=network-pre.target systemd-sysctl.service systemd-modules-load.service +Before=network.target shutdown.target network-online.target +ConditionPathExists=!/run/initramfs/net.up.flag + +[Service] +Type=forking +ExecStart=-/bin/sh -c 'udevadm settle && dhclient -nw' +PIDFile=/run/dhclient.pid + +[Install] +WantedBy=multi-user.target +WantedBy=network-online.target +EOF + systemctl enable dhclient >>$OUTPUT 2>&1 + fi + + if [ -f /etc/systemd/system/multi-user.target.wants/grub-initrd-fallback.service ]; then + echo "Disable grub-initrd-fallback.service autostart." + systemctl disable grub-initrd-fallback.service + fi + + if grep openssh-server $SCRIPT_DIR/pkglists/main.list >>$OUTPUT 2>&1; then + echo "Enable ssh.service autostart." >>$OUTPUT 2>&1 + cat </lib/systemd/system/ssh-keygen.service +[Unit] +Description=Generate sshd keys +Before=ssh.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/ssh-keygen -A +RemainAfterExit=true +StandardOutput=journal + +[Install] +WantedBy=multi-user.target +EOF + systemctl enable ssh-keygen >>$OUTPUT 2>&1 + systemctl enable ssh >>$OUTPUT 2>&1 + fi + + if [ $DISTRIBUTION = "buster" ]; then + cat </etc/issue + + + \l + + + + + + Thank you for using MiniOS. + Based on Debian GNU/Linux 10. + + :::: :::: ::::::::::: :::: ::: ::::::::::: :::::::: :::::::: + +:+:+: :+:+:+ :+: :+:+: :+: :+: :+: :+: :+: :+: + +:+ +:+:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ + +#+ +:+ +#+ +#+ +#+ +:+ +#+ +#+ +#+ +:+ +#++:++#++ + +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ + #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# + ### ### ########### ### #### ########### ######## ######## + + : : + : Root login name: root : + : Password: toor : + : User login name: live : + : Password: evil : + + + + + + + +EOF + else + cat </etc/issue + + + \l + + + + + + Thank you for using MiniOS. + Based on Ubuntu. + + :::: :::: ::::::::::: :::: ::: ::::::::::: :::::::: :::::::: + +:+:+: :+:+:+ :+: :+:+: :+: :+: :+: :+: :+: :+: + +:+ +:+:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ + +#+ +:+ +#+ +#+ +#+ +:+ +#+ +#+ +#+ +:+ +#++:++#++ + +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ + #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# + ### ### ########### ### #### ########### ######## ######## + + : : + : Root login name: root : + : Password: toor : + : User login name: live : + : Password: evil : + + + + + + + +EOF + fi + +} + +function chroot_finish_up() { + current_process + + # truncate machine id (why??) + truncate -s 0 /etc/machine-id >>$OUTPUT 2>&1 + + # remove diversion (why??) + rm /sbin/initctl >>$OUTPUT 2>&1 + dpkg-divert --rename --remove /sbin/initctl >>$OUTPUT 2>&1 + + # remove ssh config + #rm -f /etc/ssh/ssh_host* + + # clean up useless stuff + rm -rf /tmp/* ~/.bash_history >>$OUTPUT 2>&1 + rm -rf ~/.cache + find /var/log/ -type f | xargs rm -f >>$OUTPUT 2>&1 + rm -f /etc/ssh/ssh_host* + rm -f /var/backups/* >>$OUTPUT 2>&1 + rm -f /var/cache/ldconfig/* >>$OUTPUT 2>&1 + #rm -f /var/cache/debconf/* >>$OUTPUT 2>&1 + rm -f /var/cache/fontconfig/* >>$OUTPUT 2>&1 + rm -f /var/cache/apt/archives/*.deb >>$OUTPUT 2>&1 + rm -f /var/cache/apt/*.bin >>$OUTPUT 2>&1 + rm -f /var/cache/debconf/*-old >>$OUTPUT 2>&1 + rm -f /var/lib/apt/extended_states >>$OUTPUT 2>&1 + rm -f /var/lib/apt/lists/*Packages >>$OUTPUT 2>&1 + rm -f /var/lib/apt/lists/*Translation* >>$OUTPUT 2>&1 + rm -f /var/lib/apt/lists/*InRelease >>$OUTPUT 2>&1 + rm -f /var/lib/apt/lists/deb.* >>$OUTPUT 2>&1 + rm -f /var/lib/dpkg/*-old >>$OUTPUT 2>&1 + + #chmod +x /linux-live/basesystem/01-core/postinstall + #/linux-live/basesystem/01-core/postinstall + +} + +# ================================================================= +# ================================================================= +# ======================= MODULE FUNCTIONS ======================== +# ================================================================= +# ================================================================= + +function module_check_mounted() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if grep -qs "$MODULE_MERGED_DIR" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/dev" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/run" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/proc" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/sys" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/dev/pts" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/tmp" /proc/mounts; then + echo -e "${BOLD}${LIGHTYELLOW}Сhroot contains mounted filesystems.${ENDCOLOUR}" + if [ "$UNATTENDED" = "1" ]; then + module_chroot_umount_fs + else + read -r -p "$(echo -e ""Do you want to ${GREEN}unmount them${ENDCOLOUR}? [${BOLD}${GREEN}Y${ENDCOLOUR}/n])" response + response=${response,,} + if [[ "$response" =~ ^(no|n)$ ]]; then + exit 1 + else + module_chroot_umount_fs + fi + fi + fi +} + +function module_check_build_dir() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if [ "$UNATTENDED" = "1" ]; then + #echo -e "${RED}!!!Unattended installation!!!${ENDCOLOUR}" + echo -e "The working directory is ${MAGENTA}$MODULE_UPPER_DIR${ENDCOLOUR}." + if [ "$(ls -A $MODULE_UPPER_DIR)" != "" ]; then + module_cleanup + module_check_mounted + fi + else + # ▼ должно быть только перенаправление ошибки! + if [ "$(ls -A $MODULE_UPPER_DIR)" != "" ]; then + echo -e "${MAGENTA}$MODULE_UPPER_DIR${ENDCOLOUR} is not empty." + module_cleanup + module_check_mounted + echo -e "The working directory is ${MAGENTA}$MODULE_MERGED_DIR${ENDCOLOUR}." + else + module_check_mounted + echo -e "The working directory is ${MAGENTA}$MODULE_MERGED_DIR${ENDCOLOUR}." + fi + fi +} + +function module_chroot_mount_fs() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + + local MODULES MODULE_LOWER_DIR + + module_check_mounted + + if [ $UNION_BUILD_TYPE = "overlayfs" ]; then + MODULES_LIST="" + MODULES=($PARENT_DIR/image/$LIVEKITNAME/*.$BEXT) + for ((i = ${#MODULES[@]} - 1; i >= 0; i--)); do + MODULE_LOWER_DIR=$(basename ${MODULES[$i]} .$BEXT) + mkdir -p $MODULES_DIR/lower/$MODULE_LOWER_DIR-lower + mount ${MODULES[$i]} $MODULES_DIR/lower/$MODULE_LOWER_DIR-lower + MODULES_LIST=$MODULES_LIST":""$MODULES_DIR/lower/$MODULE_LOWER_DIR-lower" + done + MODULES_LIST=${MODULES_LIST:1} + + mkdir -p $MODULE_UPPER_DIR $MODULE_WORK_DIR $MODULE_MERGED_DIR + + mount -t overlay overlay -o lowerdir=$MODULES_LIST,upperdir=$MODULE_UPPER_DIR,workdir=$MODULE_WORK_DIR $MODULE_MERGED_DIR + elif [ $UNION_BUILD_TYPE = "aufs" ]; then + MODULES_LIST="" + MODULES=($PARENT_DIR/image/$LIVEKITNAME/*.$BEXT) + for ((i = ${#MODULES[@]} - 1; i >= 0; i--)); do + MODULE_LOWER_DIR=$(basename ${MODULES[$i]} .$BEXT) + mkdir -p $MODULES_DIR/lower/$MODULE_LOWER_DIR-lower + mount ${MODULES[$i]} $MODULES_DIR/lower/$MODULE_LOWER_DIR-lower + MODULES_LIST=$MODULES_LIST":""$MODULES_DIR/lower/$MODULE_LOWER_DIR-lower""=ro" + done + MODULES_LIST=${MODULES_LIST:1} + + mkdir -p $MODULE_UPPER_DIR $MODULE_WORK_DIR $MODULE_MERGED_DIR + + mount -t aufs -o br:$MODULE_UPPER_DIR=rw:$MODULES_LIST aufs $MODULE_MERGED_DIR + fi + + if [ ! -d $MODULE_MERGED_DIR/dev ]; then + mkdir -p $MODULE_MERGED_DIR/dev + fi + if [ ! -d $MODULE_MERGED_DIR/run ]; then + mkdir -p $MODULE_MERGED_DIR/run + fi + if [ ! -d $MODULE_MERGED_DIR/proc ]; then + mkdir -p $MODULE_MERGED_DIR/proc + fi + if [ ! -d $MODULE_MERGED_DIR/sys ]; then + mkdir -p $MODULE_MERGED_DIR/sys + fi + if [ ! -d $MODULE_MERGED_DIR/tmp ]; then + mkdir -p $MODULE_MERGED_DIR/tmp + fi + + mount --bind /dev $MODULE_MERGED_DIR/dev + if [ -f /.dockerenv ] || [ "$container" = "podman" ]; then + mkdir -p $MODULE_MERGED_DIR/run/resolvconf + touch $MODULE_MERGED_DIR/run/resolvconf/resolv.conf + mount --bind /etc/resolv.conf $MODULE_MERGED_DIR/run/resolvconf/resolv.conf + else + mount --bind /run $MODULE_MERGED_DIR/run + fi + mount none -t proc $MODULE_MERGED_DIR/proc + mount none -t sysfs $MODULE_MERGED_DIR/sys + mount none -t devpts $MODULE_MERGED_DIR/dev/pts + mount none -t tmpfs $MODULE_MERGED_DIR/tmp +} + +function module_chroot_umount_fs() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + + local MODULES MODULE_LOWER_DIR + + set +e + umount $MODULE_MERGED_DIR/proc >>$OUTPUT 2>&1 + umount $MODULE_MERGED_DIR/sys >>$OUTPUT 2>&1 + umount $MODULE_MERGED_DIR/dev/pts >>$OUTPUT 2>&1 + umount $MODULE_MERGED_DIR/tmp >>$OUTPUT 2>&1 + umount $MODULE_MERGED_DIR/dev >>$OUTPUT 2>&1 + if [ -f /.dockerenv ] || [ "$container" = "podman" ]; then + umount $MODULE_MERGED_DIR/run/resolvconf/resolv.conf >>$OUTPUT 2>&1 + rm -f $MODULE_MERGED_DIR/run/resolvconf/resolv.conf + rmdir $MODULE_MERGED_DIR/run/resolvconf + else + umount $MODULE_MERGED_DIR/run >>$OUTPUT 2>&1 + fi + umount $MODULE_MERGED_DIR >>$OUTPUT 2>&1 + set -e + + MODULES=($PARENT_DIR/image/$LIVEKITNAME/*.$BEXT) + for ((i = ${#MODULES[@]} - 1; i >= 0; i--)); do + MODULE_LOWER_DIR=$(basename ${MODULES[$i]} .$BEXT) + umount $MODULES_DIR/lower/$MODULE_LOWER_DIR-lower + done + + module_check_mounted +} + +function module_cleanup() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + if [ "$UNATTENDED" = "1" ]; then + module_check_mounted + rm -rf $MODULE_UPPER_DIR + if [ -d "$MODULE_UPPER_DIR" ]; then + module_cleanup + fi + else + read -r -p "$(echo -e ""Do you want to ${BOLD}${RED}completely remove content${ENDCOLOUR} of ${MAGENTA}$MODULE_UPPER_DIR${ENDCOLOUR}? [y/${BOLD}${GREEN}N${ENDCOLOUR}])" response + response=${response,,} + if [[ "$response" =~ ^(yes|y)$ ]]; then + module_check_mounted + rm -rf $MODULE_UPPER_DIR + if [ -d "$MODULE_UPPER_DIR" ]; then + module_cleanup + fi + else + echo -e "${MAGENTA}$MODULE_UPPER_DIR${ENDCOLOUR} should be empty to continue." + exit 1 + fi + fi +} + +function module_chroot_finish_up() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + + # truncate machine id (why??) + chroot $MODULE_MERGED_DIR /bin/bash -x <>$OUTPUT 2>&1 + dpkg-divert --rename --remove /sbin/initctl >>$OUTPUT 2>&1 +EOF +} + +function module_chroot_cleanup() { + echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." + # clean up useless stuff + rm -rf $MODULE_UPPER_DIR/boot $MODULE_UPPER_DIR/dev $MODULE_UPPER_DIR/proc $MODULE_UPPER_DIR/sys $MODULE_UPPER_DIR/rmp $MODULE_UPPER_DIR/run + rm -f $MODULE_UPPER_DIR/root/.bash_history >>$OUTPUT 2>&1 + rm -rf $MODULE_UPPER_DIR/.cache + find $MODULE_UPPER_DIR/var/log/ -type f | xargs rm -f >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/etc/ssh/ssh_host* + rm -f $MODULE_UPPER_DIR/var/backups/* >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/cache/ldconfig/* >>$OUTPUT 2>&1 + #rm -f $MODULE_UPPER_DIR/var/cache/debconf/* >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/cache/fontconfig/* >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/cache/apt/archives/*.deb >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/cache/apt/*.bin >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/cache/debconf/*-old >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/lib/apt/extended_states >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/lib/apt/lists/*Packages >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/lib/apt/lists/*Translation* >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/lib/apt/lists/*InRelease >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/lib/apt/lists/deb.* >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/var/lib/dpkg/*-old >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/preinstall >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/install >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/cleanup >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/package.list >>$OUTPUT 2>&1 + rm -f $MODULE_UPPER_DIR/postinstall >>$OUTPUT 2>&1 + rm -rf $MODULE_UPPER_DIR/rootcopy >>$OUTPUT 2>&1 +} + +function build_modules_chroot() { + current_process + + if [ $CONTAINER_TYPE = "1" ]; then + if [ ! -f /.minios-live ]; then + setup_host + fi + fi + + MODULES_DIR=$PARENT_DIR/modules + + cd $SCRIPT_DIR/linux-live/modules + + for MODULE in *; do + if (ls $PARENT_DIR/image/$LIVEKITNAME/*.$BEXT | grep -q $MODULE 2>/dev/null); then + echo -e "${RED}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!${ENDCOLOUR}" + echo -e "Please remove ${MAGENTA}$PARENT_DIR/image/$LIVEKITNAME/$MODULE.$BEXT${ENDCOLOUR} if you want to build ${MAGENTA}$MODULE${ENDCOLOUR}." + echo -e "${RED}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!${ENDCOLOUR}" + else + MODULE_UPPER_DIR="$MODULES_DIR/$MODULE-upper" + MODULE_WORK_DIR="$MODULES_DIR/$MODULE-work" + MODULE_MERGED_DIR="$MODULES_DIR/$MODULE-merged" + + module_check_build_dir + + module_chroot_mount_fs + + # run pre-install script + if [ -f $SCRIPT_DIR/linux-live/modules/$MODULE/preinstall ]; then + cp $SCRIPT_DIR/linux-live/modules/$MODULE/preinstall $MODULE_MERGED_DIR/preinstall + chmod +x $MODULE_MERGED_DIR/preinstall + chroot $MODULE_MERGED_DIR /usr/bin/env \ + OUTPUT=$OUTPUT \ + LOGPATH=$LOGPATH \ + BUILD_TEST_ISO=$BUILD_TEST_ISO \ + CREATE_BACKUP=$CREATE_BACKUP \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + /preinstall >>$OUTPUT 2>&1 + fi + + # copy files + if [ ! -f $SCRIPT_DIR/linux-live/modules/$MODULE/is_internal_build ]; then + if [ "$(ls -A $SCRIPT_DIR/linux-live/modules/$MODULE/rootcopy)" != "" ]; then + echo "1" + (cd $SCRIPT_DIR/linux-live/modules/$MODULE/rootcopy && cp --parents -afr * $MODULE_MERGED_DIR/) + fi + else + if [ "$(ls -A $SCRIPT_DIR/linux-live/modules/$MODULE/rootcopy)" != "" ]; then + mkdir $MODULE_MERGED_DIR/rootcopy + (cd $SCRIPT_DIR/linux-live/modules/$MODULE/rootcopy && cp --parents -afr * $MODULE_MERGED_DIR/rootcopy/) + fi + fi + + # run install script + if [ -f $SCRIPT_DIR/linux-live/modules/$MODULE/install ]; then + cp $SCRIPT_DIR/linux-live/modules/$MODULE/install $MODULE_MERGED_DIR/install + chmod +x $MODULE_MERGED_DIR/install + if [ -f $SCRIPT_DIR/linux-live/modules/$MODULE/cleanup ]; then + cp $SCRIPT_DIR/linux-live/modules/$MODULE/cleanup $MODULE_MERGED_DIR/cleanup + fi + if [ -f $SCRIPT_DIR/linux-live/modules/$MODULE/package.list ]; then + cp $SCRIPT_DIR/linux-live/modules/$MODULE/package.list $MODULE_MERGED_DIR/package.list + fi + chroot $MODULE_MERGED_DIR /usr/bin/env \ + OUTPUT=$OUTPUT \ + LOGPATH=$LOGPATH \ + BUILD_TEST_ISO=$BUILD_TEST_ISO \ + CREATE_BACKUP=$CREATE_BACKUP \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + /install >>$OUTPUT 2>&1 + fi + + if [ -f $SCRIPT_DIR/linux-live/modules/$MODULE/is_internal_build ]; then + module_chroot_umount_fs + + # run external actions + + if [ "$(ls -A $MODULE_UPPER_DIR)" != "" ]; then + mkdir -p $PARENT_DIR/modules/tmp >>$OUTPUT 2>&1 + mksquashfs $MODULE_UPPER_DIR $PARENT_DIR/modules/tmp/$MODULE-stock.$BEXT -comp lz4 -b 1024K -always-use-fragments -noappend >>$OUTPUT 2>&1 || exit + mv $PARENT_DIR/modules/tmp/$MODULE-stock.$BEXT $MODULE_UPPER_DIR/$MODULE-stock.$BEXT >>$OUTPUT 2>&1 + cd $MODULE_UPPER_DIR >>$OUTPUT 2>&1 + unsquashfs $MODULE-stock.$BEXT >>$OUTPUT 2>&1 + else + echo -e "${MAGENTA}$BUILD_DIR${ENDCOLOUR} is empty. Nothing to do." + fi + + #module_check_build_dir + + module_chroot_mount_fs + fi + + # run install2 script + if [ -f $SCRIPT_DIR/linux-live/modules/$MODULE/install2 ]; then + cp $SCRIPT_DIR/linux-live/modules/$MODULE/install2 $MODULE_MERGED_DIR/install2 + chmod +x $MODULE_MERGED_DIR/install2 + chroot $MODULE_MERGED_DIR /usr/bin/env \ + OUTPUT=$OUTPUT \ + LOGPATH=$LOGPATH \ + BUILD_TEST_ISO=$BUILD_TEST_ISO \ + CREATE_BACKUP=$CREATE_BACKUP \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + /install2 >>$OUTPUT 2>&1 + fi + + : 'if [ ! -f $SCRIPT_DIR/linux-live/modules/$MODULE/is_internal_build ]; then + # copy files + if [ "$(ls -A $SCRIPT_DIR/linux-live/modules/$MODULE/rootcopy)" != "" ]; then + (cd $SCRIPT_DIR/linux-live/modules/$MODULE/rootcopy && cp --parents -afr * $MODULE_MERGED_DIR/) + fi + fi' + + # run post-install script + if [ -f $SCRIPT_DIR/linux-live/modules/$MODULE/postinstall ]; then + cp $SCRIPT_DIR/linux-live/modules/$MODULE/postinstall $MODULE_MERGED_DIR/postinstall + chmod +x $MODULE_MERGED_DIR/postinstall + chroot $MODULE_MERGED_DIR /usr/bin/env \ + OUTPUT=$OUTPUT \ + LOGPATH=$LOGPATH \ + BUILD_TEST_ISO=$BUILD_TEST_ISO \ + CREATE_BACKUP=$CREATE_BACKUP \ + DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE \ + APT_CMD=$APT_CMD \ + APT_OPTIONS=$APT_OPTIONS \ + APT_OPTIONS2=$APT_OPTIONS2 \ + LIVE_TYPE=$LIVE_TYPE \ + /postinstall >>$OUTPUT 2>&1 + fi + + # run external actions + if [ -f $SCRIPT_DIR/linux-live/modules/$MODULE/is_internal_build ]; then + cp $MODULE_UPPER_DIR/$MODULE.$BEXT $PARENT_DIR/image/$LIVEKITNAME/$MODULE-$COMP_TYPE.$BEXT >>$OUTPUT 2>&1 + fi + + #if [ ! -f $SCRIPT_DIR/linux-live/modules/$MODULE/is_internal_build ]; then + module_chroot_finish_up + + module_chroot_umount_fs + + module_chroot_cleanup + #fi + + if [ ! -f $PARENT_DIR/image/$LIVEKITNAME/$MODULE.$BEXT ] && [ ! -f $SCRIPT_DIR/linux-live/modules/$MODULE/is_internal_build ]; then + echo "here 1" + build_modules_live + fi + + fi + done +} + +function build_modules_live() { + current_process + echo "here 2" + if [ $CONTAINER_TYPE = "1" ]; then + if [ ! -f /.minios-live ]; then + setup_host + fi + fi + + MODULES_DIR=$PARENT_DIR/modules + + cd $SCRIPT_DIR/linux-live/modules + + for MODULE in *; do + + if (ls $PARENT_DIR/image/$LIVEKITNAME/*.$BEXT | grep -q $MODULE 2>/dev/null); then + echo -e "${RED}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!${ENDCOLOUR}" + echo -e "Please remove ${MAGENTA}$PARENT_DIR/image/$LIVEKITNAME/$MODULE.$BEXT${ENDCOLOUR} if you want to build ${MAGENTA}$MODULE${ENDCOLOUR}." + echo -e "${RED}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!${ENDCOLOUR}" + else + + MODULE_UPPER_DIR="$MODULES_DIR/$MODULE-upper" + MODULE_WORK_DIR="$MODULES_DIR/$MODULE-work" + MODULE_MERGED_DIR="$MODULES_DIR/$MODULE-merged" + + if [ "$(ls -A $MODULE_UPPER_DIR)" != "" ]; then + if [ $COMP_TYPE = "zstd" ]; then + mksquashfs $MODULE_UPPER_DIR $PARENT_DIR/image/$LIVEKITNAME/$MODULE-$COMP_TYPE.$BEXT -comp $COMP_TYPE -Xcompression-level 22 -b 1024K -always-use-fragments -noappend || exit + else + mksquashfs $MODULE_UPPER_DIR $PARENT_DIR/image/$LIVEKITNAME/$MODULE-$COMP_TYPE.$BEXT -comp $COMP_TYPE -b 1024K -always-use-fragments -noappend || exit + fi + else + echo -e "${MAGENTA}$BUILD_DIR${ENDCOLOUR} is empty. Nothing to do." + fi + fi + done +} diff --git a/linux-live/modules/01-firmware/install b/linux-live/modules/01-firmware/install new file mode 100644 index 0000000..29e9948 --- /dev/null +++ b/linux-live/modules/01-firmware/install @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e # exit on error +set -o pipefail # exit on pipeline error +set -u # treat unset variable as error + +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" + +# install packages +if [ -f $SCRIPT_DIR/package.list ]; then + #sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD update >>$OUTPUT 2>&1 && + #sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD install $APT_OPTIONS $APT_OPTIONS2 \ + $(grep -vE "^\s*#" $SCRIPT_DIR/package.list | tr "\n" " ") >>$OUTPUT 2>&1 +fi diff --git a/linux-live/modules/01-firmware/package.list b/linux-live/modules/01-firmware/package.list new file mode 100644 index 0000000..b8cb39c --- /dev/null +++ b/linux-live/modules/01-firmware/package.list @@ -0,0 +1,13 @@ +firmware-linux-free +firmware-linux-nonfree +firmware-atheros +firmware-iwlwifi +firmware-zd1211 +firmware-realtek +firmware-bnx2 +firmware-brcm80211 +firmware-cavium +firmware-ipw2x00 +firmware-libertas +firmware-ti-connectivity +firmware-b43-installer \ No newline at end of file diff --git a/linux-live/modules/01-firmware/postinstall b/linux-live/modules/01-firmware/postinstall new file mode 100644 index 0000000..4c072dc --- /dev/null +++ b/linux-live/modules/01-firmware/postinstall @@ -0,0 +1,92 @@ +#!/bin/bash + +rm -f /etc/fstab +rm -f /etc/mtab +rm -f /etc/apt/sources.list~ +rm -Rf /etc/systemd/system/timers.target.wants +rm -f /etc/systemd/system/multi-user.target.wants/ssh.service +rm -f /etc/systemd/system/multi-user.target.wants/dnsmasq.service + +rm -f /etc/ssh/ssh_host* + +rm -f /var/backups/* +rm -f /var/cache/ldconfig/* +rm -f /var/cache/debconf/* +rm -f /var/cache/fontconfig/* +rm -f /var/lib/apt/extended_states +rm -f /var/lib/systemd/random-seed +rm -f /var/lib/apt/lists/deb.* +rm -Rf /root/.local/share/mc +rm -Rf /root/.cache +rm -f /root/.wget-hsts + +rm -f /var/lib/dpkg/*-old +rm -f /var/log/* +rm -f /var/log/*/* +rm -f /var/log/*/*/* +rm -f /var/cache/apt/archives/*.deb +rm -f /var/cache/apt/*.bin +rm -f /var/cache/debconf/*-old +rm -f /var/lib/dhcp/dhclient.leases +rm -f /root/.bash_history +rm -f /root/.wget-hsts +rm -Rf /usr/share/doc/* +rm -Rf /usr/share/info/* +rm -f /usr/share/images/fluxbox/debian-squared.jpg +rm -Rf /usr/share/fluxbox/nls/??* +rm -Rf /usr/share/gnome/help + +rm -Rf /usr/share/locale/?? +rm -Rf /usr/share/locale/??_* +rm -Rf /usr/share/locale/??@* +rm -Rf /usr/share/locale/??? +rm -Rf /usr/share/i18n/locales/*_* +rm -Rf /usr/share/man/?? +rm -Rf /usr/share/man/*_* + +rm -Rf /usr/share/icons/elementaryXubuntu-dark +rm -Rf /usr/share/icons/gnome/256x256 + +rm /usr/share/applications/compton.desktop +rm /usr/share/applications/debian-uxterm.desktop +rm /usr/share/applications/debian-xterm.desktop +rm /usr/share/applications/htop.desktop +rm /usr/share/applications/mc.desktop +rm /usr/share/applications/mcedit.desktop +rm /usr/share/applications/pcmanfm-desktop-pref.desktop +rm /usr/share/applications/python2.7.desktop +rm /usr/share/applications/python3.7.desktop +rm /usr/share/applications/vim.desktop + + + +# Unzip gzipped files (man pages), so LZMA can compress 2times better. +# First we fix symlinks, then uncompress files +# $1 = search directory +uncompress_files() +{ + local LINK LINE + + find "$1" -type l -name "*.gz" | while read LINE; do + LINK="$(readlink "$LINE" | sed -r 's/.gz$//')" + FILE="$(echo "$LINE" | sed -r 's/.gz$//')" + ln -sfn "$LINK" "$FILE" + rm -f "$LINE" + done + find "$1" -type f -name "*.gz" | xargs -r gunzip +} + +uncompress_files /etc/alternatives +uncompress_files /usr/share/man + +# remove broken links +# $1 = search directory +remove_broken_links() +{ + find "$1" -type l -exec test ! -e {} \; -print | xargs rm -vf +} + +remove_broken_links /etc/alternatives +remove_broken_links /usr/share/man + + diff --git a/linux-live/modules/02-xorg/install b/linux-live/modules/02-xorg/install new file mode 100644 index 0000000..29e9948 --- /dev/null +++ b/linux-live/modules/02-xorg/install @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e # exit on error +set -o pipefail # exit on pipeline error +set -u # treat unset variable as error + +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" + +# install packages +if [ -f $SCRIPT_DIR/package.list ]; then + #sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD update >>$OUTPUT 2>&1 && + #sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD install $APT_OPTIONS $APT_OPTIONS2 \ + $(grep -vE "^\s*#" $SCRIPT_DIR/package.list | tr "\n" " ") >>$OUTPUT 2>&1 +fi diff --git a/linux-live/modules/02-xorg/package.list b/linux-live/modules/02-xorg/package.list new file mode 100755 index 0000000..5b401b4 --- /dev/null +++ b/linux-live/modules/02-xorg/package.list @@ -0,0 +1,14 @@ +xserver-xorg +xserver-xorg-video-all +xserver-xorg-video-intel +xinit +xterm +blackbox +libxcursor1 +breeze-cursor-theme +x11-utils +wmctrl +xdotool +libdrm-intel1 +libgl1-mesa-dri +libglu1-mesa \ No newline at end of file diff --git a/linux-live/modules/02-xorg/postinstall b/linux-live/modules/02-xorg/postinstall new file mode 100644 index 0000000..a14863e --- /dev/null +++ b/linux-live/modules/02-xorg/postinstall @@ -0,0 +1,122 @@ +#!/bin/bash + +# Set setuid bit on xorg binary, so it can be started by guest user +chmod u+s /usr/lib/xorg/Xorg + +# use only white cursors. There were some troubles if the other cursors +# was left behind, installing gtk apps reverted the cursor from white to gray, +# so we're going to nuke it to leave only Snow cursors active. +rm -Rf /usr/share/icons/breeze_cursors +mv /usr/share/icons/Breeze_Snow /usr/share/icons/breeze_cursors + +(cd rootcopy && cp --parents -afr * /) + +# install x11 server utils, apt-get would add cpp dependency, bullshit! +cd /tmp +apt-get download x11-xserver-utils +dpkg -x x11-xserver-utils*.deb /tmp/x11utils +cd /tmp/x11utils +cp -aR * / + +update-alternatives --set x-terminal-emulator /usr/bin/xterm + +apt-get remove --yes vim* grub* debconf-i18n installation-report + +CWD="$(pwd)" +cd /tmp +apt-get download acpi-support +dpkg -x acpi-support*.deb /tmp/acpisupport +cd /tmp/acpisupport +cp -aR * / +cd "$CWD" + +rm -f /etc/fstab +rm -f /etc/mtab +rm -f /etc/apt/sources.list~ +rm -Rf /etc/systemd/system/timers.target.wants +rm -f /etc/systemd/system/multi-user.target.wants/ssh.service +rm -f /etc/systemd/system/multi-user.target.wants/dnsmasq.service + +rm -f /etc/ssh/ssh_host* + +rm -f /var/backups/* +rm -f /var/cache/ldconfig/* +rm -f /var/cache/debconf/* +rm -f /var/cache/fontconfig/* +rm -f /var/lib/apt/extended_states +rm -f /var/lib/systemd/random-seed +rm -f /var/lib/apt/lists/deb.* +rm -Rf /root/.local/share/mc +rm -Rf /root/.cache +rm -f /root/.wget-hsts + +rm -f /var/lib/dpkg/*-old +rm -f /var/log/* +rm -f /var/log/*/* +rm -f /var/log/*/*/* +rm -f /var/cache/apt/archives/*.deb +rm -f /var/cache/apt/*.bin +rm -f /var/cache/debconf/*-old +rm -f /var/lib/dhcp/dhclient.leases +rm -f /root/.bash_history +rm -f /root/.wget-hsts +rm -Rf /usr/share/doc/* +rm -Rf /usr/share/info/* +rm -f /usr/share/images/fluxbox/debian-squared.jpg +rm -Rf /usr/share/fluxbox/nls/??* +rm -Rf /usr/share/gnome/help + +rm -Rf /usr/share/locale/?? +rm -Rf /usr/share/locale/??_* +rm -Rf /usr/share/locale/??@* +rm -Rf /usr/share/locale/??? +rm -Rf /usr/share/i18n/locales/*_* +rm -Rf /usr/share/man/?? +rm -Rf /usr/share/man/*_* + +rm -Rf /usr/share/icons/elementaryXubuntu-dark +rm -Rf /usr/share/icons/gnome/256x256 + +rm /usr/share/applications/compton.desktop +rm /usr/share/applications/debian-uxterm.desktop +rm /usr/share/applications/debian-xterm.desktop +rm /usr/share/applications/htop.desktop +rm /usr/share/applications/mc.desktop +rm /usr/share/applications/mcedit.desktop +rm /usr/share/applications/pcmanfm-desktop-pref.desktop +rm /usr/share/applications/python2.7.desktop +rm /usr/share/applications/python3.7.desktop +rm /usr/share/applications/vim.desktop + + + +# Unzip gzipped files (man pages), so LZMA can compress 2times better. +# First we fix symlinks, then uncompress files +# $1 = search directory +uncompress_files() +{ + local LINK LINE + + find "$1" -type l -name "*.gz" | while read LINE; do + LINK="$(readlink "$LINE" | sed -r 's/.gz$//')" + FILE="$(echo "$LINE" | sed -r 's/.gz$//')" + ln -sfn "$LINK" "$FILE" + rm -f "$LINE" + done + find "$1" -type f -name "*.gz" | xargs -r gunzip +} + +uncompress_files /etc/alternatives +uncompress_files /usr/share/man + +# remove broken links +# $1 = search directory +remove_broken_links() +{ + find "$1" -type l -exec test ! -e {} \; -print | xargs rm -vf +} + +remove_broken_links /etc/alternatives +remove_broken_links /usr/share/man + + diff --git a/linux-live/modules/02-xorg/rootcopy/etc/systemd/system/display-manager.service b/linux-live/modules/02-xorg/rootcopy/etc/systemd/system/display-manager.service new file mode 120000 index 0000000..d31ece8 --- /dev/null +++ b/linux-live/modules/02-xorg/rootcopy/etc/systemd/system/display-manager.service @@ -0,0 +1 @@ +/lib/systemd/system/xorg.service \ No newline at end of file diff --git a/linux-live/modules/02-xorg/rootcopy/root/.Xresources b/linux-live/modules/02-xorg/rootcopy/root/.Xresources new file mode 100644 index 0000000..2d6d0a3 --- /dev/null +++ b/linux-live/modules/02-xorg/rootcopy/root/.Xresources @@ -0,0 +1,30 @@ +! this are Xresources to make xterm look good +! put into ~/.Xresources +! after changing contents, run xrdb -merge .Xresources +! gentoo has a bug so that it doesnt read it when X starts, so add above +! command to /etc/xfce4/xinitrc (top) and be happy. + +XTerm*foreground: white +XTerm*background: rgb:22/22/22 +XTerm*cursorColor: rgb:00/ff/00 +XTerm*borderColor: black +XTerm*scrollColor: black +XTerm*visualBell: true +XTerm*saveLines: 50000 +XTerm*allowSendEvents: True +XTerm*sessionMgt: false +XTerm*rightScrollBar: true +XTerm*eightBitInput: false +XTerm*faceName:fixed:size=11 +XTerm*boldFont:fixed:size=11 +XTerm*activeIcon: true +XTerm*iconPixmap: /usr/share/icons/locolor/16x16/apps/xterm.xbm +XTerm*fullscreen: never + +Xft.antialias: true +Xft.hinting: true +Xft.hintstyle: hintfull +Xft.lcdfilter: lcdlegacy +Xft.rgba: rgb + +XTerm*selectToClipboard: true diff --git a/linux-live/modules/02-xorg/rootcopy/root/.blackbox-menu b/linux-live/modules/02-xorg/rootcopy/root/.blackbox-menu new file mode 100644 index 0000000..df8a870 --- /dev/null +++ b/linux-live/modules/02-xorg/rootcopy/root/.blackbox-menu @@ -0,0 +1,5 @@ +[begin] ( Menu ) + [exec] (Terminal) { xterm -ls -title Terminal } + [exec] (Web browser) { chromium } + [exit] (Exit) +[end] diff --git a/linux-live/modules/02-xorg/rootcopy/root/.blackboxrc b/linux-live/modules/02-xorg/rootcopy/root/.blackboxrc new file mode 100644 index 0000000..a39f965 --- /dev/null +++ b/linux-live/modules/02-xorg/rootcopy/root/.blackboxrc @@ -0,0 +1,6 @@ +session.screen0.toolbar.widthPercent: 100 +session.screen0.strftimeFormat: %H:%M +session.edgeSnapThreshold: 10 +session.menuFile: /root/.blackbox-menu +session.styleFile: /usr/share/blackbox/styles/Slax +session.changeWorkspaceWithMouseWheel: False diff --git a/linux-live/modules/02-xorg/rootcopy/usr/lib/systemd/system/xorg.service b/linux-live/modules/02-xorg/rootcopy/usr/lib/systemd/system/xorg.service new file mode 100644 index 0000000..98a2f31 --- /dev/null +++ b/linux-live/modules/02-xorg/rootcopy/usr/lib/systemd/system/xorg.service @@ -0,0 +1,7 @@ +[Unit] +Description=X-Window +ConditionKernelCommandLine=!text +After=systemd-user-sessions.service + +[Service] +ExecStart=/bin/su --login -c "/usr/bin/startx -- :0 vt7 -ac -nolisten tcp" diff --git a/linux-live/modules/02-xorg/rootcopy/usr/share/blackbox/styles/Slax b/linux-live/modules/02-xorg/rootcopy/usr/share/blackbox/styles/Slax new file mode 100644 index 0000000..aefe9ef --- /dev/null +++ b/linux-live/modules/02-xorg/rootcopy/usr/share/blackbox/styles/Slax @@ -0,0 +1,79 @@ +*.appearance: flat solid + +*button.pressed.appearance: sunken solid +*button.pressed.backgroundColor: rgb:69/c1/f1 +*button.appearance: parentrelative + +*.focus.backgroundColor: rgb:69/c1/f1 +*.unfocus.backgroundColor: rgb:28/28/28 + +*font: Bitstream Vera Sans-9 + +menu.title.appearance: flat solid +menu.title.backgroundColor: rgb:69/c1/f1 +menu.title.textColor: rgb:28/28/28 +menu.title.alignment: center +menu.title.marginWidth: 6 + +menu.frame.appearance: flat gradient border +menu.frame.textColor: rgb:28/28/28 +menu.frame.foregroundColor: grey40 +menu.frame.borderColor: rgb:69/c1/f1 +menu.frame.borderWidth: 6 +menu.frame.disabledColor: darkgrey +menu.frame.alignment: left +menu.frame.marginWidth: 2 + +menu.active.appearance: flat solid border +menu.active.backgroundColor: rgb:69/c1/f1 +menu.active.borderWidth: 4 +menu.active.borderColor: rgb:69/c1/f1 +menu.active.textColor: rgb:38/38/38 + +rootCommand: bsetroot -solid rgb:77/90/aa + +slit.appearance: raised solid +slit.backgroundColor: rgb:77/90/aa +slit.marginWidth: 3 + +toolbar.appearance: flat gradient border +toolbar.alignment: center +toolbar*textColor: rgb:28/28/28 +toolbar.label.appearance: parentrelative +toolbar.clock.appearance: parentrelative +toolbar.windowLabel.appearance: parentrelative + +window.title.focus.appearance: flat solid +window.title.focus.backgroundColor: rgb:69/c1/f1 +window.title.unfocus.appearance: flat solid +window.title.unfocus.backgroundColor: rgb:d6/d6/d6 +window.title.marginWidth: 5 + +window.label.focus.appearance: parentrelative +window.label.focus.textColor: rgb:28/28/28 +window.label.unfocus.appearance: parentrelative +window.label.unfocus.textColor: rgb:28/28/28 +window.label.marginWidth: 1 + +window.button.focus.appearance: parentrelative +window.button.focus.foregroundColor: white + +window.button.unfocus.appearance: parentrelative +window.button.unfocus.foregroundColor: darkgrey + +window.handle.focus.appearance: flat solid +window.handle.focus.backgroundColor: rgb:69/c1/f1 +window.handle.unfocus.appearance: flat solid +window.handle.unfocus.backgroundColor: rgb:d6/d6/d6 + +window.grip.focus.appearance: flat solid +window.grip.focus.backgroundColor: rgb:69/c1/f1 +window.grip.unfocus.appearance: flat solid +window.grip.unfocus.backgroundColor: rgb:d6/d6/d6 + +window*alignment: center + +window.handleHeight: 7 +window.frame.borderWidth: 7 +window.frame.focus.borderColor: rgb:69/c1/f1 +window.frame.unfocus.borderColor: rgb:d6/d6/d6 diff --git a/linux-live/modules/02-xorg/rootcopy/usr/share/icons/locolor/16x16/apps/xterm.xbm b/linux-live/modules/02-xorg/rootcopy/usr/share/icons/locolor/16x16/apps/xterm.xbm new file mode 100644 index 0000000..0cd329e --- /dev/null +++ b/linux-live/modules/02-xorg/rootcopy/usr/share/icons/locolor/16x16/apps/xterm.xbm @@ -0,0 +1,6 @@ +#define command2_width 16 +#define command2_height 16 +static unsigned char command2_bits[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xe7, 0xff, 0xcf, 0xff, + 0x9f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x9f, 0xff, 0xcf, 0xff, 0xe7, 0xc1, + 0xf7, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; diff --git a/linux-live/modules/03-desktop/cleanup b/linux-live/modules/03-desktop/cleanup new file mode 100644 index 0000000..dd745ec --- /dev/null +++ b/linux-live/modules/03-desktop/cleanup @@ -0,0 +1,91 @@ +#!/bin/bash + +rm -f /etc/fstab +rm -f /etc/mtab +rm -f /etc/apt/sources.list~ +rm -Rf /etc/systemd/system/timers.target.wants +rm -f /etc/systemd/system/multi-user.target.wants/ssh.service +rm -f /etc/systemd/system/multi-user.target.wants/dnsmasq.service + +rm -f /etc/ssh/ssh_host* + +rm -f /var/backups/* +rm -f /var/cache/ldconfig/* +rm -f /var/cache/debconf/* +rm -f /var/cache/fontconfig/* +rm -f /var/lib/apt/extended_states +rm -f /var/lib/systemd/random-seed +rm -f /var/lib/apt/lists/deb.* +rm -Rf /root/.local/share/mc +rm -Rf /root/.cache +rm -f /root/.wget-hsts + +rm -f /var/lib/dpkg/*-old +rm -f /var/log/* +rm -f /var/log/*/* +rm -f /var/log/*/*/* +rm -f /var/cache/apt/archives/*.deb +rm -f /var/cache/apt/*.bin +rm -f /var/cache/debconf/*-old +rm -f /var/lib/dhcp/dhclient.leases +rm -f /root/.bash_history +rm -f /root/.wget-hsts +rm -Rf /usr/share/doc/* +rm -Rf /usr/share/info/* +rm -f /usr/share/images/fluxbox/debian-squared.jpg +rm -Rf /usr/share/fluxbox/nls/??* +rm -Rf /usr/share/gnome/help + +rm -Rf /usr/share/locale/?? +rm -Rf /usr/share/locale/??_* +rm -Rf /usr/share/locale/??@* +rm -Rf /usr/share/locale/??? +rm -Rf /usr/share/i18n/locales/*_* +rm -Rf /usr/share/man/?? +rm -Rf /usr/share/man/*_* + +rm -Rf /usr/share/icons/elementaryXubuntu-dark +rm -Rf /usr/share/icons/gnome/256x256 + +rm /usr/share/applications/compton.desktop +rm /usr/share/applications/debian-uxterm.desktop +rm /usr/share/applications/debian-xterm.desktop +rm /usr/share/applications/htop.desktop +rm /usr/share/applications/mc.desktop +rm /usr/share/applications/mcedit.desktop +rm /usr/share/applications/pcmanfm-desktop-pref.desktop +rm /usr/share/applications/python2.7.desktop +rm /usr/share/applications/python3.7.desktop +rm /usr/share/applications/vim.desktop + + + +# Unzip gzipped files (man pages), so LZMA can compress 2times better. +# First we fix symlinks, then uncompress files +# $1 = search directory +uncompress_files() +{ + local LINK LINE + + find "$1" -type l -name "*.gz" | while read LINE; do + LINK="$(readlink "$LINE" | sed -r 's/.gz$//')" + FILE="$(echo "$LINE" | sed -r 's/.gz$//')" + ln -sfn "$LINK" "$FILE" + rm -f "$LINE" + done + find "$1" -type f -name "*.gz" | xargs -r gunzip +} + +uncompress_files /etc/alternatives +uncompress_files /usr/share/man + +# remove broken links +# $1 = search directory +remove_broken_links() +{ + find "$1" -type l -exec test ! -e {} \; -print | xargs rm -vf +} + +remove_broken_links /etc/alternatives +remove_broken_links /usr/share/man + diff --git a/linux-live/modules/03-desktop/install b/linux-live/modules/03-desktop/install new file mode 100755 index 0000000..adf0c55 --- /dev/null +++ b/linux-live/modules/03-desktop/install @@ -0,0 +1,25 @@ +#!/bin/bash + +CWD=$(dirname $(readlink -f $0)) + +NAME=fluxbox +VERSION=1.3.5 + +# first install stock version + +apt-get update +apt-get install --no-install-recommends --yes \ + $NAME \ + feh \ + compton \ + volumeicon-alsa \ + murrine-themes \ + libnotify4 \ + scrot + +. ./cleanup + +(cd /rootcopy && cp --parents -afr * /) +chown live.users /home/live +chown -R live.users /home/live/.gtkrc-2.0 +chown -R live.users /home/live/.config \ No newline at end of file diff --git a/linux-live/modules/03-desktop/install2 b/linux-live/modules/03-desktop/install2 new file mode 100644 index 0000000..0dc0109 --- /dev/null +++ b/linux-live/modules/03-desktop/install2 @@ -0,0 +1,95 @@ +#!/bin/bash + +CWD=$(dirname $(readlink -f $0)) + +NAME=fluxbox +VERSION=1.3.5 + +cd / + +# create user directories +for dir in Desktop Documents Downloads Music Pictures Public Templates Videos; do + mkdir -p /squashfs-root/home/live/$dir + mkdir -p /squashfs-root/root/$dir +done +chown -R live.users /squashfs-root/home/live + +# then, we want to patch it to implement window resizing! +# so we will recompile whole package + +REBUILD=/tmp/$NAME-rebuild-$$ + +apt-get update +apt-get --yes build-dep $NAME + +mkdir -p $REBUILD +cd $REBUILD + +apt-get source $NAME + +cd $NAME-$VERSION + +cat $CWD/patches/fluxbox-slax.diff > debian/patches/fluxbox-slax.diff +echo fluxbox-slax.diff >> debian/patches/series + +dpkg-buildpackage -us -uc + +rm -Rf debian/$NAME/DEBIAN +rm -Rf debian/$NAME/usr/share/doc +rm -Rf debian/$NAME/usr/share/images + +cp debian/$NAME/usr/bin/fluxbox /squashfs-root/usr/bin + + +# add xlunch from sources +wget -O /tmp/xlunch.tar.gz https://github.com/Tomas-M/xlunch/archive/v4.5.3.tar.gz +cd /tmp +tar -xf xlunch.tar.gz +cd xlunch-4.5.3 +make +cp xlunch /squashfs-root/usr/bin +cp extra/gentriesquick /squashfs-root/usr/bin/xlunch_genquick +mkdir -p /squashfs-root/usr/share/icons/hicolor/48x48/apps/ +cp extra/ghost.png /squashfs-root/usr/share/icons/hicolor/48x48/apps/xlunch_ghost.png + +# add tray icon launcher +wget -O /tmp/systrayiconlauncher.tar.gz https://github.com/Tomas-M/SystrayIconLauncher/archive/master.tar.gz +cd /tmp +tar -xf systrayiconlauncher.tar.gz +cd SystrayIconLauncher-master +apt-get install --yes libgtk2.0-dev +make +cp systrayicon /squashfs-root/usr/bin + + +# add gtkdialog +wget -O /tmp/gtkdialog.tar.gz https://github.com/Tomas-M/GTKdialog/archive/master.tar.gz +cd /tmp +tar -xf gtkdialog.tar.gz +cd GTKdialog-master +make +cp gtkdialog /squashfs-root/usr/bin + + +# battery icon app +cd /tmp +wget https://github.com/valr/cbatticon/archive/1.6.7.tar.gz +tar -xf 1.6.7.tar.gz +cd cbatticon-1.6.7 +cp -R /usr/include/glib-2.0/* /usr/include +cp -R /usr/include/gtk-2.0/* /usr/include +apt install --yes libnotify-dev +sed -i "s/WITH_GTK3 = 1/WITH_GTK3 = 0/" Makefile +CFLAGS="-O2 \ +-I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ \ +-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include/ \ +-I/usr/include/gdk-pixbuf-2.0/ \ +-I/usr/include/atk-1.0/ \ +-I/usr/include/cairo \ +-I/usr/include/pango-1.0 \ +-I/usr/include/glib-2.0 \ +-I/usr/include/gtk-2.0" \ +make +cp cbatticon /squashfs-root/usr/bin + +dir2sb /squashfs-root /03-desktop.sb \ No newline at end of file diff --git a/linux-live/modules/03-desktop/is_internal_build b/linux-live/modules/03-desktop/is_internal_build new file mode 100644 index 0000000..e69de29 diff --git a/linux-live/modules/03-desktop/patches/fluxbox-slax.diff b/linux-live/modules/03-desktop/patches/fluxbox-slax.diff new file mode 100644 index 0000000..e76174e --- /dev/null +++ b/linux-live/modules/03-desktop/patches/fluxbox-slax.diff @@ -0,0 +1,97 @@ +--- a/src/Window.cc 2013-02-13 05:04:05.000000000 -0500 ++++ b/src/Window.cc 2017-11-05 17:31:37.516503305 -0500 +@@ -2745,6 +2745,14 @@ + m_button_grab_x = x - frame().x() - frame().window().borderWidth(); + m_button_grab_y = y - frame().y() - frame().window().borderWidth(); + ++ // If mouse clicked on the border, start window resize instead of move ++ if (m_button_grab_x <= 0 || m_button_grab_x >= (int)frame().window().width() ++ || m_button_grab_y >= (int)frame().window().height() ) { ++ ReferenceCorner dir = getResizeDirection(m_button_grab_x,m_button_grab_y,EDGEORCORNERRESIZE,frame().window().borderWidth(),frame().window().borderWidth()); ++ startResizing(m_button_grab_x, m_button_grab_y, dir); ++ return; ++ } ++ + moving = true; + + Fluxbox *fluxbox = Fluxbox::instance(); +@@ -2752,7 +2760,7 @@ + // freely map and unmap the window we're moving. + grabPointer(screen().rootWindow().window(), False, ButtonMotionMask | + ButtonReleaseMask, GrabModeAsync, GrabModeAsync, +- screen().rootWindow().window(), frame().theme()->moveCursor(), CurrentTime); ++ screen().rootWindow().window(), None, CurrentTime); + + if (menu().isVisible()) + menu().hide(); +--- a/src/FbTk/FbDrawable.hh ++++ b/src/FbTk/FbDrawable.hh +@@ -52,7 +52,8 @@ public: + LEFT, + RIGHT, + UP, +- DOWN ++ DOWN, ++ MENU + }; + + // x, y, width and height define a space within which we're drawing a triangle +--- a/src/ToolFactory.cc 2013-02-13 05:04:05.000000000 -0500 ++++ b/src/ToolFactory.cc 2017-10-31 12:11:20.000000000 -0400 +@@ -101,6 +101,8 @@ + cmd_str += " (workspace=[current])"; + } + ++ if (name.find("menu") != std::string::npos) cmd_str = "Exec fbappselect"; ++ + FbTk::RefCount > cmd(FbTk::CommandParser::instance().parse(cmd_str)); + if (cmd == 0) // we need a command + return 0; +@@ -110,6 +112,9 @@ + if (name.find("prev") != std::string::npos) + arrow_type = FbTk::FbDrawable::LEFT; + ++ if (name.find("menu") != std::string::npos) ++ arrow_type = FbTk::FbDrawable::MENU; ++ + ArrowButton *win = new ArrowButton(arrow_type, parent, + 0, 0, + button_size, button_size); +--- a/src/FbTk/FbDrawable.cc 2017-10-19 06:06:08.000000000 -0400 ++++ a/src/FbTk/FbDrawable.cc 2017-10-19 06:06:57.013131070 -0400 +@@ -96,7 +96,7 @@ + if (drawable() == 0 || gc == 0 || width == 0 || height == 0) + return; + +- XPoint pts[3]; ++ XPoint pts[4]; + + if (scale < 100) scale = 100; // not bigger than the space allowed + else if (scale > 10000) scale = 10000; // not too small... +@@ -115,6 +115,26 @@ + } + + switch (type) { ++ case FbTk::FbDrawable::MENU: ++ { ++ int s=7; int m=2; int d=2; int sh=-1; //size margin distance ++ pts[0].x=m+sh; pts[0].y=m+sh; pts[1].x=m+s+sh; pts[1].y=m+sh; ++ pts[2].x=m+s+sh; pts[2].y=m+s+sh; pts[3].x=m+sh; pts[3].y=m+s+sh; ++ fillPolygon(gc, pts, 4, Convex, CoordModeOrigin); ++ ++ pts[0].x=m+s+d+sh; pts[0].y=m+sh; pts[1].x=m+s+d+s+sh; pts[1].y=m+sh; ++ pts[2].x=m+s+d+s+sh; pts[2].y=m+s+sh; pts[3].x=m+s+d+sh; pts[3].y=m+s+sh; ++ fillPolygon(gc, pts, 4, Convex, CoordModeOrigin); ++ ++ pts[0].x=m+sh; pts[0].y=m+s+d+sh; pts[1].x=m+s+sh; pts[1].y=m+s+d+sh; ++ pts[2].x=m+s+sh; pts[2].y=m+s+d+s+sh; pts[3].x=m+sh; pts[3].y=m+s+d+s+sh; ++ fillPolygon(gc, pts, 4, Convex, CoordModeOrigin); ++ ++ pts[0].x=m+s+d+sh; pts[0].y=m+s+d+sh; pts[1].x=m+s+d+s+sh; pts[1].y=m+s+d+sh; ++ pts[2].x=m+s+d+s+sh; pts[2].y=m+s+d+s+sh; pts[3].x=m+s+d+sh; pts[3].y=m+s+d+s+sh; ++ fillPolygon(gc, pts, 4, Convex, CoordModeOrigin); ++ return; ++ } + case FbTk::FbDrawable::LEFT: + // start at the tip + pts[0].x = (width / 2) - (ax / 2); pts[0].y = height / 2; diff --git a/linux-live/modules/03-desktop/rootcopy/etc/xlunch/entries.dsv b/linux-live/modules/03-desktop/rootcopy/etc/xlunch/entries.dsv new file mode 100644 index 0000000..c5bce20 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/etc/xlunch/entries.dsv @@ -0,0 +1,4 @@ +Terminal;/usr/share/icons/hicolor/128x128/apps/terminal.png;xterm -title Terminal +Web Browser;/usr/share/icons/hicolor/128x128/apps/chromium.png;chromium +Text Editor;/usr/share/icons/hicolor/128x128/apps/editor.png;leafpad +Calculator;/usr/share/icons/hicolor/128x128/apps/calculator.png;qalculate diff --git a/linux-live/modules/03-desktop/rootcopy/etc/xlunch/logout.dsv b/linux-live/modules/03-desktop/rootcopy/etc/xlunch/logout.dsv new file mode 100644 index 0000000..40a9f82 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/etc/xlunch/logout.dsv @@ -0,0 +1,3 @@ +Logout;/usr/share/icons/hicolor/128x128/actions/logout.png;logout +Restart;/usr/share/icons/hicolor/128x128/actions/restart.png;restart +Shut down;/usr/share/icons/hicolor/128x128/actions/shutdown.png;shutdown diff --git a/linux-live/modules/03-desktop/rootcopy/home/live/.config/chromium/Default/Preferences b/linux-live/modules/03-desktop/rootcopy/home/live/.config/chromium/Default/Preferences new file mode 100644 index 0000000..5bfddb0 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/home/live/.config/chromium/Default/Preferences @@ -0,0 +1,38 @@ +{ + "AudioCaptureAllowed": false, + "account_id_migration_state": 2, + "account_tracker_service_last_update": "13154004704520013", + "alternate_error_pages": { + "enabled": false + }, + "bookmark_bar": { + "show_on_all_tabs": false + }, + "browser": { + "check_default_browser": false, + "has_seen_welcome_page": true, + "show_home_button": false, + "window_placement": { + "bottom": 10, + "left": 10, + "maximized": true, + "right": 10, + "top": 10 + } + }, + "extensions": { + "theme": { + "use_system": true + } + }, + "ntp": { + "most_visited_blacklist": { + "c8e0afd1da1d9e29511240861f795a5a": null, + "eacc8c3ad0b50bd698ef8752d5ee24b6": null + } + }, + "safebrowsing": { + "enabled": false, + "scout_group_selected": true + } +} \ No newline at end of file diff --git a/linux-live/modules/03-desktop/rootcopy/home/live/.config/chromium/First Run b/linux-live/modules/03-desktop/rootcopy/home/live/.config/chromium/First Run new file mode 100644 index 0000000..e69de29 diff --git a/linux-live/modules/03-desktop/rootcopy/home/live/.gtkrc-2.0 b/linux-live/modules/03-desktop/rootcopy/home/live/.gtkrc-2.0 new file mode 100644 index 0000000..96f0cb2 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/home/live/.gtkrc-2.0 @@ -0,0 +1 @@ +include "/usr/share/themes/MurrinaChrome/gtk-2.0/gtkrc" diff --git a/linux-live/modules/03-desktop/rootcopy/root/.config/volumeicon/volumeicon b/linux-live/modules/03-desktop/rootcopy/root/.config/volumeicon/volumeicon new file mode 100644 index 0000000..80e3cc8 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.config/volumeicon/volumeicon @@ -0,0 +1,19 @@ +[StatusIcon] +stepsize=5 +lmb_slider=false +mmb_mute=false +use_horizontal_slider=false +show_sound_level=false +onclick=xterm -e 'alsamixer' +theme=White Gnome + +[Hotkeys] +up_enabled=true +down_enabled=true +mute_enabled=true +up=XF86AudioRaiseVolume +down=XF86AudioLowerVolume +mute=XF86AudioMute + +[Alsa] +card=default diff --git a/linux-live/modules/03-desktop/rootcopy/root/.config/xarchiver/xarchiverrc b/linux-live/modules/03-desktop/rootcopy/root/.config/xarchiver/xarchiverrc new file mode 100644 index 0000000..f65e2a5 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.config/xarchiver/xarchiverrc @@ -0,0 +1,20 @@ +[xarchiver] +preferred_format=0 +confirm_deletion=true +sort_filename_content=false +store_output=false +icon_size=0 +show_archive_comment=false +show_sidebar=false +show_location_bar=false +preferred_temp_dir=/tmp +allow_sub_dir=0 +overwrite=false +full_path=true +touch=false +freshen=false +update=false +store_path=false +recurse=true +solid_archive=false +remove_files=false diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/apps b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/apps new file mode 100644 index 0000000..347fd3c --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/apps @@ -0,0 +1,18 @@ +[app] (name=fbrun) + [Position] (WINCENTER) {0 0} + [Layer] {2} +[end] + +[app] (name=gtkdialog) + [Position] (WINCENTER) {0 0} + [Layer] {2} +[end] + +[app] (name=xlunch) + [DECO] {NONE} + [IconHidden] {yes} +[end] + +[app] (name=xterm) {1} + [Position] (WINCENTER) {0 0} +[end] diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/fbrun_history b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/fbrun_history new file mode 100644 index 0000000..e69de29 diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/init b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/init new file mode 100644 index 0000000..66de046 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/init @@ -0,0 +1,76 @@ +session.screen0.slit.maxOver: false +session.screen0.slit.placement: TopLeft +session.screen0.slit.layer: Dock +session.screen0.slit.onhead: 0 +session.screen0.slit.acceptKdeDockapps: true +session.screen0.slit.alpha: 255 +session.screen0.slit.autoHide: false +session.screen0.menu.alpha: 255 +session.screen0.clientMenu.usePixmap: true +session.screen0.tab.placement: TopLeft +session.screen0.tab.width: 64 +session.screen0.toolbar.maxOver: false +session.screen0.toolbar.tools: RootMenu, iconbar, systemtray, clock +session.screen0.toolbar.autoHide: false +session.screen0.toolbar.widthPercent: 100 +session.screen0.toolbar.alpha: 255 +session.screen0.toolbar.visible: true +session.screen0.toolbar.placement: BottomCenter +session.screen0.toolbar.layer: Dock +session.screen0.toolbar.height: 0 +session.screen0.toolbar.onhead: 1 +session.screen0.tabs.usePixmap: true +session.screen0.tabs.maxOver: true +session.screen0.tabs.intitlebar: true +session.screen0.window.focus.alpha: 255 +session.screen0.window.unfocus.alpha: 255 +session.screen0.iconbar.usePixmap: true +session.screen0.iconbar.alignment: Left +session.screen0.iconbar.iconTextPadding: 10 +session.screen0.iconbar.mode: {static groups} (workspace) +session.screen0.iconbar.iconWidth: 128 +session.screen0.titlebar.left: +session.screen0.titlebar.right: Minimize Maximize Close +session.screen0.clickRaises: true +session.screen0.maxIgnoreIncrement: false +session.screen0.workspacewarping: true +session.screen0.colPlacementDirection: TopToBottom +session.screen0.maxDisableMove: false +session.screen0.rowPlacementDirection: LeftToRight +session.screen0.focusNewWindows: true +session.screen0.autoRaise: true +session.screen0.opaqueMove: true +session.screen0.maxDisableResize: false +session.screen0.tabFocusModel: ClickToTabFocus +session.screen0.tooltipDelay: 500 +session.screen0.fullMaximization: false +session.screen0.noFocusWhileTypingDelay: 0 +session.screen0.strftimeFormat: %H:%M +session.screen0.workspaces: 4 +session.screen0.allowRemoteActions: false +session.screen0.focusModel: ClickFocus +session.screen0.windowMenu: /root/.fluxbox/windowmenu +session.screen0.workspaceNames: Workspace 1 Ctrl+F1,Workspace 2 Ctrl+F2,Workspace 3 Ctrl+F3,Workspace 4 Ctrl+F4, +session.screen0.edgeSnapThreshold: 10 +session.screen0.showwindowposition: false +session.screen0.defaultDeco: NORMAL +session.screen0.menuDelay: 200 +session.screen0.windowPlacement: RowMinOverlapPlacement +session.screen0.focusSameHead: false +session.screen0.workspacewarping: false +session.keyFile: ~/.fluxbox/keys +session.menuFile: ~/.fluxbox/menu +session.styleFile: /usr/share/fluxbox/styles/Slax +session.colorsPerChannel: 4 +session.forcePseudoTransparency: true +session.ignoreBorder: false +session.doubleClickInterval: 250 +session.appsFile: /root/.fluxbox/apps +session.tabPadding: 0 +session.cacheLife: 5 +session.cacheMax: 200 +session.styleOverlay: /root/.fluxbox/overlay +session.autoRaiseDelay: 250 +session.slitlistFile: /root/.fluxbox/slitlist +session.tabsAttachArea: Window +session.configVersion: 13 diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/kblayout b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/kblayout new file mode 100644 index 0000000..c574d07 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/kblayout @@ -0,0 +1 @@ +en diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/keys b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/keys new file mode 100644 index 0000000..fd2b8c1 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/keys @@ -0,0 +1,139 @@ +# click on the desktop to get menus +OnDesktop Mouse1 :MacroCmd {WindowMenu} {HideMenus} +OnDesktop Mouse2 :WorkspaceMenu +OnDesktop Mouse3 :RootMenu + +# scroll on the desktop to change workspaces +#OnDesktop Mouse4 :PrevWorkspace +#OnDesktop Mouse5 :NextWorkspace + +# scroll on the toolbar to change current window +#OnToolbar Mouse4 :PrevWindow {static groups} (iconhidden=no) +#OnToolbar Mouse5 :NextWindow {static groups} (iconhidden=no) + +# alt + left/right click to move/resize a window +OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving} +OnWindowBorder Move1 :StartMoving + +OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner} +OnLeftGrip Move1 :StartResizing bottomleft +OnRightGrip Move1 :StartResizing bottomright + +# alt + middle click to lower the window +OnWindow Mod1 Mouse2 :Lower + +# control-click a window's titlebar and drag to attach windows +OnTitlebar Control Mouse1 :StartTabbing + +# double click on the titlebar to shade +OnTitlebar Double Mouse1 :Maximize + +# left click on the titlebar to move the window +OnTitlebar Mouse1 :MacroCmd {Raise} {Focus} {ActivateTab} {StartMoving} +OnTitlebar Move1 :StartMoving + +# middle click on the titlebar to lower +OnTitlebar Mouse2 :Lower + +# right click on the titlebar for a menu of options +OnTitlebar Mouse3 :WindowMenu + +# alt-tab +Mod1 Tab :NextWindow {groups} (workspace=[current]) +Mod1 Shift Tab :PrevWindow {groups} (workspace=[current]) + +# cycle through tabs in the current window +Mod4 Tab :NextTab +Mod4 Shift Tab :PrevTab + +# go to a specific tab in the current window +Mod4 1 :Tab 1 +Mod4 2 :Tab 2 +Mod4 3 :Tab 3 +Mod4 4 :Tab 4 +Mod4 5 :Tab 5 +Mod4 6 :Tab 6 +Mod4 7 :Tab 7 +Mod4 8 :Tab 8 +Mod4 9 :Tab 9 + +# open a terminal +Mod1 F1 :Exec xterm + +# open a dialog to run programs +Mod1 F2 :Exec fbappselect + +# volume settings, using common keycodes +# if these don't work, use xev to find out your real keycodes +176 :Exec amixer sset Master,0 1+ +174 :Exec amixer sset Master,0 1- +160 :Exec amixer sset Master,0 toggle + +# current window commands +Mod1 F4 :Close +Mod1 F5 :Kill +Mod1 F9 :Minimize +Mod1 F10 :Maximize +Mod1 F11 :Fullscreen + +# open the window menu +Mod1 space :WindowMenu + +# exit fluxbox +Control Mod1 Delete :Exit + +# change to previous/next workspace +Control Mod1 Left :PrevWorkspace +Control Mod1 Right :NextWorkspace + +# send the current window to previous/next workspace +Mod4 Left :SendToPrevWorkspace +Mod4 Right :SendToNextWorkspace + +# send the current window and follow it to previous/next workspace +Control Mod4 Left :TakeToPrevWorkspace +Control Mod4 Right :TakeToNextWorkspace + +# change to a specific workspace +Control F1 :Workspace 1 +Control F2 :Workspace 2 +Control F3 :Workspace 3 +Control F4 :Workspace 4 +Control F5 :Workspace 5 +Control F6 :Workspace 6 +Control F7 :Workspace 7 +Control F8 :Workspace 8 +Control F9 :Workspace 9 +Control F10 :Workspace 10 +Control F11 :Workspace 11 +Control F12 :Workspace 12 + +# send the current window to a specific workspace +Mod4 F1 :SendToWorkspace 1 +Mod4 F2 :SendToWorkspace 2 +Mod4 F3 :SendToWorkspace 3 +Mod4 F4 :SendToWorkspace 4 +Mod4 F5 :SendToWorkspace 5 +Mod4 F6 :SendToWorkspace 6 +Mod4 F7 :SendToWorkspace 7 +Mod4 F8 :SendToWorkspace 8 +Mod4 F9 :SendToWorkspace 9 +Mod4 F10 :SendToWorkspace 10 +Mod4 F11 :SendToWorkspace 11 +Mod4 F12 :SendToWorkspace 12 + +# send the current window and change to a specific workspace +Control Mod4 F1 :TakeToWorkspace 1 +Control Mod4 F2 :TakeToWorkspace 2 +Control Mod4 F3 :TakeToWorkspace 3 +Control Mod4 F4 :TakeToWorkspace 4 +Control Mod4 F5 :TakeToWorkspace 5 +Control Mod4 F6 :TakeToWorkspace 6 +Control Mod4 F7 :TakeToWorkspace 7 +Control Mod4 F8 :TakeToWorkspace 8 +Control Mod4 F9 :TakeToWorkspace 9 +Control Mod4 F10 :TakeToWorkspace 10 +Control Mod4 F11 :TakeToWorkspace 11 +Control Mod4 F12 :TakeToWorkspace 12 + +Print :Exec fbprintscreen diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/lastwallpaper b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/lastwallpaper new file mode 100644 index 0000000..686a294 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/lastwallpaper @@ -0,0 +1 @@ +fbsetroot|-foreground #7790aa -solid #7790aa|style|:0.0 diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/menu b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/menu new file mode 100644 index 0000000..f55cc8f --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/menu @@ -0,0 +1,68 @@ +[begin] (Desktop menu) + [exec] (Terminal) { fbstartupnotify && xterm -ls } + [exec] (File Manager) { fbstartupnotify && pcmanfm } + [exec] (Web Browser) { fbstartupnotify && fbliveapp chromium } + [exec] (Text Editor) { fbstartupnotify && leafpad } + [exec] (Calculator) { fbstartupnotify && qalculate } + [exec] (Network Manager) { fbstartupnotify && wicd-manager } + [exec] (Run) { fbappselect } + [separator] + [workspaces] (Workspaces ...) + [submenu] (Screen resolution ...) {} + [include] (~/.fluxbox/menu_resolution) + [end] + [submenu] (Keyboard layout ...) {} + [exec] (Czech) { fbsetkb cz } + [exec] (English) { fbsetkb us } + [exec] (French) { fbsetkb fr } + [exec] (German) { fbsetkb de } + [exec] (Italian) { fbsetkb it } + [exec] (Polish) { fbsetkb pl } + [exec] (Portuguese) { fbsetkb pt } + [exec] (Russian) { fbsetkb ru } + [exec] (Slovak) { fbsetkb sk } + [exec] (Spanish) { fbsetkb es } + [exec] (Ukrainian) { fbsetkb ua } + [submenu] (Other ...) {} + [exec] (Afghani) { fbsetkb af } + [exec] (Albanian) { fbsetkb al } + [exec] (Arabic [Morocco]) { fbsetkb ma } + [exec] (Arabic) { fbsetkb ara } + [exec] (Armenian) { fbsetkb am } + [exec] (Azerbaijani) { fbsetkb az } + [exec] (Belarusian) { fbsetkb by } + [exec] (Belgian) { fbsetkb be } + [exec] (Berber [Algeria]) { fbsetkb dz } + [exec] (Bosnian) { fbsetkb ba } + [exec] (Brasil) { fbsetkb br } + [exec] (Bulgarian) { fbsetkb bg } + [exec] (Croatian) { fbsetkb hr } + [exec] (Danish) { fbsetkb dk } + [exec] (Dutch) { fbsetkb nl } + [exec] (English [Australian]) { fbsetkb au } + [exec] (Estonian) { fbsetkb ee } + [exec] (Finnish) { fbsetkb fi } + [exec] (French [Canada]) { fbsetkb ca } + [exec] (German [Austria]) { fbsetkb at } + [exec] (German [Switzerland]) { fbsetkb ch } + [exec] (Greek) { fbsetkb gr } + [exec] (Hebrew) { fbsetkb il } + [exec] (Hungarian) { fbsetkb hu } + [exec] (Icelandic) { fbsetkb is } + [exec] (Indian) { fbsetkb in } + [exec] (Iraqi) { fbsetkb iq } + [exec] (Irish) { fbsetkb ie } + [exec] (Latvian) { fbsetkb lv } + [exec] (Lithuanian) { fbsetkb lt } + [exec] (Norwegian) { fbsetkb no } + [exec] (Persian) { fbsetkb ir } + [exec] (Romanian) { fbsetkb ro } + [exec] (Serbian) { fbsetkb rs } + [exec] (Slovenian) { fbsetkb si } + [exec] (Swedish) { fbsetkb se } + [exec] (Turkish) { fbsetkb tr } + [end] + [end] + [exec] (Exit / Logout) { fblogout } + +[end] diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/overlay b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/overlay new file mode 100644 index 0000000..bb4e91c --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/overlay @@ -0,0 +1,2 @@ +! The following line will prevent styles from setting the background. +! background: none diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/slitlist b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/slitlist new file mode 100644 index 0000000..e69de29 diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/startup b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/startup new file mode 100644 index 0000000..fcf7527 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/startup @@ -0,0 +1,111 @@ +#!/bin/sh +# +# fluxbox startup-script: +# +# Lines starting with a '#' are ignored. + +# Change your keymap: +xmodmap "/root/.Xmodmap" + +# merge xresource settings +xrdb -merge ~/.Xresources + +# set keyboard layout +fbsetkb $(cat ~/.fluxbox/kblayout) + +# setup bookmarks for file manager +gtk-bookmarks-update + +# Share common directories with guest user. This is necessary +# because some apps like chromium must be running under guest +for dir in Desktop Documents Downloads Music Pictures Public Templates Videos; do + if ! mountpoint /root/$dir; then + mount --bind /home/live/$dir /root/$dir + fi +done + +# set background color and big wait mouse cursor +xsetroot -solid '#111111' +xsetroot -xcf /usr/share/icons/breeze_cursors/cursors/watch 37 + +# disable screen blanking +xset s off +xset -dpms + +# volume icon in system tray. Can fail if no soundcard is detected +volumeicon & + +# preload compton and fluxbox to cache +(compton --help; fluxbox --help) >/dev/null 2>&1 + +# Keep black screen for first second while the sound plays. +# This slows startup a little, but it is nicer effect. +SND=/usr/share/sounds/startup.wav +if [ -r $SND ]; then + cat $SND > /dev/null # preload + aplay $SND & + sleep 1 & + SOUNDPID=$! +fi + +# Debian-local change: +# - fbautostart has been added with a quick hack to check to see if it +# exists. If it does, we'll start it up by default. +which fbautostart > /dev/null +if [ $? -eq 0 ]; then + fbautostart +fi + +# We need to postpone compton after fluxbox starts, else it won't set +# the transparency of toolbar properly... So we check the fehbg file, +# which is created by fluxbox at the phase when it sets background. +# Once the file exist, fluxbox-toolbar is already started + +SIGNAL1=~/.fehbg +SIGNAL2=~/.fehbg2 + +rm -f $SIGNAL1 2>/dev/null +rm -f $SIGNAL2 2>/dev/null + +( + while [ ! -e $SIGNAL1 ]; do + sleep 0.1 + done + touch $SIGNAL2 + + (sleep 1; (echo; sleep 10; echo :quit) | xlunch --window --xposition 20 --yposition -30 \ + --width 195 --height 53 --noscroll --noprompt --backgroundcolor ffffff00 \ + --multiple --desktop --button "/usr/share/fluxbox/styles/Slax/pixmaps/start-here.png;;0,0;fbappselect" & ) & + + exec compton --sw-opti -e 0.9 --shadow-exclude 'class_g="xlunch-windowed"' --fade-exclude 'role*="fluxbox-toolbar"' --opacity-rule '70:role*="fluxbox-toolbar"' --no-fading-destroyed-argb -D 5 -c -f -l -2 -t -2 -r 0 -o 1 -z --shadow-exclude 'bounding_shaped' +) & + +# We want to run systrayicon only after the volumeicon is started +# So we have to wait until it is visible to xwinfo +# We also wait after background is set and compton is started +( + while [ ! -e $SIGNAL2 ]; do + sleep 0.1 + done + + rm -f $SIGNAL2 + + while ! xwininfo -name volumeicon >/dev/null 2>&1 && pgrep volumeicon >/dev/null 2>&1; do + sleep 0.1 + done + + exec systrayicon --command fblogout --iconfile /usr/share/icons/locolor/16x16/actions/system-shutdown-symbolic.png +) & + +# gen screen resolutions to fluxbox menu +xrandr 2>/dev/null | fgrep x | fgrep . | sort -n | tr -s " " | cut -d " " -f 2 \ +| sed -r "s:(.*):[exec] (\\1) {fbscreensize \\1}:" > ~/.fluxbox/menu_resolution + +# In all cases, wait for the sound sleeper. +# If startup took longer (sound completed already), no extra wait +wait $SOUNDPID + +# And last but not least we start fluxbox. +# Because it is the last app you have to run it with ''exec'' before it. + +exec fluxbox diff --git a/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/windowmenu b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/windowmenu new file mode 100644 index 0000000..d867b64 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.fluxbox/windowmenu @@ -0,0 +1,15 @@ +[begin] + [shade] + [stick] + [maximize] + [iconify] + [raise] + [lower] + [settitledialog] + [sendto] + [layer] + [alpha] + [extramenus] + [separator] + [close] +[end] diff --git a/linux-live/modules/03-desktop/rootcopy/root/.gtkrc-2.0 b/linux-live/modules/03-desktop/rootcopy/root/.gtkrc-2.0 new file mode 100644 index 0000000..96f0cb2 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.gtkrc-2.0 @@ -0,0 +1 @@ +include "/usr/share/themes/MurrinaChrome/gtk-2.0/gtkrc" diff --git a/linux-live/modules/03-desktop/rootcopy/root/.xinitrc b/linux-live/modules/03-desktop/rootcopy/root/.xinitrc new file mode 100644 index 0000000..22df2f4 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/root/.xinitrc @@ -0,0 +1 @@ +startfluxbox diff --git a/linux-live/modules/03-desktop/rootcopy/usr/bin/fbappselect b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbappselect new file mode 100755 index 0000000..4221ef7 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbappselect @@ -0,0 +1,39 @@ +#!/bin/bash + +COMMAND=$( + xlunch_genquick 64 --desktop | \ + xlunch --border 7% --sideborder 10% --borderratio 100 --sideborderratio 50 \ + --background /usr/share/wallpapers/slax_wallpaper.jpg --font DejaVuSans/11 \ + --voidclickterminate --iconpadding 40 --textpadding 10 \ + --leastmargin 6 --hidemissing --iconsize 64 \ + --highlight /usr/share/icons/hicolor/128x128/apps/xlunch_highlight.png \ + --outputonly +) + +if [ "$COMMAND" = "" ]; then + exit +fi + +fbstartupnotify + +# if command is a .desktop file, parse it +if [[ "$COMMAND" =~ \.desktop ]]; then + NoTerm="$(cat "$COMMAND" | grep Terminal\\s*= | grep -i "Terminal\\s*=\\s*false")" + COMMAND="$(cat "$COMMAND" | grep Exec\\s*= | head -n 1 | sed -r s/.*=// | sed -r "s/%[^%]+//g")" +fi + +cmd="$(echo $COMMAND | sed -r "s/\\s.*//")" +whi="$(which $cmd | head -n 1)" +Xdep=$(ldd $whi | grep libX11) +Ndep=$(ldd $whi | grep libncurses) + +WAIT='echo "--------------------------------------------------"; read -n 1 -s -r -p "Command finished. Press any key to close window..."' +if [ "$Ndep" != "" -o "$cmd" = "man" -o "$cmd" = "mc" ]; then + WAIT="" +fi + +if [ "$Xdep" = "" -a "$cmd" != "chromium" -a "$cmd" != "wicd-manager" -a "$cmd" != "fbliveapp" -a "$NoTerm" = "" ]; then + exec xterm -ls -e bash --login -c -- "echo $USER@$HOSTNAME:$PWD# '$COMMAND'; $COMMAND; $WAIT" +else + exec $COMMAND +fi diff --git a/linux-live/modules/03-desktop/rootcopy/usr/bin/fbliveapp b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbliveapp new file mode 100755 index 0000000..3f417c1 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbliveapp @@ -0,0 +1,83 @@ +#!/bin/bash + +if [ "$1" = "votecoin" ]; then + NAME="VoteCoin Wallet" + ABOUT="VoteCoin Wallet is a crypto currency wallet, +forked from ZCash, which itslef forked from Bitcoin. +It supports fully anonymous transactions and voting. +Receive free 10 VOT coins for installing the wallet. +In the future, VoteCoin will be used for decision +funding in Slax." + TMP="/tmp/votecoin.tar.gz" + EXECUTABLE="/opt/VoteCoin Wallet-linux-x64/VoteCoin Wallet" + INSTALL="wget -O $TMP 'https://votecoin.site/download.php?os=linux' && tar -xf $TMP -C /opt && rm -f $TMP && apt install --yes libxss1 libgconf-2-4 libnss3" + POSTINSTALL="" + ONLY64=true +fi + +if [ "$1" = "vlc" ]; then + NAME="VLC Video Player" + ABOUT="VLC Video Player is a free and open source multimedia player +and framework that plays most multimedia files as well as DVDs, +Audio CDs, CVDs, and various streaming protocols." + EXECUTABLE="/usr/bin/vlc" + INSTALL="apt install --yes vlc" + POSTINSTALL="rm /usr/share/applications/vlc.desktop; mkdir /home/live/.config/vlc; echo '[qt4] +qt-privacy-ask=0' > /home/live/.config/vlc/vlcrc;" + GUEST=true +fi + +if [ "$1" = "chromium" ]; then + NAME="Chromium Web Browser" + ABOUT="Chromium is a free and open source version of +the famous Chrome browser, developed by Google." + EXECUTABLE="/usr/bin/chromium" + INSTALL="apt install --yes chromium chromium-sandbox" + POSTINSTALL="rm -f /usr/share/applications/chromium.desktop" + GUEST=true +fi + +shift + +# ------------------------------------------------ +# do not touch anything below this line +# ------------------------------------------------ + +if [ "$ABOUT" != "" ]; then + ABOUT="$ABOUT + +" +fi + + +if [ "$EXECUTABLE" = "" ]; then + exit +fi + + +if [ ! -f "$EXECUTABLE" ]; then + + if [ $(uname -m) != 'x86_64' -a "$ONLY64" = "true" ]; then + gtkdialog -i /usr/share/icons/gnome/16x16/status/dialog-warning.png -t Error -m "$NAME only works in 64bit version of Slax" -y OK + exit 1 + fi + + if gtkdialog -i /usr/share/icons/gnome/16x16/status/dialog-question.png -t Question -m "$ABOUT$NAME is not yet installed. +Do you like to download and install it now?" -y Yes -n No; then + xterm -ls -e bash --login -c -- "$INSTALL; $POSTINSTALL" + fi +fi + + +if [ -f "$EXECUTABLE" ]; then + + fbstartupnotify + + if [ "$GUEST" = "true" -a "$EUID" -eq 0 ]; then + xhost + >/dev/null 2>/dev/null + exec su -c "$EXECUTABLE "$@"" live + fi + + exec "$EXECUTABLE" "$@" + +fi diff --git a/linux-live/modules/03-desktop/rootcopy/usr/bin/fblogout b/linux-live/modules/03-desktop/rootcopy/usr/bin/fblogout new file mode 100755 index 0000000..02571e1 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/bin/fblogout @@ -0,0 +1,31 @@ +#!/bin/bash + +COMMAND=$( + xlunch --input /etc/xlunch/logout.dsv --noprompt --border auto --sideborder auto --columns 3 --rows 1 \ + --background /usr/share/wallpapers/slax_wallpaper.jpg --font DejaVuSans/11 \ + --voidclickterminate --iconpadding 30 --textpadding 10 \ + --leastmargin 10 --hidemissing --iconsize 128 \ + --highlight /usr/share/icons/hicolor/128x128/apps/xlunch_highlight.png \ + --outputonly +) + +SND=/usr/share/sounds/shutdown.wav + +if [ "$COMMAND" != "" -a -r $SND ]; then + # blank desktop with smooth effect (if compton still running) + xlunch --noprompt --input /dev/null --bc 111111ff & + # play shutdown sound + aplay $SND +fi + +if [ "$COMMAND" = "logout" ]; then + killall Xorg +fi + +if [ "$COMMAND" = "restart" ]; then + reboot +fi + +if [ "$COMMAND" = "shutdown" ]; then + poweroff +fi diff --git a/linux-live/modules/03-desktop/rootcopy/usr/bin/fbprintscreen b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbprintscreen new file mode 100755 index 0000000..2fa57c9 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbprintscreen @@ -0,0 +1,18 @@ +#!/bin/bash + +PICTURES=~/Pictures +mkdir -p $PICTURES +cd $PICTURES + +# make screenshot +SCREENSHOT=$(scrot -e 'echo $f') + +if [ "$SCREENSHOT" = "" ]; then + exit 1 +fi + +# open screenshot in 2/3 window +read W H X <<< $(xrandr 2>/dev/null | fgrep '*' | tr -s " " | tr "x" " ") +W=$(($W*2/3)) +H=$(($H*2/3)) +exec feh --geometry $W"x"$H $SCREENSHOT diff --git a/linux-live/modules/03-desktop/rootcopy/usr/bin/fbscreensize b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbscreensize new file mode 100755 index 0000000..b51e329 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbscreensize @@ -0,0 +1,17 @@ +#!/bin/bash + +SIGNAL=~/.fehbg +rm -f $SIGNAL + +OUTPUT=$(xrandr 2>/dev/null | grep -iv disconnected | grep -i 'connected' | head -n 1 | cut -d " " -f 1) +MODE=$1 + +xrandr --output $OUTPUT --mode $MODE -s $MODE + +while [ -e $SIGNAL ]; do + sleep 0.1 +done + +sleep 1 + +killall -SIGUSR1 compton diff --git a/linux-live/modules/03-desktop/rootcopy/usr/bin/fbsetkb b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbsetkb new file mode 100755 index 0000000..4e08683 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbsetkb @@ -0,0 +1,4 @@ +#!/bin/bash + +setxkbmap $1 +echo $1 > ~/.fluxbox/kblayout diff --git a/linux-live/modules/03-desktop/rootcopy/usr/bin/fbstartupnotify b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbstartupnotify new file mode 100755 index 0000000..aa6a9a6 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/bin/fbstartupnotify @@ -0,0 +1,18 @@ +#!/bin/bash + +CURSORSDIR=/usr/share/icons/breeze_cursors/cursors/ +SIZE=16 + +# Set cursor to wait. As soon as new window is detected, change cursor back +xsetroot -xcf $CURSORSDIR/left_ptr_watch $SIZE +export WINDOWS="$(wmctrl -l)" + +( + sleep 0.2 + until diff <(echo "$WINDOWS") <(wmctrl -l) | egrep -q "^[>]"; do + sleep 0.5 + done + xsetroot -xcf $CURSORSDIR/left_ptr $SIZE +) & + +exit 0 diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/applications/1terminal.desktop b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/1terminal.desktop new file mode 100644 index 0000000..4005587 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/1terminal.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Icon=terminal +Name=Terminal +Exec=xterm -ls +Terminal=false diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/applications/5chromium.desktop b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/5chromium.desktop new file mode 100644 index 0000000..bcc3636 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/5chromium.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Name=Web Browser +GenericName=Web Browser +Exec=fbliveapp chromium %U +Terminal=false +X-MultipleArgs=false +Type=Application +Icon=chromium.png +Categories=Network;WebBrowser; +MimeType=audio/*;image/*;video/*;application/pdf;application/x-pdf;text/html;text/xml;application/xhtml_xml;application/x-mimearchive;x-scheme-handler/http;x-scheme-handler/https; +StartupWMClass=chromium +StartupNotify=true diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/applications/feh.desktop b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/feh.desktop new file mode 100644 index 0000000..6f6988d --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/feh.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Version=1.0 +Name=Image viewer +GenericName=Image viewer +Exec=feh %U +Terminal=false +X-MultipleArgs=false +Type=Application +Icon=none.png +Categories=ImageViewer; +MimeType=image/*; +StartupWMClass=feh +StartupNotify=true +Hidden=true diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/applications/mimeapps.list b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/mimeapps.list new file mode 100644 index 0000000..8217417 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/mimeapps.list @@ -0,0 +1,132 @@ +[Default Applications] +application/pdf=chromium.desktop; +application/x-pdf=chromium.desktop; +audio/3gpp=chromium.desktop; +audio/ac3=chromium.desktop; +audio/flac=chromium.desktop; +audio/mp4=chromium.desktop; +audio/mpeg=chromium.desktop; +audio/mpegurl=chromium.desktop; +audio/ogg=chromium.desktop; +audio/x-flac=chromium.desktop; +audio/x-gsm=chromium.desktop; +audio/x-it=chromium.desktop; +audio/x-m4a=chromium.desktop; +audio/x-matroska=chromium.desktop; +audio/x-mod=chromium.desktop; +audio/x-mp3=chromium.desktop; +audio/x-mpeg=chromium.desktop; +audio/x-mpegurl=chromium.desktop; +audio/x-pn-wav=chromium.desktop;; +audio/x-tta=chromium.desktop; +audio/x-vorbis=chromium.desktop; +audio/x-vorbis+ogg=chromium.desktop; +audio/x-wav=chromium.desktop; +audio/x-wavpack=chromium.desktop; +audio/x-xm=chromium.desktop; +application/ogg=chromium.desktop; +application/x-extension-m4a=chromium.desktop; +application/x-extension-mp4=chromium.desktop; +application/x-flac=chromium.desktop; +application/x-flash-video=chromium.desktop; +application/x-ogg=chromium.desktop; +image/bmp=feh.desktop; +image/gif=feh.desktop; +image/jpeg=feh.desktop; +image/jpg=feh.desktop; +image/pjpeg=feh.desktop; +image/png=feh.desktop; +image/svg+xml=chromium.desktop; +image/svg+xml-compressed=chromium.desktop; +image/x-bmp=feh.desktop; +image/x-gray=chromium.desktop; +image/x-icb=chromium.desktop; +image/x-ico=chromium.desktop; +image/x-pcx=chromium.desktop; +image/x-png=feh.desktop; +image/x-portable-anymap=chromium.desktop; +image/x-portable-bitmap=chromium.desktop; +image/x-portable-graymap=chromium.desktop; +image/x-portable-pixmap=chromium.desktop; +image/x-xbitmap=chromium.desktop; +image/x-xpixmap=chromium.desktop; +image/vnd.wap.wbmp=chromium.desktop; +image/x-fits=gimp.desktop +image/x-icon=gimp.desktop +image/x-sun-raster=gimp.desktop +image/x-tga=gimp.desktop +image/x-xcf=gimp.desktop +image/x-xwindowdump=gimp.desktop +video/3gpp=chromium.desktop; +video/dv=chromium.desktop; +video/fli=chromium.desktop; +video/flv=chromium.desktop; +video/mp2t=chromium.desktop; +video/mp4=chromium.desktop; +video/mp4v-es=chromium.desktop; +video/mpeg=chromium.desktop; +video/msvideo=chromium.desktop; +video/ogg=chromium.desktop; +video/quicktime=chromium.desktop; +video/vivo=chromium.desktop; +video/vnd.divx=chromium.desktop; +video/vnd.rn-realvideo=chromium.desktop; +video/vnd.vivo=chromium.desktop; +video/webm=chromium.desktop; +video/x-anim=chromium.desktop; +video/x-avi=chromium.desktop; +video/x-flc=chromium.desktop; +video/x-fli=chromium.desktop; +video/x-flic=chromium.desktop; +video/x-flv=chromium.desktop; +video/x-m4v=chromium.desktop; +video/x-matroska=chromium.desktop; +video/x-mpeg=chromium.desktop; +video/x-ogm+ogg=chromium.desktop; +video/x-theora+ogg=chromium.desktop; +application/x-flash-video=chromium.desktop; +text/plain=leafpad.desktop; +text/css=leafpad.desktop; +text/javascript=leafpad.desktop; +text/mathml=leafpad.desktop; +text/x-c++hdr=leafpad.desktop; +text/x-c++src=leafpad.desktop; +text/x-csrc=leafpad.desktop; +text/x-chdr=leafpad.desktop; +text/x-dtd=leafpad.desktop; +text/x-java=leafpad.desktop; +text/x-javascript=leafpad.desktop; +text/x-makefile=leafpad.desktop; +text/x-moc=leafpad.desktop; +text/x-pascal=leafpad.desktop; +text/x-patch=leafpad.desktop; +text/x-perl=leafpad.desktop; +text/x-php=leafpad.desktop; +text/x-python=leafpad.desktop; +text/x-sql=leafpad.desktop; +text/x-tcl=leafpad.desktop; +text/x-tex=leafpad.desktop; +text/xml=leafpad.desktop; +application/javascript=leafpad.desktop; +application/x-cgi=leafpad.desktop; +application/x-javascript=leafpad.desktop; +application/x-perl=leafpad.desktop; +application/x-php=leafpad.desktop; +application/x-python=leafpad.desktop; +application/x-shellscript=leafpad.desktop; +application/xml=leafpad.desktop; +application/xml-dtd=leafpad.desktop; +application/x-bzip=xarchiver.desktop; +application/x-bzip-compressed-tar=xarchiver.desktop; +application/x-gzip=xarchiver.desktop; +application/x-tar=xarchiver.desktop; +application/x-zip=xarchiver.desktop; +application/x-zip-compressed=xarchiver.desktop; +application/zip=xarchiver.desktop; +application/x-compressed-tar=xarchiver.desktop; +application/x-bzip2=xarchiver.desktop; +application/x-bzip2-compressed-tar=xarchiver.desktop; +application/x-lzma-compressed-tar=xarchiver.desktop; +application/x-lzma=xarchiver.desktop; +application/x-xz=xarchiver.desktop; +application/x-xz-compressed-tar=xarchiver.desktop; diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/applications/videoplayer.desktop b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/videoplayer.desktop new file mode 100644 index 0000000..b2f1714 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/videoplayer.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Icon=videoplayer +Name=Video Player +Exec=fbliveapp vlc +Terminal=false diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/applications/votecoin.desktop b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/votecoin.desktop new file mode 100644 index 0000000..460e9a8 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/share/applications/votecoin.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Icon=votecoin +Name=VoteCoin Wallet +Exec=fbliveapp votecoin +Terminal=false +Hidden=true diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/closefcs.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/closefcs.png new file mode 100644 index 0000000..6843155 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/closefcs.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/closepr.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/closepr.png new file mode 100644 index 0000000..819f59a Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/closepr.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/closeunfcs.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/closeunfcs.png new file mode 100644 index 0000000..dabe48c Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/closeunfcs.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/maxfcs.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/maxfcs.png new file mode 100644 index 0000000..ae0558e Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/maxfcs.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/maxpr.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/maxpr.png new file mode 100644 index 0000000..e87bb1e Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/maxpr.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/maxunfcs.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/maxunfcs.png new file mode 100644 index 0000000..f878fe6 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/maxunfcs.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/minfcs.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/minfcs.png new file mode 100644 index 0000000..f67c7ed Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/minfcs.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/minpr.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/minpr.png new file mode 100644 index 0000000..100be63 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/minpr.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/minunfcs.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/minunfcs.png new file mode 100644 index 0000000..82b487f Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/minunfcs.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/start-here.png b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/start-here.png new file mode 100644 index 0000000..e74bf47 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/pixmaps/start-here.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/theme.cfg b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/theme.cfg new file mode 100644 index 0000000..2dbd225 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/share/fluxbox/styles/Slax/theme.cfg @@ -0,0 +1,114 @@ +! Slax fluxbox theme +! (c) Tomas Matejicek + +! common settings +*font: Bitstream Vera Sans-9 + +background: fullscreen +background.pixmap: /usr/share/wallpapers/slax_wallpaper.jpg + +toolbar.justify: left +toolbar.clock.justify: right +window.justify: center +menu.title.justify: center +menu.frame.justify: left + +! window +window.focus.backgroundColor: #63b4fb +window.unfocus.backgroundColor: #ebebeb +window.focus.borderColor: #63b4fb +window.unfocus.borderColor: #ebebeb +window.borderWidth: 6 +window.handleWidth: 0 + +! title +window.title.height: 18 +window.title.focus: flat solid +window.title.focus.color: #63b4fb +window.label.focus: parentrelative +window.label.focus.textColor: #282828 +window.title.unfocus: flat solid +window.title.unfocus.color: #ebebeb +window.label.unfocus: parentrelative +window.label.unfocus.textColor: #282828 + +! buttons +window.button.focus: flat solid +window.button.focus.color: #63b4fb +window.button.focus.picColor: #282828 +window.button.pressed: sunken solid +window.button.pressed.color: #63b4fb +window.button.pressed.picColor: #000000 +window.button.unfocus: flat solid +window.button.unfocus.color: #ebebeb +window.button.unfocus.picColor: #282828 + +window.close.pixmap: closefcs.png +window.close.unfocus.pixmap: closeunfcs.png +window.close.pressed.pixmap: closepr.png +window.iconify.pixmap: minfcs.png +window.iconify.unfocus.pixmap: minunfcs.png +window.iconify.pressed.pixmap: minpr.png +window.maximize.pixmap: maxfcs.png +window.maximize.unfocus.pixmap: maxunfcs.png +window.maximize.pressed.pixmap: maxpr.png + +! taskbar +toolbar.height: 18 +toolbar.bevelWidth: 0 +toolbar.borderWidth: 3 +toolbar.borderColor: #222222 +toolbar: flat solid + +toolbar.color: #222222 +toolbar.clock: flat solid +toolbar.clock.color: #222222 +toolbar.clock.textColor: white + +toolbar.iconbar.empty: flat +toolbar.iconbar.empty.color: #222222 + +toolbar.iconbar.focused.borderWidth: 15 +toolbar.iconbar.focused.borderColor: #222222 +toolbar.iconbar.focused: flat +toolbar.iconbar.focused.color: #dddddd +toolbar.iconbar.focused.textColor: #282828 +toolbar.iconbar.focused.justify: left + +toolbar.iconbar.unfocused.borderWidth: 15 +toolbar.iconbar.unfocused.borderColor: #222222 +toolbar.iconbar.unfocused: flat +toolbar.iconbar.unfocused.color: #444444 +toolbar.iconbar.unfocused.textColor: white +toolbar.iconbar.unfocused.justify: left + +toolbar.button: flat solid +toolbar.button.borderWidth: 13 +toolbar.button.borderColor: #222222 +toolbar.button.color: #222222 +toolbar.button.picColor: #61CA00 +toolbar.button.pressed: flat solid + +! menu +menu.title: flat solid +menu.title.color: #63b4fb +menu.title.textColor: #282828 +menu.title.justify: center + +menu.bevelWidth: 4 +menu.borderWidth: 6 +menu.borderColor: #63b4fb + +menu.frame: flat solid +menu.frame.disableColor: #999999 +menu.frame.color: #ebebeb +menu.frame.textColor: #282828 +menu.frame.justify: left + +menu.hilite: flat solid +menu.hilite.textColor: #ffffff +menu.hilite.color: #63b4fb + +menu.bullet: empty +menu.bullet.position: right +menu.itemHeight: 24 diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/actions/logout.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/actions/logout.png new file mode 100644 index 0000000..fa6dddb Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/actions/logout.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/actions/restart.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/actions/restart.png new file mode 100644 index 0000000..7c80934 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/actions/restart.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/actions/shutdown.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/actions/shutdown.png new file mode 100644 index 0000000..8c25c3a Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/actions/shutdown.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/apps/chromium.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/apps/chromium.png new file mode 100644 index 0000000..057a663 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/apps/chromium.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/apps/terminal.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/apps/terminal.png new file mode 100644 index 0000000..c53249b Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/apps/terminal.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/apps/xlunch_highlight.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/apps/xlunch_highlight.png new file mode 100644 index 0000000..bb45fe5 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/128x128/apps/xlunch_highlight.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/64x64/apps/videoplayer.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/64x64/apps/videoplayer.png new file mode 100644 index 0000000..327b538 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/64x64/apps/videoplayer.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/64x64/apps/votecoin.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/64x64/apps/votecoin.png new file mode 100644 index 0000000..a7056af Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/hicolor/64x64/apps/votecoin.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/actions/system-shutdown-symbolic.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/actions/system-shutdown-symbolic.png new file mode 100644 index 0000000..7386bcd Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/actions/system-shutdown-symbolic.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/apps/black.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/apps/black.png new file mode 100644 index 0000000..53993f0 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/apps/black.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/apps/xterm.xbm b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/apps/xterm.xbm new file mode 100644 index 0000000..0cd329e --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/apps/xterm.xbm @@ -0,0 +1,6 @@ +#define command2_width 16 +#define command2_height 16 +static unsigned char command2_bits[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xe7, 0xff, 0xcf, 0xff, + 0x9f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x9f, 0xff, 0xcf, 0xff, 0xe7, 0xc1, + 0xf7, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_czech_republic.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_czech_republic.png new file mode 100644 index 0000000..d79b3d9 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_czech_republic.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_france.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_france.png new file mode 100644 index 0000000..2db5840 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_france.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_germany.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_germany.png new file mode 100644 index 0000000..8deb4c9 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_germany.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_italy.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_italy.png new file mode 100644 index 0000000..19064f8 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_italy.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_poland.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_poland.png new file mode 100644 index 0000000..4dd7104 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_poland.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_portugal.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_portugal.png new file mode 100644 index 0000000..19cd33a Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_portugal.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_russia.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_russia.png new file mode 100644 index 0000000..b4822ea Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_russia.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_slovakia.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_slovakia.png new file mode 100644 index 0000000..8c4d813 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_slovakia.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_spain.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_spain.png new file mode 100644 index 0000000..d87283c Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_spain.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_ukraine.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_ukraine.png new file mode 100644 index 0000000..639aa4a Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_ukraine.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_usa.png b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_usa.png new file mode 100644 index 0000000..f027ed8 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/icons/locolor/16x16/flags/flag_usa.png differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/sounds/shutdown.wav b/linux-live/modules/03-desktop/rootcopy/usr/share/sounds/shutdown.wav new file mode 100644 index 0000000..cba904d Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/sounds/shutdown.wav differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/sounds/startup.wav b/linux-live/modules/03-desktop/rootcopy/usr/share/sounds/startup.wav new file mode 100644 index 0000000..278e8e8 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/sounds/startup.wav differ diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/themes/MurrinaChrome/gtk-2.0/gtkrc b/linux-live/modules/03-desktop/rootcopy/usr/share/themes/MurrinaChrome/gtk-2.0/gtkrc new file mode 100644 index 0000000..f1fdee6 --- /dev/null +++ b/linux-live/modules/03-desktop/rootcopy/usr/share/themes/MurrinaChrome/gtk-2.0/gtkrc @@ -0,0 +1,438 @@ +gtk_color_scheme = "fg_color:#000000\nbg_color:#eeeeee\nbase_color:#FFFFFF\ntext_color:#000000\nselected_bg_color:#63b4fb\nselected_fg_color:#FFFFFF\ntooltip_bg_color:#F5F5C9\ntooltip_fg_color:#000000" + +# menu delay +#gtk-menu-popup-delay = 0 + +# icon sizes +#gtk-icon-sizes = "gtk-menu=16,16:\ngtk-button=16,16:\ngtk-dnd=16,16:\npanel-menu=16,16:\npanel=16,16:\ngtk-dialog=16,16:" + +# icon sizes (small toolbar) +# gtk-icon-sizes = "gtk-menu=16,16:\ngtk-button=16,16:\ngtk-dnd=16,16:\npanel-menu=16,16:\npanel=16,16:\ngtk-dialog=16,16:\ngtk-small-toolbar=16,16:\ngtk-large-toolbar=16,16:" + +style "murrine-default" +{ + ######## + # Style Properties + ######## + GtkButton ::child-displacement-x = 1 + GtkButton ::child-displacement-y = 1 + GtkButton ::default-border = { 0, 0, 0, 0 } + GtkButton ::inner-border = { 5, 5, 5, 5 } + GtkCheckButton ::indicator-size = 14 + + GtkPaned ::handle-size = 6 + + GtkRange ::trough-border = 0 + GtkRange ::slider-width = 15 + GtkRange ::stepper-size = 15 + + GtkScale ::slider-length = 15 + GtkScale ::trough-side-details = 0 + GtkScrollbar ::min-slider-length = 30 + + GtkMenuBar ::internal-padding = 1 + GtkExpander ::expander-size = 16 + GtkToolbar ::internal-padding = 0 + GtkTreeView ::expander-size = 14 + GtkTreeView ::vertical-separator = 0 + + GtkMenu ::horizontal-padding = 1 + GtkMenu ::vertical-padding = 1 + + GtkMenuBar ::shadow_type = GTK_SHADOW_NONE + GtkToolbar ::shadow_type = GTK_SHADOW_NONE + + # Glow the tasklist by changing the color, instead of overlaying it with a rectangle + #WnckTasklist ::fade-overlay-rect = 0 + + xthickness = 1 + ythickness = 1 + + + fg[NORMAL] = @fg_color + fg[PRELIGHT] = @fg_color + fg[SELECTED] = @selected_fg_color + fg[ACTIVE] = @fg_color + fg[INSENSITIVE] = darker (@bg_color) + + bg[NORMAL] = @bg_color + bg[PRELIGHT] = shade (1.02, @bg_color) + bg[SELECTED] = @selected_bg_color + bg[INSENSITIVE] = @bg_color + bg[ACTIVE] = shade (0.9, @bg_color) + + base[NORMAL] = @base_color + base[PRELIGHT] = shade (0.95, @bg_color) + base[ACTIVE] = shade (0.88, @selected_bg_color) + base[SELECTED] = shade (0.89, @selected_bg_color) + base[INSENSITIVE] = @bg_color + + text[NORMAL] = @text_color + text[PRELIGHT] = @text_color + text[ACTIVE] = @selected_fg_color + text[SELECTED] = @selected_fg_color + text[INSENSITIVE] = darker (@bg_color) + + engine "murrine" + { + animation = TRUE + colorize_scrollbar = FALSE + contrast = 0.65 # 0.8 for less contrast, more than 1.0 for more contrast on borders + glazestyle = 0 # 0 = flat highlight, 1 = curved highlight, 2 = concave style, 3 = top curved highlight, 4 = beryl highlight + gradient_shades = {1.03,1.0,1.0,0.985} + #gradient_shades = {1.09,1.06,1.04,1.01} # default: {1.1,1.0,1.0,1.1} + highlight_shade = 1.0 # set highlight amount for buttons or widgets + lightborder_shade = 1.06 # sets lightborder amount for buttons or widgets + #lightborderstyle = 0 # 0 = lightborder on top side, 1 = lightborder on all sides + listviewheaderstyle = 1 # 0 = flat, 1 = glassy, 2 = raised + listviewstyle = 1 # 0 = nothing, 1 = dotted + menubaritemstyle = 0 # 0 = menuitem look, 1 = button look + menubarstyle = 0 # 0 = flat, 1 = glassy, 2 = gradient, 3 = striped + menuitemstyle = 1 # 0 = flat, 1 = glassy, 2 = striped + menustyle = 0 # 0 = no vertical menu stripe, 1 = display vertical menu stripe + reliefstyle = 0 # 0 = flat, 1 = inset, 2 = shadow + rgba = TRUE # FALSE = disabled, TRUE = enabled + roundness = 0 # 0 = squared, 1 = old default, more will increase roundness + scrollbarstyle = 0 # 0 = nothing, 1 = circles, 2 = handles, 3 = diagonal stripes, 4 = diagonal stripes and handles, 5 = horizontal stripes, 6 = horizontal stripes and handles + sliderstyle = 0 # 0 = nothing added, 1 = handles + stepperstyle = 0 # 0 = standard, 1 = integrated stepper handles, 2 = unknown + toolbarstyle = 0 # 0 = flat, 1 = glassy, 2 = gradient + } +} + +style "murrine-wide" +{ + xthickness = 2 + ythickness = 2 + + bg[SELECTED] = @selected_bg_color +} + +style "murrine-wider" +{ + xthickness = 3 + ythickness = 3 + + bg[SELECTED] = @selected_bg_color +} + +style "murrine-button" = "murrine-wider" +{ + bg[NORMAL] = shade (1.04, @bg_color) + bg[PRELIGHT] = shade (1.06, @bg_color) + bg[ACTIVE] = shade (1.02, @bg_color) + bg[INSENSITIVE] = shade (1.0, @bg_color) + + engine "murrine" { + contrast = 0.45 + } +} + +style "murrine-entry" = "murrine-wider" +{ + engine "murrine" { + contrast = 0.35 + } +} +style "murrine-notebook" +{ + xthickness = 2 + ythickness = 2 + + bg[ACTIVE] = shade (0.99, @bg_color) + bg[NORMAL] = shade (1.03, @bg_color) + bg[SELECTED] = @selected_bg_color + fg[ACTIVE] = shade (0.34, @bg_color) +} + +style "murrine-tasklist" = "murrine-wide" +{ +} + +style "murrine-menu" = "murrine-wider" +{ + xthickness = 3 + ythickness = 3 + + bg[NORMAL] = shade (1.18, @bg_color) +} + +style "murrine-menu-item" = "murrine-wider" +{ + xthickness = 2 + ythickness = 3 + + fg[PRELIGHT] = @selected_fg_color + bg[SELECTED] = shade (0.95, @selected_bg_color) + bg[SELECTED] = shade (0.95, @selected_bg_color) + + engine "murrine" + { + roundness = 0 + } +} + +style "murrine-separator-menu-item" +{ +} + +style "murrine-treeview" +{ + bg[SELECTED] = @selected_bg_color +} + +style "murrine-treeview-header" = "murrine-default" +{ + bg[NORMAL] = shade (1.06,@bg_color) + bg[PRELIGHT] = shade (1.06,@bg_color) +} + +style "murrine-frame-title" +{ + fg[NORMAL] = lighter (@fg_color) +} + +style "murrine-tooltips" = "murrine-wider" +{ + bg[NORMAL] = @tooltip_bg_color + fg[NORMAL] = @tooltip_fg_color +} + +style "murrine-progressbar" +{ + xthickness = 0 + ythickness = 0 + + fg[PRELIGHT] = @selected_fg_color + bg[NORMAL] = shade (0.98, @bg_color) + bg[SELECTED] = @selected_bg_color +} + +style "murrine-statusbar" +{ +} + +style "murrine-comboboxentry" +{ +} + +style "murrine-spinbutton" +{ +} + +style "murrine-scale" = "murrine-button" +{ + GtkRange ::slider-width = 15 + + engine "murrine" + { + roundness = 6 + } +} + +style "murrine-hscale" +{ +} + +style "murrine-vscale" +{ +} + +style "murrine-scrollbar" +{ + bg[NORMAL] = shade (1.04, @bg_color) + bg[PRELIGHT] = shade (1.06, @bg_color) + bg[ACTIVE] = shade (1.02, @bg_color) + bg[INSENSITIVE] = shade (1.0, @bg_color) +} + +style "murrine-hscrollbar" +{ +} + +style "murrine-vscrollbar" +{ +} + +style "murrine-menubar" +{ +} + +style "murrine-nautilus-location" +{ +# bg[NORMAL] = shade (1.0,@selected_bg_color) +# bg[SELECTED] = shade (1.0,@selected_bg_color) +# bg[ACTIVE] = shade (1.0,@selected_bg_color) +} + +style "murrine-radiocheck" = "murrine-default" +{ + text[NORMAL] = "#FFFFFF" + text[PRELIGHT] = "#FFFFFF" +} + +style "panel" +{ + fg[NORMAL] = "#FFFFFF" + fg[PRELIGHT] = "#FFFFFF" + fg[ACTIVE] = "#FFFFFF" + bg[NORMAL] = shade (0.4, @bg_color) + bg[ACTIVE] = shade (0.5, @bg_color) + bg[PRELIGHT] = shade (0.56, @bg_color) + + engine "murrine" { + contrast = 0.8 + } +} + +style "smaller-text" +{ + font_name = "7" +} + +style "handle" +{ + bg[NORMAL] = "#232323" +} + +######################################### +# Matches +######################################### + +# theme radio buttons and checkmarks +class "GtkRadio*" style "murrine-radiocheck" +class "GtkCheck*" style "murrine-radiocheck" + +# theme default style is applied to every widget +class "GtkWidget" style "murrine-default" + +# Increase the x/ythickness in some widgets +class "GtkToolbar" style "murrine-default" +class "GtkRange" style "murrine-wide" +class "GtkFrame" style "murrine-wide" +class "GtkSeparator" style "murrine-wide" +class "GtkEntry" style "murrine-entry" + +class "GtkSpinButton" style "murrine-spinbutton" +class "GtkScale" style "murrine-scale" +class "GtkVScale" style "murrine-vscale" +class "GtkHScale" style "murrine-hscale" +class "GtkScrollbar" style "murrine-scrollbar" +class "GtkVScrollbar" style "murrine-vscrollbar" +class "GtkHScrollbar" style "murrine-hscrollbar" + +# General matching following, the order is choosen so that the right styles override each other +# eg. progressbar needs to be more important then the menu match. + +# This is not perfect, it could be done better +# (That is modify *every* widget in the notebook, and change those back that +# we really don't want changed) +widget_class "**" style "murrine-notebook" +widget_class "**" style "murrine-notebook" +widget_class "**" style "murrine-notebook" +widget_class "**" style "murrine-notebook" + +widget_class "*" style "murrine-button" +widget_class "*" style "murrine-notebook" +widget_class "**" style "murrine-statusbar" + +widget_class "**" style "murrine-comboboxentry" +widget_class "**" style "murrine-comboboxentry" + +widget_class "**" style "murrine-menubar" +widget_class "**" style "murrine-menu" +widget_class "**" style "murrine-menu-item" +widget_class "**" style "murrine-separator-menu-item" + +widget_class "*.." style "murrine-frame-title" +widget_class "*.*" style "murrine-treeview" + +widget_class "*" style "murrine-progressbar" + +# Treeview header +widget_class "*.." style "murrine-treeview-header" +widget_class "*.." style "murrine-treeview-header" +widget_class "*.." style "murrine-treeview-header" +widget_class "*.." style "murrine-treeview-header" + +# Workarounds for Evolution +widget_class "*.ETable.ECanvas" style "murrine-treeview-header" +widget_class "*.ETree.ECanvas" style "murrine-treeview-header" + +# Panel style +class "*Panel*" style "panel" +class "*notif*" style "panel" +class "*Notif*" style "panel" +class "*Tray*" style "panel" +class "*tray*" style "panel" + +widget_class "*ToolButton*" style "smaller-text" +widget_class "*Statusbar*" style "smaller-text" +widget_class "*Mail*" style "panel" +widget "*PanelWidget*" style "panel" +widget "*PanelApplet*" style "panel" + +class "PanelAppletFrame" style "handle" + +# The window of the tooltip is called "gtk-tooltip" +################################ +# FIXME: +# This will not work if one embeds eg. a button into the tooltip. +# As far as I can tell right now we will need to rework the theme +# quite a bit to get this working correctly. +# (It will involve setting different priorities, etc.) +################################ +widget "gtk-tooltip*" style "murrine-tooltips" + +################################################### +# Special cases and work arounds +################################################### + +# Special case the nautilus-extra-view-widget +# ToDo: A more generic approach for all applications that have a widget like this. +widget "*.nautilus-extra-view-widget" style : highest "murrine-nautilus-location" + +# Work around for http://bugzilla.gnome.org/show_bug.cgi?id=382646 +# Note that the work around assumes that the combobox is _not_ in +# appears-as-list mode. +# Similar hack also in the menuitem style. +# This style does not affect GtkComboBoxEntry, it does have an effect +# on comboboxes in appears-as-list mode though. +style "murrine-combobox-text-color-workaround" +{ + text[NORMAL] = @fg_color + text[PRELIGHT] = @fg_color + text[SELECTED] = @selected_fg_color + text[ACTIVE] = @fg_color + text[INSENSITIVE] = darker (@bg_color) +} +widget_class "*.." style "murrine-combobox-text-color-workaround" + +style "murrine-menuitem-text-is-fg-color-workaround" +{ + text[NORMAL] = @fg_color + text[PRELIGHT] = @selected_fg_color + text[SELECTED] = @selected_fg_color + text[ACTIVE] = @fg_color + text[INSENSITIVE] = darker (@bg_color) +} + +widget "*.gtk-combobox-popup-menu.*" style "murrine-menuitem-text-is-fg-color-workaround" + +# Work around the usage of GtkLabel inside GtkListItems to display text. +# This breaks because the label is shown on a background that is based on the +# base color set. +style "murrine-fg-is-text-color-workaround" +{ + fg[NORMAL] = @text_color + fg[PRELIGHT] = @text_color + fg[ACTIVE] = @selected_fg_color + fg[SELECTED] = @selected_fg_color + fg[INSENSITIVE] = darker (@bg_color) +} + +widget_class "**" style "murrine-fg-is-text-color-workaround" +# The same problem also exists for GtkCList and GtkCTree +# Only match GtkCList and not the parent widgets, because that would also change the headers. + +widget_class "*" style "murrine-fg-is-text-color-workaround" diff --git a/linux-live/modules/03-desktop/rootcopy/usr/share/wallpapers/slax_wallpaper.jpg b/linux-live/modules/03-desktop/rootcopy/usr/share/wallpapers/slax_wallpaper.jpg new file mode 100644 index 0000000..c5d7af5 Binary files /dev/null and b/linux-live/modules/03-desktop/rootcopy/usr/share/wallpapers/slax_wallpaper.jpg differ diff --git a/linux-live/modules/04-apps/cleanup b/linux-live/modules/04-apps/cleanup new file mode 100644 index 0000000..dd745ec --- /dev/null +++ b/linux-live/modules/04-apps/cleanup @@ -0,0 +1,91 @@ +#!/bin/bash + +rm -f /etc/fstab +rm -f /etc/mtab +rm -f /etc/apt/sources.list~ +rm -Rf /etc/systemd/system/timers.target.wants +rm -f /etc/systemd/system/multi-user.target.wants/ssh.service +rm -f /etc/systemd/system/multi-user.target.wants/dnsmasq.service + +rm -f /etc/ssh/ssh_host* + +rm -f /var/backups/* +rm -f /var/cache/ldconfig/* +rm -f /var/cache/debconf/* +rm -f /var/cache/fontconfig/* +rm -f /var/lib/apt/extended_states +rm -f /var/lib/systemd/random-seed +rm -f /var/lib/apt/lists/deb.* +rm -Rf /root/.local/share/mc +rm -Rf /root/.cache +rm -f /root/.wget-hsts + +rm -f /var/lib/dpkg/*-old +rm -f /var/log/* +rm -f /var/log/*/* +rm -f /var/log/*/*/* +rm -f /var/cache/apt/archives/*.deb +rm -f /var/cache/apt/*.bin +rm -f /var/cache/debconf/*-old +rm -f /var/lib/dhcp/dhclient.leases +rm -f /root/.bash_history +rm -f /root/.wget-hsts +rm -Rf /usr/share/doc/* +rm -Rf /usr/share/info/* +rm -f /usr/share/images/fluxbox/debian-squared.jpg +rm -Rf /usr/share/fluxbox/nls/??* +rm -Rf /usr/share/gnome/help + +rm -Rf /usr/share/locale/?? +rm -Rf /usr/share/locale/??_* +rm -Rf /usr/share/locale/??@* +rm -Rf /usr/share/locale/??? +rm -Rf /usr/share/i18n/locales/*_* +rm -Rf /usr/share/man/?? +rm -Rf /usr/share/man/*_* + +rm -Rf /usr/share/icons/elementaryXubuntu-dark +rm -Rf /usr/share/icons/gnome/256x256 + +rm /usr/share/applications/compton.desktop +rm /usr/share/applications/debian-uxterm.desktop +rm /usr/share/applications/debian-xterm.desktop +rm /usr/share/applications/htop.desktop +rm /usr/share/applications/mc.desktop +rm /usr/share/applications/mcedit.desktop +rm /usr/share/applications/pcmanfm-desktop-pref.desktop +rm /usr/share/applications/python2.7.desktop +rm /usr/share/applications/python3.7.desktop +rm /usr/share/applications/vim.desktop + + + +# Unzip gzipped files (man pages), so LZMA can compress 2times better. +# First we fix symlinks, then uncompress files +# $1 = search directory +uncompress_files() +{ + local LINK LINE + + find "$1" -type l -name "*.gz" | while read LINE; do + LINK="$(readlink "$LINE" | sed -r 's/.gz$//')" + FILE="$(echo "$LINE" | sed -r 's/.gz$//')" + ln -sfn "$LINK" "$FILE" + rm -f "$LINE" + done + find "$1" -type f -name "*.gz" | xargs -r gunzip +} + +uncompress_files /etc/alternatives +uncompress_files /usr/share/man + +# remove broken links +# $1 = search directory +remove_broken_links() +{ + find "$1" -type l -exec test ! -e {} \; -print | xargs rm -vf +} + +remove_broken_links /etc/alternatives +remove_broken_links /usr/share/man + diff --git a/linux-live/modules/04-apps/install b/linux-live/modules/04-apps/install new file mode 100755 index 0000000..3c54525 --- /dev/null +++ b/linux-live/modules/04-apps/install @@ -0,0 +1,15 @@ +#!/bin/bash + +CWD=$(dirname $(readlink -f $0)) + +apt-get update +apt-get install --no-install-recommends --yes \ + qalculate-gtk \ + pcmanfm \ + lxtask \ + xarchiver xdg-utils libgconf-2-4 \ + wicd + +. ./cleanup + +(cd /rootcopy && cp --parents -afr * /) diff --git a/linux-live/modules/04-apps/install2 b/linux-live/modules/04-apps/install2 new file mode 100644 index 0000000..4f3adaf --- /dev/null +++ b/linux-live/modules/04-apps/install2 @@ -0,0 +1,37 @@ +#!/bin/bash + +CWD=$(dirname $(readlink -f $0)) + +cd / + +rm -Rf /squashfs-root/root/.fluxbox +rm -f /squashfs-root/root/.gtk-bookmarks + +# we want to patch pcmanfm it to hide ugly root warning icon +# so we will recompile whole package + +REBUILD=/tmp/pcmanfm-rebuild-$$ + +apt-get update +apt-get --yes build-dep pcmanfm + +mkdir -p -m 0777 $REBUILD +cd $REBUILD + +apt-get source pcmanfm + +cd pcmanfm-1.3.1 +dpkg-buildpackage -us -uc +patch -p1 < $CWD/patches/pcmanfm-slax.diff +make + +strip --strip-unneeded src/pcmanfm +cp src/pcmanfm /squashfs-root/usr/bin + +rm -f /squashfs-root/usr/share/applications/leafpad.desktop +rm -f /squashfs-root/usr/share/applications/qalculate-gtk.desktop +rm -f /squashfs-root/usr/share/applications/pcmanfm.desktop +rm -f /squashfs-root/usr/share/applications/wicd.desktop +rm -f /squashfs-root/usr/share/applications/lxtask.desktop + +dir2sb /squashfs-root /04-apps.sb diff --git a/linux-live/modules/04-apps/is_internal_build b/linux-live/modules/04-apps/is_internal_build new file mode 100644 index 0000000..e69de29 diff --git a/linux-live/modules/04-apps/patches/pcmanfm-slax.diff b/linux-live/modules/04-apps/patches/pcmanfm-slax.diff new file mode 100644 index 0000000..ad20b83 --- /dev/null +++ b/linux-live/modules/04-apps/patches/pcmanfm-slax.diff @@ -0,0 +1,10 @@ +--- a/src/main-win.c ++++ b/src/main-win.c +@@ -955,6 +955,7 @@ static void fm_main_win_init(FmMainWin * + /* the location bar */ + win->location = fm_path_entry_new(); + g_signal_connect(win->location, "activate", G_CALLBACK(on_location_activate), win); ++ if (FALSE) + if(geteuid() == 0) /* if we're using root, Give the user some warnings */ + { + GtkWidget* warning = gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR); diff --git a/linux-live/modules/04-apps/rootcopy/etc/systemd/system/suspend.target.wants/resume_wifi.service b/linux-live/modules/04-apps/rootcopy/etc/systemd/system/suspend.target.wants/resume_wifi.service new file mode 120000 index 0000000..528ff71 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/etc/systemd/system/suspend.target.wants/resume_wifi.service @@ -0,0 +1 @@ +/lib/systemd/system/resume_wifi.service \ No newline at end of file diff --git a/linux-live/modules/04-apps/rootcopy/etc/wicd/manager-settings.conf b/linux-live/modules/04-apps/rootcopy/etc/wicd/manager-settings.conf new file mode 100644 index 0000000..b6e52cb --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/etc/wicd/manager-settings.conf @@ -0,0 +1,20 @@ +[Settings] +backend = external +always_show_wired_interface = True +use_global_dns = False +global_dns_1 = None +global_dns_2 = None +global_dns_3 = None +global_dns_dom = None +global_search_dom = None +auto_reconnect = True +debug_mode = False +wired_connect_mode = 1 +signal_display_type = 0 +should_verify_ap = 1 +dhcp_client = 0 +link_detect_tool = 0 +flush_tool = 0 +sudo_app = 0 +prefer_wired = False +show_never_connect = True diff --git a/linux-live/modules/04-apps/rootcopy/etc/wicd/wired-settings.conf b/linux-live/modules/04-apps/rootcopy/etc/wicd/wired-settings.conf new file mode 100644 index 0000000..1d6ee42 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/etc/wicd/wired-settings.conf @@ -0,0 +1,16 @@ +[wired-default] +ip = None +broadcast = None +netmask = None +gateway = None +search_domain = None +dns_domain = None +dns1 = None +dns2 = None +dns3 = None +beforescript = None +afterscript = None +predisconnectscript = None +postdisconnectscript = None +encryption_enabled = None +default = True diff --git a/linux-live/modules/04-apps/rootcopy/root/.config/libfm/libfm.conf b/linux-live/modules/04-apps/rootcopy/root/.config/libfm/libfm.conf new file mode 100644 index 0000000..4e71676 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/root/.config/libfm/libfm.conf @@ -0,0 +1,45 @@ +# Configuration file for the libfm version 1.2.5. +# Autogenerated file, don't edit, your changes will be overwritten. + +[config] +single_click=0 +use_trash=0 +confirm_del=1 +confirm_trash=1 +advanced_mode=0 +si_unit=0 +force_startup_notify=1 +backup_as_hidden=1 +no_usb_trash=1 +no_child_non_expandable=0 +show_full_names=1 +only_user_templates=0 +template_run_app=0 +template_type_once=0 +auto_selection_delay=600 +drop_default_action=ask +defer_content_test=0 +quick_exec=0 +show_internal_volumes=0 +terminal=x-terminal-emulator %s +thumbnail_local=1 +thumbnail_max=2048 +smart_desktop_autodrop=1 + +[ui] +big_icon_size=48 +small_icon_size=24 +pane_icon_size=24 +thumbnail_size=128 +show_thumbnail=1 +shadow_hidden=1 + +[places] +places_home=1 +places_desktop=0 +places_root=0 +places_computer=0 +places_trash=0 +places_applications=0 +places_network=0 +places_unmounted=0 diff --git a/linux-live/modules/04-apps/rootcopy/root/.config/pcmanfm/default/pcmanfm.conf b/linux-live/modules/04-apps/rootcopy/root/.config/pcmanfm/default/pcmanfm.conf new file mode 100644 index 0000000..a39ba16 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/root/.config/pcmanfm/default/pcmanfm.conf @@ -0,0 +1,26 @@ +[config] +bm_open_method=0 + +[volume] +mount_on_startup=1 +mount_removable=1 +autorun=1 + +[ui] +always_show_tabs=0 +max_tab_chars=32 +win_width=640 +win_height=480 +splitter_pos=150 +media_in_new_tab=0 +desktop_folder_new_win=0 +change_tab_on_drop=1 +close_on_unmount=1 +focus_previous=1 +side_pane_mode=places +view_mode=list +show_hidden=0 +sort=name;ascending; +toolbar= +show_statusbar=1 +pathbar_mode_buttons=1 diff --git a/linux-live/modules/04-apps/rootcopy/root/.qalculate/qalculate-gtk.cfg b/linux-live/modules/04-apps/rootcopy/root/.qalculate/qalculate-gtk.cfg new file mode 100644 index 0000000..cc01904 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/root/.qalculate/qalculate-gtk.cfg @@ -0,0 +1,127 @@ + +[General] +version=0.9.7 +width=450 +height=400 +save_mode_on_exit=1 +save_definitions_on_exit=1 +load_global_definitions=1 +fetch_exchange_rates_at_startup=0 +wget_args=--quiet --tries=1 +show_keypad=1 +show_history=0 +show_stack=1 +rpn_keypad_only=1 +display_expression_status=1 +enable_completion=1 +use_unicode_signs=1 +lower_case_numbers=0 +lower_case_e=1 +base_display=1 +spell_out_logical_operators=1 +dot_as_separator=0 +use_custom_result_font=0 +use_custom_expression_font=0 +use_custom_status_font=0 +custom_result_font=Sans 10 +custom_expression_font=Sans 10 +custom_status_font=Sans 10 +multiplication_sign=0 +division_sign=1 +expression_history=10*20 +expression_history=d*d +expression_history=5+2/200000000000 +expression_history=5+2/200000 +expression_history=5+2/2 +expression_history=5+2/3 +history_expression=10*20 +history_parse=10 * 20 +history_result=200 +history_expression=d*d +history_parse=day * day +history_result=1 d^2 +history_expression=5+2/200000000000 +history_parse=5 + (2 ∕ 2E11) +history_result_approximate=5 +history_result_approximate=5 +history_expression=5+2/200000000000 +history_parse=5 + (2 ∕ 2E11) +history_result_approximate=5 +history_result_approximate=5 +history_result_approximate=5 +history_expression=5+2/200000000000 +history_parse=5 + (2 ∕ 2E11) +history_result_approximate=5 +history_expression=5+2/200000 +history_parse=5 + (2 ∕ 200000) +history_result=5.00001 +history_expression=5+2/2 +history_parse=5 + (2 ∕ 2) +history_result=6 +history_expression=5+2/3 +history_parse=5 + (2 ∕ 3) +history_result_approximate=5.6666667 +recent_functions= +recent_variables= +recent_units= + +[Mode] +min_deci=0 +use_min_deci=0 +max_deci=2 +use_max_deci=0 +precision=8 +min_exp=-1 +negative_exponents=0 +sort_minus_last=1 +number_fraction_format=0 +use_prefixes=1 +abbreviate_names=1 +all_prefixes_enabled=0 +denominator_prefix_enabled=1 +place_units_separately=1 +auto_post_conversion=0 +number_base=10 +number_base_expression=10 +read_precision=0 +assume_denominators_nonzero=1 +warn_about_denominators_assumed_nonzero=1 +structuring=1 +angle_unit=1 +functions_enabled=1 +variables_enabled=1 +calculate_functions=1 +calculate_variables=1 +sync_units=1 +unknownvariables_enabled=0 +units_enabled=1 +allow_complex=1 +allow_infinite=1 +indicate_infinite_series=0 +show_ending_zeroes=0 +round_halfway_to_even=0 +approximation=1 +in_rpn_mode=0 +rpn_syntax=0 +limit_implicit_multiplication=0 +spacious=1 +excessive_parenthesis=0 +short_multiplication=1 +default_assumption_type=4 +default_assumption_sign=0 + +[Plotting] +plot_legend_placement=2 +plot_style=0 +plot_smoothing=0 +plot_display_grid=1 +plot_full_border=0 +plot_min=0 +plot_max=10 +plot_step=1 +plot_sampling_rate=100 +plot_use_sampling_rate=1 +plot_variable=x +plot_rows=0 +plot_type=0 +plot_color=1 diff --git a/linux-live/modules/04-apps/rootcopy/usr/bin/wicd-manager b/linux-live/modules/04-apps/rootcopy/usr/bin/wicd-manager new file mode 100755 index 0000000..321496f --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/usr/bin/wicd-manager @@ -0,0 +1,20 @@ +#!/bin/bash + +# check if gui is runnning, if so bring it to front and do nothing more +if pgrep wicd-client; then + xdotool search --name "Wicd Network Manager" windowactivate + exit +fi + +CONF=/etc/wicd/manager-settings.conf + +# remove previously configured settings so wicd can gather fresh ones +# then run wicd gtk gui application +service wicd stop +sed -i -r "s/^wireless_interface.*=.*//" $CONF +sed -i -r "s/^wired_interface.*=.*//" $CONF +sed -i -r "s/^wpa_driver.*=.*//" $CONF +service wicd start + +# start gui client +wicd-client --no-tray diff --git a/linux-live/modules/04-apps/rootcopy/usr/lib/systemd/system/resume_wifi.service b/linux-live/modules/04-apps/rootcopy/usr/lib/systemd/system/resume_wifi.service new file mode 100644 index 0000000..627bf6d --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/usr/lib/systemd/system/resume_wifi.service @@ -0,0 +1,13 @@ +[Unit] +Description=Start wifi after resume +After=suspend.target + +[Service] +User=root +Type=oneshot +ExecStart=/usr/share/wicd/daemon/autoconnect.py +TimeoutSec=0 +StandardOutput=syslog + +[Install] +WantedBy=suspend.target diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/applications/2pcmanfm.desktop b/linux-live/modules/04-apps/rootcopy/usr/share/applications/2pcmanfm.desktop new file mode 100644 index 0000000..1278327 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/usr/share/applications/2pcmanfm.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Icon=system-file-manager +Name=File Manager +GenericName=File Manager +Comment=Browse the file system and manage the files +Categories=System;FileTools;FileManager;Utility;Core;GTK; +Exec=pcmanfm %U +StartupNotify=true +Terminal=false +MimeType=inode/directory; diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/applications/3qalculate-gtk.desktop b/linux-live/modules/04-apps/rootcopy/usr/share/applications/3qalculate-gtk.desktop new file mode 100644 index 0000000..afdec00 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/usr/share/applications/3qalculate-gtk.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Name=Calculator +Exec=qalculate-gtk +Icon=calculator +Terminal=false diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/applications/6wicd.desktop b/linux-live/modules/04-apps/rootcopy/usr/share/applications/6wicd.desktop new file mode 100644 index 0000000..bf1fd85 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/usr/share/applications/6wicd.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Exec=wicd-manager +Icon=gnome_network_workgroup +Name=Net Manager +Terminal=false diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/applications/xarchiver.desktop b/linux-live/modules/04-apps/rootcopy/usr/share/applications/xarchiver.desktop new file mode 100644 index 0000000..f349497 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/usr/share/applications/xarchiver.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Version=1.0 +Name=Archiver +Comment=A GTK+2 only archive manager +GenericName=Archive manager +Exec=xarchiver %f +Icon=xarchiver +Terminal=false +Type=Application +X-MultipleArgs=false +Categories=GTK;Archiving;Utility; +Keywords=GTK;archiver;frontend;compression;zip;bz2;7z;gzip;deb;rpm;arj;lzma;rar;xz; +StartupNotify=true +MimeType=application/x-arj;application/arj;application/x-bzip;application/x-bzip-compressed-tar;application/x-gzip;application/x-rar;application/x-rar-compressed;application/x-tar;application/x-zip;application/x-zip-compressed;application/zip;application/x-7z-compressed;application/x-compressed-tar;application/x-bzip2;application/x-bzip2-compressed-tar;application/x-lzma-compressed-tar;application/x-lzma;application/x-deb;application/deb;application/x-xz;application/x-xz-compressed-tar; diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/applications/zlxtask.desktop b/linux-live/modules/04-apps/rootcopy/usr/share/applications/zlxtask.desktop new file mode 100644 index 0000000..12aa220 --- /dev/null +++ b/linux-live/modules/04-apps/rootcopy/usr/share/applications/zlxtask.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Task Manager +Comment=Manage running processes +GenericName=Process manager +Keywords=task;kill;suspend;processor;memory;monitoring;performance; +Exec=lxtask +Icon=utilities-system-monitor +Terminal=false +StartupNotify=true +Type=Application +Categories=GTK;System;Monitor; diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-documents.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-documents.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-documents.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-download.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-download.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-download.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-music.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-music.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-music.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-pictures.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-pictures.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-pictures.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-publicshare.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-publicshare.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-publicshare.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-remote.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-remote.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-remote.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-saved-search.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-saved-search.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-saved-search.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-templates.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-templates.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-templates.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-videos.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-videos.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder-videos.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/folder.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/user-bookmarks.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/user-bookmarks.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/user-bookmarks.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/user-desktop.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/user-desktop.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/user-desktop.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/user-home.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/user-home.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/16x16/places/user-home.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-documents.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-documents.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-documents.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-download.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-download.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-download.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-music.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-music.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-music.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-pictures.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-pictures.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-pictures.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-publicshare.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-publicshare.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-publicshare.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-remote.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-remote.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-remote.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-saved-search.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-saved-search.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-saved-search.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-templates.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-templates.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-templates.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-videos.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-videos.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder-videos.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/folder.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/user-bookmarks.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/user-bookmarks.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/user-bookmarks.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/user-desktop.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/user-desktop.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/user-desktop.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/user-home.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/user-home.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/22x22/places/user-home.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-documents.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-documents.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-documents.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-download.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-download.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-download.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-music.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-music.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-music.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-pictures.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-pictures.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-pictures.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-publicshare.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-publicshare.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-publicshare.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-remote.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-remote.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-remote.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-saved-search.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-saved-search.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-saved-search.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-templates.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-templates.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-templates.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-videos.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-videos.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder-videos.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/folder.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/user-bookmarks.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/user-bookmarks.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/user-bookmarks.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/user-desktop.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/user-desktop.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/user-desktop.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/user-home.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/user-home.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/24x24/places/user-home.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-documents.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-documents.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-documents.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-download.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-download.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-download.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-music.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-music.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-music.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-pictures.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-pictures.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-pictures.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-publicshare.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-publicshare.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-publicshare.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-remote.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-remote.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-remote.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-saved-search.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-saved-search.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-saved-search.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-templates.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-templates.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-templates.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-videos.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-videos.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder-videos.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/folder.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/user-bookmarks.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/user-bookmarks.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/user-bookmarks.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/user-desktop.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/user-desktop.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/user-desktop.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/user-home.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/user-home.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/32x32/places/user-home.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-documents.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-documents.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-documents.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-download.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-download.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-download.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-music.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-music.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-music.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-pictures.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-pictures.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-pictures.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-publicshare.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-publicshare.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-publicshare.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-remote.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-remote.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-remote.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-saved-search.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-saved-search.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-saved-search.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-templates.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-templates.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-templates.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-videos.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-videos.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder-videos.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/folder.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/user-bookmarks.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/user-bookmarks.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/user-bookmarks.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/user-desktop.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/user-desktop.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/user-desktop.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/user-home.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/user-home.png new file mode 100644 index 0000000..154bb9e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/gnome/48x48/places/user-home.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/128x128/apps/calculator.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/128x128/apps/calculator.png new file mode 100644 index 0000000..70a03aa Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/128x128/apps/calculator.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/128x128/apps/editor.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/128x128/apps/editor.png new file mode 100644 index 0000000..bfc6460 Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/128x128/apps/editor.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/128x128/apps/system-file-manager.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/128x128/apps/system-file-manager.png new file mode 100644 index 0000000..33f9b0a Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/128x128/apps/system-file-manager.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/16x16/apps/system-file-manager.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/16x16/apps/system-file-manager.png new file mode 100644 index 0000000..32d82e5 Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/16x16/apps/system-file-manager.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/24x24/apps/system-file-manager.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/24x24/apps/system-file-manager.png new file mode 100644 index 0000000..1a94a20 Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/24x24/apps/system-file-manager.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/32x32/apps/system-file-manager.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/32x32/apps/system-file-manager.png new file mode 100644 index 0000000..c211019 Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/32x32/apps/system-file-manager.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/48x48/apps/system-file-manager.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/48x48/apps/system-file-manager.png new file mode 100644 index 0000000..8b45025 Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/48x48/apps/system-file-manager.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/calculator.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/calculator.png new file mode 100644 index 0000000..768b352 Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/calculator.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/gnome_network_workgroup.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/gnome_network_workgroup.png new file mode 100644 index 0000000..4d7c2c7 Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/gnome_network_workgroup.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/leafpad.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/leafpad.png new file mode 100644 index 0000000..d7689e0 Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/leafpad.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/system-file-manager.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/system-file-manager.png new file mode 100644 index 0000000..aca5c1e Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/system-file-manager.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/utilities-system-monitor.png b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/utilities-system-monitor.png new file mode 100644 index 0000000..f3b5041 Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/icons/hicolor/64x64/apps/utilities-system-monitor.png differ diff --git a/linux-live/modules/04-apps/rootcopy/usr/share/pixmaps/qalculate.png b/linux-live/modules/04-apps/rootcopy/usr/share/pixmaps/qalculate.png new file mode 100644 index 0000000..274d1fa Binary files /dev/null and b/linux-live/modules/04-apps/rootcopy/usr/share/pixmaps/qalculate.png differ diff --git a/linux-live/modules/05-chromium/cleanup b/linux-live/modules/05-chromium/cleanup new file mode 100644 index 0000000..dd745ec --- /dev/null +++ b/linux-live/modules/05-chromium/cleanup @@ -0,0 +1,91 @@ +#!/bin/bash + +rm -f /etc/fstab +rm -f /etc/mtab +rm -f /etc/apt/sources.list~ +rm -Rf /etc/systemd/system/timers.target.wants +rm -f /etc/systemd/system/multi-user.target.wants/ssh.service +rm -f /etc/systemd/system/multi-user.target.wants/dnsmasq.service + +rm -f /etc/ssh/ssh_host* + +rm -f /var/backups/* +rm -f /var/cache/ldconfig/* +rm -f /var/cache/debconf/* +rm -f /var/cache/fontconfig/* +rm -f /var/lib/apt/extended_states +rm -f /var/lib/systemd/random-seed +rm -f /var/lib/apt/lists/deb.* +rm -Rf /root/.local/share/mc +rm -Rf /root/.cache +rm -f /root/.wget-hsts + +rm -f /var/lib/dpkg/*-old +rm -f /var/log/* +rm -f /var/log/*/* +rm -f /var/log/*/*/* +rm -f /var/cache/apt/archives/*.deb +rm -f /var/cache/apt/*.bin +rm -f /var/cache/debconf/*-old +rm -f /var/lib/dhcp/dhclient.leases +rm -f /root/.bash_history +rm -f /root/.wget-hsts +rm -Rf /usr/share/doc/* +rm -Rf /usr/share/info/* +rm -f /usr/share/images/fluxbox/debian-squared.jpg +rm -Rf /usr/share/fluxbox/nls/??* +rm -Rf /usr/share/gnome/help + +rm -Rf /usr/share/locale/?? +rm -Rf /usr/share/locale/??_* +rm -Rf /usr/share/locale/??@* +rm -Rf /usr/share/locale/??? +rm -Rf /usr/share/i18n/locales/*_* +rm -Rf /usr/share/man/?? +rm -Rf /usr/share/man/*_* + +rm -Rf /usr/share/icons/elementaryXubuntu-dark +rm -Rf /usr/share/icons/gnome/256x256 + +rm /usr/share/applications/compton.desktop +rm /usr/share/applications/debian-uxterm.desktop +rm /usr/share/applications/debian-xterm.desktop +rm /usr/share/applications/htop.desktop +rm /usr/share/applications/mc.desktop +rm /usr/share/applications/mcedit.desktop +rm /usr/share/applications/pcmanfm-desktop-pref.desktop +rm /usr/share/applications/python2.7.desktop +rm /usr/share/applications/python3.7.desktop +rm /usr/share/applications/vim.desktop + + + +# Unzip gzipped files (man pages), so LZMA can compress 2times better. +# First we fix symlinks, then uncompress files +# $1 = search directory +uncompress_files() +{ + local LINK LINE + + find "$1" -type l -name "*.gz" | while read LINE; do + LINK="$(readlink "$LINE" | sed -r 's/.gz$//')" + FILE="$(echo "$LINE" | sed -r 's/.gz$//')" + ln -sfn "$LINK" "$FILE" + rm -f "$LINE" + done + find "$1" -type f -name "*.gz" | xargs -r gunzip +} + +uncompress_files /etc/alternatives +uncompress_files /usr/share/man + +# remove broken links +# $1 = search directory +remove_broken_links() +{ + find "$1" -type l -exec test ! -e {} \; -print | xargs rm -vf +} + +remove_broken_links /etc/alternatives +remove_broken_links /usr/share/man + diff --git a/linux-live/modules/05-chromium/install b/linux-live/modules/05-chromium/install new file mode 100755 index 0000000..463a90d --- /dev/null +++ b/linux-live/modules/05-chromium/install @@ -0,0 +1,15 @@ +#!/bin/bash + +apt-get update +apt-get install --yes --no-install-recommends chromium chromium-sandbox + +. ./cleanup + +echo 'export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --disk-cache-dir=/dev/null --disk-cache-size=1"' >>/etc/chromium.d/default-flags + +rm -Rf /usr/share/icons/gnome/256x256 +rm -Rf /root/.fluxbox +rm -Rf /root/.fluxbox/kblayout +rm -Rf /root/.gtk-bookmarks +rm -Rf /var/lib/wicd/dhclient.conf +rm -Rf /usr/share/applications/chromium.desktop diff --git a/linux-live/pkglists/hostreq.list b/linux-live/pkglists/hostreq.list new file mode 100644 index 0000000..fcb86d6 --- /dev/null +++ b/linux-live/pkglists/hostreq.list @@ -0,0 +1,13 @@ +# Приложения, необходимые хостовой системе для сборки. +sudo +binutils +debootstrap +squashfs-tools +xz-utils +lz4 +zstd +xorriso +genisoimage +grub-pc-bin +grub-efi-amd64-bin +mtools \ No newline at end of file diff --git a/linux-live/pkglists/main.list b/linux-live/pkglists/main.list new file mode 100644 index 0000000..83b471e --- /dev/null +++ b/linux-live/pkglists/main.list @@ -0,0 +1,41 @@ +mc +squashfs-tools +genisoimage +zip +unzip +psmisc +net-tools +alsa-utils +man +less +xz-utils +ca-certificates +openssl +acpid +acpi-support-base +powermgmt-base +bzip2 +gpart +hdparm +sdparm +mdadm +smartmontools +dosfstools +lsof +htop +gddrescue +rsync +netcat +ssh +gpm +wireless-tools +ntfs-3g +rfkill +file +dnsmasq +ntpdate +dvd+rw-tools +usb-modeswitch +pm-utils +wget +linux-image-amd64 \ No newline at end of file diff --git a/linux-live/pkglists/prereq.list b/linux-live/pkglists/prereq.list new file mode 100644 index 0000000..8c6d783 --- /dev/null +++ b/linux-live/pkglists/prereq.list @@ -0,0 +1,5 @@ +# Приложения, без которых невозможна установка. +sudo +libterm-readline-gnu-perl +systemd-sysv +dbus \ No newline at end of file diff --git a/linux-live/tools/bootlogo.update b/linux-live/tools/bootlogo.update new file mode 100755 index 0000000..906144c --- /dev/null +++ b/linux-live/tools/bootlogo.update @@ -0,0 +1,52 @@ +#!/bin/bash +# create boot image from program versions +# for example, https://ipsumimage.appspot.com/640x480.png?s=28&b=523&f=e53&l=|bash++4.4.20|VBoxControl++6.0.10r132072|code++1.43.1|git++2.17.1|brave-browser++80.1.5.113|python3++3.6.9 + +set -euo pipefail + +# Modify this list as needed. +version_commands=( + "bash --version | grep -Eo '[0-9]+.[0-9]+.[0-9]+'" + "VBoxControl --version" # virtualbox guest additions + "code --version | head -1" + "git --version | xargs | tr ' ' '\n' | tail -1" + "brave-browser --version | xargs | tr ' ' '\n' | tail -1" + "python3 --version | xargs | tr ' ' '\n' | tail -1" +) + +# image settings +resolution=640x480 +background=523 +fontcolor=e53 +fontsize=28 + +# build boot message +message="" +for ver_command in "${version_commands[@]}"; do + # program name + program="$(echo $ver_command | awk '{print $1;}')" + + if which $program > /dev/null; then + # pipes become newlines + message+="|" + # program name + message+="$program" + # pluses become spaces + message+="++" + # program version. eval allows additional pipeline commands + message+="$(eval $ver_command)" + fi +done + +# dummyimage.com can be used instead (or as fallback), but +# it a) uses a slightly different url structure +# and b) font-size is sensitive to long messages (whereas +# ipsumimage let's you specify font size directly) +host=ipsumimage.appspot.com +remote_url="https://$host/$resolution.png?s=$fontsize&b=$background&f=$fontcolor&l=$message" +target_path="$(dirname $(readlink -f $0))/../bootfiles/bootlogo.png" + +echo "downloading $remote_url" +wget -O "$target_path" "$remote_url" || curl -o "$target_path" "$remote_url" + +echo "complete" diff --git a/linux-live/tools/isolinux.bin.update b/linux-live/tools/isolinux.bin.update new file mode 100755 index 0000000..067a267 --- /dev/null +++ b/linux-live/tools/isolinux.bin.update @@ -0,0 +1,63 @@ +#!/bin/bash + +# This script will update the file ../bootfiles/isolinux.bin to match +# your LiveKit name. Note you may need to run this on a 32bit system. +# +# Requires: Debian +# + +set -e + +CWD=$(pwd) + +echo +echo "--------------------------------------------------------------------" +echo "Add directory to isolinux search paths (usually /\$LIVEKITNAME/boot)" +echo -n "(for example /slax/boot or /linux/boot): " +read DIR + + +# download, unpack, and patch syslinux + +if ! apt-get --yes build-dep syslinux; then + echo "the most common cause of build-dep failures can be solved by following the steps described here: https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list" + exit 1 +fi +mkdir -m 0777 /tmp/syslinux +cd /tmp/syslinux +apt-get source syslinux +apt-get --yes install upx +cd syslinux*/core + +for file in fs/iso9660/iso9660.c fs/lib/loadconfig.c elflink/load_env32.c; do + sed -i -r 's:"/",:"'$DIR'",\n\t"/",:' $file +done + +cd ../ + +rm -f bios/core/isolinux.bin +rm -f bios/com32/elflink/ldlinux/ldlinux.c32 +rm -f bios/com32/lib/libcom32.c32 +rm -f bios/com32/libutil/libutil.c32 +rm -f bios/com32/menu/vesamenu.c32 +rm -f bios/extlinux/extlinux + +make -j 8 -i + +echo +echo "Copying files to $CWD ..." + +cp bios/core/isolinux.bin $CWD +cp bios/com32/elflink/ldlinux/ldlinux.c32 $CWD +cp bios/com32/lib/libcom32.c32 $CWD +cp bios/com32/libutil/libutil.c32 $CWD +cp bios/com32/menu/vesamenu.c32 $CWD + +ARCH=$(uname -m) +if [ "$ARCH" = "x86_64" ]; then ARCH=64; else ARCH=32; fi +EXTLINUX=extlinux.x$ARCH + +strip --strip-unneeded bios/extlinux/extlinux +cp bios/extlinux/extlinux $CWD/extlinux.x$ARCH + +echo "done"