Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


qemu_kvm_tinycore_image

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
qemu_kvm_tinycore_image [2018/01/07 16:40] – created adminqemu_kvm_tinycore_image [2018/01/07 16:43] admin
Line 1: Line 1:
-=====Qemu / KVM TinyCore image===== +=====Qemu / KVM TinyCore 8.2.1 image=====
-  * Download TinyCore Linux ISO +
-  curl -O https://mirrors.dotsrc.org/tinycorelinux/8.x/x86/release/TinyCore-8.2.1.iso+
  
-# Create mount points +{{::qemu-tc.png?nolink|}}
-sudo mkdir -p /mnt/{image,iso}+
  
-Create disk image +  * Download TinyCore Linux ISO:<code>curl -O https://mirrors.dotsrc.org/tinycorelinux/8.x/x86/release/TinyCore-8.2.1.iso</code. 
-qemu-img create -f raw tc.raw 64M +  * Create mount points<code>sudo mkdir -p /mnt/{image,iso}</code> 
- +  * Create disk image<code>qemu-img create -f raw tc.raw 64M</code> 
-Mount image as blockdevice +  Mount image as blockdevice<code>sudo losetup /dev/loop0 tc.raw 
-sudo losetup /dev/loop0 tc.raw +sudo kpartx -a /dev/loop0</code> 
-sudo kpartx -a /dev/loop0 +  Create partition table on disk image<code>sudo parted --script /dev/loop0 \
- +
-Create partition table on disk image +
-sudo parted --script /dev/loop0 \+
     mklabel msdos \     mklabel msdos \
     mkpart primary 1MiB 100% \     mkpart primary 1MiB 100% \
-    toggle 1 boot +    toggle 1 boot</code> 
- +  Create filesystem<code>sudo mkfs.ext2 /dev/mapper/loop0p1</code> 
-Create filesystem +  Mount image and ISO<code>
-sudo mkfs.ext2 /dev/mapper/loop0p1 +
- +
-Mount image and ISO+
 sudo mount /dev/mapper/loop0p1 /mnt/image sudo mount /dev/mapper/loop0p1 /mnt/image
-sudo mount -o loop TinyCore-8.2.1.iso /mnt/iso +sudo mount -o loop TinyCore-8.2.1.iso /mnt/iso</code> 
- +  Create directories (grub2 on Fedora/RedHat)<code>sudo mkdir -p /mnt/image/{boot,tce,tce/optional}</code> 
-Create directories (grub2 on Fedora/RedHat) +  Copy TinyCore to disk image<code>
-sudo mkdir -p /mnt/image/{boot,tce,tce/optional} +
- +
-Copy TinyCore to disk image+
 sudo cp /mnt/iso/boot/core.gz /mnt/image/boot/ sudo cp /mnt/iso/boot/core.gz /mnt/image/boot/
 sudo cp /mnt/iso/boot/vmlinuz /mnt/image/boot/ sudo cp /mnt/iso/boot/vmlinuz /mnt/image/boot/
 sudo cp /mnt/iso/cde/onboot.lst /mnt/image/tce/ sudo cp /mnt/iso/cde/onboot.lst /mnt/image/tce/
-sudo cp /mnt/iso/cde/optional/* /mnt/image/tce/optional/ +sudo cp /mnt/iso/cde/optional/* /mnt/image/tce/optional/</code> 
- +  Install GRUB (grub2-... on Fedora/RedHat)<code>sudo grub2-install --target=i386-pc --boot-directory=/mnt/image/boot /dev/loop0</code> 
-Install GRUB (grub2-... on Fedora/RedHat) +  Configure grub<code>sudo bash -c "cat > /mnt/image/boot/grub2/grub.cfg" <<'EOF'
-sudo grub2-install --target=i386-pc --boot-directory=/mnt/image/boot /dev/loop0 +
- +
-Configure grub +
-sudo bash -c "cat > /mnt/image/boot/grub2/grub.cfg" <<'EOF'+
 set timeout=5 set timeout=5
 set root='hd0,msdos1' set root='hd0,msdos1'
Line 46: Line 30:
     initrd /boot/core.gz     initrd /boot/core.gz
 } }
-EOF +EOF</code> 
- +  Test boot image<code>
-Test boot image+
 cd; sudo umount /mnt/{iso,image} cd; sudo umount /mnt/{iso,image}
  
Line 60: Line 43:
     -usb \     -usb \
     -device usb-ehci,id=ehci \     -device usb-ehci,id=ehci \
-    -device usb-tablet,bus=usb-bus.0+    -device usb-tablet,bus=usb-bus.0</code>
  
  
 {{tag>[qmeu kvm tinycore image]}} {{tag>[qmeu kvm tinycore image]}}
    
qemu_kvm_tinycore_image.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1