Advertisement
Guest User

Untitled

a guest
Jan 7th, 2013
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.88 KB | None | 0 0
  1. #!/usr/bin/ash
  2.  
  3. run_latehook() {
  4.    
  5.    # Mount tmpfs root
  6.    mount -t tmpfs tmpfs /mnt
  7.    
  8.    # Unpack rootfs
  9.    msg "Unpacking rootfs..."
  10.    cd /mnt
  11.    
  12.    # parse the kernel command line
  13.    parse_cmdline
  14.    
  15.    for archfs in ${archfs//,/ }; do
  16.    if [ "$archfs" = "xz" ]; then
  17.         xz -d < /new_root/boot/archfs.xz | cpio -imd --no-absolute-filenames > /dev/null 2>&1
  18.    
  19.    elif [ "$archfs" = "gzip" ]; then
  20.         gzip -dc /new_root/boot/archfs.gz | cpio -imd --no-absolute-filenames > /dev/null 2>&1
  21.  
  22.    elif [ "$archfs" = "lzo" ]; then
  23.         lzop -d < /new_root/boot/archfs.lzo | cpio -imd --no-absolute-filenames > /dev/null 2>&1
  24.    
  25.    elif [ "$archfs" = "img" ]; then
  26.         cpio -imd --no-absolute-filenames /new_root/boot/archfs.img > /dev/null 2>&1
  27.    fi
  28.    done
  29.    # Switch tmpfs to new root
  30.    umount /new_root
  31.    mount -M /mnt /new_root
  32. }
  33.  
  34. # vim: set ft=sh ts=4 sw=4 et:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement