Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jaromaz/yosild
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.1
Choose a base ref
...
head repository: jaromaz/yosild
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 18 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 4, 2021

  1. VirtIO exclusion notice

    jaromaz committed Nov 4, 2021
    Copy the full SHA
    87e8f23 View commit details

Commits on Nov 9, 2021

  1. Kernel 5.15.1

    jaromaz committed Nov 9, 2021
    Copy the full SHA
    5577ca7 View commit details

Commits on Dec 27, 2021

  1. Kernel 5.15.11

    jaromaz committed Dec 27, 2021
    Copy the full SHA
    2c0b835 View commit details

Commits on Jan 10, 2022

  1. Kernel 5.15.13

    jaromaz committed Jan 10, 2022
    Copy the full SHA
    86e91f8 View commit details
  2. Kernel 5.15.13

    jaromaz committed Jan 10, 2022
    Copy the full SHA
    a37e8bc View commit details

Commits on Jan 20, 2022

  1. Kernel 5.16.1

    jaromaz committed Jan 20, 2022
    Copy the full SHA
    c0dcc29 View commit details
  2. Kernel 5.16.1

    jaromaz committed Jan 20, 2022
    Copy the full SHA
    a1e5b9f View commit details

Commits on Jan 24, 2022

  1. Copy the full SHA
    98c0419 View commit details
  2. Kernel 5.16.2

    jaromaz committed Jan 24, 2022
    Copy the full SHA
    8a58f26 View commit details
  3. Logrotate fix

    jaromaz committed Jan 24, 2022
    Copy the full SHA
    89c103b View commit details

Commits on Apr 12, 2022

  1. Hyper-V support

    jaromaz committed Apr 12, 2022
    Copy the full SHA
    06623f9 View commit details
  2. Hyper-V support

    jaromaz committed Apr 12, 2022
    Copy the full SHA
    04b8cff View commit details
  3. Hyper-V support

    jaromaz committed Apr 12, 2022
    Copy the full SHA
    6a5d3f0 View commit details
  4. Kernel 5.16.19

    jaromaz committed Apr 12, 2022
    Copy the full SHA
    46697e2 View commit details
  5. Hyper-V support

    jaromaz committed Apr 12, 2022
    Copy the full SHA
    00d0ecd View commit details

Commits on Jul 9, 2022

  1. Update README.md

    jaromaz committed Jul 9, 2022
    Copy the full SHA
    b990ccb View commit details
  2. Update README.md

    jaromaz committed Jul 9, 2022
    Copy the full SHA
    adf49d3 View commit details

Commits on Aug 9, 2022

  1. Update README.md

    jaromaz authored Aug 9, 2022
    Copy the full SHA
    da9152a View commit details
Showing with 63 additions and 43 deletions.
  1. +23 −15 README.md
  2. +40 −28 yosild.sh
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# Yosild - Your simple Linux distro

Yosild is a single shell script that builds a full, minimal Linux distribution,
based on BusyBox. It compiles the **latest stable kernel** (5.14.15) and the
**latest stable version of the BusyBox** (1.34.1). This script can prepare
based on BusyBox. It compiles the **stable kernel** 5.16.19 and the
**latest stable version of the BusyBox** 1.34.1. This script can prepare
minimalistic Linux system for devices with little hardware resources. Yosild Linux
needs just **64 MB RAM** and **36 MB storage size**. *yosild.sh* requires [minimal][1]
*Debian* or *Ubuntu* distro to run with the architecture compatible with the target device.

The script works with VirtualBox or KVM/QEMU - you can create an additional virtual hard
drive and install Yosild Linux on it, and then connect this virtual disk to a new virtual
machine - just like in my [YouTube video][3]:
needs just **70 MB RAM** and **40 MB storage size**. *yosild.sh* requires
[minimal][1] *Debian* or *Ubuntu* distro to run with the architecture compatible
with the target device.

The script works with VirtualBox, Hyper-V and KVM/QEMU (all drive types except
VirtIO) - you can create an additional virtual hard drive and install Yosild Linux
on it, and then connect this virtual disk to a new virtual machine - just like in
my [YouTube video][3]:
<p align="center"><a href="https://www.youtube.com/watch?v=BPXxPZBBeJ0" target="_blank"><img src="https://jm.iq.pl/yosild/yosild_mov2.jpg" width="50%"></a></p>

Yosild creates probably the simplest, complete version of Linux, which makes it easier
to understand, how to build the system from scratch. It is much easier to build
than other, previously available solutions: Aboriginal, mkroot, Buildroot or Linux
From Scratch - just specify the target drive (virtual or flash drive) inside the
*yosild.sh* script and simply run the script. You can also rename the system to make
it your distribution.

Yosild creates probably the simplest, complete version of Linux, which makes it
easier to understand, how to build the system from scratch and how to use it.
Yosild is much easier to build than other, previously available solutions:
Aboriginal, mkroot, Buildroot or Linux From Scratch. Just specify the target
drive (virtual or flash drive) inside the *yosild.sh* script and simply run the
script. You can also rename the system to make it your distribution.

**Yosild**:

@@ -44,6 +45,13 @@ Yosild is licensed under GNU General Public License v3.0.

For more information please visit my website: [https://jm.iq.pl/yosild][2]

### Support

You can transfer any funds you wish to my
*[PayPal account](https://www.paypal.com/paypalme/jaromaz)* if you want to
support this project.


[1]: https://www.debian.org/CD/netinst/
[2]: https://jm.iq.pl/yosild
[3]: https://www.youtube.com/watch?v=BPXxPZBBeJ0
68 changes: 40 additions & 28 deletions yosild.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/bin/sh

# -------------------------------------
# Yosild 3.1 - Your simple Linux distro
# ---------------------------------------
# Yosild - Your simple Linux distro
version="3.2.1"
# (c) Jaromaz https://jm.iq.pl
# Yosild is licensed under
# GNU General Public License v3.0
# -------------------------------------
# ---------------------------------------

# ----- Config ------------------------
device="vdb"
# ----- Config --------------------------
device="sdc"
distro_name="Yosild"
distro_desc="Your simple Linux distro"
distro_version="3.1"
distro_codename="chinchilla"
telnetd="true"
kernel="https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.14.15.tar.xz"
telnetd_enabled="true"
hyperv_support="false"
kernel="https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.16.19.tar.xz"
busybox="https://busybox.net/downloads/busybox-1.34.1.tar.bz2"
# -------------------------------------
# ---------------------------------------

if [ $(id -u) -ne 0 ]; then
echo "Run as root"; exit 1
@@ -56,11 +56,11 @@ if [ $answer != "y" ] ; then
cd busybox
make defconfig

# BusyBox configuration ------
# BusyBox configuration --------------------------------
sed 's/^.*CONFIG_STATIC.*$/CONFIG_STATIC=y/' -i .config
sed 's/^CONFIG_MAN=y/CONFIG_MAN=n/' -i .config
echo "CONFIG_STATIC_LIBGCC=y" >> .config

# ------------------------------------------------------
make
cd ../../
fi
@@ -98,12 +98,21 @@ if [ $answer != "y" ] ; then
rm linux-*.tar.xz
mv linux* linux
cd linux
make defconfig

# Linux Kernel configuration -----
sed "s/Debian/$distro_name/" -i .config
# --------------------------------

# Linux Kernel config --------------------------------------
if [ "$hyperv_support" = "true" ]; then
cat <<EOF >> arch/x86/configs/x86_64_defconfig
CONFIG_HYPERVISOR_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_CONNECTOR=y
CONFIG_HYPERV=y
CONFIG_HYPERV_NET=y
EOF
fi
# ----------------------------------------------------------

make defconfig
make
cd ../../
fi
@@ -158,7 +167,7 @@ cat << EOF > var/www/html/index.html
<!DOCTYPE html><html lang="en"><head><title>$distro_name httpd default page: It works</title>
<style>body{background-color:#004c75;}h1,p{margin-top:60px;color:#d4d4d4;
text-align:center;font-family:Arial}</style></head><body><h1>It works!</h1><hr>
<p><b>$distro_name httpd</b> default page<br>ver. $distro_version</p></body></html>
<p><b>$distro_name httpd</b> default page<br>ver. $version</p></body></html>
EOF

# fstab
@@ -172,16 +181,18 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
export PS1="\\e[0;32m\\u@\\h:\\w\\\$ \\e[m"
[ \$(id -u) -eq 0 ] && export PS1="\\u@\\h:\\w# "
alias vim=vi
alias su="su -l"
alias exit="clear;exit"
alias logout="clear;logout"
alias l.='ls -d .*'
alias ll='ls -Al'
alias su='su -l'
alias logout='clear;exit'
alias exit='clear;exit'
alias locate=which
alias whereis=which
alias logout=exit
alias useradd=adduser
EOF

# banner
printf "\n\e[96m${*}$distro_name\e[0m${*} Linux \e[97m${*}$distro_version\e[0m${*} - $distro_desc\n\n" | tee -a etc/issue usr/share/infoban >/dev/null
printf "\n\e[96m${*}$distro_name\e[0m${*} Linux \e[97m${*}$version\e[0m${*} - $distro_desc\n\n" | tee -a etc/issue usr/share/infoban >/dev/null
cat << EOF >> etc/issue
* Default root password: Yosild
* Networking: ifupdown
@@ -203,8 +214,8 @@ EOF
cat << EOF > etc/os-release
PRETTY_NAME="$distro_name - $distro_desc ($distro_codename)"
NAME="$distro_name"
VERSION_ID="$distro_version"
VERSION="$distro_version"
VERSION_ID="$version"
VERSION="$version"
VERSION_CODENAME="$distro_codename"
ID="$distro_name"
HOME_URL="https://github.com/jaromaz/yosild"
@@ -316,11 +327,11 @@ cat << EOF > var/spool/cron/crontabs/root
EOF

# logrotate
cat << EOF > etc/cron/daily/logrotate
cat << EOF > usr/sbin/logrotate
#!/bin/sh
maxsize=512
dir=/var/log
for log in messages lastlog; do
for log in \$(ls -1 \${dir} | grep -Ev '\.gz$'); do
size=\$(du "\$dir/\$log" | tr -s '\t' ' ' | cut -d' ' -f1)
if [ "\$size" -gt "\$maxsize" ] ; then
tsp=\$(date +%s)
@@ -330,6 +341,7 @@ for log in messages lastlog; do
fi
done
EOF
ln -s ../../../usr/sbin/logrotate etc/cron/daily/logrotate

# init scripts installer
cat << EOF > usr/bin/add-rc.d
@@ -381,7 +393,7 @@ PIDFILE=/var/run/$1.pid
init \$@
EOF
chmod 744 etc/init.d/$1
[ $1 = 'telnetd' ] && [ "$telnetd" = false ] && continue;
[ $1 = 'telnetd' ] && [ "$telnetd_enabled" = false ] && continue;
[ "$3" ] && ln -s ../init.d/$1 etc/rc.d/$3$1.sh
done

@@ -424,7 +436,7 @@ chmod 664 var/log/lastlog var/log/wtmp
chmod 4755 bin/busybox
chmod 600 var/spool/cron/crontabs/root
chmod 755 usr/sbin/nologin sbin/disban init sbin/man etc/init.d/rcS\
etc/cron/daily/logrotate usr/bin/add-rc.d sbin/halt\
usr/sbin/logrotate usr/bin/add-rc.d sbin/halt\
usr/share/udhcpc/default.script
chmod 644 etc/passwd etc/group etc/hostname etc/shells etc/hosts etc/fstab\
etc/issue etc/motd etc/network/interfaces etc/profile