X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@lists.alpinelinux.org Received: from smtp161.iad.emailsrvr.com (smtp161.iad.emailsrvr.com [207.97.245.161]) by lists.alpinelinux.org (Postfix) with ESMTP id EEFB0361DA89 for ; Wed, 1 Sep 2010 20:33:21 +0000 (UTC) Received: from relay16.relay.iad.mlsrvr.com (localhost [127.0.0.1]) by relay16.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id 207631B40B8; Wed, 1 Sep 2010 16:33:21 -0400 (EDT) Received: by relay16.relay.iad.mlsrvr.com (Authenticated sender: mcs-AT-darkregion.net) with ESMTPSA id 2849A1B408D; Wed, 1 Sep 2010 16:33:20 -0400 (EDT) From: Matt Smith To: alpine-devel@lists.alpinelinux.org Cc: Matt Smith Subject: [alpine-devel] [PATCH] alpine-conf: Fixed setup-disk to add swap to fstab Date: Wed, 1 Sep 2010 15:33:00 +0000 Message-Id: <1283355180-1842-1-git-send-email-mcs@darkregion.net> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: References: X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: This patch fixes bug #419: http://redmine.alpinelinux.org/issues/419 Problem exists in Alpine Linux 2.0.0. This patch updates setup-disk to correctly add swap to the fstab and add the swap service to the boot runlevel. --- setup-disk.in | 29 +++++++++++++++++++++++------ 1 files changed, 23 insertions(+), 6 deletions(-) diff --git a/setup-disk.in b/setup-disk.in index 96e8e99..c59b529 100644 --- a/setup-disk.in +++ b/setup-disk.in @@ -206,10 +206,16 @@ EOF # install extlinux apk add -q syslinux is_xen || extlinux -i $raidopt "$mnt"/boot/ +} + +unmount_partitions() { + local mnt="$1" # unmount the partitions umount $(awk '{print $2}' /proc/mounts | grep ^"$mnt" | sort -r) +} +fix_mbr_all_disks() { # fix mbr for all disk devices for i in $rootdisk; do local errmsg @@ -217,9 +223,6 @@ EOF errmsg=$(dd if="$MBR" of=$i 2>&1) \ || echo "$errmsg" done - echo "" - echo "Installation is done. Please reboot." - apk del -q syslinux } # figure out decent default swap size in mega bytes @@ -381,11 +384,25 @@ EOF mdadm --detail --scan > /etc/mdadm.conf rc-update --quiet add mdadm-raid boot fi - rc-update --quiet add swap boot - install_mounted_root /mnt || return 1 - # the func to generate fstab does not detect swap. add it manually + + # manually add swap to local fstab and swapon (in case the install needs swap) sed -i -e '/swap/d' /etc/fstab echo -e "$(uuid_or_device $swap_dev)\tswap\t\tswap\tdefaults 0 0" >> /etc/fstab + swapon -a + + install_mounted_root /mnt || return 1 + + # manually add swap to mounted fstab and add the swap service to the boot runlevel + echo -e "$(uuid_or_device $swap_dev)\tswap\t\tswap\tdefaults 0 0" >> /mnt/etc/fstab + chroot /mnt ""rc-update --quiet add swap boot"" + + unmount_partitions /mnt + swapoff -a + fix_mbr_all_disks + + echo "" + echo "Installation is done. Please reboot." + apk del -q syslinux } usage() { -- 1.7.2.2 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---