mkarchiso: cleanup opts, user dir creation
As in title, this patch cleans up opt flags that exist for no reason and adds additional flags to modify the disk meta info which would otherwise be hardcoded. I wasn't quite sure about the user directory part but it doesn't seem like a good idea to put that part into the script and therefore I commented it out. It would probably interfere with rc.local scripts that take care of skel copying. I replaced the part after the TODO with a safe guard to make sure that people who are not aware of the changes will not be caught by surprise. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
parent
44550defdb
commit
961d4cb670
@ -4,6 +4,10 @@ PKGLIST=""
|
||||
QUIET="y"
|
||||
FORCE="n"
|
||||
PACCONFIG="/etc/pacman.conf"
|
||||
export LABEL="ARCHISO_$(pwgen -n 8 1 | tr [a-z] [A-Z])"
|
||||
PUBLISHER="Arch Linux <http://www.archlinux.org>"
|
||||
APPLICATION="Arch Linux Live/Rescue CD"
|
||||
CREATE_DEFAULT="n"
|
||||
|
||||
APPNAME=$(basename "${0}")
|
||||
|
||||
@ -15,8 +19,12 @@ usage ()
|
||||
echo " -f Force overwrite of working files/squashfs image/bootable image"
|
||||
echo " -p PACKAGE(S) Additional package(s) to install, can be used multiple times"
|
||||
echo " -C <file> Config file for pacman. Default $PACCONFIG"
|
||||
echo " -v Enable verbose output."
|
||||
echo " -h This message."
|
||||
echo " -L <label> Set a label for the disk"
|
||||
echo " -P <publisher> Set a publisher for the disk"
|
||||
echo " -A <application> Set an application name for the disk"
|
||||
echo " -d Create default user directory /home/arch"
|
||||
echo " -v Enable verbose output"
|
||||
echo " -h This message"
|
||||
echo " commands:"
|
||||
echo " create <dir>"
|
||||
echo " create a base directory layout to work with"
|
||||
@ -28,10 +36,14 @@ usage ()
|
||||
exit $1
|
||||
}
|
||||
|
||||
while getopts 'C:i:P:p:a:t:fvh' arg; do
|
||||
while getopts 'p:C:L:P:A:dfvh' arg; do
|
||||
case "${arg}" in
|
||||
p) PKGLIST="${PKGLIST} ${OPTARG}" ;;
|
||||
C) PACCONFIG="${OPTARG}" ;;
|
||||
L) LABEL="${OPTARG}" ;;
|
||||
P) PUBLISHER="${OPTARG}" ;;
|
||||
A) APPLICATION="${OPTARG}" ;;
|
||||
d) CREATE_DEFAULT="y" ;;
|
||||
f) FORCE="y" ;;
|
||||
v) QUIET="n" ;;
|
||||
h|?) usage 0 ;;
|
||||
@ -134,10 +146,12 @@ to the iso/ directory.
|
||||
fi
|
||||
|
||||
#TODO is this needed? do it at the Makefile level?
|
||||
if [ ${CREATE_DEFAULT} == "y" ]; then
|
||||
if [ -d "${work_dir}/root-image/home/" ]; then
|
||||
echo "Creating default home directory"
|
||||
install -d -o1000 -g100 -m0755 "${work_dir}/root-image/home/arch"
|
||||
fi
|
||||
fi
|
||||
|
||||
# delete a lot of unnecessary cache/log files
|
||||
kill_dirs="var/abs var/cache/man var/cache/pacman var/lib/pacman/sync var/log/* var/mail tmp/* initrd"
|
||||
@ -215,7 +229,6 @@ _imgcommon () {
|
||||
|
||||
cp "${work_dir}/isomounts" "${work_dir}/iso/"
|
||||
|
||||
export LABEL="ARCHISO_$(pwgen -n 8 1 | tr [a-z] [A-Z])"
|
||||
[ -f ${work_dir}/iso/boot/grub/menu.lst ] && sed "s|archisolabel=[^ ]*|archisolabel=${LABEL}|" -i ${work_dir}/iso/boot/grub/menu.lst
|
||||
[ -f ${work_dir}/iso/boot/isolinux/isolinux.cfg ] && sed "s|archisolabel=[^ ]*|archisolabel=${LABEL}|" -i ${work_dir}/iso/boot/isolinux/isolinux.cfg
|
||||
}
|
||||
@ -251,10 +264,11 @@ command_iso () {
|
||||
qflag=""
|
||||
[ "${QUIET}" = "y" ] && qflag="-quiet"
|
||||
mkisofs ${qflag} -r -l $bootflags -uid 0 -gid 0 \
|
||||
-udf -allow-limited-size -iso-level 3 \
|
||||
-input-charset utf-8 -p "prepared by mkarchiso" \
|
||||
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||
-publisher "Arch Linux <http://www.archlinux.org>" \
|
||||
-A "Arch Linux Live/Rescue CD" \
|
||||
-publisher "${PUBLISHER}" \
|
||||
-A "${APPLICATION}" \
|
||||
-V "${LABEL}" \
|
||||
-o "${imgname}" "${work_dir}/iso/"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user