User Tools

Site Tools


multiboot_usb_key

Differences

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

Link to this comparison view

Next revision
Previous revision
multiboot_usb_key [2010/09/02 18:19] – created memeruizmultiboot_usb_key [2021/02/01 05:55] (current) – external edit 127.0.0.1
Line 10: Line 10:
   * Install grub on the usb key   * Install grub on the usb key
  
-  mount /dev/sdb1 /mnt +  mount /dev/sdb1 /media/usb0 
-  grub-install --no-floppy --root-directory=/mnt /dev/sdb+  grub-install --no-floppy --root-directory=/media/usb0 /dev/sdb
  
-  * Create a grub.cfg file in /boot/grub/ with the following contents:+  * Create a grub.cfg file in /media/usb0/boot/grub/ with the following contents:
  
   menuentry "debian-installer-i386" {   menuentry "debian-installer-i386" {
Line 44: Line 44:
     initrd /boot/live_i386/initrd.img     initrd /boot/live_i386/initrd.img
   }   }
 +
 +===== Debian installer =====
 +
 +  * Get the hd-usb debian installer vmlinuz and initrd.gz files from the web. Rename them to vmlinuz_$arch and initrd_$arch.gz, where $arch is the computer architecture (i386, amd64). Copy them to /media/usb0/boot.
 +  * Get the corresponding netinstall iso files for the installed architectures and copy them to /media/usb0
 +
 +===== Debian live =====
 +
 +  * Create some necessary directories:
 +
 +  mkdir /media/usb0/persistent
 +  mkdir /media/usb0/persistent/amd64
 +  mkdir /media/usb0/persistent/i386
 +  mkdir /media/usb0/boot/live_amd64
 +  mkdir /media/usb0/boot/live_i386
 +
 +==== Generate the debian live image ====
 +
 +  * Install live-helper package
 +  * Create live image (do this from a 64bit machine):
 +
 +  mkdir /tmp/d-l
 +  mkdir /tmp/d-l/amd64
 +  cd /tmp/d-l/amd64
 +  sudo lh clean --binary
 +  sudo lh config -b usb-hdd -a amd64 -d sid
 +  sudo lh build
 +
 +  * When the build is finished edit the file chroot/sbin/live-snapshot 
 +  * Replace the line:
 +
 +  SNAP_COW=$(echo "${SNAP_RESYNC_STRING}" | sed -e 's|^/root\([^:.]*\).*$|'"${DEF_SNAP_COW}"'\1|')
 +
 +  * With:
 +
 +  SNAP_COW=$(echo "${SNAP_RESYNC_STRING}" | sed -e 's|^/cow\([^:.]*\).*$|'"${DEF_SNAP_COW}"'\1|')
 +
 +  * Regenerate the live image:
 +
 +  sudo lh clean --binary
 +  sudo lh binary
 +
 +  * Loop mount the generated live image, copy the important parts to the usb key, and extract the initrd contents:  
 +
 +  mount -o loop,offset=512 binary.img /mnt
 +  cd /mnt/live
 +  cp * /media/usb0/boot/live_amd64
 +  mkdir /tmp/initrd_amd64
 +  cp /mnt/live/initrd.img /tmp/initrd_amd64/initrd.img.gz
 +  cd /tmp/initrd_amd64
 +  gunzip initrd.img.gz
 +  cpio -ivmd -F initrd.img
 +  rm initrd.img
 +
 +  * Edit the file scripts/live
 +  * Replace line:
 +
 +  ${snap_type}SNAP="/cow${snap_mount#$rootmnt}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt
 +
 +  * With:
 +
 +  ${snap_type}SNAP="/cow${snap_mount#$rootmnt}":${snapdev}:${snapfile}" >> ${rootmnt}/etc/live.conf # for resync on reboot/halt
 +
 +  * And replace line:
 +
 +  snapdata=$(find_files "${PERSISTENT_PATH}${snap_label}.squashfs  ${PERSISTENT_PATH}${snap_label}.cpio.gz ${PERSISTENT_PATH}${snap_label}.ext2  ${PERSISTENT_PATH}${snap_label}.ext3 ${PERSISTENT_PATH}${snap_label}.ext4 ${PERSISTENT_PATH}${snap_label}.jffs2")
 +
 +  * With:
 +
 +  snapdata=$(find_files "${PERSISTENT_PATH}/${snap_label}.squashfs  ${PERSISTENT_PATH}/${snap_label}.cpio.gz ${PERSISTENT_PATH}/${snap_label}.ext2  ${PERSISTENT_PATH}/${snap_label}.ext3 ${PERSISTENT_PATH}/${snap_label}.ext4 ${PERSISTENT_PATH}/${snap_label}.jffs2")
 +
 +  * Recreate initrd.img file, and copy it to the usb key:
 +
 +  find .| cpio -o -H newc | gzip -9 > ../initrd.img
 +  cp ../initrd.img /media/usb0/boot/live_amd64
 +
 +  * Repeat the whole procedure for the 32bits case, just use i386 where amd64 is.
 +
 +===== Debian Live (February 2013) =====
 +
 +  mkdir /tmp/live_amd64
 +  cd /tmp/live_amd64
 +  lb config -a amd64 -d sid --mirror-bootstrap http://mirrors.ucr.ac.cr/debian/ --mirror-binary http://mirrors.ucr.ac.cr/debian/ --archive-areas "main contrib non-free"
 +
 +In directory config/package-lists, create file called base.list and add the following to it:
 +
 +  lvm2
 +  testdisk
 +  dmsetup
 +  cryptsetup
 +  cryptmount
 +  gdisk
 +  emacs
 +  mc
 +  joe
 +  gddrescue
 +  magicrescue
 +  wipe
 +  ntfs-3g
 +  partimage
 +  sshfs
 +  firmware-linux-nonfree
 +  firmware-linux
  
  
multiboot_usb_key.1283451573.txt.gz · Last modified: 2021/02/01 05:55 (external edit)