From: "Richard Farina" <zerochaos@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/genkernel:aufs commit in: defaults/
Date: Fri, 5 Sep 2014 16:09:52 +0000 (UTC) [thread overview]
Message-ID: <1406834373.3ea3c267cd3b05c68b508f28b00efa5116850c09.zerochaos@gentoo> (raw)
commit: 3ea3c267cd3b05c68b508f28b00efa5116850c09
Author: Fernando Reyes (likewhoa) <design <AT> missionaccomplish <DOT> com>
AuthorDate: Thu Jul 10 01:53:07 2014 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Thu Jul 31 19:19:33 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=3ea3c267
Changed to the dd command which creates the livecd.aufs image for
the aufs writable branch to make the process faster we create a
sparse file. Added a check for a block device so that we don't try
mounting the aufs device & some small comestic changes.
---
defaults/initrd.scripts | 33 ++++++++++++++++++++++-----------
defaults/linuxrc | 3 ++-
2 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 8a3d93e..5a01986 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -376,7 +376,7 @@ create_changefs() {
local size
while :; do
- read -p '<< Size of file (Press Enter for default 256 Mb): ' size
+ read -p '<< Size of file (Press Enter for default 256 MB): ' size
size=${size:-256}
@@ -386,13 +386,13 @@ create_changefs() {
elif [ 15 -ge "$size" ]; then
bad_msg "Please give a size of at least 16 Megabytes"
else
- if dd if=/dev/zero "of=$aufs_dev_mnt$aufs_union_file" bs=1M count="$size" &>/dev/null; then
- good_msg "Creation of $aufs_union_file, ${size}Mb on $aufs_dev successful, formatting it ext2"
+ if dd if=/dev/zero "of=$aufs_dev_mnt$aufs_union_file" bs=1 seek="$size"M count=0 &>/dev/null; then
+ good_msg "Creation of $aufs_union_file, ${size}MB on $aufs_dev successful, formatting it ext2"
mke2fs -F "$aufs_dev_mnt$aufs_union_file" &>/dev/null
break
else
rm "$aufs_dev_mnt$aufs_union_file"
- bad_msg "Unable to create ${aufs_union_file#*/} on $aufs_dev of ${size}Mb"
+ bad_msg "Unable to create ${aufs_union_file#*/} on $aufs_dev of ${size}MB"
bad_msg "Ensure your disk is not full or read-only"
read -p '<< Type "a" to abort, anything else to continue : ' doabort
@@ -410,13 +410,19 @@ create_changefs() {
setup_aufs() {
bootstrapCD
- if [ -n "$aufs_dev" ]; then
- good_msg "Mounting $aufs_dev to $aufs_memory for aufs support"
+ 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
+ good_msg "Mounting $aufs_dev to $aufs_memory for aufs support"
- if ! mount -t auto "$aufs_dev" "$aufs_dev_mnt" &>/dev/null; then
- bad_msg "Mount of $aufs_dev failed, falling back to ramdisk based aufs"
- unset aufs_dev
- fi
+ if ! mount -t auto "$aufs_dev" "$aufs_dev_mnt" &>/dev/null; then
+ bad_msg "Mount of $aufs_dev failed, falling back to ramdisk based aufs"
+ unset aufs_dev
+ fi
+ fi
# Check and attempt to create the AUFS union file
if [ ! -e $aufs_dev_mnt$aufs_union_file ] && [ -n "$aufs_dev" ]; then
@@ -455,7 +461,12 @@ setup_aufs() {
aufs_xino=$aufs_memory
umount "$aufs_memory" &>/dev/null
- bad_msg "Create an extfs ${aufs_union_file#*/} file on this device"
+ if [ 1 = "$invalidblk" ]; then
+ bad_msg "Verify that you've entered a valid device path"
+ else
+ bad_msg "Create an extfs ${aufs_union_file#*/} file on this device"
+ fi
+
bad_msg "if you wish to have aufs data persistency on reboots"
bad_msg "Falling back to ramdisk based aufs"
good_msg "Mounting ramdisk to $aufs_memory for aufs support"
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 276f150..3098866 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -786,6 +786,7 @@ distfiles /usr/portage/distfiles tmpfs defaults 0 0
FSTAB
fi
+ # When aufs.modules= is used
if [ 1 = "$aufs_modules" ]; then
warn_msg "Adding all modules in $aufs_modules_dev/modules/"
@@ -804,7 +805,7 @@ FSTAB
cp /etc/sysconfig/keyboard "$CHROOT/etc/sysconfig/"
fi
- # Create the diuectories for our new union mounts
+ # Create the directories for our new union mounts
[ ! -d $CHROOT$NEW_ROOT ] && mkdir -p "$CHROOT$NEW_ROOT"
# Check to see if we successfully mounted $aufs_dev
next reply other threads:[~2014-09-05 16:10 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 16:09 Richard Farina [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-04-29 19:04 [gentoo-commits] proj/genkernel:aufs commit in: defaults/ Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2014-09-23 0:21 Richard Farina
2014-09-23 0:21 Richard Farina
2014-09-05 16:11 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-05-24 21:35 Richard Farina
2014-05-24 21:35 Richard Farina
2014-05-24 21:35 Richard Farina
2014-05-22 20:28 Richard Farina
2014-05-22 20:28 Richard Farina
2014-05-22 20:28 Richard Farina
2014-05-22 20:28 Richard Farina
2014-03-17 19:38 Robin H. Johnson
2014-03-17 19:32 Robin H. Johnson
2014-03-17 19:20 Robin H. Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406834373.3ea3c267cd3b05c68b508f28b00efa5116850c09.zerochaos@gentoo \
--to=zerochaos@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox