From 7f62ff7e22aceddc35f25780174aabe686d41d88 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 6 Oct 2011 11:36:58 +0000 Subject: setup-bootable: revert the cache logic It was broken. This reverts: 70b1a6716dc5e2ed4a4b92d908691f86924c3753 a234ec98b8a4be9fa7ebd8e37cce4d58ec1c5473 c67ff2550962e8857d9a7c3859fc5003324e418a 0b3ae89a2abdaccea8eac0a089c1e1fd589c5c3e --- setup-bootable.in | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/setup-bootable.in b/setup-bootable.in index bde5301..926d7fd 100644 --- a/setup-bootable.in +++ b/setup-bootable.in @@ -61,7 +61,6 @@ Options: -k Keep current alpine_dev in syslinux.cfg. Without this it will be replaced with the UUID. -u Upgrade mode. Keep existing syslinux.cfg and don't run syslinux. - If apk cache is detected, attempts to upgrade the apk cache -s Force run syslinux, even if upgrade mode. -v Verbose mode. Display whats going on. @@ -122,12 +121,6 @@ fi # fish out label, uuid and type eval $(blkid $dest | cut -d: -f2-) -# Check for RO mounting -if [ "`grep \"$destdir\" /proc/mount | grep 'ro,'`" = "ro" ]; then - remountneeded="Y" - mount -o remount,rw "$destdir" -fi - [ -n "$verbose" ] && echo "Using $dest as target (mounted on $destdir)" @@ -190,8 +183,6 @@ elif [ -n "$srcurl" ]; then || die "Failed to download or extract $srcurl" fi - - # make sure files are really there before we replace existing [ -n "$verbose" ] && echo "Flushing cache..." sync @@ -224,34 +215,15 @@ for i in $tomove; do mv "$destdir"/.new/$i "$destdir"/ || die "Failed to move $destdir/.new/ to $destdir" done - if [ -z "$keep_alpine_dev" ] && [ -n "$UUID" ]; then sed -i -e "s/alpine_dev=[^ \t]\+/alpine_dev=UUID=$UUID/" \ "$destdir"/syslinux.cfg fi -# Update the cache folder on destdir if present -if [ -e "$destdir"/*.apkovl.tar.gz ] && [ -e "$destdir"/cache ]; then - mkdir "$destdir"/tmp.cache - - mv /etc/apk/cache /etc/apk/cache.temp - ln -s "destdir"/tmp.cache/ /etc/apk/cache - - mkdir "destdir"/cache.old - mv "$destdir"/cache/* "$destdir"/cache.old/ - - apk update - apk cache sync - - mv "$destdir"/tmp.cache/* "$destdir"/cache/ && rm -rf "$destdir"/cache.old - rm -rf "$destdir"/tmp.cache -fi - # cleanup [ -z "$keep_old" ] && rm -rf "$destdir"/.old "$destdir"/.new sync - # If we only copy then we are done. if [ -n "$upgrade" ] && [ -z "$syslinux" ]; then cleanup @@ -273,9 +245,5 @@ else echo "Warning: Could not find the parent device for $dest" fi -if [ "$remountneeded" = "Y" ]; then - mount -o remount,ro "$destdir" -fi - cleanup sync -- cgit v1.2.3