summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-02-05 21:46:28 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-02-05 21:46:28 +0100
commit7c7a001ee6b8642121d28191bcc913c2ea452900 (patch)
treef6c94f1fa52ea89994a1c2d2e2ee3f382d0bc287
parentae49983b15e102ff4850e2b387ebafc839cdc9e5 (diff)
downloadbootstrap32-7c7a001ee6b8642121d28191bcc913c2ea452900.tar.xz
building up to pacman pre-requisites, pacman itself doesn't work yet
changed checkout method parameter, we have asp, yaourt and packages32 now
-rw-r--r--README40
-rwxr-xr-xbuild_stage1.sh1
-rwxr-xr-xbuild_stage1_package.sh33
-rw-r--r--default.conf2
-rw-r--r--i486-stage1/archlinux-keyring/DESCR (renamed from packages-i486-stage1/.gitkeep)0
-rw-r--r--i486-stage1/archlinux32-keyring/DESCR2
-rw-r--r--i486-stage1/pacman-mirrorlist/DESCR5
-rw-r--r--i486-stage1/pacman/DESCR25
-rw-r--r--i486-stage1/template/DESCR12
-rw-r--r--i486-stage1/uinit/DESCR2
10 files changed, 69 insertions, 53 deletions
diff --git a/README b/README
index 3ad26be..0823c39 100644
--- a/README
+++ b/README
@@ -166,7 +166,6 @@ su cross ./create_cdrom.sh
# basic packages
PACKAGES=" \
-archlinux-keyring archlinux32-keyring pacman-mirrorlist pacman \
fakeroot \
make mpfr gawk libmpc binutils gcc \
glibc \
@@ -178,7 +177,7 @@ sysfsutils libidn nettle iputils"
# mpfr for gawk, gcc
# sysfsutils and libidn, nettle for iputils
SYSROOT_PACKAGES=" \
-file libmpc mpfr \
+libmpc mpfr \
sysfsutils libidn"
@@ -189,43 +188,6 @@ sysfsutils libidn"
-
-# pacman-mirrorlist
-cp $HOME/packages32/core/pacman-mirrorlist/mirrorlist pacman-mirrorlist/.
-./update-list
-cat > pacman-mirrorlist/mirrorlist >> pacman-mirrorlist/mirrorlist <<EOF
-## Switzerland
-Server = https://archlinux32.andreasbaumann.cc/$arch/$repo
-EOF
-
-# archlinux-keyring
-
-# archlinux32-keyring
-cp -R $HOME/packages32/core/archlinux32-keyring .
-
-# pacman
-# append archlinux32 keyring
-cat ~/packages32/core/pacman/PKGBUILD >> pacman/PKGBUILD
-# craft a temporary i486 pacman.conf (no gpg and hard-coded architecture)
-cp pacman.conf.i686 pacman.conf.i486
-sed -i 's@^\(SigLevel\)@#\1@' pacman.conf.i486
-sed -i 's@^\(LocalFileSigLevel\)@#\1@' pacman.conf.i486
-# TODO: ADAPT sed -i 's@i686@i486@' pacman/PKGBUILD
-sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' pacman/PKGBUILD
-# asciidoc is a makedepend, we can use the one on the host (this means
-# also we can pacman only rebuild on i486 itself after the whole python
-# zoo is installed)
-sed -i "/makedepends=/s/'asciidoc'//" pacman/PKGBUILD
-# minimal dependencies, we don't sign anything yet, gpgme and gnupg have
-# far too many dependencies which cannot be easily cross-compiled
-sed -i "s/'gpgme'//" pacman/PKGBUILD
-sed -i 's@./configure@./configure --without-gpgme@' pacman/PKGBUILD
-# use 486 config and not 686 one
-sed -i 's@pacman.conf.i686@pacman.conf.i486@' pacman/PKGBUILD
-# some more architecture patching
-sed -i 's@i686@i486@g' pacman/PKGBUILD
-
-
# fakeroot
sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' fakeroot/PKGBUILD
# disable makedepends and take out po4a
diff --git a/build_stage1.sh b/build_stage1.sh
index 4d43d40..fdeae00 100755
--- a/build_stage1.sh
+++ b/build_stage1.sh
@@ -13,6 +13,7 @@ attr acl gmp gdbm db perl openssl
zlib pambase cracklib libtirpc pam libcap coreutils
util-linux e2fsprogs
expat bzip2 lz4 xz pcre less gzip tar libarchive curl
+pacman-mirrorlist archlinux-keyring archlinux32-keyring pacman
elfutils
sed texinfo grep findutils file diffutils ed patch
kbd procps-ng shadow
diff --git a/build_stage1_package.sh b/build_stage1_package.sh
index 06ecfcd..585f2db 100755
--- a/build_stage1_package.sh
+++ b/build_stage1_package.sh
@@ -35,16 +35,26 @@ if test $(pacman --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -
PACKAGE_DIR="$SCRIPT_DIR/$TARGET_CPU-stage1/$PACKAGE"
PACKAGE_CONF="$PACKAGE_DIR/DESCR"
if test -f $PACKAGE_CONF; then
- if test $(grep -c NEEDS_YAOURT $PACKAGE_CONF) = 1; then
- NEEDS_YAOURT=$(grep NEEDS_YAOURT $PACKAGE_CONF | cut -f 2 -d =)
+ if test $(grep -c FETCH_METHOD $PACKAGE_CONF) = 1; then
+ FETCH_METHOD=$(grep FETCH_METHOD $PACKAGE_CONF | cut -f 2 -d = | tr -d '"')
fi
fi
- if test "$NEEDS_YAOURT"; then
- yaourt -G "$PACKAGE"
- else
- asp export "$PACKAGE"
- fi
-
+ case $FETCH_METHOD in
+ "asp")
+ asp export "$PACKAGE"
+ ;;
+ "yaourt")
+ yaourt -G "$PACKAGE"
+ ;;
+ "packages32")
+ # (we assume, we only take core packages)
+ cp -a $ARCHLINUX32_PACKAGES/core/$PACKAGE .
+ ;;
+ *)
+ print "ERROR: unknown FETCH_METHOD '$FETCH_METHOD'.." >2
+ exit 1
+ esac
+
cd "$PACKAGE" || exit 1
# attach our destination platform to be a supported architecture
@@ -57,6 +67,13 @@ if test $(pacman --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -
cat "$DIFF_PKGBUILD" >> PKGBUILD
fi
+ # copy all other files from Archlinux32, if they exist
+ # (we assume, we only take core packages during stage1)
+ if test -f "$DIFF_PKGBUILD"; then
+ find $ARCHLINUX32_PACKAGES/core/pacman-mirrorlist/* ! -name PKGBUILD \
+ -exec cp {} . \;
+ fi
+
# source package descriptions, sets variables for this script
# and executes whatever is needed to build the package
diff --git a/default.conf b/default.conf
index c5397ce..0301ee7 100644
--- a/default.conf
+++ b/default.conf
@@ -44,7 +44,7 @@ GIT_URL_ARCHLINUX32_PACKAGES=https://github.com/archlinux32/packages.git
ARCHLINUX32_PACKAGES=$CROSS_HOME/packages32
# uncomment to debug scripts
-set -x
+#set -x
# some default variables, not to be changed
SCRIPT=$(sudo realpath -s "$0")
diff --git a/packages-i486-stage1/.gitkeep b/i486-stage1/archlinux-keyring/DESCR
index e69de29..e69de29 100644
--- a/packages-i486-stage1/.gitkeep
+++ b/i486-stage1/archlinux-keyring/DESCR
diff --git a/i486-stage1/archlinux32-keyring/DESCR b/i486-stage1/archlinux32-keyring/DESCR
new file mode 100644
index 0000000..7fbf211
--- /dev/null
+++ b/i486-stage1/archlinux32-keyring/DESCR
@@ -0,0 +1,2 @@
+# this package exists only in Archlinux32, copy the whole bunch
+FETCH_METHOD="packages32"
diff --git a/i486-stage1/pacman-mirrorlist/DESCR b/i486-stage1/pacman-mirrorlist/DESCR
new file mode 100644
index 0000000..233e5bc
--- /dev/null
+++ b/i486-stage1/pacman-mirrorlist/DESCR
@@ -0,0 +1,5 @@
+# append our local i486 only mirror for now
+cat >> mirrorlist <<EOF
+## Switzerland
+Server = https://archlinux32.andreasbaumann.cc/\$arch/\$repo
+EOF
diff --git a/i486-stage1/pacman/DESCR b/i486-stage1/pacman/DESCR
new file mode 100644
index 0000000..0ad0305
--- /dev/null
+++ b/i486-stage1/pacman/DESCR
@@ -0,0 +1,25 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# minimal dependencies, we don't sign anything yet, gpgme and gnupg have
+# far too many dependencies which cannot be easily cross-compiled
+sed -i "1!N;/depends=/s/'gpgme'//" PKGBUILD
+sed -i 's@./configure@./configure --without-gpgme@' PKGBUILD
+
+# asciidoc is a makedepend, we can use the one on the host (this means
+# also we can pacman only rebuild on i486 itself after the whole python
+# zoo is installed)
+sed -i "/makedepends=/s/'asciidoc'//" PKGBUILD
+
+#TODO FROM HERE
+
+# craft a temporary i486 pacman.conf (no gpg and hard-coded architecture)
+cp pacman.conf.i686 pacman.conf.i486
+sed -i 's@^\(SigLevel\)@#\1@' pacman.conf.i486
+sed -i 's@^\(LocalFileSigLevel\)@#\1@' pacman.conf.i486
+# TODO: ADAPT sed -i 's@i686@i486@' pacman/PKGBUILD
+sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' pacman/PKGBUILD
+# use 486 config and not 686 one
+sed -i 's@pacman.conf.i686@pacman.conf.i486@' pacman/PKGBUILD
+# some more architecture patching
+sed -i 's@i686@i486@g' pacman/PKGBUILD
diff --git a/i486-stage1/template/DESCR b/i486-stage1/template/DESCR
index faa5d7f..1e3a94a 100644
--- a/i486-stage1/template/DESCR
+++ b/i486-stage1/template/DESCR
@@ -1,7 +1,11 @@
-# NEEDS_YAOURT = 0 | 1
-# asp is the default tool to fetch packages, if the
-# package is only available in AUR, the set NEEDS_YAOURT=1
-NEEDS_YAOURT=0
+# FETCH_METHOD = "asp" | "yaourt" | "packages32"
+# "asp" is the default tool to fetch the package description PKGBUILD and
+# associated patch and other files.
+# If the package exists only on AUR, then use "yaourt".
+# If you want the package from Archlinux32, use "packages32".
+# (this is only for where to get the base set of files from, the patches
+# from packages32 are always applied)
+FETCH_METHOD="asp"
# NOPARALLEL_BUILD = 0 | 1
# the -j<N> parameter to makepkg will be set to -j if
diff --git a/i486-stage1/uinit/DESCR b/i486-stage1/uinit/DESCR
index 50ccc45..1d1a56e 100644
--- a/i486-stage1/uinit/DESCR
+++ b/i486-stage1/uinit/DESCR
@@ -1,5 +1,5 @@
# uinit as temporary systemd replacement for PID 1, lives in the AUR
-NEEDS_YAOURT=1
+FETCH_METHOD="yaourt"
# prepare configure for cross-compilation
sed -i "s/make /make CC=$TARGET_ARCH-gcc /g" PKGBUILD