Skip to content

Instantly share code, notes, and snippets.

@player999
Created May 25, 2021 17:15
Show Gist options
  • Save player999/652039f29272fa9048f37e45a369f75e to your computer and use it in GitHub Desktop.
Save player999/652039f29272fa9048f37e45a369f75e to your computer and use it in GitHub Desktop.
Prepare initramfs for Hikvision
#!/bin/bash
dd if=/dev/zero of=tmp.ext2 bs=1M count=16
mkfs.ext2 ./tmp.ext2
mkdir -p tmp_mp
sudo mount ./tmp.ext2 ./tmp_mp
sudo cp -rf fs/* ./tmp_mp
sudo umount ./tmp_mp
rm -r ./tmp_mp
gzip ./tmp.ext2
mkimage -A arm -O Linux -T ramdisk -C gzip -n ramdisk_1.0.28_ubuntu -d ./tmp.ext2.gz test_initrd.gz
rm ./tmp.ext2.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment