编译grub2参考之前的文章
https://blog.csdn.net/hknaruto/article/details/126120947
插入U盘,创建一个分区,vfat格式化
sudo mkfs.vfat /dev/sdb1
挂载
mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb
grub-install写入引导信息
mkdir /mnt/usb/boot
/usr/local/sbin/grub-install --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable
完成安装后的目录及文件
.
./boot
./boot/grub
./boot/grub/arm64-efi
./boot/grub/arm64-efi/bufio.mod
./boot/grub/arm64-efi/gcry_twofish.mod
./boot/grub/arm64-efi/reboot.mod
./boot/grub/arm64-efi/fat.mod
./boot/grub/arm64-efi/minix2.mod
./boot/grub/arm64-efi/f2fs.mod
./boot/grub/arm64-efi/tar.mod
./boot/grub/arm64-efi/part_bsd.mod
./boot/grub/arm64-efi/loadenv.mod
./boot/grub/arm64-efi/test_blockarg.mod
./boot/grub/arm64-efi/ldm.mod
./boot/grub/arm64-efi/gfxterm_background.mod
./boot/grub/arm64-efi/lssal.mod
./boot/grub/arm64-efi/zfscrypt.mod
./boot/grub/arm64-efi/hello.mod
./boot/grub/arm64-efi/part_amiga.mod
./boot/grub/arm64-efi/priority_queue.mod
./boot/grub/arm64-efi/gcry_dsa.mod
./boot/grub/arm64-efi/macho.mod
./boot/grub/arm64-efi/efi_gop.mod
./boot/grub/arm64-efi/pbkdf2_test.mod
./boot/grub/arm64-efi/iso9660.mod
./boot/grub/arm64-efi/diskfilter.mod
./boot/grub/arm64-efi/true.mod
./boot/grub/arm64-efi/gcry_md5.mod
./boot/grub/arm64-efi/part_plan.mod
./boot/grub/arm64-efi/mpi.mod
./boot/grub/arm64-efi/password_pbkdf2.mod
./boot/grub/arm64-efi/gcry_sha512.mod
./boot/grub/arm64-efi/efifwsetup.mod
./boot/grub/arm64-efi/part_dvh.mod
./boot/grub/arm64-efi/cmdline_cat_test.mod
./boot/grub/arm64-efi/hashsum.mod
./boot/grub/arm64-efi/gfxterm.mod
./boot/grub/arm64-efi/gcry_whirlpool.mod
./boot/grub/arm64-efi/setjmp_test.mod
./boot/grub/arm64-efi/sleep.mod
./boot/grub/arm64-efi/ntfs.mod
./boot/grub/arm64-efi/exfat.mod
./boot/grub/arm64-efi/btrfs.mod
./boot/grub/arm64-efi/zstd.mod
./boot/grub/arm64-efi/zfsinfo.mod
./boot/grub/arm64-efi/file.mod
./boot/grub/arm64-efi/xen_boot.mod
./boot/grub/arm64-efi/gcry_sha256.mod
./boot/grub/arm64-efi/serial.mod
./boot/grub/arm64-efi/blocklist.mod
./boot/grub/arm64-efi/part_gpt.mod
./boot/grub/arm64-efi/net.mod
./boot/grub/arm64-efi/signature_test.mod
./boot/grub/arm64-efi/lsefimmap.mod
./boot/grub/arm64-efi/raid5rec.mod
./boot/grub/arm64-efi/lsmmap.mod
./boot/grub/arm64-efi/sleep_test.mod
./boot/grub/arm64-efi/minix3_be.mod
./boot/grub/arm64-efi/time.mod
./boot/grub/arm64-efi/functional_test.mod
./boot/grub/arm64-efi/romfs.mod
./boot/grub/arm64-efi/setjmp.mod
./boot/grub/arm64-efi/lsefi.mod
./boot/grub/arm64-efi/hexdump.mod
./boot/grub/arm64-efi/acpi.mod
./boot/grub/arm64-efi/minix3.mod
./boot/grub/arm64-efi/ufs2.mod
./boot/grub/arm64-efi/luks.mod
./boot/grub/arm64-efi/scsi.mod
./boot/grub/arm64-efi/search_fs_uuid.mod
./boot/grub/arm64-efi/luks2.mod
./boot/grub/arm64-efi/dm_nv.mod
./boot/grub/arm64-efi/bfs.mod
./boot/grub/arm64-efi/testspeed.mod
./boot/grub/arm64-efi/gzio.mod
./boot/grub/arm64-efi/efinet.mod
./boot/grub/arm64-efi/affs.mod
./boot/grub/arm64-efi/lvm.mod
./boot/grub/arm64-efi/strtoull_test.mod
./boot/grub/arm64-efi/disk.mod
./boot/grub/arm64-efi/gcry_rmd160.mod
./boot/grub/arm64-efi/mul_test.mod
./boot/grub/arm64-efi/font.mod
./boot/grub/arm64-efi/odc.mod
./boot/grub/arm64-efi/loopback.mod
./boot/grub/arm64-efi/zfs.mod
./boot/grub/arm64-efi/test.mod
./boot/grub/arm64-efi/ufs1.mod
./boot/grub/arm64-efi/cpio.mod
./boot/grub/arm64-efi/gcry_crc.mod
./boot/grub/arm64-efi/video_fb.mod
./boot/grub/arm64-efi/json.mod
./boot/grub/arm64-efi/udf.mod
./boot/grub/arm64-efi/read.mod
./boot/grub/arm64-efi/cpio_be.mod
./boot/grub/arm64-efi/mmap.mod
./boot/grub/arm64-efi/normal.mod
./boot/grub/arm64-efi/xfs.mod
./boot/grub/arm64-efi/minix_be.mod
./boot/grub/arm64-efi/syslinuxcfg.mod
./boot/grub/arm64-efi/date.mod
./boot/grub/arm64-efi/datehook.mod
./boot/grub/arm64-efi/cbfs.mod
./boot/grub/arm64-efi/bitmap_scale.mod
./boot/grub/arm64-efi/progress.mod
./boot/grub/arm64-efi/div_test.mod
./boot/grub/arm64-efi/part_msdos.mod
./boot/grub/arm64-efi/search.mod
./boot/grub/arm64-efi/part_sun.mod
./boot/grub/arm64-efi/keystatus.mod
./boot/grub/arm64-efi/fdt.mod
./boot/grub/arm64-efi/hfspluscomp.mod
./boot/grub/arm64-efi/terminfo.mod
./boot/grub/arm64-efi/tftp.mod
./boot/grub/arm64-efi/exfctest.mod
./boot/grub/arm64-efi/chain.mod
./boot/grub/arm64-efi/videotest_checksum.mod
./boot/grub/arm64-efi/tga.mod
./boot/grub/arm64-efi/ctz_test.mod
./boot/grub/arm64-efi/part_apple.mod
./boot/grub/arm64-efi/videoinfo.mod
./boot/grub/arm64-efi/mdraid09.mod
./boot/grub/arm64-efi/ext2.mod
./boot/grub/arm64-efi/xnu_uuid_test.mod
./boot/grub/arm64-efi/minix.mod
./boot/grub/arm64-efi/search_label.mod
./boot/grub/arm64-efi/raid6rec.mod
./boot/grub/arm64-efi/jpeg.mod
./boot/grub/arm64-efi/gfxterm_menu.mod
./boot/grub/arm64-efi/bswap_test.mod
./boot/grub/arm64-efi/gcry_sha1.mod
./boot/grub/arm64-efi/video_colors.mod
./boot/grub/arm64-efi/msdospart.mod
./boot/grub/arm64-efi/cryptodisk.mod
./boot/grub/arm64-efi/geli.mod
./boot/grub/arm64-efi/probe.mod
./boot/grub/arm64-efi/gcry_cast5.mod
./boot/grub/arm64-efi/ufs1_be.mod
./boot/grub/arm64-efi/cat.mod
./boot/grub/arm64-efi/afsplitter.mod
./boot/grub/arm64-efi/linux.mod
./boot/grub/arm64-efi/gcry_blowfish.mod
./boot/grub/arm64-efi/extcmd.mod
./boot/grub/arm64-efi/minicmd.mod
./boot/grub/arm64-efi/nilfs2.mod
./boot/grub/arm64-efi/help.mod
./boot/grub/arm64-efi/lzopio.mod
./boot/grub/arm64-efi/part_acorn.mod
./boot/grub/arm64-efi/lsefisystab.mod
./boot/grub/arm64-efi/part_dfly.mod
./boot/grub/arm64-efi/squash4.mod
./boot/grub/arm64-efi/gcry_serpent.mod
./boot/grub/arm64-efi/tpm.mod
./boot/grub/arm64-efi/gettext.mod
./boot/grub/arm64-efi/gcry_tiger.mod
./boot/grub/arm64-efi/shift_test.mod
./boot/grub/arm64-efi/procfs.mod
./boot/grub/arm64-efi/gcry_rfc2268.mod
./boot/grub/arm64-efi/datetime.mod
./boot/grub/arm64-efi/jfs.mod
./boot/grub/arm64-efi/smbios.mod
./boot/grub/arm64-efi/crypto.mod
./boot/grub/arm64-efi/hfs.mod
./boot/grub/arm64-efi/gcry_idea.mod
./boot/grub/arm64-efi/sfs.mod
./boot/grub/arm64-efi/afs.mod
./boot/grub/arm64-efi/cmp_test.mod
./boot/grub/arm64-efi/videotest.mod
./boot/grub/arm64-efi/png.mod
./boot/grub/arm64-efi/memrw.mod
./boot/grub/arm64-efi/gcry_seed.mod
./boot/grub/arm64-efi/div.mod
./boot/grub/arm64-efi/ntfscomp.mod
./boot/grub/arm64-efi/gcry_rijndael.mod
./boot/grub/arm64-efi/eval.mod
./boot/grub/arm64-efi/gcry_md4.mod
./boot/grub/arm64-efi/halt.mod
./boot/grub/arm64-efi/cmp.mod
./boot/grub/arm64-efi/offsetio.mod
./boot/grub/arm64-efi/lsacpi.mod
./boot/grub/arm64-efi/xnu_uuid.mod
./boot/grub/arm64-efi/hfsplus.mod
./boot/grub/arm64-efi/bitmap.mod
./boot/grub/arm64-efi/gptsync.mod
./boot/grub/arm64-efi/parttool.mod
./boot/grub/arm64-efi/part_sunpc.mod
./boot/grub/arm64-efi/adler32.mod
./boot/grub/arm64-efi/archelp.mod
./boot/grub/arm64-efi/tr.mod
./boot/grub/arm64-efi/all_video.mod
./boot/grub/arm64-efi/echo.mod
./boot/grub/arm64-efi/mdraid09_be.mod
./boot/grub/arm64-efi/gfxmenu.mod
./boot/grub/arm64-efi/crc64.mod
./boot/grub/arm64-efi/search_fs_file.mod
./boot/grub/arm64-efi/newc.mod
./boot/grub/arm64-efi/http.mod
./boot/grub/arm64-efi/xzio.mod
./boot/grub/arm64-efi/configfile.mod
./boot/grub/arm64-efi/minix2_be.mod
./boot/grub/arm64-efi/pgp.mod
./boot/grub/arm64-efi/ls.mod
./boot/grub/arm64-efi/elf.mod
./boot/grub/arm64-efi/fshelp.mod
./boot/grub/arm64-efi/boot.mod
./boot/grub/arm64-efi/mdraid1x.mod
./boot/grub/arm64-efi/password.mod
./boot/grub/arm64-efi/gcry_camellia.mod
./boot/grub/arm64-efi/gcry_rsa.mod
./boot/grub/arm64-efi/video.mod
./boot/grub/arm64-efi/reiserfs.mod
./boot/grub/arm64-efi/memdisk.mod
./boot/grub/arm64-efi/gcry_arcfour.mod
./boot/grub/arm64-efi/gcry_des.mod
./boot/grub/arm64-efi/terminal.mod
./boot/grub/arm64-efi/macbless.mod
./boot/grub/arm64-efi/regexp.mod
./boot/grub/arm64-efi/pbkdf2.mod
./boot/grub/arm64-efi/testload.mod
./boot/grub/arm64-efi/trig.mod
./boot/grub/arm64-efi/moddep.lst
./boot/grub/arm64-efi/command.lst
./boot/grub/arm64-efi/fs.lst
./boot/grub/arm64-efi/partmap.lst
./boot/grub/arm64-efi/parttool.lst
./boot/grub/arm64-efi/video.lst
./boot/grub/arm64-efi/crypto.lst
./boot/grub/arm64-efi/terminal.lst
./boot/grub/arm64-efi/modinfo.sh
./boot/grub/arm64-efi/core.efi
./boot/grub/locale
./boot/grub/locale/sl.mo
./boot/grub/locale/nl.mo
./boot/grub/locale/pl.mo
./boot/grub/locale/sr.mo
./boot/grub/locale/ro.mo
./boot/grub/locale/gl.mo
./boot/grub/locale/it.mo
./boot/grub/locale/ko.mo
./boot/grub/locale/en@piglatin.mo
./boot/grub/locale/ru.mo
./boot/grub/locale/en@quot.mo
./boot/grub/locale/vi.mo
./boot/grub/locale/id.mo
./boot/grub/locale/sv.mo
./boot/grub/locale/de.mo
./boot/grub/locale/fi.mo
./boot/grub/locale/de_CH.mo
./boot/grub/locale/lt.mo
./boot/grub/locale/eo.mo
./boot/grub/locale/tr.mo
./boot/grub/locale/uk.mo
./boot/grub/locale/da.mo
./boot/grub/locale/es.mo
./boot/grub/locale/de@hebrew.mo
./boot/grub/locale/ja.mo
./boot/grub/locale/ast.mo
./boot/grub/locale/fr.mo
./boot/grub/locale/hu.mo
./boot/grub/locale/en@arabic.mo
./boot/grub/locale/pt.mo
./boot/grub/locale/pt_BR.mo
./boot/grub/locale/en@greek.mo
./boot/grub/locale/ca.mo
./boot/grub/locale/lg.mo
./boot/grub/locale/zh_TW.mo
./boot/grub/locale/nb.mo
./boot/grub/locale/en@cyrillic.mo
./boot/grub/locale/zh_CN.mo
./boot/grub/locale/pa.mo
./boot/grub/locale/hr.mo
./boot/grub/locale/en@hebrew.mo
./boot/grub/fonts
./boot/grub/grubenv
./EFI
./EFI/BOOT
./EFI/BOOT/BOOTAA64.EFI
测试UF716笔记本上的引导
![](https://i-blog.csdnimg.cn/blog_migrate/2bf031d93f99eb57551fccc94c8bd6bd.png)
成功引导grub2。