diff options
-rw-r--r-- | README | 10 | ||||
-rw-r--r-- | README.old | 117 | ||||
-rw-r--r-- | archiso/Makefile | 2 | ||||
-rw-r--r-- | archiso/hooks/archiso | 36 | ||||
-rwxr-xr-x | archiso/mkarchiso | 17 | ||||
-rwxr-xr-x | configs/baseline/build.sh | 24 | ||||
-rw-r--r-- | configs/baseline/root-image/etc/fstab | 2 | ||||
-rw-r--r-- | configs/baseline/syslinux/syslinux.cfg | 2 | ||||
-rw-r--r-- | configs/releng/aitab.core | 12 | ||||
-rwxr-xr-x | configs/releng/build.sh | 73 | ||||
-rw-r--r-- | configs/releng/root-image/etc/fstab | 5 | ||||
-rwxr-xr-x | configs/releng/root-image/etc/rc.d/archiso | 32 | ||||
-rw-r--r-- | configs/releng/syslinux.dual/syslinux_arch32.cfg | 2 | ||||
-rw-r--r-- | configs/releng/syslinux.dual/syslinux_arch64.cfg | 2 | ||||
-rw-r--r-- | configs/releng/syslinux/syslinux.cfg | 2 |
15 files changed, 142 insertions, 196 deletions
@@ -33,6 +33,10 @@ This is a rebranded fork of the original Archiso for Parabola GNU/Linux-libre. * copytoram= If set to "y" or just "copytoram" without arguments, all SquashFS are copied to "RAM". Default: (unset) +* checksum= If set to "y" or just "checksum" without arguments, + performs a self-test of all files inside ${install_dir}, + and continue booting if ok. + Default: (unset) * cowspace_size= Set the size of tmpfs /cowspace. This space is used for Copy-On-Write files of dm-snapshot. (directory not visible outside initramfs) @@ -45,6 +49,8 @@ This is a rebranded fork of the original Archiso for Parabola GNU/Linux-libre. Size is in bytes (suffix with "k", "m" and "g") or in percentage of available RAM. Default: "75%" +* dm_snap_prefix= Set a prefix for device-mapper snapshot node names. + Default: "arch" * arch= Force an architecture type (i686 | x86_64). Do not set it for normal operations. Useful for running a 64 bit kernel / 32 bit userspace. @@ -240,6 +246,7 @@ Note: These steps should be done with 64 bits support. [chroot32] # cp -r /usr/share/archiso/configs/releng /tmp [chroot32] # cd /tmp/releng [chroot32] # ./build.sh all_iso_single + [chroot32] # ./build.sh purge_single #optional * Enter 64 bits chroot enviroment then build core and netinstall single images. @@ -248,9 +255,10 @@ Note: These steps should be done with 64 bits support. [chroot64] # cp -r /usr/share/archiso/configs/releng /tmp [chroot64] # cd /tmp/releng [chroot64] # ./build.sh all_iso_single + [chroot64] # ./build.sh purge_single #optional * Build core and netinstall dual images from any of the chroot enviroments. - [host64] mkarchroot -r bash /tmp/chroot64 + [host64] # mkarchroot -r bash /tmp/chroot64 [chroot64] # cd /tmp/releng [chroot64] # ./build.sh all_iso_dual diff --git a/README.old b/README.old deleted file mode 100644 index cbfed9e..0000000 --- a/README.old +++ /dev/null @@ -1,117 +0,0 @@ -Archiso For Dummies Like Me and You -------------------------------------- - - -- What the hell is Archiso? - -Archiso is a small set of bash scripts that is capable of building fully -functional Arch Linux based live CDs. It is a very generic tool, so it -could potentially be used to generate anything from rescue systems, -to install disks, to special interest live CD systems, and who knows what -else. Simply put, if it involves Arch on a shiny coaster, it can do it. - - -- Alright, so how does one install it? - -First off, Archiso has some dependencies: - - mkinitcpio - - cdrkit - - squashfs-tools - - aufs2 (only needed in target media) - - aufs2-util (only needed in target media) - - devtools for mkarchroot - - syslinux - - nbd - - mkinitcpio-nfs-utils - -Archiso itself can be installed with the handy dandy included Makefile, -and the incantation 'make install'. - - -- Great, so how do you use this thing? - -The heart and soul of Archiso is mkarchiso. All of its options are -documented in its usage output, so we won't go into detail here. -Instead, let's go over the general process. - -The first thing you should probably do is create a directory to work -in, and cd to it. This'll help keep things organized. Next, you'll want -to create a mkinitcpio config file that suits your needs. Typically this -means modifying whatever hooks you want. A typical set of hooks for -archiso looks something like this: - -HOOKS="base udev archiso pata scsi sata usb fw pcmcia filesystems usbinput" - -It's probably worth mentioning that hardware autodetection and things -of that nature do not belong here. Only what's necessary to get the system -on its feet, and out of the initcpio really belong here, fancier stuff -can be done on the booted system anyway. - -You'll also want to create a list of packages you want installed on your -live CD system. A file full of package names, one-per-line, is the format -for this. Typically you'll want BASE and a kernel as a bare minimum, but -you're free to install whatever else you want. This is *great* for -special interest live CDs, just specify packages you want and gogogo. - -The last item of importance is what are called addons. Basically this -means any other crap you might want to include on your live CD, including -binary package repos, special configurations, random files, we don't -know, be creative. mkarchiso expects them all to be put in a single -directory, with an fstab-like config file. Currently two types of addons -are supported, squashfs images that get layered onto the root union, and -plain directories which can be bind mounted anywhere under the root. - -If you want to add a squashfs union layer: -- Set up whatever you want to include in a separate directory someplace, - as if that directory was / . Then run mksquahfs on it, and copy the - created image to your addons directory. -- Add an entry to your addons config file (which must be named 'config', - by the way). Typical squashfs entries look like this: - live_overlay.sqfs / squashfs - Where the first component is the path to the image relative to your - addons directory, the second is the mountpoint (irrelevant for - squashfs, they will all get layered at /) and of course the third - component is the type. -- Be aware that the order of entries on the config matters! Entries will - be layered on top of one another, later entries are mounted _UNDER_ - earlier entries (an unfortunate counterintuitive result of the way we - have to mount the unions). - -If you want to add plain directories to bind mount: -- Set up your directory somewhere, and copy it to your addon directory. -- Add an entry to your addons config file, example entry: - core /packages bind - where the first component is the path to the directory relative to - your addons directory, the second component is where you'd like it - bind-mounted relative to the live CD's root filesystem, and the last - component is the type. - - -- How can build installation mediums like provided by Arch Linux? - -- Just follow these next steps as root. -- Note that mkarchroot is optional, but with it, will ensure to have - a clean enviroment for building isos. -- This clean chroot, will take about 400MB (+130MB with all needed tools). -- After make, max space usage is about 2GB. -- In last step instead of just execute make, can be more selective: - Execute "make net-iso" or make "core-iso". - Do not execute make net-iso after make core-iso, otherwise net-iso - will be really a core-iso. - - -pacman -S devtools --needed -mkarchroot /tmp/somedir base -mkarchroot -r bash /tmp/somedir -# vi/nano /etc/pacman.d/mirrorlist and uncomment your prefered mirror. -pacman -S git squashfs-tools syslinux devtools cdrkit make nbd mkinitcpio-nfs-utils -cd /tmp -git clone git://projects.archlinux.org/archiso.git -cd archiso/archiso -make install -cd ../configs/syslinux-iso/ -make - -Done! - -vim: textwidth=72 diff --git a/archiso/Makefile b/archiso/Makefile index 78dd534..60632e2 100644 --- a/archiso/Makefile +++ b/archiso/Makefile @@ -20,7 +20,7 @@ install-hooks: install-examples: # install examples install -d -m 755 $(DESTDIR)/usr/share/archiso/ - cp -r ../configs $(DESTDIR)/usr/share/archiso/configs + cp -r ../configs $(DESTDIR)/usr/share/archiso/ install-doc: install -d -m 755 $(DESTDIR)/usr/share/archiso/ diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 7e2997a..c973ffc 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -29,6 +29,7 @@ _mnt_fs() { local mnt="${2}" local img_fullname="${img##*/}"; local img_name="${img_fullname%%.*}" + local dm_snap_name="${dm_snap_prefix}_${img_name}" local ro_dev ro_dev_size ro_dev_fs_type rw_dev mkdir -p "${mnt}" @@ -42,11 +43,11 @@ _mnt_fs() { _next_loop_dev rw_dev=$(_make_loop_dev "/cowspace/${img_name}.cow") - echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} N 8" | dmsetup create ${img_name} + echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} N 8" | dmsetup create ${dm_snap_name} - msg ":: Mounting '/dev/mapper/${img_name}' (${ro_dev_fs_type}) to '${mnt}'" - if ! mount -t "${ro_dev_fs_type}" "/dev/mapper/${img_name}" "${mnt}" ; then - echo "ERROR: while mounting '/dev/mapper/${img_name}' to '${mnt}'" + msg ":: Mounting '/dev/mapper/${dm_snap_name}' (${ro_dev_fs_type}) to '${mnt}'" + if ! mount -t "${ro_dev_fs_type}" "/dev/mapper/${dm_snap_name}" "${mnt}" ; then + echo "ERROR: while mounting '/dev/mapper/${dm_snap_name}' to '${mnt}'" launch_interactive_shell fi } @@ -76,11 +77,22 @@ _mnt_sfs() { fi } +_verify_checksum() { + local _status + cd "/bootmnt/${archisobasedir}" + md5sum -c checksum.md5 > /checksum.log 2>&1 + _status=$? + cd "${OLDPWD}" + return ${_status} +} + + run_hook() { [[ -z "${arch}" ]] && arch="$(uname -m)" [[ -z "${cowspace_size}" ]] && cowspace_size="75%" [[ -z "${copytoram_size}" ]] && copytoram_size="75%" [[ -z "${archisobasedir}" ]] && archisobasedir="arch" + [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch" [[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}" if [[ -z "${aitab}" ]]; then aitab="/bootmnt/${archisobasedir}/aitab" @@ -133,6 +145,22 @@ archiso_mount_handler() { launch_interactive_shell fi + if [[ "${checksum}" == "y" ]]; then + if [[ -f "/bootmnt/${archisobasedir}/checksum.md5" ]]; then + msg -n ":: Self-test requested, please wait..." + if _verify_checksum; then + msg "done. Checksum is OK, continue booting." + else + echo "ERROR: one or more files are corrupted" + echo "see /checksum.log for details" + launch_interactive_shell + fi + else + echo "ERROR: checksum=y option specified but checksum.md5 not found" + launch_interactive_shell + fi + fi + if [[ "${copytoram}" == "y" ]]; then msg -n ":: Mounting /copytoram (tmpfs) filesystem, size=${copytoram_size}..." mount -t tmpfs -o "size=${copytoram_size}",mode=0755 copytoram /copytoram diff --git a/archiso/mkarchiso b/archiso/mkarchiso index e09ad54..1c3242d 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -112,6 +112,8 @@ _usage () echo " includes all specified packages" echo " prepare <dir>" echo " build all images" + echo " checksum <dir>" + echo " make a checksum.md5 for self-test" echo " iso <dir> <image name>" echo " build an iso image from the working dir" exit ${1} @@ -134,6 +136,8 @@ _show_config () { ;; prepare) ;; + checksum) + ;; iso) _msg_info " Image name: ${img_name}" _msg_info " Disk label: ${iso_label}" @@ -286,6 +290,16 @@ _mkfs () { _umount_fs "${work_dir}/mnt/${_src}" } +command_checksum () { + _show_config checksum + + _msg_info "Creating checksum file for self-test" + cd "${work_dir}/iso/${install_dir}" + find -type f ! -name checksum.md5 -print0 | xargs -0 md5sum > checksum.md5 + cd ${OLDPWD} + _msg_info "Done!" +} + # Create an ISO9660 filesystem from "iso" directory. command_iso () { if [[ ! -f "${work_dir}/iso/isolinux/isolinux.bin" ]]; then @@ -428,6 +442,9 @@ case "${command_name}" in prepare) command_prepare ;; + checksum) + command_checksum + ;; iso) if [[ $# -lt 3 ]]; then _msg_error "No image specified" 0 diff --git a/configs/baseline/build.sh b/configs/baseline/build.sh index 64664fc..780194d 100755 --- a/configs/baseline/build.sh +++ b/configs/baseline/build.sh @@ -10,20 +10,14 @@ arch=$(uname -m) work_dir=work verbose="n" +script_path=$(readlink -f ${0%/*}) + # Base installation (root-image) make_basefs() { mkarchiso ${verbose} -D "${install_dir}" -p "base" create "${work_dir}" mkarchiso ${verbose} -D "${install_dir}" -p "syslinux" create "${work_dir}" } -# Customize installation (root-image) -make_customize_root_image() { - if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - cp -af root-image ${work_dir} - : > ${work_dir}/build.${FUNCNAME} - fi -} - # Copy mkinitcpio archiso hooks (root-image) make_setup_mkinitcpio() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then @@ -38,11 +32,11 @@ make_boot() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then mkdir -p ${work_dir}/iso/${install_dir}/boot/${arch} mkinitcpio \ - -c ./mkinitcpio.conf \ + -c ${script_path}/mkinitcpio.conf \ -b ${work_dir}/root-image \ - -k /boot/vmlinuz26 \ + -k /boot/vmlinuz-linux-libre \ -g ${work_dir}/iso/${install_dir}/boot/${arch}/libreiso.img - cp ${work_dir}/root-image/boot/vmlinuz26 ${work_dir}/iso/${install_dir}/boot/${arch} + cp ${work_dir}/root-image/boot/vmlinuz-linux-libre ${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz : > ${work_dir}/build.${FUNCNAME} fi } @@ -53,7 +47,7 @@ make_syslinux() { mkdir -p ${work_dir}/iso/${install_dir}/boot/syslinux sed "s|%ARCHISO_LABEL%|${iso_label}|g; s|%INSTALL_DIR%|${install_dir}|g; - s|%ARCH%|${arch}|g" syslinux/syslinux.cfg > ${work_dir}/iso/${install_dir}/boot/syslinux/syslinux.cfg + s|%ARCH%|${arch}|g" ${script_path}/syslinux/syslinux.cfg > ${work_dir}/iso/${install_dir}/boot/syslinux/syslinux.cfg cp ${work_dir}/root-image/usr/lib/syslinux/menu.c32 ${work_dir}/iso/${install_dir}/boot/syslinux/ : > ${work_dir}/build.${FUNCNAME} fi @@ -63,7 +57,7 @@ make_syslinux() { make_isolinux() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then mkdir -p ${work_dir}/iso/isolinux - sed "s|%INSTALL_DIR%|${install_dir}|g" isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg + sed "s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg cp ${work_dir}/root-image/usr/lib/syslinux/isolinux.bin ${work_dir}/iso/isolinux/ : > ${work_dir}/build.${FUNCNAME} fi @@ -72,7 +66,7 @@ make_isolinux() { # Process aitab make_aitab() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - sed "s|%ARCH%|${arch}|g" aitab > ${work_dir}/iso/${install_dir}/aitab + sed "s|%ARCH%|${arch}|g" ${script_path}/aitab > ${work_dir}/iso/${install_dir}/aitab : > ${work_dir}/build.${FUNCNAME} fi } @@ -84,6 +78,7 @@ make_prepare() { # Build ISO make_iso() { + mkarchiso ${verbose} checksum "${work_dir}" mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}" "${name}-${version}-${arch}.iso" } @@ -94,7 +89,6 @@ else fi make_basefs -make_customize_root_image make_setup_mkinitcpio make_boot make_syslinux diff --git a/configs/baseline/root-image/etc/fstab b/configs/baseline/root-image/etc/fstab deleted file mode 100644 index 4b82b80..0000000 --- a/configs/baseline/root-image/etc/fstab +++ /dev/null @@ -1,2 +0,0 @@ -# <file system> <dir> <type> <options> <dump> <pass> -/dev/mapper/root-image / auto defaults 0 0 diff --git a/configs/baseline/syslinux/syslinux.cfg b/configs/baseline/syslinux/syslinux.cfg index 58c3209..6bd59a5 100644 --- a/configs/baseline/syslinux/syslinux.cfg +++ b/configs/baseline/syslinux/syslinux.cfg @@ -5,7 +5,7 @@ TIMEOUT 300 LABEL libre MENU LABEL Parabola GNU/Linux-libre -LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz26 +LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz INITRD /%INSTALL_DIR%/boot/%ARCH%/libreiso.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% diff --git a/configs/releng/aitab.core b/configs/releng/aitab.core index e538000..5a54bec 100644 --- a/configs/releng/aitab.core +++ b/configs/releng/aitab.core @@ -1,6 +1,6 @@ -# <img> <mnt> <arch> <sfs_comp> <fs_type> <fs_size> -root-image / %ARCH% xz ext4 50% -lib-modules /lib/modules %ARCH% xz ext4 10% -usr-share /usr/share any xz ext4 50% -core-pkgs /repo/pkg %ARCH% xz none 0 -core-any-pkgs /repo/any any xz none 0 +# <img> <mnt> <arch> <sfs_comp> <fs_type> <fs_size> +root-image / %ARCH% xz ext4 50% +lib-modules /lib/modules %ARCH% xz ext4 10% +usr-share /usr/share any xz ext4 50% +repo-core-%ARCH% /repo/core/%ARCH% %ARCH% xz none 0 +repo-core-any /repo/core/any any xz none 0 diff --git a/configs/releng/build.sh b/configs/releng/build.sh index 9e10b0a..8c96c76 100755 --- a/configs/releng/build.sh +++ b/configs/releng/build.sh @@ -10,6 +10,8 @@ arch=$(uname -m) work_dir=work verbose="n" +script_path=$(readlink -f ${0%/*}) + # Base installation (root-image) make_basefs() { mkarchiso ${verbose} -D "${install_dir}" -p "base" create "${work_dir}" @@ -18,13 +20,13 @@ make_basefs() { # Additional packages (root-image) make_packages() { - mkarchiso ${verbose} -D "${install_dir}" -p "$(grep -v ^# packages.${arch})" create "${work_dir}" + mkarchiso ${verbose} -D "${install_dir}" -p "$(grep -v ^# ${script_path}/packages.${arch})" create "${work_dir}" } # Customize installation (root-image) make_customize_root_image() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - cp -af root-image ${work_dir} + cp -af ${script_path}/root-image ${work_dir} chmod 750 ${work_dir}/root-image/etc/sudoers.d chmod 440 ${work_dir}/root-image/etc/sudoers.d/g_wheel mkdir -p ${work_dir}/root-image/etc/pacman.d @@ -58,11 +60,11 @@ make_boot() { local _dst_boot=${work_dir}/iso/${install_dir}/boot mkdir -p ${_dst_boot}/${arch} mkinitcpio \ - -c ./mkinitcpio.conf \ + -c ${script_path}/mkinitcpio.conf \ -b ${_src} \ - -k /boot/vmlinuz26 \ + -k /boot/vmlinuz-linux-libre \ -g ${_dst_boot}/${arch}/libreiso.img - mv ${_src}/boot/vmlinuz26 ${_dst_boot}/${arch} + mv ${_src}/boot/vmlinuz-linux-libre ${_dst_boot}/${arch}/vmlinuz cp ${_src}/boot/memtest86+/memtest.bin ${_dst_boot}/memtest cp ${_src}/usr/share/licenses/common/GPL2/license.txt ${_dst_boot}/memtest.COPYING : > ${work_dir}/build.${FUNCNAME} @@ -77,8 +79,8 @@ make_syslinux() { mkdir -p ${_dst_syslinux} sed "s|%ARCHISO_LABEL%|${iso_label}|g; s|%INSTALL_DIR%|${install_dir}|g; - s|%ARCH%|${arch}|g" syslinux/syslinux.cfg > ${_dst_syslinux}/syslinux.cfg - cp syslinux/splash.png ${_dst_syslinux} + s|%ARCH%|${arch}|g" ${script_path}/syslinux/syslinux.cfg > ${_dst_syslinux}/syslinux.cfg + cp ${script_path}/syslinux/splash.png ${_dst_syslinux} cp ${_src_syslinux}/*.c32 ${_dst_syslinux} cp ${_src_syslinux}/*.com ${_dst_syslinux} cp ${_src_syslinux}/*.0 ${_dst_syslinux} @@ -94,7 +96,7 @@ make_syslinux() { make_isolinux() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then mkdir -p ${work_dir}/iso/isolinux - sed "s|%INSTALL_DIR%|${install_dir}|g" isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg + sed "s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg cp ${work_dir}/root-image/usr/lib/syslinux/isolinux.bin ${work_dir}/iso/isolinux/ : > ${work_dir}/build.${FUNCNAME} fi @@ -117,17 +119,18 @@ make_usr_share() { } # Make [core] repository, keep "any" pkgs in a separate fs (makes more "dual-iso" friendly) +# TODO add 'base' packages on [libre] make_core_repo() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then local _url _urls _pkg_name _cached_pkg _dst - mkdir -p ${work_dir}/core-any-pkgs - mkdir -p ${work_dir}/core-pkgs + mkdir -p ${work_dir}/repo-core-any + mkdir -p ${work_dir}/repo-core-${arch} pacman -Sy - _urls=$(pacman -Sddp $(comm -2 -3 <(pacman -Sql core | sort ) <(grep -v ^# core.exclude.${arch} | sort))) + _urls=$(pacman -Sddp $(comm -2 -3 <(pacman -Sql core | sort ) <(grep -v ^# ${script_path}/core.exclude.${arch} | sort))) for _url in ${_urls}; do _pkg_name=${_url##*/} _cached_pkg=/var/cache/pacman/pkg/${_pkg_name} - _dst=${work_dir}/core-pkgs/${_pkg_name} + _dst=${work_dir}/repo-core-${arch}/${_pkg_name} if [[ ! -e ${_dst} ]]; then if [[ -e ${_cached_pkg} ]]; then cp -v "${_cached_pkg}" "${_dst}" @@ -135,10 +138,10 @@ make_core_repo() { wget -nv "${_url}" -O "${_dst}" fi fi - repo-add -q ${work_dir}/core-pkgs/core.db.tar.gz ${work_dir}/core-pkgs/${_pkg_name} + repo-add -q ${work_dir}/repo-core-${arch}/core.db.tar.gz ${work_dir}/repo-core-${arch}/${_pkg_name} if [[ ${_pkg_name} =~ any.pkg ]]; then - mv "${_dst}" ${work_dir}/core-any-pkgs/${_pkg_name} - ln -sf ../any/${_pkg_name} ${work_dir}/core-pkgs/${_pkg_name} + mv "${_dst}" ${work_dir}/repo-core-any/${_pkg_name} + ln -sf ../any/${_pkg_name} ${work_dir}/repo-core-${arch}/${_pkg_name} fi done : > ${work_dir}/build.${FUNCNAME} @@ -150,7 +153,7 @@ make_core_repo() { make_aitab() { local _iso_type=${1} if [[ ! -e ${work_dir}/build.${FUNCNAME}_${_iso_type} ]]; then - sed "s|%ARCH%|${arch}|g" aitab.${_iso_type} > ${work_dir}/iso/${install_dir}/aitab + sed "s|%ARCH%|${arch}|g" ${script_path}/aitab.${_iso_type} > ${work_dir}/iso/${install_dir}/aitab : > ${work_dir}/build.${FUNCNAME}_${_iso_type} fi } @@ -164,6 +167,7 @@ make_prepare() { # args: $1 (core | netinstall) make_iso() { local _iso_type=${1} + mkarchiso ${verbose} checksum "${work_dir}" mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}" "${name}-${version}-${_iso_type}-${arch}.iso" } @@ -190,23 +194,24 @@ make_dual() { rm -f ${work_dir}/dual/iso/${install_dir}/aitab rm -f ${work_dir}/dual/iso/${install_dir}/boot/syslinux/syslinux.cfg if [[ ${_iso_type} == "core" ]]; then - if [[ ! -e ${work_dir}/dual/iso/${install_dir}/any/core-any-pkgs.sfs || - ! -e ${work_dir}/dual/iso/${install_dir}/i686/core-pkgs.sfs || - ! -e ${work_dir}/dual/iso/${install_dir}/x86_64/core-pkgs.sfs ]]; then + if [[ ! -e ${work_dir}/dual/iso/${install_dir}/any/repo-core-any.sfs || + ! -e ${work_dir}/dual/iso/${install_dir}/i686/repo-core-i686.sfs || + ! -e ${work_dir}/dual/iso/${install_dir}/x86_64/repo-core-x86_64.sfs ]]; then echo "ERROR: core_iso_single build is not found." _usage 1 fi else - rm -f ${work_dir}/dual/iso/${install_dir}/any/core-any-pkgs.sfs - rm -f ${work_dir}/dual/iso/${install_dir}/i686/core-pkgs.sfs - rm -f ${work_dir}/dual/iso/${install_dir}/x86_64/core-pkgs.sfs + rm -f ${work_dir}/dual/iso/${install_dir}/any/repo-core-any.sfs + rm -f ${work_dir}/dual/iso/${install_dir}/i686/repo-core-i686.sfs + rm -f ${work_dir}/dual/iso/${install_dir}/x86_64/repo-core-x86_64.sfs fi - paste -d"\n" <(sed "s|%ARCH%|i686|g" aitab.${_iso_type}) \ - <(sed "s|%ARCH%|x86_64|g" aitab.${_iso_type}) | uniq > ${work_dir}/dual/iso/${install_dir}/aitab - for _cfg in syslinux.dual/*.cfg; do + paste -d"\n" <(sed "s|%ARCH%|i686|g" ${script_path}/aitab.${_iso_type}) \ + <(sed "s|%ARCH%|x86_64|g" ${script_path}/aitab.${_iso_type}) | uniq > ${work_dir}/dual/iso/${install_dir}/aitab + for _cfg in ${script_path}/syslinux.dual/*.cfg; do sed "s|%ARCHISO_LABEL%|${iso_label}|g; s|%INSTALL_DIR%|${install_dir}|g" ${_cfg} > ${work_dir}/dual/iso/${install_dir}/boot/syslinux/${_cfg##*/} done + mkarchiso ${verbose} checksum "${work_dir}/dual" mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}/dual" "${name}-${version}-${_iso_type}-dual.iso" : > ${work_dir}/dual/build.${FUNCNAME}_${_iso_type} fi @@ -216,8 +221,8 @@ make_dual() { _usage () { - echo "usage ${0##*/} net_iso_single | core_iso_single | all_iso_single | clean_single" - echo " net_iso_dual | core_iso_dual | all_iso_dual | clean_dual" + echo "usage ${0##*/} net_iso_single | core_iso_single | all_iso_single | purge_single | clean_single" + echo " net_iso_dual | core_iso_dual | all_iso_dual | purge_dual | clean_dual" echo exit ${1} } @@ -281,6 +286,20 @@ case "${command_name}" in make_dual netinstall make_dual core ;; + purge_single) + if [[ -d ${work_dir} ]]; then + find ${work_dir} -mindepth 1 -maxdepth 1 \ + ! -path ${work_dir}/iso -prune \ + | xargs rm -rf + fi + ;; + purge_dual) + if [[ -d ${work_dir}/dual ]]; then + find ${work_dir}/dual -mindepth 1 -maxdepth 1 \ + ! -path ${work_dir}/dual/iso -prune \ + | xargs rm -rf + fi + ;; clean_single) rm -rf ${work_dir} rm -f ${name}-${version}-*-${arch}.iso diff --git a/configs/releng/root-image/etc/fstab b/configs/releng/root-image/etc/fstab deleted file mode 100644 index 0df0cba..0000000 --- a/configs/releng/root-image/etc/fstab +++ /dev/null @@ -1,5 +0,0 @@ -# -# /etc/fstab: static file system information -# -# <file system> <dir> <type> <options> <dump> <pass> -/dev/mapper/root-image / auto defaults 0 0 diff --git a/configs/releng/root-image/etc/rc.d/archiso b/configs/releng/root-image/etc/rc.d/archiso index 68e8375..cc930f6 100755 --- a/configs/releng/root-image/etc/rc.d/archiso +++ b/configs/releng/root-image/etc/rc.d/archiso @@ -16,20 +16,24 @@ do_locale_gen () # start agetty on it too. do_special_console() { - cmdline_console="$(kernel_cmdline console)" - [ $? -ne 0 ] && return - - dev="${cmdline_console%%,*}" - args="${cmdline_console##*,}" - baud="${args%%[neo]*}" && baud="${baud:-"9600"}" - [ "x${args}" != "x${args%%r}" ] && rts="-h" - - - stat_busy "Starting agetty on console: ${cmdline_console}" - echo "${dev}" >> /etc/securetty - echo "z0:2345:respawn:/sbin/agetty ${rts} ${baud} ${dev} linux" >> /etc/inittab - /sbin/telinit q - stat_done + local cmdline_console + if cmdline_console=$(kernel_cmdline console); then + stat_busy "Starting agetty on console: ${cmdline_console}" + local port options baud rts + port=${cmdline_console%%,*} + options=${cmdline_console#${port}} + options=${options#,} + baud=${options%%[neo]*} + [[ ${options} =~ r$ ]] && rts="-h" + if ! grep -q "^${port}" /etc/securetty; then + echo ${port} >> /etc/securetty + fi + if ! grep -q "^z0:" /etc/inittab; then + echo "z0:2345:respawn:/sbin/agetty -8 -s ${rts} ${baud:-9600} ${port} linux" >> /etc/inittab + fi + /sbin/telinit q + stat_done + fi } case "$1" in diff --git a/configs/releng/syslinux.dual/syslinux_arch32.cfg b/configs/releng/syslinux.dual/syslinux_arch32.cfg index e2575ae..d6180f6 100644 --- a/configs/releng/syslinux.dual/syslinux_arch32.cfg +++ b/configs/releng/syslinux.dual/syslinux_arch32.cfg @@ -4,7 +4,7 @@ Boot the Parabola (i686) live medium. It allows you to install a fully libre Arch Linux or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola (i686) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz26 +LINUX /%INSTALL_DIR%/boot/i686/vmlinuz INITRD /%INSTALL_DIR%/boot/i686/libreiso.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% # Next line should be uncommented when prepare enviroment to boot from PXE. diff --git a/configs/releng/syslinux.dual/syslinux_arch64.cfg b/configs/releng/syslinux.dual/syslinux_arch64.cfg index e38e984..64f2269 100644 --- a/configs/releng/syslinux.dual/syslinux_arch64.cfg +++ b/configs/releng/syslinux.dual/syslinux_arch64.cfg @@ -4,7 +4,7 @@ Boot the Parabola (x86_64) live medium. It allows you to install a fully libre Arch Linux or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola (x86_64) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz26 +LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz INITRD /%INSTALL_DIR%/boot/x86_64/libreiso.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% # Next line should be uncommented when prepare enviroment to boot from PXE. diff --git a/configs/releng/syslinux/syslinux.cfg b/configs/releng/syslinux/syslinux.cfg index 3d54c40..14f48e6 100644 --- a/configs/releng/syslinux/syslinux.cfg +++ b/configs/releng/syslinux/syslinux.cfg @@ -33,7 +33,7 @@ Boot the Parabola live medium. It allows you to install a fully libre Arch Linux or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola GNU/Linux-libre -LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz26 +LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz INITRD /%INSTALL_DIR%/boot/%ARCH%/libreiso.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% # Next line should be uncommented when prepare enviroment to boot from PXE. |