From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E61A513838B for ; Tue, 23 Sep 2014 00:21:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DCC7FE0B22; Tue, 23 Sep 2014 00:21:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7B8D1E0B22 for ; Tue, 23 Sep 2014 00:21:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7A188340259 for ; Tue, 23 Sep 2014 00:21:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9FBE75F66 for ; Tue, 23 Sep 2014 00:21:18 +0000 (UTC) From: "Richard Farina" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Richard Farina" Message-ID: <1411430848.5e7ea7fce1b18ceadcf3cf3e7bc008d6fd537a0a.zerochaos@gentoo> Subject: [gentoo-commits] proj/genkernel:aufs commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts X-VCS-Directories: defaults/ X-VCS-Committer: zerochaos X-VCS-Committer-Name: Richard Farina X-VCS-Revision: 5e7ea7fce1b18ceadcf3cf3e7bc008d6fd537a0a X-VCS-Branch: aufs Date: Tue, 23 Sep 2014 00:21:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8a41e012-d205-45e1-ba09-bf0777b85485 X-Archives-Hash: b0d69bdef53c0660835828bc2ec0b9a3 commit: 5e7ea7fce1b18ceadcf3cf3e7bc008d6fd537a0a Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Tue Sep 23 00:07:28 2014 +0000 Commit: Richard Farina gentoo org> CommitDate: Tue Sep 23 00:07:28 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=5e7ea7fc aufs changes saving automation The aufs code has the ability to save changes in a file, however, it requires the user to manually tell us where the file is. This code will automatically check for the file on $CDROOT, as well as automatically pick up the casper-rw file created by unetbooting for persistence. Additionally we add the option for aufs=search which will search all drives for livecd.aufs. Possible later enhancements include searching other partitions on the CDROOT_DEV for livecd.aufs automatically instead of needing aufs=search. Then again, possible later enhancements also include just always searching, it's shockingly fast to do the search... --- defaults/initrd.scripts | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index a834ed2..1cc9ff9 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -123,7 +123,7 @@ findmediamount() { fi good_msg "Attempting to mount media: ${x}" ${CRYPT_SILENT} - mount -r -t ${CDROOT_TYPE} ${x} ${mntcddir} >/dev/null 2>&1 + mount -t ${CDROOT_TYPE} ${x} ${mntcddir} >/dev/null 2>&1 if [ "$?" = '0' ] then if [ -n "${ISOBOOT}" ]; then @@ -408,12 +408,29 @@ create_changefs() { setup_aufs() { bootstrapCD + if [ "$aufs_dev" = "search" ]; then + findmediamount "aufs-dev" "$aufs_union_file" \ + "aufs_dev" "$aufs_dev_mnt" $(devicelist) + aufs_mounted="1" + elif [ -z $aufs_dev ] && [ -w "$CDROOT_PATH/$aufs_union_file" ]; then + aufs_dev="$REAL_ROOT" + aufs_dev_mnt="$CDROOT_PATH" + aufs_mounted="1" + fi + if [ -z $aufs_dev ] && [ -w "$CDROOT_PATH/casper-rw" ]; then + aufs_dev="$REAL_ROOT" + aufs_dev_mnt="$CDROOT_PATH" + aufs_union_file="/casper-rw" + aufs_mounted="1" + fi + if [ -n "$aufs_dev" ]; then if [ ! -b $aufs_dev ]; then bad_msg "$aufs_dev is not a valid block device" local invalidblk=1 unset aufs_dev - else + #skip this block when aufs_dev_mnt is already mounted + elif [ "$aufs_mounted" != "1" ]; then good_msg "Mounting $aufs_dev to $aufs_memory for aufs support" if ! mount -t auto "$aufs_dev" "$aufs_dev_mnt" &>/dev/null; then @@ -428,6 +445,9 @@ setup_aufs() { elif [ -n "$aufs_dev" ]; then while :; do if mount -t auto "$aufs_dev_mnt$aufs_union_file" "$aufs_memory" &>/dev/null; then + if [ "$aufs_union_file" = "/casper-rw" ];then + bad_msg "Use of livecd.aufs preferred to casper-rw for changes saving, please rename the file." + fi break else bad_msg "Mounting of changes file failed, Running e2fsck"