diff options
Diffstat (limited to 'packages')
105 files changed, 932 insertions, 13416 deletions
diff --git a/packages/altboot/altboot.bb b/packages/altboot/altboot.bb index 568f52835b..80e22d1924 100644 --- a/packages/altboot/altboot.bb +++ b/packages/altboot/altboot.bb @@ -6,7 +6,7 @@ MAINTAINER = "Matthias 'CoreDump' Hentges <oe@hentges.net>" LICENSE = "GPL" -PR = "r4" +PR = "r5" SRC_URI = "file://altboot-menu \ diff --git a/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs b/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs new file mode 100644 index 0000000000..1949f20b48 --- /dev/null +++ b/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs @@ -0,0 +1,324 @@ +# !/bin/sh +M_TITLE="Copy rootfs to SD/CF" + + +die() { + echo "ERROR: $1" >/dev/tty0 + exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1 +} + +ask_target() { + available_disks="`mount | grep "/media" | grep -v ram | awk '{print $3}'`" + + if test -z "$available_disks" + then + die "No mounted targets found!" + fi + + cnt=1 + for d in $available_disks + do + echo -e "\t[$cnt] $d" + let cnt=$cnt+1 + done + + while test -z "$ROOTFS_TARGET" + do + echo -n "Target: " + read junk </dev/tty1 + + x=1 + for d in $available_disks + do + if test "$junk" = "$x" + then + ROOTFS_TARGET="$d" + break + fi + let x=$x+1 + done + + + done + + ROOTFS_TARGET_DEV="`mount | grep "$ROOTFS_TARGET " | awk '{print $1}'`" + ROOTFS_TARGET_FS="`mount | grep "$ROOTFS_TARGET " | awk '{print $5}'`" + + echo "Using [$ROOTFS_TARGET] on [$ROOTFS_TARGET_DEV] with [$ROOTFS_TARGET_FS] filesystem" +} + +ask_format() { + if test "$ROOTFS_TARGET_FS" != ext2 + then + echo -e "\nYou are not using the ext2 filesystem on your target.\nYou now have two choices:" + echo -e "\t[1] Reformat to ext2" + echo -e "\t[2] Use an image-file ontop of the existing filesystem" + + while true + do + echo -n "Your choice: " + read junk </dev/tty1 + + case "$junk" in + 1) ROOTFS_TARGET_TYPE="ext2" + break ;; + 2) ROOTFS_TARGET_TYPE="image" + break ;; + esac + done + + echo "Mode: [$ROOTFS_TARGET_TYPE]" + else + echo -e "\nYou are using the ext2 filesystem on your target.\nYou now have two choices:" + echo -e "\t[1] Install to the target directly" + echo -e "\t[2] Use an image-file ontop of the existing filesystem\n" + + while true + do + echo -n "Your choice: " + read junk </dev/tty1 + + case "$junk" in + 1) ROOTFS_TARGET_TYPE="direct" + break ;; + 2) ROOTFS_TARGET_TYPE="image" + break ;; + esac + done + + echo "Mode: [$ROOTFS_TARGET_TYPE]" + + fi +} + +ask_confirm() { + echo -e "\nYour choices are:" + echo -e "\tTarget:\t$ROOTFS_TARGET_DEV (currently mounted as $ROOTFS_TARGET)" + case "$ROOTFS_TARGET_TYPE" in + direct) echo -e "\tType:\t${C_RED}direct install, reformat if required${C_RESET}";; + image) echo -e "\tType:\tinstall into image-file";; + esac + + while true + do + echo -n "Continue? [y|n] " + read junk </dev/tty1 + + case "$junk" in + y) break ;; + n) exit 1 + esac + done +} + +direct_install() { + + format_target + + echo -n "Creating temporary directory..." + mkdir -p /media/temp && echo ok || die "mkdir -p /media/temp failed!" + + echo -n "Mounting [$ROOTFS_TARGET_DEV] as /media/temp..." + mount "$ROOTFS_TARGET_DEV" /media/temp && echo "ok" || die "mount "$ROOTFS_TARGET_DEV" /media/temp FAILED" + + copy_files +} + +format_target() { + echo -e "\n\nI'm about to format your target ($ROOTFS_TARGET_DEV) to the ext2 filesystem\n" + echo -e "${C_RED}YOU WILL LOSE ALL DATA ON YOUR TARGET IF YOU CONTINUE${C_RESET}\n" + + while true + do + echo -n "Continue? [y|n] " + read junk </dev/tty1 + + case "$junk" in + y) break ;; + n) die "User aborted mkfs" + break ;; + esac + done + + echo -n "Umounting $ROOTFS_TARGET_DEV..." + umount "$ROOTFS_TARGET_DEV" && echo "ok" || die "umount $ROOTFS_TARGET_DEV failed!" + + + echo "Formatting..." + /sbin/mkfs.ext2 -m0 "$ROOTFS_TARGET_DEV" && echo -e "\nmkfs.ext2 finished" || die "\nmkfs.ext2 FAILED" + } + +image_install( |
