Skip to content

Commit

Permalink
Merge pull request #107 from drauger-os-development/testing
Browse files Browse the repository at this point in the history
Multiple updates
  • Loading branch information
Batcastle authored Oct 18, 2024
2 parents 843c378 + e94da8d commit c57beb9
Show file tree
Hide file tree
Showing 87 changed files with 1,574 additions and 1,078 deletions.
2 changes: 1 addition & 1 deletion .pep8speaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ scanner:
linter: pycodestyle # Other option is flake8

pycodestyle: # Same as scanner.linter value. Other option is flake8
max-line-length: 79 # Default is 79 in PEP 8
max-line-length: 100 # Default is 79 in PEP 8, 100 is used in pylint
ignore: # Errors and warnings to ignore
- W191

Expand Down
15 changes: 8 additions & 7 deletions DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Package: system-installer
Version: 2.5.5
Maintainer: Thomas Castleman <contact@draugeros.org>
Homepage: https://github.com/drauger-os-development/system-installer
Package: edamame
Version: 2.9.0
Maintainer: Thomas Castleman <batcastle@draugeros.org>
Homepage: https://github.com/drauger-os-development/edamame
Section: admin
Architecture: amd64
Priority: important
Depends: arch-install-scripts, python3 (>=3.6.7-1~18.04), bash, gir1.2-gtk-3.0 (>=3.24.12-1ubuntu1), coreutils (>=8.28-1ubuntu1), apt (>=1.6.11), squashfs-tools (>=1:4.3-6ubuntu0.18.04.1), zenity (>=3.28.1-1), grub2-common (>=2.02-2ubuntu8.13), initramfs-tools (>=0.130ubuntu3.8), systemd (>=237-3ubuntu10.24), locales (>=2.27-3ubuntu1), procps (>=2:3.3.12-3ubuntu1.1), grep (>=3.1-2), keyboard-configuration, util-linux (>=2.34-0.1ubuntu2), python3-parted (>=3.11.2), python3-psutil (>=5.5.0), python3-apt (>=2.0.0), python3-urllib3 (>=1.26.5-1~exp1), python3-gnupg (>=0.4.5), python3-xmltodict (>=0.11.0), python3-dnspython
Description: System Installer for Drauger OS
System Installer for Drauger OS
Replaces: system-installer (<=2.7.4)
Depends: arch-install-scripts, python3.11, bash, gir1.2-gtk-3.0 (>=3.24.12-1ubuntu1), coreutils (>=8.28-1ubuntu1), apt (>=1.6.11), squashfs-tools (>=1:4.3-6ubuntu0.18.04.1), grub2-common (>=2.02-2ubuntu8.13), initramfs-tools (>=0.130ubuntu3.8), systemd (>=237-3ubuntu10.24), locales (>=2.27-3ubuntu1), procps (>=2:3.3.12-3ubuntu1.1), grep (>=3.1-2), keyboard-configuration, util-linux (>=2.34-0.1ubuntu2), python3-parted (>=3.11.2), python3-psutil (>=5.5.0), python3-apt (>=2.0.0), python3-urllib3 (>=1.26.5-1~exp1), python3-gnupg (>=0.4.5), python3-xmltodict (>=0.11.0), python3-dnspython, tzdata, laptop-detect (>=0.16), libpython3.11
Description: System Installation utility
System Installation utility for Debian-based Operating Systems.
26 changes: 0 additions & 26 deletions DEBIAN/postinst

This file was deleted.

28 changes: 0 additions & 28 deletions DEBIAN/postrm

This file was deleted.

22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# system-installer
# Edamame
System Installation Utility for Drauger OS.

`system-installer` aims to provide a fast, modular method of installing a Debian-based operating system. As of now, it is not advised for use on systems that Linux new-comers will frequent, due to it's reliance upon `gparted` and the users understanding of how partitioning works.
**Formerly known as `system-installer`**

`edamame` aims to provide a fast, modular method of installing a Debian-based operating system. As of now, it is not advised for use on systems that Linux new-comers will frequent, due to it's reliance upon `gparted` and the users understanding of how partitioning works.

[Click here to view the current list of known bugs](https://github.com/drauger-os-development/system-installer/blob/master/known-bugs.md)

[Click here to view the list of planned features](https://github.com/drauger-os-development/system-installer/blob/master/planned-features.md)
[Click here to view the current list of known bugs](https://github.com/drauger-os-development/edamame/blob/master/known-bugs.md)

[Click here for notes on hacking on `system-installer`](https://github.com/drauger-os-development/system-installer/blob/master/hacking.md)
[Click here to view the list of planned features](https://github.com/drauger-os-development/edamame/blob/master/planned-features.md)

`system-installer` currently is known working only on Drauger OS, but is being adapted to work on other Debian-based OSs as well. `system-installer` is designed NOT to be specific to Drauger OS. So testing on other distros is encouraged!
[Click here for notes on hacking on `edamame`](https://github.com/drauger-os-development/edamame/blob/master/hacking.md)

`edamame` currently is known working only on Drauger OS, but is being adapted to work on other Debian-based OSs as well. `edamame` is designed NOT to be specific to Drauger OS. So testing on other distros is encouraged!


## Notable features
Expand All @@ -24,22 +26,22 @@ System Installation Utility for Drauger OS.
## Development


Interested in helping out with development? Great! Check out the notes on how to get started with development [here](https://github.com/drauger-os-development/system-installer/blob/master/development.md).
Interested in helping out with development? Great! Check out the notes on how to get started with development [here](https://github.com/drauger-os-development/edamame/blob/master/development.md).

## Other Notes


### `system-installer` requires `systemd`
### `edamame` requires `systemd`
This drawback is in place for a number of reasons:
* `systemd-boot` is easier and more reliable to install on UEFI than GRUB
* `systemd` makes setting up everything from keyboard to language to time significantly easier
* `systemd` is present on most Linux systems

### `system-installer` uses `GRUB` on `BIOS`, `systemd-boot` on `UEFI`
### `edamame` uses `GRUB` on `BIOS`, `systemd-boot` on `UEFI`
* `systemd-boot` does not support BIOS
* `GRUB` is a pain on UEFI

### Max 40+ MB *.deb
The *.deb is currently +40 MB because it packs a kernel to install inside the *.deb file.

This can be circumvented by passing the `--pool` flag to `build.sh`, and results in a *.deb with no kernel archive. To use this DEB, please be sure to have a folder in your ISO storing all necessary packages (kernel and systemd-boot-manager) and have that folder defined in `etc/system-installer/settings.json`.
This can be circumvented by passing the `--pool` flag to `build.sh`, and results in a *.deb with no kernel archive. To use this DEB, please be sure to have a folder in your ISO storing all necessary packages (kernel and systemd-boot-manager) and have that folder defined in `etc/edamame/settings.json`.
74 changes: 68 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mkdir ../"$FOLDER"
# Instead of compiling, we are building a tar.xz archive of the latest kernel package
# Don't make the archive if --pool passed
if [ "$OPTIONS" != "--pool" ]; then
cd usr/share/system-installer
cd usr/share/edamame
echo -e "\t###\tDOWNLOADING\t###\t"
rsync -vr "$PACK_URL" kernel
rsync -vr "$META_URL" kernel
Expand Down Expand Up @@ -58,8 +58,39 @@ fi

# Pshyc - we're compiling shit now
cd usr/bin
g++ -fPIE -m64 -o system-installer system-installer.cxx $(python3.10-config --ldflags --cflags --embed)
echo "Would you like to build with Python 3.11, or 3.12?"
read -p "Exit [0], Do Not Compile [1], Python 3.11 [2], Python 3.12 [3], : " ans
if $(echo "${ans,,}" | grep -qE "1|one|first"); then
vert="dnc"
elif $(echo "${ans,,}" | grep -qE "2|two|second|3.11"); then
vert="3.11"
elif $(echo "${ans,,}" | grep -qE "3|three|third|3.12"); then
vert="3.12"
elif $(echo "${ans,,}" | grep -qE "exit|quit|leave|e|q|x|0|no|zero"); then
echo "Exiting as requested..."
exit 1
else
echo "Input not recognized. Defaulting to Python 3.11"
fi
{
g++ -fPIE -m64 -o edamame edamame.cxx
} || {
echo "Build failed. Try making sure you have 'python${vert}-dev' and 'libpython${vert}-dev' installed" 1>&2
exit 2
}
cd ../..
files_to_edit=$(find "." -maxdepth 10 -type f -name '*.py' -print)
shebang='\#\!/usr/bin/env'
if [ "$vert" == "dnc" ]; then
shebang="$shebang python3"
elif [ "$vert" == "3.11" ]; then
shebang="$shebang python3.11"
elif [ "$vert" == "3.12" ]; then
shebang="$shebang python3.12"
fi
for each in $files_to_edit; do
sed -i "s:\#\!shebang:$shebang:" $each
done
##############################################################
# #
# #
Expand Down Expand Up @@ -101,6 +132,30 @@ fi
if [ -d srv ]; then
cp -R srv ../"$FOLDER"/srv
fi
##############################################################
# #
# #
# COMPILE ANYTHING NECSSARY HERE #
# #
# #
##############################################################
if [[ "$vert" != "dnc" ]]; then
cp nuitka_compile.sh ../"$FOLDER"/
cp compile.conf ../"$FOLDER"/
base="$PWD"
cd ../"$FOLDER"/
./nuitka_compile.sh --python-ver=$vert
rm -v nuitka_compile.sh compile.conf
cd "$base"
fi
##############################################################
# #
# #
# REMEMBER TO DELETE SOURCE FILES FROM TMP #
# FOLDER BEFORE BUILD #
# #
# #
##############################################################
cp -R DEBIAN ../"$FOLDER"/DEBIAN
mkdir -p usr/share/doc/$PAK
git log > usr/share/doc/$PAK/changelog
Expand All @@ -109,17 +164,24 @@ tar --verbose --create --xz -f changelog.gz changelog 1>/dev/null
rm changelog
cd ../../../..
base="$PWD"
cp -R usr/share/doc/$PAK ../"$FOLDER"/usr/share/doc/$PAK
cd ..
#DELETE STUFF HERE
if [ "$OPTIONS" != "--pool" ]; then
rm "$base"/usr/share/system-installer/kernel.tar.xz
rm "$base"/usr/share/edamame/kernel.tar.xz
fi
# delete binary files from repo
rm "$base"/usr/bin/system-installer
rm "$base"/usr/bin/edamame
# delete C++ source from package
rm "$FOLDER"/usr/bin/system-installer.cxx
rm "$FOLDER"/usr/bin/edamame.cxx
# delete Python cache files
find "$FOLDER" -maxdepth 10 -type d -name __pycache__ -exec rm -rfv {} \;
if [[ "$vert" != "dnc" ]]; then
find "$FOLDER" -maxdepth 10 -type d -name __pycache__ -exec rm -rfv {} \;
fi
#build the shit
dpkg-deb --build "$FOLDER"
rm -rf "$FOLDER"
cd "$base"
for each in $files_to_edit; do
sed -i "s:$shebang:\#\!shebang:" $each
done
34 changes: 34 additions & 0 deletions compile.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Compilation options
global_options="--show-progress --show-memory --show-modules --remove-output"
mod_options="--no-pyi-file"
sa_options="--python-flag=no_site"
jobs=8

# The below files will be compiled with Nuitka

# Edamame core files
mod usr/share/edamame/common.py
mod usr/share/edamame/auto_partitioner.py

# Edamame Module files
mod usr/share/edamame/modules/make_swap.py
mod usr/share/edamame/modules/set_time.py
mod usr/share/edamame/modules/auto_login_set.py
mod usr/share/edamame/modules/common.py
mod usr/share/edamame/modules/auto_partitioner.py

# UI files
mod usr/share/edamame/UI/common.py
mod usr/share/edamame/UI/auto_partitioner.py
mod usr/share/edamame/UI/main.py

# OEM files
mod usr/share/edamame/oem/auto_partitioner.py
mod usr/share/edamame/oem/post_install/configure/set_time.py
mod usr/share/edamame/oem/post_install/configure/auto_login_set.py

# Other files
mod usr/lib/python3/dist-packages/de_control/__init__.py
mod usr/lib/python3/dist-packages/de_control/_common.py
mod usr/lib/python3/dist-packages/de_control/immersion.py
mod usr/lib/python3/dist-packages/de_control/modify.py
18 changes: 10 additions & 8 deletions development.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Development environment setup

The following packages are required in order to do development for `system-installer`. Most of these packages are available in most distributions of Linux and many come pre-installed in some distros.
The following packages are required in order to do development for `edamame`. Most of these packages are available in most distributions of Linux and many come pre-installed in some distros.

* `python3`
* `gir1.2-gtk-3.0`
* `p7zip-full`
* `python3-parted`
* `python3-gnupg`
* `python3-dnspython`
* `python3-dev`
* `libpython3-dev`

The following are not required but may help out
* `arch-install-scripts`
Expand All @@ -17,17 +19,17 @@ The following are not required but may help out

To install all of the dependencies at once, use
```bash
sudo apt install -y python3 gir1.2-gtk-3.0 p7zip-full python3-parted python3-dev python3-gnupg arch-install-scripts coreutils squashfs-tools pylint
sudo apt install -y python3 gir1.2-gtk-3.0 p7zip-full python3-parted python3-dev python3-gnupg arch-install-scripts coreutils squashfs-tools pylint libpython3-dev
```

# How to get started

Do you know some programming and want to help out, but haven't worked on someone else's codebase before? This section is here for you. These are some recommended steps on how to contribute without diving into specifics.

1. Create a Github account (if necessary)
* It is strongly recommended to protect your github account with 2FA to protect us from your account being compromized.
* It is strongly recommended to protect your GitHub account with 2FA to protect us from your account being compromised.
* SMS 2FA is not recommended
2. Download and install a git management tool.
2. Download and install a git management tool.
* [Gitkraken](https://www.gitkraken.com) is recommended
* The rest of the guide assumes you are using Gitkraken.
3. Go to preferences==>SSH. Generate a new private/public key.
Expand All @@ -38,10 +40,10 @@ Do you know some programming and want to help out, but haven't worked on someone
8. Click on code ==> SSH and copy the URL provided
9. Go into Gitkraken and clone your forked repository using the SSH URL
10. When viewing your repository in Gitkraken, find the dev branch (remote) and have Gitkraken checkout. You should be checked out to the current dev branch of your repository
* While you are working, changes might be made to the Drauger OS repository you forked.
* While you are working, changes might be made to the Drauger OS repository you forked.
* If changes affect the files you are working on, you may need to rebase from your repository's page. Be aware that your work may be lost, so backup your working files.
* If you rebase, don't forget to pull from gitkraken.
11. Make the desired changes and commits.
* If you rebase, don't forget to pull from Gitkraken.
11. Make the desired changes and commits.
12. Push your commits to your repository as necessary
13. When you are finished making your changes, run through the pre-pull checklist
14. Go to the pull requests section of the Drauger OS repository and generate a pull request
Expand All @@ -63,7 +65,7 @@ A good rule of thumb is if your Python code gets a score of `7.5` or higher from
# Unit test instructions
_more coming soon_

You can find a number of tests to make sure your programs work correctly in the `tests` directory. These are currently tailored to how these programs are written, i.e. they work Python scripts. None of the UI is tested yet. Feel free to write more tests and request their addition in a pull request.
You can find a number of tests to make sure your programs work correctly in the `tests` directories. These are currently tailored to how these programs are written, i.e. they work for Python scripts. None of the UI is tested yet. Feel free to write more tests and request their addition in a pull request.

If, after modifying a function, the unit test fails, fix the issue in the function. Don't modify the unit test unless the functions interface has changed

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
"EXTRAS":true,
"UPDATES":false,
"LOGIN":false,
"COMPAT_MODE": false,
"MODEL":"Acer laptop",
"LAYOUT":"English(US)",
"VARIENT":"English(US) - English(US, euro on 5)",
"raid_array": {
"raid_type": null,
"disks": {
"1": null,
"2": null,
"3": null,
"4": null
}
"raid_type": null,
"disks": {
"1": null,
"2": null,
"3": null,
"4": null
}
}
},
"COMMENTS":["Any comments, put in this 'comment' field",
Expand Down
22 changes: 22 additions & 0 deletions etc/edamame/realtek.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"rtl8111b": "r8168-dkms",
"rtl8111c": "r8168-dkms",
"rtl8111d": "r8168-dkms",
"rtl8111e": "r8168-dkms",
"rtl8111f": "r8168-dkms",
"rtl8111g(s)": "r8168-dkms",
"rtl8111h(s)": "r8168-dkms",
"rtl8118(a)(s)": "r8168-dkms",
"rtl8119i": "r8168-dkms",
"rtl8111l": "r8168-dkms",
"rtl8168b": "r8168-dkms",
"rtl8168e": "r8168-dkms",
"rtl8168h": "r8168-dkms",
"rtl8111dp": "r8168-dkms",
"rtl8111ep": "r8168-dkms",
"rtl8111fp": "r8168-dkms",
"rtl8411": "r8168-dkms",
"rtl8411b": "r8168-dkms",
"rtl8821ce": "rtl8821ce-dkms"
}

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
},
"run_post_oem": ["/usr/bin/drauger-welcome"],
"kernel_meta_pkg": "linux-drauger",
"remove_pkgs": ["system-installer",
"persistence-daemon"]
"remove_pkgs": ["edamame",
"persistence-daemon"]
}
Loading

0 comments on commit c57beb9

Please sign in to comment.