LINUX.ORG.RU
решено ФорумAdmin

mkisofs - добавление с исходным каталогом

 , , mkisofs


0

1

день добрый, господа колдуны! :о)

создаю «отладочный iso» с пом-ю команды:

mkisofs -lJR -o dbg.iso dir1 dir2 dir3
из-за разношерстого содержания «рабочего каталога» неудобно создавать образ всего каталога, поэтому добавляю только нужные каталоги/подкаталоги/внутренние/внешние, но они добавляются в iso без «исходного каталога» и сваливается все содержимое каталогов в корень iso

как добавлять в образ-iso c исходным каталогом? как то:

dir1/*
dir2/*
dir3/*

с набегу не cмог разобраться.
всем спасибо, кланяюсь, можно идеи, ссылки, помидоры :о)

p.s.
пока для отладки можно добавлять «корень», но это очень долго/неудобно,
да и хотелось-бы на будущее разобраться.

★★★★

Читаю man с выражением, недорого:

NAME
       mkisofs - create an hybrid ISO-9660/JOLIET/HFS/UDF filesystem-image with optional Rock Ridge attributes.

SYNOPSIS
       mkisofs [ options ] [ -o filename ] pathspec [pathspec ...]
       mkisofs [ options ] [ -o filename ] -find [find expression]

<пропущено>

   Dealing with path names
       pathspec is the path of the directory tree to be copied into the ISO-9660 filesystem.  Multiple paths can be specified, and mkisofs will merge the files found in all
       of the specified path components to form the cdrom image.
       
       If the option -graft-points has been specified, it is possible to graft the paths at points other than the root directory, and it is possible to graft files  or  di‐
       rectories  onto  the cdrom image with names different than what they have in the source filesystem.  This is easiest to illustrate with a couple of examples.   Let’s
       start by assuming that a local file ../old.lis exists, and you wish to include it in the cdrom image.
       
            foo/bar/=../old.lis

       will include the file old.lis in the cdrom image at /foo/bar/old.lis, while
       
            foo/bar/xxx=../old.lis

TL;DR:

mkisofs -lJR -graft-points -o dbg.iso dir1/=dir1 dir2/=dir2 dir3/=dir3

Pinkbyte ★★★★★
()
Последнее исправление: Pinkbyte (всего исправлений: 2)

аналогично для tar:

#!/bin/sh
set -e; clear

ARC_TAR=${RAM:-/dev/shm/$USER/ram}/arc.tar
ARC_TXZ=arc.txz

mkdir -p $(dirname $ARC_TAR)
rm -fr $ARC_TAR $ARC_TXZ

tar --append -f $ARC_TAR --transform="s%dir1%dir1.new%" -C dir dir1
# blah-blah-blah
cat    $ARC_TAR | xz -f > $ARC_TXZ
rm -fr $ARC_TAR

sunjob ★★★★
() автор топика
Для того чтобы оставить комментарий войдите или зарегистрируйтесь.