Skip to content

Commit

Permalink
Continue boximg chain implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
alenz33 committed Apr 21, 2015
1 parent eeb696e commit 040bdf0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions etc/chains/frm2/boximg.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
(hd0,1) {steps.devmap.mapped[0]}
'''

APT_PREF_BACKPORT = '''
Package: *
Pin: release a={chain.distribution}-backports
Pin-Priority: 500
'''

POLICY_RC_D = '''
#!/bin/sh
echo "All runlevel operations denied by policy" >&2
exit 101
'''


# Short description which will be displayed on command line help.
description = 'This chain builds the image of FRM II\'s TACO/TANGO boxes.'
Expand Down Expand Up @@ -134,3 +146,19 @@
'--root-directory={steps.mount.mountpoint} '
'{steps.devmap.loopdev}')

steps.pinbp = Step('fs.WriteFile',
description='Pin backports to normal level',
path='{steps.mount.mountpoint}/etc/apt/preferences.d/backports',
content=APT_PREF_BACKPORT)

## INSERT HERE: old workaround: install taco first may be possible

steps.policy = Step('fs.WriteFile',
description='Forbid execution of init scripts on installation',
path='{steps.mount.mountpoint}/usr/sbin/policy-rc.d',
content=POLICY_RC_D)

steps.policyperm = Step('syscall.ChrootedSystemCall',
description='Enable policy-rc.d',
command='chmod +x /usr/sbin/policy-rc.d',
chrootdir='{steps.mount.mountpoint}')

0 comments on commit 040bdf0

Please sign in to comment.