create-custom-debian-live-usb-stick-uefi
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| create-custom-debian-live-usb-stick-uefi [2019/02/03 10:06] – [Create CD image] baumi | create-custom-debian-live-usb-stick-uefi [2019/04/20 10:10] (current) – [Create GPT & MBR partition tables] baumi | ||
|---|---|---|---|
| Line 42: | Line 42: | ||
| blackbox xserver-xorg-core xserver-xorg xinit xterm \ | blackbox xserver-xorg-core xserver-xorg xinit xterm \ | ||
| pciutils usbutils gparted ntfs-3g hfsprogs rsync less curl tcpdump dosfstools syslinux partclone vim pv \ | pciutils usbutils gparted ntfs-3g hfsprogs rsync less curl tcpdump dosfstools syslinux partclone vim pv \ | ||
| - | firefox-esr chntpw lvm2 mdadm keepassx gdisk gnupg duplicity s3cmd bzip2 lsof screen mc htop iproute2 inetutils-ping inetutils-traceroute | + | firefox-esr chntpw lvm2 mdadm keepassx gdisk gnupg duplicity s3cmd bzip2 lsof screen mc htop iproute2 inetutils-ping inetutils-traceroute |
| [ ... ] | [ ... ] | ||
| Line 61: | Line 61: | ||
| ===== Create filesystem & boot config ===== | ===== Create filesystem & boot config ===== | ||
| < | < | ||
| - | root@host: | + | root@host: |
| mksquashfs chroot image/ | mksquashfs chroot image/ | ||
| Parallel mksquashfs: Using 1 processor | Parallel mksquashfs: Using 1 processor | ||
| Line 100: | Line 100: | ||
| mail (8) | mail (8) | ||
| root@host: | root@host: | ||
| - | root@host: | + | root@host: |
| - | cp chroot/ | + | cp chroot/ |
| root@host: | root@host: | ||
| Line 111: | Line 111: | ||
| set timeout=30 | set timeout=30 | ||
| - | menuentry "The Shit Has Hit The Fan" { | + | menuentry "SHTF Live Stick" { |
| - | linux /vmlinuz boot=live | + | linux /vmlinuz boot=live |
| initrd /initrd | initrd /initrd | ||
| } | } | ||
| Line 123: | Line 123: | ||
| < | < | ||
| root@host: | root@host: | ||
| + | root@host: | ||
| + | </ | ||
| + | ==== Create GPT & MBR partition tables (skip for updating) ==== | ||
| + | < | ||
| root@host: | root@host: | ||
| 100+0 records in | 100+0 records in | ||
| 100+0 records out | 100+0 records out | ||
| 102400 bytes (102 kB) copied, 1.5086 s, 67.9 kB/s | 102400 bytes (102 kB) copied, 1.5086 s, 67.9 kB/s | ||
| - | root@host: | + | root@host: |
| - | + | | |
| - | Welcome to fdisk (util-linux 2.25.2). | + | |
| - | Changes will remain in memory only, until you decide to write them. | + | name 1 BIOS \ |
| - | Be careful before using the write command. | + | set 1 bios_grub on \ |
| - | + | | |
| - | Device does not contain a recognized partition table. | + | name 2 EFI \ |
| - | Created a new DOS disklabel with disk identifier 0x374a220b. | + | set 2 esp on \ |
| - | + | | |
| - | Command (m for help): n | + | name 3 LINUX \ |
| - | Partition type | + | set 3 msftdata on |
| - | | + | |
| - | e | + | root@host:~/ |
| - | Select (default p): p | + | r # recovery and transformation options |
| - | Partition number (1-4, default 1): | + | h # make hybrid MBR |
| - | First sector (2048-2005431, | + | 1 2 3 # partition numbers for hybrid MBR |
| - | Last sector, +sectors or +size{K,M,G,T,P} (2048-2005431, | + | N # do not place EFI GPT (0xEE) partition |
| - | + | EF # MBR hex code | |
| - | Created a new partition | + | N # do not set bootable flag |
| - | + | EF # MBR hex code | |
| - | Command | + | N # do not set bootable flag |
| - | Selected | + | 83 # MBR hex code |
| - | The bootable flag on partition 1 is enabled now. | + | Y # set the bootable flag |
| - | + | x # extra functionality menu | |
| - | Command (m for help): t | + | h # recompute CHS values in protective/ |
| - | Selected partition 1 | + | w # write table to disk and exit |
| - | Hex code (type L to list all codes): b | + | Y # confirm changes |
| - | If you have created or modified any DOS 6.x partitions, please see the fdisk documentation for additional information. | + | EOF |
| - | Changed type of partition ' | + | </ |
| - | + | ==== Create filesystems | |
| - | Command | + | < |
| - | The partition table has been altered. | + | root@host: |
| - | Calling ioctl() to re-read partition table. | + | </ |
| - | Syncing disks. | + | ==== Create & mount filesystems ==== |
| - | + | < | |
| - | root@host: | + | root@host: |
| - | mkfs.fat | + | </ |
| + | ==== Install grub for UEFI and BIOS ==== | ||
| + | < | ||
| + | root@host: | ||
| + | --target=x86_64-efi \ | ||
| + | --efi-directory=/ | ||
| + | --boot-directory=/ | ||
| + | --removable \ | ||
| + | --recheck | ||
| + | |||
| + | root@host: | ||
| + | --target=i386-pc \ | ||
| + | --boot-directory=/ | ||
| + | --recheck \ | ||
| + | ${DEVICE} | ||
| root@host: | root@host: | ||
| Line 169: | Line 187: | ||
| ===== Create USB Stick ===== | ===== Create USB Stick ===== | ||
| < | < | ||
| - | root@host: | + | root@host: |
| - | root@host:~/shtf-stick# syslinux -i ${DEVICE}1 | + | cp -ar ./image/* /mnt/usb/ && \ |
| - | + | cp -a ./scratch/grub.cfg /mnt/usb/boot/grub/grub.cfg && \ | |
| - | root@host:~/shtf-stick# dd if=/ | + | umount /mnt/{usb,efi} |
| - | 1+0 records in | + | |
| - | 1+0 records out | + | |
| - | 440 bytes (440 B) copied, 0.0564548 s, 7.8 kB/s | + | |
| - | + | ||
| - | root@host: | + | |
| - | mount ${DEVICE}1 /mnt/usb | + | |
| - | + | ||
| - | root@host: | + | |
| - | cp / | + | |
| - | cp / | + | |
| - | cp / | + | |
| - | cp image/isolinux/isolinux.cfg /mnt/usb/syslinux.cfg && \ | + | |
| - | cp /usr/share/ | + | |
| - | rsync -rv image/live /mnt/usb/ && date +%Y%m%d_%H%M > / | + | |
| - | sending incremental file list | + | |
| - | live/ | + | |
| - | live/ | + | |
| - | live/ | + | |
| - | live/ | + | |
| - | + | ||
| - | sent 308,553,889 bytes received 77 bytes 88, | + | |
| - | total size is 308, | + | |
| - | + | ||
| - | root@host: | + | |
| </ | </ | ||
create-custom-debian-live-usb-stick-uefi.1549184795.txt.gz · Last modified: by baumi
