From b3eb6529568929068d490105cedf1b488708dbc4 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sat, 26 Jan 2019 17:08:23 +0100 Subject: [PATCH] Add makechroot.sh for 15.0 --- 14.2/convert32-supported | 1 + 15.0/makechroot.sh | 63 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100755 15.0/makechroot.sh diff --git a/14.2/convert32-supported b/14.2/convert32-supported index 0814cdc..6582f15 100644 --- a/14.2/convert32-supported +++ b/14.2/convert32-supported @@ -54,6 +54,7 @@ sdl svgalib v4l-utils zlib +gamin # n cyrus-sasl diff --git a/15.0/makechroot.sh b/15.0/makechroot.sh new file mode 100755 index 0000000..6c8b6a3 --- /dev/null +++ b/15.0/makechroot.sh @@ -0,0 +1,63 @@ +#!/bin/sh -e +set -e + +if [ "$(id -u)" != 0 ]; then + echo "This script needs root permissions!" 1>&2 + exit 1 +fi + +if [ "$#" -lt 2 ]; then + echo "Usage: $0 " 1>&2 + exit 1 +fi + +slackware="$(realpath "$1")" +chroot="$(realpath "$2")" + +temp="$(mktemp -d -t makechroot.XXXXXX)" + +# Make sure we clean up properly before exitting +cleanup() { + mountpoint -q "$temp/mnt" && umount "$temp/mnt" + mountpoint -q "$temp/dvd" && umount "$temp/dvd" + rm -rf "$temp" +} +trap 'cleanup' EXIT + +# Extract the initrd +cd "$temp" +xz -cd "$slackware/isolinux/initrd.img" | cpio -id + +# Mount the dvd +mkdir dvd +mount --bind "$slackware" dvd + +# Mount the destination +mkdir -p "$chroot" +mount --bind "$chroot" mnt + +# Install the packages +env -i chroot . sh -l -c ' +/sbin/installpkg --root /mnt --terse /dvd/slackware*/*/*.t?z + +cd /mnt +for script in \ + 04.mkfontdir \ + 05.fontconfig \ + 07.update-desktop-database \ + 07.update-mime-database \ + 08.gtk-update-icon-cache \ + 11.cacerts \ + cups-genppdupdate +do + var/lib/pkgtools/setup/setup.$script +done +chroot . /usr/bin/update-gtk-immodules > /dev/null 2>&1 +HOME=/root chroot . /usr/bin/update-gdk-pixbuf-loaders > /dev/null 2>&1 +chroot . /usr/bin/update-pango-querymodules > /dev/null 2>&1 +chroot . /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas > /dev/null 2>&1 +' +# We only run a few setup scripts that do not require user interaction, and deal with updating caches and such, which is not done (properly) by the doinst.sh scripts. +# To get a full list, run: bzcat MANIFEST.bz2 | awk '{print $6}' | grep '^var/log/setup/setup\.' | sort +# Besides the setup scripts, we also need to run some programs which are usually ran from /etc/rc.d/rc.M, but not from the setup scripts. +# This is tailored to Slackware 15.0-current, I'm unsure whether it'll work properly on any other version.