From 9ad5099f0b3b48e706851996fdb34cd932db5b03 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Tue, 29 Mar 2016 01:01:21 +0200 Subject: Fix the 'setup2hd' script's method of Live content installation. In the original version of the script, the squashfs modules' contents would be extracted one after the other. However this disregards any package or file deletions inbetween modules. As a result, e.g. a PLASMA5 installation to disk using 'setup2hd' would leave several artefacts in removed_scripts and removed_packages and probably in other locations too. The overlay is now constructed somewhat differently, so that 'setup2hd' can access the full read-only filesystem properly; it will copy this content to the harddisk using rsync. A progress indicator will show the stats of files that are actually being transferred. At the same time, the 'setup2hd' script's language settings are now hard-coded by setting 'LC_ALL' and LANG to "C". Slackware's setup scripts parse command output and expect english texts there, but when you selected a different language when booting your Live OS, this would confuse e.g. 'liloconfig' to the extent that it failed to find the Linux partitions. --- liveinit | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'liveinit') diff --git a/liveinit b/liveinit index 21bf588..e761e44 100755 --- a/liveinit +++ b/liveinit @@ -555,9 +555,13 @@ if [ "$RESCUE" = "" ]; then [ ! -d ${UPPERDIR} ] && mkdir -p ${UPPERDIR} [ ! -d ${OVLWORK} ] && mkdir -p ${OVLWORK} - # Create the overlay of readonly and writable directories: + # Create the overlays of readonly and writable directories: + mkdir -p /mnt/${LIVEMAIN}fs mkdir -p /mnt/overlay - mount -t overlay -o workdir=${OVLWORK},upperdir=${UPPERDIR},lowerdir=${RODIRS} overlay /mnt/overlay + # We are going to use the readonly overlay as source for 'setup2hd': + mount -t overlay -o lowerdir=${RODIRS} overlay /mnt/${LIVEMAIN}fs + # Now add the writable upper layer: + mount -t overlay -o workdir=${OVLWORK},upperdir=${UPPERDIR},lowerdir=/mnt/${LIVEMAIN}fs overlay /mnt/overlay if [ $? -ne 0 -a "$VIRGIN" = "0" ]; then # Failed to create the persistent overlay - try without persistence: echo "${MARKER}: Failed to create persistent overlay, attempting to continue in RAM." @@ -565,7 +569,7 @@ if [ "$RESCUE" = "" ]; then OVLWORK=/mnt/live/.ovlwork mkdir -p ${UPPERDIR} mkdir -p ${OVLWORK} - mount -t overlay -o workdir=${OVLWORK},upperdir=${UPPERDIR},lowerdir=${RODIRS} overlay /mnt/overlay + mount -t overlay -o workdir=${OVLWORK},upperdir=${UPPERDIR},lowerdir=/mnt/${LIVEMAIN}fs overlay /mnt/overlay fi debugit @@ -573,6 +577,8 @@ if [ "$RESCUE" = "" ]; then # Make the underpinning RAM fs accessible in the live system (for fun): mkdir -p /mnt/overlay/mnt/live mount --bind /mnt/live /mnt/overlay/mnt/live + mkdir -p /mnt/overlay/mnt/${LIVEMAIN}fs + mount --bind /mnt/${LIVEMAIN}fs /mnt/overlay/mnt/${LIVEMAIN}fs if [ $TORAM -eq 0 ]; then # Same for the Linux filesystem on the USB stick: -- cgit v1.2.3