From 533477718ce901a426158a41691b16f5f6db9e76 Mon Sep 17 00:00:00 2001 From: John Bowler Date: Tue, 31 Jan 2006 09:29:38 +0000 Subject: slugos-init: make /linuxrc use disk uuids, remove .recovery stuff in 0.10 - the /boot/disk bootstrap now mounts -U uuid if one is available from turnup. turnup checks disk for blkids and no longer complains about .recovery, /boo/* no longer create .recovery or check for it on boot; disconnect the disk or the network to boot to flash on a semi broken system. --- packages/slugos-init/files/turnup | 59 +++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 15 deletions(-) (limited to 'packages/slugos-init/files/turnup') diff --git a/packages/slugos-init/files/turnup b/packages/slugos-init/files/turnup index 19c5af1745..d27648680f 100644 --- a/packages/slugos-init/files/turnup +++ b/packages/slugos-init/files/turnup @@ -88,6 +88,7 @@ get_flash() { # # check_rootfs [-i] # Make sure the candidate rootfs is empty +# Environment: rootdev=device or NFS root path check_rootfs() { local fcount @@ -100,15 +101,24 @@ check_rootfs() { fcount="$(find "$1" ! -type d -print | wc -l)" test "$fcount" -eq 0 && return 0 - echo "turnup: $1: partition contains existing files, specify -f to overwrite" >&2 + echo "turnup: $rootdev: partition contains existing files, specify -f to overwrite" >&2 return 1;; *) checkmount "$1" && return 0 - echo "turnup: $1: partition does not seem to be a valid root partition" >&2 - if test -f "$1"/.recovery - then - echo " $1/.recovery exists: fix the partition then remove it" >&2 - fi + echo "turnup: $rootdev: partition does not seem to be a valid root partition" >&2 + echo " The partition must contain a full operating system. To ensure that" >&2 + echo " this is the case it is checked for the following, all of which must" >&2 + echo " exist for the bootstrap to work:" >&2 + echo + echo " 1) A directory /mnt." >&2 + echo " 2) A command line interpreter program in /bin/sh." >&2 + echo " 3) The program chroot in /sbin or /usr/sbin." >&2 + echo " 4) The program init in /sbin, /etc or /bin." >&2 + echo + echo " One or more of these items is missing. Mount $rootdev on /mnt" >&2 + echo " and examine its contents. You can use turnup disk|nfs -i -f" >&2 + echo " to copy this operating system onto the disk, but it may overwrite" >&2 + echo " files on the disk." >&2 return 1;; esac } @@ -315,16 +325,17 @@ setup_fstab() { } # -# boot_rootfs [options] +# boot_rootfs ( |) [options] # Change the flash partition (not the current root!) to boot off # the new root file system boot_rootfs() { - local type ffs sleep device opt + local type ffs sleep device uuid opt type="$1" ffs="$2" sleep="$3" device="$4" + uuid= # test this first as the test does not depend on the correctness # of the other arguments @@ -344,7 +355,8 @@ boot_rootfs() { echo "turnup: boot_rootfs($ffs, $type, $device): expected block device" >&2 return 1 } - shift 2;; + uuid="$3" + shift 3;; nfs) shift 2;; flash) ;; ram) ;; @@ -384,6 +396,7 @@ boot_rootfs() { *) { echo '#!/bin/sh' echo 'leds beep' test "$sleep" -gt 0 && echo -n "sleep='$sleep' " + test -n "$uuid" && echo -n "UUID='$uuid' " echo -n "exec '/boot/$type' '$device'" for opt in "$@" do @@ -416,7 +429,7 @@ boot_rootfs() { # disk [-m] [-i] [-s