Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 208499 | Differences between
and this patch

Collapse All | Expand All

(-)liveusb.sh.orig (-9 / +27 lines)
Lines 171-189 Link Here
171
if [ ${isomode} -eq 1 ]; then
171
if [ ${isomode} -eq 1 ]; then
172
	umount ${cdmnt} || die "Failed unmounting ${cdmnt}"
172
	umount ${cdmnt} || die "Failed unmounting ${cdmnt}"
173
fi
173
fi
174
mv ${utmp}/isolinux/* ${utmp} || die "Failed moving contents"
174
175
mv ${utmp}/isolinux.cfg ${utmp}/syslinux.cfg
175
bootloader=""
176
rm -rf ${utmp}/isolinux*
176
177
mv ${utmp}/memtest86 ${utmp}/memtest \
177
if [ -d "${utmp}/isolinux" ]; then
178
  bootloader="isolinux"
179
  mv ${utmp}/isolinux/* ${utmp} || die "Failed moving contents"
180
  mv ${utmp}/isolinux.cfg ${utmp}/syslinux.cfg
181
  rm -rf ${utmp}/isolinux*
182
  mv ${utmp}/memtest86 ${utmp}/memtest \
178
	|| die "Failed moving ${utmp}/memtest86 to ${utmp}/memtest"
183
	|| die "Failed moving ${utmp}/memtest86 to ${utmp}/memtest"
179
184
185
  sed -i \
186
      -e "s:cdroot:cdroot slowusb:" \
187
      -e "s:kernel memtest86:kernel memtest:" \
188
      ${utmp}/syslinux.cfg || die "Failed using sed"
189
fi
180
190
181
sed -i \
191
if [ -d "${utmp}/boot/grub" ]; then
182
    -e "s:cdroot:cdroot slowusb:" \
192
  bootloader="grub"
183
    -e "s:kernel memtest86:kernel memtest:" \
193
  device=$(echo ${USBDEV} | sed -e 's:p\?[0-9]\+$::')
184
    ${utmp}/syslinux.cfg || die "Failed using sed"
194
  partition=$(echo ${USBDEV} | sed -e 's:^.*p\?\([0-9]\+\)$:\1:')
195
  grub_partition=$((${partition} - 1))
196
  echo "(hd0) ${device}" > ${utmp}/boot/grub/device.map
197
  cp /lib/grub/*/* ${utmp}/boot/grub/
198
  echo -e "root (hd0,${grub_partition})\nsetup (hd0)\nquit" | grub --batch --device-map=${utmp}/boot/grub/device.map || die "Couldn't install the grub bootloader"
199
fi
185
200
186
umount ${utmp} || die "Failed unmounting ${utmp}"
201
umount ${utmp} || die "Failed unmounting ${utmp}"
187
syslinux ${USBDEV} || die "Couldn't install the syslinux bootloader"
202
203
if [ "${bootloader}" = "isolinux" ]; then
204
  syslinux ${USBDEV} || die "Couldn't install the syslinux bootloader"
205
fi
188
206
189
echo "Gentoo LiveUSB created"
207
echo "Gentoo LiveUSB created"

Return to bug 208499