#!/usr/bin/ash
run_latehook() {
# Mount tmpfs root
mount -t tmpfs tmpfs /mnt
# Unpack rootfs
msg "Unpacking rootfs..."
cd /mnt
# parse the kernel command line
parse_cmdline
for archfs in ${archfs//,/ }; do
if [ "$archfs" = "xz" ]; then
xz -d < /new_root/boot/archfs.xz | cpio -imd --no-absolute-filenames > /dev/null 2>&1
elif [ "$archfs" = "gzip" ]; then
gzip -dc /new_root/boot/archfs.gz | cpio -imd --no-absolute-filenames > /dev/null 2>&1
elif [ "$archfs" = "lzo" ]; then
lzop -d < /new_root/boot/archfs.lzo | cpio -imd --no-absolute-filenames > /dev/null 2>&1
elif [ "$archfs" = "img" ]; then
cpio -imd --no-absolute-filenames /new_root/boot/archfs.img > /dev/null 2>&1
fi
done
# Switch tmpfs to new root
umount /new_root
mount -M /mnt /new_root
}
# vim: set ft=sh ts=4 sw=4 et: