diff options
author | Oyvind Repvik <nail@nslu2-linux.org> | 2006-01-21 17:07:17 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-01-21 17:07:17 +0000 |
commit | ec31c75e94546c0ede50107715ade3920516834f (patch) | |
tree | 827b9c487b6185c606dec70d7ca8d142f7e4f5c7 /packages/slugos-init/files/turnup | |
parent | 4da76a6a2f64d3deb7ac20326ff01384be8c9e4f (diff) |
slugos-init: Use tune2fs to mark the root fs with a "unique" label
turnup marks the rootfs with a label, and /boot/disk mounts the correct
partition on boot.
Closes slugbug #320
Diffstat (limited to 'packages/slugos-init/files/turnup')
-rw-r--r-- | packages/slugos-init/files/turnup | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/packages/slugos-init/files/turnup b/packages/slugos-init/files/turnup index 0029697c50..3bb1a55b9c 100644 --- a/packages/slugos-init/files/turnup +++ b/packages/slugos-init/files/turnup @@ -309,7 +309,7 @@ setup_fstab() { # -# boot_rootfs <boot type> <flash file system> <sleep time> <device> [options] +# boot_rootfs <boot type> <flash file system> <sleep time> <label> <device> [options] # Change the flash partition (not the current root!) to boot off # the new root file system boot_rootfs() { @@ -318,8 +318,9 @@ boot_rootfs() { type="$1" ffs="$2" sleep="$3" - device="$4" - + label="$4" + device="$5" + # test this first as the test does not depend on the correctness # of the other arguments test -n "$ffs" -a -d "$ffs" || { @@ -376,7 +377,7 @@ boot_rootfs() { };; *) { echo '#!/bin/sh' test "$sleep" -gt 0 && echo -n "sleep='$sleep' " - echo -n "exec '/boot/$type' '$device'" + echo -n "exec '/boot/$type' '$label'" for opt in "$@" do echo -n " '$opt'" @@ -492,8 +493,10 @@ disk() { # if everything went ok boot from this disk if test $status -eq 0 then + TEMP_LABEL=`date +%y%m%d%H%M` + tune2fs -L $TEMP_LABEL $device # memsticks boot like disks, so ignore the -m - boot_rootfs disk "$ffs" "$sleep" "$device" -t "$fst" -o "$fso" + boot_rootfs disk "$ffs" "$sleep" "$TEMP_LABEL" "$device" -t "$fst" -o "$fso" fi else echo "turnup disk: $device($*): unable to mount device on $new" >&2 |