1 |
commit: c7abfb38a783e2cbfa8ccfe01fc7f257c19bca3c |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 17 19:38:09 2014 +0000 |
4 |
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 22 20:05:35 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=c7abfb38 |
7 |
|
8 |
Document the very large if structure for AUFS. |
9 |
|
10 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
11 |
|
12 |
--- |
13 |
defaults/linuxrc | 35 ++++++++++++++++++----------------- |
14 |
1 file changed, 18 insertions(+), 17 deletions(-) |
15 |
|
16 |
diff --git a/defaults/linuxrc b/defaults/linuxrc |
17 |
index b4ce21d..aaf27ad 100644 |
18 |
--- a/defaults/linuxrc |
19 |
+++ b/defaults/linuxrc |
20 |
@@ -733,7 +733,7 @@ then |
21 |
test_success 'Mount filesystem' |
22 |
FS_LOCATION='mnt/livecd' |
23 |
# Setup the loopback mounts, if unencrypted |
24 |
- else |
25 |
+ else # if [ -n "${CRYPT_ROOT}" ] |
26 |
if [ "${LOOPTYPE}" = 'normal' ] |
27 |
then |
28 |
good_msg 'Mounting loop filesystem' |
29 |
@@ -801,13 +801,14 @@ then |
30 |
test_success 'mount /dev/loop0 /' |
31 |
FS_LOCATION='mnt/livecd' |
32 |
fi |
33 |
- fi |
34 |
+ fi # if [ -n "${CRYPT_ROOT}" ] |
35 |
|
36 |
if [ "${USE_AUFS_NORMAL}" -eq '1' ] |
37 |
then |
38 |
union_insert_dir ${UNION} ${NEW_ROOT}/${FS_LOCATION} |
39 |
|
40 |
# Make sure fstab notes livecd is mounted ro. Makes system skip remount which fails on aufs dirs. |
41 |
+ # TODO: remounting all tmpfs as RO seems weird, can we be more specific? |
42 |
sed -e 's|\(.*\s/\s*tmpfs\s*\)defaults\(.*\)|\1defaults,ro\2|' /${UNION}/etc/fstab > /${UNION}/etc/fstab.new |
43 |
mv /${UNION}/etc/fstab.new /${UNION}/etc/fstab |
44 |
warn_msg "Adding all modules in $MODULESD/modules/" |
45 |
@@ -843,7 +844,7 @@ then |
46 |
setup_unionfs ${NEW_ROOT} /${FS_LOCATION} |
47 |
CHROOT=/union |
48 |
else |
49 |
- #XXX Note to potential reviewers. diff formats this section very very oddly. Be sure to review this hunk after applied, do NOT simply read the diff |
50 |
+ #XXX Note to potential reviewers. diff formats this section very very oddly. Be sure to review this hunk after applied, do NOT simply read the diff |
51 |
if [ ! "${USE_AUFS_NORMAL}" -eq '1' ] |
52 |
then |
53 |
good_msg "Copying read-write image contents to tmpfs" |
54 |
@@ -887,22 +888,22 @@ then |
55 |
# It does not exist, make a link to the livecd |
56 |
ln -s "/${FS_LOCATION}/${directory}" "${directory}" 2>/dev/null |
57 |
current_parent="${directory}" |
58 |
- fi |
59 |
- done |
60 |
- fi |
61 |
- done |
62 |
+ fi # if [ -e "/${NEW_ROOT}/${directory}" ] ... else |
63 |
+ done # while read directory |
64 |
+ fi # if [ -L "${NEW_ROOT}/${FS_LOCATION}/${x}" ] ... else |
65 |
+ done # for x in ${ROOT_LINKS} |
66 |
mkdir -p initramfs proc tmp run sys 2>/dev/null |
67 |
chmod 1777 tmp |
68 |
|
69 |
- fi |
70 |
- #XXX: end extremely confusing hunk |
71 |
+ fi # if [ ! "${USE_AUFS_NORMAL}" -eq '1' ] |
72 |
+ #XXX: end extremely confusing hunk |
73 |
|
74 |
- # have handy /mnt/cdrom (CDROOT_PATH) as well |
75 |
- _new_cdroot="${NEW_ROOT}${CDROOT_PATH}" |
76 |
- [ ! -d "${_new_cdroot}" ] && mkdir -p "${_new_cdroot}" |
77 |
- mount --bind "${CDROOT_PATH}" "${_new_cdroot}" |
78 |
+ # have handy /mnt/cdrom (CDROOT_PATH) as well |
79 |
+ _new_cdroot="${NEW_ROOT}${CDROOT_PATH}" |
80 |
+ [ ! -d "${_new_cdroot}" ] && mkdir -p "${_new_cdroot}" |
81 |
+ mount --bind "${CDROOT_PATH}" "${_new_cdroot}" |
82 |
|
83 |
- fi |
84 |
+ fi # if [ "${USE_UNIONFS_NORMAL}" = '1' ] ... else |
85 |
|
86 |
#UML=$(cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||') |
87 |
#if [ "${UML}" = 'UML' ] |
88 |
@@ -914,7 +915,7 @@ then |
89 |
# Let Init scripts know that we booted from CD |
90 |
export CDBOOT |
91 |
CDBOOT=1 |
92 |
-else |
93 |
+else # if [ "${CDROOT}" = '1' ] |
94 |
if [ "${USE_UNIONFS_NORMAL}" = '1' ] |
95 |
then |
96 |
mkdir /union_changes |
97 |
@@ -928,7 +929,7 @@ else |
98 |
mkdir -p ${UNION}/tmp/.initrd |
99 |
fi |
100 |
|
101 |
-fi |
102 |
+fi # if [ "${CDROOT}" = '1' ] |
103 |
|
104 |
# Mount the additional things as required by udev & systemd |
105 |
if [ -f ${NEW_ROOT}/etc/initramfs.mounts ]; then |
106 |
@@ -959,7 +960,7 @@ for fs in $fslist; do |
107 |
if ! $cmd; then |
108 |
bad_msg "Unable to mount $dev for $fs" |
109 |
fi |
110 |
-done |
111 |
+done # for fs in $fslist; do |
112 |
|
113 |
# Execute script on the cdrom just before boot to update things if necessary |
114 |
cdupdate |