blob: eb93ab0f8cd9289aad602aafd7c92ac331aa54d3 [file] [log] [blame]
Milton D. Miller II0e775142016-01-20 14:57:54 -06001#!/bin/sh
2
Milton Millerba65b7b2016-02-05 12:07:53 -06003fslist="proc sys dev run"
Milton Miller98203162023-08-25 00:00:24 -05004api=run/initramfs
Milton D. Miller II0e775142016-01-20 14:57:54 -06005
6cd /
Patrick Williams51d6af42023-04-14 14:19:55 -05007# shellcheck disable=SC2086
Milton Millerba65b7b2016-02-05 12:07:53 -06008mkdir -p $fslist
Milton D. Miller II0e775142016-01-20 14:57:54 -06009mount dev dev -tdevtmpfs
10mount sys sys -tsysfs
11mount proc proc -tproc
Milton Miller98203162023-08-25 00:00:24 -050012if grep $api proc/mounts
13then
14 umount $api
15fi
Milton D. Miller II0e775142016-01-20 14:57:54 -060016if ! grep run proc/mounts
17then
18 mount tmpfs run -t tmpfs -o mode=755,nodev
19fi
20
Milton D. Miller II0e775142016-01-20 14:57:54 -060021# To start a interactive shell with job control at this point, run
22# getty 38400 ttyS4
23
24findmtd() {
25 m=$(grep -xl "$1" /sys/class/mtd/*/name)
26 m=${m%/name}
27 m=${m##*/}
Patrick Williams51d6af42023-04-14 14:19:55 -050028 echo "$m"
Milton D. Miller II0e775142016-01-20 14:57:54 -060029}
30
Andrew Jeffery25a50222016-02-23 23:47:23 +103031blkid_fs_type() {
32 # Emulate util-linux's `blkid -s TYPE -o value $1`
33 # Example busybox blkid output:
34 # # blkid /dev/mtdblock5
35 # /dev/mtdblock5: TYPE="squashfs"
36 # Process output to extract TYPE value "squashfs".
Patrick Williams51d6af42023-04-14 14:19:55 -050037 blkid "$1" | sed -e 's/^.*TYPE="//' -e 's/".*$//'
Andrew Jeffery25a50222016-02-23 23:47:23 +103038}
39
40probe_fs_type() {
Patrick Williams51d6af42023-04-14 14:19:55 -050041 fst=$(blkid_fs_type "$1")
42 echo "${fst:=jffs2}"
Andrew Jeffery25a50222016-02-23 23:47:23 +103043}
44
Milton D. Miller IIa81cb932016-03-07 17:46:28 -060045# This fw_get_env_var is a possibly broken version of fw_printenv that
46# does not check the crc or flag byte.
Gunnar Millse5b38602018-08-31 12:39:15 -050047# The u-boot environment starts with a crc32, followed by a flag byte
Milton D. Miller IIab618362016-03-02 15:23:22 -060048# when a redundannt environment is configured, followed by var=value\0 sets.
49# The flag byte for nand is a 1 byte counter; for nor it is a 1 or 0 byte.
Milton D. Miller IIab618362016-03-02 15:23:22 -060050
51get_fw_env_var() {
Milton D. Miller IIa81cb932016-03-07 17:46:28 -060052 # do we have 1 or 2 copies of the environment?
53 # count non-blank non-comment lines
54 # copies=$(grep -v ^# /etc/fw_env.config | grep -c [::alnum::])
55 # ... we could if we had the fw_env.config in the initramfs
Edward A. Jamesfd6f07c2017-08-15 14:18:12 -050056 copies=2
Milton D. Miller IIa81cb932016-03-07 17:46:28 -060057
58 # * Change \n to \r and \0 to \n
59 # * Skip to the 5th byte to skip over crc
60 # * then skip to the first or 2nd byte to skip over flag if it exists
61 # * stop parsing at first empty line corresponding to the
62 # double \0 at the end of the environment.
63 # * print the value of the variable name passed as argument
64
Edward A. Jameseb77a8f2017-07-14 12:32:44 -050065 envdev=$(findmtd u-boot-env)
Patrick Williams51d6af42023-04-14 14:19:55 -050066 if test -n "$envdev"
Edward A. Jameseb77a8f2017-07-14 12:32:44 -050067 then
Patrick Williams51d6af42023-04-14 14:19:55 -050068 tr '\n\000' '\r\n' < "/dev/$envdev" |
Edward A. Jameseb77a8f2017-07-14 12:32:44 -050069 tail -c +5 | tail -c +${copies-1} |
70 sed -ne '/^$/,$d' -e "s/^$1=//p"
71 fi
Milton D. Miller IIab618362016-03-02 15:23:22 -060072}
73
Milton D. Miller II71e7ec12016-03-02 18:28:54 -060074setup_resolv() {
75 runresolv=/run/systemd/resolve/resolv.conf
76 etcresolv=/etc/resolv.conf
77
78 if test ! -e $etcresolv -a ! -L $etcresolv
79 then
80 mkdir -p ${runresolv%/*}
81 ln -s $runresolv $etcresolv
82 fi
83 if test ! -f $runresolv
84 then
85 cat /proc/net/pnp > $runresolv
86 fi
87
88 return 0
89}
90
91try_tftp() {
92 # split into tftp:// host:port/ path/on/remote
93 # then spilt off / and then :port from the end of host:port/
94 # and : from the beginning of port
95
96 rest="${1#tftp://}"
97 path=${rest#*/}
Patrick Williams51d6af42023-04-14 14:19:55 -050098 host=${rest%"$path"}
Milton D. Miller II71e7ec12016-03-02 18:28:54 -060099 host="${host%/}"
Patrick Williams51d6af42023-04-14 14:19:55 -0500100 port="${host#"${host%:*}"}"
101 host="${host%"$port"}"
Milton D. Miller II71e7ec12016-03-02 18:28:54 -0600102 port="${port#:}"
103
104 setup_resolv
105
106 if test -z "$host" -o -z "$path"
107 then
108 debug_takeover "Invalid tftp download url '$url'."
109 elif echo "Downloading '$url' from $host ..." &&
110 ! tftp -g -r "$path" -l /run/image-rofs "$host" ${port+"$port"}
111 then
112 debug_takeover "Download of '$url' failed."
113 fi
114}
115
116try_wget() {
117 setup_resolv
118
119 echo "Downloading '$1' ..."
120 if ! wget -O /run/image-rofs "$1"
121 then
122 debug_takeover "Download of '$url' failed."
123 fi
124}
125
Milton Miller22509822016-02-05 13:04:29 -0600126debug_takeover() {
127 echo "$@"
Adriana Kobylak7fd01732020-03-12 11:12:59 -0500128
129 if ! grep -w enable-initrd-debug-sh "$optfile"
130 then
131 echo "Fatal error, triggering kernel panic!"
132 exit 1
133 fi
134
135 test -n "$@" && echo Try to manually fix.
Milton Miller22509822016-02-05 13:04:29 -0600136 cat << HERE
137After fixing run exit to continue this script, or reboot -f to retry, or
138touch /takeover and exit to become PID 1 allowing editing of this script.
139HERE
140
Adriana Kobylak7fd01732020-03-12 11:12:59 -0500141 while ! /bin/sh && ! test -f /takeover
Milton Miller22509822016-02-05 13:04:29 -0600142 do
Adriana Kobylak7fd01732020-03-12 11:12:59 -0500143 echo /bin/sh failed, retrying
Milton Miller22509822016-02-05 13:04:29 -0600144 done
145
Adriana Kobylak7fd01732020-03-12 11:12:59 -0500146 # Touch /takeover in the above shell to become pid 1
Milton Miller22509822016-02-05 13:04:29 -0600147 if test -e /takeover
148 then
149 cat << HERE
150
151Takeover of init requested. Executing /bin/sh as PID 1.
152When finished exec new init or cleanup and run reboot -f.
153
154Warning: No job control! Shell exit will panic the system!
155HERE
Patrick Williams51d6af42023-04-14 14:19:55 -0500156 export PS1=init#\
Milton Miller22509822016-02-05 13:04:29 -0600157 exec /bin/sh
158 fi
159}
160
Milton D. Miller II0e775142016-01-20 14:57:54 -0600161rofs=$(findmtd rofs)
162rwfs=$(findmtd rwfs)
163
Milton Millerba65b7b2016-02-05 12:07:53 -0600164rodev=/dev/mtdblock${rofs#mtd}
165rwdev=/dev/mtdblock${rwfs#mtd}
166
Milton Millerec0ba3c2016-02-23 21:48:48 -0600167# Set to y for yes, anything else for no.
168force_rwfst_jffs2=y
169flash_images_before_init=n
Milton D. Miller II71e7ec12016-03-02 18:28:54 -0600170consider_download_files=y
171consider_download_tftp=y
172consider_download_http=y
173consider_download_ftp=y
Milton Millerec0ba3c2016-02-23 21:48:48 -0600174
Milton D. Miller II0e775142016-01-20 14:57:54 -0600175rofst=squashfs
Patrick Williams51d6af42023-04-14 14:19:55 -0500176rwfst=$(probe_fs_type "$rwdev")
Milton Millerba65b7b2016-02-05 12:07:53 -0600177roopts=ro
178rwopts=rw
179
Milton Miller98203162023-08-25 00:00:24 -0500180image=$api/image-
181update=$api/update
Milton Millerec0ba3c2016-02-23 21:48:48 -0600182trigger=${image}rwfs
183
Milton Millerba65b7b2016-02-05 12:07:53 -0600184init=/sbin/init
Milton Millerec0ba3c2016-02-23 21:48:48 -0600185fsckbase=/sbin/fsck.
186fsck=$fsckbase$rwfst
Milton Miller5c212e42016-02-06 16:05:06 -0600187fsckopts=-a
Milton Miller98203162023-08-25 00:00:24 -0500188
Milton D. Miller II90b68472016-02-27 15:48:52 -0600189optfile=/run/initramfs/init-options
Milton Miller49ce6a12016-05-25 18:52:04 -0500190optbase=/run/initramfs/init-options-base
Milton D. Miller II71e7ec12016-03-02 18:28:54 -0600191urlfile=/run/initramfs/init-download-url
Milton D. Miller II90b68472016-02-27 15:48:52 -0600192
Milton Millere9b9b4c2023-08-25 01:02:48 -0500193mkdir -p ${optfile%/*}
194
Milton D. Miller II6d854312016-03-07 07:59:09 -0600195if test -e /${optfile##*/}
196then
197 cp /${optfile##*/} $optfile
198fi
199
Milton Miller49ce6a12016-05-25 18:52:04 -0500200if test -e /${optbase##*/}
201then
202 cp /${optbase##*/} $optbase
203else
204 touch $optbase
205fi
206
Milton D. Miller II90b68472016-02-27 15:48:52 -0600207if test ! -f $optfile
208then
Milton Miller49ce6a12016-05-25 18:52:04 -0500209 cat /proc/cmdline $optbase > $optfile
Milton D. Miller IIab618362016-03-02 15:23:22 -0600210 get_fw_env_var openbmcinit >> $optfile
211 get_fw_env_var openbmconce >> $optfile
Milton D. Miller II90b68472016-02-27 15:48:52 -0600212fi
Milton D. Miller II0e775142016-01-20 14:57:54 -0600213
Patrick Williams51d6af42023-04-14 14:19:55 -0500214echo "rofs = $rofs $rofst rwfs = $rwfs $rwfst"
Milton D. Miller II0e775142016-01-20 14:57:54 -0600215
Milton D. Miller II90b68472016-02-27 15:48:52 -0600216if grep -w debug-init-sh $optfile
Milton D. Miller II0e775142016-01-20 14:57:54 -0600217then
Adriana Kobylak7fd01732020-03-12 11:12:59 -0500218 if grep -w enable-initrd-debug-sh "$optfile"
219 then
220 debug_takeover "Debug initial shell requested by command line."
221 else
222 echo "Need to also add enable-initrd-debug-sh for debug shell."
223 fi
Milton D. Miller II0e775142016-01-20 14:57:54 -0600224fi
225
Milton Millere9b9b4c2023-08-25 01:02:48 -0500226mkdir -p $api
227if grep -w mount-bind-run-initramfs $optfile
228then
229 mount --bind $api $api
230elif grep -w mount-tmpfs-run-initramfs $optfile
231then
232 optstmpd=run/initoptstmp
233 rm -rf $optstmpd
234 mkdir -p $optstmpd
235 cp $optfile $optbase $optstmpd
236
237 mount initrd $api -t tmpfs
238
239 mv $optstmpd/* $api
240 rmdir $optstmpd
241fi
242cp -rp init shutdown update whitelist bin sbin usr lib etc var $api
243
244if test -f ${urlfile##*/}
245then
246 cp ${urlfile##*/} $urlfile
247 if test ${urlfile%/*} != $api
248 then
249 cp -p $urlfile $api
250 fi
251fi
252
253if grep -w mount-under-run-mnt $optfile
254then
255 mnt=run/mnt
256else
257 mnt=$api
258fi
259
260rodir=$mnt/ro
261rwdir=$mnt/rw
262upper=$rwdir/cow
263work=$rwdir/work
264
265mkdir -p $rodir $rwdir
266
267
Patrick Williams51d6af42023-04-14 14:19:55 -0500268if test "$consider_download_files" = "y" &&
Milton D. Miller II71e7ec12016-03-02 18:28:54 -0600269 grep -w openbmc-init-download-files $optfile
270then
Milton D. Miller II71e7ec12016-03-02 18:28:54 -0600271 if test ! -f $urlfile
272 then
273 get_fw_env_var openbmcinitdownloadurl > $urlfile
274 fi
275 url="$(cat $urlfile)"
276 rest="${url#*://}"
Patrick Williams51d6af42023-04-14 14:19:55 -0500277 proto="${url%"$rest"}"
Milton D. Miller II71e7ec12016-03-02 18:28:54 -0600278
279 if test -z "$url"
280 then
281 echo "Download url empty. Ignoring download request."
282 elif test -z "$proto"
283 then
284 echo "Download failed."
285 elif test "$proto" = tftp://
286 then
Patrick Williams51d6af42023-04-14 14:19:55 -0500287 if test "$consider_download_tftp" = "y"
Milton D. Miller II71e7ec12016-03-02 18:28:54 -0600288 then
289 try_tftp "$url"
290 else
291 echo "Download failed."
292 fi
293 elif test "$proto" = http://
294 then
Patrick Williams51d6af42023-04-14 14:19:55 -0500295 if test "$consider_download_http" = "y"
Milton D. Miller II71e7ec12016-03-02 18:28:54 -0600296 then
297 try_wget "$url"
298 else
299 echo "Download failed."
300 fi
301 elif test "$proto" = ftp://
302 then
Patrick Williams51d6af42023-04-14 14:19:55 -0500303 if test "$consider_download_ftp" = "y"
Milton D. Miller II71e7ec12016-03-02 18:28:54 -0600304 then
305 try_wget "$url"
306 else
307 echo "Download failed."
308 fi
309 else
310 echo "Download failed."
311 fi
312fi
313
Milton D. Miller II21786ff2016-02-27 17:01:13 -0600314# If there are images in root move them to /run/initramfs/ or /run/ now.
Milton Millerec0ba3c2016-02-23 21:48:48 -0600315imagebasename=${image##*/}
Patrick Williams51d6af42023-04-14 14:19:55 -0500316if test -n "${imagebasename}" && ls /"${imagebasename}"* > /dev/null 2>&1
Milton Millerec0ba3c2016-02-23 21:48:48 -0600317then
Patrick Williams51d6af42023-04-14 14:19:55 -0500318 if test "$flash_images_before_init" = "y"
Milton D. Miller II21786ff2016-02-27 17:01:13 -0600319 then
320 echo "Flash images found, will update before starting init."
Patrick Williams51d6af42023-04-14 14:19:55 -0500321 mv /"${imagebasename}"* ${image%"$imagebasename"}
Milton D. Miller II21786ff2016-02-27 17:01:13 -0600322 else
323 echo "Flash images found, will use but deferring flash update."
Patrick Williams51d6af42023-04-14 14:19:55 -0500324 mv /"${imagebasename}"* /run/
Milton D. Miller II21786ff2016-02-27 17:01:13 -0600325 fi
Milton Millerec0ba3c2016-02-23 21:48:48 -0600326fi
327
Milton D. Miller II90b68472016-02-27 15:48:52 -0600328if grep -w clean-rwfs-filesystem $optfile
Milton Millerec0ba3c2016-02-23 21:48:48 -0600329then
330 echo "Cleaning of read-write overlay filesystem requested."
331 touch $trigger
332fi
333
Lei YUa08c9962018-07-20 15:11:27 +0800334if grep -w factory-reset $optfile
335then
336 echo "Factory reset requested."
337 touch $trigger
338 do_save=--no-save-files
339else
340 do_save=--save-files
341fi
342
Patrick Williams51d6af42023-04-14 14:19:55 -0500343if test "$force_rwfst_jffs2" = "y" -a "$rwfst" != jffs2 -a ! -f $trigger
Milton Millerec0ba3c2016-02-23 21:48:48 -0600344then
345 echo "Converting read-write overlay filesystem to jffs2 forced."
346 touch $trigger
347fi
348
349if ls $image* > /dev/null 2>&1
350then
Milton D. Miller II383bfc72016-02-29 11:35:14 -0600351 if ! test -x $update
Milton Millerec0ba3c2016-02-23 21:48:48 -0600352 then
Milton D. Miller II383bfc72016-02-29 11:35:14 -0600353 debug_takeover "Flash update requested but $update missing!"
Milton Millerec0ba3c2016-02-23 21:48:48 -0600354 elif test -f $trigger -a ! -s $trigger
355 then
Lei YUa08c9962018-07-20 15:11:27 +0800356 if [ $do_save = "--save-files" ]
357 then
358 echo "Saving selected files from read-write overlay filesystem."
359 else
360 echo "No files will be selected for save."
361 fi
362 $update --no-restore-files $do_save
Milton Millerec0ba3c2016-02-23 21:48:48 -0600363 echo "Clearing read-write overlay filesystem."
Patrick Williams51d6af42023-04-14 14:19:55 -0500364 flash_eraseall "/dev/$rwfs"
Milton Millerec0ba3c2016-02-23 21:48:48 -0600365 echo "Restoring saved files to read-write overlay filesystem."
366 touch $trigger
Milton D. Miller II383bfc72016-02-29 11:35:14 -0600367 $update --no-save-files --clean-saved-files
Milton Millerec0ba3c2016-02-23 21:48:48 -0600368 else
Lei YUa08c9962018-07-20 15:11:27 +0800369 $update --clean-saved-files $do_save
Milton Millerec0ba3c2016-02-23 21:48:48 -0600370 fi
371
Patrick Williams51d6af42023-04-14 14:19:55 -0500372 rwfst=$(probe_fs_type "$rwdev")
Milton Millerec0ba3c2016-02-23 21:48:48 -0600373 fsck=$fsckbase$rwfst
374fi
375
Milton D. Miller II5d772b02016-02-27 17:31:39 -0600376if grep -w overlay-filesystem-in-ram $optfile
377then
378 rwfst=none
379fi
380
Milton D. Miller II77be7042016-02-29 12:10:34 -0600381copyfiles=
382if grep -w copy-files-to-ram $optfile
383then
384 rwfst=none
385 copyfiles=y
386fi
387
388# It would be nice to do this after fsck but that mean rofs is mounted
389# which triggers the mtd is mounted check
390if test "$rwfst$copyfiles" = noney
391then
392 touch $trigger
393 $update --copy-files --clean-saved-files --no-restore-files
394fi
395
Milton D. Miller II9ecec172016-02-27 17:31:39 -0600396if grep -w copy-base-filesystem-to-ram $optfile &&
Patrick Williams51d6af42023-04-14 14:19:55 -0500397 test ! -e /run/image-rofs && ! cp "$rodev" /run/image-rofs
Milton D. Miller II9ecec172016-02-27 17:31:39 -0600398then
399 # Remove any partial copy to avoid attempted usage later
400 if test -e /run/image-rofs
401 then
402 ls -l /run/image-rofs
403 rm -f /run/image-rofs
404 fi
405 debug_takeover "Copying $rodev to /run/image-rofs failed."
406fi
407
Milton D. Miller IIa8f26b62016-02-27 16:04:32 -0600408if test -s /run/image-rofs
409then
410 rodev=/run/image-rofs
411 roopts=$roopts,loop
412fi
413
Patrick Williams51d6af42023-04-14 14:19:55 -0500414mount "$rodev" $rodir -t $rofst -o $roopts
Milton Miller5c212e42016-02-06 16:05:06 -0600415
Patrick Williams51d6af42023-04-14 14:19:55 -0500416if test -x "$rodir$fsck"
Milton Miller5c212e42016-02-06 16:05:06 -0600417then
418 for fs in $fslist
419 do
Patrick Williams51d6af42023-04-14 14:19:55 -0500420 mount --bind "$fs" "$rodir/$fs"
Milton Miller5c212e42016-02-06 16:05:06 -0600421 done
Patrick Williams51d6af42023-04-14 14:19:55 -0500422 chroot $rodir "$fsck" $fsckopts "$rwdev"
Milton Miller5c212e42016-02-06 16:05:06 -0600423 rc=$?
424 for fs in $fslist
425 do
Patrick Williams51d6af42023-04-14 14:19:55 -0500426 umount "$rodir/$fs"
Milton Miller5c212e42016-02-06 16:05:06 -0600427 done
428 if test $rc -gt 1
429 then
430 debug_takeover "fsck of read-write fs on $rwdev failed (rc=$rc)"
431 fi
Milton D. Miller IIed3680d2016-02-27 16:38:16 -0600432elif test "$rwfst" != jffs2 -a "$rwfst" != none
Milton Millere4425842016-02-23 21:00:06 -0600433then
Milton Miller5c212e42016-02-06 16:05:06 -0600434 echo "No '$fsck' in read only fs, skipping fsck."
435fi
436
Milton D. Miller IIed3680d2016-02-27 16:38:16 -0600437if test "$rwfst" = none
438then
439 echo "Running with read-write overlay in RAM for this boot."
440 echo "No state will be preserved unless flash update performed."
Patrick Williams51d6af42023-04-14 14:19:55 -0500441elif ! mount "$rwdev" $rwdir -t "$rwfst" -o $rwopts
Milton D. Miller II0e775142016-01-20 14:57:54 -0600442then
Milton Miller22509822016-02-05 13:04:29 -0600443 msg="$(cat)" << HERE
444
445Mounting read-write $rwdev filesystem failed. Please fix and run
Andrew Jefferye4f6d372016-02-17 17:19:58 +1030446 mount $rwdev $rwdir -t $rwfst -o $rwopts
Adriana Kobylak7fd01732020-03-12 11:12:59 -0500447or perform a factory reset with the clean-rwfs-filesystem option.
Milton Miller22509822016-02-05 13:04:29 -0600448HERE
449 debug_takeover "$msg"
Milton D. Miller II0e775142016-01-20 14:57:54 -0600450fi
451
Heyi Guo2168adb2022-01-26 14:10:33 +0800452# Empty workdir; do not remove workdir itself for it will fail to recreate it if
453# RWFS is full
454if [ -d $work ]
455then
456 find $work -maxdepth 1 -mindepth 1 -exec rm -rf '{}' +
457fi
458
Milton Miller5c212e42016-02-06 16:05:06 -0600459mkdir -p $upper $work
Milton D. Miller II0e775142016-01-20 14:57:54 -0600460
William A. Kennington III5f87e532022-05-02 17:44:21 -0700461# Opportunisticly set a sane BMC date based on a file that gets
462# written right before rebooting or powercycling. If none exists,
463# use the image build date.
464files="$upper/var/lib/systemd/random-seed $rodir/etc/os-release"
Zev Weiss1bcd53d2023-04-18 20:12:07 -0700465# shellcheck disable=SC2086
466time=$(find $files -exec stat -c %Y {} \; | sort -n | tail -n 1)
William A. Kennington III5f87e532022-05-02 17:44:21 -0700467# Allow RTC coordinated time to supersede this setting
468if [ "$(date +%s)" -lt "$time" ]; then
469 date -s @$((time + 5)) || true
470fi
471
Milton D. Miller II0e775142016-01-20 14:57:54 -0600472mount -t overlay -o lowerdir=$rodir,upperdir=$upper,workdir=$work cow /root
473
Milton Miller22509822016-02-05 13:04:29 -0600474while ! chroot /root /bin/sh -c "test -x '$init' -a -s '$init'"
475do
476 msg="$(cat)" << HERE
477
478Unable to confirm /sbin/init is an executable non-empty file
479in merged file system mounted at /root.
480
Adriana Kobylak7fd01732020-03-12 11:12:59 -0500481Change Root test failed!
Milton Miller22509822016-02-05 13:04:29 -0600482HERE
483 debug_takeover "$msg"
484done
Milton D. Miller II0e775142016-01-20 14:57:54 -0600485
Milton Millerba65b7b2016-02-05 12:07:53 -0600486for f in $fslist
Milton D. Miller II0e775142016-01-20 14:57:54 -0600487do
Patrick Williams51d6af42023-04-14 14:19:55 -0500488 mount --move "$f" "root/$f"
Milton D. Miller II0e775142016-01-20 14:57:54 -0600489done
490
Zev Weissbab33872022-06-29 14:54:10 -0700491exec switch_root /root $init