Commit e33edf91 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/alpine-conf: upgrade to 2.14.0

fixes #2258
parent c6097e36
From e85487169a542eac82244b448e9bb4882ee7a4da Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 24 Oct 2013 14:21:23 +0200
Subject: [PATCH] setup-disk: add swap to /etc/fstab
---
setup-disk.in | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/setup-disk.in b/setup-disk.in
index 8d3e14d..9e222fb 100644
--- a/setup-disk.in
+++ b/setup-disk.in
@@ -286,6 +286,10 @@ install_mounted_root() {
mv "$mnt"/etc/fstab "$mnt"/etc/fstab.old
fi
enumerate_fstab "$mnt" >> "$mnt"/etc/fstab
+ if [ -n "$SWAP_DEVICE" ]; then
+ echo -e "${SWAP_DEVICE}\tswap\tswap\tdefaults\t0 0" \
+ >> "$mnt"/etc/fstab
+ fi
cat >>"$mnt"/etc/fstab <<EOF
/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0
/dev/fd0 /media/floppy vfat noauto 0 0
@@ -573,6 +577,7 @@ setup_swap_dev() {
mkswap $swap_dev >/dev/null
echo -e "$swap_dev\tswap\t\tswap\tdefaults 0 0" >> /etc/fstab
done
+ SWAP_DEVICE="$(uuid_or_device $swap_dev)"
swapon -a
rc-update --quiet add swap boot
}
--
1.8.4.1
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
From 762c6558e48409159fba7b12ce8fb0baf4e6e2f5 Mon Sep 17 00:00:00 2001
From: Eivind Uggedal <eivind@uggedal.com>
Date: Mon, 12 Aug 2013 22:26:16 +0200
Subject: [PATCH] setup-timezone: fix bug in getopts parsing
---
setup-timezone.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup-timezone.in b/setup-timezone.in
index 41d4f16..5034223 100755
--- a/setup-timezone.in
+++ b/setup-timezone.in
@@ -47,7 +47,7 @@ while getopts "hp:z:" opt; do
case $opt in
h) usage;;
p) POSIXTZ="$OPTARG";;
- t) ZONEINFOFOLDER="$OPTARG";;
+ z) ZONEINFOFOLDER="$OPTARG";;
esac
done
--
1.8.4
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=alpine-conf
pkgver=2.13.0
pkgrel=3
pkgver=2.14.0
pkgrel=0
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
0001-setup-disk-add-swap-to-etc-fstab.patch
"
arch="all"
......@@ -39,15 +36,6 @@ package() {
ln -s lbu "$pkgdir"/sbin/lbu_$i
done
}
md5sums="29907dff864b4545e1fb5f49e08629bc alpine-conf-2.13.0.tar.xz
048af5408622f8d9fd1dcae5c48c0122 0001-setup-timezone-fix-bug-in-getopts-parsing.patch
5f8c8ef78f6ff53e4683a9daacf16355 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch
ef759a251cd383dcb3b6b0b4cfb9bb0b 0001-setup-disk-add-swap-to-etc-fstab.patch"
sha256sums="907c83a8fa1027e017fc84c7ff4bea62a41e7dcd2acd3ed7fa97ee1afc8a81ad alpine-conf-2.13.0.tar.xz
5e4dc989ab306444d470049a86225b976cdd73135bce805733c2218fd318029b 0001-setup-timezone-fix-bug-in-getopts-parsing.patch
3320a82abd79daa893a34cb9a235b27f539af12f8d32806b5630a7cef62d7aa6 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch
930b4f225a06f42f4fdd47d3d01470bfe90f1413b0e5ad05f514138ee8e99104 0001-setup-disk-add-swap-to-etc-fstab.patch"
sha512sums="fb083d154cedbd9dfa5a2ab044e7ee29ecc58dfefe80bd3c1ca9eac9d080deece561cddea996278d7db42aae44fac4b00f19d32a23ec996fbf6a6c76b78b0e85 alpine-conf-2.13.0.tar.xz
b437594aac79b3bd3a38bf43e7ade4b612cac4f09f0a2c9fa413ea21dea07fe575e24724e000586b596308bdd220afee93baeabcdbe3594c7ffa8f6d5efb83b1 0001-setup-timezone-fix-bug-in-getopts-parsing.patch
1dd5132cd0179083cf06c11e1a8513b6e49d1d75f0d14c0f402997641537c29afe3fb709910eb7b9b6ecb17a89fd77224d16dd1478725296f5bacfdcfff240fd 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch
42909ca1429c1b9e9683af8374b6787190f55131ba65fcccad1012fa2e633d0724559caec1c8bef56fb820462b72c528d3f53f40dda82fa65e22d903d718259a 0001-setup-disk-add-swap-to-etc-fstab.patch"
md5sums="94b82dd9d7a2c63aa6909238da3b44b3 alpine-conf-2.14.0.tar.xz"
sha256sums="14dc81845b16ffcbb39af9d0c5aeffab68166eec154c822b7c1c9c0697823d5b alpine-conf-2.14.0.tar.xz"
sha512sums="39aa74e676221475ce088d82b134563c3dd04a69e90919089d3876b6a4715f6df58aa156352a40d9f817414cbdb603350a3e9c15914fb254a24d8cef4acd6581 alpine-conf-2.14.0.tar.xz"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment