上次已经制作了可以在bios和uefi下启动的启动盘,今天在这个基础上添加一个支持ntfs微型linux定制的启动u盘。
一、下载小型的linux:
http://www.tinycorelinux.net/downloads.html
http://www.tinycorelinux.net/11.x/x86_64/release/
二、定制ISO:
1、使用virtualBOX 加载并从ISO启动。
2、将本地虚拟盘分区格式化:
fdisk /dev/sda
mkfs.ext3 /dev/sda1
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
3、创建目录,并copy iso内容(/mnt/sr0)
mkdir new_tiny
cp -r /mnt/sr0/* ./new_tiny/
4、处理corepure64.gz
cd boot
mv corepure64.gz corepure64.cpio.gz
gunzip *.gz
mkdir new_core
cd new_core/
cpio -i -F ../corepure64.cpio
5、安装组件并处理快捷键:
使用apps安装ntfs exfat以及相关组件
cp -fr /tmp/tcloop/fuse/* ./
cp -fr /tmp/tcloop/exfat-utils/* ./
cp -fr /tmp/tcloop/exfat-fuse/* ./
cp /tmp/tcloop/exfat-fuse/usr/local/sbin/mount.extfat ./usr/local/sbin/
cd sbin
ln -sf ../usr/local/sbin/mkntfs ./mkfs.ntfs
ln -sf ../usr/local/bin/lowntfs-3g mount.lowntfs-3g
ls -sf ../usr/local/bin/ntfs-3g mount.ntfs-3g
ln -sf ../usr/local/bin/ntfs-3g mount.ntfs-3g
cd ../usr/local/lib
ln -sf ../../../lib/libntfs-3g.so.87.0.0 ./libntfs-3g.so
6、打包新的corepure64.gz
cd /new_tiny/boot/new_core
mv ../corepure64.cpio ../corepure64.cpio.bak
find .|cpio -o -H newc > ../corepure64.cpio
cd ..
gzip -9 corepure64.cpio
mv corepure64.cpio.gz corepure64.gz
chmod a+x corepure64.gz
rm *.bak
rm -fr new_core
7、重新生成iso,两种方法:
(1)使用UltraISO将原包中的corepure64.gz替换为新的。
(2)在boot上一级目录
mkisofs -r -V "HIS LINUX" -cache-inodes -J -l \
-b boot/isolinux/isolinux.bin \
-c boot/isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 \
-boot-info-table -o "../hislinuxiso.iso"
三、制作启动盘,配置文件grub.cfg如下:
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --set=root -l 'BOOT_DISK'
menuentry "Tinycore ISO --TC" {
set isofile="/img_set/TinyCorePure64-current.iso"
loopback loop $isofile
linux (loop)/boot/vmlinuz64 loglevel=3 cde vga=791 video=vesafb:ywrap,mtrr:3 linux repo=hd:LABEL=BOOT_DISK:/
initrd (loop)/boot/corepure64.gz
}
menuentry "Tinycore ISO --TCW" {
set isofile="/img_set/TinyCorePure64-current.iso"
loopback loop $isofile
linux (loop)/boot/vmlinuz64 loglevel=3 cde waitusb=10 vga=791 video=vesafb:ywrap,mtrr:3 linux repo=hd:LABEL=BOOT_DISK:/
initrd (loop)/boot/corepure64.gz
}
menuentry "Reboot" {
reboot
}
参考:
https://blog.csdn.net/leo9150285/article/details/51163475?utm_source=blogxgwz9