This commit is contained in:
Ella-0 2021-02-15 15:06:41 +00:00
commit 72c2758136
6 changed files with 129 additions and 26 deletions

27
build_utils Executable file
View file

@ -0,0 +1,27 @@
cp_packages (){
#IMPORTANT: must be run from the folder where the iglunix repo is.
#NOTE: this will assume that there always is a '*-dev'/'*-doc' package,\n this is not true.
# That's why the errors are shown to some one who cares.
echo "Hello this is build-utils"
for pkg in ${packages[@]}
do
if [ ! -d pkgs/${pkg}/out ]; then
echo "NOTE: ${pkg} was not yet build, building it now"
cd pkgs/${pkg}/
../../iglupkg.sh
cd ../..
fi
echo "Going to copy: $pkg to $1"
tar -xf pkgs/${pkg}/out/${pkg}.*.tar.xz -C $1
tar -xf pkgs/${pkg}/out/${pkg}-dev.*.tar.xz -C $1 2> /dev/null
tar -xf pkgs/${pkg}/out/${pkg}-doc.*.tar.xz -C $1 2> /dev/null
done
}

View file

@ -10,37 +10,30 @@
#
# Create the root fs dir
echo "geninitrd.sh"
source build_utils
rm -rf isoout isoroot
mkdir isoroot
mkdir isoout
mkdir diskroot
cp_packages (){
#NOTE: this will assume that there always is a '*-dev'/'*-doc' package,\n this is not true.
# That's why the errors are shown to some one who cares.
for pkg in ${packages[@]}
do
echo "Going to copy: $pkg to $1"
tar -xf pkgs/${pkg}/out/${pkg}.*.tar.xz -C $1
tar -xf pkgs/${pkg}/out/${pkg}-dev.*.tar.xz -C $1 2> /dev/null
tar -xf pkgs/${pkg}/out/${pkg}-doc.*.tar.xz -C $1 2> /dev/null
done
}
# This should be a minimal number of packages, if we want fast boot times.
# The remaining packages are in createimg.sh
#packages=(musl mksh bmake gmake libressl cmake curl rsync linux flex byacc om4 zlib samurai libffi python ca-certificates zlib expat gettext-tiny git kati netbsd-curses kakoune iglunix)
packages=(musl linux mksh busybox toybox iglunix)
cp_packages ./isoroot
#packages=(musl mksh busybox toybox llvm bmake gmake libressl cmake curl rsync linux flex byacc om4 zlib samurai libffi python ca-certificates zlib expat gettext-tiny git kati netbsd-curses kakoune iglunix rust less heirloom-doctools file pci-ids)
#cp_packages ./diskroot
cat >isoroot/init << EOF
#!/bin/sh
exec /sbin/init
EOF
rm isoroot/sbin/init
cat >isoroot/sbin/init << EOF
cat >isoroot/sbin/init << 'EOF'
#!/bin/sh
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
@ -54,17 +47,17 @@ mount -t tmpfs tmpfs /tmp
busybox mdev -s
busybox mdev -d
exec /bin/sh
mkdir /mnt
# while not mount $(blkid -L IGLUNIX_BS_MEDIA) /mnt; do
# echo "Failed to mount boot disk"
# echo "Retrying"
# sleep 0.5
# done
while ! mount $(findfs LABEL=__IGLUNIX_ROOT) /mnt; do
echo "Failed to mount boot disk"
echo "Retrying"
sleep 0.5
done
exec switch_root /mnt
echo "Starting switch_root"
exec switch_root /mnt /bin/sh
EOF
@ -115,6 +108,8 @@ chmod +x isoroot/sbin/init
# cp /etc/inittab isoroot/etc/
cp /etc/hostname ./isoroot/hostname
cd isoroot
find . | cpio -ov | gzip -9 >../isoout/initramfs.img
cp boot/vmlinuz ../isoout/vmlinuz

51
pkgs/e2fsprogs/build.sh Normal file
View file

@ -0,0 +1,51 @@
pkgname=e2fsprogs
pkgver=1.45.6
bad="gmake"
fetch() {
curl -L "https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v$pkgver/$pkgname-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz
tar -xf $pkgname-$pkgver.tar.xz
}
build() {
cd $pkgname-$pkgver
echo "$pkgdir"
./configure \
--prefix=/usr \
--build=x86_64-unknown-linux-musl \
--host=x86_64-unknown-linux-musl \
#--exec_prefix=/
gmake
}
package() {
cd $pkgname-$pkgver
# Doesn't work :(
#gmake install DESTDIR=$pkgdir PREFIX=/usr
# We're not moving util/subst
# Do we need to? IDK
mkdir -p $pkgdir/usr/bin
mkdir -p $pkgdir/usr/lib
mv misc/badblocks misc/blkid misc/chattr misc/dumpe2fs misc/e2freefrag misc/e2fuzz misc/e2image \
misc/e2initrd_helper misc/e2undo misc/e4crypt misc/e4defrag misc/filefrag misc/fsck \
misc/logsave misc/lsattr misc/mke2fs misc/mklost+found misc/tune2fs misc/uuidd misc/uuidgen \
$pkgdir/usr/bin
mv e2fsck/e2fsck debugfs/debugfs resize/resize2fs $pkgdir/usr/bin
cd lib
mv libblkid.a libe2p.a libss.a libuuid.a libcom_err.a libext2fs.a libsupport.a $pkgdir/usr/lib
}
license() {
cd $pkgname-$pkgver
cat NOTICE
}

29
pkgs/kbd/build.sh Normal file
View file

@ -0,0 +1,29 @@
pkgname=kbd
pkgver=2.4.0
fetch() {
curl "https://mirrors.edge.kernel.org/pub/linux/utils/kbd/kbd-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz
tar -xf $pkgname-$pkgver.tar.xz
}
build() {
cd $pkgname-$pkgver
./configure \
--prefix=/usr \
--build=x86_64-unknown-linux-musl \
--host=x86_64-unknown-linux-musl
make
}
package() {
cd $pkgname-$pkgver
make install DESTDIR=$pkgdir
}
license() {
cd $pkgname-$pkgver
cat COPYING
}

View file

@ -26,6 +26,5 @@ package() {
license() {
cd $pkgname-$pkgver
cat LICENSE
# cat COPYING
cat COPYING
}

View file

@ -11,6 +11,8 @@ fetch() {
package() {
cd $pkgname-$pkgver
rm -rf /tiny-linux-bootloader
mkdir /tiny-linux-bootloader
CURR_DIR=$(pwd)