diff --git a/elkscmd/file_utils/cp.c b/elkscmd/file_utils/cp.c index 78f687da1..2232c7747 100644 --- a/elkscmd/file_utils/cp.c +++ b/elkscmd/file_utils/cp.c @@ -428,6 +428,8 @@ int do_symlink(char *symlnk, char *file) { if (opt_verbose) printf("Symlink %s -> %s\n", file, symlnk); + if (opt_force) + unlink(file); if (symlink(symlnk, file) < 0) { fprintf(stderr, "Can't create symlink "); fflush(stderr); perror(symlnk); diff --git a/elkscmd/file_utils/mknod.c b/elkscmd/file_utils/mknod.c index bb627ca11..7be28ce1f 100644 --- a/elkscmd/file_utils/mknod.c +++ b/elkscmd/file_utils/mknod.c @@ -17,9 +17,9 @@ int main(int argc, char **argv) /* preserve option */ struct stat sb; if (stat(argv[2], &sb) == 0) { - if (S_ISCHR(sb.st_mode) && argv[3] && (argv[3][0] == 'c' || argv[3][0] == 'u')) return 1; - if (S_ISBLK(sb.st_mode) && argv[3] && argv[3][0] == 'b') return 1; - if (S_ISFIFO(sb.st_mode) && argv[3] && argv[3][0] == 'p') return 1; + if (S_ISCHR(sb.st_mode) && argv[3] && (argv[3][0] == 'c' || argv[3][0] == 'u')) return 0; + if (S_ISBLK(sb.st_mode) && argv[3] && argv[3][0] == 'b') return 0; + if (S_ISFIFO(sb.st_mode) && argv[3] && argv[3][0] == 'p') return 0; } /* valid node not there yet, so we advance and create it */ argc--; diff --git a/elkscmd/rootfs_template/bin/sys b/elkscmd/rootfs_template/bin/sys index 60ebc169d..e7991c8a9 100755 --- a/elkscmd/rootfs_template/bin/sys +++ b/elkscmd/rootfs_template/bin/sys @@ -1,4 +1,6 @@ -# sys - create bootable system +# sys - create or update system from booted volume +# Creates and/or updates /dev, /etc, /bin and /linux on drive passed as argument +set -e usage() { @@ -116,7 +118,7 @@ copy_etc_files() } # sys script starts here -echo "Installing/Updating ELKS" +echo "Installing/updating ELKS on $1" MNT=/tmp/mnt small=0 arg=-s @@ -126,8 +128,10 @@ if test "$1" = "-3"; then shift; small=1; fi if test "$#" -lt 1; then usage; fi # returns fstype, 1=MINIX, 2=FAT +set +e makeboot $arg $1 FSTYPE=$? +set -e if test "$FSTYPE" = "255"; then exit 1; fi; mkdir -p $MNT @@ -143,4 +147,4 @@ sync umount $1 rmdir $MNT sync -echo "Finished." +echo "Finished successfully."