Bug 196257 - freebsd-update does not use BASEDIR as set by -b in backup_kernel ()
Summary: freebsd-update does not use BASEDIR as set by -b in backup_kernel ()
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-24 19:01 UTC by manon
Modified: 2015-07-08 12:38 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description manon 2014-12-24 19:01:36 UTC
The followning patch allows the install proicess to complete in BASEDIR, not shuzre if additional places need to be changeds


[manon@oscar10-host ~]$ diff -ur  /usr/sbin/freebsd-update freebsd-update
--- /usr/sbin/freebsd-update	2014-12-13 00:12:36.249505000 +0000
+++ freebsd-update	2014-12-24 18:47:01.000000000 +0000
@@ -2661,23 +2661,25 @@
 		return 0
 	fi
 
+	BASE_BACKUPKERNELDIR="$BASEDIR/$BACKUPKERNELDIR"
+	BASE_KERNELDIR="$BASEDIR/$KERNELDIR"
 	# Decide which directory name to use for kernel backups.
 	backup_kernel_finddir
 
-	# Remove old kernel backup files.  If $BACKUPKERNELDIR was
+	# Remove old kernel backup files.  If $BASE_BACKUPKERNELDIR was
 	# "not ours", backup_kernel_finddir would have exited, so
 	# deleting the directory content is as safe as we can make it.
-	if [ -d $BACKUPKERNELDIR ]; then
-		rm -fr $BACKUPKERNELDIR
+	if [ -d $BASE_BACKUPKERNELDIR ]; then
+		rm -fr $BASE_BACKUPKERNELDIR
 	fi
 
 	# Create directories for backup.
-	mkdir -p $BACKUPKERNELDIR
+	mkdir -p $BASE_BACKUPKERNELDIR
 	mtree -cdn -p "${KERNELDIR}" | \
-	    mtree -Ue -p "${BACKUPKERNELDIR}" > /dev/null
+	    mtree -Ue -p "${BASE_BACKUPKERNELDIR}" > /dev/null
 
 	# Mark the directory as having been created by freebsd-update.
-	touch $BACKUPKERNELDIR/.freebsd-update
+	touch $BASE_BACKUPKERNELDIR/.freebsd-update
 	if [ $? -ne 0 ]; then
 		echo "Could not create kernel backup directory"
 		exit 1
@@ -2695,8 +2697,8 @@
 	fi
 
 	# Backup all the kernel files using hardlinks.
-	(cd $KERNELDIR && find . -type f $FINDFILTER -exec \
-	    cp -pl '{}' ${BACKUPKERNELDIR}/'{}' \;)
+	(cd $BASE_KERNELDIR && find . -type f $FINDFILTER -exec \
+	    cp -pl '{}' ${BASE_BACKUPKERNELDIR}/'{}' \;)
 
 	# Re-enable patchname expansion.
 	set +f
Comment 1 Glen Barber freebsd_committer freebsd_triage 2015-07-08 12:38:48 UTC
This appears to be resolved by head@r278728 and stable/10@r279556.

Thank you for your submission.