From fad6f9d3602f241e75ba8bca7d7195eadf5a08f0 Mon Sep 17 00:00:00 2001 From: fdupoux Date: Sat, 7 Mar 2020 16:18:46 +0000 Subject: [PATCH] Simplify support for multiple architectures --- ARCHITECTURE | 1 - README.md | 15 +++++---------- build.sh | 5 ++--- pacman.conf | 3 --- 4 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 ARCHITECTURE diff --git a/ARCHITECTURE b/ARCHITECTURE deleted file mode 100644 index 1c09346..0000000 --- a/ARCHITECTURE +++ /dev/null @@ -1 +0,0 @@ -x86_64 diff --git a/README.md b/README.md index b566d07..ab229a0 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,11 @@ https://git.archlinux.org/archiso.git ## Building SystemRescueCd SystemRescueCd can be built for x86_64 or i686 architectures. It must be built -on archlinux (or archlinux32). The following packages must be installed on the -build system: archiso, grub, mtools. The archiso package must be modified to add -support for an option which allows to optimize the squashfs compression. The -patch can be found in the "patches" folder in this git repository. +on archlinux if you want to build a 64bit edition, or archlinux32 if you want +to create a 32bit edition. The following packages must be installed on the +build system: archiso, grub, mtools. The archiso package must be modified to +add support for an option which allows to optimize the squashfs compression. +The patch can be found in the "patches" folder in this git repository. The package list contains packages which are not part of the official binary package repositories. These packages need to be built from sources from the AUR @@ -24,12 +25,6 @@ The repo-add command must be used to generate the repository package index. The pacman.conf file must be updated with the address of this repository so custom packages can be accessed. -By default the target architecture will be x86_64. The following must be changed -in order to build a 32bit version instead: -* Update the ARCHITECTURE file (replace "x86_64" with "i686") -* Update Architecture in pacman.conf (replace "auto" with "i686") -* Replace archlinux repositories with archlinux32 repositories in pacman.conf - The build process can be started by running the build.sh script. It will create a large "work" sub-directory and the ISO file will be written in the "out" sub-directory. diff --git a/build.sh b/build.sh index 2aa1d57..e2cae74 100755 --- a/build.sh +++ b/build.sh @@ -4,7 +4,6 @@ set -e -u script_path=$(readlink -f ${0%/*}) version_file="${script_path}/VERSION" -arch_file="${script_path}/ARCHITECTURE" iso_name=systemrescuecd iso_version="$(<${version_file})" @@ -16,7 +15,7 @@ install_dir=sysresccd work_dir=work out_dir=out gpg_key= -arch="$(<${arch_file})" +arch="$(uname -m)" sfs_comp="xz" sfs_opts="-Xbcj x86 -b 512k -Xdict-size 512k" @@ -77,7 +76,7 @@ run_once() { make_pacman_conf() { local _cache_dirs _cache_dirs=($(pacman -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g')) - sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n ${_cache_dirs[@]})|g" ${script_path}/pacman.conf > ${work_dir}/pacman.conf + sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n ${_cache_dirs[@]})|g; s|^Architecture\s*=.*$|Architecture = ${arch}|" ${script_path}/pacman.conf > ${work_dir}/pacman.conf } # Base installation, plus needed packages (airootfs) diff --git a/pacman.conf b/pacman.conf index 9bca75a..3feaf33 100644 --- a/pacman.conf +++ b/pacman.conf @@ -78,13 +78,10 @@ SigLevel = Optional TrustAll [core] Include = /etc/pacman.d/mirrorlist -#Server = http://de.mirror.archlinux32.org/$arch/$repo [extra] Include = /etc/pacman.d/mirrorlist -#Server = http://de.mirror.archlinux32.org/$arch/$repo [community] Include = /etc/pacman.d/mirrorlist -#Server = http://de.mirror.archlinux32.org/$arch/$repo