Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 7th, 2013  |  syntax: Bash  |  size: 0.88 KB  |  views: 73  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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:
clone this paste RAW Paste Data