Principle
The method described above is out of the general mechanical hard disk and USB 2.0 the actual situation of the masses, is unpopular. A custom approach that is more consistent with the scientific outlook on development is described below.
On startup, GRUB or Extlinux boot runs/live/vmlinuz and/live/initrd.img, initrd.img after initialization will look for/live directories under SQUASHFS ext2 ext3 ext4 xfs jff S2 suffix files and directories with the Dir suffix, and then put them in the Union Mount Chenggen directory. Union filesystem, the federated file system mounts multiple folders together under a single folder, and reads and writes to the Federated directory on the branch directory designated as RW.
#initrd.img/bin/boot/9990-overlay.sh:69 if [ -n "${addimage_directory}" ] && [ -d "${addimage_directory}" ]70 then71 for FILESYSTEM in squashfs ext2 ext3 ext4 xfs jffs2 dir72 do73 for IMAGE in "${addimage_directory}"/*."${FILESYSTEM}"74 do75 if [ -e "${IMAGE}" ]76 then77 image_string="${image_string} ${IMAGE}"78 fi79 done80 done81 fi
Custom
The tool Unionfs-fuse is used here, and the compatibility is better than the AUFS,UNIONFS support on the user layer. Debian installation Method: apt-get install unionfs-fuse
, then execute:
cd /tmpmkdir custommkdir unionmount /path/to/live/filesystem.squashfs /mnt unionfs-fuse -o cow,max_files=32768 -o allow_other,use_ino,suid,dev,nonempty /tmp/custom=RW:/mnt=RO /tmp/union/ #1cd unionmount -o bind /proc proc/ #2chroot . #3
- 1: Mount two directories to/tmp/union, and write operations to/tmp/union back to/tmp/custom.
-o cow,max_files=32768 -o allow_other,use_ino,suid,dev,nonempty
is required, otherwise there will be a problem with the file read and write.
- 2:proc installing certain software may require information, such as VMWare.
- 3: If the host system is not Kali, you may need to set additional variables, such as PATH.
When we get in, we can ogled and do whatever we like. After the operation is complete, delete the extra directories and files in the/tmp/custom, package:
cd /tmpmksquashfs custom/ custom.squashfscp custom.squashfs /path/to/live/
You can see the effect after rebooting.
GRUB2 Boot Extlinux
After copying the contents of the Kali ISO directly to a partition on the USB drive, assume that it is/DEV/SDB2, the directory name is Kalilive, and the installation Extlinux
extlinux -i /path/to/kaliLive/
At this point the first 512 bytes of/DEV/SDB2 are the bootloader of Extlinux. If you installed GRUB 2 in/dev/sdb, you can:
set root=(hd0,msdos2)chainloader +1boot
Boot Extlinux.
Other
复制+手动安装 bootloader
The persistence function is not available under Kali 1.0.1. dd method has not been tested.
- For small files that require frequent modifications, such as. BASHRC, you can consider placing them under the. Dir directory.
Another way to customize Kali Linux Live USB