From: Kern Sibbald Date: Sat, 3 Jan 2009 09:50:51 +0000 (+0000) Subject: Update USB rescue code X-Git-Tag: Release-5.0.3~841 X-Git-Url: https://git.sur5r.net/?p=bacula%2Frescue;a=commitdiff_plain;h=aba674689415a70c095fc7a179cc708ab5031161 Update USB rescue code --- diff --git a/rescue/linux/usb/README.usb b/rescue/linux/usb/README.usb index ac1e3aa..06b3142 100644 --- a/rescue/linux/usb/README.usb +++ b/rescue/linux/usb/README.usb @@ -7,6 +7,8 @@ with persistent OS files and persistent /home files. +Packages needed: +apt-get install syslinux mbr Kubuntu boot tricks: diff --git a/rescue/linux/usb/packsqfs b/rescue/linux/usb/packsqfs new file mode 100755 index 0000000..f0f71f8 --- /dev/null +++ b/rescue/linux/usb/packsqfs @@ -0,0 +1,3 @@ +#!/bin/sh +# +mksquashfs sqfs filesystem.squashfs diff --git a/rescue/linux/usb/partitionusbkey b/rescue/linux/usb/partitionusbkey index 67cdb51..7b91abf 100755 --- a/rescue/linux/usb/partitionusbkey +++ b/rescue/linux/usb/partitionusbkey @@ -22,6 +22,8 @@ else dev=$USB_DEVICE fi echo "This script will distroy everything on $dev" +fdisk -l $dev +echo " " echo "Answer yes to continue " read a if [ "$a" != "yes" ] ; then @@ -67,4 +69,6 @@ umount ${dev}2 mkfs.ext2 -j -b 4096 -L casper-rw ${dev}2 umount ${dev}3 mkfs.ext2 -j -b 4096 -L home-rw ${dev}3 +syslinux -sf ${dev}1 +install-mbr -p1 ${dev} sync diff --git a/rescue/linux/usb/prebuilt/syslinux.cfg b/rescue/linux/usb/prebuilt/syslinux.cfg index c6a9dea..4462368 100644 --- a/rescue/linux/usb/prebuilt/syslinux.cfg +++ b/rescue/linux/usb/prebuilt/syslinux.cfg @@ -1,22 +1,14 @@ DEFAULT persistent GFXBOOT bootlogo -APPEND file=/preseed/kubuntu.seed boot=casper initrd=/casper/initrd.gz -- +APPEND file=/preseed/kubuntu.seed noprompt boot=casper initrd=/casper/initrd.gz -- LABEL persistent menu label ^Start Kubuntu saving changes to USB kernel /casper/vmlinuz - append file=/preseed/kubuntu.seed boot=casper persistent initrd=/casper/initrd.gz -- -LABEL live - menu label ^Run Kubuntu without saving changes - kernel /casper/vmlinuz - append file=/preseed/kubuntu.seed boot=casper initrd=/casper/initrd.gz -- -LABEL live-install - menu label ^Install Kubuntu - kernel /casper/vmlinuz - append file=/preseed/kubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.gz -- -LABEL rescue - menu label ^Rescue a broken system + append file=/preseed/kubuntu.seed noprompt boot=casper persistent initrd=/casper/initrd.gz -- +LABEL shell + menu label ^Boot into a shell kernel /casper/vmlinuz - append file=/preseed/cli.seed boot=casper persistent rescue/enable=true initrd=/casper/initrd.gz -- + append boot=casper textonly persistent noprompt rescue/enable=true initrd=/casper/initrd.gz -- LABEL memtest menu label Test ^memory kernel mt86plus @@ -25,6 +17,14 @@ LABEL hd menu label ^Boot from first hard disk localboot 0x80 append - +LABEL live + menu label ^Run Kubuntu without saving changes + kernel /casper/vmlinuz + append file=/preseed/kubuntu.seed noprompt boot=casper initrd=/casper/initrd.gz -- +LABEL live-install + menu label ^Install Kubuntu + kernel /casper/vmlinuz + append file=/preseed/kubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.gz -- DISPLAY isolinux.txt TIMEOUT 300 PROMPT 1 diff --git a/rescue/linux/usb/removepackages b/rescue/linux/usb/removepackages deleted file mode 100644 index 8489968..0000000 --- a/rescue/linux/usb/removepackages +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# -# Update squashfs -# - -chroot sqfs /bin/sh -mount -t proc none /proc/ -mount -t sysfs non /sys/ -export HOME=/root -apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep language-pack | egrep -v '\-en'` -apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep openoffice\.org-` - -cat >/etc/apt/sources.list <filesystem.manifest - -apt-get clean -rm -rf /tmp/* -rm -f /etc/hosts /etc/resolv.conf -umount /proc/ -umount /sys/ -exit -cp sqfs/filesystem.manifest . -rm -f sqfs/filsystem.manifest diff --git a/rescue/linux/usb/updatepackages b/rescue/linux/usb/updatepackages new file mode 100644 index 0000000..8489968 --- /dev/null +++ b/rescue/linux/usb/updatepackages @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Update squashfs +# + +chroot sqfs /bin/sh +mount -t proc none /proc/ +mount -t sysfs non /sys/ +export HOME=/root +apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep language-pack | egrep -v '\-en'` +apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep openoffice\.org-` + +cat >/etc/apt/sources.list <filesystem.manifest + +apt-get clean +rm -rf /tmp/* +rm -f /etc/hosts /etc/resolv.conf +umount /proc/ +umount /sys/ +exit +cp sqfs/filesystem.manifest . +rm -f sqfs/filsystem.manifest