Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
create-iso
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
le6
create-iso
Commits
871ee349
Commit
871ee349
authored
Oct 04, 2018
by
sulzbach
Browse files
Options
Browse Files
Download
Plain Diff
Temporary commit
parents
41fb56cb
afaac8fb
Pipeline
#17838
passed with stage
in 13 seconds
Changes
30
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
355 additions
and
216 deletions
+355
-216
conf/debug.conf
conf/debug.conf
+1
-0
conf/general.conf
conf/general.conf
+1
-1
conf/opts.conf
conf/opts.conf
+1
-0
create-iso.sh
create-iso.sh
+58
-43
cronjob.sh
cronjob.sh
+18
-0
include/chroot.sh
include/chroot.sh
+11
-20
include/logging.sh
include/logging.sh
+16
-15
include/mount.sh
include/mount.sh
+3
-2
mail.txt
mail.txt
+3
-0
pkg-list/lc6/repo.list
pkg-list/lc6/repo.list
+1
-0
scripts-available/compress.sh
scripts-available/compress.sh
+12
-21
scripts-available/create-local-repository.sh
scripts-available/create-local-repository.sh
+10
-12
scripts-available/install-dependencies.sh
scripts-available/install-dependencies.sh
+7
-12
scripts-available/install.sh
scripts-available/install.sh
+7
-11
scripts-available/local-repo.sh
scripts-available/local-repo.sh
+78
-0
scripts-available/make-initrd.sh
scripts-available/make-initrd.sh
+7
-13
scripts-available/manifest.sh
scripts-available/manifest.sh
+7
-9
scripts-available/pre-local-repo.sh
scripts-available/pre-local-repo.sh
+48
-0
scripts-available/pre-manifest.sh
scripts-available/pre-manifest.sh
+7
-9
scripts-available/remove.sh
scripts-available/remove.sh
+7
-11
scripts-available/setup.sh
scripts-available/setup.sh
+28
-13
scripts-available/update-sourceslist.sh
scripts-available/update-sourceslist.sh
+8
-12
scripts-enabled/lc6/34-chroot.pre-local-repo.sh
scripts-enabled/lc6/34-chroot.pre-local-repo.sh
+1
-0
scripts-enabled/lc6/35-chroot.local-repo.sh
scripts-enabled/lc6/35-chroot.local-repo.sh
+1
-0
scripts-enabled/lc6/35-create-local-repository.sh
scripts-enabled/lc6/35-create-local-repository.sh
+0
-1
scripts-enabled/le6/34-chroot.pre-local-repo.sh
scripts-enabled/le6/34-chroot.pre-local-repo.sh
+1
-0
scripts-enabled/le6/35-chroot.local-repo.sh
scripts-enabled/le6/35-chroot.local-repo.sh
+1
-0
scripts-enabled/le6/35-create-local-repository.sh
scripts-enabled/le6/35-create-local-repository.sh
+0
-1
src/lc6/preseed.cfg
src/lc6/preseed.cfg
+9
-7
src/le6/preseed.cfg
src/le6/preseed.cfg
+3
-3
No files found.
conf/debug.conf
0 → 100644
View file @
871ee349
PASSWD
=
"123mudar"
\ No newline at end of file
conf/general.conf
View file @
871ee349
...
...
@@ -7,4 +7,4 @@ ISODIR="${PREFIX}/iso"
CACHEDIR
=
"${PREFIX}/cache/${_PROF}/${_REPO}"
PKGLIST
=
"${PREFIX}/pkg-list/${_PROF}"
SOURCESLIST
=
"${PREFIX}/sources-list"
LOG_PATH
=
"/var/log"
LOG_PATH
=
"/var/log
/create-iso
"
conf/opts.conf
View file @
871ee349
...
...
@@ -5,3 +5,4 @@ _OUTPUT=""
_
REPO
=
"stable"
_
VERSION
=
""
_
DEBUG
=
false
_
MAIL
=
false
create-iso.sh
View file @
871ee349
...
...
@@ -33,6 +33,7 @@ while true; do
-o
|
--output
)
_OUTPUT
=
"
$2
"
;
shift
;
shift
;;
-r
|
--repo
)
_REPO
=
"
$2
"
;
shift
;
shift
;;
-d
|
--debug
)
_DEBUG
=
true
;
shift
;;
-s
|
--sendmail
)
_MAIL
=
true
;
shift
;;
-
*
)
echo
"Unrecognized option. Try with --help."
;
\
exit
1
;;
*
)
break
;;
...
...
@@ -57,8 +58,7 @@ if [[ "${_HELP}" = true ]]; then
echo
"output the created ISO image"
echo
-n
" -r, --repo [stable | testing | unstable] Select remote "
echo
"repository codename to download packages from"
echo
" -d, --debug Cache from last"
echo
"execution"
echo
" -d, --debug Execute in debug mode"
exit
0
fi
...
...
@@ -69,32 +69,33 @@ if [[ "$(id -u)" != "0" ]]; then
fi
if
[[
-z
"
${
_PROF
}
"
]]
;
then
echo
"No profile specified. Try with --help
or --list-profiles
."
echo
"No profile specified. Try with --help."
exit
1
fi
if
!
source
"
${
PREFIX
}
/conf/
${
_PROF
}
.conf"
;
then
echo
"Unavailable profile. Try with --help
or --list-profiles
."
echo
"Unavailable profile. Try with --help."
exit
1
fi
source
"
${
PREFIX
}
/conf/general.conf"
if
[[
-z
"
${
_VERSION
}
"
]]
;
then
echo
"No version specified.
Ommiting
."
echo
"No version specified.
Proceeding without defining it
."
else
NAME
=
"
${
NAME
}
${
_VERSION
}
"
fi
if
[[
"
${
_REPO
}
"
!=
"stable"
]]
&&
[[
"
${
_REPO
}
"
!=
"testing"
]]
&&
\
[[
"
${
_REPO
}
"
!=
"unstable"
]]
;
then
[[
"
${
_REPO
}
"
!=
"unstable"
]]
;
then
echo
"Unrecognized remote repository codename. Try with --help."
exit
1
fi
TIME_STAMP
=
"
$(
date
+
'%Y-%m-%dT%H:%M:%S'
)
"
export
LOG_FILE
=
"
${
LOG_PATH
}
/create-iso-
${
TIME_STAMP
}
.log"
export
_MAIL
export
TIME_STAMP
=
"
$(
date
+
'%Y-%m-%dT%H:%M:%S'
)
"
mkdir
--parents
"
${
LOG_PATH
}
"
export
LOG_FILE
=
"
${
LOG_PATH
}
/
${
TIME_STAMP
}
.log"
exec
1<&-
exec
2<&-
...
...
@@ -107,11 +108,12 @@ source "${PREFIX}/include/logging.sh"
source
"
${
PREFIX
}
/include/mount.sh"
# Disable debug logging if not in debug mode
[[
"
${
_DEBUG
}
"
==
false
]]
&&
let
VERBOSE_FLAGS
=
"
${
ALL
}
^
${
DEBUG
}
"
[[
"
${
_DEBUG
}
"
==
false
]]
&&
let
VERBOSE_FLAGS
=
"
${
ALL
}
^
${
L
DEBUG
}
"
# Installation of create-iso's dependencies
apt-get
install
isolinux syslinux squashfs-tools genisoimage xorriso
--yes
||
\
createIsoLogger
--message
"Failed to install basic tools"
--tag
"apt-get"
apt-get
install
isolinux syslinux squashfs-tools genisoimage xorriso reprepro
\
binwalk
--yes
||
createIsoLogger
--message
"Failed to install basic tools"
\
--tag
"apt-get"
# The default filename of the generated ISO is a concatenation of lowered-cased
# hyphen-delimited distribution version, repo codename and timestamp
...
...
@@ -165,38 +167,49 @@ conditionalMount overlay "${CHROOTDIR}" overlay \
for
script
in
"
${
SCRIPTSDIR
}
"
/
*
;
do
if
[[
-x
"
${
script
}
"
]]
&&
grep
-E
--quiet
'^[0-9]{2}-[A-Za-z]+'
\
<<<
"
$(
basename
"
${
script
}
"
)
"
;
then
createIsoLogger
--message
"Running
$(
basename
"
${
script
}
"
)
..."
--type
\
info
if
!
"
${
script
}
"
\
"
${
_PROF
}
"
\
"
${
NAME
}
"
\
"
${
WEBSITE
}
"
\
"
${
TMPFS
}
"
\
"
${
TMP
}
"
\
"
${
CHROOTDIR
}
"
\
"
${
SCRIPTSDIR
}
"
\
"
${
PKGLIST
}
"
\
"
${
SOURCESLIST
}
"
\
"
${
_REPO
}
"
\
"
${
KEYURL
}
"
\
"
${
CACHEDIR
}
"
;
then
cleanup
"
${
CHROOTDIR
}
"
createIsoLogger
--message
"Failed to run script"
exit
1
fi
# createIsoLogger -m "Breakpoint" -t d
# If the script is marked as 'chroot', it means it performs changes in
# the overlaid chroot filesystem,
# therefore, the 'chroot script', filled with the required commands by
# the marked script, is executed
# This warning is disabled because the literal '-' is actually needed:
# This warning is disabled because the literal '-' is needed:
# shellcheck disable=SC1001
if
[[
"
$(
basename
"
${
script
}
"
)
"
=
~
[
0-9]+
\-
chroot
\.
*
]]
;
then
if
!
"
${
script
}
"
\
"
${
_PROF
}
"
\
"
${
CHROOTDIR
}
"
\
"
${
PKGLIST
}
"
\
"
${
SOURCESLIST
}
"
\
"
${
_REPO
}
"
\
"
${
KEYURL
}
"
\
"
${
TMP
}
"
;
then
cleanup
"
${
CHROOTDIR
}
"
createIsoLogger
--message
"Failed to run "
\
"
$(
basename
"
${
script
}
"
)
"
fi
# If the script is marked as 'chroot', it means it performs
# changes in the overlaid chroot filesystem, therefore, the
# 'chroot script', filled with the required commands by the marked
# script, is executed
initChroot
"
${
CHROOTDIR
}
"
execChroot
"
${
CHROOTDIR
}
"
# [[ "$(basename "${script}")" =~ [0-9]+\-chroot\.update-sourceslist\.sh ]] && createIsoLogger -m "Breakpoint" -t d
closeChroot
"
${
CHROOTDIR
}
"
else
if
!
"
${
script
}
"
\
"
${
_PROF
}
"
\
"
${
NAME
}
"
\
"
${
WEBSITE
}
"
\
"
${
TMP
}
"
\
"
${
CHROOTDIR
}
"
\
"
${
PKGLIST
}
"
\
"
${
_REPO
}
"
\
"
${
CACHEDIR
}
"
\
"
${
_DEBUG
}
"
;
then
cleanup
"
${
CHROOTDIR
}
"
createIsoLogger
--message
"Failed to run "
\
"
$(
basename
"
${
script
}
"
)
"
fi
fi
# createIsoLogger -m "Breakpoint" -t d
fi
done
...
...
@@ -214,18 +227,20 @@ popd || createIsoLogger --message "Unable to change directory" --tag "popd"
cleanup
"
${
CHROOTDIR
}
"
conditionalUmount
"
${
CHROOTDIR
}
"
rm
--recursive
--force
"
${
CHROOTDIR
}
"
conditionalUmount
"
${
PREFIX
:?
}
/squashfsbase"
rm
--recursive
--force
"
${
PREFIX
:?
}
/squashfsbase"
conditionalUmount
"
${
TMP
:?
}
/image"
if
[[
"
${
_DEBUG
}
"
==
true
]]
;
then
mkdir
--parents
"
${
CACHEDIR
}
/
${
TIME_STAMP
}
"
mv
"
${
TMP
}
/MD5SUMS"
"
${
CACHEDIR
}
/
${
TIME_STAMP
}
/"
||
createIsoLogger
\
--message
"Unable to move file"
--tag
"mv"
mv
"
${
TMP
}
/upper"
"
${
CACHEDIR
}
/
${
TIME_STAMP
}
/image"
||
createIsoLogger
\
--message
"Unable to move directory"
--tag
"mv"
fi
mkdir
--parents
"
${
CACHEDIR
}
/
${
TIME_STAMP
}
"
mv
"
${
TMP
}
/MD5SUMS"
"
${
CACHEDIR
}
/
${
TIME_STAMP
}
/"
||
createIsoLogger
--message
\
"Unable to move file"
--tag
"mv"
mv
"
${
TMP
}
/upper"
"
${
CACHEDIR
}
/
${
TIME_STAMP
}
/image"
||
createIsoLogger
\
--message
"Unable to move directory"
--tag
"mv"
conditionalUmount
"
${
TMPFS
}
"
rm
--recursive
--force
"
${
TMPFS
}
"
conditionalUmount
"
${
PREFIX
:?
}
/isobase"
rm
--recursive
--force
"
${
PREFIX
:?
}
/isobase"
exit
0
cronjob.sh
0 → 100755
View file @
871ee349
#!/bin/bash
if
[
"
$(
id
-u
)
"
!=
"0"
]
;
then
echo
"You must have more power to run this script. Are you root?"
exit
-1
fi
SESSION
=
"
$(
date
+
'%Y-%m-%d'
)
"
DIR
=
"/home/lucas/create-iso"
CMD
=
"./create-iso.sh --profile le6 --version 6.1.1 --repo testing --debug --sendmail"
# Create GNU screen session
screen
-dmS
"
${
SESSION
}
"
||
exit
1
# Execute c3geniso in the main window
screen
-S
"
${
SESSION
}
"
-X
stuff
"pushd
${
DIR
}
&&
${
CMD
}
&& exit
\n
"
||
exit
2
exit
0
include/chroot.sh
View file @
871ee349
...
...
@@ -36,7 +36,7 @@ initChroot() {
mount
--bind
"
${
LOG_FILE
}
"
"
${
chrootdir
}
/
${
LOG_FILE
}
"
mount
--bind
--options
ro
"/etc/resolv.conf"
"
${
chrootdir
}
/etc/resolv.conf"
mount
--bind
"/etc/resolv.conf"
"
${
chrootdir
}
/etc/resolv.conf"
# Prevent services from being started in the chrooted environment
rm
-rf
"
${
chrootdir
:?
}
/fakebin"
...
...
@@ -69,7 +69,7 @@ function create_stub() {
EOF
cat
"
${
PREFIX
}
/
helper/logging.inc
sh"
>>
"
${
script
}
"
cat
"
${
PREFIX
}
/
include/logging.
sh"
>>
"
${
script
}
"
}
addToChrootFile
()
{
...
...
@@ -96,22 +96,13 @@ execChroot() {
function
cleanup
()
{
local
chrootdir
=
"
$1
"
if
mountpoint
--quiet
"
${
chrootdir
}
/etc/resolv.conf"
;
then
umount
--lazy
"
${
chrootdir
}
/etc/resolv.conf"
fi
if
mountpoint
--quiet
"
${
chrootdir
}
/
${
LOG_FILE
}
"
;
then
umount
--lazy
"
${
chrootdir
}
/
${
LOG_FILE
}
"
fi
if
mountpoint
--quiet
"
${
chrootdir
}
/dev/pts"
;
then
umount
--lazy
"
${
chrootdir
}
/dev/pts"
fi
if
mountpoint
--quiet
"
${
chrootdir
}
/dev"
;
then
umount
--lazy
"
${
chrootdir
}
/dev"
fi
if
mountpoint
--quiet
"
${
chrootdir
}
/sys"
;
then
umount
--lazy
"
${
chrootdir
}
/sys"
fi
if
mountpoint
--quiet
"
${
chrootdir
}
/proc"
;
then
umount
--lazy
"
${
chrootdir
}
/proc"
fi
type
conditionalUmount
>
/dev/null 2>&1
||
\
source
"
${
PREFIX
}
/include/mount.sh"
conditionalUmount
"
${
chrootdir
}
/etc/resolv.conf"
conditionalUmount
"
${
chrootdir
}
/
${
LOG_FILE
}
"
conditionalUmount
"
${
chrootdir
}
/dev/pts"
conditionalUmount
"
${
chrootdir
}
/dev"
conditionalUmount
"
${
chrootdir
}
/sys"
conditionalUmount
"
${
chrootdir
}
/proc"
}
include/logging.sh
View file @
871ee349
...
...
@@ -24,7 +24,7 @@
readonly
ERROR
=
1
readonly
WARNING
=
2
readonly
INFO
=
4
readonly
DEBUG
=
8
readonly
L
DEBUG
=
8
readonly
ALL
=
15
VERBOSE_FLAGS
=
${
ALL
}
...
...
@@ -34,9 +34,9 @@ mapType() {
e
|
error
)
echo
"
${
ERROR
}
"
;;
w
|
warning
)
echo
"
${
WARNING
}
"
;;
i
|
info
)
echo
"
${
INFO
}
"
;;
d
|
debug
)
echo
"
${
DEBUG
}
"
;;
*
)
createIsoLogger
-m
"Invalid type '
$1
'"
\
-T
"LOGGER"
;
return
1
;;
d
|
debug
)
echo
"
${
L
DEBUG
}
"
;;
*
)
createIsoLogger
-m
"Invalid type '
$1
'"
\
-T
"LOGGER"
;
return
1
;;
esac
}
...
...
@@ -55,15 +55,15 @@ createIsoLogger() {
while
true
;
do
case
"
${
1
}
"
in
-t
|
--type
)
TYPE
=
"
$(
mapType
"
$2
"
)
"
||
return
;
shift
;
\
shift
;;
shift
;;
-T
|
--tag
)
TAG
=
"
$2
"
;
shift
;
shift
;;
-m
|
--message
)
MSG
=
"
$2
"
;
shift
;
shift
;;
-s
|
--script
)
SCRIPT
=
"
$2
"
;
shift
;
shift
;;
-l
|
--line
)
LINE
=
"
$2
"
;
shift
;
shift
;;
-l
|
--line
)
LINE
=
"
$2
"
;
shift
;
shift
;;
-
*
)
createIsoLogger
-m
\
"Unrecognized option '
$1
'"
-T
"LOGGER"
;
\
return
;;
*
)
break
;;
"Unrecognized option '
$1
'"
-T
"LOGGER"
;
\
return
;;
*
)
break
;;
esac
done
...
...
@@ -80,8 +80,8 @@ createIsoLogger() {
LOG_LINE
=
"
\0
33[38;5;11m[WARNING]:
${
LOG_LINE
}
\0
33[0m"
;;
"
${
INFO
}
"
)
\
LOG_LINE
=
"
\0
33[38;5;10m[INFO]:
${
LOG_LINE
}
\0
33[0m"
;;
"
${
DEBUG
}
"
)
\
LOG_LINE
=
"
\0
33[38;5;6m[DEBUG]:
${
LOG_LINE
}
\0
33[0m"
;;
"
${
L
DEBUG
}
"
)
\
LOG_LINE
=
"
\0
33[38;5;6m[
L
DEBUG]:
${
LOG_LINE
}
\0
33[0m"
;;
*
)
\
createIsoLogger
-m
"Invalid type '
${
TYPE
}
'"
\
-T
"LOGGER"
;
return
;;
...
...
@@ -89,12 +89,13 @@ createIsoLogger() {
echo
-e
"
${
LOG_LINE
}
"
1>&2
echo
-e
"
${
LOG_LINE
}
"
>>
"
${
LOG_FILE
}
"
if
[[
"
${
TYPE
}
"
==
"
${
ERROR
}
"
]]
||
\
[[
"
${
TYPE
}
"
==
"
${
DEBUG
}
"
]]
;
then
if
[[
"
${
TYPE
}
"
==
"
${
ERROR
}
"
]]
||
[[
"
${
TYPE
}
"
==
"
${
LDEBUG
}
"
]]
;
then
[[
"
${
_MAIL
}
"
==
true
]]
&&
sendmail
-t
<<<
"
$(
sed
\
"s/##SUBJECT##/
${
TIME_STAMP
}
/"
<
"
${
PREFIX
}
/mail.txt"
&&
screen
\
-ls
;
echo
""
;
tail
--lines
=
20
"
${
LOG_FILE
}
"
)
"
/bin/bash
fi
else
createIsoLogger
-m
"Tried to use disabled type '
${
TYPE
}
'"
\
-T
"LOGGER"
createIsoLogger
-m
"Tried to use disabled type '
${
TYPE
}
'"
-T
"LOGGER"
fi
}
include/mount.sh
View file @
871ee349
...
...
@@ -38,8 +38,9 @@ conditionalMount() {
conditionalUmount
()
{
local
mountpoint
=
"
$1
"
(!
mountpoint
--quiet
"
${
mountpoint
}
"
||
umount
"
${
mountpoint
}
"
)
||
\
(!
mountpoint
--quiet
"
${
mountpoint
}
"
||
umount
--lazy
"
${
mountpoint
}
"
)
||
\
createIsoLogger
--message
"Unable to umount
${
mountpoint
}
"
--tag
"umount"
rm
--recursive
--force
"
${
mountpoint
}
"
# Todo: we may need to move this line to some points after this function call
# rm --recursive --force "${mountpoint}"
}
mail.txt
0 → 100644
View file @
871ee349
To: ls17@c3sl.ufpr.br
Subject: ##SUBJECT##
pkg-list/lc6/repo.list
View file @
871ee349
lc-conf
lc-server-all
lc-client-all
scripts-available/compress.sh
View file @
871ee349
...
...
@@ -24,35 +24,26 @@
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
TMP
=
"
$5
"
CHROOTDIR
=
"
$6
"
# SCRIPTSDIR="$7"
# PKGLIST="$8"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
TMP
=
"
$4
"
CHROOTDIR
=
"
$5
"
# PKGLIST="$6"
# REPO="$7"
# CACHEDIR="$8"
# DEBUG="$9"
PREFIX
=
"
${
PWD
}
"
type
createIsoLogger
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/common.sh"
type
conditionalUmount
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/include/mount.sh"
type
createIsoLogger
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/include/logging.sh"
#########################################
# WARNING:
# Sanity check if {dev,proc,sys} are mounted, cp from /proc will be recursive
# until run out RAM.
if
mountpoint
--quiet
"
${
CHROOTDIR
}
/dev/pts"
;
then
umount
"
${
CHROOTDIR
}
/dev/pts"
fi
if
mountpoint
--quiet
"
${
CHROOTDIR
}
/dev"
;
then
umount
"
${
CHROOTDIR
}
/dev"
fi
if
mountpoint
--quiet
"
${
CHROOTDIR
}
/sys"
;
then
umount
"
${
CHROOTDIR
}
/sys"
fi
if
mountpoint
--quiet
"
${
CHROOTDIR
}
/proc"
;
then
umount
"
${
CHROOTDIR
}
/proc"
fi
conditionalUmount
"
${
CHROOTDIR
}
/dev/pts"
conditionalUmount
"
${
CHROOTDIR
}
/dev"
conditionalUmount
"
${
CHROOTDIR
}
/sys"
conditionalUmount
"
${
CHROOTDIR
}
/proc"
mksquashfs
"
${
CHROOTDIR
}
"
"
${
TMP
}
/image/casper/filesystem.squashfs"
-b
1M
\
-no-recovery
-processors
"
$(
nproc
)
"
-noappend
||
createIsoLogger
--message
\
...
...
scripts-available/create-local-repository.sh
View file @
871ee349
...
...
@@ -24,24 +24,21 @@
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
TMP
=
"
$5
"
CHROOTDIR
=
"
$6
"
# SCRIPTSDIR="$7"
PKGLIST
=
"
$8
"
# SOURCESLIST="$9"
REPO
=
"
${
10
}
"
# KEYURL="${11}"
TMP
=
"
$4
"
CHROOTDIR
=
"
$5
"
PKGLIST
=
"
$6
"
REPO
=
"
$7
"
# CACHEDIR="$8"
# DEBUG="$9"
PREFIX
=
"
${
PWD
}
"
type
addToChrootFile
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/common.sh"
type
createIsoLogger
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/helper/logging.incsh"
type
createIsoLogger
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/include/logging.sh"
mount
--bind
--options
ro
"/etc/resolv.conf"
"
${
CHROOTDIR
}
/etc/resolv.conf"
fingerprint
=
"
$(
gpg
--list-keys
--with-colons
'C3SL Live'
|
grep
--max-count
=
1
\
'fpr'
|
cut
--delimiter
=
':'
--fields
=
10
)
"
if
test
-z
"
${
fingerprint
}
"
;
then
if
[[
-z
"
${
fingerprint
}
"
]]
;
then
gpg
--batch
--no-tty
--gen-key
"
${
PREFIX
}
/src/gpg-key/gen-key-script"
fingerprint
=
"
$(
gpg
--list-keys
--with-colons
'C3SL Live'
|
grep
\
--max-count
=
1
'fpr'
|
cut
--delimiter
=
':'
--fields
=
10
)
"
...
...
@@ -62,9 +59,10 @@ chroot "${CHROOTDIR}" apt-get --download-only --yes install $(grep \
--invert-match
'^#'
<
"
${
PKGLIST
}
/repo.list"
|
tr
'\n'
' '
)
||
\
createIsoLogger
--message
"Unable to download packages to local repository"
\
--tag
"apt-get"
# createIsoLogger -m "Breakpoint" -t d
reprepro
--basedir
"
${
PREFIX
}
/repo/"
includedeb
"
${
REPO
}
"
\
"
${
CHROOTDIR
}
"
/var/cache/apt/archives/
*
.deb
||
createIsoLogger
--message
\
"Unable to include package
to
local repository"
--tag
"reprepro"
"Unable to include package
in
local repository"
--tag
"reprepro"
chroot
"
${
CHROOTDIR
}
"
apt-get clean
cp
--recursive
repo/
{
dists,pool
}
"
${
TMP
}
/image/"
||
createIsoLogger
--message
\
...
...
scripts-available/install-dependencies.sh
View file @
871ee349
...
...
@@ -22,22 +22,17 @@
# USA.
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
# TMP="$5"
CHROOTDIR
=
"
$6
"
# SCRIPTSDIR="$7"
PKGLIST
=
"
$8
"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
CHROOTDIR
=
"
$2
"
PKGLIST
=
"
$3
"
# SOURCESLIST="$4"
# REPO="$5"
# KEYURL="$6"
# TMP="$7"
PREFIX
=
"
${
PWD
}
"
type
addToChrootFile
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/
common
.sh"
type
addToChrootFile
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/
include/chroot
.sh"
grep
--invert-match
'^#'
<
"
${
PKGLIST
}
/dependencies.list"
|
tr
'\n'
' '
addToChrootFile
"
${
CHROOTDIR
}
"
"export PATH='/fakebin:
${
PATH
}
' createIsoLogger
\
--message
\"
Unable to export PATH
\"
--script
\
\"
$(
basename
"
${
BASH_SOURCE
[0]
}
"
)
\"
--line
\"
${
LINENO
}
\"
--tag
\"
export
\"
"
...
...
scripts-available/install.sh
View file @
871ee349
...
...
@@ -22,20 +22,16 @@
# USA.
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
# TMP="$5"
CHROOTDIR
=
"
$6
"
# SCRIPTSDIR="$7"
PKGLIST
=
"
$8
"
# SOURCESLIST="$9"
REPO
=
"
${
10
}
"
# KEYURL="${11}"
CHROOTDIR
=
"
$2
"
PKGLIST
=
"
$3
"
# SOURCESLIST="$4"
REPO
=
"
$5
"
# KEYURL="$6"
# TMP="$7"
PREFIX
=
"
${
PWD
}
"
type
addToChrootFile
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/
common
.sh"
type
addToChrootFile
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/
include/chroot
.sh"
addToChrootFile
"
${
CHROOTDIR
}
"
"export PATH='/fakebin:
${
PATH
}
' ||
\
createIsoLogger --message
\"
Unable to export PATH
\"
--script
\
...
...
scripts-available/local-repo.sh
0 → 100755
View file @
871ee349
#!/usr/bin/env bash
# shellcheck disable=SC1090
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of create-iso
#
# create-iso is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# PROFILE="$1"
CHROOTDIR
=
"
$2
"
PKGLIST
=
"
$3
"
# SOURCESLIST="$4"
REPO
=
"
$5
"
# KEYURL="$6"
TMP
=
"
$7
"
PREFIX
=
"
${
PWD
}
"
type
addToChrootFile
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/include/chroot.sh"
type
createIsoLogger
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/include/logging.sh"
fingerprint
=
"
$(
gpg
--list-keys
--with-colons
'C3SL Live'
|
grep
--max-count
=
1
\
'fpr'
|
cut
--delimiter
=
':'
--fields
=
10
)
"
if
[[
-z
"
${
fingerprint
}
"
]]
;
then
gpg
--batch
--no-tty
--gen-key
"
${
PREFIX
}
/src/gpg-key/gen-key-script"
fingerprint
=
"
$(
gpg
--list-keys
--with-colons
'C3SL Live'
|
grep
\
--max-count
=
1
'fpr'
|
cut
--delimiter
=
':'
--fields
=
10
)
"
fi
cp
--recursive
--archive
"
${
PREFIX
}
/src/local-repository/"
"
${
PREFIX
}
/repo/"
sed
--in-place
"s/##GPGKEY##/
${
fingerprint
}
/"
\
"
${
PREFIX
}
/repo/conf/distributions"
||
createIsoLogger
--message
\
"Unable to setup the key of local repository"
--type
warning
--tag
"sed"
sed
--in-place
"s/##CODENAME##/
${
REPO
}
/"
"
${
PREFIX
}
/repo/conf/distributions"
\
||
createIsoLogger
--message
\
"Unable to setup the codename of local repository"
--type
warning
--tag
"sed"
reprepro
--basedir
"
${
PREFIX
}
/repo/"
includedeb
"
${
REPO
}
"
\
"
${
CHROOTDIR
}
"
/var/cache/apt/archives/
*
.deb
||
createIsoLogger
--message
\
"Unable to include package in local repository"
--tag
"reprepro"
cp
--recursive
repo/
{
dists,pool
}
"
${
TMP
}
/image/"
||
createIsoLogger
--message
\
"Unable to move local repository to image"
--tag
"mv"
rm
--recursive
--force
"
${
PREFIX
:?
}
/repo/"
gpg
--armor
--export
'C3SL Live'
>
"
${
CHROOTDIR
}
/tmp/public.key"
||
\
createIsoLogger
--message
"Unable to export key"
--tag
"gpg"
addToChrootFile
"
${
CHROOTDIR
}
"
"export PATH='/fakebin:
${
PATH
}
' createIsoLogger
\
--message
\"
Unable to export PATH
\"
--script
\
\"
$(
basename
"
${
BASH_SOURCE
[0]
}
"
)
\"
--line
\"
${
LINENO
}
\"
--tag
\"
export
\"
"
addToChrootFile
"
${
CHROOTDIR
}
"
"export DEBIAN_FRONTEND=noninteractive ||
\
createIsoLogger --message
\"
Unable to export DEBIAN_FRONTEND
\"
--script
\
\"
$(
basename
"
${
BASH_SOURCE
[0]
}
"
)
\"
--line
\"
${
LINENO
}
\"
--tag
\"
export
\"
"
addToChrootFile
"
${
CHROOTDIR
}
"
"apt-get clean && apt-key add /tmp/public.key
\
|| createIsoLogger --message
\"
Unable to add key of local repository
\"
\
--script
\"
$(
basename
"
${
BASH_SOURCE
[0]
}
"
)
\"
--line
\"
${
LINENO
}
\"
--tag
\
\"
apt-get
\"
"
addToChrootFile
"
${
CHROOTDIR
}
"
"rm /tmp/public.key || createIsoLogger
\
--message
\"
Unable to remove the key file
\"
--script
\"
$(
basename
\
"
${
BASH_SOURCE
[0]
}
"
)
\"
--line
\"
${
LINENO
}
\"
--tag
\"
apt-get
\"
--type warning"
exit
0
scripts-available/make-initrd.sh
View file @
871ee349
...
...
@@ -24,19 +24,16 @@
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
TMP
=
"
$5
"
CHROOTDIR
=
"
$6
"
# SCRIPTSDIR="$7"
# PKGLIST="$8"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
CACHEDIR
=
"
${
12
}
"
TMP
=
"
$4
"
CHROOTDIR
=
"
$5
"
# PKGLIST="$6"
# REPO="$7"
CACHEDIR
=
"
$8
"
# DEBUG="$9"
PREFIX
=
"
${
PWD
}
"
type
createIsoLogger
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/
helper/logging.inc
sh"
type
createIsoLogger
>
/dev/null 2>&1
||
source
"
${
PREFIX
}
/
include/logging.
sh"
# The most recent kernel available in the base system is used in the image
initrd_path
=
"
$(
find
"
${
CHROOTDIR
}
/boot/"
-maxdepth
1
-regextype
egrep
-name
\
...
...
@@ -49,7 +46,6 @@ PREVIOUS="$(find "${CACHEDIR}" -mindepth 1 -maxdepth 1 -type d | sort \
--numeric
|
tail
--lines
=
1
)
"
if
[[
-f
"
${
PREVIOUS
}
/MD5SUMS"
]]
;
then
createIsoLogger
-m
"Breakpoint: Got true"
-t
d
OLDMD5
=
"
$(
cat
"
${
PREVIOUS
}
/MD5SUMS"
)
"
if
[[
"
${
OLDMD5
}
"
==
"
${
NEWMD5
}
"
]]
;
then
...
...
@@ -59,8 +55,6 @@ if [[ -f "${PREVIOUS}/MD5SUMS" ]]; then
fi
fi
createIsoLogger
-m
"Breakpoint: Got false"
-t
d
version
=
"
$(
basename
"
${
initrd_path
}
"
|
cut
--delimiter
=
'-'
--fields
=
2,3
)
"
cp
"
${
CHROOTDIR
}
/boot/vmlinuz-
${
version
}
-generic"
\
"
${
TMP
}
/image/casper/vmlinuz"
||
createIsoLogger
--message
\
...
...
scripts-available/manifest.sh
View file @
871ee349
...
...
@@ -24,18 +24,16 @@
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
TMP
=
"
$5
"
# CHROOTDIR="$6"