summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODOS9
-rwxr-xr-xbuild_stage1.sh2
-rw-r--r--default.conf8
-rw-r--r--i486-stage1/nasm/DESCR11
-rw-r--r--i486-stage1/syslinux/DESCR15
-rwxr-xr-xinstall_host.sh7
-rwxr-xr-xprepare_stage1_repo.sh1
7 files changed, 49 insertions, 4 deletions
diff --git a/TODOS b/TODOS
index d920d81..adb012e 100644
--- a/TODOS
+++ b/TODOS
@@ -12,7 +12,8 @@
bsdtar: /home/cross/i486-root/packages/i486/linux-headers-4.15.1-2-i486.pkg.tar.xz: Not found in archive
bsdtar: Error exit delayed from previous errors.
Built package linux.
-- gcc PKGBUILD instead of diff
+- currently gcc has a PKGBUILD modified by hand instead of diff seds in DESCR
+ (the diff is very big and complex)
- removing all pacman databases and recreating them with repo-add, also
removing all installed pacman packages seem a little bit paranoic. Find
out how to speed this up and do it properly.
@@ -42,4 +43,10 @@
Temporary breakpoint 1, 0x004005b0 in main ()
(gdb) list
1 /home/cross/.build/i486-unknown-linux-gnu/src/gcc/libgcc/libgcc2.c: No such file or directory.
+- stage1
+ - stage1: cdrom installs keyrings without having a gpg binary
+ - 32 MB is not enough when installing packages => add a swap as first action!
+ - stage1 has no bootloader package (syslinux) to install
+ - do we really want to install stage1 via a CDROM?
+- using the cross compiler for syslinux is most likely overkill
diff --git a/build_stage1.sh b/build_stage1.sh
index 7c19766..098054f 100755
--- a/build_stage1.sh
+++ b/build_stage1.sh
@@ -18,7 +18,7 @@ elfutils
sed texinfo grep findutils file diffutils ed patch
fakeroot
kbd procps-ng shadow
-inetutils bc kmod linux uinit
+inetutils bc kmod linux uinit nasm syslinux
net-tools libmnl libnfnetlink iptables iproute2
libedit openssh
make mpfr gawk libmpc binutils gcc glibc
diff --git a/default.conf b/default.conf
index 8ecfb3c..e28de34 100644
--- a/default.conf
+++ b/default.conf
@@ -50,9 +50,13 @@ ARCHLINUX32_PACKAGES=$CROSS_HOME/packages32
SCRIPT=$(sudo realpath -s "$0")
SCRIPT_DIR=$(dirname "$SCRIPT")
-if test $(uname -m) = "x86_64"; then
+# CPU we build on
+BUILD_CPU=$(uname -m)
+
+# the asp is different per platform
+if test $BUILD_CPU = "x86_64"; then
ASP=asp
fi
-if test $(uname -m) = "i686"; then
+if test $BUILD_CPU = "i686"; then
ASP=asp32
fi
diff --git a/i486-stage1/nasm/DESCR b/i486-stage1/nasm/DESCR
new file mode 100644
index 0000000..7a7ecb8
--- /dev/null
+++ b/i486-stage1/nasm/DESCR
@@ -0,0 +1,11 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# remove all fonts and ghostscript (we don't build the manual)
+sed -i "/makedepends=/s/perl-font-ttf//" PKGBUILD
+sed -i "/makedepends=/s/perl-sort-versions//" PKGBUILD
+sed -i "/makedepends=/s/fontconfig//" PKGBUILD
+sed -i "/makedepends=/s/adobe-source-sans-pro-fonts//" PKGBUILD
+sed -i "/makedepends=/s/ttf-liberation//" PKGBUILD
+sed -i "/makedepends=/s/ghostscript//" PKGBUILD
+sed -i "s/\(make -C doc\)/#\1/" PKGBUILD
diff --git a/i486-stage1/syslinux/DESCR b/i486-stage1/syslinux/DESCR
new file mode 100644
index 0000000..a542c39
--- /dev/null
+++ b/i486-stage1/syslinux/DESCR
@@ -0,0 +1,15 @@
+# disable python
+sed -i "/makedepends=/s/python2//" PKGBUILD
+sed -i "s/make PYTHON=python2/make/" PKGBUILD
+
+# take git from the host
+sed -i "/makedepends=/s/git//" PKGBUILD
+
+# no documentation
+sed -i "/makedepends=/s/asciidoc//" PKGBUILD
+
+# no upx compression
+sed -i "/makedepends=/s/upx//" PKGBUILD
+
+# use the cross compiler
+sed -i "s/\(make \$_targets\)/\1 CC=$TARGET_ARCH-gcc AS=$TARGET_ARCH-as LD=$TARGET_ARCH-ld AR=$TARGET_ARCH-ar/" PKGBUILD
diff --git a/install_host.sh b/install_host.sh
index 1a7076e..c2a9c54 100755
--- a/install_host.sh
+++ b/install_host.sh
@@ -34,6 +34,13 @@ pacman --noconfirm --needed -S syslinux cdrtools
# for building a hard disk image
pacman --noconfirm --needed -S qemu
+# for building syslinux (Intel only)
+case $BUILD_CPU in
+ i*86|x86_64)
+ pacman --noconfirm --needed -S nasm
+ ;;
+esac
+
# some packages come from the AUR
if test "$(grep -c '\[archlinuxfr\]' /etc/pacman.conf)" = 0; then
cat >> /etc/pacman.conf <<EOF
diff --git a/prepare_stage1_repo.sh b/prepare_stage1_repo.sh
index 1596b74..d3cf684 100755
--- a/prepare_stage1_repo.sh
+++ b/prepare_stage1_repo.sh
@@ -85,6 +85,7 @@ if test ! -d $STAGE1_BUILD; then
CPUS=$(nproc)
sed -i "s@^#MAKEFLAGS=.*@MAKEFLAGS=\"-j$CPUS\"@" makepkg-i486.conf
sed -i "s@-march=x86-64 -mtune=generic @@" makepkg-i486.conf
+ sed -i "s@-march=i686 -mtune=generic @@" makepkg-i486.conf
echo "Prepared the stage 1 build environment."
fi