diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-10-02 07:58:33 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-10-02 07:58:33 +0000 |
commit | 562765e842b43133319b1f084f0479ba4843abbe (patch) | |
tree | 08c3d0646b659d7827c6a033e413665d66f8f01b /main/alpine-conf | |
parent | 543ea1b7436f575c6125a8b33b2547e9bbcc2a39 (diff) | |
download | aports-562765e842b43133319b1f084f0479ba4843abbe.tar.bz2 aports-562765e842b43133319b1f084f0479ba4843abbe.tar.xz |
main/alpine-conf: fix running syslinux trigger from setup-disk
ref #2250
Diffstat (limited to 'main/alpine-conf')
-rw-r--r-- | main/alpine-conf/0001-setup-disk-fix-running-update-extlinux-in-chroot.patch | 89 | ||||
-rw-r--r-- | main/alpine-conf/APKBUILD | 12 |
2 files changed, 97 insertions, 4 deletions
diff --git a/main/alpine-conf/0001-setup-disk-fix-running-update-extlinux-in-chroot.patch b/main/alpine-conf/0001-setup-disk-fix-running-update-extlinux-in-chroot.patch new file mode 100644 index 0000000000..d22db9e98d --- /dev/null +++ b/main/alpine-conf/0001-setup-disk-fix-running-update-extlinux-in-chroot.patch @@ -0,0 +1,89 @@ +From c9533d0ea64f29de872e48be67b6eaa10b7e2ca3 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Wed, 2 Oct 2013 07:51:33 +0000 +Subject: [PATCH] setup-disk: fix running update-extlinux in chroot + +When installling the packages in new root, the update-extlinux trigger +script will be executed. We make sure this does not fail by: + - run extlinux --install before we install packages + - mount /dev and /proc for the chroot + - temprorary disable grsecurity's chroot_caps +--- + setup-disk.in | 39 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 34 insertions(+), 5 deletions(-) + +diff --git a/setup-disk.in b/setup-disk.in +index d3a4500..8d3e14d 100644 +--- a/setup-disk.in ++++ b/setup-disk.in +@@ -160,6 +160,31 @@ find_pvs_in_vg() { + pvs --noheadings | awk "\$2 == \"$vg\" {print \$1}" + } + ++# echo current grsecurity option and set new ++set_grsec() { ++ local key="$1" value="$2" ++ if ! [ -e /proc/sys/kernel/grsecurity/$key ]; then ++ return 0 ++ fi ++ cat /proc/sys/kernel/grsecurity/$key ++ echo $value > /proc/sys/kernel/grsecurity/$key ++} ++ ++init_chroot_mounts() { ++ local mnt="$1" i= ++ for i in proc dev; do ++ mkdir -p "$mnt"/$i ++ mount --bind /$i "$mnt"/$i ++ done ++} ++ ++cleanup_chroot_mounts() { ++ local mnt="$1" i= ++ for i in proc dev; do ++ umount "$mnt"/$i ++ done ++} ++ + install_mounted_root() { + local mnt="$1" mnt_boot= boot_fs= root_fs= + local initfs_features="ata base ide scsi usb virtio" +@@ -266,15 +291,15 @@ install_mounted_root() { + /dev/fd0 /media/floppy vfat noauto 0 0 + /dev/usbdisk /media/usb vfat noauto 0 0 + EOF +- + # remove the installed db in case its there so we force re-install + rm -f "$mnt"/var/lib/apk/installed "$mnt"/lib/apk/db/installed + echo "Installing system on $rootdev:" ++ extlinux $extlinux_raidopt --install "$mnt"/boot ++ + # apk reads config from target root so we need to copy the config + mkdir -p "$mnt"/etc/apk/keys/ + cp /etc/apk/keys/* "$mnt"/etc/apk/keys/ + +- + local apkflags="--initdb --quiet --progress --update-cache --clean-protected" + local pkgs=$(cat "$mnt"/etc/apk/world "$mnt"/var/lib/apk/world 2>/dev/null) + pkgs="$pkgs acct linux-$KERNEL_FLAVOR alpine-base" +@@ -287,10 +312,14 @@ EOF + repoflags="$repoflags --repository $i" + done + ++ chroot_caps=$(set_grsec chroot_caps 0) ++ init_chroot_mounts "$mnt" + apk add --root "$mnt" $apkflags --overlay-from-stdin \ +- $repoflags $pkgs <$ovlfiles>/dev/null || return 1 +- echo "" +- extlinux $extlinux_raidopt --install "$mnt"/boot ++ $repoflags $pkgs <$ovlfiles>/dev/null ++ local ret=$? ++ cleanup_chroot_mounts "$mnt" ++ set_grsec chroot_caps $chroot_caps > /dev/null ++ return $ret + } + + unmount_partitions() { +-- +1.8.4 + diff --git a/main/alpine-conf/APKBUILD b/main/alpine-conf/APKBUILD index 7fefa54198..65a5dc0e86 100644 --- a/main/alpine-conf/APKBUILD +++ b/main/alpine-conf/APKBUILD @@ -1,12 +1,13 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=alpine-conf pkgver=2.13.0 -pkgrel=1 +pkgrel=2 pkgdesc="Alpine configuration management scripts" url=http://git.alpinelinux.org/cgit/$pkgname depends="openrc" source="http://dev.alpinelinux.org/archive/alpine-conf/alpine-conf-$pkgver.tar.xz 0001-setup-timezone-fix-bug-in-getopts-parsing.patch + 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch " arch="all" @@ -38,8 +39,11 @@ package() { done } md5sums="29907dff864b4545e1fb5f49e08629bc alpine-conf-2.13.0.tar.xz -048af5408622f8d9fd1dcae5c48c0122 0001-setup-timezone-fix-bug-in-getopts-parsing.patch" +048af5408622f8d9fd1dcae5c48c0122 0001-setup-timezone-fix-bug-in-getopts-parsing.patch +5f8c8ef78f6ff53e4683a9daacf16355 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch" sha256sums="907c83a8fa1027e017fc84c7ff4bea62a41e7dcd2acd3ed7fa97ee1afc8a81ad alpine-conf-2.13.0.tar.xz -5e4dc989ab306444d470049a86225b976cdd73135bce805733c2218fd318029b 0001-setup-timezone-fix-bug-in-getopts-parsing.patch" +5e4dc989ab306444d470049a86225b976cdd73135bce805733c2218fd318029b 0001-setup-timezone-fix-bug-in-getopts-parsing.patch +3320a82abd79daa893a34cb9a235b27f539af12f8d32806b5630a7cef62d7aa6 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch" sha512sums="fb083d154cedbd9dfa5a2ab044e7ee29ecc58dfefe80bd3c1ca9eac9d080deece561cddea996278d7db42aae44fac4b00f19d32a23ec996fbf6a6c76b78b0e85 alpine-conf-2.13.0.tar.xz -b437594aac79b3bd3a38bf43e7ade4b612cac4f09f0a2c9fa413ea21dea07fe575e24724e000586b596308bdd220afee93baeabcdbe3594c7ffa8f6d5efb83b1 0001-setup-timezone-fix-bug-in-getopts-parsing.patch" +b437594aac79b3bd3a38bf43e7ade4b612cac4f09f0a2c9fa413ea21dea07fe575e24724e000586b596308bdd220afee93baeabcdbe3594c7ffa8f6d5efb83b1 0001-setup-timezone-fix-bug-in-getopts-parsing.patch +1dd5132cd0179083cf06c11e1a8513b6e49d1d75f0d14c0f402997641537c29afe3fb709910eb7b9b6ecb17a89fd77224d16dd1478725296f5bacfdcfff240fd 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch" |