Skip to content

Commit

Permalink
Merge pull request #45 from drauger-os-development/dev
Browse files Browse the repository at this point in the history
Bug fixes, Pool Folder support added
  • Loading branch information
Batcastle authored Oct 23, 2021
2 parents 01c8cd8 + 0beec70 commit a1d79ae
Show file tree
Hide file tree
Showing 17 changed files with 680 additions and 449 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.pyc
__pycache__
changelog.gz
changelog
2 changes: 1 addition & 1 deletion DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: system-installer
Version: 2.1.0
Version: 2.1.3
Maintainer: Thomas Castleman <contact@draugeros.org>
Homepage: https://github.com/drauger-os-development/system-installer
Section: admin
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ This drawback is in place for a number of reasons:
* `systemd-boot` does not support BIOS
* `GRUB` is a pain on UEFI

### +40 MB *.deb
### 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`.
81 changes: 47 additions & 34 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PAK=$(cat DEBIAN/control | grep 'Package: ' | sed 's/Package: //g')
ARCH=$(cat DEBIAN/control | grep 'Architecture: '| sed 's/Architecture: //g')
FOLDER="$PAK\_$VERSION\_$ARCH"
FOLDER=$(echo "$FOLDER" | sed 's/\\//g')
OPTIONS="$1"
mkdir ../"$FOLDER"
##############################################################
# #
Expand All @@ -14,40 +15,43 @@ mkdir ../"$FOLDER"
##############################################################

# Instead of compiling, we are building a tar.xz archive of the latest kernel package
cd usr/share/system-installer/modules
echo -e "\t###\tDOWNLOADING\t###\t"
rsync -vr rsync://apt.draugeros.org/aptsync/pool/main/l/linux-upstream kernel
rsync -vr rsync://apt.draugeros.org/aptsync/pool/main/l/linux-meta kernel
echo -e "\t###\tDELETING CRUFT\t###\t"
list=$(ls kernel)
for each in $list; do
remove=$(ls kernel/$each | grep -v 'amd64.deb$')
for each2 in $remove; do
rm -rfv kernel/$each/$each2
# Don't make the archive if --pool passed
if [ "$OPTIONS" != "--pool" ]; then
cd usr/share/system-installer
echo -e "\t###\tDOWNLOADING\t###\t"
rsync -vr rsync://apt.draugeros.org/aptsync/pool/main/l/linux-upstream kernel
rsync -vr rsync://apt.draugeros.org/aptsync/pool/main/l/linux-meta kernel
echo -e "\t###\tDELETING CRUFT\t###\t"
list=$(ls kernel)
for each in $list; do
remove=$(ls kernel/$each | grep -v 'amd64.deb$')
for each2 in $remove; do
rm -rfv kernel/$each/$each2
done
done
done
meta=$(echo kernel/linux-meta/$(ls kernel/linux-meta | sort -Vr | head -1))
dep=$(dpkg-deb --field $meta Depends | sed 's/, /\\|/g')
cd kernel/linux-upstream
rm -rfv $(ls | sed "/\($dep\)/d")
dep=$(echo "$dep" | sed 's/\\|/ /g' | awk '{print $1}' | sed 's/\(image-\|headers-\)/xanmod_/g')
rm -rfv $(ls | grep "edge")
rm -rfv $(ls | grep "cacule")
cd ../linux-meta
rm -rfv $(ls | grep -v "$dep")
rm -rfv $(ls | grep "edge")
rm -rfv $(ls | grep "cacule")
cd ..
dep=$(echo "$dep" | sed 's/xanmod_//g')
mv linux-upstream "$dep"
cd ..
# delete empty folders
find . -type d -empty -print -delete
echo -e "\t###\tCOMPRESSING\t###\t"
tar --verbose --create --xz -f kernel.tar.xz kernel
echo -e "\t###\tCLEANING\t###\t"
rm -rfv kernel
cd ../../../..
meta=$(echo kernel/linux-meta/$(ls kernel/linux-meta | sort -Vr | head -1))
dep=$(dpkg-deb --field $meta Depends | sed 's/, /\\|/g')
cd kernel/linux-upstream
rm -rfv $(ls | sed "/\($dep\)/d")
dep=$(echo "$dep" | sed 's/\\|/ /g' | awk '{print $1}' | sed 's/\(image-\|headers-\)/xanmod_/g')
rm -rfv $(ls | grep "edge")
rm -rfv $(ls | grep "cacule")
cd ../linux-meta
rm -rfv $(ls | grep -v "$dep")
rm -rfv $(ls | grep "edge")
rm -rfv $(ls | grep "cacule")
cd ..
dep=$(echo "$dep" | sed 's/xanmod_//g')
mv linux-upstream "$dep"
cd ..
# delete empty folders
find . -type d -empty -print -delete
echo -e "\t###\tCOMPRESSING\t###\t"
tar --verbose --create --xz -f kernel.tar.xz kernel
echo -e "\t###\tCLEANING\t###\t"
rm -rfv kernel
cd ../../../..
fi
##############################################################
# #
# #
Expand Down Expand Up @@ -90,9 +94,18 @@ if [ -d srv ]; then
cp -R srv ../"$FOLDER"/srv
fi
cp -R DEBIAN ../"$FOLDER"/DEBIAN
mkdir -p usr/share/doc/$PAK
git log > usr/share/doc/$PAK/changelog
cd usr/share/doc/$PAK
tar --verbose --create --xz -f changelog.gz changelog 1>/dev/null
rm changelog
cd ../../../..
base="$pwd"
cd ..
#DELETE STUFF HERE
rm system-installer/usr/share/system-installer/modules/kernel.tar.xz
if [ "$OPTIONS" != "--pool" ]; then
rm system-installer/usr/share/system-installer/modules/kernel.tar.xz
fi
#build the shit
dpkg-deb --build "$FOLDER"
rm -rf "$FOLDER"
2 changes: 1 addition & 1 deletion development.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development Setup and Tools

The following packages are required in order to do development for `system-istaller`. 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 `system-installer`. 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`
Expand Down
1 change: 1 addition & 0 deletions etc/system-installer/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"squashfs_Location": "/run/live/medium/live/filesystem.squashfs",
"local_repo": "/run/live/medium/repo",
"distro": "Drauger OS",
"report": {
"recv_keys": "https://download.draugeros.org/keys/public_keys.asc",
Expand Down
Loading

0 comments on commit a1d79ae

Please sign in to comment.