3 ## live-build(7) - System Build Scripts
4 ## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
6 ## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7 ## This is free software, and you are welcome to redistribute it
8 ## under certain conditions; see COPYING for details.
13 # Including common functions
14 [ -e "${LIVE_BUILD}/scripts/build.sh" ] && .
"${LIVE_BUILD}/scripts/build.sh" || .
/usr
/lib
/live
/build.sh
16 # Setting static variables
18 DESCRIPTION
="$(Echo 'create configuration for live-build(7)')"
19 USAGE
="${PROGRAM} [--apt apt|aptitude]\n\
20 \t [--apt-ftp-proxy URL]\n\
21 \t [--apt-http-proxy URL]\n\
22 \t [--apt-indices true|false]\n\
23 \t [--apt-options OPTION|\"OPTIONS\"]\n\
24 \t [--aptitude-options OPTION|\"OPTIONS\"]\n\
25 \t [--apt-pipeline DEPTH]\n\
26 \t [--apt-recommends true|false]\n\
27 \t [--apt-secure true|false]\n\
28 \t [--apt-source-archives true|false]\n\
29 \t [-a|--architectures ARCHITECTURE]\n\
30 \t [-b|--binary-images iso|iso-hybrid|netboot|tar|hdd]\n\
31 \t [--binary-filesystem fat16|fat32|ext2|ext3|ext4|ntfs]\n\
32 \t [--bootappend-install PARAMETER|\"PARAMETERS\"]\n\
33 \t [--bootappend-live PARAMETER|\"PARAMETERS\"]\n\
34 \t [--bootappend-live-failsafe PARAMETER|\"PARAMETERS\"]\n\
35 \t [--bootloader grub|syslinux]\n\
36 \t [--bootstrap cdebootstrap|cdebootstrap-static|debootstrap]\n\
37 \t [--cache true|false]\n\
38 \t [--cache-indices true|false]\n\
39 \t [--cache-packages true|false]\n\
40 \t [--cache-stages STAGE|\"STAGES\"]\n\
41 \t [--checksums md5|sha1|sha256|sha512|none]\n\
42 \t [--compression bzip2|gzip|lzip|xz|none]\n\
43 \t [--config GIT_URL::GIT_BRANCH]\n\
44 \t [--zsync true|false]\n\
45 \t [--build-with-chroot true|false]\n\
46 \t [--chroot-filesystem ext2|ext3|ext4|squashfs|jffs2|none]\n\
48 \t [-c|--conffile FILE]\n\
49 \t [--debconf-frontend dialog|editor|noninteractive|readline]\n\
50 \t [--debconf-priority low|medium|high|critical]\n\
51 \t [--debian-installer true|cdrom|netinst|netboot|businesscard|live|false]\n\
52 \t [--debian-installer-distribution daily|CODENAME]\n\
53 \t [--debian-installer-preseedfile FILE|URL]\n\
54 \t [--debian-installer-gui true|false]\n\
56 \t [-d|--distribution CODENAME]\n\
57 \t [--parent-distribution CODENAME]\n\
58 \t [--parent-debian-installer-distribution CODENAME]\n\
60 \t [--fdisk fdisk|fdisk.dist]\n\
62 \t [--grub-splash FILE]\n\
63 \t [--gzip-options OPTION|\"OPTIONS\"]\n\
65 \t [--ignore-system-defaults]\n\
66 \t [--initramfs auto|none|live-boot|casper]\n\
67 \t [--initramfs-compression bzip2|gzip|lzma]\n\
68 \t [--initsystem sysvinit|runit|systemd|upstart|none]\n\
69 \t [--image-name [NAME]\n\
70 \t [--interactive shell]\n\
71 \t [--isohybrid-options OPTION|\"OPTIONS\"]\n\
72 \t [--hdd-label LABEL]\n\
74 \t [--iso-application NAME]\n\
75 \t [--iso-preparer NAME]\n\
76 \t [--iso-publisher NAME]\n\
77 \t [--iso-volume NAME]\n\
78 \t [--jffs2-eraseblock SIZE]\n\
79 \t [--keyring-packages PACKAGE|\"PACKAGES\"]\n\
80 \t [-k|--linux-flavours FLAVOUR|\"FLAVOURS\"]\n\
81 \t [--linux-packages \"PACKAGES\"]\n\
82 \t [--losetup losetup|losetup.orig]\n\
83 \t [--memtest memtest86+|memtest86|none]\n\
84 \t [-m|--parent-mirror-bootstrap URL]\n\
85 \t [--parent-mirror-chroot URL]\n\
86 \t [--parent-mirror-chroot-security URL]\n\
87 \t [--parent-mirror-binary URL]\n\
88 \t [--parent-mirror-binary-security URL]\n\
89 \t [--parent-mirror-debian-installer URL]\n\
90 \t [--mirror-bootstrap URL]\n\
91 \t [--mirror-chroot URL]\n\
92 \t [--mirror-chroot-security URL]\n\
93 \t [--mirror-binary URL]\n\
94 \t [--mirror-binary-security URL]\n\
95 \t [--mirror-debian-installer URL]\n\
96 \t [--mode debian|ubuntu]\n\
97 \t [--system live|normal]\n\
98 \t [--net-root-filesystem nfs|cfs]\n\
99 \t [--net-root-mountoptions OPTIONS]\n\
100 \t [--net-root-path PATH]\n\
101 \t [--net-root-server IP|HOSTNAME]\n\
102 \t [--net-cow-filesystem nfs|cfs]\n\
103 \t [--net-cow-mountoptions OPTIONS]\n\
104 \t [--net-cow-path PATH]\n\
105 \t [--net-cow-server IP|HOSTNAME]\n\
106 \t [--net-tarball true|false]\n\
108 \t [--archives ARCHIVE|\"ARCHIVES\"]\n\
109 \t [--archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\
110 \t [--parent-archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\
111 \t [--security true|false]\n\
112 \t [--source true|false]\n\
113 \t [-s|--source-images iso|netboot|tar|hdd]\n\
114 \t [--firmware-binary true|false]\n\
115 \t [--firmware-chroot true|false]\n\
116 \t [--swap-file-path PATH]\n\
117 \t [--swap-file-size MB]\n\
118 \t [--tasksel apt|aptitude|tasksel]\n\
119 \t [--templates PATH]\n\
120 \t [--updates true|false]\n\
121 \t [--backports true|false]\n\
122 \t [--exposed-root true|false]\n\
124 \t [--loadlin true|false]\n\
125 \t [--win32-loader true|false]\n\
126 \t [--bootstrap-qemu-exclude PACKAGES]\n\
127 \t [--bootstrap-qemu-static PATH]\n\
128 \t [--bootstrap-qemu-arch ARCH]"
133 LONG_OPTIONS
="apt:,apt-ftp-proxy:,apt-http-proxy:,apt-options:,aptitude-options:,debootstrap-options:,cdebootstrap-options:,
134 apt-pipeline:,apt-recommends:,apt-secure:,apt-source-archives:,bootstrap:,cache:,cache-indices:,cache-packages:,
135 cache-stages:,debconf-frontend:,debconf-priority:,dump,
136 initramfs:,initramfs-compression:,initsystem:,fdisk:,losetup:,mode:,system:,tasksel:,
137 templates:,architectures:,clean,
138 distribution:,parent-distribution:,parent-debian-installer-distribution:,parent-mirror-bootstrap:,parent-mirror-chroot:,parent-mirror-chroot-security:,parent-mirror-binary:,
139 parent-mirror-binary-security:,parent-mirror-debian-installer:,
140 mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-binary:,
141 mirror-binary-security:,mirror-debian-installer:,
142 archives:,archive-areas:,parent-archive-areas:,chroot-filesystem:,exposed-root:,
143 gzip-options:,hooks:,image-name:,interactive:,keyring-packages:,linux-flavours:,linux-packages:,
144 security:,updates:,backports:,binary-filesystem:,binary-images:,
145 apt-indices:,bootappend-install:,bootappend-live:,bootappend-live-failsafe:,bootloader:,checksums:,compression:,config:,zsync:,build-with-chroot:,
146 debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:,
147 grub-splash:,isohybrid-options:,hdd-label:,hdd-size:,iso-application:,iso-preparer:,iso-publisher:,
148 iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:,
149 net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,
150 net-cow-server:,net-tarball:,firmware-binary:,firmware-chroot:,swap-file-path:,swap-file-size:,
151 loadlin:,win32-loader:,source:,source-images:,breakpoints,conffile:,debug,force,
152 help,ignore-system-defaults,quiet,usage,verbose,version,bootstrap-qemu-static:,bootstrap-qemu-arch:,
153 bootstrap-qemu-exclude:"
154 # Remove spaces added by indentation
155 LONG_OPTIONS
="$(echo ${LONG_OPTIONS} | tr -d ' ')"
156 ARGUMENTS
="$(getopt --longoptions ${LONG_OPTIONS} --name="${PROGRAM}" --options a:f:d:m:l:k:p:b:e:s:c:huv --shell sh -- "${@}")"
160 Echo_error "terminating
" >&2
164 eval set -- "${ARGUMENTS}"
171 if [ -x "$
(which dpkg-query
2>/dev
/null
)" ]
173 VERSION_DPKG="$
(dpkg-query
-f='${Version}' --show live-build
)"
176 Echo "%s
: This is live-build version
%s
" "${0}" "${VERSION_DPKG:-${VERSION}}"
178 # Dump conffile contents
179 Print_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
181 # Dump contents of directories that contain text files
182 for DIRECTORY in config/package-lists config/apt config/preseed config/rootfs
184 if Find_files "${DIRECTORY}"
186 Echo_file "${DIRECTORY}"/*
190 # Dump directory listings of all directories under config/
191 for DIRECTORY in $(find config/ -mindepth 1 -maxdepth 1 -type d)
193 if Find_files "${DIRECTORY}"
195 ls -lR "${DIRECTORY}" | while read LINE
197 echo "${DIRECTORY}: ${LINE}"
217 LB_APT_FTP_PROXY="${2}"
222 LB_APT_HTTP_PROXY="${2}"
227 LB_APT_INDICES="${2}"
237 APTITUDE_OPTIONS="${2}"
242 LB_APT_PIPELINE="${2}"
247 LB_APT_RECOMMENDS="${2}"
256 --apt-source-archives)
257 LB_APT_SOURCE_ARCHIVES="${2}"
266 --debootstrap-options)
267 DEBOOTSTRAP_OPTIONS="${2}"
271 --cdebootstrap-options)
272 CDEBOOTSTRAP_OPTIONS="${2}"
282 LB_CACHE_INDICES="${2}"
287 LB_CACHE_PACKAGES="${2}"
292 LB_CACHE_STAGES="${2}"
297 LB_DEBCONF_FRONTEND="${2}"
302 LB_DEBCONF_PRIORITY="${2}"
311 --initramfs-compression)
312 LB_INITRAMFS_COMPRESSION="${2}"
353 LIVE_IMAGE_ARCHITECTURE="${2}"
358 LB_DISTRIBUTION="${2}"
362 --parent-distribution)
363 LB_PARENT_DISTRIBUTION="${2}"
367 -m|--parent-mirror-bootstrap)
368 LB_PARENT_MIRROR_BOOTSTRAP="${2}"
372 --parent-mirror-chroot)
373 LB_PARENT_MIRROR_CHROOT="${2}"
377 --parent-mirror-chroot-security)
378 LB_PARENT_MIRROR_CHROOT_SECURITY="${2}"
382 --parent-mirror-binary)
383 LB_PARENT_MIRROR_BINARY="${2}"
387 --parent-mirror-binary-security)
388 LB_PARENT_MIRROR_BINARY_SECURITY="${2}"
392 --parent-mirror-debian-installer)
393 LB_PARENT_MIRROR_DEBIAN_INSTALLER="${2}"
398 LB_MIRROR_BOOTSTRAP="${2}"
403 LB_MIRROR_CHROOT="${2}"
407 --mirror-chroot-security)
408 LB_MIRROR_CHROOT_SECURITY="${2}"
413 LB_MIRROR_BINARY="${2}"
417 --mirror-binary-security)
418 LB_MIRROR_BINARY_SECURITY="${2}"
422 --mirror-debian-installer)
423 LB_MIRROR_DEBIAN_INSTALLER="${2}"
433 LIVE_IMAGE_ARCHIVE_AREAS="${2}"
437 --parent-archive-areas)
438 LIVE_IMAGE_PARENT_ARCHIVE_AREAS="${2}"
444 LB_CHROOT_FILESYSTEM="${2}"
449 LB_EXPOSED_ROOT="${2}"
464 LIVE_IMAGE_NAME="${2}"
469 LB_INTERACTIVE="${2}"
474 LB_KEYRING_PACKAGES="${2}"
479 LB_LINUX_FLAVOURS="${2}"
484 LB_LINUX_PACKAGES="${2}"
505 LB_BINARY_FILESYSTEM="${2}"
510 LIVE_IMAGE_TYPE="${2}"
515 LB_BOOTAPPEND_LIVE="${2}"
519 --bootappend-live-failsafe)
520 LB_BOOTAPPEND_LIVE_FAILSAFE="${2}"
524 --bootappend-install)
525 LB_BOOTAPPEND_INSTALL="${2}"
540 LB_COMPRESSION="${2}"
555 LB_BUILD_WITH_CHROOT="${2}"
560 LB_DEBIAN_INSTALLER="${2}"
564 --debian-installer-distribution)
565 LB_DEBIAN_INSTALLER_DISTRIBUTION="${2}"
569 --parent-debian-installer-distribution)
570 LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${2}"
574 --debian-installer-preseedfile)
575 LB_DEBIAN_INSTALLER_PRESEEDFILE="${2}"
579 --debian-installer-gui)
580 LB_DEBIAN_INSTALLER_GUI="${2}"
585 LB_GRUB_SPLASH="${2}"
590 LB_ISOHYBRID_OPTIONS="${2}"
605 LB_ISO_APPLICATION="${2}"
610 LB_ISO_PREPARER="${2}"
615 LB_ISO_PUBLISHER="${2}"
625 LB_JFFS2_ERASEBLOCK="${2}"
634 --net-root-filesystem)
635 LB_NET_ROOT_FILESYSTEM="${2}"
639 --net-root-mountoptions)
640 LB_NET_ROOT_MOUNTOPTIONS="${2}"
645 LB_NET_ROOT_PATH="${2}"
650 LB_NET_ROOT_SERVER="${2}"
654 --net-cow-filesystem)
655 LB_NET_COW_FILESYSTEM="${2}"
659 --net-cow-mountoptions)
660 LB_NET_COW_MOUNTOPTIONS="${2}"
665 LB_NET_COW_PATH="${2}"
670 LB_NET_COW_SERVER="${2}"
675 LB_NET_TARBALL="${2}"
680 LB_FIRMWARE_BINARY="${2}"
685 LB_FIRMWARE_CHROOT="${2}"
690 LB_SWAP_FILE_PATH="${2}"
695 LB_SWAP_FILE_SIZE="${2}"
705 LB_WIN32_LOADER="${2}"
709 --bootstrap-qemu-arch)
710 LB_BOOTSTRAP_QEMU_ARCHITECTURES="${2}"
714 --bootstrap-qemu-exclude)
715 LB_BOOTSTRAP_QEMU_EXCLUDE="${2}"
719 --bootstrap-qemu-static)
720 LB_BOOTSTRAP_QEMU_STATIC="${2}"
731 LB_SOURCE_IMAGES="${2}"
766 --ignore-system-defaults)
796 Echo_error "internal error
%s
" "${0}"
803 Local_arguments "${@}"
805 if [ -e .git ] && [ -n "${_CONFIG}" ]
807 if [ "${1}" != "noauto
" ]
809 Echo_message "Ignoring
--config ${_CONFIG}: ${PWD} is already a git repository
"
815 if [ -e .build/config ] && [ -n "${_CONFIG}" ]
817 if [ "${1}" != "noauto
" ]
819 Echo_message "Ignoring
--config ${_CONFIG}: ${PWD} is already a live-build configuration tree
"
825 if [ -n "${_CONFIG}" ]
827 if [ -e "${_CONFIG}" ] || [ -e "/usr
/share
/live
/images
/${_CONFIG}" ]
829 if [ ! -e "${_CONFIG}" ] && [ -e "/usr
/share
/live
/images
/${_CONFIG}" ]
831 _CONFIG="/usr
/share
/live
/images
/${_CONFIG}"
834 Echo_message "Copying
${_CONFIG}"
835 tar -C "${_CONFIG}" -c . | tar -C ./ -x
837 _GIT_REPOSITORY="$
(echo ${_CONFIG} |
sed -e 's|::.*$||')"
839 Echo_message "Cloning
${_GIT_REPOSITORY}"
840 git clone ${_GIT_REPOSITORY} ./
842 if [ "${_GIT_REPOSITORY}" != "${_CONFIG}" ]
844 _GIT_BRANCH="$
(echo ${_CONFIG} |
awk -F\
:\
: '{ print $NF }')"
846 Echo_message "Checking out
${_GIT_BRANCH}"
847 git checkout ${_GIT_BRANCH}
851 if [ -e auto/config ]
853 _EXTRA_OPTIONS="$
(echo ${@} | sed -e "s|--config ${_GIT_REPOSITORY}::${_GIT_BRANCH}||g" -e "s|--config ${_GIT_REPOSITORY}||g
")"
855 Echo_message
"The following extra options specified to lb config are going to be added to auto/config: ${_EXTRA_OPTIONS}"
856 sed -i -e "s|\"\${@}\"|${_EXTRA_OPTIONS} \"\${@}\"|" auto
/config
861 if [ "${1}" != "noauto" ] && [ -x auto
/config
]
863 Echo_message
"Executing auto/config script."
868 if [ "${1}" = "noauto" ]
873 # Reading system configuration
874 if ls /etc
/live
/build.conf
> /dev
/null
2>&1 ||
ls /etc
/live
/build
/* > /dev
/null
2>&1
876 if In_list
"--ignore-system-defaults" "${@}"
878 Echo_message
"Ignoring defaults in %s" "/etc/live/build.conf"
880 Echo_message
"Using defaults in %s" "/etc/live/build.conf"
882 Read_conffiles
/etc
/live
/build.conf
/etc
/live
/build
/*
886 # Reading existing configuration
887 Read_conffiles config
/all config
/common config
/bootstrap config
/chroot config
/binary config
/source
889 Local_arguments
"${@}"
891 if [ -n "${_CONFFILE}" ]
893 Read_conffiles
"${_CONFFILE}"
904 Echo_message
"Creating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LIVE_IMAGE_ARCHITECTURE} system"
906 Echo_message
"Updating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LIVE_IMAGE_ARCHITECTURE} system"
909 # Creating bootstrap configuration
911 mkdir
-p config
/includes
913 # Creating live-build configuration
914 cat > config
/common
<< EOF
915 # config/common - common options for live-build(7)
917 # \$LB_APT: set package manager
918 # (Default: ${LB_APT})
921 # \$LB_APT_FTP_PROXY: set apt/aptitude ftp proxy
922 # (Default: autodetected or empty)
923 LB_APT_FTP_PROXY="${LB_APT_FTP_PROXY}"
925 # \$LB_APT_HTTP_PROXY: set apt/aptitude http proxy
926 # (Default: autodetected or empty)
927 LB_APT_HTTP_PROXY="${LB_APT_HTTP_PROXY}"
929 # \$LB_APT_PIPELINE: set apt/aptitude pipeline depth
930 # (Default: ${LB_APT_PIPELINE})
931 LB_APT_PIPELINE="${LB_APT_PIPELINE}"
933 # \$LB_APT_RECOMMENDS: set apt/aptitude recommends
934 # (Default: ${LB_APT_RECOMMENDS})
935 LB_APT_RECOMMENDS="${LB_APT_RECOMMENDS}"
937 # \$LB_APT_SECURE: set apt/aptitude security
938 # (Default: ${LB_APT_SECURE})
939 LB_APT_SECURE="${LB_APT_SECURE}"
941 # \$LB_APT_SOURCE_ARCHIVES: set apt/aptitude source entries in sources.list
942 # (Default: ${LB_APT_SOURCE_ARCHIVES})
943 LB_APT_SOURCE_ARCHIVES="${LB_APT_SOURCE_ARCHIVES}"
945 # \$LB_BOOTSTRAP: set bootstrap program
946 # (Default: ${LB_BOOTSTRAP})
947 LB_BOOTSTRAP="${LB_BOOTSTRAP}"
949 # \$LB_CACHE: control cache
950 # (Default: ${LB_CACHE})
951 LB_CACHE="${LB_CACHE}"
953 # \$LB_CACHE_INDICES: control if downloaded package indices should be cached
954 # (Default: ${LB_CACHE_INDICES})
955 LB_CACHE_INDICES="${LB_CACHE_INDICES}"
957 # \$LB_CACHE_PACKAGES: control if downloaded packages files should be cached
958 # (Default: ${LB_CACHE_PACKAGES})
959 LB_CACHE_PACKAGES="${LB_CACHE_PACKAGES}"
961 # \$LB_CACHE_STAGES: control if completed stages should be cached
962 # (Default: ${LB_CACHE_STAGES})
963 LB_CACHE_STAGES="${LB_CACHE_STAGES}"
965 # \$LB_DEBCONF_FRONTEND: set debconf(1) frontend to use
966 # (Default: ${LB_DEBCONF_FRONTEND})
967 LB_DEBCONF_FRONTEND="${LB_DEBCONF_FRONTEND}"
969 # \$LB_DEBCONF_PRIORITY: set debconf(1) priority to use
970 # (Default: ${LB_DEBCONF_PRIORITY})
971 LB_DEBCONF_PRIORITY="${LB_DEBCONF_PRIORITY}"
973 # \$LB_INITRAMFS: set initramfs hook
974 # (Default: ${LB_INITRAMFS})
975 LB_INITRAMFS="${LB_INITRAMFS}"
977 # \$LB_INITRAMFS_COMPRESSION: set initramfs compression
978 # (Default: ${LB_INITRAMFS_COMPRESSION})
979 LB_INITRAMFS_COMPRESSION="${LB_INITRAMFS_COMPRESSION}"
981 # \$LB_INITSYSTEM: set init system
982 # (Default: ${LB_INITSYSTEM})
983 LB_INITSYSTEM="${LB_INITSYSTEM}"
985 # \$LB_FDISK: set fdisk program
986 # (Default: autodetected)
987 LB_FDISK="${LB_FDISK}"
989 # \$LB_LOSETUP: set losetup program
990 # (Default: autodetected)
991 LB_LOSETUP="${LB_LOSETUP}"
993 # \$LB_MODE: set distribution mode
994 # (Default: ${LB_MODE})
997 # \$LB_SYSTEM: set system type
998 # (Default: ${LB_SYSTEM})
999 LB_SYSTEM="${LB_SYSTEM}"
1001 # \$LB_TASKSEL: set tasksel program
1002 # (Default: ${LB_TASKSEL})
1003 LB_TASKSEL="${LB_TASKSEL}"
1005 # \$LB_TEMPLATES: set templates
1006 # (Default: ${LB_TEMPLATES})
1007 LB_TEMPLATES="${LB_TEMPLATES}"
1009 # live-build options
1011 # \$_BREAKPOINTS: enable breakpoints
1012 # (Default: ${_BREAKPOINTS})
1013 #_BREAKPOINTS="${_BREAKPOINTS}"
1015 # \$_DEBUG: enable debug
1016 # (Default: ${_DEBUG})
1019 # \$_COLOR: enable color
1020 # (Default: ${_COLOR})
1023 # \$_FORCE: enable force
1024 # (Default: ${_FORCE})
1027 # \$_QUIET: enable quiet
1028 # (Default: ${_QUIET})
1031 # \$_VERBOSE: enable verbose
1032 # (Default: ${_VERBOSE})
1033 #_VERBOSE="${_VERBOSE}"
1035 # Internal stuff (FIXME)
1036 APT_OPTIONS="${APT_OPTIONS}"
1037 APTITUDE_OPTIONS="${APTITUDE_OPTIONS}"
1038 DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS}"
1039 CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS}"
1040 GZIP_OPTIONS="${GZIP_OPTIONS}"
1041 ISOHYBRID_OPTIONS="${ISOHYBRID_OPTIONS}"
1044 # Creating lb_bootstrap_* configuration
1045 cat > config
/bootstrap
<< EOF
1046 # config/bootstrap - options for live-build(7), bootstrap stage
1048 # \$LB_DISTRIBUTION: select distribution to use
1049 # (Default: ${LB_DISTRIBUTION})
1050 LB_DISTRIBUTION="${LB_DISTRIBUTION}"
1052 # \$LB_PARENT_DISTRIBUTION: select parent distribution to use
1053 # (Default: ${LB_PARENT_DISTRIBUTION})
1054 LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION}"
1056 # \$LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION: select parent distribution for debian-installer to use
1057 # (Default: ${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION})
1058 LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}"
1060 # \$LB_PARENT_MIRROR_BOOTSTRAP: set parent mirror to bootstrap from
1061 # (Default: ${LB_PARENT_MIRROR_BOOTSTRAP})
1062 LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP}"
1064 # \$LB_PARENT_MIRROR_CHROOT: set parent mirror to fetch packages from
1065 # (Default: ${LB_PARENT_MIRROR_CHROOT})
1066 LB_PARENT_MIRROR_CHROOT="${LB_PARENT_MIRROR_CHROOT}"
1068 # \$LB_PARENT_MIRROR_CHROOT_SECURITY: set security parent mirror to fetch packages from
1069 # (Default: ${LB_PARENT_MIRROR_CHROOT_SECURITY})
1070 LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY}"
1072 # \$LB_PARENT_MIRROR_BINARY: set parent mirror which ends up in the image
1073 # (Default: ${LB_PARENT_MIRROR_BINARY})
1074 LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY}"
1076 # \$LB_PARENT_MIRROR_BINARY_SECURITY: set security parent mirror which ends up in the image
1077 # (Default: ${LB_PARENT_MIRROR_BINARY_SECURITY})
1078 LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY}"
1080 # \$LB_PARENT_MIRROR_DEBIAN_INSTALLER: set debian-installer parent mirror
1081 # (Default: ${LB_PARENT_MIRROR_BOOTSTRAP})
1082 LB_PARENT_MIRROR_DEBIAN_INSTALLER="${LB_PARENT_MIRROR_DEBIAN_INSTALLER}"
1084 # \$LB_MIRROR_BOOTSTRAP: set mirror to bootstrap from
1085 # (Default: ${LB_MIRROR_BOOTSTRAP})
1086 LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP}"
1088 # \$LB_MIRROR_CHROOT: set mirror to fetch packages from
1089 # (Default: ${LB_MIRROR_CHROOT})
1090 LB_MIRROR_CHROOT="${LB_MIRROR_CHROOT}"
1092 # \$LB_MIRROR_CHROOT_SECURITY: set security mirror to fetch packages from
1093 # (Default: ${LB_MIRROR_CHROOT_SECURITY})
1094 LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY}"
1096 # \$LB_MIRROR_BINARY: set mirror which ends up in the image
1097 # (Default: ${LB_MIRROR_BINARY})
1098 LB_MIRROR_BINARY="${LB_MIRROR_BINARY}"
1100 # \$LB_MIRROR_BINARY_SECURITY: set security mirror which ends up in the image
1101 # (Default: ${LB_MIRROR_BINARY_SECURITY})
1102 LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY}"
1104 # \$LB_MIRROR_DEBIAN_INSTALLER: set debian-installer mirror
1105 # (Default: ${LB_MIRROR_BOOTSTRAP})
1106 LB_MIRROR_DEBIAN_INSTALLER="${LB_MIRROR_DEBIAN_INSTALLER}"
1108 # \$LB_ARCHIVES: enable available third-party archives
1110 LB_ARCHIVES="${LB_ARCHIVES}"
1112 # \$LB_BOOTSTRAP_QEMU_ARCHITECTURES: architectures to use foreign bootstrap
1113 # (Default: ${LB_BOOTSTRAP_QEMU_ARCHITECTURES})
1114 LB_BOOTSTRAP_QEMU_ARCHITECTURES="${LB_BOOTSTRAP_QEMU_ARCHITECTURES}"
1116 # \$LB_BOOTSTRAP_QEMU_EXCLUDE: packages to exclude during foreign bootstrap
1117 # (Default: ${LB_BOOTSTRAP_QEMU_EXCLUDE})
1118 LB_BOOTSTRAP_QEMU_EXCLUDE="${LB_BOOTSTRAP_QEMU_EXCLUDE}"
1120 # \$LB_BOOTSTRAP_QEMU_STATIC: static qemu binary for foreign bootstrap
1121 # (Default: ${LB_BOOTSTRAP_QEMU_STATIC})
1122 LB_BOOTSTRAP_QEMU_STATIC="${LB_BOOTSTRAP_QEMU_STATIC}"
1125 # Creating lb_chroot_* configuration
1126 mkdir
-p config
/archives
1128 mkdir
-p config
/hooks
1129 mkdir
-p config
/includes.chroot
1130 mkdir
-p config
/packages
1131 mkdir
-p config
/packages.chroot
1132 mkdir
-p config
/package-lists
1133 mkdir
-p config
/preseed
1135 cat > config
/chroot
<< EOF
1136 # config/chroot - options for live-build(7), chroot stage
1138 # \$LB_CHROOT_FILESYSTEM: set chroot filesystem
1139 # (Default: ${LB_CHROOT_FILESYSTEM})
1140 LB_CHROOT_FILESYSTEM="${LB_CHROOT_FILESYSTEM}"
1142 # \$LB_UNION_FILESYSTEM: set union filesystem
1143 # (Default: ${LB_UNION_FILESYSTEM})
1144 LB_UNION_FILESYSTEM="${LB_UNION_FILESYSTEM}"
1146 # \$LB_EXPOSED_ROOT: expose root as read only
1147 # (Default: ${LB_EXPOSED_ROOT})
1148 LB_EXPOSED_ROOT="${LB_EXPOSED_ROOT}"
1150 # \$LB_HOOKS: set hook commands
1152 LB_HOOKS="${LB_HOOKS}"
1154 # \$LB_INTERACTIVE: set interactive build
1155 # (Default: ${LB_INTERACTIVE})
1156 LB_INTERACTIVE="${LB_INTERACTIVE}"
1158 # \$LB_KEYRING_PACKAGES: set keyring packages
1160 LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES}"
1162 # \$LB_LINUX_FLAVOURS: set kernel flavour to use
1163 # (Default: autodetected)
1164 LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS}"
1166 # \$LB_LINUX_PACKAGES: set kernel packages to use
1167 # (Default: autodetected)
1168 LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES}"
1170 # \$LB_SECURITY: enable security updates
1171 # (Default: ${LB_SECURITY})
1172 LB_SECURITY="${LB_SECURITY}"
1174 # \$LB_UPDATES: enable updates updates
1175 # (Default: ${LB_UPDATES})
1176 LB_UPDATES="${LB_UPDATES}"
1178 # \$LB_BACKPORTS: enable backports updates
1179 # (Default: ${LB_BACKPORTS})
1180 LB_BACKPORTS="${LB_BACKPORTS}"
1183 # Creating lb_binary_* configuration
1184 mkdir
-p config
/debian-installer
1185 mkdir
-p config
/includes.binary
1186 mkdir
-p config
/includes.debian-installer
1187 mkdir
-p config
/packages.binary
1188 mkdir
-p config
/package-lists
1189 mkdir
-p config
/rootfs
1191 cat > config
/binary
<< EOF
1192 # config/binary - options for live-build(7), binary stage
1194 # \$LB_BINARY_FILESYSTEM: set image filesystem
1195 # (Default: ${LB_BINARY_FILESYSTEM})
1196 LB_BINARY_FILESYSTEM="${LB_BINARY_FILESYSTEM}"
1198 # \$LB_APT_INDICES: set apt/aptitude generic indices
1199 # (Default: ${LB_APT_INDICES})
1200 LB_APT_INDICES="${LB_APT_INDICES}"
1202 # \$LB_BOOTAPPEND_LIVE: set boot parameters
1204 LB_BOOTAPPEND_LIVE="${LB_BOOTAPPEND_LIVE}"
1206 # \$LB_BOOTAPPEND_INSTALL: set boot parameters
1208 LB_BOOTAPPEND_INSTALL="${LB_BOOTAPPEND_INSTALL}"
1210 # \$LB_BOOTAPPEND_LIVE_FAILSAFE: set boot parameters
1212 LB_BOOTAPPEND_LIVE_FAILSAFE="${LB_BOOTAPPEND_LIVE_FAILSAFE}"
1214 # \$LB_BOOTLOADER: set bootloader
1215 # (Default: ${LB_BOOTLOADER})
1216 LB_BOOTLOADER="${LB_BOOTLOADER}"
1218 # \$LB_CHECKSUMS: set checksums
1219 # (Default: ${LB_CHECKSUMS})
1220 LB_CHECKSUMS="${LB_CHECKSUMS}"
1222 # \$LB_COMPRESSION: set compression
1223 # (Default: ${LB_COMPRESSION})
1224 LB_COMPRESSION="${LB_COMPRESSION}"
1226 # \$LB_ZSYNC: set zsync
1227 # (Default: ${LB_ZSYNC})
1228 LB_ZSYNC="${LB_ZSYNC}"
1230 # \${LB_BUILD_WITH_CHROOT: control if we build binary images chrooted
1231 # (Default: ${LB_BUILD_WITH_CHROOT})
1232 # DO NEVER, *NEVER*, *N*E*V*E*R* SET THIS OPTION to false.
1233 LB_BUILD_WITH_CHROOT="${LB_BUILD_WITH_CHROOT}"
1235 # \$LB_DEBIAN_INSTALLER: set debian-installer
1236 # (Default: ${LB_DEBIAN_INSTALLER})
1237 LB_DEBIAN_INSTALLER="${LB_DEBIAN_INSTALLER}"
1239 # \$LB_DEBIAN_INSTALLER_DISTRIBUTION: set debian-installer suite
1241 LB_DEBIAN_INSTALLER_DISTRIBUTION="${LB_DEBIAN_INSTALLER_DISTRIBUTION}"
1243 # \$LB_DEBIAN_INSTALLER_PRESEEDFILE: set debian-installer preseed filename/url
1244 # (Default: ${LB_DEBIAN_INSTALLER_PRESEEDFILE})
1245 LB_DEBIAN_INSTALLER_PRESEEDFILE="${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
1247 # \$LB_DEBIAN_INSTALLER_GUI: toggle use of GUI debian-installer
1248 # (Default: ${LB_DEBIAN_INSTALLER_GUI})
1249 LB_DEBIAN_INSTALLER_GUI="${LB_DEBIAN_INSTALLER_GUI}"
1251 # \$LB_GRUB_SPLASH: set custom grub splash
1253 LB_GRUB_SPLASH="${LB_GRUB_SPLASH}"
1255 # \$LB_HDD_LABEL: set hdd label
1256 # (Default: ${LB_HDD_LABEL})
1257 LB_HDD_LABEL="${LB_HDD_LABEL}"
1259 # \$LB_HDD_SIZE: set hdd filesystem size
1260 # (Default: ${LB_HDD_SIZE})
1261 LB_HDD_SIZE="${LB_HDD_SIZE}"
1263 # \$LB_ISO_APPLICATION: set iso author
1264 # (Default: ${LB_ISO_APPLICATION})
1265 LB_ISO_APPLICATION="${LB_ISO_APPLICATION}"
1267 # \$LB_ISO_PREPARER: set iso preparer
1268 # (Default: ${LB_ISO_PREPARER})
1269 LB_ISO_PREPARER="${LB_ISO_PREPARER}"
1271 # \$LB_ISO_PUBLISHER: set iso publisher
1272 # (Default: ${LB_ISO_PUBLISHER})
1273 LB_ISO_PUBLISHER="${LB_ISO_PUBLISHER}"
1275 # \$LB_ISO_VOLUME: set iso volume (max 32 chars)
1276 # (Default: ${LB_ISO_VOLUME})
1277 LB_ISO_VOLUME="${LB_ISO_VOLUME}"
1279 # \$LB_JFFS2_ERASEBLOCK: set jffs2 eraseblock size
1281 LB_JFFS2_ERASEBLOCK=""
1283 # \$LB_MEMTEST: set memtest
1284 # (Default: ${LB_MEMTEST})
1285 LB_MEMTEST="${LB_MEMTEST}"
1287 # \$LB_LOADLIN: set loadlin
1288 # (Default: ${LB_LOADLIN})
1289 LB_LOADLIN="${LB_LOADLIN}"
1291 # \$LB_WIN32_LOADER: set win32-loader
1292 # (Default: ${LB_WIN32_LOADER})
1293 LB_WIN32_LOADER="${LB_WIN32_LOADER}"
1295 # \$LB_NET_ROOT_FILESYSTEM: set netboot filesystem
1296 # (Default: ${LB_NET_ROOT_FILESYSTEM})
1297 LB_NET_ROOT_FILESYSTEM="${LB_NET_ROOT_FILESYSTEM}"
1299 # \$LB_NET_ROOT_MOUNTOPTIONS: set nfsopts
1301 LB_NET_ROOT_MOUNTOPTIONS="${LB_NET_ROOT_MOUNTOPTIONS}"
1303 # \$LB_NET_ROOT_PATH: set netboot server directory
1304 # (Default: ${LB_NET_ROOT_PATH})
1305 LB_NET_ROOT_PATH="${LB_NET_ROOT_PATH}"
1307 # \$LB_NET_ROOT_SERVER: set netboot server address
1308 # (Default: ${LB_NET_ROOT_SERVER})
1309 LB_NET_ROOT_SERVER="${LB_NET_ROOT_SERVER}"
1311 # \$LB_NET_COW_FILESYSTEM: set net client cow filesystem
1312 # (Default: ${LB_NET_COW_FILESYSTEM})
1313 LB_NET_COW_FILESYSTEM="${LB_NET_COW_FILESYSTEM}"
1315 # \$LB_NET_COW_MOUNTOPTIONS: set cow mount options
1317 LB_NET_COW_MOUNTOPTIONS="${LB_NET_COW_MOUNTOPTIONS}"
1319 # \$LB_NET_COW_PATH: set cow directory
1320 # (Default: ${LB_NET_COW_PATH})
1321 LB_NET_COW_PATH="${LB_NET_COW_PATH}"
1323 # \$LB_NET_COW_SERVER: set cow server
1324 # (Default: ${LB_NET_COW_SERVER})
1325 LB_NET_COW_SERVER="${LB_NET_COW_SERVER}"
1327 # \$LB_NET_TARBALL: set net tarball
1328 # (Default: ${LB_NET_TARBALL})
1329 LB_NET_TARBALL="${LB_NET_TARBALL}"
1331 # \$LB_FIRMWARE_BINARY: include firmware packages in debian-installer
1332 # (Default: ${LB_FIRMWARE_BINARY})
1333 LB_FIRMWARE_BINARY="${LB_FIRMWARE_BINARY}"
1335 # \$LB_FIRMWARE_CHROOT: include firmware packages in debian-installer
1336 # (Default: ${LB_FIRMWARE_CHROOT})
1337 LB_FIRMWARE_CHROOT="${LB_FIRMWARE_CHROOT}"
1339 # \$LB_SWAP_FILE_PATH: set swap file path
1340 # (Default: ${LB_SWAP_FILE_PATH})
1341 LB_SWAP_FILE_PATH="${LB_SWAP_FILE_PATH}"
1343 # \$LB_SWAP_FILE_SIZE: set swap file size
1344 # (Default: ${LB_SWAP_FILE_SIZE})
1345 LB_SWAP_FILE_SIZE="${LB_SWAP_FILE_SIZE}"
1348 # Creating lb_source_* configuration
1349 cat > config
/source << EOF
1350 # config/source - options for live-build(7), source stage
1352 # \$LB_SOURCE: set source option
1353 # (Default: ${LB_SOURCE})
1354 LB_SOURCE="${LB_SOURCE}"
1356 # \$LB_SOURCE_IMAGES: set image type
1357 # (Default: ${LB_SOURCE_IMAGES})
1358 LB_SOURCE_IMAGES="${LB_SOURCE_IMAGES}"
1364 # Checking defaults again
1367 if [ "${_CLEAN}" = "true" ]
1369 # Remove empty directories in config tree
1370 rmdir --ignore-fail-on-non-empty auto
> /dev
/null
2>&1 || true
1371 rmdir --ignore-fail-on-non-empty config
/*/ > /dev
/null
2>&1 || true
1372 rmdir --ignore-fail-on-non-empty config
> /dev
/null
2>&1 || true
1373 rmdir --ignore-fail-on-non-empty local
/*/ > /dev
/null
2>&1 || true
1374 rmdir --ignore-fail-on-non-empty local > /dev
/null
2>&1 || true
1377 # New style configuration
1378 Echo_warning
"WARNING: THIS VERSION OF LIVE-BUILD IS EXPERIMENTAL!"
1379 Echo_warning
"IT IS UNFINISHED AND CHANGES HEAVILY WITHOUT PRIOR NOTICE."
1380 Echo_warning
"USER DISCRETION IS ADVISED."
1382 if [ ! -e config
/image
]
1388 Set_configuration
"config/image" "Configuration-Version" "${LIVE_CONFIGURATION_VERSION}"
1389 [ "${_NEW_CONFIG}" = "true" ] && echo "" >> config
/image
1390 Set_configuration
"config/image" "Name" "${LIVE_IMAGE_NAME}"
1391 Set_configuration
"config/image" "Architecture" "${LIVE_IMAGE_ARCHITECTURE}"
1392 Set_configuration
"config/image" "Archive-Areas" "${LIVE_IMAGE_ARCHIVE_AREAS}"
1393 [ "${LB_DERIVATIVE}" = "true" ] && Set_configuration
"config/image" "Parent-Archive-Areas" "${LIVE_IMAGE_PARENT_ARCHIVE_AREAS}" # FIXME
1394 Set_configuration
"config/image" "Type" "${LIVE_IMAGE_TYPE}"
1396 # Creating stage file
1397 Create_stagefile .build
/config