diff --git a/pl-files/compile-modules/gcc.rb b/pl-files/compile-modules/gcc.rb index b0b5778..814d84b 100644 --- a/pl-files/compile-modules/gcc.rb +++ b/pl-files/compile-modules/gcc.rb @@ -84,21 +84,27 @@ def toolchainBuild globalVars puts "Done." end - if File.exist?("#{globalVars["sysroot"]}/lib/libpl32.so") == false - print "Building pl32lib-ng..." - compilePl32lib("pl32lib-ng", "compile", [ "--prefix=#{globalVars["sysroot"]} --target=#{globalVars["triple"]} CC=#{globalVars["tcprefix"]}/bin/#{globalVars["cross_cc"]} CFLAGS='-Os'", "build" ], globalVars) - puts "Done." - print "Installing pl32lib-ng..." - compilePl32lib("pl32lib-ng", "compile", "install", globalVars) + if File.exist?("#{globalVars["sysroot"]}/lib/libz.so") == false + print "Building zlib..." + Dir.chdir("#{globalVars["buildDir"]}/zlib-#{globalVars["zlib"]}") + if File.exist?("build") == false + Dir.mkdir("build") + end + Dir.chdir("build") + blockingSpawn({"CC" => "#{globalVars["tcprefix"]}/bin/#{globalVars["cross_cc"]}", "AR" => "#{globalVars["tcprefix"]}/bin/#{globalVars["triple"]}-ar"}, "../configure --prefix=#{globalVars["sysroot"]} 2>#{globalVars["baseDir"]}/logs/zlib-error.log 1>#{globalVars["baseDir"]}/logs/zlib.log"); + blockingSpawn("make -j#{globalVars["threads"]} 2>#{globalVars["baseDir"]}/logs/zlib-error.log 1>#{globalVars["baseDir"]}/logs/zlib.log"); + puts "Done." + print "Installing zlib..." + blockingSpawn("make install 2>#{globalVars["baseDir"]}/logs/zlib-error.log 1>#{globalVars["baseDir"]}/logs/zlib.log") puts "Done." end - if File.exist?("#{globalVars["sysroot"]}/lib/libplml.so") == false - print "Building libplml..." - compilePl32lib("libplml", "compile", [ "--prefix=#{globalVars["sysroot"]} --target=#{globalVars["triple"]} CC=#{globalVars["tcprefix"]}/bin/#{globalVars["cross_cc"]} CFLAGS='-Os'", "build" ], globalVars) + if File.exist?("#{globalVars["sysroot"]}/lib/libplrt.so") == false + print "Building pl-rt..." + compilePl32lib("pl-rt", "compile", [ "--prefix=#{globalVars["sysroot"]} --target=#{globalVars["triple"]} CC=#{globalVars["tcprefix"]}/bin/#{globalVars["cross_cc"]} CFLAGS='-Os'", "build" ], globalVars) puts "Done." - print "Installing libplml..." - compilePl32lib("libplml", "compile", "install", globalVars) + print "Installing pl-rt..." + compilePl32lib("pl-rt", "compile", "install", globalVars) puts "Done." end end diff --git a/pl-files/compile-modules/rootfs.rb b/pl-files/compile-modules/rootfs.rb index 017a07f..236bb41 100644 --- a/pl-files/compile-modules/rootfs.rb +++ b/pl-files/compile-modules/rootfs.rb @@ -27,12 +27,27 @@ def rootfsBuild globalVars puts "Done." end + if File.exist?("#{globalVars["outputDir"]}/rootfs/usr/lib/libz.so") == false + print "Building zlib..." + Dir.chdir("#{globalVars["buildDir"]}/zlib-#{globalVars["zlib"]}") + if File.exist?("build") == false + Dir.mkdir("build") + end + Dir.chdir("build") + blockingSpawn({"CC" => "#{globalVars["tcprefix"]}/bin/#{globalVars["cross_cc"]}", "AR" => "#{globalVars["tcprefix"]}/bin/#{globalVars["triple"]}-ar"}, "../configure --prefix=/usr --includedir=/opt/include 2>#{globalVars["baseDir"]}/logs/zlib-error.log 1>#{globalVars["baseDir"]}/logs/zlib.log"); + blockingSpawn("make -j#{globalVars["threads"]} 2>#{globalVars["baseDir"]}/logs/zlib-error.log 1>#{globalVars["baseDir"]}/logs/zlib.log"); + puts "Done." + print "Installing zlib..." + blockingSpawn("make install DESTDIR=#{globalVars["outputDir"]}/rootfs 2>#{globalVars["baseDir"]}/logs/zlib-error.log 1>#{globalVars["baseDir"]}/logs/zlib.log") + puts "Done." + end + if File.exist?("#{globalVars["outputDir"]}/rootfs/usr/bin/toybox") == false print "Building Toybox..." Dir.chdir("#{globalVars["buildDir"]}/toybox-#{globalVars["toybox"]}") system("make defconfig 2>#{globalVars["baseDir"]}/logs/toybox-error.log >#{globalVars["baseDir"]}/logs/toybox.log") configFile = File.open(".config", "a") - configFile.write("CONFIG_SH=y\nCONFIG_DD=y\nCONFIG_EXPR=y\nCONFIG_GETTY=y\nCONFIG_MDEV=y\n") + configFile.write("CONFIG_SH=y\nCONFIG_DD=y\nCONFIG_EXPR=y\nCONFIG_GETTY=y\nCONFIG_MDEV=y\nCONFIG_TOYBOX_LIBZ=y\n") configFile.close() system("make -j#{globalVars["threads"]} CC=#{globalVars["tcprefix"]}/bin/#{globalVars["cross_cc"]} CFLAGS=#{globalVars["cross_cflags"]} 2>>#{globalVars["baseDir"]}/logs/toybox-error.log >>#{globalVars["baseDir"]}/logs/toybox.log") puts "Done" @@ -41,21 +56,12 @@ def rootfsBuild globalVars puts "Done." end - if File.exist?("#{globalVars["outputDir"]}/rootfs/usr/lib/libpl32.so") == false - print "Building pl32lib-ng..." - compilePl32lib("pl32lib-ng", "compile", [ "--prefix=#{globalVars["outputDir"]}/rootfs/usr --includedir=#{globalVars["outputDir"]}/rootfs/opt/include --target=#{globalVars["triple"]} CC=#{globalVars["tcprefix"]}/bin/#{globalVars["cross_cc"]} CFLAGS='-Os'", "build" ], globalVars) - puts "Done." - print "Installing pl32lib-ng..." - compilePl32lib("pl32lib-ng", "compile", "install", globalVars) - puts "Done." - end - - if File.exist?("#{globalVars["outputDir"]}/rootfs/usr/lib/libplml.so") == false - print "Building libplml..." - compilePl32lib("libplml", "compile", [ "--prefix=#{globalVars["outputDir"]}/rootfs/usr --includedir=#{globalVars["outputDir"]}/rootfs/opt/include --target=#{globalVars["triple"]} CC=#{globalVars["tcprefix"]}/bin/#{globalVars["cross_cc"]} CFLAGS='-Os'", "build" ], globalVars) + if File.exist?("#{globalVars["outputDir"]}/rootfs/usr/lib/libplrt.so") == false + print "Building pl-rt..." + compilePl32lib("pl-rt", "compile", [ "--prefix=#{globalVars["outputDir"]}/rootfs/usr --includedir=#{globalVars["outputDir"]}/rootfs/opt/include --target=#{globalVars["triple"]} CC=#{globalVars["tcprefix"]}/bin/#{globalVars["cross_cc"]} CFLAGS='-Os'", "build" ], globalVars) puts "Done." - print "Installing libplml..." - compilePl32lib("libplml", "compile", "install", globalVars) + print "Installing pl-rt..." + compilePl32lib("pl-rt", "compile", "install", globalVars) puts "Done." end diff --git a/pl-files/configure-files/gcc.yaml b/pl-files/configure-files/gcc.yaml index 83f2151..8edc747 100644 --- a/pl-files/configure-files/gcc.yaml +++ b/pl-files/configure-files/gcc.yaml @@ -1,3 +1,3 @@ toolchain: "gcc" -pkgList: [ "linux", "binutils", "gcc", "gmp", "mpc", "mpfr", "toybox", "musl", "pl32lib-ng", "libplml", "pl-srv" ] +pkgList: [ "linux", "binutils", "gcc", "gmp", "mpc", "mpfr", "toybox", "musl", "pl-rt", "pl-srv", "zlib" ] supportedArch: [ "i486", "i586", "i686", "x86_64", "armv5", "armv6", "armv6k", "armv7", "aarch64", "riscv64" ] diff --git a/pl-files/configure-files/pkg/libplml.yaml b/pl-files/configure-files/pkg/libplml.yaml deleted file mode 100644 index 7bbe77a..0000000 --- a/pl-files/configure-files/pkg/libplml.yaml +++ /dev/null @@ -1,4 +0,0 @@ -name: "libplml" -version: "0.02" -github: true -url: "pocketlinux32/libplml" diff --git a/pl-files/configure-files/pkg/pl-rt.yaml b/pl-files/configure-files/pkg/pl-rt.yaml index 3ebc69c..cc101db 100644 --- a/pl-files/configure-files/pkg/pl-rt.yaml +++ b/pl-files/configure-files/pkg/pl-rt.yaml @@ -1,5 +1,5 @@ name: "pl-rt" -version: "0.06" +version: "0.06.1" github: true -tag: "v0.06" +tag: "v0.06.1" url: "portalinux-project/pl-rt" diff --git a/pl-files/configure-files/pkg/pl-srv-git.yaml b/pl-files/configure-files/pkg/pl-srv-git.yaml deleted file mode 100644 index 9170b61..0000000 --- a/pl-files/configure-files/pkg/pl-srv-git.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: "pl-srv" -version: "0.03" -branch: "main" -github: true -url: "portalinux-project/pl-srv" diff --git a/pl-files/configure-files/pkg/pl-srv.yaml b/pl-files/configure-files/pkg/pl-srv.yaml index f1827e7..97a33cf 100644 --- a/pl-files/configure-files/pkg/pl-srv.yaml +++ b/pl-files/configure-files/pkg/pl-srv.yaml @@ -1,5 +1,5 @@ name: "pl-srv" -version: "0.03" -tag: "v0.03" +version: "0.04.1" +tag: "v0.04.1" github: true url: "portalinux-project/pl-srv" diff --git a/pl-files/configure-files/pkg/pl32lib-ng.yaml b/pl-files/configure-files/pkg/pl32lib-ng.yaml deleted file mode 100644 index b38aea8..0000000 --- a/pl-files/configure-files/pkg/pl32lib-ng.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: "pl32lib-ng" -version: "1.06-ng" -github: true -tag: "v1.06-ng" -url: "pocketlinux32/pl32lib-ng" diff --git a/pl-files/pl-rootfs/usr-bin/init-script b/pl-files/pl-rootfs/usr-bin/init-script index a6e4f8b..3f6bc74 100644 --- a/pl-files/pl-rootfs/usr-bin/init-script +++ b/pl-files/pl-rootfs/usr-bin/init-script @@ -5,8 +5,8 @@ if [ "$1" = "tb" ]; then cmdList="$(toybox)" for i in $cmdList; do - if [ "$i" != "sh" ]; then - toybox ln -s /usr/bin/toybox /usr/bin/$i + if [ "$i" != "sh" ] || [ "$i" != "ls" ]; then + toybox ln -s /usr/bin/toybox /usr/bin/$i 2>/dev/null printf "* Creating link: $i \\r" fi done