ref: a68ed6aa3117a8f130215e3a7bfb3312da66267f
parent: d50371d52ddad76f6393ceadd74ed5f4433b9666
author: Natanael Copa <ncopa@alpinelinux.org>
date: Wed Apr 13 03:37:02 CDT 2011
init: unmount the media where apkovl was found if needed This prevents double mount of /media/usb and /media/usbdisk
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -140,7 +140,10 @@
for i in usb floppy cdrom; do
mount -o ro /media/$i 2>/dev/null || continue
ovl=$(find_ovl /media/$i)
- [ -f "$ovl" ] && return
+ if [ -f "$ovl" ]; then
+ ovl_unmount="$ovl_unmount /media/$i"
+ return
+ fi
umount /media/$i 2>/dev/null
done
sleep 1
@@ -388,7 +391,7 @@
eend $? $errstr || ovlfiles=
# hack, incase /root/.ssh was included in apkovl
[ -d "$sysroot/root" ] && chmod 700 "$sysroot/root"
- umount /media/$i 2>/dev/null &
+ umount $ovl_unmount 2>/dev/null &
pkgs="$pkgs $(sed 's/\#.*//' $sysroot/etc/lbu/packages.list 2>/dev/null)"
rm -f "$sysroot"/etc/lbu/packages.list
pkgs="$pkgs $(cat $sysroot/var/lib/apk/world $sysroot/etc/apk/world 2>/dev/null)"