Make mkarchiso a bit more KISS
Remove the need for a configuration file. Some of the command line options had to be switched up a bit in order to do this. Also simplify the package list- only one package list is needed, not a directory, and additional packages can be specified on the command line. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
2f10bc9b79
commit
ef89b8a29f
57
mkarchiso
57
mkarchiso
@ -1,8 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
CONFIG="$(pwd)/mkarchiso.conf"
|
|
||||||
CPIOCONFIG="$(pwd)/archiso-mkinitcpio.conf"
|
CPIOCONFIG="$(pwd)/archiso-mkinitcpio.conf"
|
||||||
DEF_CONFIG_DIR="$(pwd)/default-config"
|
DEF_CONFIG_DIR="$(pwd)/default-config"
|
||||||
|
PKGFILE="$(pwd)/packages.list"
|
||||||
|
PKGLIST=""
|
||||||
QUIET="y"
|
QUIET="y"
|
||||||
FORCE="n"
|
FORCE="n"
|
||||||
|
|
||||||
@ -10,8 +11,6 @@ command_name=""
|
|||||||
work_dir=""
|
work_dir=""
|
||||||
isoname=""
|
isoname=""
|
||||||
|
|
||||||
PKGDIR="$(pwd)"
|
|
||||||
|
|
||||||
APPNAME=$(basename "${0}")
|
APPNAME=$(basename "${0}")
|
||||||
|
|
||||||
# usage: usage <exitvalue>
|
# usage: usage <exitvalue>
|
||||||
@ -19,12 +18,12 @@ usage ()
|
|||||||
{
|
{
|
||||||
echo "usage ${APPNAME} [options] command <command options>"
|
echo "usage ${APPNAME} [options] command <command options>"
|
||||||
echo " general options:"
|
echo " general options:"
|
||||||
echo " -c CONFIG Use CONFIG file. default: ${CONFIG}"
|
|
||||||
echo " -i CPIO_CONFIG Use CONFIG file for mkinitcpio. default: ${CPIOCONFIG}"
|
|
||||||
echo " -p PKGFILE_DIR Look for package list files in DIR. default: ${PKGDIR}"
|
|
||||||
echo " -f Force overwrite of working files/squashfs image/iso"
|
echo " -f Force overwrite of working files/squashfs image/iso"
|
||||||
echo " -v Verbose output. Default: no"
|
echo " -i CPIO_CONFIG Use CONFIG file for mkinitcpio. default: ${CPIOCONFIG}"
|
||||||
echo " -h This message"
|
echo " -P PKGFILE File with list of packages to install. default: ${PKGFILE}"
|
||||||
|
echo " -p PACKAGE Additional package to install, can be used multiple times"
|
||||||
|
echo " -v Enable verbose output."
|
||||||
|
echo " -h This message."
|
||||||
echo " commands:"
|
echo " commands:"
|
||||||
echo " install <working dir> : where to build the ISO root"
|
echo " install <working dir> : where to build the ISO root"
|
||||||
echo " squash <working dir> : generate a squashfs image of the ISO root"
|
echo " squash <working dir> : generate a squashfs image of the ISO root"
|
||||||
@ -33,11 +32,11 @@ usage ()
|
|||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts 'c:i:p:fvh' arg; do
|
while getopts 'i:P:p:fvh' arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
c) CONFIG="${OPTARG}" ;;
|
|
||||||
i) CPIOCONFIG="${OPTARG}" ;;
|
i) CPIOCONFIG="${OPTARG}" ;;
|
||||||
p) PKGDIR="${OPTARG}" ;;
|
P) PKGFILE="${OPTARG}" ;;
|
||||||
|
p) PKGLIST="${PKGLIST} ${OPTARG}" ;;
|
||||||
f) FORCE="y" ;;
|
f) FORCE="y" ;;
|
||||||
v) QUIET="n" ;;
|
v) QUIET="n" ;;
|
||||||
h|?) usage 0 ;;
|
h|?) usage 0 ;;
|
||||||
@ -67,15 +66,6 @@ esac
|
|||||||
|
|
||||||
[ "x${work_dir}" = "x" ] && (echo "please specify a working directory" && usage 1)
|
[ "x${work_dir}" = "x" ] && (echo "please specify a working directory" && usage 1)
|
||||||
|
|
||||||
#TODO - do we even need a config file?
|
|
||||||
if [ -e "${CONFIG}" ]; then
|
|
||||||
source "${CONFIG}"
|
|
||||||
else
|
|
||||||
echo "error: Config '${CONFIG}' does not exist, aborting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# {{{ Build
|
|
||||||
isoroot="${work_dir}/iso"
|
isoroot="${work_dir}/iso"
|
||||||
instroot="${work_dir}/install"
|
instroot="${work_dir}/install"
|
||||||
|
|
||||||
@ -107,7 +97,6 @@ install_pkgfile ()
|
|||||||
if [ -e "${1}" ]; then
|
if [ -e "${1}" ]; then
|
||||||
toinstall=""
|
toinstall=""
|
||||||
while read pkg; do
|
while read pkg; do
|
||||||
echo $ignorepkgs | grep "\<$pkg\>" >/dev/null 2>&1 && continue
|
|
||||||
toinstall="${toinstall} ${pkg}"
|
toinstall="${toinstall} ${pkg}"
|
||||||
done < ${1}
|
done < ${1}
|
||||||
_pacman "${toinstall}"
|
_pacman "${toinstall}"
|
||||||
@ -130,30 +119,18 @@ if [ "${command_name}" = "install" -o "${command_name}" = "all" ]; then
|
|||||||
mkdir -p "${instroot}"
|
mkdir -p "${instroot}"
|
||||||
|
|
||||||
echo "Installing packages..."
|
echo "Installing packages..."
|
||||||
for pkgfile in ${package_files}; do
|
echo " Installing packages from '${PKGFILE}'"
|
||||||
echo " Installing packages from '$pkgfile'"
|
install_pkgfile "${PKGFILE}"
|
||||||
install_pkgfile "${PKGDIR}/$pkgfile.packages"
|
|
||||||
done
|
for pkg in ${PKGLIST}; do
|
||||||
for pkg in ${additional_packages}; do
|
|
||||||
echo " Installing package '${pkg}'"
|
echo " Installing package '${pkg}'"
|
||||||
_pacman "${pkg}"
|
_pacman "${pkg}"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Installing kernel '${kernelpkg}'"
|
echo "Updating kernel module dependancies"
|
||||||
if ! _pacman "${kernelpkg}" ; then
|
|
||||||
echo "error: pacman failed to install '${kernelpkg}', aborting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
kernelver=$(_kversion)
|
kernelver=$(_kversion)
|
||||||
kernelsuffix=${kernelver##*-}
|
depmod -a -b "${instroot}" -v "${kernelver}" -F "${instroot}/boot/System.map26" >/dev/null
|
||||||
echo "Kernel Version ${kernelver} (${kernelsuffix}) installed - installing modules..."
|
# remove the initcpio images that were generated for the host system
|
||||||
if [ -e "${PKGDIR}/${kernelsuffix}.modules" ]; then
|
|
||||||
install_pkgfile "${PKGDIR}/${kernelsuffix}.modules"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Updating module dependancies"
|
|
||||||
[ "${kernelsuffix}" = "ARCH" ] && kernelsuffix=""
|
|
||||||
depmod -a -b "${instroot}" -v "${kernelver}" -F "${instroot}/boot/System.map26${kernelsuffix}" >/dev/null
|
|
||||||
find "${instroot}/boot" -name *.img -delete
|
find "${instroot}/boot" -name *.img -delete
|
||||||
|
|
||||||
echo "Applying default configuration for the Arch ISO"
|
echo "Applying default configuration for the Arch ISO"
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
# vim: set ft=sh:
|
|
||||||
#TODO this can all be removed in place of commandline params to mkarchiso
|
|
||||||
kernelpkg="kernel26"
|
|
||||||
packager_name="Archlinux User"
|
|
||||||
|
|
||||||
package_files="base"
|
|
||||||
additional_packages=""
|
|
||||||
ignorepkgs="devfsd hotplug pcmcia-cs"
|
|
||||||
|
|
||||||
qemu_test="n"
|
|
||||||
qemuparams="" #"-vnc 1"
|
|
@ -1,56 +1,74 @@
|
|||||||
bash
|
bash
|
||||||
bin86
|
bin86
|
||||||
binutils
|
|
||||||
bzip2
|
bzip2
|
||||||
coreutils
|
coreutils
|
||||||
cpio
|
cpio
|
||||||
cracklib
|
cracklib
|
||||||
|
cryptsetup
|
||||||
db
|
db
|
||||||
dcron
|
dcron
|
||||||
dhcpcd
|
dhcpcd
|
||||||
dialog
|
dialog
|
||||||
|
diffutils
|
||||||
|
dnsutils
|
||||||
|
dosfstools
|
||||||
e2fsprogs
|
e2fsprogs
|
||||||
ed
|
ed
|
||||||
|
fakeroot
|
||||||
elinks
|
elinks
|
||||||
file
|
file
|
||||||
filesystem
|
filesystem
|
||||||
findutils
|
findutils
|
||||||
|
fuse
|
||||||
gawk
|
gawk
|
||||||
gcc
|
gcc
|
||||||
gettext
|
gettext
|
||||||
glibc
|
glibc
|
||||||
grep
|
grep
|
||||||
groff
|
|
||||||
grub-gfx
|
grub-gfx
|
||||||
gzip
|
gzip
|
||||||
|
hdparm
|
||||||
initscripts
|
initscripts
|
||||||
|
iptables
|
||||||
iputils
|
iputils
|
||||||
|
ipw3945
|
||||||
jfsutils
|
jfsutils
|
||||||
kbd
|
kbd
|
||||||
|
kernel-headers
|
||||||
|
kernel26
|
||||||
less
|
less
|
||||||
lftp
|
lftp
|
||||||
libpcap
|
|
||||||
libusb
|
libusb
|
||||||
licenses
|
licenses
|
||||||
lilo
|
lilo
|
||||||
lshwd
|
lshwd
|
||||||
lsof
|
lsof
|
||||||
|
lvm2
|
||||||
lzo2
|
lzo2
|
||||||
|
madwifi
|
||||||
|
madwifi-utils
|
||||||
mailx
|
mailx
|
||||||
man
|
man
|
||||||
man-pages
|
man-pages
|
||||||
mdadm
|
mdadm
|
||||||
memtest86+
|
memtest86+
|
||||||
|
mkinitcpio
|
||||||
mktemp
|
mktemp
|
||||||
module-init-tools
|
module-init-tools
|
||||||
nano
|
nano
|
||||||
ncurses
|
ncurses
|
||||||
|
ndiswrapper
|
||||||
|
ndiswrapper-utils
|
||||||
net-tools
|
net-tools
|
||||||
netcat
|
netcat
|
||||||
netkit-telnet
|
netkit-telnet
|
||||||
|
nfs-utils
|
||||||
|
ntfs-3g
|
||||||
|
ntfsprogs
|
||||||
nmap
|
nmap
|
||||||
openssh
|
openssh
|
||||||
openssl
|
openssl
|
||||||
|
openvpn
|
||||||
pacman
|
pacman
|
||||||
pam
|
pam
|
||||||
parted
|
parted
|
||||||
@ -59,7 +77,9 @@ pcmciautils
|
|||||||
pcre
|
pcre
|
||||||
perl
|
perl
|
||||||
popt
|
popt
|
||||||
|
portmap
|
||||||
ppp
|
ppp
|
||||||
|
pptpclient
|
||||||
procinfo
|
procinfo
|
||||||
procps
|
procps
|
||||||
psmisc
|
psmisc
|
||||||
@ -67,9 +87,12 @@ python
|
|||||||
readline
|
readline
|
||||||
reiserfsprogs
|
reiserfsprogs
|
||||||
rp-pppoe
|
rp-pppoe
|
||||||
|
rt2500
|
||||||
|
screen
|
||||||
sed
|
sed
|
||||||
shadow
|
shadow
|
||||||
squashfs-tools
|
squashfs-tools
|
||||||
|
sudo
|
||||||
sysfsutils
|
sysfsutils
|
||||||
syslog-ng
|
syslog-ng
|
||||||
sysvinit
|
sysvinit
|
||||||
@ -81,11 +104,16 @@ unionfs-utils
|
|||||||
unrar
|
unrar
|
||||||
unzip
|
unzip
|
||||||
usbutils
|
usbutils
|
||||||
util-linux
|
util-linux-ng
|
||||||
|
vi
|
||||||
vim
|
vim
|
||||||
wget
|
wget
|
||||||
which
|
which
|
||||||
wireless_tools
|
wireless_tools
|
||||||
|
wlan-ng26
|
||||||
|
wlan-ng26-utils
|
||||||
wpa_supplicant
|
wpa_supplicant
|
||||||
|
xfsdump
|
||||||
xfsprogs
|
xfsprogs
|
||||||
|
zd1211-firmware
|
||||||
zlib
|
zlib
|
@ -1,5 +0,0 @@
|
|||||||
ipw3945
|
|
||||||
madwifi
|
|
||||||
ndiswrapper
|
|
||||||
rt2500
|
|
||||||
wlan-ng26
|
|
Loading…
Reference in New Issue
Block a user