makecpioinitrd 275 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. rm initrd.gz 2>/dev/null
  3. sync
  4. cd initrd-tree
  5. if [ "$1" = "lzma" ];then
  6. find . | ../cpio -o -H newc > ../initrd
  7. sync
  8. cd ..
  9. lzma e ./initrd ./initrd.gz
  10. sync
  11. rm -f ./initrd
  12. else
  13. #gzip...
  14. find . | ../cpio -o -H newc | gzip -9 > ../initrd.gz
  15. sync
  16. cd ..
  17. fi