pull/23/merge
johndah4x0r 2017-07-31 12:16:33 +00:00 committed by GitHub
commit 5085f42570
31 changed files with 1436 additions and 671 deletions

21
.config
View File

@ -1,6 +1,11 @@
#!/bin/bash #!/bin/bash
# The process ID. Do not touch!
PID=$$
# This is a config file for Linux Live Kit build script. # This is a config file for Linux Live Kit build script.
# You shouldn't need to change anything expect LIVEKITNAME # You shouldn't need to change anything expect LIVEKITNAME
# Modified, used by Linux Live Kit Improved.
# Live Kit Name. Defaults to 'linux'; # Live Kit Name. Defaults to 'linux';
# This will be the name of the directory created on your CD/USB, which # This will be the name of the directory created on your CD/USB, which
@ -27,16 +32,24 @@ KERNEL=$(uname -r)
# No subdirectories are allowed, no slashes, # No subdirectories are allowed, no slashes,
# so You can't use /var/tmp here for example # so You can't use /var/tmp here for example
# Exclude directories like proc sys tmp # Exclude directories like proc sys tmp
MKMOD="bin etc home lib lib64 opt root sbin srv usr var" MKMOD="bin etc home lib opt root sbin srv usr var"
# List of files and directories you'd like to exclude from your Live Kit # List of files and directories you'd like to
# exclude from your Live Kit
EXCLUDE="/etc/fstab /etc/mtab" EXCLUDE="/etc/fstab /etc/mtab"
# Temporary directory to store livekit filesystem # Temporary directory to store livekit filesystem
LIVEKITDATA=/tmp/$LIVEKITNAME-data-$$ LIVEKITDATA=/tmp/$LIVEKITNAME-data-$PID
# Directory to store all of Live Kit builds
BUILD_DIR=/tmp/livekit-build/
# Bundle extension, for example 'sb' for .sb extension # Bundle extension, for example 'sb' for .sb extension
BEXT=sb # NOTE: Set to '.bund' extension by default instead of '.sb'
BEXT=bund
# Directory with kernel .ko modules, can be different in some distros # Directory with kernel .ko modules, can be different in some distros
LMK="lib/modules/$KERNEL" LMK="lib/modules/$KERNEL"
# Architecture (not needed)
ARCH=$(uname -m)

84
DOC/ABOUT 100644
View File

@ -0,0 +1,84 @@
About Linux Live Kit Improved
===========================================================
Linux Live Kit Improved, as the name suggests, is an
improved fork of the original Linux Live Kit.
Website (the original version): http://linux-live.org/
===========================================================
This text file combines all documents into one.
===========================================================
1] Boot parameters
===========================================================
These are used by the kernel and the Live Kit
system itself.
You can pass these boot parameters to the bootloader:
Live Kit parameters:
> debug - Start the Live Kit in verbose mode.
> dbg_shell - Start the debug shell several times while starting up.
> from={n} - Load data from {n}. (will search all devices for the data)
> copy2ram - Boot the Live Kit system just as normal, but also copy data to RAM.
> perch - Activate persistent changes.
Kernel parameters:
> noapic - Disable APIC (if you want, or maybe if your kernel screams about it!)
> acpi=off - Disable ACPI (if you might be still using a legacy system :P)
> init={n} - Execute command {n} instead of the init script itself.
2] Bundles
===========================================================
A bundle is compressed squashfs filesystem, consisting of
up-to-the-root directory structure. The older, but still
functional predecessor of the bundle is called a 'module'.
The bundle is an improved version of the 'module'.
NOTE:
The defaults is 512k, but I opted with 1024k, since
my system can handle that load, and I will get a smaller
bundule size, which is a !!HUGE!! advantage!
And, note: this message is also from the future (2k17!), which means
that software has also evolved as the years has passed...
'mksquashfs' will go nuts if you supply it with '-bs' instead of '-b'...
How to make a bundle:
# mksquashfs bundle_rootfs wholefs.{bext} -comp xz -b 1024k
or
# mksquashfs /usr /usr.{bext} --keep-as-directory -comp xz -b 1024k
or use function in livekitlib:
# source ./livekitlib; mkbund bundle_rootfs wholefs.{bext}
3] 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 any other operating systems.
4] Terminology
=========================================================
+ This toolkit is based on
the original Linux Live Kit. (http://linux-live.org/)
Extracted from the original terminology.txt:
> 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.

View File

@ -1,13 +1,341 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
License: 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.
This software is released under GNU GENERAL PUBLIC LICENSE. Preamble
Warranty: 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.
This software is distributed with NO WARRANTY, use it at your own risk. 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.
Author: 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.
This software is written by For example, if you distribute copies of such a program, whether
Tomas M. <http://www.linux-live.org> 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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
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.
<signature of Ty Coon>, 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.

View File

@ -1,5 +0,0 @@
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)

View File

@ -1,31 +0,0 @@
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 ?

View File

@ -1,2 +0,0 @@
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/

View File

@ -1,14 +0,0 @@
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).

View File

@ -1,18 +0,0 @@
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.

49
README
View File

@ -1,49 +0,0 @@
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.
* 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.
* 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 and aufs. Debian Jessie's kernel does.
* You may also wish to replace boot graphics in ./bootfiles/bootlogo.png
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
* You will need the following packages to be installed:
- squashfs-tools
- genisoimage or mkisofs
- zip
Author: Tomas M. <http://www.linux-live.org>

79
README.md 100644
View File

@ -0,0 +1,79 @@
## Linux Live Kit Improved.
This set of scripts will help you to
build your own Live Kit distro. This project is based on
the original Linux Live Kit. <http://linux-live.org>
## You will need to have the following installed:
* squashfs-tools
* genisoimage and/or mkisofs (optional)
* zip
## Before you build:
- 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.
The best practice is to make a directory such
as for example: '/tmp/a', and put all the files there.
Make sure to extract and use it on a POSIX-compatible
filesystem (for ex: EXT4), since it will create symlinks
and such that might not be compatible in for example: FAT
and such other filesystems.
- Before you start building your Live Kit, please consider
editing the ./.config file, and tweak it to suit your needs.
Most importantly, change the LIVEKITNAME variable.
- Make sure you are pointing to the right kernel. If in doubt,
change the path in ./.config. Your kernel must support both
SquashFS and AUFS, or else you will get an error both while
building, and when you actually boot your Live Kit.
On most Linux distro-s, the kernel is in /vmlinuz, a
symlink to /boot/vmlinuz-* or even /boot/vmlinux-*
Debian Jessie's kernel supports both AUFS and SquashFS out-of-the-box.
It's recommended to use Debian Jessie as the base OS, but the choice is yours.
- It's recommended to replace boot background in
bootfiles/bootpic.png and edit syslinux.cfg to fit your needs.
When editing the configuration file, make sure to keep all paths
pointing to /boot/, since it will be replaced to /LIVEKITNAME/boot/
during the build session.
- 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 want to boot your Live Kit from a CD, you'll need to recompile
syslinux.bin and/or isolinux.bin else it won't be able to boot
your Live Kit from directory "/LIVEKITNAME".
There is a script prepared for you which will do all of the building.
Simply go to directory ./tools/ and run isolinux.bin-update, it will rebuild
isolinux.bin automatically by downloading SysLinux sources, patching them using
your actual LIVEKITNAME and recompiling. This step is not needed if you only need
the ZIP archive version.
- If you have tmpfs mounted on /tmp, make sure you have enough (or maybe even
a lot of) RAM, since Live Kit will store lots of data to the target.
If you don't have enough (or even went out of) RAM, make sure
that /tmp is a regular on-disk directory.
- If you want to include your own bundules, then the 'include\_bund/' directory
might come in handy! Just make sure that the file extension will match
with your chosen .BEXT extension.
When you're ready, run the ./build script to build your Live Kit Distro.
The script will:
+ Build both ISO and ZIP files for you in /tmp
+ Do all the hard work for you.
+ Will automatically check for errors.
+ Will warn you if you don't have the correct packages.
NOTE:
WHEN YOU DOWNLOAD THIS KIT, MAKE SURE THAT ./build AND ./livekitlib IS
EXECUTABLE!

3
TODO
View File

@ -1,3 +1,4 @@
* copy DOC/* to Live Kit created * copy DOC/* to Live Kit created
* describe meaning of special files in bundles * describe meaning of special files in bundles
* PXE should include all possible .ko dependencies else some of the ethernet modules won't work, like b44.ko * PXE should include all possible .ko dependencies else some of the
networking modules won't work, like b44.ko

1
_config.yml 100644
View File

@ -0,0 +1 @@
theme: jekyll-theme-modernist

View File

@ -0,0 +1,59 @@
@echo off
cls
set DISK=none
set TESTFILE=testfile.tmp
echo This file is used to determine current drive letter. It should be deleted. >\%TESTFILE%
if not exist \%TESTFILE% goto readOnly
echo Determining drive letter...
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 if exist %%d:\%TESTFILE% set DISK=%%d
del \%TESTFILE%
if %DISK% == none goto DiskNotFound
rem User prompt
rem ============ BEGIN USER PROMPT ============
cls
echo ===========================================================
echo Boot setup: MyLinux
echo ===========================================================
echo Drive letter: %DISK%
echo ===========================================================
echo Thank you for choosing MyLinux!
echo Just make sure this is not your C: drive, or else
echo your OS (that is, Windows) will not boot!
echo.
echo Press any key to continue or press Ctrl-C to cancel...
pause >nul
rem ============ END USER PROMPT ============
echo.
echo Setting up boot record for %DISK%: Please wait...
if %OS% == Windows_NT goto setupNT
goto setup95
:setupNT
\boot\syslinux.exe -maf -d /boot/ %DISK%:
goto setupDone
:setup95
\boot\syslinux.com -maf -d /boot/ %DISK%:
:setupDone
echo Bootloader installation finished!
goto pauseit
:readOnly
echo Error: BootInstall.bat started from read-only media!
goto pauseit
:DiskNotFound
echo Error: Drive letter is non-existant!
:pauseit
echo Press any key to exit...
pause > nul
:end

View File

@ -0,0 +1,117 @@
#!/bin/sh
# Setup booting from disk (USB or harddrive)
# Requires: fdisk, df, tail, tr, cut, dd, sed
# Make sure that we are root
if [ $(id -u) -ne 0 ]; then
echo "> $(basename $0): Must be root to install bootloader!" >&2
exit 1
fi
# change working directory to dir from which we are started
CWD="$(pwd)"
BOOT="$(dirname "$0")"
cd "$BOOT"
# Program definitions
INST_NAME=`basename $0`
INST_PID=$$
LOGFILE="/tmp/$INST_NAME-$INST_PID.log"
# 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")" #"
# Try to use installed extlinux binary and
# fallback to extlinux.exe only if no installed
# extlinux is not found at all.
EXTLINUX="$(which extlinux 2>/dev/null)"
if [ -z "$EXTLINUX" ]; then
echo "> Falling back to included EXTLinux program..." >&2
EXTLINUX="./extlinux.exe"
fi
# Prompt user
#
clear
echo " +-+-+-+-+-+-+-+-+-+-+============+-+-+-+-+-+-+-+-+-+-+-+ "
echo " Boot setup: MyLinux"
echo " +-+-+-+-+-+-+-+-+-+-+============+-+-+-+-+-+-+-+-+-+-+-+ "
echo " Current device: $DEV"
echo " Current partition: $PART"
echo " +-+-+-+-+-+-+-+-+-=+-+-+-+>--<+-+-+-+=-+-+-+-+-+-+-+-+-+ "
echo " Thank you for choosing MyLinux!"
echo " Are you sure that you wanna install MyLinux on"
echo " this device? Make sure that you are not installing on"
echo " your local drive!"
echo " +-+-+-+-+-+-+-+-+-=+-+-+-+>--<+-+-+-+=-+-+-+-+-+-+-+-+-+ "
echo " Just press 'Enter' to continue or press Ctrl-C"
echo " to cancel the installation..."
read -p ' What are you waiting for... ' junk
# If he/she continues, check which disk are we on
if [ "$DEV" = "/dev/sda" ] || [ "$DEV" = "/dev/hda" ]; then
WARN_DISK=0
else
WARN_DISK=1
fi
if [ $WARN_DISK -eq 0 ]; then
# APT-like danger prompt
CONFIRM_TEXT="Yes, do as I say!"
echo "> Current partition: $PART" >&2
echo "> You are about to do something " >&2
echo "> dangerous to your system!" >&2
echo "> Type in to continue: 'Yes, do as I say!'"
read -p " ?] " CONFIRM
if test "$CONFIRM" != "$CONFIRM_TEXT"; then
echo "> Incorrect phrase!" >&2
echo "> No changes were made!" >&2
exit 1
fi
fi
echo
# notify user
echo "> WARNING: Do not interrupt at this stage!" >&2
echo "> Installing EXTLinux bootloader: Please wait..." >&2
# install bootloader
"$EXTLINUX" --install "$BOOT" 2>&1 | tee $LOGFILE | cat >&2
if [ $? -ne 0 ]; then
echo "> Failed to install boot loader!" >&2
echo "> Please read the errors above (and/or" >&2
echo "> consult the logfile at /tmp) and press Enter to exit." >&2
read junk
exit 1
else
echo "> Installation of EXTLinux bootloader was successful!"
fi
echo "> Initialising new MBR..." >&2
# MBR
if [ "$DEV" != "$PART" ]; then
# Setup MBR on the first block
dd bs=440 count=1 conv=notrunc if="$BOOT/mbr.bin" of="$DEV" 2>/dev/null
# Toggle a bootable flag
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
echo "Bootloader installation finished."
cd "$CWD"

View File

@ -1,47 +0,0 @@
@echo off
cls
echo ===============================================================================
echo Setting your drive to boot
echo ===============================================================================
echo.
set DISK=none
set BOOTFLAG=boot666s.tmp
echo This file is used to determine current drive letter. It should be deleted. >\%BOOTFLAG%
if not exist \%BOOTFLAG% goto readOnly
echo 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 if exist %%d:\%BOOTFLAG% set DISK=%%d
del \%BOOTFLAG%
if %DISK% == none goto DiskNotFound
echo.
echo Setting up boot record for %DISK%:, wait please...
if %OS% == Windows_NT goto setupNT
goto setup95
:setupNT
\boot\syslinux.exe -maf -d /boot/ %DISK%:
goto setupDone
:setup95
\boot\syslinux.com -maf -d /boot/ %DISK%:
:setupDone
echo Installation finished.
goto pauseit
:readOnly
echo You're starting boot installer from a read-only media, this will not work.
goto pauseit
:DiskNotFound
echo Error: can't find out current drive letter
:pauseit
echo Press any key to exit...
pause > nul
:end

View File

@ -1,47 +0,0 @@
#!/bin/sh
# Setup booting from disk (USB or harddrive)
# Requires: fdisk, df, tail, tr, cut, dd, sed
# change working directory to dir from which we are started
CWD="$(pwd)"
BOOT="$(dirname "$0")"
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")" #"
# Try to use installed extlinux binary and fallback to extlinux.exe only
# if no installed extlinux is not found at all.
EXTLINUX="$(which extlinux 2>/dev/null)"
if [ "$EXTLINUX" = "" ]; then
EXTLINUX="./extlinux.exe"
fi
"$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
dd bs=440 count=1 conv=notrunc if="$BOOT/mbr.bin" of="$DEV" 2>/dev/null
# Toggle a bootable flag
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
echo "Boot installation finished."
cd "$CWD"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -1,18 +1,17 @@
UI /boot/vesamenu.c32 UI /boot/vesamenu.c32
TIMEOUT 100
TIMEOUT 140
MENU ROWS 4
MENU CLEAR MENU CLEAR
MENU BACKGROUND /boot/bootlogo.png MENU ROWS 8
MENU BACKGROUND /boot/bootpic.png
DEFAULT main
LABEL default LABEL main
MENU LABEL Run Linux MENU LABEL Run MyLinux
KERNEL /boot/vmlinuz KERNEL /boot/vmlinuz
APPEND vga=769 initrd=/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 APPEND vga=normal initrd=/boot/initramfs.img load_ramdisk=1 rw printk.time=0
LABEL default LABEL debug
MENU LABEL Run Linux debug MENU LABEL Run MyLinux (debug)
KERNEL /boot/vmlinuz KERNEL /boot/vmlinuz
APPEND vga=769 initrd=/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 debug APPEND vga=normal initrd=/boot/initramfs.img load_ramdisk=1 rw printk.time=0 debug

View File

@ -4,6 +4,7 @@
# #
# Lines containing # are ignored # Lines containing # are ignored
# #
Thank you for using mylinux! Thank you for using mylinux!
Steps to make it bootable from your USB device: Steps to make it bootable from your USB device:

246
build
View File

@ -1,87 +1,231 @@
#!/bin/bash #!/bin/bash
# Linux Live Kit version 7
export PATH=.:./tools:../tools:/usr/sbin:/usr/bin:/sbin:/bin:/ # Linux Live Kit Improved v1.0
# Original version: Linux Live Kit version 7
# Modified/improved by: @johndah4x0r [terencedoesmc12 AT gmail DOT com]
CHANGEDIR=$(dirname $(readlink -f $0)) # Environment path
echo "Changing current directory to $CHANGEDIR" export PATH="${PATH}:.:./tools:../tools"
CWD="$(pwd)" source ./.config || exit 1
cd $CHANGEDIR source ./livekitlib || exit 1
. ./.config || exit 1
. ./livekitlib || exit 1
# only root can continue, because only root can read all files from your system # only root can continue, because only root can read all files from your system
allow_only_root allow_only_root
# check for mksquashfs with xz compression # Change directory to build environment
if [ "$(mksquashfs 2>&1 | grep "Xdict-size")" = "" ]; then CHANGEDIR="$(dirname $0)"
echo "mksquashfs not found or doesn't support -comp xz, aborting, no changes made" echo "Changing current directory to $CHANGEDIR"
echo "you may consider installing squashfs-tools package" CWD="$(pwd)"
exit 1 cd "$CHANGEDIR"
# It's building time!
clear
echo_sign "BUILD SCRIPT"
echo_livekit_msg "build: Doing a self-check..."
# Start with 0 errors
ERRS=0
# Check if mksquashfs supports XZ compression
if [ -z "$(mksquashfs 2>&1 | grep "Xdict-size")" ]; then
echo_err "build: 'mksquashfs': not-avail / not-supported"
(( ERRS+=1 ))
else
echo_livekit_msg "build: 'mksquashfs': avail + supported"
fi fi
MKISOFS=$(which mkisofs) # Check if either 'mkisofs' or 'genisoimage' exists
if [ "$MKISOFS" = "" ]; then MKISOFS="$(which mkisofs 2>/dev/null || \
MKISOFS=$(which genisoimage) which genisoimage 2>/dev/null)"
fi if [ -z "$MKISOFS" ]; then
if [ "$MKISOFS" = "" ]; then echo_err "build: 'mkisofs' / 'genisoimage': not-avail"
echo "Cannot found mkisofs or genisoimage, stop"
exit 3 # Hahaha! 'false'?!?!?
MKISOFS="false"
else
echo_livekit_msg "build: '$(basename $MKISOFS)': avail"
fi fi
# build initramfs image # Check if we have 'zip'
echo "Building intramfs image..." ZIP_CMD="$(which zip 2>/dev/null)"
if [ -z "$ZIP_CMD" ]; then
# since a ZIP archive is the core, we have to go to fatal mode!
echo_fatal "build: 'zip': not-avail"
echo_fatal "build: 'zip': Critically needed!"
(( ERRS+= 2 ))
else
echo_livekit_msg "build: 'zip': avail"
fi
if [ $ERRS -eq 0 ]; then
echo_livekit_msg "build: Problems found: $ERRS"
echo_livekit_msg "build: Self-check passed."
else
echo_err "build: Problems found: $ERRS"
echo_err "build: Self-check failed!"
echo_err "build: Please make sure that you have all needed packages installed!"
exit 1
fi
echo_livekit_msg "build: Preparing to build..."
clear
echo " ==========================================="
echo " Linux Live Kit version 2.0 (improved)"
echo " ==========================================="
echo " Live Kit information:"
echo " > Kernel version: $KERNEL"
echo " > Architecture: $ARCH"
echo " > Live Kit name: $LIVEKITNAME"
echo " > Bundle extension: '.$BEXT'"
read -p "Press Enter to continue or press Ctrl-C to cancel... " junk
# It's time to rock 'n roll!
clear
# Generate initramfs image (cpio-xz archive)
echo_livekit_msg "build: Generating initramfs CPIO-XZ image..."
cd initramfs cd initramfs
INITRAMFS=$(./initramfs_create "$LIVEKITNAME") INITRAMFS="$(./gen-initramfs "$LIVEKITNAME")"
cd .. cd ..
# create live kit filesystem (cpio archive) # Prepare the Live Kit archive
rm -Rf "$LIVEKITDATA" rm -Rf "$LIVEKITDATA"
echo_livekit_msg "build: Preparing boot files..."
BOOT="$LIVEKITDATA"/"$LIVEKITNAME"/boot BOOT="$LIVEKITDATA"/"$LIVEKITNAME"/boot
mkdir -p "$BOOT" mkdir -p "$BOOT"
mkdir -p "$BOOT"/../changes mkdir -p "$BOOT"/../changes
mkdir -p "$BOOT"/../modules mkdir -p "$BOOT"/../bundles
mv "$INITRAMFS" $BOOT/initrfs.img mv "$INITRAMFS" $BOOT/initramfs.img
cp bootfiles/* $BOOT cp 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 # do substitution
cat bootfiles/syslinux.cfg | sed -r "s:/boot/:/$LIVEKITNAME/boot/:" | \
sed -r "s:MyLinux:$LIVEKITNAME:" > $BOOT/syslinux.cfg
echo_livekit_msg "build: BootInstall.*: Replacing 'MyLinux' with '$LIVEKITNAME'..."
cat bootfiles/BootInstall.bat | sed -r "s:/boot/:/$LIVEKITNAME/boot/:" | \
sed -r "s:\\\\boot\\\\:\\\\$LIVEKITNAME\\\\boot\\\\:" | fgrep -iv "rem" | \
sed -r "s:MyLinux:$LIVEKITNAME:" > $BOOT/BootInstall.bat
cat bootfiles/BootInstall.sh | sed -r "s:MyLinux:$LIVEKITNAME:" > $BOOT/BootInstall.sh
echo_livekit_msg "build: Copying kernel..."
cp $VMLINUZ $BOOT/ cp $VMLINUZ $BOOT/
if [ -d sb ]; then # Copy files from include_bund/, but
cp sb/* $LIVEKITDATA/$LIVEKITNAME/ # do not skip bundle creation
else #
# create compressed bundles if [ -n "$(ls -A include_bund/ | grep ".$BEXT")" ]; then
for i in $MKMOD; do echo_livekit_msg "build: Copying bundles from include_bund/ ..."
mksquashfs /$i $LIVEKITDATA/$LIVEKITNAME/$i.$BEXT -comp xz -b 512k -keep-as-directory ls -A include_bund/ | grep ".$BEXT" | \
done while read BUND; do
cp $BUND "$LIVEKITDATA"/"$LIVEKITNAME"/bundles/
done
fi fi
# create compressed bundles
for i in $MKMOD; do
CMDOPT="$(get_exclude "$EXCLUDE" $i)"
echolog "CMDOPT = $CMDOPT" >&2
mkbund /$i $LIVEKITDATA/$LIVEKITNAME/00-main-$i.$BEXT \
-keep-as-directory $CMDOPT
done
# copy rootcopy folder # copy rootcopy folder
if [ -d rootcopy ]; then if [ -d rootcopy/ ]; then
cp -a rootcopy $LIVEKITDATA/$LIVEKITNAME/ echo_livekit_msg "build: Copying contents of rootcopy/..."
cp -a rootcopy/ $LIVEKITDATA/$LIVEKITNAME/
fi fi
# create ISO for CD image
echo "Creating ISO file for CD boot..."
cd "$LIVEKITDATA"
TARGET=/mnt/z TARGET=/mnt/z
if [ ! -d $TARGET ]; then if [ ! -d $TARGET ]; then
TARGET=/tmp TARGET=/tmp/livekit-build/
fi fi
ARCH=$(uname -m) if [ ! -d $TARGET ]; then
mkdir -p $TARGET &>/dev/null
fi
$MKISOFS -o "$TARGET/$LIVEKITNAME-$ARCH.iso" -v -J -R -D -A "$LIVEKITNAME" -V "$LIVEKITNAME" \ # Output file
OUT_FILE="$LIVEKITNAME-$ARCH-$PID"
# Checksum file
SUM_FILE="$TARGET/CHECKSUMS-${OUT_FILE}.TXT"
# Go to Live Kit build data
cd "$LIVEKITDATA"
# Create ISO image
echo_livekit_msg "build: Creating ISO file for CD boot..."
# How the F@-- can it be more compact than this!?!?
"$MKISOFS" -o "$TARGET/$OUT_FILE.iso" -v -J \
-R -D -A "$LIVEKITNAME" -V "$LIVEKITNAME" \
-no-emul-boot -boot-info-table -boot-load-size 4 \ -no-emul-boot -boot-info-table -boot-load-size 4 \
-b "$LIVEKITNAME"/boot/isolinux.bin -c "$LIVEKITNAME"/boot/isolinux.boot . \ -b "$LIVEKITNAME"/boot/isolinux.bin -c \
>/dev/null 2>/dev/null "$LIVEKITNAME"/boot/isolinux.boot . &>/dev/null
if [ $? -ne 0 ]; then
echo_warn "build: Failed to generate ISO image!"
SCAN=
else
echo_livekit_msg "build: ISO image: $OUT_FILE.iso"
SCAN=1
fi
cat "$CWD/bootinfo.txt" | fgrep -v "#" | sed -r "s/mylinux/$LIVEKITNAME/" | sed -r "s/\$/ /" > readme.txt # Substitute 'mylinux' with $LIVEKITNAME
echo "Creating ZIP for USB boot..." cat "$CWD/bootinfo.txt" | fgrep -v "#" | \
rm -f "$TARGET/$LIVEKITNAME-$ARCH.zip" sed -r "s/mylinux/$LIVEKITNAME/" | sed -r "s/\$//" > readme.txt
zip -0 -r "$TARGET/$LIVEKITNAME-$ARCH.zip" *
# Create ZIP archive for "universal" use
echo_livekit_msg "build: Creating ZIP for USB boot..."
rm -f "$TARGET/$OUT_FILE.zip"
zip -0 -r "$TARGET/$OUT_FILE.zip" * &>/dev/null
echo_livekit_msg "build: Output file: $OUT_FILE.zip"
echo_livekit_msg "build: Cleaning up..."
cd .. cd ..
rm -Rf "$LIVEKITDATA" rm -Rf "$LIVEKITDATA"
echo "finished. Find your result in $TARGET"
# just for aesthetics
echo_livekit_msg "build: Process ID: $PID - Your results is in $TARGET"
# Generate checksum(s)
echo_livekit_msg "build: Generating MD5 checksums: Please wait..."
if [ "$SCAN" ]; then
MD5_ISO="$(md5sum $TARGET/$OUT_FILE.iso 2>/dev/null | cut -d ' ' -f 1)"
else
MD5_ISO="< FAILED TO GENERATE ISO IMAGE! >"
fi
MD5_ZIP="$(md5sum $TARGET/$OUT_FILE.zip 2>/dev/null | cut -d ' ' -f 1)"
cat >"$SUM_FILE" <<EOF
Linux Live Kit Improved
----------------------------------------
Date: `date`
Process ID: $PID
Live Kit name: $LIVEKITNAME
MD5 Checksums for this build:
+ $OUT_FILE.iso - $MD5_ISO
+ $OUT_FILE.zip - $MD5_ZIP
Have a nice day!
EOF
echo_livekit_msg "build: $OUT_FILE.iso: $MD5_ISO"
echo_livekit_msg "build: $OUT_FILE.zip: $MD5_ZIP"
# Done!
echo_livekit_msg "Build process finished!"
echo "Have a nice day!"
read -p "Press Enter to continue..." junk
cd "$CWD"
clear

0
initramfs/cleanup 100644 → 100755
View File

View File

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
# Create initramfs image # Generate initramfs image
# Author: Tomas M <http://www.linux-live.org/> # Original author: Tomas M <http://www.linux-live.org/>
# # Modified by: 'JohnDaH4x0r' [terencedoesmc12 AT gmail DOT com]
. ../.config source ../.config
INITRAMFS=/tmp/$LIVEKITNAME-initramfs-$$ INITRAMFS=/tmp/$LIVEKITNAME-initramfs-$PID
# copy file to initramfs tree, including # copy file to initramfs tree, including
# all library dependencies (as shown by ldd) # all library dependencies (as shown by ldd)
@ -42,7 +42,9 @@ copy_including_deps()
} }
rm -Rf $INITRAMFS rm -Rf $INITRAMFS
mkdir -p $INITRAMFS/{bin,dev,etc,lib,lib64,mnt,proc,root,run,sys,tmp,usr,var/log}
# NEW: lib64 might be unnecessary to include.
mkdir -p $INITRAMFS/{bin,dev,etc,lib,mnt,proc,root,run,sys,tmp,usr,var/log}
ln -s bin $INITRAMFS/sbin ln -s bin $INITRAMFS/sbin
cd static cd static

84
initramfs/init 100644 → 100755
View File

@ -1,55 +1,93 @@
#!/bin/sh #!/bin/sh
# Initial script for Linux Live Kit # Initial script for Linux Live Kit / Linux Live Kit Improved
# Author: Tomas M <http://www.linux-live.org/> # Modified by: "JohnDaH4x0r" <terencedoesmc12 AT gmail.com>
# Modify and export/declare new PATH
export PATH=.:/:/usr/sbin:/usr/bin:/sbin:/bin export PATH=.:/:/usr/sbin:/usr/bin:/sbin:/bin
# Source Live Kit library script
. /lib/.config . /lib/.config
. /lib/livekitlib . /lib/livekitlib
# Declare start of 'init' state
clear
echo_sign "INIT START"
# Run switch_root: initramfs -> tmpfs
transfer_initramfs transfer_initramfs
# Directory variables pointing to /memory
MEMORY=/memory MEMORY=/memory
CHANGES=$MEMORY/changes CHANGES=$MEMORY/changes
UNION=$MEMORY/union UNION=$MEMORY/union
DATAMNT=$MEMORY/data DATAMNT=$MEMORY/data
BUNDLES=$MEMORY/bundles BUNDLES=$MEMORY/bundles
header "Live Kit init <http://www.linux-live.org/>" # Initliaise /proc, /sys and such
init_proc_sysfs init_proc_sysfs
# Initialise debugging if requested
debug_start debug_start
debug_shell dbg_shell_start
# load some modules manually first, then modprobe everything we have
# 1st debug shell interval
debug_shell
# Initialise important kernel modules
init_devs init_devs
init_aufs init_aufs
init_zram init_zram
# Then, modprobe everything
modprobe_everything modprobe_everything
# find data dir with filesystem bundles # Find data dir with filesystem bundles
DATA="$(find_data 60 "$DATAMNT")" # NEW:
debug_shell # Only 15 seconds before timeout, to minimize the
# setup persistent changes, if possible # pain of waiting a "whole" minute.
#
DATA="$(find_data 15 "$DATAMNT")"
# 2nd debug shell interval
debug_shell
# Setup persistent changes
persistent_changes "$DATA" "$CHANGES" persistent_changes "$DATA" "$CHANGES"
debug_shell
# copy to RAM if needed # 3rd debug shell interval
debug_shell
# Copy data to RAM if requested by user
DATA="$(copy_to_ram "$DATA" "$CHANGES")" DATA="$(copy_to_ram "$DATA" "$CHANGES")"
debug_shell
# init aufs union # Setup an empty union
init_union "$CHANGES" "$UNION" init_union "$CHANGES" "$UNION"
debug_shell
# add data to union # 4th debug shell interval
debug_shell
# Append bundles to union
union_append_bundles "$DATA" "$BUNDLES" "$UNION" union_append_bundles "$DATA" "$BUNDLES" "$UNION"
debug_shell
# rootcopy # 5th debug shell interval
debug_shell
# Copy contents of 'rootcopy/'
copy_rootcopy_content "$DATA" "$UNION" copy_rootcopy_content "$DATA" "$UNION"
# create empty fstab # Generate a basic 'fstab' with the core filesystems
fstab_create "$UNION" fstab_create "$UNION"
debug_shell
header "Live Kit done, starting $LIVEKITNAME" # 6th and final debug shell interval
debug_shell
# Declare the end of first 'init' state
clear
echo_sign "INIT END"
# Change root to main OS and let the 'init' in the
# main OS do the rest...
change_root "$UNION" change_root "$UNION"
header "!!ERROR occured, you shouldn't be here.!!" # < ======== NOTHING SHOULD GO OVER THIS LINE! ======== >
/bin/sh fatal "Unknown error!"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

814
livekitlib 100644 → 100755

File diff suppressed because it is too large Load Diff

View File

@ -31,12 +31,14 @@ sed -i -r "s:/boot/syslinux:/$LIVEKITNAME/boot:" core/fs/lib/loadconfig.c
make \ make \
${CC:+CC="$CC"} ${CC:+CC="$CC"}
echo
echo "Copying isolinux.bin to $(readlink -f '../../bootfiles/isolinux.bin')"
cp -p core/isolinux.bin ../../bootfiles/isolinux.bin cp -p core/isolinux.bin ../../bootfiles/isolinux.bin
echo echo "Cleaning up..."
echo "Copying isolinux.bin to $(realpath ../../bootfiles/isolinux.bin)"
cd .. cd ..
rm -Rf $PKG rm -Rf $PKG
rm -f $PKGTGZ rm -f $PKGTGZ
echo "Done!"