3 Commits
24.00 ... 24.02

3 changed files with 14 additions and 3 deletions

View File

@ -51,6 +51,10 @@ check_ret() {
################# #################
## main script ## ## main script ##
################# #################
if [ "$EUID" -ne 0 ]; then
error "You should run this script as root"
fi
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
error "Please specify a name for the archive" error "Please specify a name for the archive"
fi fi
@ -68,7 +72,7 @@ fi
info "Creating directory structure" info "Creating directory structure"
pushd $TARGET > /dev/null pushd $TARGET > /dev/null
mkdir -p {dev,proc,sys,run,tmp,root,home,boot} mkdir -p {dev,proc,sys,run,tmp,root,home,boot,mnt}
mkdir -p var/{log,mail,lib} mkdir -p var/{log,mail,lib}
mkdir -p usr/{bin,lib,sbin} mkdir -p usr/{bin,lib,sbin}
mkdir -p etc/mp mkdir -p etc/mp
@ -80,7 +84,7 @@ pushd $TARGET > /dev/null
ln -sf usr/sbin sbin ln -sf usr/sbin sbin
cat > etc/passwd << "EOF" cat > etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash root:!:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/dev/null:/usr/bin/false bin:x:1:1:bin:/dev/null:/usr/bin/false
daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false
messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false
@ -184,6 +188,8 @@ cat > $TARGET/etc/shells << "EOF"
/bin/bash /bin/bash
EOF EOF
cp "$TARGET/etc/skel/."* "$TARGET/root"
info "Installing certs" info "Installing certs"
wget -q https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt -O "$TARGET/certdata.txt" wget -q https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt -O "$TARGET/certdata.txt"
matter-chroot $TARGET make-ca > /dev/null matter-chroot $TARGET make-ca > /dev/null

View File

@ -104,5 +104,5 @@ if [ $# -gt 1 ]; then
exit $RET_CODE exit $RET_CODE
fi fi
chrt bash --login chrt bash --noprofile --login
exit $? exit $?

View File

@ -99,6 +99,10 @@ check_iso_vars() {
################# #################
## main script ## ## main script ##
################# #################
if [ "$EUID" -ne 0 ]; then
error "You should run this script as root"
fi
if [ $# -ne 2 ]; then if [ $# -ne 2 ]; then
error "Please specify a release archive and a config directory" error "Please specify a release archive and a config directory"
fi fi
@ -146,6 +150,7 @@ set_indent
info "Removing $e" info "Removing $e"
rm -rf "$TMPDIR/$e" rm -rf "$TMPDIR/$e"
done done
rm -rf "$TMPDIR/.git"
unset_indent unset_indent
info "Extracting release archive" info "Extracting release archive"