mirror_style release download_style apt var-state force_md5 global LIBC := 'libc6' if test $ARCH = alpha { global LIBC := '"libc6.1'" } proc work_out_debs { global required := '"base-files base-passwd bash bsdutils debconf-tiny debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname ldso libc6 libdb2 libgdbmg1 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libpopt0 libreadline4 libstdc++2.10 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-5.005-base perl-base procps sed shellutils slang1 sysklogd sysvinit tar textutils update util-linux whiptail'" global base := '"adduser ae apt base-config elvis-tiny fbset fdutils gettext-base console-data console-tools console-tools-libs libdb2 libwrap0 locales modconf netbase ftp ppp pppconfig pump tasksel tcpd textutils telnet xviddetect'" proc without_package { echo $2 | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' } matchstr $ARCH { "alpha" { global required := ""$[without_package "libc6" $required] libc6.1"" } "i386" { global base := ""$base fdflush isapnptools lilo mbr pciutils pcmcia-cs psmisc setserial syslinux"" } * { # other arches may have special needs not yet represented here # oh well, Potato is old } } } proc first_stage_install { extract $required :> "$TARGET/var/lib/dpkg/status" echo > "$TARGET/var/lib/dpkg/available" setup_etc echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" proc x_feign_install { var pkg = $1 var deb = $[debfor $pkg] var ver = $[extract_deb_field "$TARGET/$deb" Version] mkdir -p "$TARGET/var/lib/dpkg/info" echo \ "Package: $pkg Version: $ver Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" touch "$TARGET/var/lib/dpkg/info/$(pkg).list" } setup_devices x_feign_install dpkg if test -e "$TARGET/usr/bin/perl-5.005.dist" { mv "$TARGET/usr/bin/perl-5.005.dist" "$TARGET/usr/bin/perl-5.005" } if test ! -e "$TARGET/usr/bin/perl" { ln -sf perl-5.005 "$TARGET/usr/bin/perl" } } proc second_stage_install { proc x_core_install { in_target dpkg --force-depends --install $[debfor @Argv] } export DEBIAN_FRONTEND=Noninteractive setup_proc ln "$TARGET/sbin/ldconfig.new" "$TARGET/sbin/ldconfig" in_target /sbin/ldconfig x_core_install base-files base-passwd ldso x_core_install dpkg ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" x_core_install $LIBC smallyes '' | x_core_install perl-5.005-base x_core_install mawk x_core_install debconf-tiny in_target dpkg-preconfigure $[debfor $required $base] repeatn 5 in_target dpkg --force-depends --unpack $[debfor $required] mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" cp "$TARGET/bin/true" "$TARGET/sbin/start-stop-daemon" setup_dselect_method apt in_target dpkg --configure --pending --force-configure-any --force-depends smallyes '' | repeatn 5 in_target dpkg --force-auto-select --force-overwrite --skip-same-version --install $[debfor $base] mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" } (CommandList children: [ (C {(mirror_style)} {(release)}) (C {(download_style)} {(apt)} {(var-state)}) (C {(force_md5)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:LIBC) op:Equal rhs:{(libc6)} spids:[13])] spids: [13] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$ARCH"))} {(Lit_Other "=")} {(alpha)} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:LIBC) op:Equal rhs:{(DQ (libc6.1))} spids:[34])] spids: [34] ) ] spids: [-1 31] ) ] spids: [-1 39] ) (FuncDef name: work_out_debs body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:required) op: Equal rhs: { (DQ ( "base-files base-passwd bash bsdutils debconf-tiny debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname ldso libc6 libdb2 libgdbmg1 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libpopt0 libreadline4 libstdc++2.10 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-5.005-base perl-base procps sed shellutils slang1 sysklogd sysvinit tar textutils update util-linux whiptail" ) ) } spids: [50] ) ] spids: [50] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:base) op: Equal rhs: { (DQ ( "adduser ae apt base-config elvis-tiny fbset fdutils gettext-base console-data console-tools console-tools-libs libdb2 libwrap0 locales modconf netbase ftp ppp pppconfig pump tasksel tcpd textutils telnet xviddetect" ) ) } spids: [57] ) ] spids: [57] ) (FuncDef name: without_package body: (BraceGroup children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Number "$2"))}) (C {(tr)} {(SQ <" ">)} {(SQ <"\\n">)}) (C {(grep)} {(-v)} {(DQ ("^") ($ VSub_Number "$1") (Lit_Other "$"))}) (C {(tr)} {(SQ <"\\n">)} {(SQ <" ">)}) ] negated: False ) ] spids: [69] ) spids: [64 68] ) (Case to_match: {($ VSub_Name "$ARCH")} arms: [ (case_arm pat_list: [{(DQ (alpha))}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:required) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(without_package)} {(DQ (libc6))} {(DQ ($ VSub_Name "$required"))} ) ] ) left_token: spids: [134 144] ) (" libc6.1") ) } spids: [132] ) ] spids: [132] ) ] spids: [127 129 149 -1] ) (case_arm pat_list: [{(DQ (i386))}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:base) op: Equal rhs: { (DQ ($ VSub_Name "$base") ( " fdflush isapnptools lilo mbr pciutils pcmcia-cs psmisc setserial syslinux" ) ) } spids: [158] ) ] spids: [158] ) ] spids: [153 155 165 -1] ) (case_arm pat_list:[{(Lit_Other "*")}] spids:[168169-1180]) ] spids: [119 123 180] ) ] spids: [47] ) spids: [42 46] ) (FuncDef name: first_stage_install body: (BraceGroup children: [ (C {(extract)} {($ VSub_Name "$required")}) (SimpleCommand words: [{(Lit_Other ":")}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$TARGET") (/var/lib/dpkg/status))} spids: [200] ) ] ) (SimpleCommand words: [{(echo)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$TARGET") (/var/lib/dpkg/available))} spids: [210] ) ] ) (C {(setup_etc)}) (SimpleCommand words: [{(echo)} {(SQ <"# UNCONFIGURED FSTAB FOR BASE SYSTEM">)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$TARGET") (/etc/fstab))} spids: [228] ) ] ) (Sentence child: (C {(chown)} {(0) (Lit_Other ":") (0)} {(DQ ($ VSub_Name "$TARGET") (/etc/fstab))}) terminator: ) (C {(chmod)} {(644)} {(DQ ($ VSub_Name "$TARGET") (/etc/fstab))}) (FuncDef name: x_feign_install body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:pkg) op: Equal rhs: {($ VSub_Number "$1")} spids: [269] ) ] spids: [267] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:deb) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(debfor)} {($ VSub_Name "$pkg")})] ) left_token: spids: [277 281] ) ) } spids: [275] ) ] spids: [273] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:ver) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(extract_deb_field)} {(DQ ($ VSub_Name "$TARGET") (/) ($ VSub_Name "$deb"))} {(Version)} ) ] ) left_token: spids: [289 299] ) ) } spids: [287] ) ] spids: [285] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$TARGET") (/var/lib/dpkg/info))}) (SimpleCommand words: [ {(echo)} { (DQ ("Package: ") ($ VSub_Name "$pkg") ("\n") ("Version: ") ($ VSub_Name "$ver") ("\n") ("Status: install ok installed") ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$TARGET") (/var/lib/dpkg/status))} spids: [327] ) ] ) (C {(touch)} {(DQ ($ VSub_Name "$TARGET") (/var/lib/dpkg/info/) (${ VSub_Name pkg) (.list))} ) ] spids: [264] ) spids: [259 263] ) (C {(setup_devices)}) (C {(x_feign_install)} {(dpkg)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-e)} {(DQ ($ VSub_Name "$TARGET") (/usr/bin/perl-5.005.dist))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(mv)} {(DQ ($ VSub_Name "$TARGET") (/usr/bin/perl-5.005.dist))} {(DQ ($ VSub_Name "$TARGET") (/usr/bin/perl-5.005))} ) ] spids: [-1 376] ) ] spids: [-1 392] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-e)} {(DQ ($ VSub_Name "$TARGET") (/usr/bin/perl))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(ln)} {(-sf)} {(perl-5.005)} {(DQ ($ VSub_Name "$TARGET") (/usr/bin/perl))}) ] spids: [-1 411] ) ] spids: [-1 426] ) ] spids: [190] ) spids: [185 189] ) (FuncDef name: second_stage_install body: (BraceGroup children: [ (FuncDef name: x_core_install body: (BraceGroup children: [ (C {(in_target)} {(dpkg)} {(--force-depends)} {(--install)} { (CommandSubPart command_list: (CommandList children: [(C {(debfor)} {(DQ ($ VSub_At "$@"))})] ) left_token: spids: [455 461] ) } ) ] spids: [444] ) spids: [439 443] ) (C {(export)} {(Lit_VarLike "DEBIAN_FRONTEND=") (Noninteractive)}) (C {(setup_proc)}) (C {(ln)} {(DQ ($ VSub_Name "$TARGET") (/sbin/ldconfig.new))} {(DQ ($ VSub_Name "$TARGET") (/sbin/ldconfig))} ) (C {(in_target)} {(/sbin/ldconfig)}) (C {(x_core_install)} {(base-files)} {(base-passwd)} {(ldso)}) (C {(x_core_install)} {(dpkg)}) (C {(ln)} {(-sf)} {(/usr/share/zoneinfo/UTC)} {(DQ ($ VSub_Name "$TARGET") (/etc/localtime))}) (C {(x_core_install)} {($ VSub_Name "$LIBC")}) (Pipeline children: [(C {(smallyes)} {(SQ )}) (C {(x_core_install)} {(perl-5.005-base)})] negated: False ) (C {(x_core_install)} {(mawk)}) (C {(x_core_install)} {(debconf-tiny)}) (C {(in_target)} {(dpkg-preconfigure)} { (CommandSubPart command_list: (CommandList children: [(C {(debfor)} {($ VSub_Name "$required")} {($ VSub_Name "$base")})] ) left_token: spids: [557 563] ) } ) (C {(repeatn)} {(5)} {(in_target)} {(dpkg)} {(--force-depends)} {(--unpack)} { (CommandSubPart command_list: (CommandList children:[(C {(debfor)} {($ VSub_Name "$required")})]) left_token: spids: [579 583] ) } ) (C {(mv)} {(DQ ($ VSub_Name "$TARGET") (/sbin/start-stop-daemon))} {(DQ ($ VSub_Name "$TARGET") (/sbin/start-stop-daemon.REAL))} ) (C {(cp)} {(DQ ($ VSub_Name "$TARGET") (/bin/true))} {(DQ ($ VSub_Name "$TARGET") (/sbin/start-stop-daemon))} ) (C {(setup_dselect_method)} {(apt)}) (C {(in_target)} {(dpkg)} {(--configure)} {(--pending)} {(--force-configure-any)} {(--force-depends)} ) (Pipeline children: [ (C {(smallyes)} {(SQ )}) (C {(repeatn)} {(5)} {(in_target)} {(dpkg)} {(--force-auto-select)} {(--force-overwrite)} {(--skip-same-version)} {(--install)} { (CommandSubPart command_list: (CommandList children:[(C {(debfor)} {($ VSub_Name "$base")})]) left_token: spids: [657 661] ) } ) ] negated: False ) (C {(mv)} {(DQ ($ VSub_Name "$TARGET") (/sbin/start-stop-daemon.REAL))} {(DQ ($ VSub_Name "$TARGET") (/sbin/start-stop-daemon))} ) ] spids: [436] ) spids: [431 435] ) ] )