95 |
chroot $rootfs /usr/sbin/update-rc.d -f hwclockfirst.sh remove |
chroot $rootfs /usr/sbin/update-rc.d -f hwclockfirst.sh remove |
96 |
} |
} |
97 |
|
|
98 |
|
arch=$(arch) |
99 |
|
|
100 |
download_debian() |
download_debian() |
101 |
{ |
{ |
102 |
packages=\ |
packages=\ |
111 |
openssh-server |
openssh-server |
112 |
|
|
113 |
cache=$1 |
cache=$1 |
|
arch=$2 |
|
114 |
|
|
115 |
# check the mini debian was not already downloaded |
# check the mini debian was not already downloaded |
116 |
mkdir -p "$cache/partial-$arch" |
mkdir -p "$cache/partial-$arch" |
138 |
copy_debian() |
copy_debian() |
139 |
{ |
{ |
140 |
cache=$1 |
cache=$1 |
|
arch=$2 |
|
141 |
rootfs=$3 |
rootfs=$3 |
142 |
|
|
143 |
# make a local copy of the minidebian |
# make a local copy of the minidebian |
158 |
return 1 |
return 1 |
159 |
fi |
fi |
160 |
|
|
|
arch=$(arch) |
|
161 |
if [ "$arch" == "x86_64" ]; then |
if [ "$arch" == "x86_64" ]; then |
162 |
arch=amd64 |
arch=amd64 |
163 |
fi |
fi |
250 |
usage() |
usage() |
251 |
{ |
{ |
252 |
cat <<EOF |
cat <<EOF |
253 |
$1 -h|--help -p|--path=<path> --clean |
$1 -h|--help -p|--path=<path> -a|--arch=stable --clean |
254 |
EOF |
EOF |
255 |
return 0 |
return 0 |
256 |
} |
} |
257 |
|
|
258 |
options=$(getopt -o hp:n:c -l help,path:,name:,clean -- "$@") |
options=$(getopt -o hp:n:ca: -l help,path:,name:,clean,arch: -- "$@") |
259 |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
260 |
usage $(basename $0) |
usage $(basename $0) |
261 |
exit 1 |
exit 1 |
267 |
case "$1" in |
case "$1" in |
268 |
-h|--help) usage $0 && exit 0;; |
-h|--help) usage $0 && exit 0;; |
269 |
-p|--path) path=$2; shift 2;; |
-p|--path) path=$2; shift 2;; |
270 |
-n|--name) name=$2; shift 2;; |
-n|--name) name=$2; shift 2;; |
271 |
-c|--clean) clean=$2; shift 2;; |
-c|--clean) clean=$2; shift 2;; |
272 |
|
-a|--arch) arch=$2; shift 2;; |
273 |
--) shift 1; break ;; |
--) shift 1; break ;; |
274 |
*) break ;; |
*) break ;; |
275 |
esac |
esac |